text
stringlengths 2
1.04M
| meta
dict |
---|---|
package com.thoughtworks.go.util;
import org.apache.commons.codec.digest.DigestUtils;
import org.junit.jupiter.api.Test;
import java.io.ByteArrayInputStream;
import java.util.Random;
import static com.thoughtworks.go.util.CachedDigestUtils.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
public class CachedDigestUtilsTest {
@Test
public void shouldComputeForAGivenStringUsingSHA_512_256() {
String fingerprint = "Some String";
String digest = sha512_256Hex(fingerprint);
assertEquals(DigestUtils.sha512_256Hex(fingerprint), digest);
}
@Test
public void shouldComputeForAnEmptyStringUsingSHA_512_256() {
String fingerprint = "";
String digest = sha512_256Hex(fingerprint);
assertEquals(DigestUtils.sha512_256Hex(fingerprint), digest);
}
@Test
public void shouldComputeForAGivenStringUsingSHA_256() {
String fingerprint = "Some String";
String digest = sha256Hex(fingerprint);
assertEquals(DigestUtils.sha256Hex(fingerprint), digest);
}
@Test
public void shouldComputeForAnEmptyStringUsingSHA_256() {
String fingerprint = "";
String digest = sha256Hex(fingerprint);
assertEquals(DigestUtils.sha256Hex(fingerprint), digest);
}
@Test
public void shouldComputeForAGivenStringUsingMD5() {
String fingerprint = "Some String";
String digest = md5Hex(fingerprint);
assertEquals(DigestUtils.md5Hex(fingerprint), digest);
}
@Test
public void shouldComputeForAnEmptyStringUsingMD5() {
String fingerprint = "";
String digest = md5Hex(fingerprint);
assertEquals(DigestUtils.md5Hex(fingerprint), digest);
}
@Test
public void shouldComputeForAGivenStreamUsingMD5() {
byte[] testData = new byte[1024 * 1024];
new Random().nextBytes(testData);
assertEquals(DigestUtils.md5Hex(testData), md5Hex(new ByteArrayInputStream(testData)));
}
}
| {
"content_hash": "22b3d09c4f58d45aa388e682156007e1",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 95,
"avg_line_length": 32.225806451612904,
"alnum_prop": 0.7017017017017017,
"repo_name": "GaneshSPatil/gocd",
"id": "625e08e358c1a5c7c01cbc72ebe9b2ab0e999444",
"size": "2599",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "config/config-api/src/test/java/com/thoughtworks/go/util/CachedDigestUtilsTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "466"
},
{
"name": "CSS",
"bytes": "1578"
},
{
"name": "EJS",
"bytes": "1626"
},
{
"name": "FreeMarker",
"bytes": "10183"
},
{
"name": "Groovy",
"bytes": "2467987"
},
{
"name": "HTML",
"bytes": "330937"
},
{
"name": "Java",
"bytes": "21404638"
},
{
"name": "JavaScript",
"bytes": "2331039"
},
{
"name": "NSIS",
"bytes": "23525"
},
{
"name": "PowerShell",
"bytes": "664"
},
{
"name": "Ruby",
"bytes": "623850"
},
{
"name": "SCSS",
"bytes": "820788"
},
{
"name": "Sass",
"bytes": "21277"
},
{
"name": "Shell",
"bytes": "169730"
},
{
"name": "TypeScript",
"bytes": "4428865"
},
{
"name": "XSLT",
"bytes": "207072"
}
],
"symlink_target": ""
} |
package com.bt.openlink.type;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.Matchers.contains;
import static org.junit.Assert.assertThat;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import com.bt.openlink.CoreFixtures;
@SuppressWarnings("ConstantConditions")
public class ProfileTest {
private static final Site SITE = Site.Builder.start()
.setDefault(true)
.setId(42)
.setType(Site.Type.CISCO)
.setName("test-site-name")
.build();
@Rule public final ExpectedException expectedException = ExpectedException.none();
@Test
public void willCreateAProfile() {
final ProfileId profileId = ProfileId.from("test-profile-id").orElseThrow(IllegalArgumentException::new);
final Profile profile = Profile.Builder.start()
.setSite(SITE)
.setId(profileId)
.setDefault(true)
.setDeviceType(CoreFixtures.DEVICE_TYPE)
.setDeviceId(CoreFixtures.DEVICE_ID)
.setLabel("test-label")
.addAction(RequestAction.ANSWER_CALL)
.setOnline(true)
.build();
assertThat(profile.getSite().get(), is(SITE));
assertThat(profile.getId().get(), is(profileId));
assertThat(profile.isDefaultProfile().get(), is(true));
assertThat(profile.getDeviceType().get(), is(CoreFixtures.DEVICE_TYPE));
assertThat(profile.getDeviceId().get(), is(CoreFixtures.DEVICE_ID));
assertThat(profile.getLabel().get(), is("test-label"));
assertThat(profile.isOnline().get(), is(true));
assertThat(profile.getActions().size(), is(1));
assertThat(profile.getActions().get(0), is(RequestAction.ANSWER_CALL));
}
@Test
public void willNotCreateAProfileWithoutASite() {
expectedException.expect(IllegalStateException.class);
expectedException.expectMessage("The site has not been set");
Profile.Builder.start()
.setId(ProfileId.from("test-profile-id").orElseThrow(IllegalArgumentException::new))
.build();
}
@Test
public void willNotCreateAProfileWithoutAProfileId() {
expectedException.expect(IllegalStateException.class);
expectedException.expectMessage("The profile id has not been set");
Profile.Builder.start()
.setSite(SITE)
.build();
}
@Test
public void willNotCreateAProfileWithoutADefaultIndicator() {
expectedException.expect(IllegalStateException.class);
expectedException.expectMessage("The default indicator has not been set");
Profile.Builder.start()
.setSite(SITE)
.setId(ProfileId.from("test-profile-id").orElseThrow(IllegalArgumentException::new))
.build();
}
@Test
public void willNotCreateAProfileWithoutALabel() {
expectedException.expect(IllegalStateException.class);
expectedException.expectMessage("The label has not been set");
Profile.Builder.start()
.setSite(SITE)
.setId(ProfileId.from("test-profile-id").orElseThrow(IllegalArgumentException::new))
.setDefault(false)
.build();
}
@Test
public void willNotCreateAProfileWithoutAnOnlineIndicator() {
expectedException.expect(IllegalStateException.class);
expectedException.expectMessage("The online indicator has not been set");
Profile.Builder.start()
.setSite(SITE)
.setId(ProfileId.from("test-profile-id").orElseThrow(IllegalArgumentException::new))
.setDefault(false)
.setLabel("test-label")
.build();
}
@Test
public void willCreateAProfileWithoutMandatoryFields() {
final List<String> errors = new ArrayList<>();
final Profile profile = Profile.Builder.start()
.build(errors);
assertThat(profile.getSite(), is(Optional.empty()));
assertThat(profile.getId(), is(Optional.empty()));
assertThat(profile.isDefaultProfile(), is(Optional.empty()));
assertThat(profile.getDeviceType(), is(Optional.empty()));
assertThat(profile.getDeviceId(), is(Optional.empty()));
assertThat(profile.getLabel(), is(Optional.empty()));
assertThat(profile.isOnline(), is(Optional.empty()));
assertThat(errors, contains(
"Invalid profile; missing profile id is mandatory",
"Invalid profile; missing site is mandatory",
"Invalid profile; missing default indicator is mandatory",
"Invalid profile; missing label is mandatory",
"Invalid profile; missing online indicator is mandatory"));
}
} | {
"content_hash": "e8dc9f21ebb7ee81c478e596aa1dee84",
"timestamp": "",
"source": "github",
"line_count": 137,
"max_line_length": 113,
"avg_line_length": 36.416058394160586,
"alnum_prop": 0.638404489877731,
"repo_name": "BT-OpenSource/bt-openlink-java",
"id": "06612450112577e78d0754fc4705b33a9cbd4ff5",
"size": "4989",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "openlink-core/src/test/java/com/bt/openlink/type/ProfileTest.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "1115000"
}
],
"symlink_target": ""
} |
"""
**Features:**
- Validates whether the property_name allows a color property to be set.
- Decodes the following color formats: hexidecimal, rgb, rgba, hsl, hsla.
Exception: English color names are handled separately
| **Either** in the property_alias_dict under the key ``color``,
| **Or** they are passed through to cssutils because they are valid CSS and do not require further processing.
**Note:** The shorthand properties ``background``, ``border``, and ``outline`` are supported (as of November 2015).
**Assumption:** It is assumed that all dashes are removed from the input ``value`` prior to using this parser.
**Example:**
>>> color_parser = ColorParser('border-color', 'h0df48a')
>>> color_parser.property_name_allows_color()
True
"""
# python 2
from __future__ import absolute_import
# builtins
from re import findall
# custom
from blowdrycss.utilities import contains_a_digit
from blowdrycss.datalibrary import property_regex_dict
__author__ = 'chad nelson'
__project__ = 'blowdrycss'
class ColorParser(object):
""" Extracts plain text, hexidecimal, rgb, rgba, hsl, and hsla color codes from encoded class selectors.
"""
def __init__(self, property_name='', value=''):
self.color_regexes = property_regex_dict['color']
self.property_name = property_name
self.value = value
def property_name_allows_color(self):
""" Detects if the ``property_name`` allows a color property value.
**Reference:** http://www.w3.org/TR/CSS21/propidx.html
:return: (bool) -- Returns True if the ``property_name`` is allow to contain colors. Otherwise, it returns
False.
**Examples:**
>>> color_parser = ColorParser('border-color', 'h0df48a')
>>> color_parser.property_name_allows_color()
True
>>> color_parser.property_name = 'invalid'
>>> color_parser.property_name_allows_color()
False
"""
color_property_names = {
'color', 'background-color', 'border', 'border-color', 'border-top-color', 'border-right-color',
'border-bottom-color', 'border-left-color', 'outline', 'outline_color',
'background', 'border-top', 'border-right', 'border-bottom', 'border-left',
'text-shadow',
}
for color_property_name in color_property_names:
if self.property_name == color_property_name:
return True
return False
def find_h_index(self, value=''):
""" Detects if the ``value`` is a valid hexidecimal encoding.
**Note:** Supports shorthand properties.
:type value: str
:param value: Expects a ``value`` of the form: h0ff48f or hfaf i.e. 'h' + a 3 or 6 digit hexidecimal value 0-f.
:return: (int or NoneType) -- Returns the index of the ``h`` to be replaced in the ``value`` if it matches
the hex regex. Otherwise it returns None.
**Examples:**
>>> color_parser = ColorParser()
>>> color_parser.find_h_index(value='h0df48a')
0
>>> color_parser.find_h_index(value='h1invalid')
None
"""
for regex in self.color_regexes:
matches = findall(regex, value)
if len(matches) == 1:
h_index = value.index(matches[0])
return h_index
return None
def replace_h_with_hash(self, value=''):
""" Replaces the prepended ``h`` prefix with a hash sign ``#`` or octothorpe if you prefer long words.
| Includes an internal check to ensure that the value is a valid hexidecimal encoding.
| Only replaces the ``h`` that matches the regex as other ``h`` characters may be present.
| **Shorthand properties are supported:**
| **border case:** ``1px solid hddd`` becomes ``1px solid #ddd``
:param value: Encoded hexidecimal value of the form ``hf1f`` or ``hc2c2c2``.
:return: (str) -- Returns actually #0ff48f and #faf in the valid case. Returns the input ``value`` unchanged
for the invalid case.
>>> color_parser = ColorParser()
>>> # Valid Cases
>>> color_parser.replace_h_with_hash('h0ff24f')
#0ff24f
>>> color_parser.replace_h_with_hash('hf4f')
#f4f
>>> # Valid multiple 'h' case.
>>> color_parser.replace_h_with_hash('13px dashed hd0d')
13px dashed #d0d
>>> # Invalid Cases
>>> color_parser.replace_h_with_hash('bold')
bold
>>> color_parser.replace_h_with_hash('he2z')
he2z
"""
if self.property_name_allows_color():
h_index = self.find_h_index(value=value) # Only this 'h' will be replaced.
if h_index is not None:
value = value[0:h_index] + '#' + value[h_index + 1:]
return value
def add_color_parenthetical(self, value=''):
""" Convert parenthetical color values: rbg, rbga, hsl, hsla to valid css format
Assumes that color conversion happens after dashes, decimal point, negative signs, and percentage signs
are converted.
**Note:** Currently not compatible with shorthand properties.
:type value: str
:param value: Space delimited rbg, rbga, hsl, hsla values.
:return: (str) -- Returns the valid css color parenthetical. Returns the input ``value`` unchanged
for the non-matching case.
**Examples:**
>>> color_parser = ColorParser('color', '')
>>> color_parser.add_color_parenthetical('rgb 0 255 0')
rgb(0, 255, 0)
>>> color_parser.add_color_parenthetical('rgba 255 0 0 0.5')
rgba(255, 0, 0, 0.5)
>>> color_parser.add_color_parenthetical('hsl 120 60% 70%')
hsl(120, 60%, 70%)
>>> color_parser.add_color_parenthetical('hsla 120 60% 70% 0.3')
hsla(120, 60%, 70%, 0.3)
>>> # Pass-through case as no conversion is possible.
>>> color_parser.add_color_parenthetical('hsla')
hsla
"""
if self.property_name_allows_color():
if contains_a_digit(string=value):
keywords = {'rgb ', 'rgba ', 'hsl ', 'hsla '}
for key in keywords:
if value.startswith(key):
value = value.replace(key, key.strip() + '(') # Remove key whitespace and add opening '('
value += ')' # Add closing ')'
value = value.replace(' ', ', ') # Add commas ', '
break
return value
| {
"content_hash": "91f86f356884a52d541ede34bfab67fd",
"timestamp": "",
"source": "github",
"line_count": 175,
"max_line_length": 119,
"avg_line_length": 37.96,
"alnum_prop": 0.588438958301972,
"repo_name": "nueverest/BlowDryCSS",
"id": "2e73c03f3d47cd47a724927ff26186814b388bea",
"size": "6643",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "blowdrycss/colorparser.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "3689"
},
{
"name": "CSS",
"bytes": "1378"
},
{
"name": "HTML",
"bytes": "17637"
},
{
"name": "JavaScript",
"bytes": "10569"
},
{
"name": "Python",
"bytes": "399730"
}
],
"symlink_target": ""
} |
Cufon.replace('#menu a, footer, h2, .button1, .date, .tabs .nav li a', { fontFamily: 'Ubuntu', hover:true });
| {
"content_hash": "d5aae0931a71aa52c37b9bcc98873fb5",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 109,
"avg_line_length": 55.5,
"alnum_prop": 0.6396396396396397,
"repo_name": "jimufan/jimufan.github.io",
"id": "222c294579e3bebcef4e1df0a2e343fa4a83040c",
"size": "111",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "cufon-replace.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "37566"
},
{
"name": "JavaScript",
"bytes": "224689"
}
],
"symlink_target": ""
} |
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = _build
# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " devhelp to make HTML files and a Devhelp project"
@echo " epub to make an epub"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdf to make LaTeX files and run them through pdflatex"
@echo " text to make text files"
@echo " man to make manual pages"
@echo " texinfo to make Texinfo files"
@echo " info to make Texinfo files and run them through makeinfo"
@echo " gettext to make PO message catalogs"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
clean:
-rm -rf $(BUILDDIR)/*
html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
dirhtml:
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
singlehtml:
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
pickle:
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
@echo
@echo "Build finished; now you can process the pickle files."
json:
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
@echo
@echo "Build finished; now you can process the JSON files."
htmlhelp:
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in $(BUILDDIR)/htmlhelp."
qthelp:
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/StoryBase.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/StoryBase.qhc"
devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/StoryBase"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/StoryBase"
@echo "# devhelp"
epub:
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
latex:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
@echo "Run \`make' in that directory to run these through (pdf)latex" \
"(use \`make latexpdf' here to do that automatically)."
latexpdf:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through pdflatex..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
text:
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
@echo
@echo "Build finished. The text files are in $(BUILDDIR)/text."
man:
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
@echo
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
texinfo:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
@echo "Run \`make' in that directory to run these through makeinfo" \
"(use \`make info' here to do that automatically)."
info:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo "Running Texinfo files through makeinfo..."
make -C $(BUILDDIR)/texinfo info
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
gettext:
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
@echo
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
changes:
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
@echo
@echo "The overview file is in $(BUILDDIR)/changes."
linkcheck:
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/output.txt."
doctest:
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."
| {
"content_hash": "45305f4b0582857e47d6f143784b305a",
"timestamp": "",
"source": "github",
"line_count": 149,
"max_line_length": 141,
"avg_line_length": 36.80536912751678,
"alnum_prop": 0.7018599562363238,
"repo_name": "denverfoundation/storybase",
"id": "0956c93dcbae30e937d19cb475c67c4cb8cd5509",
"size": "5576",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "docs/Makefile",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "285649"
},
{
"name": "Cucumber",
"bytes": "176820"
},
{
"name": "HTML",
"bytes": "286197"
},
{
"name": "JavaScript",
"bytes": "1623541"
},
{
"name": "Makefile",
"bytes": "1006"
},
{
"name": "Python",
"bytes": "3020016"
},
{
"name": "Shell",
"bytes": "23932"
}
],
"symlink_target": ""
} |
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>
angular-meditor: Simple floating text editor for Angular, inspired by Medium
</title>
<meta name="description" content="Simple floating text editor for Angular, inspired by Medium.">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="//fonts.googleapis.com/css?family=Open+Sans:400,700" rel="stylesheet" type="text/css">
<link href="//cdnjs.cloudflare.com/ajax/libs/foundation/5.2.2/css/foundation.min.css" rel="stylesheet" type="text/css">
<link href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.0.3/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<!-- build:css({.tmp,app}) styles/meditor.css -->
<!-- inject:css -->
<link rel="stylesheet" href="styles/demo.css">
<link rel="stylesheet" href="styles/meditor.css">
<!-- endinject -->
<!-- endbuild -->
</head>
<body ng-app="meditorDemo" ng-controller="MainCtrl">
<!--[if lt IE 9]>
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
<![endif]-->
<header class="row">
<div class="large-12 columns text-center">
<a href="https://github.com/ghinda/angular-meditor" class="button radius right">
<i class="fa fa-github"></i>
GitHub
</a>
<h1>angular-meditor</h1>
</div>
</header>
<!-- directive: text-meditor 1-->
<section class="row">
<ng-editor ng-model="arrayModel" placeholder="Type here"></ng-editor>
</section>
<section>
</section>
<footer class="row">
<div class="large-7 columns">
<p>
<a href="http://ghinda.net/angular-meditor" class="copy">angular-meditor</a> is asd a project by <a href="http://ghinda.net">Ionuț Colceriu</a>.
</p>
</div>
</footer>
<!-- build:js scripts/plugins.js -->
<script src="bower_components/angular/angular.js"></script>
<script src="bower_components/angular-route/angular-route.js"></script>
<!-- endbuild -->
<!-- build:js({.tmp,app}) scripts/demo.js -->
<script src="scripts/demo.js"></script>
<!-- endbuild -->
<!-- build:js({.tmp,app}) scripts/text-ngEditor.js -->
<!-- inject:js -->
<script src="modules/ngEditor/angular/ngEditor.js"></script>
<script src="modules/ngEditor/utils/selection.js"></script>
<script src="modules/ngEditor/angular/directives/ngEditor.js"></script>
<script src="modules/ngEditor/angular/directives/ngEditorToolbar.js"></script>
<script src="modules/ngEditor/angular/services/toolbarDelegate.js"></script>
<!-- endinject -->
<!-- endbuild -->
</body>
</html>
| {
"content_hash": "45ea7f57b4758b54ee9f83db43cffcf1",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 176,
"avg_line_length": 32.373493975903614,
"alnum_prop": 0.6538890956457015,
"repo_name": "marduke182/editor",
"id": "f05df7b0f64922a51de9a8d62951becbb14a9201",
"size": "2688",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/index.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "11677"
},
{
"name": "HTML",
"bytes": "3462"
},
{
"name": "JavaScript",
"bytes": "15575"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
android:id="@+id/turns"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="@dimen/panel_width"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:padding="@dimen/routing_turns_padding">
<FrameLayout
android:id="@+id/turn"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<com.mapswithme.maps.widget.ArrowView
android:id="@+id/iv__turn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:src="@drawable/ic_round"/>
<TextView
android:id="@+id/tv__exit_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:textAppearance="@style/MwmTextAppearance.Title"
android:textColor="@color/routing_blue"
android:visibility="gone"
tools:text="2"
tools:visibility="visible"/>
</FrameLayout>
<TextView
android:id="@+id/tv__turn_distance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/margin_base"
android:layout_toRightOf="@+id/turn"
android:textAppearance="@style/MwmTextAppearance.Display1.Plus"
android:textColor="@color/routing_blue"
tools:text="300 m"/>
<TextView
android:id="@+id/tv__next_street"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@id/tv__turn_distance"
android:layout_below="@id/tv__turn_distance"
android:maxLines="2"
android:textAppearance="@style/MwmTextAppearance.Body2"
android:textSize="@dimen/text_size_title"
tools:text="Oxford str."
tools:visibility="visible"/>
</RelativeLayout> | {
"content_hash": "bbd8659f39b2b51498c0802b627a486e",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 67,
"avg_line_length": 34.27272727272727,
"alnum_prop": 0.6970822281167108,
"repo_name": "AlexanderMatveenko/omim",
"id": "a88d1334ddf0faa127f68281a426af3ae56622eb",
"size": "1885",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "android/res/layout/layout_turn_and_street.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Awk",
"bytes": "3962"
},
{
"name": "Batchfile",
"bytes": "9246"
},
{
"name": "C",
"bytes": "11720853"
},
{
"name": "C++",
"bytes": "126895730"
},
{
"name": "CMake",
"bytes": "120618"
},
{
"name": "CSS",
"bytes": "19655"
},
{
"name": "Cucumber",
"bytes": "305230"
},
{
"name": "DIGITAL Command Language",
"bytes": "36710"
},
{
"name": "Emacs Lisp",
"bytes": "7798"
},
{
"name": "Groff",
"bytes": "78550"
},
{
"name": "HTML",
"bytes": "9396727"
},
{
"name": "IDL",
"bytes": "5307"
},
{
"name": "Inno Setup",
"bytes": "4337"
},
{
"name": "Java",
"bytes": "2342941"
},
{
"name": "JavaScript",
"bytes": "3265"
},
{
"name": "Lua",
"bytes": "57500"
},
{
"name": "Makefile",
"bytes": "233284"
},
{
"name": "Module Management System",
"bytes": "2080"
},
{
"name": "Objective-C",
"bytes": "678970"
},
{
"name": "Objective-C++",
"bytes": "746733"
},
{
"name": "PHP",
"bytes": "2841"
},
{
"name": "Perl",
"bytes": "25886"
},
{
"name": "PowerShell",
"bytes": "1885"
},
{
"name": "Protocol Buffer",
"bytes": "439756"
},
{
"name": "Python",
"bytes": "1109044"
},
{
"name": "QMake",
"bytes": "75327"
},
{
"name": "Ruby",
"bytes": "59753"
},
{
"name": "Shell",
"bytes": "2282201"
},
{
"name": "TeX",
"bytes": "311877"
},
{
"name": "VimL",
"bytes": "3744"
}
],
"symlink_target": ""
} |
import unittest
from .dsl import DslTestCase
from .coordination import CoordinationTestCase
from .expect import ExpectTestCase
from .patch import PatchTestCase
def all_tests():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(DslTestCase))
suite.addTest(unittest.makeSuite(CoordinationTestCase))
suite.addTest(unittest.makeSuite(ExpectTestCase))
suite.addTest(unittest.makeSuite(PatchTestCase))
return suite
| {
"content_hash": "94a6660e1dd1a0aa655db854aee28509",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 59,
"avg_line_length": 29.866666666666667,
"alnum_prop": 0.7946428571428571,
"repo_name": "drslump/pyshould",
"id": "29649b70aa326e3157786e3ebd215de0ebabff61",
"size": "448",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tests/__init__.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Makefile",
"bytes": "414"
},
{
"name": "Python",
"bytes": "71568"
}
],
"symlink_target": ""
} |
<html><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>Filibuster</title> <link rel="stylesheet" href="styles.css">
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro" rel="stylesheet">
<body><h1>Results for "names_first_British_scientist"</h1>
<p><a href="index.html">Index</a></p>
<p class="blurb">Kevin</p>
<p class="blurb">Thomas</p>
<p class="blurb">Henry</p>
<p class="blurb">Abraham</p>
<p class="blurb">Morris</p>
<p class="blurb">Otto</p>
<p class="blurb">Edward</p>
<p class="blurb">Thomas</p>
<p class="blurb">Illtyd</p>
<p class="blurb">Morris</p>
<p class="blurb">Abraham</p>
<p class="blurb">Kevin</p>
<p class="blurb">Edward</p>
<p class="blurb">Kevin</p>
<p class="blurb">Edward</p>
<p class="blurb">Edward</p>
<p class="blurb">Jeremy</p>
<p class="blurb">Thomas</p>
<p class="blurb">Edward</p>
<p class="blurb">Thomas</p>
</body></html> | {
"content_hash": "460ab7ecfa33d4c4e539164839d4eea7",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 140,
"avg_line_length": 35.8,
"alnum_prop": 0.6703910614525139,
"repo_name": "LettError/filibuster",
"id": "4bb606df697df83b7bdd1f20b8c073b713a7b2c2",
"size": "895",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/names_first_British_scientist.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "388788"
}
],
"symlink_target": ""
} |
package org.teavm.classlib.java.security;
// Note: this class is left empty on purpose -
// functionality is intended to be added as need arises
public final class TAccessControlContext {
}
| {
"content_hash": "d03ecd64015e6bd1cb573186e5dca4c8",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 56,
"avg_line_length": 24.25,
"alnum_prop": 0.7680412371134021,
"repo_name": "konsoletyper/teavm",
"id": "a74bbf5ce9c43b281f79377a80ff52d1f94fe9a1",
"size": "806",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "classlib/src/main/java/org/teavm/classlib/java/security/TAccessControlContext.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "146734"
},
{
"name": "CSS",
"bytes": "1533"
},
{
"name": "HTML",
"bytes": "27508"
},
{
"name": "Java",
"bytes": "14562907"
},
{
"name": "JavaScript",
"bytes": "86216"
},
{
"name": "Shell",
"bytes": "6477"
}
],
"symlink_target": ""
} |
.class Lcom/android/server/search/SearchManagerService$Lifecycle$1;
.super Ljava/lang/Object;
.source "SearchManagerService.java"
# interfaces
.implements Ljava/lang/Runnable;
# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
value = Lcom/android/server/search/SearchManagerService$Lifecycle;->onUnlockUser(I)V
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x0
name = null
.end annotation
# instance fields
.field final synthetic this$1:Lcom/android/server/search/SearchManagerService$Lifecycle;
.field final synthetic val$userId:I
# direct methods
.method constructor <init>(Lcom/android/server/search/SearchManagerService$Lifecycle;I)V
.locals 0
iput-object p1, p0, Lcom/android/server/search/SearchManagerService$Lifecycle$1;->this$1:Lcom/android/server/search/SearchManagerService$Lifecycle;
iput p2, p0, Lcom/android/server/search/SearchManagerService$Lifecycle$1;->val$userId:I
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
# virtual methods
.method public run()V
.locals 2
iget-object v0, p0, Lcom/android/server/search/SearchManagerService$Lifecycle$1;->this$1:Lcom/android/server/search/SearchManagerService$Lifecycle;
invoke-static {v0}, Lcom/android/server/search/SearchManagerService$Lifecycle;->-get0(Lcom/android/server/search/SearchManagerService$Lifecycle;)Lcom/android/server/search/SearchManagerService;
move-result-object v0
iget v1, p0, Lcom/android/server/search/SearchManagerService$Lifecycle$1;->val$userId:I
invoke-static {v0, v1}, Lcom/android/server/search/SearchManagerService;->-wrap1(Lcom/android/server/search/SearchManagerService;I)V
return-void
.end method
| {
"content_hash": "e4534be47f483ee4a8efa3fc0ecf8ee1",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 197,
"avg_line_length": 31.836363636363636,
"alnum_prop": 0.7829811536264991,
"repo_name": "BatMan-Rom/ModdedFiles",
"id": "b31e84d7326091258c4b162611a9d05236cc8bcb",
"size": "1751",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "services.jar.out/smali/com/android/server/search/SearchManagerService$Lifecycle$1.smali",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "GLSL",
"bytes": "15069"
},
{
"name": "HTML",
"bytes": "139176"
},
{
"name": "Smali",
"bytes": "541934400"
}
],
"symlink_target": ""
} |
/**
*
*/
package com.fuhj.itower.ui;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Properties;
import com.fuhj.log.AppLogger;
import com.fuhj.util.SpringUtil;
/**
* @Description: TODO
* @author fu
* @date 2016-3-19
*/
public class MyProperties {
public static final String COOKIEFILE = SpringUtil.getWebAppPath() + "WEB-INF" + File.separator + "cookie.properties";
public static synchronized String getValueByKey(String filePath, String key) {
Properties pps = new Properties();
try {
File f = new File(filePath);
if (!f.exists())
return null;
InputStream in = new BufferedInputStream(new FileInputStream(filePath));
pps.load(in);
String value = pps.getProperty(key);
// AppLogger.sysDebug("getValueByKey:" + key + " = " + value);
in.close();
return value;
} catch (IOException e) {
e.printStackTrace();
return null;
}
}
// 写入Properties信息
public static synchronized void writeProperties(String filePath, String pKey, String pValue) throws IOException {
AppLogger.sysDebug("writeProperties:" + filePath + " " + pKey + " = " + pValue);
Properties pps = new Properties();
File f = new File(filePath);
if (!f.exists())
f.createNewFile();
InputStream in = new FileInputStream(filePath);
// 从输入流中读取属性列表(键和元素对)
pps.load(in);
// 调用 Hashtable 的方法 put。使用 getProperty 方法提供并行性。
// 强制要求为属性的键和值使用字符串。返回值是 Hashtable 调用 put 的结果。
OutputStream out = new FileOutputStream(filePath);
pps.setProperty(pKey, pValue);
// 以适合使用 load 方法加载到 Properties 表中的格式,
// 将此 Properties 表中的属性列表(键和元素对)写入输出流
pps.store(out, "Update " + pKey);
out.close();
in.close();
}
}
| {
"content_hash": "92eacf4f3ac1a766e9d56c8aef21742c",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 119,
"avg_line_length": 28.37878787878788,
"alnum_prop": 0.6812600106780566,
"repo_name": "fhj7627406/itowerElec",
"id": "9949089ad7657ddf5420572746c719caa57d94e3",
"size": "2077",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/com/fuhj/itower/ui/MyProperties.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "186202"
},
{
"name": "HTML",
"bytes": "6625"
},
{
"name": "Java",
"bytes": "1262093"
},
{
"name": "JavaScript",
"bytes": "27414"
}
],
"symlink_target": ""
} |
import { Component, ContentChild, ElementRef, EventEmitter, forwardRef, HostListener, Input, Output, SimpleChange } from '@angular/core';
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from "@angular/forms";
import { coerceBooleanProperty } from '@angular/material/core/coercion/boolean-property';
import { Observable, Subscription } from 'rxjs/Rx';
import { clearTimeout, setTimeout } from 'timers';
import { Position, Rect } from '../../common/core/graphics';
import { DejaTileSelectionChangedEvent, IDejaTile, IDejaTileEvent, IDejaTileList } from './index';
import { DejaTilesLayoutProvider } from './tiles-layout.provider';
const noop = () => { };
const DejaTilesComponentValueAccessor = {
multi: true,
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => DejaTilesComponent),
};
@Component({
providers: [
DejaTilesComponentValueAccessor,
],
selector: 'deja-tiles',
styleUrls: [
'./tiles.component.scss',
],
templateUrl: './tiles.component.html',
})
export class DejaTilesComponent implements ControlValueAccessor {
@Input() public maxwidth = '100%';
@Input() public maxheight: string;
@Input() public tileminwidth = '10%';
@Input() public tilemaxwidth = '100%';
@Input() public tileminheight = '10%';
@Input() public tilemaxheight = '100%';
@Output() public tileTitleEditClick = new EventEmitter();
@Output() public selectionChanged = new EventEmitter();
@ContentChild('tileTemplate') public tileTemplate;
private tiles = [] as IDejaTileList;
private dragInfos: IDejaTileDragDropInfos;
private dragging = false;
private onTouchedCallback: () => void = noop;
private onChangeCallback: (_: any) => void = noop;
private _selectedTiles: IDejaTile[];
private _layoutProvider: DejaTilesLayoutProvider;
private width: number;
private height: number;
private cursor: string;
private pressedTile: IDejaTile;
private _designMode = false;
private mouseMoveObs: Subscription;
private mouseUpObs: Subscription;
private globalMouseMoveObs: Subscription;
private globalMouseUpObs: Subscription;
private globalKeyUpObs: Subscription;
private dragSelection: {
pageOffset: Position,
tilesOffset: Position,
tilesRect: Rect,
};
constructor(private el: ElementRef) {
}
@Input()
set designMode(value: boolean) {
this._designMode = coerceBooleanProperty(value);
this.mouseMove = this._designMode;
if (this._designMode) {
this.globalMouseMove = false;
} else {
// Ensure no resizing cursor in readonly mode
this.cursor = null;
}
}
get designMode() {
return this._designMode;
}
public get selectedTiles() {
return this._selectedTiles;
}
public set selectedTiles(selectedTiles: IDejaTile[]) {
let event = {} as DejaTileSelectionChangedEvent;
event.selectedTiles = selectedTiles;
this.selectionChanged.emit(event);
this._selectedTiles = selectedTiles;
}
private get layoutProvider() {
if (!this._layoutProvider) {
this._layoutProvider = new DejaTilesLayoutProvider(this.el.nativeElement, this.maxwidth, this.maxheight, this.tileminwidth, this.tilemaxwidth, this.tileminheight, this.tilemaxheight, (width, height) => {
this.width = width;
this.height = height;
});
}
return this._layoutProvider;
}
// ************* ControlValueAccessor Implementation **************
// get accessor
get value(): any {
return this.tiles;
}
// set accessor including call the onchange callback
set value(v: any) {
this.writeValue(v);
this.onChangeCallback(v);
}
// From ControlValueAccessor interface
public writeValue(value: any) {
this.tiles = value;
if (this.tiles) {
this.ensureIds();
this.layoutProvider.refreshTiles(this.tiles, this.el.nativeElement.clientWidth);
} else {
this.tiles = [];
}
}
// From ControlValueAccessor interface
public registerOnChange(fn: any) {
this.onChangeCallback = fn;
}
// From ControlValueAccessor interface
public registerOnTouched(fn: any) {
this.onTouchedCallback = fn;
}
// ************* End of ControlValueAccessor Implementation **************
public removeTile(tile: IDejaTile) {
let index = this.tiles.indexOf(tile);
this.tiles.splice(index, 1);
this.onChangeCallback(this.tiles);
}
public ensureVisible(tile: IDejaTile) {
let target = this.el.nativeElement as HTMLElement;
let scrollElement = (target.ownerDocument as any).scrollingElement;
if (tile) {
let left = tile.l;
let right = tile.r;
let top = tile.t;
let bottom = tile.b;
while (target && target.tagName !== 'BODY') {
left += target.offsetLeft;
right += target.offsetLeft;
top += target.offsetTop;
bottom += target.offsetTop;
target = target.offsetParent as HTMLElement;
}
if (left < scrollElement.scrollLeft) {
scrollElement.scrollLeft = left;
} else if (right > scrollElement.scrollLeft + scrollElement.clientWidth) {
scrollElement.scrollLeft = right;
}
if (top < scrollElement.scrollTop) {
scrollElement.scrollTop = top;
} else if (bottom > scrollElement.scrollTop + scrollElement.clientHeight) {
scrollElement.scrollTop = bottom;
}
}
}
public expandTile(tile: IDejaTile, pixelheight: number) {
this.layoutProvider.expandTile(tile, pixelheight);
}
public cancelExpand() {
this.layoutProvider.cancelExpand();
}
public refresh() {
if (this.tiles) {
this.ensureIds();
this.layoutProvider.refreshTiles(this.tiles, this.el.nativeElement.clientWidth);
}
}
public getFreePlace(pageX: number, pageY: number, width: number, height: number) {
if (!this.tiles || this.tiles.length === 0) {
return new Rect(0, 0, width, height);
}
// Check if we drag on a tile
let containerElement = this.el.nativeElement as HTMLElement;
let containerBounds = containerElement.getBoundingClientRect();
pageX -= containerBounds.left;
pageY -= containerBounds.top;
let minSize = this.layoutProvider.getTileMinPixelSize();
let tile = this.layoutProvider.HitTest(this.tiles, new Rect(pageX, pageY, minSize.width, minSize.height));
}
protected ngOnChanges(changes: { [propKey: string]: SimpleChange }) {
for (let propName in changes) {
if (propName === 'designMode') {
this.tiles && this.tiles.filter((t) => t.selected).forEach((t) => t.selected = false);
this.selectedTiles = [];
}
}
}
protected ngAfterViewInit() {
Observable.fromEvent(window, 'resize').subscribe((event: Event) => {
this.refresh();
});
}
protected onTitleEditClicked(e: Event, tile: IDejaTile) {
let event = e as IDejaTileEvent;
event.tile = tile;
this.tileTitleEditClick.emit(event);
}
protected onDragStart(event: Event) {
// Disallow HTML drag and drop in design mode
return !this.designMode;
}
@HostListener('mousedown', ['$event'])
protected onMouseDown(event: MouseEvent) {
if (event.buttons === 1 && this.tiles) {
let target = event.target as HTMLElement;
this.pressedTile = this.getTileFromHTMLElement(target);
this.mouseUp = this.pressedTile !== undefined;
if (this.designMode) {
if (this.pressedTile) {
if (event.ctrlKey) {
// Multi-selection is available in design mode, selection on the mouse up
} else {
let selectedTiles = this.tiles.filter((t) => t.selected);
if (!this.pressedTile.selected || this.cursor !== 'move') {
selectedTiles.forEach((t) => t.selected = false);
this.pressedTile.selected = true;
selectedTiles = [this.pressedTile];
}
let containerElement = this.el.nativeElement as HTMLElement;
let containerBounds = containerElement.getBoundingClientRect();
let pageX = event.pageX - containerBounds.left;
let pageY = event.pageY - containerBounds.top;
this.dragInfos = {
cursor: this.cursor,
enabled: false,
offsetX: event.offsetX,
offsetY: event.offsetY,
startX: pageX,
startY: pageY,
tiles: selectedTiles,
};
this.globalMouseUp = true;
this.selectedTiles = selectedTiles;
return true; // Continue in case of drag and drop
}
} else if (target === this.el.nativeElement || target.parentNode === this.el.nativeElement) {
// Start drag selection
let containerElement = this.el.nativeElement as HTMLElement;
let containerBounds = containerElement.getBoundingClientRect();
let pageX = event.pageX - containerBounds.left;
let pageY = event.pageY - containerBounds.top;
this.dragSelection = {
pageOffset: new Position(pageX, pageY),
tilesOffset: new Position(pageX - event.offsetX, pageY - event.offsetY),
tilesRect: new Rect(),
};
// Unselect all tiles
this.tiles.filter((t) => t.selected).forEach((t) => t.selected = false);
this.selectedTiles = [];
event.preventDefault();
return false;
}
} else if (this.pressedTile) {
this.pressedTile.pressed = true;
this.globalMouseMove = true;
return true; // Continue in case of drag and drop
}
}
}
public set mouseUp(value: boolean) {
if (value) {
if (this.mouseUpObs) {
return;
}
let element = this.el.nativeElement as HTMLElement;
this.mouseUpObs = Observable.fromEvent(element.ownerDocument, 'mouseup').subscribe((event: MouseEvent) => {
if (this.pressedTile) {
this.pressedTile.pressed = false;
if (this.designMode) {
// Multi-selection is available in design mode
if (event.ctrlKey) {
let selectedTiles = this.selectedTiles;
if (this.pressedTile.selected) {
this.pressedTile.selected = false;
let index = this.selectedTiles.findIndex((t) => this.pressedTile === t);
selectedTiles.splice(index, 1);
} else {
this.pressedTile.selected = true;
selectedTiles.push(this.pressedTile);
}
this.selectedTiles = selectedTiles;
}
}
}
});
} else if (this.mouseUpObs) {
this.mouseUpObs.unsubscribe();
delete this.mouseUpObs;
}
}
public set globalMouseUp(value: boolean) {
if (value) {
if (this.globalMouseUpObs) {
return;
}
let element = this.el.nativeElement as HTMLElement;
this.globalMouseUpObs = Observable.fromEvent(element.ownerDocument, 'mouseup').subscribe((event: MouseEvent) => {
if (this.dragSelection) {
this.dragSelection = undefined;
return false;
} else if (this.dragInfos) {
if (this.dragInfos.enabled) {
this.layoutProvider.drop(this.dragInfos.tiles);
}
this.endDrag();
this.onChangeCallback(this.tiles);
return false;
}
});
} else if (this.globalMouseUpObs) {
this.globalMouseUpObs.unsubscribe();
delete this.globalMouseUpObs;
}
}
public set globalKeyUp(value: boolean) {
if (value) {
if (this.globalKeyUpObs) {
return;
}
let element = this.el.nativeElement as HTMLElement;
this.globalKeyUpObs = Observable.fromEvent(element.ownerDocument, 'keyup').subscribe((event: KeyboardEvent) => {
if (event.keyCode === 27) {
this.cancelDrag();
}
});
} else if (this.globalKeyUpObs) {
this.globalKeyUpObs.unsubscribe();
delete this.globalKeyUpObs;
}
}
public set globalMouseMove(value: boolean) {
if (value) {
if (this.globalMouseMoveObs) {
return;
}
let element = this.el.nativeElement as HTMLElement;
this.globalMouseMoveObs = Observable.fromEvent(element.ownerDocument, 'mousemove').subscribe((event: MouseEvent) => {
let currentTile = this.getTileFromHTMLElement(event.target as HTMLElement);
if (this.pressedTile && this.pressedTile.pressed && event.buttons === 1 && this.pressedTile === currentTile) {
return;
}
this.clearPressedTile();
});
} else if (this.globalMouseMoveObs) {
this.globalMouseMoveObs.unsubscribe();
delete this.globalMouseMoveObs;
}
}
public set mouseMove(value: boolean) {
if (value) {
if (this.mouseMoveObs) {
return;
}
let element = this.el.nativeElement as HTMLElement;
this.mouseMoveObs = Observable.fromEvent(element, 'mousemove').subscribe((event: MouseEvent) => {
if (this.dragSelection) {
if (event.buttons !== 1) {
this.dragSelection = undefined;
return;
}
// Unselect all tiles
this.tiles.filter((t) => t.selected).forEach((t) => t.selected = false);
let containerElement = this.el.nativeElement as HTMLElement;
let containerBounds = containerElement.getBoundingClientRect();
let pageX = event.pageX - containerBounds.left;
let pageY = event.pageY - containerBounds.top;
// And select all tiles between start position and current position
let pageRect = Rect.fromPoints(this.dragSelection.pageOffset, new Position(pageX, pageY));
this.dragSelection.tilesRect = pageRect.offset(-this.dragSelection.tilesOffset.left, -this.dragSelection.tilesOffset.top);
let selectedTiles = [];
this.layoutProvider.HitTest(this.tiles, this.dragSelection.tilesRect).forEach((t) => {
t.selected = true;
selectedTiles.push(t);
});
this.selectedTiles = selectedTiles;
} else if (this.dragInfos) {
if (event.buttons === 1) {
let containerElement = this.el.nativeElement as HTMLElement;
let containerBounds = containerElement.getBoundingClientRect();
let pageX = event.pageX - containerBounds.left;
let pageY = event.pageY - containerBounds.top;
if (!this.dragInfos.enabled) {
if (Math.abs(this.dragInfos.startX - pageX) > 10 || Math.abs(this.dragInfos.startY - pageY) > 10) {
// Start tile drag and drop
this.dragging = true;
this.dragInfos.enabled = true;
this.globalKeyUp = true;
this.layoutProvider.startDrag(this.dragInfos.tiles, this.dragInfos.cursor, pageX, pageY);
}
} else {
this.layoutProvider.drag(this.dragInfos.tiles, pageX, pageY);
}
} else if (this.dragInfos.enabled) {
this.cancelDrag();
}
} else if (event.buttons !== 1) {
let tileElement = this.getTileElementFromHTMLElement(event.target as HTMLElement);
if (tileElement) {
this.cursor = this.getCursor(event, tileElement);
} else {
this.cursor = null;
}
}
});
} else if (this.mouseMoveObs) {
this.mouseMoveObs.unsubscribe();
delete this.mouseMoveObs;
}
}
private clearPressedTile = () => {
if (this.pressedTile) {
this.pressedTile.pressed = false;
delete this.pressedTile;
}
this.globalMouseMove = false;
this.mouseUp = false;
}
private getTileElementFromHTMLElement(element: HTMLElement) {
let parentElement = element;
while (parentElement && !parentElement.hasAttribute('tile-index')) {
element = parentElement;
parentElement = parentElement.parentElement;
if (parentElement === this.el.nativeElement) {
return undefined;
}
}
return parentElement;
}
private getTileFromHTMLElement(element: HTMLElement): IDejaTile {
let tileElement = this.getTileElementFromHTMLElement(element);
if (!tileElement) {
return undefined;
}
let index = +tileElement.getAttribute('tile-index');
return this.tiles[index];
}
private ensureIds() {
this.tiles.forEach((t) => {
if (!t.id) {
t.id = this.getCurrentId();
}
});
}
private getCurrentId(): string {
let id = 0;
let sid = '#' + id;
let ids = {};
this.tiles.map((t) => ids[t.id] = t.id);
while (ids[sid]) {
sid = '#' + (++id);
}
return sid;
}
private getCursor(event: MouseEvent, tileElement: HTMLElement) {
let x = event.x;
let y = event.y;
let bounds = tileElement.getBoundingClientRect();
if (x < bounds.left + 10) {
if (y < bounds.top + 10) {
return 'nw-resize';
} else if (y > bounds.bottom - 10) {
return 'sw-resize';
} else {
return 'w-resize';
}
} else if (x > bounds.right - 10) {
if (y < bounds.top + 10) {
return 'ne-resize';
} else if (y > bounds.bottom - 10) {
return 'se-resize';
} else {
return 'e-resize';
}
} else {
if (y < bounds.top + 10) {
return 'n-resize';
} else if (y > bounds.bottom - 10) {
return 's-resize';
} else {
return 'move';
}
}
}
private cancelDrag() {
if (this.dragInfos && this.dragInfos.enabled) {
this.layoutProvider.cancelDrag(this.dragInfos.tiles);
}
this.endDrag();
}
private endDrag() {
// console.log('EndDrag');
if (this.dragInfos) {
if (this.dragInfos.enabled) {
this.dragInfos.enabled = false;
setTimeout(() => {
this.dragging = this.dragInfos && this.dragInfos.enabled;
}, 500);
}
this.globalKeyUp = false;
this.globalMouseUp = false;
delete this.dragInfos;
}
}
}
interface IDejaTileDragDropInfos {
enabled: boolean;
startX: number;
startY: number;
offsetX: number;
offsetY: number;
tiles: IDejaTile[];
cursor: string;
}
| {
"content_hash": "358a06f0e45b2aa394ed37aac69e0e99",
"timestamp": "",
"source": "github",
"line_count": 591,
"max_line_length": 215,
"avg_line_length": 35.934010152284266,
"alnum_prop": 0.5304421528464472,
"repo_name": "KillingJokeCHOrg/dejajs",
"id": "8946ed82a0f5a34a80bcd2712e1c34a790d8185f",
"size": "21237",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/component/tiles/tiles.component.ts",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "72489"
},
{
"name": "HTML",
"bytes": "70247"
},
{
"name": "JavaScript",
"bytes": "4360"
},
{
"name": "TypeScript",
"bytes": "558312"
}
],
"symlink_target": ""
} |
package parse
import (
"bytes"
"errors"
"fmt"
"io"
"math"
"strconv"
"unsafe"
"github.com/go-graphite/go-carbon/points"
)
// https://github.com/golang/go/issues/2632#issuecomment-66061057
func unsafeString(b []byte) string {
return *(*string)(unsafe.Pointer(&b))
}
func PlainLine(p []byte) ([]byte, float64, int64, error) {
p = bytes.Trim(p, " \n\r")
i1 := bytes.IndexByte(p, ' ')
if i1 < 1 {
return nil, 0, 0, fmt.Errorf("bad message: %#v", string(p))
}
i2 := bytes.IndexByte(p[i1+1:], ' ')
if i2 < 1 {
return nil, 0, 0, fmt.Errorf("bad message: %#v", string(p))
}
i2 += i1 + 1
i3 := len(p)
value, err := strconv.ParseFloat(unsafeString(p[i1+1:i2]), 64)
if err != nil || math.IsNaN(value) {
return nil, 0, 0, fmt.Errorf("bad message: %#v", string(p))
}
tsf, err := strconv.ParseFloat(unsafeString(p[i2+1:i3]), 64)
if err != nil || math.IsNaN(tsf) {
return nil, 0, 0, fmt.Errorf("bad message: %#v", string(p))
}
return p[:i1], value, int64(tsf), nil
}
func Plain(body []byte) ([]*points.Points, error) {
size := len(body)
offset := 0
result := make([]*points.Points, 0, 4)
MainLoop:
for offset < size {
lineEnd := bytes.IndexByte(body[offset:size], '\n')
if lineEnd < 0 {
return result, errors.New("unfinished line")
} else if lineEnd == 0 {
// skip empty line
offset++
continue MainLoop
}
name, value, timestamp, err := PlainLine(body[offset : offset+lineEnd+1])
offset += lineEnd + 1
if err != nil {
return result, err
}
result = append(result, points.OnePoint(string(name), value, timestamp))
}
return result, nil
}
// old version. for benchmarks only
func oldPlain(body []byte) ([]*points.Points, error) {
result := make([]*points.Points, 4)
reader := bytes.NewBuffer(body)
for {
line, err := reader.ReadBytes('\n')
if err != nil && err != io.EOF {
return result, err
}
if len(line) == 0 {
break
}
if line[len(line)-1] != '\n' {
return result, errors.New("unfinished line in file")
}
p, err := points.ParseText(string(line))
if err != nil {
return result, err
}
result = append(result, p)
}
return result, nil
}
| {
"content_hash": "64f83cd6683e31180ab64c66c83b192d",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 75,
"avg_line_length": 19.572727272727274,
"alnum_prop": 0.6130980027868091,
"repo_name": "deniszh/go-carbon",
"id": "ecae282a4a99c5b8ba3ea1984e1aafaa80c8fb02",
"size": "2153",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "receiver/parse/plain.go",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Dockerfile",
"bytes": "824"
},
{
"name": "Go",
"bytes": "529004"
},
{
"name": "Makefile",
"bytes": "4617"
},
{
"name": "Python",
"bytes": "2499"
},
{
"name": "Shell",
"bytes": "4992"
}
],
"symlink_target": ""
} |
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
/* File created by MIDL compiler version 7.00.0555 */
/* Compiler settings for propidl.idl:
Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 7.00.0555
protocol : dce , ms_ext, c_ext, robust
error checks: allocation ref bounds_check enum stub_data
VC __declspec() decoration level:
__declspec(uuid()), __declspec(selectany), __declspec(novtable)
DECLSPEC_UUID(), MIDL_INTERFACE()
*/
/* @@MIDL_FILE_HEADING( ) */
#pragma warning( disable: 4049 ) /* more than 64k source lines */
/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
#define __REQUIRED_RPCNDR_H_VERSION__ 500
#endif
/* verify that the <rpcsal.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCSAL_H_VERSION__
#define __REQUIRED_RPCSAL_H_VERSION__ 100
#endif
#include "rpc.h"
#include "rpcndr.h"
#ifndef __RPCNDR_H_VERSION__
#error this stub requires an updated version of <rpcndr.h>
#endif // __RPCNDR_H_VERSION__
#ifndef COM_NO_WINDOWS_H
#include "windows.h"
#include "ole2.h"
#endif /*COM_NO_WINDOWS_H*/
#ifndef __propidl_h__
#define __propidl_h__
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
#pragma once
#endif
/* Forward Declarations */
#ifndef __IPropertyStorage_FWD_DEFINED__
#define __IPropertyStorage_FWD_DEFINED__
typedef interface IPropertyStorage IPropertyStorage;
#endif /* __IPropertyStorage_FWD_DEFINED__ */
#ifndef __IPropertySetStorage_FWD_DEFINED__
#define __IPropertySetStorage_FWD_DEFINED__
typedef interface IPropertySetStorage IPropertySetStorage;
#endif /* __IPropertySetStorage_FWD_DEFINED__ */
#ifndef __IEnumSTATPROPSTG_FWD_DEFINED__
#define __IEnumSTATPROPSTG_FWD_DEFINED__
typedef interface IEnumSTATPROPSTG IEnumSTATPROPSTG;
#endif /* __IEnumSTATPROPSTG_FWD_DEFINED__ */
#ifndef __IEnumSTATPROPSETSTG_FWD_DEFINED__
#define __IEnumSTATPROPSETSTG_FWD_DEFINED__
typedef interface IEnumSTATPROPSETSTG IEnumSTATPROPSETSTG;
#endif /* __IEnumSTATPROPSETSTG_FWD_DEFINED__ */
/* header files for imported files */
#include "objidl.h"
#include "oaidl.h"
#ifdef __cplusplus
extern "C"{
#endif
/* interface __MIDL_itf_propidl_0000_0000 */
/* [local] */
//+-------------------------------------------------------------------------
//
// Microsoft Windows
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//--------------------------------------------------------------------------
#if ( _MSC_VER >= 800 )
#if _MSC_VER >= 1200
#pragma warning(push)
#endif
#pragma warning(disable:4201) /* Nameless struct/union */
#pragma warning(disable:4237) /* obsolete member named 'bool' */
#endif
#if ( _MSC_VER >= 1020 )
#pragma once
#endif
typedef struct tagVersionedStream
{
GUID guidVersion;
IStream *pStream;
} VERSIONEDSTREAM;
typedef struct tagVersionedStream *LPVERSIONEDSTREAM;
// Flags for IPropertySetStorage::Create
#define PROPSETFLAG_DEFAULT ( 0 )
#define PROPSETFLAG_NONSIMPLE ( 1 )
#define PROPSETFLAG_ANSI ( 2 )
// (This flag is only supported on StgCreatePropStg & StgOpenPropStg
#define PROPSETFLAG_UNBUFFERED ( 4 )
// (This flag causes a version-1 property set to be created
#define PROPSETFLAG_CASE_SENSITIVE ( 8 )
// Flags for the reservied PID_BEHAVIOR property
#define PROPSET_BEHAVIOR_CASE_SENSITIVE ( 1 )
#ifdef MIDL_PASS
// This is the PROPVARIANT definition for marshaling.
typedef struct tag_inner_PROPVARIANT PROPVARIANT;
#else
// This is the standard C layout of the PROPVARIANT.
typedef struct tagPROPVARIANT PROPVARIANT;
#endif
typedef struct tagCAC
{
ULONG cElems;
CHAR *pElems;
} CAC;
typedef struct tagCAUB
{
ULONG cElems;
UCHAR *pElems;
} CAUB;
typedef struct tagCAI
{
ULONG cElems;
SHORT *pElems;
} CAI;
typedef struct tagCAUI
{
ULONG cElems;
USHORT *pElems;
} CAUI;
typedef struct tagCAL
{
ULONG cElems;
LONG *pElems;
} CAL;
typedef struct tagCAUL
{
ULONG cElems;
ULONG *pElems;
} CAUL;
typedef struct tagCAFLT
{
ULONG cElems;
FLOAT *pElems;
} CAFLT;
typedef struct tagCADBL
{
ULONG cElems;
DOUBLE *pElems;
} CADBL;
typedef struct tagCACY
{
ULONG cElems;
CY *pElems;
} CACY;
typedef struct tagCADATE
{
ULONG cElems;
DATE *pElems;
} CADATE;
typedef struct tagCABSTR
{
ULONG cElems;
BSTR *pElems;
} CABSTR;
typedef struct tagCABSTRBLOB
{
ULONG cElems;
BSTRBLOB *pElems;
} CABSTRBLOB;
typedef struct tagCABOOL
{
ULONG cElems;
VARIANT_BOOL *pElems;
} CABOOL;
typedef struct tagCASCODE
{
ULONG cElems;
SCODE *pElems;
} CASCODE;
typedef struct tagCAPROPVARIANT
{
ULONG cElems;
PROPVARIANT *pElems;
} CAPROPVARIANT;
typedef struct tagCAH
{
ULONG cElems;
LARGE_INTEGER *pElems;
} CAH;
typedef struct tagCAUH
{
ULONG cElems;
ULARGE_INTEGER *pElems;
} CAUH;
typedef struct tagCALPSTR
{
ULONG cElems;
LPSTR *pElems;
} CALPSTR;
typedef struct tagCALPWSTR
{
ULONG cElems;
LPWSTR *pElems;
} CALPWSTR;
typedef struct tagCAFILETIME
{
ULONG cElems;
FILETIME *pElems;
} CAFILETIME;
typedef struct tagCACLIPDATA
{
ULONG cElems;
CLIPDATA *pElems;
} CACLIPDATA;
typedef struct tagCACLSID
{
ULONG cElems;
CLSID *pElems;
} CACLSID;
#ifdef MIDL_PASS
// This is the PROPVARIANT padding layout for marshaling.
typedef BYTE PROPVAR_PAD1;
typedef BYTE PROPVAR_PAD2;
typedef ULONG PROPVAR_PAD3;
#else
// This is the standard C layout of the structure.
typedef WORD PROPVAR_PAD1;
typedef WORD PROPVAR_PAD2;
typedef WORD PROPVAR_PAD3;
#define tag_inner_PROPVARIANT
#endif
#if !defined(_MSC_EXTENSIONS)
struct tagPROPVARIANT;
#else
#ifndef MIDL_PASS
struct tagPROPVARIANT {
union {
#endif
struct tag_inner_PROPVARIANT
{
VARTYPE vt;
PROPVAR_PAD1 wReserved1;
PROPVAR_PAD2 wReserved2;
PROPVAR_PAD3 wReserved3;
/* [switch_type] */ union
{
/* Empty union arm */
CHAR cVal;
UCHAR bVal;
SHORT iVal;
USHORT uiVal;
LONG lVal;
ULONG ulVal;
INT intVal;
UINT uintVal;
LARGE_INTEGER hVal;
ULARGE_INTEGER uhVal;
FLOAT fltVal;
DOUBLE dblVal;
VARIANT_BOOL boolVal;
// _VARIANT_BOOL bool;
SCODE scode;
CY cyVal;
DATE date;
FILETIME filetime;
CLSID *puuid;
CLIPDATA *pclipdata;
BSTR bstrVal;
BSTRBLOB bstrblobVal;
BLOB blob;
LPSTR pszVal;
LPWSTR pwszVal;
IUnknown *punkVal;
IDispatch *pdispVal;
IStream *pStream;
IStorage *pStorage;
LPVERSIONEDSTREAM pVersionedStream;
LPSAFEARRAY parray;
CAC cac;
CAUB caub;
CAI cai;
CAUI caui;
CAL cal;
CAUL caul;
CAH cah;
CAUH cauh;
CAFLT caflt;
CADBL cadbl;
CABOOL cabool;
CASCODE cascode;
CACY cacy;
CADATE cadate;
CAFILETIME cafiletime;
CACLSID cauuid;
CACLIPDATA caclipdata;
CABSTR cabstr;
CABSTRBLOB cabstrblob;
CALPSTR calpstr;
CALPWSTR calpwstr;
CAPROPVARIANT capropvar;
CHAR *pcVal;
UCHAR *pbVal;
SHORT *piVal;
USHORT *puiVal;
LONG *plVal;
ULONG *pulVal;
INT *pintVal;
UINT *puintVal;
FLOAT *pfltVal;
DOUBLE *pdblVal;
VARIANT_BOOL *pboolVal;
DECIMAL *pdecVal;
SCODE *pscode;
CY *pcyVal;
DATE *pdate;
BSTR *pbstrVal;
IUnknown **ppunkVal;
IDispatch **ppdispVal;
LPSAFEARRAY *pparray;
PROPVARIANT *pvarVal;
} ;
} ;
#ifndef MIDL_PASS
DECIMAL decVal;
};
};
#endif
#endif /* _MSC_EXTENSIONS */
#ifdef MIDL_PASS
// This is the LPPROPVARIANT definition for marshaling.
typedef struct tag_inner_PROPVARIANT *LPPROPVARIANT;
typedef const PROPVARIANT *REFPROPVARIANT;
#else
// This is the standard C layout of the PROPVARIANT.
typedef struct tagPROPVARIANT * LPPROPVARIANT;
#ifndef _REFPROPVARIANT_DEFINED
#define _REFPROPVARIANT_DEFINED
#ifdef __cplusplus
#define REFPROPVARIANT const PROPVARIANT &
#else
#define REFPROPVARIANT const PROPVARIANT * __MIDL_CONST
#endif
#endif
#endif // MIDL_PASS
// Reserved global Property IDs
#define PID_DICTIONARY ( 0 )
#define PID_CODEPAGE ( 0x1 )
#define PID_FIRST_USABLE ( 0x2 )
#define PID_FIRST_NAME_DEFAULT ( 0xfff )
#define PID_LOCALE ( 0x80000000 )
#define PID_MODIFY_TIME ( 0x80000001 )
#define PID_SECURITY ( 0x80000002 )
#define PID_BEHAVIOR ( 0x80000003 )
#define PID_ILLEGAL ( 0xffffffff )
// Range which is read-only to downlevel implementations
#define PID_MIN_READONLY ( 0x80000000 )
#define PID_MAX_READONLY ( 0xbfffffff )
// Property IDs for the DiscardableInformation Property Set
#define PIDDI_THUMBNAIL 0x00000002L // VT_BLOB
// Property IDs for the SummaryInformation Property Set
#define PIDSI_TITLE 0x00000002L // VT_LPSTR
#define PIDSI_SUBJECT 0x00000003L // VT_LPSTR
#define PIDSI_AUTHOR 0x00000004L // VT_LPSTR
#define PIDSI_KEYWORDS 0x00000005L // VT_LPSTR
#define PIDSI_COMMENTS 0x00000006L // VT_LPSTR
#define PIDSI_TEMPLATE 0x00000007L // VT_LPSTR
#define PIDSI_LASTAUTHOR 0x00000008L // VT_LPSTR
#define PIDSI_REVNUMBER 0x00000009L // VT_LPSTR
#define PIDSI_EDITTIME 0x0000000aL // VT_FILETIME (UTC)
#define PIDSI_LASTPRINTED 0x0000000bL // VT_FILETIME (UTC)
#define PIDSI_CREATE_DTM 0x0000000cL // VT_FILETIME (UTC)
#define PIDSI_LASTSAVE_DTM 0x0000000dL // VT_FILETIME (UTC)
#define PIDSI_PAGECOUNT 0x0000000eL // VT_I4
#define PIDSI_WORDCOUNT 0x0000000fL // VT_I4
#define PIDSI_CHARCOUNT 0x00000010L // VT_I4
#define PIDSI_THUMBNAIL 0x00000011L // VT_CF
#define PIDSI_APPNAME 0x00000012L // VT_LPSTR
#define PIDSI_DOC_SECURITY 0x00000013L // VT_I4
// Property IDs for the DocSummaryInformation Property Set
#define PIDDSI_CATEGORY 0x00000002 // VT_LPSTR
#define PIDDSI_PRESFORMAT 0x00000003 // VT_LPSTR
#define PIDDSI_BYTECOUNT 0x00000004 // VT_I4
#define PIDDSI_LINECOUNT 0x00000005 // VT_I4
#define PIDDSI_PARCOUNT 0x00000006 // VT_I4
#define PIDDSI_SLIDECOUNT 0x00000007 // VT_I4
#define PIDDSI_NOTECOUNT 0x00000008 // VT_I4
#define PIDDSI_HIDDENCOUNT 0x00000009 // VT_I4
#define PIDDSI_MMCLIPCOUNT 0x0000000A // VT_I4
#define PIDDSI_SCALE 0x0000000B // VT_BOOL
#define PIDDSI_HEADINGPAIR 0x0000000C // VT_VARIANT | VT_VECTOR
#define PIDDSI_DOCPARTS 0x0000000D // VT_LPSTR | VT_VECTOR
#define PIDDSI_MANAGER 0x0000000E // VT_LPSTR
#define PIDDSI_COMPANY 0x0000000F // VT_LPSTR
#define PIDDSI_LINKSDIRTY 0x00000010 // VT_BOOL
// FMTID_MediaFileSummaryInfo - Property IDs
#define PIDMSI_EDITOR 0x00000002L // VT_LPWSTR
#define PIDMSI_SUPPLIER 0x00000003L // VT_LPWSTR
#define PIDMSI_SOURCE 0x00000004L // VT_LPWSTR
#define PIDMSI_SEQUENCE_NO 0x00000005L // VT_LPWSTR
#define PIDMSI_PROJECT 0x00000006L // VT_LPWSTR
#define PIDMSI_STATUS 0x00000007L // VT_UI4
#define PIDMSI_OWNER 0x00000008L // VT_LPWSTR
#define PIDMSI_RATING 0x00000009L // VT_LPWSTR
#define PIDMSI_PRODUCTION 0x0000000AL // VT_FILETIME (UTC)
#define PIDMSI_COPYRIGHT 0x0000000BL // VT_LPWSTR
// PIDMSI_STATUS value definitions
enum PIDMSI_STATUS_VALUE
{ PIDMSI_STATUS_NORMAL = 0,
PIDMSI_STATUS_NEW = ( PIDMSI_STATUS_NORMAL + 1 ) ,
PIDMSI_STATUS_PRELIM = ( PIDMSI_STATUS_NEW + 1 ) ,
PIDMSI_STATUS_DRAFT = ( PIDMSI_STATUS_PRELIM + 1 ) ,
PIDMSI_STATUS_INPROGRESS = ( PIDMSI_STATUS_DRAFT + 1 ) ,
PIDMSI_STATUS_EDIT = ( PIDMSI_STATUS_INPROGRESS + 1 ) ,
PIDMSI_STATUS_REVIEW = ( PIDMSI_STATUS_EDIT + 1 ) ,
PIDMSI_STATUS_PROOF = ( PIDMSI_STATUS_REVIEW + 1 ) ,
PIDMSI_STATUS_FINAL = ( PIDMSI_STATUS_PROOF + 1 ) ,
PIDMSI_STATUS_OTHER = 0x7fff
} ;
#define PRSPEC_INVALID ( 0xffffffff )
#define PRSPEC_LPWSTR ( 0 )
#define PRSPEC_PROPID ( 1 )
typedef struct tagPROPSPEC
{
ULONG ulKind;
/* [switch_type] */ union
{
PROPID propid;
LPOLESTR lpwstr;
/* Empty union arm */
} DUMMYUNIONNAME;
} PROPSPEC;
typedef struct tagSTATPROPSTG
{
LPOLESTR lpwstrName;
PROPID propid;
VARTYPE vt;
} STATPROPSTG;
// Macros for parsing the OS Version of the Property Set Header
#define PROPSETHDR_OSVER_KIND(dwOSVer) HIWORD( (dwOSVer) )
#define PROPSETHDR_OSVER_MAJOR(dwOSVer) LOBYTE(LOWORD( (dwOSVer) ))
#define PROPSETHDR_OSVER_MINOR(dwOSVer) HIBYTE(LOWORD( (dwOSVer) ))
#define PROPSETHDR_OSVERSION_UNKNOWN 0xFFFFFFFF
typedef struct tagSTATPROPSETSTG
{
FMTID fmtid;
CLSID clsid;
DWORD grfFlags;
FILETIME mtime;
FILETIME ctime;
FILETIME atime;
DWORD dwOSVersion;
} STATPROPSETSTG;
extern RPC_IF_HANDLE __MIDL_itf_propidl_0000_0000_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_propidl_0000_0000_v0_0_s_ifspec;
#ifndef __IPropertyStorage_INTERFACE_DEFINED__
#define __IPropertyStorage_INTERFACE_DEFINED__
/* interface IPropertyStorage */
/* [unique][uuid][object] */
EXTERN_C const IID IID_IPropertyStorage;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("00000138-0000-0000-C000-000000000046")
IPropertyStorage : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE ReadMultiple(
/* [in] */ ULONG cpspec,
/* [size_is][in] */ __RPC__in_ecount_full(cpspec) const PROPSPEC rgpspec[ ],
/* [size_is][out] */ __RPC__out_ecount_full(cpspec) PROPVARIANT rgpropvar[ ]) = 0;
virtual HRESULT STDMETHODCALLTYPE WriteMultiple(
/* [in] */ ULONG cpspec,
/* [size_is][in] */ __RPC__in_ecount_full(cpspec) const PROPSPEC rgpspec[ ],
/* [size_is][in] */ __RPC__in_ecount_full(cpspec) const PROPVARIANT rgpropvar[ ],
/* [in] */ PROPID propidNameFirst) = 0;
virtual HRESULT STDMETHODCALLTYPE DeleteMultiple(
/* [in] */ ULONG cpspec,
/* [size_is][in] */ __RPC__in_ecount_full(cpspec) const PROPSPEC rgpspec[ ]) = 0;
virtual HRESULT STDMETHODCALLTYPE ReadPropertyNames(
/* [in] */ ULONG cpropid,
/* [size_is][in] */ __RPC__in_ecount_full(cpropid) const PROPID rgpropid[ ],
/* [size_is][out] */ __RPC__out_ecount_full(cpropid) LPOLESTR rglpwstrName[ ]) = 0;
virtual HRESULT STDMETHODCALLTYPE WritePropertyNames(
/* [in] */ ULONG cpropid,
/* [size_is][in] */ __RPC__in_ecount_full(cpropid) const PROPID rgpropid[ ],
/* [size_is][in] */ __RPC__in_ecount_full(cpropid) const LPOLESTR rglpwstrName[ ]) = 0;
virtual HRESULT STDMETHODCALLTYPE DeletePropertyNames(
/* [in] */ ULONG cpropid,
/* [size_is][in] */ __RPC__in_ecount_full(cpropid) const PROPID rgpropid[ ]) = 0;
virtual HRESULT STDMETHODCALLTYPE Commit(
/* [in] */ DWORD grfCommitFlags) = 0;
virtual HRESULT STDMETHODCALLTYPE Revert( void) = 0;
virtual HRESULT STDMETHODCALLTYPE Enum(
/* [out] */ __RPC__deref_out_opt IEnumSTATPROPSTG **ppenum) = 0;
virtual HRESULT STDMETHODCALLTYPE SetTimes(
/* [in] */ __RPC__in const FILETIME *pctime,
/* [in] */ __RPC__in const FILETIME *patime,
/* [in] */ __RPC__in const FILETIME *pmtime) = 0;
virtual HRESULT STDMETHODCALLTYPE SetClass(
/* [in] */ __RPC__in REFCLSID clsid) = 0;
virtual HRESULT STDMETHODCALLTYPE Stat(
/* [out] */ __RPC__out STATPROPSETSTG *pstatpsstg) = 0;
};
#else /* C style interface */
typedef struct IPropertyStorageVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
__RPC__in IPropertyStorage * This,
/* [in] */ __RPC__in REFIID riid,
/* [annotation][iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
__RPC__in IPropertyStorage * This);
ULONG ( STDMETHODCALLTYPE *Release )(
__RPC__in IPropertyStorage * This);
HRESULT ( STDMETHODCALLTYPE *ReadMultiple )(
__RPC__in IPropertyStorage * This,
/* [in] */ ULONG cpspec,
/* [size_is][in] */ __RPC__in_ecount_full(cpspec) const PROPSPEC rgpspec[ ],
/* [size_is][out] */ __RPC__out_ecount_full(cpspec) PROPVARIANT rgpropvar[ ]);
HRESULT ( STDMETHODCALLTYPE *WriteMultiple )(
__RPC__in IPropertyStorage * This,
/* [in] */ ULONG cpspec,
/* [size_is][in] */ __RPC__in_ecount_full(cpspec) const PROPSPEC rgpspec[ ],
/* [size_is][in] */ __RPC__in_ecount_full(cpspec) const PROPVARIANT rgpropvar[ ],
/* [in] */ PROPID propidNameFirst);
HRESULT ( STDMETHODCALLTYPE *DeleteMultiple )(
__RPC__in IPropertyStorage * This,
/* [in] */ ULONG cpspec,
/* [size_is][in] */ __RPC__in_ecount_full(cpspec) const PROPSPEC rgpspec[ ]);
HRESULT ( STDMETHODCALLTYPE *ReadPropertyNames )(
__RPC__in IPropertyStorage * This,
/* [in] */ ULONG cpropid,
/* [size_is][in] */ __RPC__in_ecount_full(cpropid) const PROPID rgpropid[ ],
/* [size_is][out] */ __RPC__out_ecount_full(cpropid) LPOLESTR rglpwstrName[ ]);
HRESULT ( STDMETHODCALLTYPE *WritePropertyNames )(
__RPC__in IPropertyStorage * This,
/* [in] */ ULONG cpropid,
/* [size_is][in] */ __RPC__in_ecount_full(cpropid) const PROPID rgpropid[ ],
/* [size_is][in] */ __RPC__in_ecount_full(cpropid) const LPOLESTR rglpwstrName[ ]);
HRESULT ( STDMETHODCALLTYPE *DeletePropertyNames )(
__RPC__in IPropertyStorage * This,
/* [in] */ ULONG cpropid,
/* [size_is][in] */ __RPC__in_ecount_full(cpropid) const PROPID rgpropid[ ]);
HRESULT ( STDMETHODCALLTYPE *Commit )(
__RPC__in IPropertyStorage * This,
/* [in] */ DWORD grfCommitFlags);
HRESULT ( STDMETHODCALLTYPE *Revert )(
__RPC__in IPropertyStorage * This);
HRESULT ( STDMETHODCALLTYPE *Enum )(
__RPC__in IPropertyStorage * This,
/* [out] */ __RPC__deref_out_opt IEnumSTATPROPSTG **ppenum);
HRESULT ( STDMETHODCALLTYPE *SetTimes )(
__RPC__in IPropertyStorage * This,
/* [in] */ __RPC__in const FILETIME *pctime,
/* [in] */ __RPC__in const FILETIME *patime,
/* [in] */ __RPC__in const FILETIME *pmtime);
HRESULT ( STDMETHODCALLTYPE *SetClass )(
__RPC__in IPropertyStorage * This,
/* [in] */ __RPC__in REFCLSID clsid);
HRESULT ( STDMETHODCALLTYPE *Stat )(
__RPC__in IPropertyStorage * This,
/* [out] */ __RPC__out STATPROPSETSTG *pstatpsstg);
END_INTERFACE
} IPropertyStorageVtbl;
interface IPropertyStorage
{
CONST_VTBL struct IPropertyStorageVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IPropertyStorage_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define IPropertyStorage_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define IPropertyStorage_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define IPropertyStorage_ReadMultiple(This,cpspec,rgpspec,rgpropvar) \
( (This)->lpVtbl -> ReadMultiple(This,cpspec,rgpspec,rgpropvar) )
#define IPropertyStorage_WriteMultiple(This,cpspec,rgpspec,rgpropvar,propidNameFirst) \
( (This)->lpVtbl -> WriteMultiple(This,cpspec,rgpspec,rgpropvar,propidNameFirst) )
#define IPropertyStorage_DeleteMultiple(This,cpspec,rgpspec) \
( (This)->lpVtbl -> DeleteMultiple(This,cpspec,rgpspec) )
#define IPropertyStorage_ReadPropertyNames(This,cpropid,rgpropid,rglpwstrName) \
( (This)->lpVtbl -> ReadPropertyNames(This,cpropid,rgpropid,rglpwstrName) )
#define IPropertyStorage_WritePropertyNames(This,cpropid,rgpropid,rglpwstrName) \
( (This)->lpVtbl -> WritePropertyNames(This,cpropid,rgpropid,rglpwstrName) )
#define IPropertyStorage_DeletePropertyNames(This,cpropid,rgpropid) \
( (This)->lpVtbl -> DeletePropertyNames(This,cpropid,rgpropid) )
#define IPropertyStorage_Commit(This,grfCommitFlags) \
( (This)->lpVtbl -> Commit(This,grfCommitFlags) )
#define IPropertyStorage_Revert(This) \
( (This)->lpVtbl -> Revert(This) )
#define IPropertyStorage_Enum(This,ppenum) \
( (This)->lpVtbl -> Enum(This,ppenum) )
#define IPropertyStorage_SetTimes(This,pctime,patime,pmtime) \
( (This)->lpVtbl -> SetTimes(This,pctime,patime,pmtime) )
#define IPropertyStorage_SetClass(This,clsid) \
( (This)->lpVtbl -> SetClass(This,clsid) )
#define IPropertyStorage_Stat(This,pstatpsstg) \
( (This)->lpVtbl -> Stat(This,pstatpsstg) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __IPropertyStorage_INTERFACE_DEFINED__ */
#ifndef __IPropertySetStorage_INTERFACE_DEFINED__
#define __IPropertySetStorage_INTERFACE_DEFINED__
/* interface IPropertySetStorage */
/* [unique][uuid][object] */
typedef /* [unique] */ __RPC_unique_pointer IPropertySetStorage *LPPROPERTYSETSTORAGE;
EXTERN_C const IID IID_IPropertySetStorage;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("0000013A-0000-0000-C000-000000000046")
IPropertySetStorage : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE Create(
/* [in] */ __RPC__in REFFMTID rfmtid,
/* [unique][in] */ __RPC__in_opt const CLSID *pclsid,
/* [in] */ DWORD grfFlags,
/* [in] */ DWORD grfMode,
/* [out] */ __RPC__deref_out_opt IPropertyStorage **ppprstg) = 0;
virtual HRESULT STDMETHODCALLTYPE Open(
/* [in] */ __RPC__in REFFMTID rfmtid,
/* [in] */ DWORD grfMode,
/* [out] */ __RPC__deref_out_opt IPropertyStorage **ppprstg) = 0;
virtual HRESULT STDMETHODCALLTYPE Delete(
/* [in] */ __RPC__in REFFMTID rfmtid) = 0;
virtual HRESULT STDMETHODCALLTYPE Enum(
/* [out] */ __RPC__deref_out_opt IEnumSTATPROPSETSTG **ppenum) = 0;
};
#else /* C style interface */
typedef struct IPropertySetStorageVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
__RPC__in IPropertySetStorage * This,
/* [in] */ __RPC__in REFIID riid,
/* [annotation][iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
__RPC__in IPropertySetStorage * This);
ULONG ( STDMETHODCALLTYPE *Release )(
__RPC__in IPropertySetStorage * This);
HRESULT ( STDMETHODCALLTYPE *Create )(
__RPC__in IPropertySetStorage * This,
/* [in] */ __RPC__in REFFMTID rfmtid,
/* [unique][in] */ __RPC__in_opt const CLSID *pclsid,
/* [in] */ DWORD grfFlags,
/* [in] */ DWORD grfMode,
/* [out] */ __RPC__deref_out_opt IPropertyStorage **ppprstg);
HRESULT ( STDMETHODCALLTYPE *Open )(
__RPC__in IPropertySetStorage * This,
/* [in] */ __RPC__in REFFMTID rfmtid,
/* [in] */ DWORD grfMode,
/* [out] */ __RPC__deref_out_opt IPropertyStorage **ppprstg);
HRESULT ( STDMETHODCALLTYPE *Delete )(
__RPC__in IPropertySetStorage * This,
/* [in] */ __RPC__in REFFMTID rfmtid);
HRESULT ( STDMETHODCALLTYPE *Enum )(
__RPC__in IPropertySetStorage * This,
/* [out] */ __RPC__deref_out_opt IEnumSTATPROPSETSTG **ppenum);
END_INTERFACE
} IPropertySetStorageVtbl;
interface IPropertySetStorage
{
CONST_VTBL struct IPropertySetStorageVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IPropertySetStorage_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define IPropertySetStorage_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define IPropertySetStorage_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define IPropertySetStorage_Create(This,rfmtid,pclsid,grfFlags,grfMode,ppprstg) \
( (This)->lpVtbl -> Create(This,rfmtid,pclsid,grfFlags,grfMode,ppprstg) )
#define IPropertySetStorage_Open(This,rfmtid,grfMode,ppprstg) \
( (This)->lpVtbl -> Open(This,rfmtid,grfMode,ppprstg) )
#define IPropertySetStorage_Delete(This,rfmtid) \
( (This)->lpVtbl -> Delete(This,rfmtid) )
#define IPropertySetStorage_Enum(This,ppenum) \
( (This)->lpVtbl -> Enum(This,ppenum) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __IPropertySetStorage_INTERFACE_DEFINED__ */
#ifndef __IEnumSTATPROPSTG_INTERFACE_DEFINED__
#define __IEnumSTATPROPSTG_INTERFACE_DEFINED__
/* interface IEnumSTATPROPSTG */
/* [unique][uuid][object] */
typedef /* [unique] */ __RPC_unique_pointer IEnumSTATPROPSTG *LPENUMSTATPROPSTG;
EXTERN_C const IID IID_IEnumSTATPROPSTG;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("00000139-0000-0000-C000-000000000046")
IEnumSTATPROPSTG : public IUnknown
{
public:
virtual /* [local] */ HRESULT STDMETHODCALLTYPE Next(
/* [in] */ ULONG celt,
/* [annotation][length_is][size_is][out] */
__out_ecount_part(celt, *pceltFetched) STATPROPSTG *rgelt,
/* [annotation][out] */
__out_opt __deref_out_range(0, celt) ULONG *pceltFetched) = 0;
virtual HRESULT STDMETHODCALLTYPE Skip(
/* [in] */ ULONG celt) = 0;
virtual HRESULT STDMETHODCALLTYPE Reset( void) = 0;
virtual HRESULT STDMETHODCALLTYPE Clone(
/* [out] */ __RPC__deref_out_opt IEnumSTATPROPSTG **ppenum) = 0;
};
#else /* C style interface */
typedef struct IEnumSTATPROPSTGVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
__RPC__in IEnumSTATPROPSTG * This,
/* [in] */ __RPC__in REFIID riid,
/* [annotation][iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
__RPC__in IEnumSTATPROPSTG * This);
ULONG ( STDMETHODCALLTYPE *Release )(
__RPC__in IEnumSTATPROPSTG * This);
/* [local] */ HRESULT ( STDMETHODCALLTYPE *Next )(
IEnumSTATPROPSTG * This,
/* [in] */ ULONG celt,
/* [annotation][length_is][size_is][out] */
__out_ecount_part(celt, *pceltFetched) STATPROPSTG *rgelt,
/* [annotation][out] */
__out_opt __deref_out_range(0, celt) ULONG *pceltFetched);
HRESULT ( STDMETHODCALLTYPE *Skip )(
__RPC__in IEnumSTATPROPSTG * This,
/* [in] */ ULONG celt);
HRESULT ( STDMETHODCALLTYPE *Reset )(
__RPC__in IEnumSTATPROPSTG * This);
HRESULT ( STDMETHODCALLTYPE *Clone )(
__RPC__in IEnumSTATPROPSTG * This,
/* [out] */ __RPC__deref_out_opt IEnumSTATPROPSTG **ppenum);
END_INTERFACE
} IEnumSTATPROPSTGVtbl;
interface IEnumSTATPROPSTG
{
CONST_VTBL struct IEnumSTATPROPSTGVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IEnumSTATPROPSTG_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define IEnumSTATPROPSTG_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define IEnumSTATPROPSTG_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define IEnumSTATPROPSTG_Next(This,celt,rgelt,pceltFetched) \
( (This)->lpVtbl -> Next(This,celt,rgelt,pceltFetched) )
#define IEnumSTATPROPSTG_Skip(This,celt) \
( (This)->lpVtbl -> Skip(This,celt) )
#define IEnumSTATPROPSTG_Reset(This) \
( (This)->lpVtbl -> Reset(This) )
#define IEnumSTATPROPSTG_Clone(This,ppenum) \
( (This)->lpVtbl -> Clone(This,ppenum) )
#endif /* COBJMACROS */
#endif /* C style interface */
/* [call_as] */ HRESULT STDMETHODCALLTYPE IEnumSTATPROPSTG_RemoteNext_Proxy(
__RPC__in IEnumSTATPROPSTG * This,
/* [in] */ ULONG celt,
/* [length_is][size_is][out] */ __RPC__out_ecount_part(celt, *pceltFetched) STATPROPSTG *rgelt,
/* [out] */ __RPC__out ULONG *pceltFetched);
void __RPC_STUB IEnumSTATPROPSTG_RemoteNext_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
#endif /* __IEnumSTATPROPSTG_INTERFACE_DEFINED__ */
#ifndef __IEnumSTATPROPSETSTG_INTERFACE_DEFINED__
#define __IEnumSTATPROPSETSTG_INTERFACE_DEFINED__
/* interface IEnumSTATPROPSETSTG */
/* [unique][uuid][object] */
typedef /* [unique] */ __RPC_unique_pointer IEnumSTATPROPSETSTG *LPENUMSTATPROPSETSTG;
EXTERN_C const IID IID_IEnumSTATPROPSETSTG;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("0000013B-0000-0000-C000-000000000046")
IEnumSTATPROPSETSTG : public IUnknown
{
public:
virtual /* [local] */ HRESULT STDMETHODCALLTYPE Next(
/* [in] */ ULONG celt,
/* [annotation][length_is][size_is][out] */
__out_ecount_part(celt, *pceltFetched) STATPROPSETSTG *rgelt,
/* [annotation][out] */
__out_opt __deref_out_range(0, celt) ULONG *pceltFetched) = 0;
virtual HRESULT STDMETHODCALLTYPE Skip(
/* [in] */ ULONG celt) = 0;
virtual HRESULT STDMETHODCALLTYPE Reset( void) = 0;
virtual HRESULT STDMETHODCALLTYPE Clone(
/* [out] */ __RPC__deref_out_opt IEnumSTATPROPSETSTG **ppenum) = 0;
};
#else /* C style interface */
typedef struct IEnumSTATPROPSETSTGVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
__RPC__in IEnumSTATPROPSETSTG * This,
/* [in] */ __RPC__in REFIID riid,
/* [annotation][iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
__RPC__in IEnumSTATPROPSETSTG * This);
ULONG ( STDMETHODCALLTYPE *Release )(
__RPC__in IEnumSTATPROPSETSTG * This);
/* [local] */ HRESULT ( STDMETHODCALLTYPE *Next )(
IEnumSTATPROPSETSTG * This,
/* [in] */ ULONG celt,
/* [annotation][length_is][size_is][out] */
__out_ecount_part(celt, *pceltFetched) STATPROPSETSTG *rgelt,
/* [annotation][out] */
__out_opt __deref_out_range(0, celt) ULONG *pceltFetched);
HRESULT ( STDMETHODCALLTYPE *Skip )(
__RPC__in IEnumSTATPROPSETSTG * This,
/* [in] */ ULONG celt);
HRESULT ( STDMETHODCALLTYPE *Reset )(
__RPC__in IEnumSTATPROPSETSTG * This);
HRESULT ( STDMETHODCALLTYPE *Clone )(
__RPC__in IEnumSTATPROPSETSTG * This,
/* [out] */ __RPC__deref_out_opt IEnumSTATPROPSETSTG **ppenum);
END_INTERFACE
} IEnumSTATPROPSETSTGVtbl;
interface IEnumSTATPROPSETSTG
{
CONST_VTBL struct IEnumSTATPROPSETSTGVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IEnumSTATPROPSETSTG_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define IEnumSTATPROPSETSTG_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define IEnumSTATPROPSETSTG_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define IEnumSTATPROPSETSTG_Next(This,celt,rgelt,pceltFetched) \
( (This)->lpVtbl -> Next(This,celt,rgelt,pceltFetched) )
#define IEnumSTATPROPSETSTG_Skip(This,celt) \
( (This)->lpVtbl -> Skip(This,celt) )
#define IEnumSTATPROPSETSTG_Reset(This) \
( (This)->lpVtbl -> Reset(This) )
#define IEnumSTATPROPSETSTG_Clone(This,ppenum) \
( (This)->lpVtbl -> Clone(This,ppenum) )
#endif /* COBJMACROS */
#endif /* C style interface */
/* [call_as] */ HRESULT STDMETHODCALLTYPE IEnumSTATPROPSETSTG_RemoteNext_Proxy(
__RPC__in IEnumSTATPROPSETSTG * This,
/* [in] */ ULONG celt,
/* [length_is][size_is][out] */ __RPC__out_ecount_part(celt, *pceltFetched) STATPROPSETSTG *rgelt,
/* [out] */ __RPC__out ULONG *pceltFetched);
void __RPC_STUB IEnumSTATPROPSETSTG_RemoteNext_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
#endif /* __IEnumSTATPROPSETSTG_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_propidl_0000_0004 */
/* [local] */
typedef /* [unique] */ __RPC_unique_pointer IPropertyStorage *LPPROPERTYSTORAGE;
__checkReturn WINOLEAPI PropVariantCopy(
__out PROPVARIANT* pvarDest,
__in const PROPVARIANT * pvarSrc);
WINOLEAPI PropVariantClear(__inout PROPVARIANT* pvar);
WINOLEAPI FreePropVariantArray(
__in ULONG cVariants,
__inout_ecount(cVariants) PROPVARIANT* rgvars);
#if defined(_MSC_EXTENSIONS)
#define _PROPVARIANTINIT_DEFINED_
# ifdef __cplusplus
inline void PropVariantInit (__out PROPVARIANT * pvar )
{
memset ( pvar, 0, sizeof(PROPVARIANT) );
}
# else
# define PropVariantInit(pvar) memset ( (pvar), 0, sizeof(PROPVARIANT) )
# endif
#endif /* _MSC_EXTENSIONS */
#ifndef _STGCREATEPROPSTG_DEFINED_
__checkReturn WINOLEAPI StgCreatePropStg(
__in IUnknown* pUnk,
__in REFFMTID fmtid,
__in const CLSID* pclsid,
__in DWORD grfFlags,
__in __reserved DWORD dwReserved,
__deref_out IPropertyStorage** ppPropStg);
__checkReturn WINOLEAPI StgOpenPropStg(
__in IUnknown* pUnk,
__in REFFMTID fmtid,
__in DWORD grfFlags,
__in __reserved DWORD dwReserved,
__deref_out IPropertyStorage** ppPropStg);
__checkReturn WINOLEAPI StgCreatePropSetStg(
__in IStorage* pStorage,
__in __reserved DWORD dwReserved,
__deref_out IPropertySetStorage** ppPropSetStg);
#define CCH_MAX_PROPSTG_NAME 31
__checkReturn WINOLEAPI FmtIdToPropStgName(
__in const FMTID* pfmtid,
__out_ecount(CCH_MAX_PROPSTG_NAME+1) LPOLESTR oszName);
__checkReturn WINOLEAPI PropStgNameToFmtId(
__in const LPOLESTR oszName,
__out FMTID* pfmtid);
#endif
#ifndef _SERIALIZEDPROPERTYVALUE_DEFINED_
#define _SERIALIZEDPROPERTYVALUE_DEFINED_
typedef struct tagSERIALIZEDPROPERTYVALUE
{
DWORD dwType;
BYTE rgb[1];
} SERIALIZEDPROPERTYVALUE;
#endif
EXTERN_C
__success(TRUE) /* Raises status on failure */
SERIALIZEDPROPERTYVALUE* __stdcall
StgConvertVariantToProperty(
__in const PROPVARIANT* pvar,
__in USHORT CodePage,
__out_bcount_opt(*pcb) SERIALIZEDPROPERTYVALUE* pprop,
__inout ULONG* pcb,
__in PROPID pid,
__in __reserved BOOLEAN fReserved,
__inout_opt ULONG* pcIndirect);
#ifdef __cplusplus
class PMemoryAllocator;
EXTERN_C
__success(TRUE) /* Raises status on failure */
BOOLEAN __stdcall
StgConvertPropertyToVariant(
__in const SERIALIZEDPROPERTYVALUE* pprop,
__in USHORT CodePage,
__out PROPVARIANT* pvar,
__in PMemoryAllocator* pma);
#endif
#if _MSC_VER >= 1200
#pragma warning(pop)
#else
#pragma warning(default:4201) /* Nameless struct/union */
#pragma warning(default:4237) /* keywords bool, true, false, etc.. */
#endif
extern RPC_IF_HANDLE __MIDL_itf_propidl_0000_0004_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_propidl_0000_0004_v0_0_s_ifspec;
/* Additional Prototypes for ALL interfaces */
unsigned long __RPC_USER BSTR_UserSize( __RPC__in unsigned long *, unsigned long , __RPC__in BSTR * );
unsigned char * __RPC_USER BSTR_UserMarshal( __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in BSTR * );
unsigned char * __RPC_USER BSTR_UserUnmarshal(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out BSTR * );
void __RPC_USER BSTR_UserFree( __RPC__in unsigned long *, __RPC__in BSTR * );
unsigned long __RPC_USER LPSAFEARRAY_UserSize( __RPC__in unsigned long *, unsigned long , __RPC__in LPSAFEARRAY * );
unsigned char * __RPC_USER LPSAFEARRAY_UserMarshal( __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in LPSAFEARRAY * );
unsigned char * __RPC_USER LPSAFEARRAY_UserUnmarshal(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out LPSAFEARRAY * );
void __RPC_USER LPSAFEARRAY_UserFree( __RPC__in unsigned long *, __RPC__in LPSAFEARRAY * );
unsigned long __RPC_USER BSTR_UserSize64( __RPC__in unsigned long *, unsigned long , __RPC__in BSTR * );
unsigned char * __RPC_USER BSTR_UserMarshal64( __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in BSTR * );
unsigned char * __RPC_USER BSTR_UserUnmarshal64(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out BSTR * );
void __RPC_USER BSTR_UserFree64( __RPC__in unsigned long *, __RPC__in BSTR * );
unsigned long __RPC_USER LPSAFEARRAY_UserSize64( __RPC__in unsigned long *, unsigned long , __RPC__in LPSAFEARRAY * );
unsigned char * __RPC_USER LPSAFEARRAY_UserMarshal64( __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in LPSAFEARRAY * );
unsigned char * __RPC_USER LPSAFEARRAY_UserUnmarshal64(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out LPSAFEARRAY * );
void __RPC_USER LPSAFEARRAY_UserFree64( __RPC__in unsigned long *, __RPC__in LPSAFEARRAY * );
/* [local] */ HRESULT STDMETHODCALLTYPE IEnumSTATPROPSTG_Next_Proxy(
IEnumSTATPROPSTG * This,
/* [in] */ ULONG celt,
/* [annotation][length_is][size_is][out] */
__out_ecount_part(celt, *pceltFetched) STATPROPSTG *rgelt,
/* [annotation][out] */
__out_opt __deref_out_range(0, celt) ULONG *pceltFetched);
/* [call_as] */ HRESULT STDMETHODCALLTYPE IEnumSTATPROPSTG_Next_Stub(
__RPC__in IEnumSTATPROPSTG * This,
/* [in] */ ULONG celt,
/* [length_is][size_is][out] */ __RPC__out_ecount_part(celt, *pceltFetched) STATPROPSTG *rgelt,
/* [out] */ __RPC__out ULONG *pceltFetched);
/* [local] */ HRESULT STDMETHODCALLTYPE IEnumSTATPROPSETSTG_Next_Proxy(
IEnumSTATPROPSETSTG * This,
/* [in] */ ULONG celt,
/* [annotation][length_is][size_is][out] */
__out_ecount_part(celt, *pceltFetched) STATPROPSETSTG *rgelt,
/* [annotation][out] */
__out_opt __deref_out_range(0, celt) ULONG *pceltFetched);
/* [call_as] */ HRESULT STDMETHODCALLTYPE IEnumSTATPROPSETSTG_Next_Stub(
__RPC__in IEnumSTATPROPSETSTG * This,
/* [in] */ ULONG celt,
/* [length_is][size_is][out] */ __RPC__out_ecount_part(celt, *pceltFetched) STATPROPSETSTG *rgelt,
/* [out] */ __RPC__out ULONG *pceltFetched);
/* end of Additional Prototypes */
#ifdef __cplusplus
}
#endif
#endif
| {
"content_hash": "a9417aa176f47b4a4a831d9cfc785c65",
"timestamp": "",
"source": "github",
"line_count": 1329,
"max_line_length": 150,
"avg_line_length": 31.478555304740407,
"alnum_prop": 0.596605712919804,
"repo_name": "wyrover/SharpDX",
"id": "7add02f0ad8aa392445eaa31e7adb77187737853",
"size": "41835",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "External/gccxml/share/gccxml-0.9/Vc10/PlatformSDK/PropIdl.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "2165038"
},
{
"name": "C#",
"bytes": "10840548"
},
{
"name": "C++",
"bytes": "6556094"
},
{
"name": "CSS",
"bytes": "10347"
},
{
"name": "FLUX",
"bytes": "79643"
},
{
"name": "Shell",
"bytes": "4192"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Reflection;
namespace Nalarium.Reflection
{
public class MethodReader
{
public static List<MethodInfo> GetMethodList(Type type, BindingFlags flags = BindingFlags.Public | BindingFlags.Instance)
{
var fn = type.FullName;
lock (Lock)
{
if (!TypeMethodInfoDictionary.ContainsKey(fn))
{
TypeMethodInfoDictionary.Add(fn, new List<MethodInfo>(type.GetMethods(flags)));
}
if (TypeMethodInfoDictionary.ContainsKey(fn))
{
return TypeMethodInfoDictionary[fn];
}
}
return new List<MethodInfo>();
}
private static readonly Dictionary<string, List<MethodInfo>> TypeMethodInfoDictionary = new Dictionary<string, List<MethodInfo>>();
private static readonly object Lock = new object();
}
} | {
"content_hash": "e9041258e42c482138cfaf34a5849e3c",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 139,
"avg_line_length": 34.758620689655174,
"alnum_prop": 0.5793650793650794,
"repo_name": "davidbetz/nalarium",
"id": "ceed896838acd82d85451a15192a52924ed3fbb0",
"size": "1077",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Nalarium/Reflection/MethodReader.cs",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C#",
"bytes": "452406"
},
{
"name": "Smalltalk",
"bytes": "10744"
}
],
"symlink_target": ""
} |
<?php
/* @var $this PartnersController */
/* @var $model Partners */
$this->breadcrumbs=array(
'Partners'=>array('index'),
$model->id,
);
$this->menu=array(
array('label'=>'List Partners', 'url'=>array('index')),
array('label'=>'Create Partners', 'url'=>array('create')),
array('label'=>'Update Partners', 'url'=>array('update', 'id'=>$model->id)),
array('label'=>'Delete Partners', 'url'=>'#', 'linkOptions'=>array('submit'=>array('delete','id'=>$model->id),'confirm'=>'Are you sure you want to delete this item?')),
array('label'=>'Manage Partners', 'url'=>array('admin')),
);
?>
<h1>View Partners #<?php echo $model->id; ?></h1>
<?php $this->widget('zii.widgets.CDetailView', array(
'data'=>$model,
'attributes'=>array(
'id',
'img',
),
)); ?>
| {
"content_hash": "71f4fbb0ad7e3d00f2a7778e3122f1cd",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 169,
"avg_line_length": 28.296296296296298,
"alnum_prop": 0.6099476439790575,
"repo_name": "NI54Oficina/ni54-yii",
"id": "2b4ba9b5026c3aaeee09f95780592b87476096f2",
"size": "764",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "protected/views/partners/view.php",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "ApacheConf",
"bytes": "424"
},
{
"name": "Batchfile",
"bytes": "1337"
},
{
"name": "CSS",
"bytes": "277251"
},
{
"name": "HTML",
"bytes": "78267"
},
{
"name": "JavaScript",
"bytes": "4064051"
},
{
"name": "PHP",
"bytes": "21638261"
}
],
"symlink_target": ""
} |
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Diagnostics;
using System.Threading;
#if WORKSPACE
using Microsoft.CodeAnalysis.Internal.Log;
#endif
namespace Roslyn.Utilities
{
/// <summary>
/// A lightweight mutual exclusion object which supports waiting with cancellation and prevents
/// recursion (i.e. you may not call Wait if you already hold the lock)
/// </summary>
/// <remarks>
/// <para>
/// The <see cref="NonReentrantLock"/> provides a lightweight mutual exclusion class that doesn't
/// use Windows kernel synchronization primitives.
/// </para>
/// <para>
/// The implementation is distilled from the workings of <see cref="SemaphoreSlim"/>
/// The basic idea is that we use a regular sync object (Monitor.Enter/Exit) to guard the setting
/// of an 'owning thread' field. If, during the Wait, we find the lock is held by someone else
/// then we register a cancellation callback and enter a "Monitor.Wait" loop. If the cancellation
/// callback fires, then it "pulses" all the waiters to wake them up and check for cancellation.
/// Waiters are also "pulsed" when leaving the lock.
/// </para>
/// <para>
/// All public members of <see cref="NonReentrantLock"/> are thread-safe and may be used concurrently
/// from multiple threads.
/// </para>
/// </remarks>
internal sealed class NonReentrantLock
{
/// <summary>
/// A synchronization object to protect access to the <see cref="_owningThreadId"/> field and to be pulsed
/// when <see cref="Release"/> is called and during cancellation.
/// </summary>
private readonly object _syncLock;
/// <summary>
/// The <see cref="Environment.CurrentManagedThreadId" /> of the thread that holds the lock. Zero if no thread is holding
/// the lock.
/// </summary>
private volatile int _owningThreadId;
/// <summary>
/// Constructor.
/// </summary>
/// <param name="useThisInstanceForSynchronization">If false (the default), then the class
/// allocates an internal object to be used as a sync lock.
/// If true, then the sync lock object will be the NonReentrantLock instance itself. This
/// saves an allocation but a client may not safely further use this instance in a call to
/// Monitor.Enter/Exit or in a "lock" statement.
/// </param>
public NonReentrantLock(bool useThisInstanceForSynchronization = false)
{
_syncLock = useThisInstanceForSynchronization ? this : new object();
}
/// <summary>
/// Shared factory for use in lazy initialization.
/// </summary>
public static readonly Func<NonReentrantLock> Factory = () => new NonReentrantLock(useThisInstanceForSynchronization: true);
/// <summary>
/// Blocks the current thread until it can enter the <see cref="NonReentrantLock"/>, while observing a
/// <see cref="CancellationToken"/>.
/// </summary>
/// <remarks>
/// Recursive locking is not supported. i.e. A thread may not call Wait successfully twice without an
/// intervening <see cref="Release"/>.
/// </remarks>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> token to
/// observe.</param>
/// <exception cref="OperationCanceledException"><paramref name="cancellationToken"/> was
/// canceled.</exception>
/// <exception cref="LockRecursionException">The caller already holds the lock</exception>
public void Wait(CancellationToken cancellationToken = default)
{
if (this.IsOwnedByMe)
{
throw new LockRecursionException();
}
CancellationTokenRegistration cancellationTokenRegistration = default;
if (cancellationToken.CanBeCanceled)
{
cancellationToken.ThrowIfCancellationRequested();
// Fast path to try and avoid allocations in callback registration.
lock (_syncLock)
{
if (!this.IsLocked)
{
this.TakeOwnership();
return;
}
}
cancellationTokenRegistration = cancellationToken.Register(s_cancellationTokenCanceledEventHandler, _syncLock, useSynchronizationContext: false);
}
using (cancellationTokenRegistration)
{
// PERF: First spin wait for the lock to become available, but only up to the first planned yield.
// This additional amount of spinwaiting was inherited from SemaphoreSlim's implementation where
// it showed measurable perf gains in test scenarios.
var spin = new SpinWait();
while (this.IsLocked && !spin.NextSpinWillYield)
{
spin.SpinOnce();
}
lock (_syncLock)
{
while (this.IsLocked)
{
// If cancelled, we throw. Trying to wait could lead to deadlock.
cancellationToken.ThrowIfCancellationRequested();
#if WORKSPACE
using (Logger.LogBlock(FunctionId.Misc_NonReentrantLock_BlockingWait, cancellationToken))
#endif
{
// Another thread holds the lock. Wait until we get awoken either
// by some code calling "Release" or by cancellation.
Monitor.Wait(_syncLock);
}
}
// We now hold the lock
this.TakeOwnership();
}
}
}
/// <summary>
/// Exit the mutual exclusion.
/// </summary>
/// <remarks>
/// The calling thread must currently hold the lock.
/// </remarks>
/// <exception cref="InvalidOperationException">The lock is not currently held by the calling thread.</exception>
public void Release()
{
AssertHasLock();
lock (_syncLock)
{
this.ReleaseOwnership();
// Release one waiter
Monitor.Pulse(_syncLock);
}
}
/// <summary>
/// Determine if the lock is currently held by the calling thread.
/// </summary>
/// <returns>True if the lock is currently held by the calling thread.</returns>
public bool LockHeldByMe()
{
return this.IsOwnedByMe;
}
/// <summary>
/// Throw an exception if the lock is not held by the calling thread.
/// </summary>
/// <exception cref="InvalidOperationException">The lock is not currently held by the calling thread.</exception>
public void AssertHasLock()
{
Contract.ThrowIfFalse(LockHeldByMe());
}
/// <summary>
/// Checks if the lock is currently held.
/// </summary>
private bool IsLocked
{
get
{
return _owningThreadId != 0;
}
}
/// <summary>
/// Checks if the lock is currently held by the calling thread.
/// </summary>
private bool IsOwnedByMe
{
get
{
return _owningThreadId == Environment.CurrentManagedThreadId;
}
}
/// <summary>
/// Take ownership of the lock (by the calling thread). The lock may not already
/// be held by any other code.
/// </summary>
private void TakeOwnership()
{
Debug.Assert(!this.IsLocked);
_owningThreadId = Environment.CurrentManagedThreadId;
}
/// <summary>
/// Release ownership of the lock. The lock must already be held by the calling thread.
/// </summary>
private void ReleaseOwnership()
{
Debug.Assert(this.IsOwnedByMe);
_owningThreadId = 0;
}
/// <summary>
/// Action object passed to a cancellation token registration.
/// </summary>
private static readonly Action<object> s_cancellationTokenCanceledEventHandler = CancellationTokenCanceledEventHandler;
/// <summary>
/// Callback executed when a cancellation token is canceled during a Wait.
/// </summary>
/// <param name="obj">The syncLock that protects a <see cref="NonReentrantLock"/> instance.</param>
private static void CancellationTokenCanceledEventHandler(object obj)
{
lock (obj)
{
// Release all waiters to check their cancellation tokens.
Monitor.PulseAll(obj);
}
}
public SemaphoreDisposer DisposableWait(CancellationToken cancellationToken = default)
{
this.Wait(cancellationToken);
return new SemaphoreDisposer(this);
}
/// <summary>
/// Since we want to avoid boxing the return from <see cref="NonReentrantLock.DisposableWait"/>, this type must be public.
/// </summary>
public struct SemaphoreDisposer : IDisposable
{
private readonly NonReentrantLock _semaphore;
public SemaphoreDisposer(NonReentrantLock semaphore)
{
_semaphore = semaphore;
}
public void Dispose()
{
_semaphore.Release();
}
}
}
}
| {
"content_hash": "774203593b206b7a15f6f8cde65f3d13",
"timestamp": "",
"source": "github",
"line_count": 261,
"max_line_length": 161,
"avg_line_length": 38.06130268199234,
"alnum_prop": 0.5724783571572377,
"repo_name": "nguerrera/roslyn",
"id": "dea5e3078280d9ecfb35ceea9ce4af5b79d99a2d",
"size": "9936",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Workspaces/Core/Portable/Utilities/NonReentrantLock.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "1C Enterprise",
"bytes": "289100"
},
{
"name": "Batchfile",
"bytes": "8757"
},
{
"name": "C#",
"bytes": "122747926"
},
{
"name": "C++",
"bytes": "5392"
},
{
"name": "CMake",
"bytes": "9153"
},
{
"name": "Dockerfile",
"bytes": "2102"
},
{
"name": "F#",
"bytes": "508"
},
{
"name": "PowerShell",
"bytes": "217803"
},
{
"name": "Rich Text Format",
"bytes": "14887"
},
{
"name": "Shell",
"bytes": "83770"
},
{
"name": "Smalltalk",
"bytes": "622"
},
{
"name": "Visual Basic",
"bytes": "70046841"
}
],
"symlink_target": ""
} |
// ==UserScript==
// @name ProfessionLevels
// @namespace https://github.com/MyRequiem/comfortablePlayingInGW
// @description На странице информации персонажа отображает оставшееся количество очков до следующего уровня професии.
// @id comfortablePlayingInGW@MyRequiem
// @updateURL https://raw.githubusercontent.com/MyRequiem/comfortablePlayingInGW/master/separatedScripts/ProfessionLevels/professionLevels.meta.js
// @downloadURL https://raw.githubusercontent.com/MyRequiem/comfortablePlayingInGW/master/separatedScripts/ProfessionLevels/professionLevels.user.js
// @include https://*gwars*/info.php?id=*
// @grant none
// @license MIT
// @version 1.02-140522
// @author MyRequiem [https://www.gwars.io/info.php?id=2095458], идея Bodyarm
// ==/UserScript==
| {
"content_hash": "8808bfbe68da1b221de99d3a85694bc4",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 152,
"avg_line_length": 65.07692307692308,
"alnum_prop": 0.7139479905437353,
"repo_name": "MyRequiem/comfortablePlayingInGW",
"id": "3fa8aadaa634b8f8adf162570a216bc29846613d",
"size": "940",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "separatedScripts/ProfessionLevels/professionLevels.meta.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "9523"
},
{
"name": "HTML",
"bytes": "1151814"
},
{
"name": "JavaScript",
"bytes": "1344903"
},
{
"name": "Python",
"bytes": "12132"
},
{
"name": "Shell",
"bytes": "2670"
}
],
"symlink_target": ""
} |
package client
import (
"net/http"
"net/url"
"fmt"
"io/ioutil"
"go-http-client/authorizationProvider"
"go-http-client/entityMapper"
)
type CClient struct {
client *http.Client
url *url.URL
authorizationProvider authorizationProvider.AuthorizationProvider
entityMapper entityMapper.EntityMapper
}
func(cli *CClient) newClient(clientFactory *CClientFactory)(*CClient) {
client := &CClient{}
client.url = clientFactory.baseUrl
client.client = clientFactory.client
client.authorizationProvider = clientFactory.authorizationProvider
client.entityMapper = clientFactory.entityMapper
return client
}
func(cli *CClient) setAuthorization(authorization string) {
cli.authorizationProvider = authorizationProvider.SimpleAuthorizationProvider{Authorization:authorization}
}
func(cli *CClient) newClientWithBaseUrl(clientFactory CClientFactory, baseUrl *url.URL)(*CClient){
client := &CClient{}
client.url = baseUrl
client.client = clientFactory.client
return client
}
func (cli *CClient) Get(path ...string)(*CRequest) {
return cli.newGetRequest(path...)
}
func (cli *CClient) Post(path ...string)(*CRequest) {
return cli.newPostRequest(path...)
}
func (cli *CClient) Delete(path ...string)(*CRequest) {
return cli.newDeleteRequest(path...)
}
func (cli *CClient) Put(path ...string)(*CRequest) {
return cli.newPutRequest(path...)
}
func (cli *CClient) execute(request *http.Request)(*CResponse, error) {
cResponse := &CResponse{}
if cli.authorizationProvider != nil {
request.Header.Set("Authorization", cli.authorizationProvider.GetAuthorization())
}
fmt.Println("request url >>>>>", request.URL.String())
//buf := new(bytes.Buffer)
//buf.ReadFrom(request.Body)
//s := buf.String()
//fmt.Println("request body >>>>>", s)
fmt.Println("request header >>>>>", request.Header)
response, error := cli.client.Do(request)
cResponse.Response = response
if error != nil {
fmt.Println("response error <<<<<", error.Error())
return cResponse, error
}
fmt.Println("response status code <<<<<", cResponse.StatusCode)
body, error := ioutil.ReadAll(cResponse.Body)
if error != nil {
fmt.Println("response error <<<<<", error.Error())
return cResponse, error
}
cResponse.Payload = string(body)
fmt.Println("response header <<<<<", response.Header)
fmt.Println("response body <<<<<", cResponse.Payload)
return cResponse, nil
}
func (cli *CClient) newGetRequest(path ...string)(*CRequest) {
//fmt.Println("URL", this.url)
getRequest, _ := http.NewRequest("GET", "", nil)
request := &CRequest{client: cli, request: getRequest, uriBuilder: cli.url}
return request.Path(path...)
}
func (cli *CClient) newPostRequest(path ...string)(*CRequest) {
//fmt.Println("URL", this.url)
postRequest, _ := http.NewRequest("POST", "", nil)
request := &CRequest{client: cli, request: postRequest, uriBuilder: cli.url}
return request.Path(path...)
}
func (cli *CClient) newDeleteRequest(path ...string)(*CRequest) {
//fmt.Println("URL", this.url)
deleteRequest, _ := http.NewRequest("DELETE", "", nil)
request := &CRequest{client: cli, request: deleteRequest, uriBuilder: cli.url}
return request.Path(path...)
}
func (cli *CClient) newPutRequest(path ...string)(*CRequest) {
//fmt.Println("URL", this.url)
putRequest, _ := http.NewRequest("PUT", "", nil)
request := &CRequest{client: cli, request: putRequest, uriBuilder: cli.url}
return request.Path(path...)
}
| {
"content_hash": "4d7d25dd0ea11aeaf611ea00eff5a99e",
"timestamp": "",
"source": "github",
"line_count": 120,
"max_line_length": 107,
"avg_line_length": 28.45,
"alnum_prop": 0.7155828939660223,
"repo_name": "chao-luo/go-http-client",
"id": "54b9edad9d18361fb9ae2bf80483e63a2f811b53",
"size": "3414",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "client.go",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Go",
"bytes": "10344"
}
],
"symlink_target": ""
} |
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Example - example-select-with-non-string-options-production</title>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.6.2/angular.min.js"></script>
<script src="app.js"></script>
</head>
<body ng-app="nonStringSelect">
<select ng-model="model.id" convert-to-number>
<option value="0">Zero</option>
<option value="1">One</option>
<option value="2">Two</option>
</select>
{{ model }}
</body>
</html> | {
"content_hash": "0903484f53c6c9790508995885bbc01e",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 88,
"avg_line_length": 22.772727272727273,
"alnum_prop": 0.6586826347305389,
"repo_name": "chdyi/Angular.js",
"id": "5563ac4fc82e141a25b18fe335119e35143c941d",
"size": "501",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "BookStore/app/framework/angular-1.6.2/docs/examples/example-select-with-non-string-options/index-production.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "56989"
},
{
"name": "HTML",
"bytes": "3496456"
},
{
"name": "JavaScript",
"bytes": "943499"
}
],
"symlink_target": ""
} |
<div id="lookup" class="container">
<h1>User Lookup</h1>
<form ng-submit="searchUser()" class="row" name="searchfrom">
<div class="input-group col-sm-2 search-button">
<input class="btn btn-primary" type="submit" name="searchterm" value="Search" ng-click="searchUser" data-ng-disabled="checkLength()">
</div>
<div class="input-group col-sm-10">
<div class="input-group-addon"><i class="fa fa-search"></i></div>
<input class="form-control" type="text" ng-model="searchterm" placeholder="Email, username or name">
</div>
<p>Minimum length 4 characters</p>
<div role="alert">
</div>
</form>
<div ng-show="empty">
<div class="alert alert-warning" role="alert">No results found</div>
</div>
<div ng-show="loading">
<p id="loading">Loading Results <i id="loading_spinner" class='fa fa-spinner fa-spin'></i></p>
</div>
<div ng-show="people">
<h3>Search Results</h3>
<table id="user_lookup">
<tr>
<th width="100">User ID</th><th class="name">Name</th><th>Enrolled Courses</th>
</tr>
<tr class="person" ng-repeat="(key, value) in people" ng-click="findUser(key)">
<td width="100">{{key}}</td>
<td class="name">{{value.name}}</td>
<td>
<span ng-repeat="course in value.courses"><span class="label label-info">{{course}}</span> </span>
</td>
</tr>
</table>
</div>
<div ng-show="profile">
<h3>User Profile for {{profile.profile.name}}</h3>
<div id="profile">
<div class="col-sm-6z">
<div class="panel">
<h4>Profile</h4>
<dl>
<dt>User ID:</dt><dd>{{ user_id }}</dd>
<dt>Year of Birth:</dt><dd>{{ profile.profile.year_of_birth }} </dd>
<dt>Gender:</dt><dd>{{ profile.profile.gender }} </dd>
<dt>Country:</dt><dd>{{ profile.profile.country }} </dd>
<dt>Goals:</dt><dd>{{ profile.profile.goals }} </dd>
<dt>Language:</dt><dd>{{ profile.profile.language }} </dd>
<dt>Education:</dt><dd>{{ profile.profile.level_of_education }} </dd>
<dt>Location:</dt><dd>{{ profile.profile.location }} </dd>
<dt>Mailing Address:</dt><dd>{{ profile.profile.mailing_address }} </dd>
</dl>
<iframe
width="100%"
height="300"
frameborder="0" style="border:0; margin-bottom:-5px;"
ng-src="{{profile.profile.country_url}}"
ng-show="profile.profile.country"
>
</iframe>
</div>
</div>
<div class="col-sm-6z">
<div class="panel">
<h4>Enrolled Courses</h4>
<ul>
<li ng-repeat="course in profile.courses">{{course}}</li>
</ul>
</div>
</div>
<div class="col-sm-6z" ng-repeat="(key, value) in profile.person_course">
<div class="panel">
<h4>{{ key }}</h4>
<dl>
<dt>Registered:</dt><dd><i ng-if="value.registered == 1" class="fa fa-check" style="color:green;"></i><i ng-if="value.registered == 0" class="fa fa-times" style="color:red;"></i></dd>
<dt>Explored:</dt><dd><i ng-if="value.explored == 1" class="fa fa-check" style="color:green;"></i><i ng-if="value.explored == 0" class="fa fa-times" style="color:red;"></i></dd>
<dt>Certified:</dt><dd><i ng-if="value.certified == 1" class="fa fa-check" style="color:green;"></i><i ng-if="value.certified == 0" class="fa fa-times" style="color:red;"></i></dd>
<dt>Grade:</dt><dd>{{ value.grade }}</dd>
<dt>Mode:</dt><dd>{{ value.mode }}</dd>
<dt>Chapters Viewed:</dt><dd>{{ value.nchapters }}</dd>
<dt>Videos viewed:</dt><dd>{{ value.nplay_video }}</dd>
<dt>Discussion Posts:</dt><dd>{{ value.nforum_posts }}</dd>
<dt>Number of events:</dt><dd>{{ value.nevents }}</dd>
<dt>Enrolled:</dt><dd>{{ value.start_time }}</dd>
<dt>Last Event:</dt><dd>{{ value.last_event }}</dd>
<dt>Days Active:</dt><dd>{{ value.ndays_act }}</dd>
</dl>
</div>
</div>
</div>
</div>
</div>
<style>
form.row {
margin-bottom:20px;
}
div.panel {
border:1px solid #ddd;
}
div.panel h4 {
text-align:center;
padding:5px;
margin:0;
background:#ddd;
}
div.panel dl, div.panel ul {
margin:10px;
overflow:auto;
}
div.panel dl dt {
width:150px;
text-align:right;
margin-right:10px;
float:left;
clear:left;
}
div.panel dl dd {
float:left;
}
a.person {
border:1px solid #fafafa;
padding:5px;
margin-bottom:5px;
background:#ddd;
}
div.search-button {
float:right !important;
padding-left:10px !important;
}
table#user_lookup {
margin-bottom:40px;
margin-top:20px;
border:1px solid #ccc;
width:100%;
}
table#user_lookup th {
text-align:center;
padding:10px;
background:#fafafa;
padding:4px;
color:#333 !important;
border:1px solid #ccc;
}
table#user_lookup td {
padding:6px;
}
table#user_lookup span {
margin-right:5px;
}
table#user_lookup tr:nth-child(even) {
background:#eee;
}
table .name {
width:200px !important;
}
table#user_lookup tr:hover {
background:#369;
color:#fff;
cursor: pointer;
}
#profile {
margin-bottom:40px;
}
#profile {
-webkit-column-count: 3;
-webkit-column-gap: 10px;
-webkit-column-fill: auto;
-moz-column-count: 3;
-moz-column-gap: 10px;
-moz-column-fill: auto;
column-count: 3;
column-gap: 15px;
column-fill: auto;
}
.col-sm-6z {
-webkit-column-break-inside: avoid; /* Chrome, Safari, Opera */
page-break-inside: avoid; /* Firefox */
break-inside: avoid; /* IE 10+ */
}
#loading {
font-size:150%;
margin-bottom:20px;
}
</style> | {
"content_hash": "a9e2a73e0677bb44ef34aadf36f103ca",
"timestamp": "",
"source": "github",
"line_count": 187,
"max_line_length": 203,
"avg_line_length": 36.54545454545455,
"alnum_prop": 0.4784899034240562,
"repo_name": "UQ-UQx/dashboard_js",
"id": "fcb9dcfac774bd679bb6eda5d0e79e4b207d745f",
"size": "6834",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/views/person.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "24139"
},
{
"name": "CSS",
"bytes": "11345"
},
{
"name": "HTML",
"bytes": "74771"
},
{
"name": "JavaScript",
"bytes": "174058"
}
],
"symlink_target": ""
} |
require 'date'
require 'google/apis/core/base_service'
require 'google/apis/core/json_representation'
require 'google/apis/core/hashable'
require 'google/apis/errors'
module Google
module Apis
module NetworksecurityV1beta1
class AuthorizationPolicy
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class CancelOperationRequest
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class CertificateProviderInstance
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class ClientTlsPolicy
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class Destination
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class Empty
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class Expr
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudNetworksecurityV1beta1CertificateProvider
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudNetworksecurityV1beta1GrpcEndpoint
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleIamV1AuditConfig
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleIamV1AuditLogConfig
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleIamV1Binding
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleIamV1Policy
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleIamV1SetIamPolicyRequest
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleIamV1TestIamPermissionsRequest
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleIamV1TestIamPermissionsResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class HttpHeaderMatch
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class ListAuthorizationPoliciesResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class ListClientTlsPoliciesResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class ListLocationsResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class ListOperationsResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class ListServerTlsPoliciesResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class Location
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class MtlsPolicy
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class Operation
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class OperationMetadata
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class Rule
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class ServerTlsPolicy
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class Source
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class Status
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class ValidationCa
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class AuthorizationPolicy
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :action, as: 'action'
property :create_time, as: 'createTime'
property :description, as: 'description'
hash :labels, as: 'labels'
property :name, as: 'name'
collection :rules, as: 'rules', class: Google::Apis::NetworksecurityV1beta1::Rule, decorator: Google::Apis::NetworksecurityV1beta1::Rule::Representation
property :update_time, as: 'updateTime'
end
end
class CancelOperationRequest
# @private
class Representation < Google::Apis::Core::JsonRepresentation
end
end
class CertificateProviderInstance
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :plugin_instance, as: 'pluginInstance'
end
end
class ClientTlsPolicy
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :client_certificate, as: 'clientCertificate', class: Google::Apis::NetworksecurityV1beta1::GoogleCloudNetworksecurityV1beta1CertificateProvider, decorator: Google::Apis::NetworksecurityV1beta1::GoogleCloudNetworksecurityV1beta1CertificateProvider::Representation
property :create_time, as: 'createTime'
property :description, as: 'description'
hash :labels, as: 'labels'
property :name, as: 'name'
collection :server_validation_ca, as: 'serverValidationCa', class: Google::Apis::NetworksecurityV1beta1::ValidationCa, decorator: Google::Apis::NetworksecurityV1beta1::ValidationCa::Representation
property :sni, as: 'sni'
property :update_time, as: 'updateTime'
end
end
class Destination
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :hosts, as: 'hosts'
property :http_header_match, as: 'httpHeaderMatch', class: Google::Apis::NetworksecurityV1beta1::HttpHeaderMatch, decorator: Google::Apis::NetworksecurityV1beta1::HttpHeaderMatch::Representation
collection :methods_prop, as: 'methods'
collection :ports, as: 'ports'
end
end
class Empty
# @private
class Representation < Google::Apis::Core::JsonRepresentation
end
end
class Expr
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :description, as: 'description'
property :expression, as: 'expression'
property :location, as: 'location'
property :title, as: 'title'
end
end
class GoogleCloudNetworksecurityV1beta1CertificateProvider
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :certificate_provider_instance, as: 'certificateProviderInstance', class: Google::Apis::NetworksecurityV1beta1::CertificateProviderInstance, decorator: Google::Apis::NetworksecurityV1beta1::CertificateProviderInstance::Representation
property :grpc_endpoint, as: 'grpcEndpoint', class: Google::Apis::NetworksecurityV1beta1::GoogleCloudNetworksecurityV1beta1GrpcEndpoint, decorator: Google::Apis::NetworksecurityV1beta1::GoogleCloudNetworksecurityV1beta1GrpcEndpoint::Representation
end
end
class GoogleCloudNetworksecurityV1beta1GrpcEndpoint
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :target_uri, as: 'targetUri'
end
end
class GoogleIamV1AuditConfig
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :audit_log_configs, as: 'auditLogConfigs', class: Google::Apis::NetworksecurityV1beta1::GoogleIamV1AuditLogConfig, decorator: Google::Apis::NetworksecurityV1beta1::GoogleIamV1AuditLogConfig::Representation
property :service, as: 'service'
end
end
class GoogleIamV1AuditLogConfig
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :exempted_members, as: 'exemptedMembers'
property :log_type, as: 'logType'
end
end
class GoogleIamV1Binding
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :condition, as: 'condition', class: Google::Apis::NetworksecurityV1beta1::Expr, decorator: Google::Apis::NetworksecurityV1beta1::Expr::Representation
collection :members, as: 'members'
property :role, as: 'role'
end
end
class GoogleIamV1Policy
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :audit_configs, as: 'auditConfigs', class: Google::Apis::NetworksecurityV1beta1::GoogleIamV1AuditConfig, decorator: Google::Apis::NetworksecurityV1beta1::GoogleIamV1AuditConfig::Representation
collection :bindings, as: 'bindings', class: Google::Apis::NetworksecurityV1beta1::GoogleIamV1Binding, decorator: Google::Apis::NetworksecurityV1beta1::GoogleIamV1Binding::Representation
property :etag, :base64 => true, as: 'etag'
property :version, as: 'version'
end
end
class GoogleIamV1SetIamPolicyRequest
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :policy, as: 'policy', class: Google::Apis::NetworksecurityV1beta1::GoogleIamV1Policy, decorator: Google::Apis::NetworksecurityV1beta1::GoogleIamV1Policy::Representation
property :update_mask, as: 'updateMask'
end
end
class GoogleIamV1TestIamPermissionsRequest
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :permissions, as: 'permissions'
end
end
class GoogleIamV1TestIamPermissionsResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :permissions, as: 'permissions'
end
end
class HttpHeaderMatch
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :header_name, as: 'headerName'
property :regex_match, as: 'regexMatch'
end
end
class ListAuthorizationPoliciesResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :authorization_policies, as: 'authorizationPolicies', class: Google::Apis::NetworksecurityV1beta1::AuthorizationPolicy, decorator: Google::Apis::NetworksecurityV1beta1::AuthorizationPolicy::Representation
property :next_page_token, as: 'nextPageToken'
end
end
class ListClientTlsPoliciesResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :client_tls_policies, as: 'clientTlsPolicies', class: Google::Apis::NetworksecurityV1beta1::ClientTlsPolicy, decorator: Google::Apis::NetworksecurityV1beta1::ClientTlsPolicy::Representation
property :next_page_token, as: 'nextPageToken'
end
end
class ListLocationsResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :locations, as: 'locations', class: Google::Apis::NetworksecurityV1beta1::Location, decorator: Google::Apis::NetworksecurityV1beta1::Location::Representation
property :next_page_token, as: 'nextPageToken'
end
end
class ListOperationsResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :next_page_token, as: 'nextPageToken'
collection :operations, as: 'operations', class: Google::Apis::NetworksecurityV1beta1::Operation, decorator: Google::Apis::NetworksecurityV1beta1::Operation::Representation
end
end
class ListServerTlsPoliciesResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :next_page_token, as: 'nextPageToken'
collection :server_tls_policies, as: 'serverTlsPolicies', class: Google::Apis::NetworksecurityV1beta1::ServerTlsPolicy, decorator: Google::Apis::NetworksecurityV1beta1::ServerTlsPolicy::Representation
end
end
class Location
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :display_name, as: 'displayName'
hash :labels, as: 'labels'
property :location_id, as: 'locationId'
hash :metadata, as: 'metadata'
property :name, as: 'name'
end
end
class MtlsPolicy
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :client_validation_ca, as: 'clientValidationCa', class: Google::Apis::NetworksecurityV1beta1::ValidationCa, decorator: Google::Apis::NetworksecurityV1beta1::ValidationCa::Representation
end
end
class Operation
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :done, as: 'done'
property :error, as: 'error', class: Google::Apis::NetworksecurityV1beta1::Status, decorator: Google::Apis::NetworksecurityV1beta1::Status::Representation
hash :metadata, as: 'metadata'
property :name, as: 'name'
hash :response, as: 'response'
end
end
class OperationMetadata
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :api_version, as: 'apiVersion'
property :create_time, as: 'createTime'
property :end_time, as: 'endTime'
property :requested_cancellation, as: 'requestedCancellation'
property :status_message, as: 'statusMessage'
property :target, as: 'target'
property :verb, as: 'verb'
end
end
class Rule
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :destinations, as: 'destinations', class: Google::Apis::NetworksecurityV1beta1::Destination, decorator: Google::Apis::NetworksecurityV1beta1::Destination::Representation
collection :sources, as: 'sources', class: Google::Apis::NetworksecurityV1beta1::Source, decorator: Google::Apis::NetworksecurityV1beta1::Source::Representation
end
end
class ServerTlsPolicy
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :allow_open, as: 'allowOpen'
property :create_time, as: 'createTime'
property :description, as: 'description'
hash :labels, as: 'labels'
property :mtls_policy, as: 'mtlsPolicy', class: Google::Apis::NetworksecurityV1beta1::MtlsPolicy, decorator: Google::Apis::NetworksecurityV1beta1::MtlsPolicy::Representation
property :name, as: 'name'
property :server_certificate, as: 'serverCertificate', class: Google::Apis::NetworksecurityV1beta1::GoogleCloudNetworksecurityV1beta1CertificateProvider, decorator: Google::Apis::NetworksecurityV1beta1::GoogleCloudNetworksecurityV1beta1CertificateProvider::Representation
property :update_time, as: 'updateTime'
end
end
class Source
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :ip_blocks, as: 'ipBlocks'
collection :principals, as: 'principals'
end
end
class Status
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :code, as: 'code'
collection :details, as: 'details'
property :message, as: 'message'
end
end
class ValidationCa
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :certificate_provider_instance, as: 'certificateProviderInstance', class: Google::Apis::NetworksecurityV1beta1::CertificateProviderInstance, decorator: Google::Apis::NetworksecurityV1beta1::CertificateProviderInstance::Representation
property :grpc_endpoint, as: 'grpcEndpoint', class: Google::Apis::NetworksecurityV1beta1::GoogleCloudNetworksecurityV1beta1GrpcEndpoint, decorator: Google::Apis::NetworksecurityV1beta1::GoogleCloudNetworksecurityV1beta1GrpcEndpoint::Representation
end
end
end
end
end
| {
"content_hash": "507d2c625a3c76d12f9c25bf19b81c45",
"timestamp": "",
"source": "github",
"line_count": 497,
"max_line_length": 281,
"avg_line_length": 38.203219315895375,
"alnum_prop": 0.6590825301522094,
"repo_name": "googleapis/google-api-ruby-client",
"id": "9ac0a44701bd85091663189bd4769753a95b58a3",
"size": "19563",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "generated/google-apis-networksecurity_v1beta1/lib/google/apis/networksecurity_v1beta1/representations.rb",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Ruby",
"bytes": "198322756"
},
{
"name": "Shell",
"bytes": "19549"
}
],
"symlink_target": ""
} |
//
// NSString+Additions.m
//
//
// Created by 王会洲 on 16/2/19.
// Copyright © 2016年 王会洲. All rights reserved.
//
#import "NSString+Additions.h"
#import "NSString+MD5.h"
@implementation NSString (Additions)
/**
* 获取手机UUID
*
* @return <#return value description#>
*/
+ (NSString *)generateGuid {
CFUUIDRef uuidObj = CFUUIDCreate(nil);//create a new UUID
//get the string representation of the UUID
NSString *uuidString = (NSString*)CFBridgingRelease(CFUUIDCreateString(nil, uuidObj));
CFRelease(uuidObj);
return uuidString;
}
///////////////////////////////////////////////////////////////////////////////////////////////////
- (BOOL)isWhitespaceAndNewlines {
NSCharacterSet* whitespace = [NSCharacterSet whitespaceAndNewlineCharacterSet];
for (NSInteger i = 0; i < self.length; ++i) {
unichar c = [self characterAtIndex:i];
if (![whitespace characterIsMember:c]) {
return NO;
}
}
return YES;
}
///////////////////////////////////////////////////////////////////////////////////////////////////
- (BOOL)isEmptyOrWhitespace {
return !self.length ||
![self stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]].length;
}
///////////////////////////////////////////////////////////////////////////////////////////////////
- (void)BystringURL:(NSDictionary *)quary {
[self stringByAddingQueryDictionary:quary];
}
- (NSString*)stringByAddingQueryDictionary:(NSDictionary*)query {
NSMutableArray* pairs = [NSMutableArray array];
for (NSString* key in [query keyEnumerator]) {
NSString* value = [query objectForKey:key];
value = [value stringByReplacingOccurrencesOfString:@"?" withString:@"%3F"];
value = [value stringByReplacingOccurrencesOfString:@"=" withString:@"%3D"];
NSString* pair = [NSString stringWithFormat:@"%@=%@", key, value];
[pairs addObject:pair];
}
NSString* params = [pairs componentsJoinedByString:@"&"];
if ([self rangeOfString:@"?"].location == NSNotFound) {
return [self stringByAppendingFormat:@"?%@", params];
} else {
return [self stringByAppendingFormat:@"&%@", params];
}
}
///////////////////////////////////////////////////////////////////////////////////////////////////
- (NSComparisonResult)versionStringCompare:(NSString *)other {
NSArray *oneComponents = [self componentsSeparatedByString:@"a"];
NSArray *twoComponents = [other componentsSeparatedByString:@"a"];
// The parts before the "a"
NSString *oneMain = [oneComponents objectAtIndex:0];
NSString *twoMain = [twoComponents objectAtIndex:0];
// If main parts are different, return that result, regardless of alpha part
NSComparisonResult mainDiff;
if ((mainDiff = [oneMain compare:twoMain]) != NSOrderedSame) {
return mainDiff;
}
// At this point the main parts are the same; just deal with alpha stuff
// If one has an alpha part and the other doesn't, the one without is newer
if ([oneComponents count] < [twoComponents count]) {
return NSOrderedDescending;
} else if ([oneComponents count] > [twoComponents count]) {
return NSOrderedAscending;
} else if ([oneComponents count] == 1) {
// Neither has an alpha part, and we know the main parts are the same
return NSOrderedSame;
}
// At this point the main parts are the same and both have alpha parts. Compare the alpha parts
// numerically. If it's not a valid number (including empty string) it's treated as zero.
NSNumber *oneAlpha = [NSNumber numberWithInt:[[oneComponents objectAtIndex:1] intValue]];
NSNumber *twoAlpha = [NSNumber numberWithInt:[[twoComponents objectAtIndex:1] intValue]];
return [oneAlpha compare:twoAlpha];
}
///////////////////////////////////////////////////////////////////////////////////////////////////
- (NSString*)md5Hash
{
return [NSString md5HexDigest:self];
}
- (CGSize)heightWithFont:(UIFont *)Font width:(CGFloat)width {
return [self heightWithFont:Font width:width linebreak:NSStringDrawingUsesLineFragmentOrigin];
}
- (CGSize)heightWithFont:(UIFont *)withFont width:(CGFloat)width linebreak:(NSStringDrawingOptions)Options{
NSDictionary * attrs = @{NSFontAttributeName : withFont};
CGSize maxSize = CGSizeMake(width, MAXFLOAT);
return [self boundingRectWithSize:maxSize options:Options attributes:attrs context:nil].size;
}
/**
* 替换文本中的空格
*
* @param replaceString 替换文本
*
* @return <#return value description#>
*/
- (NSString *)replacedWhiteSpacsByString:(NSString *)replaceString{
if (IsNilOrNull(self) || IsNilOrNull(replaceString) ) {
return nil;
}
NSString *memberNameRegex = @"\\s+";
NSString *replace = [self stringByReplacingOccurrencesOfString:memberNameRegex withString:replaceString options:NSRegularExpressionSearch range:NSMakeRange(0, [self length])];
return replace;
}
/**
* 对URL地址进行 Encode 才能继续访问
*
* @return <#return value description#>
*/
- (NSString *)URLEvalutionEncoding
{
NSString * result = (__bridge_transfer NSString *)CFURLCreateStringByAddingPercentEscapes( kCFAllocatorDefault,
(CFStringRef)self,
NULL,
(CFStringRef)@"!*'();:@&=+$,/?%#[]",
kCFStringEncodingUTF8 );
return result;
}
- (NSString *)queryStringNoEncodeFromDictionary:(NSDictionary *)dict
{
return [NSString queryStringFromDictionary:dict addingPercentEscapes:NO];
}
+ (NSString *)queryStringFromDictionary:(NSDictionary *)dict addingPercentEscapes:(BOOL)add
{
NSMutableArray * pairs = [NSMutableArray array];
for ( NSString * key in [dict keyEnumerator] )
{
id value = [dict valueForKey:key];
if ([value isKindOfClass:[NSNumber class]])
{
value = [value stringValue];
}
else if ([value isKindOfClass:[NSString class]])
{
}
else
{
continue;
}
[pairs addObject:[NSString stringWithFormat:@"%@=%@",
add?[key URLEncoding]:key,
add?[value URLEncoding]:value]];
}
return [pairs componentsJoinedByString:@"&"];
}
- (NSString *)URLEncoding
{
return [self stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
}
- (NSString *)URLDecoding
{
return [self stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
}
- (NSString *)passport
{
return [NSString stringWithFormat:@"%@", [self copy]];
}
@end
| {
"content_hash": "7acdba01429319bdd4aff22f07954a8f",
"timestamp": "",
"source": "github",
"line_count": 218,
"max_line_length": 179,
"avg_line_length": 30.65137614678899,
"alnum_prop": 0.6110445974259204,
"repo_name": "7General/HZAdditions",
"id": "00c5111ba63b2cbdf9a75f27d08998d6b4cbdfd0",
"size": "6751",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "HZAdditions/Classes/NSStringHelper/NSString+Additions.m",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "Objective-C",
"bytes": "82962"
},
{
"name": "Ruby",
"bytes": "1516"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "1768e6ec4699f145856f32adec78a800",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 31,
"avg_line_length": 9.692307692307692,
"alnum_prop": 0.7063492063492064,
"repo_name": "mdoering/backbone",
"id": "f06ea16e594221c07a42494a7aeeeb8f75424ae1",
"size": "175",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Aquifoliales/Aquifoliaceae/Ilex/Ilex tsiangiana/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
<?php
class Menu extends ActiveRecord {
function getElements($element) {
return $this->find("conditions: disposicion = '" . $element . "'");
}
}
| {
"content_hash": "591e1fa64fa1471ce94c0418d559d382",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 75,
"avg_line_length": 18.22222222222222,
"alnum_prop": 0.6036585365853658,
"repo_name": "nelsonrojas/kuTiendaCMS",
"id": "356ab5e14567aab0fbc49f65467cab09fb786ce9",
"size": "164",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "default/app/models/menu.php",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "ApacheConf",
"bytes": "907"
},
{
"name": "CSS",
"bytes": "312432"
},
{
"name": "HTML",
"bytes": "98359"
},
{
"name": "JavaScript",
"bytes": "32247"
},
{
"name": "PHP",
"bytes": "830709"
}
],
"symlink_target": ""
} |
@interface SharedDismissAnimator : NSObject <UIViewControllerAnimatedTransitioning>
@property (nonatomic, assign) NSTimeInterval transitionDuration;
@end
| {
"content_hash": "8c17734f9517e16afa068009f52c0c99",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 83,
"avg_line_length": 31.2,
"alnum_prop": 0.8525641025641025,
"repo_name": "doozMen/SharedCustomPresentations",
"id": "bd1a7e70690577ceb7eaa8de48db218f489a6be5",
"size": "183",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Vendor/SharedDismissAnimator.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Objective-C",
"bytes": "15605"
},
{
"name": "Ruby",
"bytes": "268"
}
],
"symlink_target": ""
} |
<md-card>
<md-card-title>
<md-card-title-text>
<span class="md-headline">Pole</span>
</md-card-title-text>
</md-card-title>
<form flex novalidate name="validatePoleForm[num]"
ng-submit="validatePoleForm[num].$valid
&& vm.submitPoleInfo(vm.forms['validatePole'], vm.selectedIndexValidate-1,vm.thisPersonValidate[vm.selectedIndexValidate-1],true)">
<md-card-content layout="row" flex>
<md-input-container>
<md-select ng-model="vm.thisPersonValidate[vm.selectedIndexValidate-1].institution_city_id"
name="city_id">
<md-option ng-repeat="city in vm.institutionCities"
ng-value="city.id">{{city.city}}</md-option>
</md-select>
</md-input-container>
<div layout="column" layout-gt-sm="row" layout-align="none center">
<md-button type="submit"
class="button-small md-raised md-primary">Update</md-button>
<div class="status-message" ng-hide="vm.hideMessage[vm.forms['validatePole']]">
<span class="message" ng-class="vm.messageType[vm.forms['validatePole']]">
{{vm.updateStatus[vm.forms['validatePole']]}}
</span>
</div>
</div>
</md-card-content>
</form>
</md-card>
| {
"content_hash": "0c3d39d1d6615cbd23806fe32a1c5a58",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 139,
"avg_line_length": 48.93103448275862,
"alnum_prop": 0.5503875968992248,
"repo_name": "jose-braga/data-management",
"id": "14265c02b28af739efd5da77cd0f7a48ef5f92ac",
"size": "1419",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app_client/manager/validate_details/validate.personInstitutionCity.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "10392"
},
{
"name": "HTML",
"bytes": "1566809"
},
{
"name": "JavaScript",
"bytes": "3026291"
}
],
"symlink_target": ""
} |
namespace OJS.Web.Areas.Administration.ViewModels.Participant
{
using System;
using System.Linq.Expressions;
using OJS.Common.DataAnnotations;
using OJS.Data.Models;
public class ContestViewModel
{
[ExcludeFromExcel]
public static Expression<Func<Contest, ContestViewModel>> ViewModel
{
get
{
return c => new ContestViewModel
{
Id = c.Id,
Name = c.Name
};
}
}
public int Id { get; set; }
public string Name { get; set; }
}
} | {
"content_hash": "2b535d7f3afd541554fbce136994c997",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 75,
"avg_line_length": 22.464285714285715,
"alnum_prop": 0.5119236883942766,
"repo_name": "hackohackob/OpenJudgeSystem",
"id": "19e2e068c942d6dcdaf346f8d0bdc703c88d7377",
"size": "631",
"binary": false,
"copies": "7",
"ref": "refs/heads/master",
"path": "Open Judge System/Web/OJS.Web/Areas/Administration/ViewModels/Participant/ContestViewModel.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "98"
},
{
"name": "Batchfile",
"bytes": "758"
},
{
"name": "C#",
"bytes": "1817508"
},
{
"name": "CSS",
"bytes": "287438"
},
{
"name": "HTML",
"bytes": "53"
},
{
"name": "Java",
"bytes": "6107"
},
{
"name": "JavaScript",
"bytes": "5836667"
},
{
"name": "Smalltalk",
"bytes": "435"
}
],
"symlink_target": ""
} |
using System.Numerics;
using System.Threading;
using System.Threading.Tasks;
using Nethereum.Contracts.ContractHandlers;
using Nethereum.Contracts.Services;
using Nethereum.Contracts.Standards.ENS.ETHRegistrarController.ContractDefinition;
using Nethereum.RPC.Eth.DTOs;
namespace Nethereum.Contracts.Standards.ENS
{
public partial class ETHRegistrarControllerService
{
public string ContractAddress { get; }
public ContractHandler ContractHandler { get; }
public ETHRegistrarControllerService(IEthApiContractService ethApiContractService, string contractAddress)
{
ContractAddress = contractAddress;
#if !DOTNET35
ContractHandler = ethApiContractService.GetContractHandler(contractAddress);
#endif
}
#if !DOTNET35
public Task<BigInteger> MinRegistrationDurationQueryAsync(MinRegistrationDurationFunction minRegistrationDurationFunction, BlockParameter blockParameter = null)
{
return ContractHandler.QueryAsync<MinRegistrationDurationFunction, BigInteger>(minRegistrationDurationFunction, blockParameter);
}
public Task<BigInteger> MinRegistrationDurationQueryAsync(BlockParameter blockParameter = null)
{
return ContractHandler.QueryAsync<MinRegistrationDurationFunction, BigInteger>(null, blockParameter);
}
public Task<bool> AvailableQueryAsync(AvailableFunction availableFunction, BlockParameter blockParameter = null)
{
return ContractHandler.QueryAsync<AvailableFunction, bool>(availableFunction, blockParameter);
}
public Task<bool> AvailableQueryAsync(string name, BlockParameter blockParameter = null)
{
var availableFunction = new AvailableFunction();
availableFunction.Name = name;
return ContractHandler.QueryAsync<AvailableFunction, bool>(availableFunction, blockParameter);
}
public Task<string> CommitRequestAsync(CommitFunction commitFunction)
{
return ContractHandler.SendRequestAsync(commitFunction);
}
public Task<TransactionReceipt> CommitRequestAndWaitForReceiptAsync(CommitFunction commitFunction, CancellationToken cancellationToken = default)
{
return ContractHandler.SendRequestAndWaitForReceiptAsync(commitFunction, cancellationToken);
}
public Task<string> CommitRequestAsync(byte[] commitment)
{
var commitFunction = new CommitFunction();
commitFunction.Commitment = commitment;
return ContractHandler.SendRequestAsync(commitFunction);
}
public Task<TransactionReceipt> CommitRequestAndWaitForReceiptAsync(byte[] commitment, CancellationToken cancellationToken = default)
{
var commitFunction = new CommitFunction();
commitFunction.Commitment = commitment;
return ContractHandler.SendRequestAndWaitForReceiptAsync(commitFunction, cancellationToken);
}
public Task<BigInteger> CommitmentsQueryAsync(CommitmentsFunction commitmentsFunction, BlockParameter blockParameter = null)
{
return ContractHandler.QueryAsync<CommitmentsFunction, BigInteger>(commitmentsFunction, blockParameter);
}
public Task<BigInteger> CommitmentsQueryAsync(byte[] returnValue1, BlockParameter blockParameter = null)
{
var commitmentsFunction = new CommitmentsFunction();
commitmentsFunction.ReturnValue1 = returnValue1;
return ContractHandler.QueryAsync<CommitmentsFunction, BigInteger>(commitmentsFunction, blockParameter);
}
public Task<bool> IsOwnerQueryAsync(IsOwnerFunction isOwnerFunction, BlockParameter blockParameter = null)
{
return ContractHandler.QueryAsync<IsOwnerFunction, bool>(isOwnerFunction, blockParameter);
}
public Task<bool> IsOwnerQueryAsync(BlockParameter blockParameter = null)
{
return ContractHandler.QueryAsync<IsOwnerFunction, bool>(null, blockParameter);
}
public Task<byte[]> MakeCommitmentQueryAsync(MakeCommitmentFunction makeCommitmentFunction, BlockParameter blockParameter = null)
{
return ContractHandler.QueryAsync<MakeCommitmentFunction, byte[]>(makeCommitmentFunction, blockParameter);
}
public Task<byte[]> MakeCommitmentQueryAsync(string name, string owner, byte[] secret, BlockParameter blockParameter = null)
{
var makeCommitmentFunction = new MakeCommitmentFunction();
makeCommitmentFunction.Name = name;
makeCommitmentFunction.Owner = owner;
makeCommitmentFunction.Secret = secret;
return ContractHandler.QueryAsync<MakeCommitmentFunction, byte[]>(makeCommitmentFunction, blockParameter);
}
public Task<byte[]> MakeCommitmentWithConfigQueryAsync(MakeCommitmentWithConfigFunction makeCommitmentWithConfigFunction, BlockParameter blockParameter = null)
{
return ContractHandler.QueryAsync<MakeCommitmentWithConfigFunction, byte[]>(makeCommitmentWithConfigFunction, blockParameter);
}
public Task<byte[]> MakeCommitmentWithConfigQueryAsync(string name, string owner, byte[] secret, string resolver, string addr, BlockParameter blockParameter = null)
{
var makeCommitmentWithConfigFunction = new MakeCommitmentWithConfigFunction();
makeCommitmentWithConfigFunction.Name = name;
makeCommitmentWithConfigFunction.Owner = owner;
makeCommitmentWithConfigFunction.Secret = secret;
makeCommitmentWithConfigFunction.Resolver = resolver;
makeCommitmentWithConfigFunction.Addr = addr;
return ContractHandler.QueryAsync<MakeCommitmentWithConfigFunction, byte[]>(makeCommitmentWithConfigFunction, blockParameter);
}
public Task<BigInteger> MaxCommitmentAgeQueryAsync(MaxCommitmentAgeFunction maxCommitmentAgeFunction, BlockParameter blockParameter = null)
{
return ContractHandler.QueryAsync<MaxCommitmentAgeFunction, BigInteger>(maxCommitmentAgeFunction, blockParameter);
}
public Task<BigInteger> MaxCommitmentAgeQueryAsync(BlockParameter blockParameter = null)
{
return ContractHandler.QueryAsync<MaxCommitmentAgeFunction, BigInteger>(null, blockParameter);
}
public Task<BigInteger> MinCommitmentAgeQueryAsync(MinCommitmentAgeFunction minCommitmentAgeFunction, BlockParameter blockParameter = null)
{
return ContractHandler.QueryAsync<MinCommitmentAgeFunction, BigInteger>(minCommitmentAgeFunction, blockParameter);
}
public Task<BigInteger> MinCommitmentAgeQueryAsync(BlockParameter blockParameter = null)
{
return ContractHandler.QueryAsync<MinCommitmentAgeFunction, BigInteger>(null, blockParameter);
}
public Task<string> OwnerQueryAsync(OwnerFunction ownerFunction, BlockParameter blockParameter = null)
{
return ContractHandler.QueryAsync<OwnerFunction, string>(ownerFunction, blockParameter);
}
public Task<string> OwnerQueryAsync(BlockParameter blockParameter = null)
{
return ContractHandler.QueryAsync<OwnerFunction, string>(null, blockParameter);
}
public Task<string> RegisterRequestAsync(RegisterFunction registerFunction)
{
return ContractHandler.SendRequestAsync(registerFunction);
}
public Task<TransactionReceipt> RegisterRequestAndWaitForReceiptAsync(RegisterFunction registerFunction, CancellationToken cancellationToken = default)
{
return ContractHandler.SendRequestAndWaitForReceiptAsync(registerFunction, cancellationToken);
}
public Task<string> RegisterRequestAsync(string name, string owner, BigInteger duration, byte[] secret)
{
var registerFunction = new RegisterFunction();
registerFunction.Name = name;
registerFunction.Owner = owner;
registerFunction.Duration = duration;
registerFunction.Secret = secret;
return ContractHandler.SendRequestAsync(registerFunction);
}
public Task<TransactionReceipt> RegisterRequestAndWaitForReceiptAsync(string name, string owner, BigInteger duration, byte[] secret, CancellationToken cancellationToken = default)
{
var registerFunction = new RegisterFunction();
registerFunction.Name = name;
registerFunction.Owner = owner;
registerFunction.Duration = duration;
registerFunction.Secret = secret;
return ContractHandler.SendRequestAndWaitForReceiptAsync(registerFunction, cancellationToken);
}
public Task<string> RegisterWithConfigRequestAsync(RegisterWithConfigFunction registerWithConfigFunction)
{
return ContractHandler.SendRequestAsync(registerWithConfigFunction);
}
public Task<TransactionReceipt> RegisterWithConfigRequestAndWaitForReceiptAsync(RegisterWithConfigFunction registerWithConfigFunction, CancellationToken cancellationToken = default)
{
return ContractHandler.SendRequestAndWaitForReceiptAsync(registerWithConfigFunction, cancellationToken);
}
public Task<string> RegisterWithConfigRequestAsync(string name, string owner, BigInteger duration, byte[] secret, string resolver, string addr)
{
var registerWithConfigFunction = new RegisterWithConfigFunction();
registerWithConfigFunction.Name = name;
registerWithConfigFunction.Owner = owner;
registerWithConfigFunction.Duration = duration;
registerWithConfigFunction.Secret = secret;
registerWithConfigFunction.Resolver = resolver;
registerWithConfigFunction.Addr = addr;
return ContractHandler.SendRequestAsync(registerWithConfigFunction);
}
public Task<TransactionReceipt> RegisterWithConfigRequestAndWaitForReceiptAsync(string name, string owner, BigInteger duration, byte[] secret, string resolver, string addr, CancellationToken cancellationToken = default)
{
var registerWithConfigFunction = new RegisterWithConfigFunction();
registerWithConfigFunction.Name = name;
registerWithConfigFunction.Owner = owner;
registerWithConfigFunction.Duration = duration;
registerWithConfigFunction.Secret = secret;
registerWithConfigFunction.Resolver = resolver;
registerWithConfigFunction.Addr = addr;
return ContractHandler.SendRequestAndWaitForReceiptAsync(registerWithConfigFunction, cancellationToken);
}
public Task<string> RenewRequestAsync(RenewFunction renewFunction)
{
return ContractHandler.SendRequestAsync(renewFunction);
}
public Task<TransactionReceipt> RenewRequestAndWaitForReceiptAsync(RenewFunction renewFunction, CancellationToken cancellationToken = default)
{
return ContractHandler.SendRequestAndWaitForReceiptAsync(renewFunction, cancellationToken);
}
public Task<string> RenewRequestAsync(string name, BigInteger duration)
{
var renewFunction = new RenewFunction();
renewFunction.Name = name;
renewFunction.Duration = duration;
return ContractHandler.SendRequestAsync(renewFunction);
}
public Task<TransactionReceipt> RenewRequestAndWaitForReceiptAsync(string name, BigInteger duration, CancellationToken cancellationToken = default)
{
var renewFunction = new RenewFunction();
renewFunction.Name = name;
renewFunction.Duration = duration;
return ContractHandler.SendRequestAndWaitForReceiptAsync(renewFunction, cancellationToken);
}
public Task<string> RenounceOwnershipRequestAsync(RenounceOwnershipFunction renounceOwnershipFunction)
{
return ContractHandler.SendRequestAsync(renounceOwnershipFunction);
}
public Task<string> RenounceOwnershipRequestAsync()
{
return ContractHandler.SendRequestAsync<RenounceOwnershipFunction>();
}
public Task<TransactionReceipt> RenounceOwnershipRequestAndWaitForReceiptAsync(RenounceOwnershipFunction renounceOwnershipFunction, CancellationToken cancellationToken = default)
{
return ContractHandler.SendRequestAndWaitForReceiptAsync(renounceOwnershipFunction, cancellationToken);
}
public Task<TransactionReceipt> RenounceOwnershipRequestAndWaitForReceiptAsync(CancellationToken cancellationToken = default)
{
return ContractHandler.SendRequestAndWaitForReceiptAsync<RenounceOwnershipFunction>(null, cancellationToken);
}
public Task<BigInteger> RentPriceQueryAsync(RentPriceFunction rentPriceFunction, BlockParameter blockParameter = null)
{
return ContractHandler.QueryAsync<RentPriceFunction, BigInteger>(rentPriceFunction, blockParameter);
}
public Task<BigInteger> RentPriceQueryAsync(string name, BigInteger duration, BlockParameter blockParameter = null)
{
var rentPriceFunction = new RentPriceFunction();
rentPriceFunction.Name = name;
rentPriceFunction.Duration = duration;
return ContractHandler.QueryAsync<RentPriceFunction, BigInteger>(rentPriceFunction, blockParameter);
}
public Task<string> SetCommitmentAgesRequestAsync(SetCommitmentAgesFunction setCommitmentAgesFunction)
{
return ContractHandler.SendRequestAsync(setCommitmentAgesFunction);
}
public Task<TransactionReceipt> SetCommitmentAgesRequestAndWaitForReceiptAsync(SetCommitmentAgesFunction setCommitmentAgesFunction, CancellationToken cancellationToken = default)
{
return ContractHandler.SendRequestAndWaitForReceiptAsync(setCommitmentAgesFunction, cancellationToken);
}
public Task<string> SetCommitmentAgesRequestAsync(BigInteger minCommitmentAge, BigInteger maxCommitmentAge)
{
var setCommitmentAgesFunction = new SetCommitmentAgesFunction();
setCommitmentAgesFunction.MinCommitmentAge = minCommitmentAge;
setCommitmentAgesFunction.MaxCommitmentAge = maxCommitmentAge;
return ContractHandler.SendRequestAsync(setCommitmentAgesFunction);
}
public Task<TransactionReceipt> SetCommitmentAgesRequestAndWaitForReceiptAsync(BigInteger minCommitmentAge, BigInteger maxCommitmentAge, CancellationToken cancellationToken = default)
{
var setCommitmentAgesFunction = new SetCommitmentAgesFunction();
setCommitmentAgesFunction.MinCommitmentAge = minCommitmentAge;
setCommitmentAgesFunction.MaxCommitmentAge = maxCommitmentAge;
return ContractHandler.SendRequestAndWaitForReceiptAsync(setCommitmentAgesFunction, cancellationToken);
}
public Task<string> SetPriceOracleRequestAsync(SetPriceOracleFunction setPriceOracleFunction)
{
return ContractHandler.SendRequestAsync(setPriceOracleFunction);
}
public Task<TransactionReceipt> SetPriceOracleRequestAndWaitForReceiptAsync(SetPriceOracleFunction setPriceOracleFunction, CancellationToken cancellationToken = default)
{
return ContractHandler.SendRequestAndWaitForReceiptAsync(setPriceOracleFunction, cancellationToken);
}
public Task<string> SetPriceOracleRequestAsync(string prices)
{
var setPriceOracleFunction = new SetPriceOracleFunction();
setPriceOracleFunction.Prices = prices;
return ContractHandler.SendRequestAsync(setPriceOracleFunction);
}
public Task<TransactionReceipt> SetPriceOracleRequestAndWaitForReceiptAsync(string prices, CancellationToken cancellationToken = default)
{
var setPriceOracleFunction = new SetPriceOracleFunction();
setPriceOracleFunction.Prices = prices;
return ContractHandler.SendRequestAndWaitForReceiptAsync(setPriceOracleFunction, cancellationToken);
}
public Task<bool> SupportsInterfaceQueryAsync(SupportsInterfaceFunction supportsInterfaceFunction, BlockParameter blockParameter = null)
{
return ContractHandler.QueryAsync<SupportsInterfaceFunction, bool>(supportsInterfaceFunction, blockParameter);
}
public Task<bool> SupportsInterfaceQueryAsync(byte[] interfaceID, BlockParameter blockParameter = null)
{
var supportsInterfaceFunction = new SupportsInterfaceFunction();
supportsInterfaceFunction.InterfaceID = interfaceID;
return ContractHandler.QueryAsync<SupportsInterfaceFunction, bool>(supportsInterfaceFunction, blockParameter);
}
public Task<string> TransferOwnershipRequestAsync(TransferOwnershipFunction transferOwnershipFunction)
{
return ContractHandler.SendRequestAsync(transferOwnershipFunction);
}
public Task<TransactionReceipt> TransferOwnershipRequestAndWaitForReceiptAsync(TransferOwnershipFunction transferOwnershipFunction, CancellationToken cancellationToken = default)
{
return ContractHandler.SendRequestAndWaitForReceiptAsync(transferOwnershipFunction, cancellationToken);
}
public Task<string> TransferOwnershipRequestAsync(string newOwner)
{
var transferOwnershipFunction = new TransferOwnershipFunction();
transferOwnershipFunction.NewOwner = newOwner;
return ContractHandler.SendRequestAsync(transferOwnershipFunction);
}
public Task<TransactionReceipt> TransferOwnershipRequestAndWaitForReceiptAsync(string newOwner, CancellationToken cancellationToken = default)
{
var transferOwnershipFunction = new TransferOwnershipFunction();
transferOwnershipFunction.NewOwner = newOwner;
return ContractHandler.SendRequestAndWaitForReceiptAsync(transferOwnershipFunction, cancellationToken);
}
public Task<bool> ValidQueryAsync(ValidFunction validFunction, BlockParameter blockParameter = null)
{
return ContractHandler.QueryAsync<ValidFunction, bool>(validFunction, blockParameter);
}
public Task<bool> ValidQueryAsync(string name, BlockParameter blockParameter = null)
{
var validFunction = new ValidFunction();
validFunction.Name = name;
return ContractHandler.QueryAsync<ValidFunction, bool>(validFunction, blockParameter);
}
public Task<string> WithdrawRequestAsync(WithdrawFunction withdrawFunction)
{
return ContractHandler.SendRequestAsync(withdrawFunction);
}
public Task<string> WithdrawRequestAsync()
{
return ContractHandler.SendRequestAsync<WithdrawFunction>();
}
public Task<TransactionReceipt> WithdrawRequestAndWaitForReceiptAsync(WithdrawFunction withdrawFunction, CancellationToken cancellationToken = default)
{
return ContractHandler.SendRequestAndWaitForReceiptAsync(withdrawFunction, cancellationToken);
}
public Task<TransactionReceipt> WithdrawRequestAndWaitForReceiptAsync(CancellationToken cancellationToken = default)
{
return ContractHandler.SendRequestAndWaitForReceiptAsync<WithdrawFunction>(null, cancellationToken);
}
#endif
}
}
| {
"content_hash": "a74fd45afc56f3ca900042ba276fb277",
"timestamp": "",
"source": "github",
"line_count": 428,
"max_line_length": 227,
"avg_line_length": 47.67056074766355,
"alnum_prop": 0.709111405185512,
"repo_name": "Nethereum/Nethereum",
"id": "d675ef0b636113edd61eebb99b7b3fd05d592d9b",
"size": "20403",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Nethereum.Contracts/Standards/ENS/ETHRegistrarControllerService.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "28273"
},
{
"name": "C#",
"bytes": "6563861"
},
{
"name": "CSS",
"bytes": "3744"
},
{
"name": "HTML",
"bytes": "11092"
},
{
"name": "JavaScript",
"bytes": "2403758"
},
{
"name": "Shell",
"bytes": "2183"
},
{
"name": "Solidity",
"bytes": "50472"
},
{
"name": "TypeScript",
"bytes": "151156"
}
],
"symlink_target": ""
} |
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var web_linter_1 = require("./worker/web-linter");
var rules = require("codelyzer");
var rulesConfig = {
'directive-selector': [true, 'attribute', 'sg', 'camelCase'],
'component-selector': [true, 'element', 'sg', 'kebab-case'],
'use-input-property-decorator': true,
'use-output-property-decorator': true,
'use-host-property-decorator': true,
'no-input-rename': true,
'no-output-rename': true,
'use-life-cycle-interface': true,
'use-pipe-transform-interface': true,
'component-class-suffix': true,
'directive-class-suffix': true,
'import-destructuring-spacing': true,
'templates-use-public': true,
'no-access-missing-member': true,
'invoke-injectable': true,
'no-unused-css': true
};
var ruleToClass = function (ruleName) {
var result = ruleName.replace(/(\-\w)/g, function (m) { return m[1].toUpperCase(); }) + 'Rule';
return result[0].toUpperCase() + result.slice(1, result.length);
};
var getRules = function (config) {
return Object.keys(config).map(function (k) {
var className = ruleToClass(k);
var ruleConfig = config[k];
return new rules[className](k, ruleConfig, []);
});
};
var linter = new web_linter_1.WebLinter();
self.addEventListener('message', function (e) {
var config = JSON.parse(e.data);
var output = null;
var error = null;
try {
linter.lint('file.ts', config.program, getRules(rulesConfig));
output = linter.getResult().output;
}
catch (e) {
error = e;
}
if (error) {
self.postMessage({ error: error });
}
else {
self.postMessage({ output: output });
}
linter.reset();
});
//# sourceMappingURL=worker.js.map | {
"content_hash": "4e449480d2ef662ef0b192c388dea4e8",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 99,
"avg_line_length": 33.27777777777778,
"alnum_prop": 0.6238174735670562,
"repo_name": "mgechev/codelyzer",
"id": "3c72d7c1258de28704f4b9660d02349e97cdbeeb",
"size": "1797",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docs/dist/worker.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "161"
},
{
"name": "TypeScript",
"bytes": "816712"
}
],
"symlink_target": ""
} |
package envoy_extensions_filters_http_rbac_v3
import (
"bytes"
"errors"
"fmt"
"net"
"net/mail"
"net/url"
"regexp"
"strings"
"time"
"unicode/utf8"
"google.golang.org/protobuf/types/known/anypb"
)
// ensure the imports are used
var (
_ = bytes.MinRead
_ = errors.New("")
_ = fmt.Print
_ = utf8.UTFMax
_ = (*regexp.Regexp)(nil)
_ = (*strings.Reader)(nil)
_ = net.IPv4len
_ = time.Duration(0)
_ = (*url.URL)(nil)
_ = (*mail.Address)(nil)
_ = anypb.Any{}
)
// Validate checks the field values on RBAC with the rules defined in the proto
// definition for this message. If any rules are violated, an error is returned.
func (m *RBAC) Validate() error {
if m == nil {
return nil
}
if v, ok := interface{}(m.GetRules()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return RBACValidationError{
field: "Rules",
reason: "embedded message failed validation",
cause: err,
}
}
}
if v, ok := interface{}(m.GetShadowRules()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return RBACValidationError{
field: "ShadowRules",
reason: "embedded message failed validation",
cause: err,
}
}
}
// no validation rules for ShadowRulesStatPrefix
return nil
}
// RBACValidationError is the validation error returned by RBAC.Validate if the
// designated constraints aren't met.
type RBACValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e RBACValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e RBACValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e RBACValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e RBACValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e RBACValidationError) ErrorName() string { return "RBACValidationError" }
// Error satisfies the builtin error interface
func (e RBACValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sRBAC.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = RBACValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = RBACValidationError{}
// Validate checks the field values on RBACPerRoute with the rules defined in
// the proto definition for this message. If any rules are violated, an error
// is returned.
func (m *RBACPerRoute) Validate() error {
if m == nil {
return nil
}
if v, ok := interface{}(m.GetRbac()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return RBACPerRouteValidationError{
field: "Rbac",
reason: "embedded message failed validation",
cause: err,
}
}
}
return nil
}
// RBACPerRouteValidationError is the validation error returned by
// RBACPerRoute.Validate if the designated constraints aren't met.
type RBACPerRouteValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e RBACPerRouteValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e RBACPerRouteValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e RBACPerRouteValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e RBACPerRouteValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e RBACPerRouteValidationError) ErrorName() string { return "RBACPerRouteValidationError" }
// Error satisfies the builtin error interface
func (e RBACPerRouteValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sRBACPerRoute.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = RBACPerRouteValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = RBACPerRouteValidationError{}
| {
"content_hash": "b60cdac2f4e0b92f3529632430a8fc59",
"timestamp": "",
"source": "github",
"line_count": 192,
"max_line_length": 96,
"avg_line_length": 22.526041666666668,
"alnum_prop": 0.6855491329479769,
"repo_name": "knative-sandbox/eventing-natss",
"id": "4e42e7f125452838338baab9effeaf50ada83dbf",
"size": "4441",
"binary": false,
"copies": "4",
"ref": "refs/heads/main",
"path": "vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/rbac/v3/rbac.pb.validate.go",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Go",
"bytes": "222377"
},
{
"name": "Shell",
"bytes": "7436"
}
],
"symlink_target": ""
} |
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "6bd9b22d2cf36c017b5edbb3095ae052",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.23076923076923,
"alnum_prop": 0.6917293233082706,
"repo_name": "mdoering/backbone",
"id": "43b3ad325335fb717a580ecb3a623d205bdbc32f",
"size": "190",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Brassicales/Brassicaceae/Lepidium/Lepidium flavum/ Syn. Lepidium flavum flavum/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
package org.knowm.xchange.bitfinex.v1.service.marketdata;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.Test;
import org.knowm.xchange.Exchange;
import org.knowm.xchange.ExchangeFactory;
import org.knowm.xchange.bitfinex.BitfinexExchange;
import org.knowm.xchange.currency.CurrencyPair;
import org.knowm.xchange.dto.marketdata.Ticker;
import org.knowm.xchange.service.marketdata.MarketDataService;
/** @author timmolter */
public class TickerFetchIntegration {
@Test
public void tickerFetchTest() throws Exception {
Exchange exchange = ExchangeFactory.INSTANCE.createExchange(BitfinexExchange.class.getName());
MarketDataService marketDataService = exchange.getMarketDataService();
Ticker ticker = marketDataService.getTicker(new CurrencyPair("BTC", "USD"));
System.out.println(ticker.toString());
assertThat(ticker).isNotNull();
}
}
| {
"content_hash": "5f992036f000fc61da38639942f69d7f",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 98,
"avg_line_length": 35.76,
"alnum_prop": 0.7953020134228188,
"repo_name": "Panchen/XChange",
"id": "fbc2aa8ec705e5402fefd21055d4e0f90d9a1a07",
"size": "894",
"binary": false,
"copies": "2",
"ref": "refs/heads/develop",
"path": "xchange-bitfinex/src/test/java/org/knowm/xchange/bitfinex/v1/service/marketdata/TickerFetchIntegration.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "9114865"
}
],
"symlink_target": ""
} |
#ifndef FLTTRANSFORMPUT_H
#define FLTTRANSFORMPUT_H
#include "pandatoolbase.h"
#include "fltTransformRecord.h"
/**
* A "put", which is a MultiGen concept of defining a transformation by
* mapping three arbitrary points to three new arbitrary points.
*/
class FltTransformPut : public FltTransformRecord {
public:
FltTransformPut(FltHeader *header);
void set(const LPoint3d &from_origin,
const LPoint3d &from_align,
const LPoint3d &from_track,
const LPoint3d &to_origin,
const LPoint3d &to_align,
const LPoint3d &to_track);
const LPoint3d &get_from_origin() const;
const LPoint3d &get_from_align() const;
const LPoint3d &get_from_track() const;
const LPoint3d &get_to_origin() const;
const LPoint3d &get_to_align() const;
const LPoint3d &get_to_track() const;
private:
void recompute_matrix();
LPoint3d _from_origin;
LPoint3d _from_align;
LPoint3d _from_track;
LPoint3d _to_origin;
LPoint3d _to_align;
LPoint3d _to_track;
protected:
virtual bool extract_record(FltRecordReader &reader);
virtual bool build_record(FltRecordWriter &writer) const;
public:
virtual TypeHandle get_type() const {
return get_class_type();
}
virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
static TypeHandle get_class_type() {
return _type_handle;
}
static void init_type() {
FltTransformRecord::init_type();
register_type(_type_handle, "FltTransformPut",
FltTransformRecord::get_class_type());
}
private:
static TypeHandle _type_handle;
};
#endif
| {
"content_hash": "f31d1cf2b9dac2caa3493aeb907d1847",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 78,
"avg_line_length": 25.109375,
"alnum_prop": 0.6944617299315494,
"repo_name": "tobspr/panda3d",
"id": "fdfab77825572ce9b16de0890d260b439c959cfb",
"size": "1962",
"binary": false,
"copies": "15",
"ref": "refs/heads/master",
"path": "pandatool/src/flt/fltTransformPut.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Batchfile",
"bytes": "4004"
},
{
"name": "C",
"bytes": "6724918"
},
{
"name": "C++",
"bytes": "25480688"
},
{
"name": "Emacs Lisp",
"bytes": "229264"
},
{
"name": "Groff",
"bytes": "3106"
},
{
"name": "HTML",
"bytes": "8081"
},
{
"name": "Java",
"bytes": "3113"
},
{
"name": "JavaScript",
"bytes": "7003"
},
{
"name": "Logos",
"bytes": "5504"
},
{
"name": "MAXScript",
"bytes": "1745"
},
{
"name": "NSIS",
"bytes": "92320"
},
{
"name": "Nemerle",
"bytes": "4403"
},
{
"name": "Objective-C",
"bytes": "28865"
},
{
"name": "Objective-C++",
"bytes": "257446"
},
{
"name": "Perl",
"bytes": "206982"
},
{
"name": "Perl6",
"bytes": "30484"
},
{
"name": "Puppet",
"bytes": "2627"
},
{
"name": "Python",
"bytes": "5537773"
},
{
"name": "R",
"bytes": "421"
},
{
"name": "Shell",
"bytes": "55940"
},
{
"name": "Visual Basic",
"bytes": "136"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>Filterland Industries</title>
<!-- Favicon -->
<link rel='shortcut icon' type='image/x-icon' href='/favicon.ico' />
<!-- Bootstrap Core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- Custom CSS -->
<link href="css/full-slider.css" rel="stylesheet">
<link href="css/main.css" rel="stylesheet">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<!-- Navigation -->
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html">Filterland Industries</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li>
<a href="about.html">About</a>
</li>
<li>
<a href="products.html">Our Products</a>
</li>
<li>
<a href="team.html">Team</a>
</li>
<li>
<a href="contact.html">Contact us</a>
</li>
<li>
<a href="book.html">Book</a>
</li>
<li>
<a href="career.html">Careers</a>
</li>
<li>
<a href="distributor.html">Do Business with us</a>
</li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container -->
</nav>
<div class="container" style="margin-top: 50px;">
<div class="row">
<div class="col-lg-12">
<h1> <span style="color: green"> About Filterland Industries Limited </span> </h1>
<h3> <span style="color: green"> South Korean Origin: </span> </h3>
<p><b> We manufacture Oil & Gas Filters, Fuel Filters, Air Filters & Hydraulic Filters</b></p> <p>Filterland Industries Limited is in the business of Automotive Oil, Fuel & Air filter manufacturing. It started out as a South Korean company with 100% South Korean equity-holding before some prominent Nigerian Industrialists who share the company's values bought into it, recently thus making it a South Korean-Nigerian company. Filterland is an off-shoot and sister company of NamPoong Enterprises Company Limited which started its first filter factory in Pocheon, Kyungki province, South Korean in April, 1981.</p>
<h3> <span style="color: green"> Multi-National Experience </span> </h3>
<p>After 14 years of filter manufacturing in South Korea, the company established another factory Outside Korea in Ghana partnering with Crystal Auto Limited as a joint venture company in December 1995. Crystal Auto Company Limited, Ghana was and still manufacturing a full range of Automotive Oil, Fuel & Air Filters like the parent company up till date. After 3 years of successful joint venture operations with Crystal Auto Company limited in Ghana, the company decided to register its presence fully in Ghana by establishing Nam Poong Ghana limited, in November 1998.</p>
<h3> <span style="color: green"> Commencement of production in Nigeria </span> </h3>
<p>Then 25 years after the establishment and successful operation of the parent company & factory in South Korea and subsequent successful establishement of filter production factories in Ghana, the company decided to extend its operations to Nigeria, which culminated in the registration of Filterland Industries Ltd with its factory in Lagos after commencement of filter production in Nigeria and follomwing a very good reception of the products of the company in the Nigerian market & West African sub-region, the company decided to invest in additional machines and equipments in order to increase its production capacity.</p>
<h3> <span style="color: green"> Our Vision: </span> </h3>
<p>Our Vision is to be the preferred producer and supplier of high quality automotive Oil & Fuel filter in Nigeria and the West African Sub-region.</p>
<h3> <span style="color: green"> Our Mission: </span> </h3>
<p>Our desire is to produce and provide very high quality, engine-life enhancing filters of international standards-filters that will remain STABLE & RELIABLE even in conditions of high temperatures to automotive filter users who appreciate quality.</p>
<h3> <span style="color: green"> Quality & Safety Policy Statement </span> </h3>
<p>At filterland, because safety and quality are the watch-words, we are sincerely and totally committed to the philosophy that for every Filter we manufacture and offer, we will understand the safety and quality expectations of our customers and we will fulfill those expectations without exception. As one of the leading filter manufacturer, we provide our customers with a wide range of super solid quality filter products and engineering services of international standards based on our leading edge and constantly enhannced technologies.</p>
<h3> <span style="color: green"> Human Resources and Expertise: </span> </h3>
<h5> <span style="color: green"> Technical Know-how: </span> </h5>
<p>All the technical expertise and raw materials are still being provided by the parent company from south Korea. Indeed, the current Managing Director of Filterland industry Limtied, Mr H. K Lee is also the joint Managing Director of Nam Poong Enterprises Company Limited, South Korea while the other technical expatriate, Messrs Min, Park, Choi et al were all seconded from the parent company in South Korea to Filterland Industry Limited. Mr H. K Lee has more than 30 years on international pragmatic working experience in Automotive filter manufacturing. The technical & maintenance managers also have vast and multi-national experiences in the automotive filter making business. To complement the expatriate technical team, we have a good number of highly experienced Nigerian mechanical, electrical and production engineers and technicians who are involved in the day to day operations of the company.</p>
</div>
</div>
<hr>
<!-- Footer -->
<footer style="margin-bottom: 0;">
<div class="row">
<div >
<a href="https://twitter.com/FilterlandNg"><img width="45px;" height="40px;" src="img/twitter.png"></a>
<a href="https://www.facebook.com/filterlandindustries"><img width="25px;" height="40px;" src="img/facebook.png"></a></div>
<div class="col-lg-12" style="width: 40%; float: left; padding-top: 55px">
<p style="color: #C0C0C0">Copyright © Filterland industries 2008 |
Design by <a href="http://priincetech.com/index.html">Priince</a></p>
</div>
<div style="float: left; width: 50%">
<table>
<tr>
<td><img class="icon-filter-image" src="img/filter1.png"></td>
<td><img class="icon-filter-image" src="img/filter2.png"></td>
<td><img class="icon-filter-image" src="img/filter3.png"></td>
<td><img class="icon-filter-image" src="img/filter4.png"></td>
<td><img class="icon-filter-image" src="img/filter5.png"></td>
<td><img class="icon-filter-image" src="img/filter6.png"></td>
<td><img class="icon-filter-image" src="img/filter7.png"></td>
<td><img class="icon-filter-image" src="img/filter8.png"></td>
<td><img class="icon-filter-image" src="img/filter10.png"></td>
<td><img class="icon-filter-image" src="img/filter11.png"></td>
<td><img class="icon-filter-image" src="img/filter12.png"></td>
<td><img class="icon-filter-image" src="img/filter13.png"></td>
<td><img class="icon-filter-image" src="img/filter14.png"></td>
</tr>
</table>
</div>
</div>
<!-- /.row -->
</footer>
</div>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-65762947-2', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>
| {
"content_hash": "82c991e07b0a888cd3db79dcd1d77e18",
"timestamp": "",
"source": "github",
"line_count": 150,
"max_line_length": 927,
"avg_line_length": 67.98,
"alnum_prop": 0.604197312935177,
"repo_name": "filterland/filterland.github.io",
"id": "4c388dea177486b58a9c27a6d63b5a30ddd1a906",
"size": "10197",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "about.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "193203"
},
{
"name": "HTML",
"bytes": "67923"
},
{
"name": "JavaScript",
"bytes": "38152"
}
],
"symlink_target": ""
} |
'use strict';
module.exports = function (grunt) {
var resolve = require('path').resolve.bind(process.cwd()),
requireResolve = function (module) {
var start = module.substr(0, 2);
return (start !== './' && start !== '..') ? module : resolve(module);
},
extend = grunt.util._.extend;
grunt.registerMultiTask('bem', 'bem make', function () {
var options = extend({
require: 'bem',
targets: this.target
}, this.options(), this.data),
done = this.async();
var BEM = require(requireResolve(options.require)),
Q = BEM.require('q');
Q.when(BEM.api.make(options), done, function (err) {
grunt.log.error(err);
done(false);
});
});
};
| {
"content_hash": "3186c1d43b6837c27bf2fc94ce1b5f49",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 81,
"avg_line_length": 25.5625,
"alnum_prop": 0.5048899755501223,
"repo_name": "eprev/grunt-bem",
"id": "af83d03e346c504f1f8df7d2e8fc48632ea1618b",
"size": "947",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tasks/bem.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "6145"
}
],
"symlink_target": ""
} |
mod store;
pub mod ttl;
pub use store::RawStore;
pub use ttl::TTLSnapshot;
| {
"content_hash": "02dcc73344b456b254c9c75f00ee2d9f",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 25,
"avg_line_length": 15.2,
"alnum_prop": 0.7368421052631579,
"repo_name": "c4pt0r/tikv",
"id": "82ca51838097074a49ba34ecea7a3be71179c2d2",
"size": "144",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/storage/raw/mod.rs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Makefile",
"bytes": "849"
},
{
"name": "Rust",
"bytes": "929827"
}
],
"symlink_target": ""
} |
/**
*
*/
package hmi.ant;
import org.apache.tools.ant.*;
import org.apache.tools.ant.types.*;
import org.apache.tools.ant.types.resources.*;
import java.io.*;
import java.util.*;
import java.util.regex.*;
/**
* GetManifestVersion tries to read the current specification version from the manifest file.
*/
public class GetManifestVersion extends Task {
private String versionprop;
private String manifestfile;
private Union resources = new Union();
public void setVersionProp(String property) {
this.versionprop = property;
}
public void setManifestFile(String manifestfile) {
this.manifestfile = manifestfile;
}
@Override
public void execute() throws BuildException {
if (versionprop==null) {
throw new BuildException("No versionprop defined");
}
if (manifestfile==null) {
throw new BuildException("No manifestfile defined");
}
String basedir = getProject().getProperty("basedir");
//log("basedir: " + basedir);
//File mfFile = new File(manifestfile);
String version ="0";
LineNumberReader reader = null;
try {
reader = new LineNumberReader(new FileReader(basedir + "/" + manifestfile));
String line = reader.readLine();
lr: while (line!= null) {
StringTokenizer tokenizer = new StringTokenizer(line);
while (tokenizer.hasMoreTokens()) {
String token = tokenizer.nextToken();
if (token.equals("Specification-Version:")) {
if (tokenizer.hasMoreTokens()) {
version = tokenizer.nextToken();
}
reader.close();
break lr;
}
}
line = reader.readLine();
}
reader.close();
} catch (FileNotFoundException e) {
throw new BuildException("GetManifestVersion: " + e);
} catch (IOException io) {
throw new BuildException("GetManifestVersion: " + io) ;
}
getProject().setNewProperty(versionprop, version);
}
}
| {
"content_hash": "062198e97c52fd3ea9ce316b6c706dfb",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 93,
"avg_line_length": 28.256410256410255,
"alnum_prop": 0.574410163339383,
"repo_name": "jankolkmeier/HmiCore",
"id": "71b87eb79d786f7c23867fa8f0a3ee3d105697e3",
"size": "2204",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "HmiAnt/src/hmi/ant/GetManifestVersion.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "1436"
},
{
"name": "C",
"bytes": "29837"
},
{
"name": "C++",
"bytes": "61960"
},
{
"name": "CSS",
"bytes": "3084"
},
{
"name": "F#",
"bytes": "1256"
},
{
"name": "GLSL",
"bytes": "13410"
},
{
"name": "HTML",
"bytes": "1041691"
},
{
"name": "Java",
"bytes": "5282327"
},
{
"name": "TeX",
"bytes": "154264"
}
],
"symlink_target": ""
} |
<?php
declare(strict_types = 1);
namespace Innmind\AMQP\Model\Channel;
final class Flow
{
private bool $active;
private function __construct(bool $active)
{
$this->active = $active;
}
public static function start(): self
{
return new self(true);
}
public static function stop(): self
{
return new self(false);
}
public function active(): bool
{
return $this->active;
}
}
| {
"content_hash": "1a1e8eff901ea9fd2d494fb84030ba73",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 46,
"avg_line_length": 15.89655172413793,
"alnum_prop": 0.579175704989154,
"repo_name": "Innmind/AMQP",
"id": "89773ac6c399d1d697c2001980ced8bdfb7d766f",
"size": "461",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "src/Model/Channel/Flow.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Makefile",
"bytes": "237"
},
{
"name": "PHP",
"bytes": "574618"
}
],
"symlink_target": ""
} |
Testing creating brew tap
| {
"content_hash": "e957857dbaae1ff4186e57792fc1cf3a",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 25,
"avg_line_length": 26,
"alnum_prop": 0.8461538461538461,
"repo_name": "hughperkins/homebrew-test-travis-osx",
"id": "8b522a6b1abaa6b377fbe71a8226aeef2f20671b",
"size": "44",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "C++",
"bytes": "117"
},
{
"name": "CMake",
"bytes": "36"
},
{
"name": "Ruby",
"bytes": "4220"
}
],
"symlink_target": ""
} |
<?php
namespace juanluisroman\CslmBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Doctrine\ORM\EntityRepository;
class RealizarEjercicioType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('preguntas', 'collection', array('type' => new RespuestaCortaEType()))
->add('guardar', 'submit');
}
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array(
'data_class' => 'juanluisroman\CslmBundle\Entity\Ejercicio',
));
}
public function getName()
{
return 'realizar_ejercicio_form';
}
}
| {
"content_hash": "9b2f9f5b9d5e5087008d1e50abff3d8a",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 88,
"avg_line_length": 25.75,
"alnum_prop": 0.691747572815534,
"repo_name": "jltrinity/pfc",
"id": "6b17f2ac5d13b1e08e50b35f07fdac1842705a9b",
"size": "824",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/juanluisroman/CslmBundle/Form/RealizarEjercicioType.php",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "2731"
},
{
"name": "CSS",
"bytes": "39316"
},
{
"name": "HTML",
"bytes": "139517"
},
{
"name": "PHP",
"bytes": "229694"
},
{
"name": "Rebol",
"bytes": "2601"
}
],
"symlink_target": ""
} |
package javax.config;
public interface ConfigurationModelBuilder {
public ConfigurationModelBuilder withName(String name);
public ConfigurationModelBuilder withModel(ConfigurationModel type);
public ConfigurationModelBuilder withModel(String modelId);
public ConfigurationModelBuilder withConfiguration(Configuration config);
public ConfigurationModelBuilder withQuery(ConfigurationQuery query);
public ConfigurationModel build();
}
| {
"content_hash": "18d9ae695aa407d53a131b5165ddce81",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 74,
"avg_line_length": 27.352941176470587,
"alnum_prop": 0.8193548387096774,
"repo_name": "abadelt/javaconfig-api",
"id": "492c68d34256fa7eab64523b48168b6e467a88d3",
"size": "465",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/javax/config/ConfigurationModelBuilder.java",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
from collections import OrderedDict
import functools
import re
from typing import (
Dict,
Mapping,
MutableMapping,
MutableSequence,
Optional,
Sequence,
Tuple,
Type,
Union,
)
from google.api_core import exceptions as core_exceptions
from google.api_core import gapic_v1
from google.api_core import retry as retries
from google.api_core.client_options import ClientOptions
from google.auth import credentials as ga_credentials # type: ignore
from google.oauth2 import service_account # type: ignore
import pkg_resources
try:
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
except AttributeError: # pragma: NO COVER
OptionalRetry = Union[retries.Retry, object] # type: ignore
from google.protobuf import timestamp_pb2 # type: ignore
from google.cloud.binaryauthorization_v1beta1.types import resources, service
from .client import SystemPolicyV1Beta1Client
from .transports.base import DEFAULT_CLIENT_INFO, SystemPolicyV1Beta1Transport
from .transports.grpc_asyncio import SystemPolicyV1Beta1GrpcAsyncIOTransport
class SystemPolicyV1Beta1AsyncClient:
"""API for working with the system policy."""
_client: SystemPolicyV1Beta1Client
DEFAULT_ENDPOINT = SystemPolicyV1Beta1Client.DEFAULT_ENDPOINT
DEFAULT_MTLS_ENDPOINT = SystemPolicyV1Beta1Client.DEFAULT_MTLS_ENDPOINT
policy_path = staticmethod(SystemPolicyV1Beta1Client.policy_path)
parse_policy_path = staticmethod(SystemPolicyV1Beta1Client.parse_policy_path)
common_billing_account_path = staticmethod(
SystemPolicyV1Beta1Client.common_billing_account_path
)
parse_common_billing_account_path = staticmethod(
SystemPolicyV1Beta1Client.parse_common_billing_account_path
)
common_folder_path = staticmethod(SystemPolicyV1Beta1Client.common_folder_path)
parse_common_folder_path = staticmethod(
SystemPolicyV1Beta1Client.parse_common_folder_path
)
common_organization_path = staticmethod(
SystemPolicyV1Beta1Client.common_organization_path
)
parse_common_organization_path = staticmethod(
SystemPolicyV1Beta1Client.parse_common_organization_path
)
common_project_path = staticmethod(SystemPolicyV1Beta1Client.common_project_path)
parse_common_project_path = staticmethod(
SystemPolicyV1Beta1Client.parse_common_project_path
)
common_location_path = staticmethod(SystemPolicyV1Beta1Client.common_location_path)
parse_common_location_path = staticmethod(
SystemPolicyV1Beta1Client.parse_common_location_path
)
@classmethod
def from_service_account_info(cls, info: dict, *args, **kwargs):
"""Creates an instance of this client using the provided credentials
info.
Args:
info (dict): The service account private key info.
args: Additional arguments to pass to the constructor.
kwargs: Additional arguments to pass to the constructor.
Returns:
SystemPolicyV1Beta1AsyncClient: The constructed client.
"""
return SystemPolicyV1Beta1Client.from_service_account_info.__func__(SystemPolicyV1Beta1AsyncClient, info, *args, **kwargs) # type: ignore
@classmethod
def from_service_account_file(cls, filename: str, *args, **kwargs):
"""Creates an instance of this client using the provided credentials
file.
Args:
filename (str): The path to the service account private key json
file.
args: Additional arguments to pass to the constructor.
kwargs: Additional arguments to pass to the constructor.
Returns:
SystemPolicyV1Beta1AsyncClient: The constructed client.
"""
return SystemPolicyV1Beta1Client.from_service_account_file.__func__(SystemPolicyV1Beta1AsyncClient, filename, *args, **kwargs) # type: ignore
from_service_account_json = from_service_account_file
@classmethod
def get_mtls_endpoint_and_cert_source(
cls, client_options: Optional[ClientOptions] = None
):
"""Return the API endpoint and client cert source for mutual TLS.
The client cert source is determined in the following order:
(1) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is not "true", the
client cert source is None.
(2) if `client_options.client_cert_source` is provided, use the provided one; if the
default client cert source exists, use the default one; otherwise the client cert
source is None.
The API endpoint is determined in the following order:
(1) if `client_options.api_endpoint` if provided, use the provided one.
(2) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is "always", use the
default mTLS endpoint; if the environment variabel is "never", use the default API
endpoint; otherwise if client cert source exists, use the default mTLS endpoint, otherwise
use the default API endpoint.
More details can be found at https://google.aip.dev/auth/4114.
Args:
client_options (google.api_core.client_options.ClientOptions): Custom options for the
client. Only the `api_endpoint` and `client_cert_source` properties may be used
in this method.
Returns:
Tuple[str, Callable[[], Tuple[bytes, bytes]]]: returns the API endpoint and the
client cert source to use.
Raises:
google.auth.exceptions.MutualTLSChannelError: If any errors happen.
"""
return SystemPolicyV1Beta1Client.get_mtls_endpoint_and_cert_source(client_options) # type: ignore
@property
def transport(self) -> SystemPolicyV1Beta1Transport:
"""Returns the transport used by the client instance.
Returns:
SystemPolicyV1Beta1Transport: The transport used by the client instance.
"""
return self._client.transport
get_transport_class = functools.partial(
type(SystemPolicyV1Beta1Client).get_transport_class,
type(SystemPolicyV1Beta1Client),
)
def __init__(
self,
*,
credentials: Optional[ga_credentials.Credentials] = None,
transport: Union[str, SystemPolicyV1Beta1Transport] = "grpc_asyncio",
client_options: Optional[ClientOptions] = None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
) -> None:
"""Instantiates the system policy v1 beta1 client.
Args:
credentials (Optional[google.auth.credentials.Credentials]): The
authorization credentials to attach to requests. These
credentials identify the application to the service; if none
are specified, the client will attempt to ascertain the
credentials from the environment.
transport (Union[str, ~.SystemPolicyV1Beta1Transport]): The
transport to use. If set to None, a transport is chosen
automatically.
client_options (ClientOptions): Custom options for the client. It
won't take effect if a ``transport`` instance is provided.
(1) The ``api_endpoint`` property can be used to override the
default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT
environment variable can also be used to override the endpoint:
"always" (always use the default mTLS endpoint), "never" (always
use the default regular endpoint) and "auto" (auto switch to the
default mTLS endpoint if client certificate is present, this is
the default value). However, the ``api_endpoint`` property takes
precedence if provided.
(2) If GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable
is "true", then the ``client_cert_source`` property can be used
to provide client certificate for mutual TLS transport. If
not provided, the default SSL client certificate will be used if
present. If GOOGLE_API_USE_CLIENT_CERTIFICATE is "false" or not
set, no client certificate will be used.
Raises:
google.auth.exceptions.MutualTlsChannelError: If mutual TLS transport
creation failed for any reason.
"""
self._client = SystemPolicyV1Beta1Client(
credentials=credentials,
transport=transport,
client_options=client_options,
client_info=client_info,
)
async def get_system_policy(
self,
request: Optional[Union[service.GetSystemPolicyRequest, dict]] = None,
*,
name: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> resources.Policy:
r"""Gets the current system policy in the specified
location.
.. code-block:: python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
# client as shown in:
# https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import binaryauthorization_v1beta1
async def sample_get_system_policy():
# Create a client
client = binaryauthorization_v1beta1.SystemPolicyV1Beta1AsyncClient()
# Initialize request argument(s)
request = binaryauthorization_v1beta1.GetSystemPolicyRequest(
name="name_value",
)
# Make the request
response = await client.get_system_policy(request=request)
# Handle the response
print(response)
Args:
request (Optional[Union[google.cloud.binaryauthorization_v1beta1.types.GetSystemPolicyRequest, dict]]):
The request object. Request to read the current system
policy.
name (:class:`str`):
Required. The resource name, in the format
``locations/*/policy``. Note that the system policy is
not associated with a project.
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, str]]): Strings which should be
sent along with the request as metadata.
Returns:
google.cloud.binaryauthorization_v1beta1.types.Policy:
A
[policy][google.cloud.binaryauthorization.v1beta1.Policy]
for Binary Authorization.
"""
# Create or coerce a protobuf request object.
# Quick check: If we got a request object, we should *not* have
# gotten any keyword arguments that map to the request.
has_flattened_params = any([name])
if request is not None and has_flattened_params:
raise ValueError(
"If the `request` argument is set, then none of "
"the individual field arguments should be set."
)
request = service.GetSystemPolicyRequest(request)
# If we have keyword arguments corresponding to fields on the
# request, apply these.
if name is not None:
request.name = name
# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = gapic_v1.method_async.wrap_method(
self._client._transport.get_system_policy,
default_timeout=None,
client_info=DEFAULT_CLIENT_INFO,
)
# Certain fields should be provided within the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
)
# Send the request.
response = await rpc(
request,
retry=retry,
timeout=timeout,
metadata=metadata,
)
# Done; return the response.
return response
async def __aenter__(self):
return self
async def __aexit__(self, exc_type, exc, tb):
await self.transport.close()
try:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
gapic_version=pkg_resources.get_distribution(
"google-cloud-binary-authorization",
).version,
)
except pkg_resources.DistributionNotFound:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
__all__ = ("SystemPolicyV1Beta1AsyncClient",)
| {
"content_hash": "c77495647bd08ff52ffcb39653a91710",
"timestamp": "",
"source": "github",
"line_count": 325,
"max_line_length": 150,
"avg_line_length": 40.901538461538465,
"alnum_prop": 0.6516963815542015,
"repo_name": "googleapis/python-binary-authorization",
"id": "7e56b8d49e5a0b09ff230723bd3617481f1cd25c",
"size": "13893",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "google/cloud/binaryauthorization_v1beta1/services/system_policy_v1_beta1/async_client.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Dockerfile",
"bytes": "2050"
},
{
"name": "Python",
"bytes": "1055955"
},
{
"name": "Shell",
"bytes": "30702"
}
],
"symlink_target": ""
} |
module.exports = (function() {
var util = require('util');
var $ = require('jquery');
var extend = require('extend');
var Experiment = require('../../experiment');
var Player = require('../../../index');
function ProgressiveBasicExperiment() {
Experiment.apply(this, arguments);
$(this._stage).css({
width: (this.conf.tileSize * 10) + 'px',
height: (this.conf.tileSize * 10) + 'px'
});
this._playerOptions = {
seekingMode: Player.seeking.PLAY_FRAMES,
seekingSpeed: 1024,
speed: 8
};
}
util.inherits(ProgressiveBasicExperiment, Experiment);
extend(ProgressiveBasicExperiment.prototype, {
conf: {
tileSize: 50
},
// load: function() {
// Experiment.prototype.load.call(this);
// },
// unload: function() {
// Experiment.prototype.unload.call(this);
// },
_createKeyframes: function() {
function _pad(number, digits) {
return new Array(Math.max(digits - String(number).length + 1, 0)).join(0) + number;
}
var keyframes = [ ];
for (var i = 0; i < 100; i++) {
var keyframe = keyframes[i] = {
index: i,
time: keyframes[i - 1] ? keyframes[i - 1].time + 1000 : 0
};
keyframe.type = 'create';
keyframe.color = _pad(Math.round(255 / 100 * i).toString(16), 2) + '00' + _pad(Math.round(255 - 255 / 100 * i).toString(16), 2);
}
return keyframes;
},
_keyframeHandler: function(keyframe) {
if(this._player.direction === this._player.directions.BACKWARD) {
keyframe = this._reverseKeyframe(keyframe);
}
var tile;
switch(keyframe.type) {
case 'create':
tile = this._createTile(keyframe.index, keyframe.color);
this._stage.appendChild(tile);
break;
case 'removal':
tile = this._stage.querySelector('[data-index="'+ keyframe.index +'"]');
if(tile) {
this._stage.removeChild(tile);
} else {
console.warn('no tile with index ' + keyframe.index + ' on a stage');
}
break;
default:
}
},
// private
_reverseKeyframe: function(keyframe) {
var reversed = extend({ }, keyframe);
if(keyframe.type === 'create') {
reversed.type = 'removal';
delete reversed.color;
}
return reversed;
},
_createTile: function(index, color) {
var tile = document.createElement('div');
$(tile).css({
width: this.conf.tileSize + 'px',
height: this.conf.tileSize + 'px',
backgroundColor: '#' + color
})
.attr('data-index', index)
.addClass('experiment__stage__tile');
return tile;
}
});
return ProgressiveBasicExperiment;
})(); | {
"content_hash": "c4a584be419be734ca7b7ce0b6509dbc",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 144,
"avg_line_length": 30.236363636363638,
"alnum_prop": 0.46632591701743836,
"repo_name": "UsabilityTools/player",
"id": "1d194a5bb9d655edb51d6297e2621c89c5f47bb9",
"size": "3326",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "demo/experiments/progressive-basic/index.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "1355"
},
{
"name": "JavaScript",
"bytes": "209975"
},
{
"name": "Smarty",
"bytes": "6439"
}
],
"symlink_target": ""
} |
require 'test_helper'
class SessionsControllerTest < ActionController::TestCase
test 'user login submission sets username in session' do
user = APP_CONFIG['username']
pass = APP_CONFIG['password']
post :create, session: {login: user, password: pass}
assert_not session[:username].nil?, "username was not set"
end
test 'delete request removes user from session hash' do
delete :destroy
assert session[:username].nil?, "username was not removed"
end
end
| {
"content_hash": "48248d722c8402b7a549ff7425f5a7fd",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 62,
"avg_line_length": 30.75,
"alnum_prop": 0.7113821138211383,
"repo_name": "beaudavenport/astrologyDashboard",
"id": "c017abc515132709503d608f3b7bcdc2ab49adf2",
"size": "492",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "astro_dash/test/controllers/sessions_controller_test.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "686"
},
{
"name": "CSS",
"bytes": "27215"
},
{
"name": "CoffeeScript",
"bytes": "60831"
},
{
"name": "HTML",
"bytes": "540273"
},
{
"name": "JavaScript",
"bytes": "787"
},
{
"name": "Ruby",
"bytes": "534475"
}
],
"symlink_target": ""
} |
<!-- start: PAGE TITLE -->
<section id="page-title">
<div class="row">
<div class="col-sm-8">
<h1 class="mainTitle" translate="sidebar.nav.element.TREEVIEW">{{ mainTitle }}</h1>
<span class="mainDescription">A type of data structure in which each element is attached to one or more elements directly beneath it. The connections between elements are called branches. <small class="block">Webopedia - Online Tech Dictionary for IT Professionals</small></span>
</div>
<div ncy-breadcrumb></div>
</div>
</section>
<!-- end: PAGE TITLE -->
<!-- start: BOOTSRAP NAV TREE -->
<div class="container-fluid container-fullw bg-white">
<div class="row">
<div class="col-md-12">
<h5 class="over-title margin-bottom-15"><span class="text-bold">Angular Bootstrap Nav Tree</span></h5>
<p>
This is a Tree directive for Angular JS apps that use Bootstrap CSS.
</p>
<!-- /// controller: 'TreeCtrl' - localtion: assets/js/controllers/treeCtrl.js /// -->
<div ng-controller="TreeCtrl">
<div class="row">
<div class="col-md-8 col-sm-6">
<div class="panel panel-white">
<div class="panel-body">
<div class="box-tree">
<span ng-if="doing_async">...loading...</span>
<abn-tree tree-data="my_data" tree-control="my_tree" on-select="my_tree_handler(branch)" expand-level="2" initial-selection="Granny Smith" icon-leaf="ti-file" icon-expand="ti-plus" icon-collapse="ti-minus"></abn-tree>
</div>
</div>
</div>
<div class="alert alert-warning">
{{ output }}
</div>
</div>
<div class="col-md-4 col-sm-6">
<button ng-click="try_changing_the_tree_data()" class="btn btn-primary btn-o margin-bottom-15">
Change The Tree Definition
</button>
<br>
<button ng-click="try_async_load()" class="btn btn-primary btn-o">
Load Tree Data Asynchronously
</button>
<hr>
<h5>Test the Tree Control API:</h5>
<br>
<button ng-click="my_tree.select_first_branch()" class="btn btn-primary btn-sm margin-bottom-10">
First Branch
</button>
<br>
<button ng-click="my_tree.select_next_sibling()" class="btn btn-primary btn-sm margin-bottom-10">
Next Sibling
</button>
<button ng-click="my_tree.select_prev_sibling()" class="btn btn-primary btn-sm margin-bottom-10">
Prev Sibling
</button>
<br>
<button ng-click="my_tree.select_next_branch()" class="btn btn-primary btn-sm margin-bottom-10">
Next Branch
</button>
<button ng-click="my_tree.select_prev_branch()" class="btn btn-primary btn-sm margin-bottom-10">
Prev Branch
</button>
<br>
<button ng-click="my_tree.select_parent_branch()" class="btn btn-primary btn-sm margin-bottom-10">
Parent
</button>
<hr>
<button ng-click="my_tree.expand_branch()" class="btn btn-primary btn-sm margin-bottom-10">
Expand
</button>
<button ng-click="my_tree.collapse_branch()" class="btn btn-primary btn-sm margin-bottom-10">
Collapse
</button>
<button ng-click="my_tree.expand_all()" class="btn btn-primary btn-sm margin-bottom-10">
Expand All
</button>
<button ng-click="my_tree.collapse_all()" class="btn btn-primary btn-sm margin-bottom-10">
Collapse All
</button>
<hr>
<button ng-click="try_adding_a_branch()" class="btn btn-primary btn-sm margin-bottom-10">
Add Branch
</button>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- end: BOOTSRAP NAV TREE -->
| {
"content_hash": "265f5b8a1455dab64fade6e4fd46f12f",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 282,
"avg_line_length": 40.08695652173913,
"alnum_prop": 0.6035791757049892,
"repo_name": "mithundas79/angularTemplateSample",
"id": "7f23b3998d9d4784ac3c26c34ed1bcb998674873",
"size": "3688",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "assets/views/ui_tree.html",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "798904"
},
{
"name": "HTML",
"bytes": "679442"
},
{
"name": "JavaScript",
"bytes": "183486"
},
{
"name": "PHP",
"bytes": "414"
},
{
"name": "Ruby",
"bytes": "675"
}
],
"symlink_target": ""
} |
import {Action, INITIAL_STATE, RelativeFilePathsState, State} from '../../types';
const SET_MODEL_NAME = 'SET_MODEL_NAME';
export function dispatchSetModelName(name: string|undefined) {
return {type: SET_MODEL_NAME, payload: name};
}
const SET_ENVIRONMENT_NAME = 'SET_ENVIRONMENT_NAME';
export function dispatchSetEnvironmentName(name: string|undefined) {
return {type: SET_ENVIRONMENT_NAME, payload: name};
}
const SET_POSTER_NAME = 'SET_POSTER_NAME';
export function dispatchSetPosterName(name: string|undefined) {
return {type: SET_POSTER_NAME, payload: name};
}
export const getRelativeFilePaths = (state: State) =>
state.entities.modelViewerSnippet.relativeFilePaths;
export function relativeFilePathsReducer(
state: RelativeFilePathsState =
INITIAL_STATE.entities.modelViewerSnippet.relativeFilePaths,
action: Action): RelativeFilePathsState {
switch (action.type) {
case SET_MODEL_NAME:
return {...state, modelName: action.payload};
case SET_ENVIRONMENT_NAME:
return {...state, environmentName: action.payload};
case SET_POSTER_NAME:
return {...state, posterName: action.payload};
default:
return state;
}
} | {
"content_hash": "b607083dd38b44d56204b15b6674e1a6",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 81,
"avg_line_length": 32.189189189189186,
"alnum_prop": 0.7313182199832073,
"repo_name": "google/model-viewer",
"id": "fd14e7981001fa28c82a8444e9e41f4897151a86",
"size": "1819",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "packages/space-opera/src/components/relative_file_paths/reducer.ts",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "20490"
},
{
"name": "HTML",
"bytes": "283072"
},
{
"name": "JavaScript",
"bytes": "60829"
},
{
"name": "Shell",
"bytes": "21315"
},
{
"name": "TypeScript",
"bytes": "1337001"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<!--
Copyright (c) 2013 Intel Corporation.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of works must retain the original copyright notice, this list
of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the original copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of Intel Corporation nor the names of its contributors
may be used to endorse or promote products derived from this work without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "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 INTEL CORPORATION 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.
Authors:
Hao, Yunfei <[email protected]>
-->
<html>
<head>
<title>Transmission_gearPosition_attribute</title>
<meta charset="utf-8">
<script src="../resources/unitcommon.js"></script>
</head>
<body>
<div id="log"></div>
<script>
test(function() {
var obj = tizen.vehicle.get("Transmission");
check_attribute(obj, "gearPosition", obj.gearPosition, "number", obj.gearPosition+1);
}, "Transmission_gearPosition_attribute");
</script>
</body>
</html>
| {
"content_hash": "ee0ad927829e053c6ccc83caab293d5d",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 93,
"avg_line_length": 41,
"alnum_prop": 0.7560975609756098,
"repo_name": "xiaojunwu/crosswalk-test-suite",
"id": "7cc4c3c3de62032431c263eb8b7a390ece353cfb",
"size": "1968",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "webapi/webapi-vehicleinfo-xwalk-tests/vehicleinfo/Transmission_gearPosition_attribute.html",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "1620057"
},
{
"name": "Erlang",
"bytes": "2850"
},
{
"name": "F#",
"bytes": "983"
},
{
"name": "Java",
"bytes": "134550"
},
{
"name": "JavaScript",
"bytes": "31986738"
},
{
"name": "PHP",
"bytes": "43783"
},
{
"name": "Perl",
"bytes": "1696"
},
{
"name": "Python",
"bytes": "3750014"
},
{
"name": "Shell",
"bytes": "2031405"
},
{
"name": "XSLT",
"bytes": "2167352"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<taskModel xmlns="http://www.cs.wpi.edu/~rich/cetask/cea-2018-ext"
xmlns:disco="urn:disco.wpi.edu:Disco"
about="urn:secrets.wpi.edu:models:IceWall">
<task id="IceWall">
<subtasks id="_IceWall_subtasks">
<step name="_IceWall_step" task="disco:Say"/>
<step name="_IceWall_ref" task="_IceWall_tree"/>
<binding slot="$_IceWall_step.text"
value=""Clearly. You destroyed at least twenty in Cape Town alone.""/>
<binding slot="$_IceWall_step.external" value="false"/>
</subtasks>
</task>
<task id="_SC_Rest">
<subtasks id="__SC_Rest_subtasks">
<step name="__SC_Rest_step" task="disco:Say"/>
<step name="__SC_Rest_ref" task="__SC_Rest_tree"/>
<binding slot="$__SC_Rest_step.text" value=""Yes. I want you to know that...""/>
<binding slot="$__SC_Rest_step.external" value="true"/>
</subtasks>
</task>
<task id="_IceWall_tree">
<subtasks id="_d4e4_subtasks">
<step name="_d4e4_step" task="disco:Say"/>
<step name="_LeadIn_step" task="disco:Say"/>
<step name="_LeadIn_ref" task="_LeadIn_tree"/>
<binding slot="$_d4e4_step.text" value=""So? It was easier to see them that way.""/>
<binding slot="$_d4e4_step.external" value="true"/>
<binding slot="$_LeadIn_step.text"
value=""No, it wasn't. And it was more difficult to follow them, too!""/>
<binding slot="$_LeadIn_step.external" value="false"/>
</subtasks>
<subtasks id="_d4e8_subtasks">
<step name="_d4e8_step" task="disco:Say"/>
<step name="_d4e9_step" task="disco:Say"/>
<step name="_d4e10_step" task="_LeadIn_tree"/>
<binding slot="$_d4e8_step.text"
value=""Whoah, whoah, whoah. That was an accident. There was no way to know that crane would malfunction.""/>
<binding slot="$_d4e8_step.external" value="true"/>
<binding slot="$_d4e9_step.text"
value=""And some nice, innocent walls had to suffer for it.""/>
<binding slot="$_d4e9_step.external" value="false"/>
</subtasks>
</task>
<task id="_LeadIn_tree">
<subtasks id="_d4e6_subtasks">
<step name="_d4e6_step" task="disco:Say"/>
<step name="_d4e7_step" task="Escape"/>
<binding slot="$_d4e6_step.text" value=""Whatever. We still have to get past this one.""/>
<binding slot="$_d4e6_step.external" value="true"/>
</subtasks>
</task>
<task id="__SC_Rest_tree">
<subtasks id="_d4e58_subtasks">
<step name="_d4e58_step" task="disco:Say"/>
<step name="_d4e59_step" task="disco:Say"/>
<step name="_d4e60_step" task="disco:Say"/>
<binding slot="$_d4e58_step.text" value=""I'm the one who stole the diamonds.""/>
<binding slot="$_d4e58_step.external" value="true"/>
<binding slot="$_d4e59_step.text" value=""Huh?""/>
<binding slot="$_d4e59_step.external" value="false"/>
<binding slot="$_d4e60_step.text" value=""Uh... never mind.""/>
<binding slot="$_d4e60_step.external" value="true"/>
</subtasks>
<subtasks id="_d4e61_subtasks">
<step name="_d4e61_step" task="disco:Say"/>
<step name="_d4e62_step" task="disco:Say"/>
<binding slot="$_d4e61_step.text" value=""Umm... it's very cold out here.""/>
<binding slot="$_d4e61_step.external" value="true"/>
<binding slot="$_d4e62_step.text" value=""How informative.""/>
<binding slot="$_d4e62_step.external" value="false"/>
</subtasks>
</task>
<task id="Escape">
<postcondition sufficient="true">
world.get("door").isOpen() && (user() >= walkToLocation.x)
</postcondition>
<subtasks id="over">
<step name="boost" task="Boost"/>
<step name="clamber" task="Clamber"/>
<step name="open" task="OpenDoor"/>
<step name="walk" task="Walk"/>
<binding slot="$clamber.external" value="!$boost.external"/>
<binding slot="$open.external" value="!$boost.external"/>
<binding slot="$walk.external" value="$boost.external"/>
</subtasks>
<subtasks id="under">
<step name="say" task="disco:Say$Agent"/>
<binding slot="$say.text"
value="'Are you crazy? There\'s a reason it\'s called permafrost: it\'s permanent.'"/>
</subtasks>
<subtasks id="around">
<step name="say" task="disco:Say$Agent"/>
<binding slot="$say.text"
value="'It stretches on to the horizons. I heard that a company called InfiniWall makes these.'"/>
</subtasks>
<subtasks id="through">
<step name="say" task="disco:Say$Agent"/>
<binding slot="$say.text" value="'Are you kidding? There\'s no kindling here!'"/>
</subtasks>
</task>
<task id="Boost">
<script>
actor($this.external).setMovable(false);
other($this.external).setMovable(false);
world.get("climbableWall").climb();
actor($this.external).getLocation().setLocation(boosterLocation);
other($this.external).getLocation().setLocation(boostedLocation);
</script>
</task>
<task id="Clamber">
<script>
world.get("clamberTrigger").clamber();
actor($this.external).getLocation().setLocation(clamberLocation);
actor($this.external).setMovable(true);
other($this.external).setMovable(true);
</script>
</task>
<task id="OpenDoor">
<script>
if ( !$this.external ) moveNPC("sidekick", walkToLocation);
if ( world.get("door") ) world.get("door").open();
</script>
</task>
<task id="Walk">
<postcondition>
actor($this.external).getLocation().x >= walkToLocation.x
</postcondition>
<script>
if ( $this.external ) movePlayer(walkToLocation);
else moveNPC("sidekick", walkToLocation);
</script>
</task>
<task id="SillyConversation">
<precondition>
(user() >= walkToLocation.x) && (sidekick() < walkToLocation.x)
</precondition>
<subtasks id="silly_subtasks">
<step name="say" task="disco:Say$Agent"/>
<step name="rest_of_conversation" task="_SC_Rest"/>
<binding slot="$say.text" value="'Really? Now is the time to do this?'"/>
</subtasks>
</task>
<script init="true">
function user () { return getX("player"); }
function sidekick () { return getX("sidekick"); }
function getX (actor) { return world.get(actor).getLocation().x; }
walkToLocation = new Packages.java.awt.Point(16, 10);
function actor (external) {
if (external == undefined) return undefined;
if (external) return world.get("player");
return world.get("sidekick");
}
function other (external) {
if (external == undefined) return undefined;
if (external) return world.get("sidekick");
return world.get("player");
}
function rel(object, offX, offY) {
location = object.getLocation();
return new Packages.java.awt.Point(location.x + offX, location.y + offY);
}
boosterLocation = rel(world.get("climbableWall"), -1, 0);
boostedLocation = rel(world.get("clamberTrigger"), -1, 0);
clamberLocation = rel(world.get("clamberTrigger"), 1, 0);
</script>
</taskModel>
| {
"content_hash": "8c788fbabfae8a06af4d57293a465e81",
"timestamp": "",
"source": "github",
"line_count": 170,
"max_line_length": 135,
"avg_line_length": 45.23529411764706,
"alnum_prop": 0.5756827048114435,
"repo_name": "charlesrich/Disco",
"id": "5a219f4c41353f828c2ba1afb21b07eda664871f",
"size": "7690",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "disco/d4g/test/IceWall.test.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "3410"
},
{
"name": "Java",
"bytes": "645938"
},
{
"name": "JavaScript",
"bytes": "1353"
},
{
"name": "Perl",
"bytes": "137778"
},
{
"name": "Shell",
"bytes": "23961"
},
{
"name": "XSLT",
"bytes": "83952"
}
],
"symlink_target": ""
} |
<?php
namespace Becklyn\FacebookBundle\Model;
use Becklyn\FacebookBundle\Data\ApiUser;
use Becklyn\FacebookBundle\Data\Page;
use Becklyn\FacebookBundle\Data\RequestUser;
use Facebook\Facebook;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Component\Routing\RouterInterface;
/**
* Test service for debugging purposes
*/
class TestFacebookAppModel extends DebugFacebookAppModel
{
// Default values of dummy values
private $country = "de";
private $locale = "de_DE";
private $age = array("min" => 21);
private $userHasLiked = true;
private $userIsAdmin = false;
private $hasPermissions = true;
private $isInFacebookButNotInPage = false;
/**
* {@inheritdoc}
*/
public function __construct (Facebook $facebook, SessionInterface $session, RouterInterface $router)
{
parent::__construct(
$facebook,
$session,
$router,
""
);
}
//region Dummy Value Getters
/**
* Returns a dummy api user
*
* @return ApiUser
*/
public function getApiUser ()
{
return new ApiUser(array(
"id" => 123456,
"name" => "Test User",
"first_name" => "Test",
"last_name" => "User",
"link" => "http://www.google.de",
"username" => "test_user",
"email" => "[email protected]",
"locale" => $this->locale
));
}
/**
* Returns a dummy request user
*
* @return RequestUser
*/
public function getRequestUser ()
{
return new RequestUser(array(
"country" => $this->country,
"locale" => $this->locale,
"age" => $this->age
));
}
/**
* Returns a dummy page
*
* @return Page
*/
public function getPage ()
{
return new Page(array(
"liked" => $this->userHasLiked,
"id" => 123456,
"admin" => $this->userIsAdmin
));
}
/**
* {@inheritdoc}
*/
public function hasPermissions ()
{
return $this->hasPermissions;
}
/**
* {@inheritdoc}
*/
public function isInFacebookButNotInPage ()
{
return $this->isInFacebookButNotInPage;
}
/**
* {@inheritdoc}
*/
public function getAppData ()
{
return isset($_GET['app_data']) ? $_GET['app_data'] : null;
}
//endregion
//region Setters for most important dummy values
/**
* @param array $age
*/
public function setAge ($age)
{
$this->age = $age;
}
/**
* @param string $country
*/
public function setCountry ($country)
{
$this->country = $country;
}
/**
* @param string $locale
*/
public function setLocale ($locale)
{
$this->locale = $locale;
}
/**
* @param boolean $userHasLiked
*/
public function setUserHasLiked ($userHasLiked)
{
$this->userHasLiked = $userHasLiked;
}
/**
* @param boolean $userIsAdmin
*/
public function setUserIsAdmin ($userIsAdmin)
{
$this->userIsAdmin = $userIsAdmin;
}
/**
* @param boolean $hasPermissions
*/
public function setHasPermissions ($hasPermissions)
{
$this->hasPermissions = $hasPermissions;
}
/**
* @param boolean $isInFacebookButNotInPage
*/
public function setIsInFacebookButNotInPage ($isInFacebookButNotInPage)
{
$this->isInFacebookButNotInPage = $isInFacebookButNotInPage;
}
//endregion
}
| {
"content_hash": "7e724bd64fe9b7ca0d7c50f3bb3b8e47",
"timestamp": "",
"source": "github",
"line_count": 198,
"max_line_length": 104,
"avg_line_length": 19.27777777777778,
"alnum_prop": 0.5268535499083049,
"repo_name": "Becklyn/BecklynFacebookBundle",
"id": "d219c8d3ea8aff303e4e381a194d1d46bd064fed",
"size": "3817",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Model/TestFacebookAppModel.php",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "101"
},
{
"name": "HTML",
"bytes": "571"
},
{
"name": "PHP",
"bytes": "36635"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
Index Fungorum
#### Published in
Fl. pl. crypt. URSS 6(2): 181 (1961)
#### Original name
Sarcodontia bulliardii Nikol.
### Remarks
null | {
"content_hash": "dc6d4001aef98932555683370f348ff8",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 36,
"avg_line_length": 12.76923076923077,
"alnum_prop": 0.6867469879518072,
"repo_name": "mdoering/backbone",
"id": "cdaa759ddb77d272976660c98e0f4bdbab7e4ba8",
"size": "219",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Fungi/Basidiomycota/Agaricomycetes/Polyporales/Meruliaceae/Sarcodontia/Sarcodontia bulliardii/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
/**
* Users Class
*
* @author Colan
*/
class Profile extends CI_Controller {
function __construct() {
parent::__construct();
$this->load->helper('url');
$this->load->library('session');
$this->load->helper('form');
$this->load->library('form_validation');
$this->load->model('admin/admin_model');
cipl_admin_auth();
}
public function index() {
$admin_id = $this->session->userdata('admin_id');
if ($_SERVER['REQUEST_METHOD'] == 'POST') { //allow only the http method is POST
$config = array(
array(
'field' => 'first_name',
'label' => 'First Name',
'rules' => 'trim|required'
),
array(
'field' => 'last_name',
'label' => 'Last Name',
'rules' => 'trim|required'
),
array(
'field' => 'admin_email',
'label' => 'Admin Email',
'rules' => 'trim|required|valid_email|callback_email_check'
),
array(
'field' => 'password',
'label' => 'Password',
'rules' => 'trim'
),
array(
'field' => 'retype_password',
'label' => 'Retype Password',
'rules' => 'trim|matches[password]'
)
);
$this->form_validation->set_rules($config);
if ($this->form_validation->run() != FALSE) {
$update_array = array(
"first_name" => $this->input->post('first_name'),
"last_name" => $this->input->post("last_name"),
"admin_email" => $this->input->post("admin_email"),
"updated_on" => date('Y-m-d H:i:s')
);
$admin_data = array(
'admin_email' => $this->input->post("admin_email"),
'admin_first_name' => $this->input->post('first_name'),
'admin_last_name' => $this->input->post("last_name"),
);
$this->session->set_userdata($admin_data);
if ($this->input->post('password') != ''):
$password_array = array("password" => md5($this->input->post('password')));
$update_array = array_merge($password_array, $update_array);
endif;
if ( isset($_FILES['profile_image']) && $_FILES['profile_image']["name"] != '' ) {
$upload_path = 'assets/adminImages/';
$ext_image_name = explode(".", $_FILES['profile_image']['name']);
$count_ext_img = count($ext_image_name);
$image_ext = $ext_image_name[$count_ext_img - 1];
$file_name = base64_encode(trim($this->input->post('first_name'))) . '_' . md5(rand(1000000, 1000000000)) . '.' . $image_ext;
$file_name = str_replace('=', '', $file_name);
$profile_image = cipl_image_upload($_FILES['profile_image'], 'profile_image', $upload_path, $file_name, 225, 225);
if (isset($profile_image['success'])) {
$profile_image_array = array("profile_image" => $upload_path . $file_name);
$update_array = array_merge($profile_image_array, $update_array);
$this->admin_model->update_admin($update_array, $admin_id);
$this->session->set_flashdata('Success', 'Admin updated successfully.');
$this->session->set_userdata('admin_profile_image', $profile_image_array['profile_image']);
} else {
$this->session->set_flashdata('Error', $profile_image['messages']['error']);
}
} else {
$this->admin_model->update_admin($update_array, $admin_id);
$this->session->set_flashdata('Success', 'Admin updated successfully.');
}
}
}
$admin_details = $this->admin_model->get_admin_details($admin_id);
$data['admin_details'] = $admin_details[0];
$this->load->view('admin/common/header');
$this->load->view('admin/profile/edit', $data);
$this->load->view('admin/common/footer');
}
public function email_check($email) {
$valid = $this->admin_model->validate_email($email);
if ($valid != true) {
$this->form_validation->set_message('email_check', 'The admin email id already exist in our records.');
return FALSE;
} else {
return TRUE;
}
}
}
| {
"content_hash": "e64845528de2367e143b62d8c638b302",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 145,
"avg_line_length": 41.75,
"alnum_prop": 0.43925053119567314,
"repo_name": "allankish/ummahstars",
"id": "4b79e0030068d61049f6a379b8a429533a900f29",
"size": "5177",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "application/controllers/admin/Profile.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "296"
},
{
"name": "CSS",
"bytes": "627718"
},
{
"name": "HTML",
"bytes": "10191950"
},
{
"name": "JavaScript",
"bytes": "2990304"
},
{
"name": "PHP",
"bytes": "9997011"
}
],
"symlink_target": ""
} |
ActionController::Routing::Routes.draw do |map|
# The priority is based upon order of creation: first created -> highest priority.
map.root :controller => "site"
map.connect 'repositories', :controller => 'repo', :action => 'index'
map.connect 'add', :controller => 'repo', :action => 'new'
map.connect 'user', :controller => 'user', :action => 'index'
map.connect 'logout', :controller => 'user', :action => 'logout'
map.connect 'login', :controller => 'user', :action => 'login'
map.connect 'register', :controller => 'user', :action => 'register'
map.connect ':username', :controller => 'user', :action => 'profile'
map.connect ':username/:reponame', :controller => 'repo', :action => 'show', :type => 'tree', :branch => 'master'
map.connect ':username/:reponame/watch', :controller => 'repo', :action => 'watch'
map.connect ':username/:reponame/unwatch', :controller => 'repo', :action => 'unwatch'
map.connect ':username/:reponame/commits/:branch', :controller => 'repo', :action => 'commits'
map.connect ':username/:reponame/commits/:branch/*path', :controller => 'repo', :action => 'commits'
map.connect ':username/:reponame/diffs/:branch', :controller => 'repo', :action => 'diffs'
map.connect ':username/:reponame/tags/:branch/*path', :controller => 'repo', :action => 'tags'
map.connect ':username/:reponame/:type/:branch' , :controller => 'repo' , :action => 'show'
map.connect ':username/:reponame/:type/:branch/*path' , :controller => 'repo' , :action => 'show'
map.connect ':username/:reponame/:type', :controller => 'repo', :action => 'show', :branch => 'master'
#map.connect 'repo/:username/:reponame', :controller => 'repo', :action => 'show'
map.resources :repo
map.connect ':controller/:action/:id'
map.connect ':controller/:action/:id.:format'
map.connect 'profile/:username', :controller => 'user', :action => 'profile'
#map.connect 'user/:id', :controller => 'user', :action => 'show'
#map.resources :repo
# Sample of regular route:
# map.connect 'products/:id', :controller => 'catalog', :action => 'view'
# Keep in mind you can assign values other than :controller and :action
# Sample of named route:
# map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase'
# This route can be invoked with purchase_url(:id => product.id)
# Sample resource route (maps HTTP verbs to controller actions automatically):
# map.resources :products
# Sample resource route with options:
# map.resources :products, :member => { :short => :get, :toggle => :post }, :collection => { :sold => :get }
# Sample resource route with sub-resources:
# map.resources :products, :has_many => [ :comments, :sales ], :has_one => :seller
# Sample resource route with more complex sub-resources
# map.resources :products do |products|
# products.resources :comments
# products.resources :sales, :collection => { :recent => :get }
# end
# Sample resource route within a namespace:
# map.namespace :admin do |admin|
# # Directs /admin/products/* to Admin::ProductsController (app/controllers/admin/products_controller.rb)
# admin.resources :products
# end
# You can have the root of your site routed with map.root -- just remember to delete public/index.html.
# map.root :controller => "welcome"
# See how all your routes lay out with "rake routes"
end
| {
"content_hash": "428a1cd25a775e2e571898261cf96fce",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 115,
"avg_line_length": 54.317460317460316,
"alnum_prop": 0.6616014026884862,
"repo_name": "parabuzzle/lookgit",
"id": "94f11bff9025bea13bdffcba0a7ff02c57162e35",
"size": "3422",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "rails_app/config/routes.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "110726"
},
{
"name": "Ruby",
"bytes": "38076"
}
],
"symlink_target": ""
} |
using namespace AIMP36SDK;
using namespace AIMP::SDK;
public class StaticSingleThreadAllocator
{
public:
static inline char* Allocate(int size = 255)
{
char* Tmp = CurPtr;
CurPtr += size;
return Tmp;
}
static inline void Dispose(char* addr)
{
CurPtr = min(addr, CurPtr);
}
private:
static char* CurPtr;
// static char* Indexes[100];
// static int CurID;
static char allocMem[512*1024];
};
char StaticSingleThreadAllocator::allocMem[512*1024];
char* StaticSingleThreadAllocator::CurPtr = StaticSingleThreadAllocator::allocMem;
public class SystemMemoryAllocator
{
public:
static inline char* Allocate(int size = 255)
{
return new char[size];
}
static inline void Dispose(char* addr)
{
delete [] addr;
}
};
template <class T>
public ref class Singletone
{
protected:
Singletone()
{
_self = nullptr;
_refCount = 0;
}
virtual ~Singletone()
{
_self = nullptr;
}
public:
static T^ Instance()
{
if(!_self)
{
_self = gcnew T;
}
_refCount++;
return _self;
}
void FreeInst()
{
if(--_refCount==0)
delete this;
}
private:
static T^ _self;
static int _refCount;
};
namespace AIMP
{
public ref class DataConverter
{
private:
IAIMPCore* _aimpCore;
public:
void Initialize(IAIMPCore* aimpCore)
{
_aimpCore = aimpCore;
}
IAIMPString* GetAimpString(System::String^ stringValue)
{
IAIMPString* strObject = NULL;
pin_ptr<const WCHAR> strDate = PtrToStringChars(stringValue);
_aimpCore->CreateObject(IID_IAIMPString, (void**)&strObject);
strObject->SetData((PWCHAR)strDate, stringValue->Length);
return strObject;
}
};
} | {
"content_hash": "5f6b11b325969c5fc4416aac2b0d520c",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 82,
"avg_line_length": 17.042105263157893,
"alnum_prop": 0.6843730697961705,
"repo_name": "M0ns1gn0r/aimp_dotnet",
"id": "8478742ccd7d449edce0efc6545b7d245009945d",
"size": "1756",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "aimp_dotnet/DataConversion.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "6981"
},
{
"name": "C#",
"bytes": "267281"
},
{
"name": "C++",
"bytes": "223430"
}
],
"symlink_target": ""
} |
<?xml version="1.0" ?><!DOCTYPE TS><TS language="fa" version="2.0">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About ncicoin</source>
<translation>در مورد ncicoin</translation>
</message>
<message>
<location line="+39"/>
<source><b>ncicoin</b> version</source>
<translation>نسخه ncicoin</translation>
</message>
<message>
<location line="+57"/>
<source>
This is experimental software.
Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php.
This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young ([email protected]) and UPnP software written by Thomas Bernard.</source>
<translation>⏎ ⏎ این نسخه نرم افزار آزمایشی است⏎ ⏎ نرم افزار تحت لیسانس MIT/X11 منتشر شده است. به فایل coping یا آدرس http://www.opensource.org/licenses/mit-license.php. مراجعه شود⏎ ⏎ این محصول شامل نرم افزاری است که با OpenSSL برای استفاده از OpenSSL Toolkit (http://www.openssl.org/) و نرم افزار نوشته شده توسط اریک یانگ ([email protected] ) و UPnP توسط توماس برنارد طراحی شده است.</translation>
</message>
<message>
<location filename="../aboutdialog.cpp" line="+14"/>
<source>Copyright</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>The ncicoin developers</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>AddressBookPage</name>
<message>
<location filename="../forms/addressbookpage.ui" line="+14"/>
<source>Address Book</source>
<translation>فهرست آدرس</translation>
</message>
<message>
<location line="+19"/>
<source>Double-click to edit address or label</source>
<translation>برای ویرایش آدرس یا بر چسب دو بار کلیک کنید</translation>
</message>
<message>
<location line="+27"/>
<source>Create a new address</source>
<translation>آدرس جدید ایجاد کنید</translation>
</message>
<message>
<location line="+14"/>
<source>Copy the currently selected address to the system clipboard</source>
<translation>آدرس انتخاب شده در سیستم تخته رسم گیره دار کپی کنید</translation>
</message>
<message>
<location line="-11"/>
<source>&New Address</source>
<translation>آدرس جدید</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="+63"/>
<source>These are your ncicoin addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</source>
<translation>این آدرسها، آدرسهای ncicoin شما برای دریافت وجوه هستند. شما ممکن است آدرسهای متفاوت را به هر گیرنده اختصاص دهید که بتوانید مواردی که پرداخت می کنید را پیگیری نمایید</translation>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="+14"/>
<source>&Copy Address</source>
<translation>کپی آدرس</translation>
</message>
<message>
<location line="+11"/>
<source>Show &QR Code</source>
<translation>نمایش &کد QR</translation>
</message>
<message>
<location line="+11"/>
<source>Sign a message to prove you own a ncicoin address</source>
<translation>پیام را برای اثبات آدرس ncicoin خود امضا کنید</translation>
</message>
<message>
<location line="+3"/>
<source>Sign &Message</source>
<translation>امضا و پیام</translation>
</message>
<message>
<location line="+25"/>
<source>Delete the currently selected address from the list</source>
<translation>آدرس انتخاب شده در سیستم تخته رسم گیره دا حذف</translation>
</message>
<message>
<location line="+27"/>
<source>Export the data in the current tab to a file</source>
<translation>داده ها نوارِ جاری را به فایل انتقال دهید</translation>
</message>
<message>
<location line="+3"/>
<source>&Export</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-44"/>
<source>Verify a message to ensure it was signed with a specified ncicoin address</source>
<translation>یک پیام را برای حصول اطمینان از ورود به سیستم با آدرس ncicoin مشخص، شناسایی کنید</translation>
</message>
<message>
<location line="+3"/>
<source>&Verify Message</source>
<translation>شناسایی پیام</translation>
</message>
<message>
<location line="+14"/>
<source>&Delete</source>
<translation>حذف</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="-5"/>
<source>These are your ncicoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>Copy &Label</source>
<translation>کپی و برچسب گذاری</translation>
</message>
<message>
<location line="+1"/>
<source>&Edit</source>
<translation>ویرایش</translation>
</message>
<message>
<location line="+1"/>
<source>Send &Coins</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+260"/>
<source>Export Address Book Data</source>
<translation>آدرس انتخاب شده در سیستم تخته رسم گیره دار کپی کنید</translation>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation>Comma separated file (*.csv)</translation>
</message>
<message>
<location line="+13"/>
<source>Error exporting</source>
<translation>خطای صدور</translation>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation>تا فایل %1 نمی شود نوشت</translation>
</message>
</context>
<context>
<name>AddressTableModel</name>
<message>
<location filename="../addresstablemodel.cpp" line="+144"/>
<source>Label</source>
<translation>بر چسب</translation>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation>آدرس</translation>
</message>
<message>
<location line="+36"/>
<source>(no label)</source>
<translation>بدون برچسب</translation>
</message>
</context>
<context>
<name>AskPassphraseDialog</name>
<message>
<location filename="../forms/askpassphrasedialog.ui" line="+26"/>
<source>Passphrase Dialog</source>
<translation>دیالوگ Passphrase </translation>
</message>
<message>
<location line="+21"/>
<source>Enter passphrase</source>
<translation>وارد عبارت عبور</translation>
</message>
<message>
<location line="+14"/>
<source>New passphrase</source>
<translation>عبارت عبور نو</translation>
</message>
<message>
<location line="+14"/>
<source>Repeat new passphrase</source>
<translation>تکرار عبارت عبور نو</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="+33"/>
<source>Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>.</source>
<translation>وارد کنید..&lt;br/&gt عبارت عبور نو در پنجره
10 یا بیشتر کاراکتورهای تصادفی استفاده کنید &lt;b&gt لطفا عبارت عبور</translation>
</message>
<message>
<location line="+1"/>
<source>Encrypt wallet</source>
<translation>رمز بندی پنجره</translation>
</message>
<message>
<location line="+3"/>
<source>This operation needs your wallet passphrase to unlock the wallet.</source>
<translation>این عملیت نیاز عبارت عبور پنجره شما دارد برای رمز گشایی آن</translation>
</message>
<message>
<location line="+5"/>
<source>Unlock wallet</source>
<translation>تکرار عبارت عبور نو</translation>
</message>
<message>
<location line="+3"/>
<source>This operation needs your wallet passphrase to decrypt the wallet.</source>
<translation>این عملیت نیاز عبارت عبور شما دارد برای رمز بندی آن</translation>
</message>
<message>
<location line="+5"/>
<source>Decrypt wallet</source>
<translation>رمز بندی پنجره</translation>
</message>
<message>
<location line="+3"/>
<source>Change passphrase</source>
<translation>تغییر عبارت عبور</translation>
</message>
<message>
<location line="+1"/>
<source>Enter the old and new passphrase to the wallet.</source>
<translation>عبارت عبور نو و قدیم در پنجره وارد کنید</translation>
</message>
<message>
<location line="+46"/>
<source>Confirm wallet encryption</source>
<translation>تایید رمز گذاری</translation>
</message>
<message>
<location line="+1"/>
<source>Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR ZETACOINS</b>!</source>
<translation>هشدار: اگر wallet رمزگذاری شود و شما passphrase را گم کنید شما همه اطلاعات ncicoin را از دست خواهید داد.</translation>
</message>
<message>
<location line="+0"/>
<source>Are you sure you wish to encrypt your wallet?</source>
<translation>آیا اطمینان دارید که می خواهید wallet رمزگذاری شود؟</translation>
</message>
<message>
<location line="+15"/>
<source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+100"/>
<location line="+24"/>
<source>Warning: The Caps Lock key is on!</source>
<translation>هشدار: Caps lock key روشن است</translation>
</message>
<message>
<location line="-130"/>
<location line="+58"/>
<source>Wallet encrypted</source>
<translation>تغییر عبارت عبور</translation>
</message>
<message>
<location line="-56"/>
<source>ncicoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your ncicoins from being stolen by malware infecting your computer.</source>
<translation>Biticon هم اکنون بسته میشود تا فرایند رمزگذاری را تمام کند. به خاطر داشته باشید که رمزگذاری کیف پولتان نمیتواند به طور کامل بیتیکونهای شما را در برابر دزدیده شدن توسط بدافزارهایی که رایانه شما را آلوده میکنند، محافظت نماید.</translation>
</message>
<message>
<location line="+13"/>
<location line="+7"/>
<location line="+42"/>
<location line="+6"/>
<source>Wallet encryption failed</source>
<translation>عبارت عبور نو و قدیم در پنجره وارد کنید</translation>
</message>
<message>
<location line="-54"/>
<source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>
<translation>تنا موفق رمز بندی پنجره ناشی از خطای داخل شد. پنجره شما مرز بندی نشده است</translation>
</message>
<message>
<location line="+7"/>
<location line="+48"/>
<source>The supplied passphrases do not match.</source>
<translation>عبارت عبور عرضه تطابق نشد</translation>
</message>
<message>
<location line="-37"/>
<source>Wallet unlock failed</source>
<translation>نجره رمز گذار شد</translation>
</message>
<message>
<location line="+1"/>
<location line="+11"/>
<location line="+19"/>
<source>The passphrase entered for the wallet decryption was incorrect.</source>
<translation>اموفق رمز بندی پنجر</translation>
</message>
<message>
<location line="-20"/>
<source>Wallet decryption failed</source>
<translation>ناموفق رمز بندی پنجره</translation>
</message>
<message>
<location line="+14"/>
<source>Wallet passphrase was successfully changed.</source>
<translation>wallet passphrase با موفقیت تغییر یافت</translation>
</message>
</context>
<context>
<name>BitcoinGUI</name>
<message>
<location filename="../bitcoingui.cpp" line="+233"/>
<source>Sign &message...</source>
<translation>امضا و پیام</translation>
</message>
<message>
<location line="+280"/>
<source>Synchronizing with network...</source>
<translation>همگام سازی با شبکه ...</translation>
</message>
<message>
<location line="-349"/>
<source>&Overview</source>
<translation>بررسی اجمالی</translation>
</message>
<message>
<location line="+1"/>
<source>Show general overview of wallet</source>
<translation>نمای کلی پنجره نشان بده</translation>
</message>
<message>
<location line="+20"/>
<source>&Transactions</source>
<translation>&معاملات</translation>
</message>
<message>
<location line="+1"/>
<source>Browse transaction history</source>
<translation>نمایش تاریخ معاملات</translation>
</message>
<message>
<location line="+7"/>
<source>Edit the list of stored addresses and labels</source>
<translation>ویرایش لیست آدرسها و بر چسب های ذخیره ای</translation>
</message>
<message>
<location line="-14"/>
<source>Show the list of addresses for receiving payments</source>
<translation>نمایش لیست آدرس ها برای در یافت پر داخت ها</translation>
</message>
<message>
<location line="+31"/>
<source>E&xit</source>
<translation>خروج</translation>
</message>
<message>
<location line="+1"/>
<source>Quit application</source>
<translation>خروج از برنامه </translation>
</message>
<message>
<location line="+4"/>
<source>Show information about ncicoin</source>
<translation>نمایش اطلاعات در مورد بیتکویین</translation>
</message>
<message>
<location line="+2"/>
<source>About &Qt</source>
<translation>درباره &Qt</translation>
</message>
<message>
<location line="+1"/>
<source>Show information about Qt</source>
<translation>نمایش اطلاعات درباره Qt</translation>
</message>
<message>
<location line="+2"/>
<source>&Options...</source>
<translation>تنظیمات...</translation>
</message>
<message>
<location line="+6"/>
<source>&Encrypt Wallet...</source>
<translation>رمزگذاری wallet</translation>
</message>
<message>
<location line="+3"/>
<source>&Backup Wallet...</source>
<translation>پشتیبان گیری از wallet</translation>
</message>
<message>
<location line="+2"/>
<source>&Change Passphrase...</source>
<translation>تغییر Passphrase</translation>
</message>
<message>
<location line="+285"/>
<source>Importing blocks from disk...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Reindexing blocks on disk...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-347"/>
<source>Send coins to a ncicoin address</source>
<translation>سکه ها را به آدرس bitocin ارسال کن</translation>
</message>
<message>
<location line="+49"/>
<source>Modify configuration options for ncicoin</source>
<translation>انتخابهای پیکربندی را برای ncicoin اصلاح کن</translation>
</message>
<message>
<location line="+9"/>
<source>Backup wallet to another location</source>
<translation>نسخه پیشتیبان wallet را به محل دیگر انتقال دهید</translation>
</message>
<message>
<location line="+2"/>
<source>Change the passphrase used for wallet encryption</source>
<translation>عبارت عبور رمز گشایی پنجره تغییر کنید</translation>
</message>
<message>
<location line="+6"/>
<source>&Debug window</source>
<translation>اشکال زدایی از صفحه</translation>
</message>
<message>
<location line="+1"/>
<source>Open debugging and diagnostic console</source>
<translation>کنسول اشکال زدایی و تشخیص را باز کنید</translation>
</message>
<message>
<location line="-4"/>
<source>&Verify message...</source>
<translation>بازبینی پیام</translation>
</message>
<message>
<location line="-165"/>
<location line="+530"/>
<source>ncicoin</source>
<translation>یت کویین </translation>
</message>
<message>
<location line="-530"/>
<source>Wallet</source>
<translation>wallet</translation>
</message>
<message>
<location line="+101"/>
<source>&Send</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>&Receive</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>&Addresses</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+22"/>
<source>&About ncicoin</source>
<translation>در مورد ncicoin</translation>
</message>
<message>
<location line="+9"/>
<source>&Show / Hide</source>
<translation>&نمایش/ عدم نمایش</translation>
</message>
<message>
<location line="+1"/>
<source>Show or hide the main Window</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Encrypt the private keys that belong to your wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Sign messages with your ncicoin addresses to prove you own them</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Verify messages to ensure they were signed with specified ncicoin addresses</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+28"/>
<source>&File</source>
<translation>فایل</translation>
</message>
<message>
<location line="+7"/>
<source>&Settings</source>
<translation>تنظیمات</translation>
</message>
<message>
<location line="+6"/>
<source>&Help</source>
<translation>کمک</translation>
</message>
<message>
<location line="+9"/>
<source>Tabs toolbar</source>
<translation>نوار ابزار زبانه ها</translation>
</message>
<message>
<location line="+17"/>
<location line="+10"/>
<source>[testnet]</source>
<translation>آزمایش شبکه</translation>
</message>
<message>
<location line="+47"/>
<source>ncicoin client</source>
<translation>مشتری ncicoin</translation>
</message>
<message numerus="yes">
<location line="+141"/>
<source>%n active connection(s) to ncicoin network</source>
<translation><numerusform>در صد ارتباطات فعال بیتکویین با شبکه %n</numerusform></translation>
</message>
<message>
<location line="+22"/>
<source>No block source available...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+12"/>
<source>Processed %1 of %2 (estimated) blocks of transaction history.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Processed %1 blocks of transaction history.</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+20"/>
<source>%n hour(s)</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n day(s)</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n week(s)</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message>
<location line="+4"/>
<source>%1 behind</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Last received block was generated %1 ago.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Transactions after this will not yet be visible.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+22"/>
<source>Error</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Warning</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+70"/>
<source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-140"/>
<source>Up to date</source>
<translation>تا تاریخ</translation>
</message>
<message>
<location line="+31"/>
<source>Catching up...</source>
<translation>ابتلا به بالا</translation>
</message>
<message>
<location line="+113"/>
<source>Confirm transaction fee</source>
<translation>هزینه تراکنش را تایید کنید</translation>
</message>
<message>
<location line="+8"/>
<source>Sent transaction</source>
<translation>معامله ارسال شده</translation>
</message>
<message>
<location line="+0"/>
<source>Incoming transaction</source>
<translation>معامله در یافت شده</translation>
</message>
<message>
<location line="+1"/>
<source>Date: %1
Amount: %2
Type: %3
Address: %4
</source>
<translation>تاریخ %1
مبلغ%2
نوع %3
آدرس %4</translation>
</message>
<message>
<location line="+33"/>
<location line="+23"/>
<source>URI handling</source>
<translation>مدیریت URI</translation>
</message>
<message>
<location line="-23"/>
<location line="+23"/>
<source>URI can not be parsed! This can be caused by an invalid ncicoin address or malformed URI parameters.</source>
<translation>URI قابل تحلیل نیست. این خطا ممکن است به دلیل ادرس ZETACOIN اشتباه یا پارامترهای اشتباه URI رخ داده باشد</translation>
</message>
<message>
<location line="+17"/>
<source>Wallet is <b>encrypted</b> and currently <b>unlocked</b></source>
<translation>زمایش شبکهه</translation>
</message>
<message>
<location line="+8"/>
<source>Wallet is <b>encrypted</b> and currently <b>locked</b></source>
<translation>زمایش شبکه</translation>
</message>
<message>
<location filename="../bitcoin.cpp" line="+111"/>
<source>A fatal error occurred. ncicoin can no longer continue safely and will quit.</source>
<translation>خطا روی داده است. ncicoin نمی تواند بدون مشکل ادامه دهد و باید بسته شود</translation>
</message>
</context>
<context>
<name>ClientModel</name>
<message>
<location filename="../clientmodel.cpp" line="+104"/>
<source>Network Alert</source>
<translation>پیام شبکه</translation>
</message>
</context>
<context>
<name>EditAddressDialog</name>
<message>
<location filename="../forms/editaddressdialog.ui" line="+14"/>
<source>Edit Address</source>
<translation>اصلاح آدرس</translation>
</message>
<message>
<location line="+11"/>
<source>&Label</source>
<translation>بر چسب</translation>
</message>
<message>
<location line="+10"/>
<source>The label associated with this address book entry</source>
<translation>بر چسب با دفتر آدرس ورود مرتبط است</translation>
</message>
<message>
<location line="+7"/>
<source>&Address</source>
<translation>آدرس</translation>
</message>
<message>
<location line="+10"/>
<source>The address associated with this address book entry. This can only be modified for sending addresses.</source>
<translation>آدرس با دفتر آدرس ورودی مرتبط است. این فقط در مورد آدرسهای ارسال شده است</translation>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="+21"/>
<source>New receiving address</source>
<translation>آدرس در یافت نو</translation>
</message>
<message>
<location line="+4"/>
<source>New sending address</source>
<translation>آدرس ارسال نو</translation>
</message>
<message>
<location line="+3"/>
<source>Edit receiving address</source>
<translation>اصلاح آدرس در یافت</translation>
</message>
<message>
<location line="+4"/>
<source>Edit sending address</source>
<translation>اصلاح آدرس ارسال</translation>
</message>
<message>
<location line="+76"/>
<source>The entered address "%1" is already in the address book.</source>
<translation>%1آدرس وارد شده دیگر در دفتر آدرس است</translation>
</message>
<message>
<location line="-5"/>
<source>The entered address "%1" is not a valid ncicoin address.</source>
<translation>آدرس وارد شده %1 یک ادرس صحیح ncicoin نیست</translation>
</message>
<message>
<location line="+10"/>
<source>Could not unlock wallet.</source>
<translation>رمز گشایی پنجره امکان پذیر نیست</translation>
</message>
<message>
<location line="+5"/>
<source>New key generation failed.</source>
<translation>کلید نسل جدید ناموفق است</translation>
</message>
</context>
<context>
<name>GUIUtil::HelpMessageBox</name>
<message>
<location filename="../guiutil.cpp" line="+424"/>
<location line="+12"/>
<source>ncicoin-Qt</source>
<translation>ncicoin-Qt</translation>
</message>
<message>
<location line="-12"/>
<source>version</source>
<translation>نسخه</translation>
</message>
<message>
<location line="+2"/>
<source>Usage:</source>
<translation>ستفاده :</translation>
</message>
<message>
<location line="+1"/>
<source>command-line options</source>
<translation>انتخابها برای خطوط دستور command line</translation>
</message>
<message>
<location line="+4"/>
<source>UI options</source>
<translation>انتخابهای UI </translation>
</message>
<message>
<location line="+1"/>
<source>Set language, for example "de_DE" (default: system locale)</source>
<translation>زبان را تنظیم کنید برای مثال "de_DE" (پیش فرض: system locale)</translation>
</message>
<message>
<location line="+1"/>
<source>Start minimized</source>
<translation>شروع حد اقل</translation>
</message>
<message>
<location line="+1"/>
<source>Show splash screen on startup (default: 1)</source>
<translation>نمایش صفحه splash در STARTUP (پیش فرض:1)</translation>
</message>
</context>
<context>
<name>OptionsDialog</name>
<message>
<location filename="../forms/optionsdialog.ui" line="+14"/>
<source>Options</source>
<translation>اصلی</translation>
</message>
<message>
<location line="+16"/>
<source>&Main</source>
<translation>اصلی</translation>
</message>
<message>
<location line="+6"/>
<source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>Pay transaction &fee</source>
<translation>دستمزد&پر داخت معامله</translation>
</message>
<message>
<location line="+31"/>
<source>Automatically start ncicoin after logging in to the system.</source>
<translation>در زمان ورود به سیستم به صورت خودکار ncicoin را اجرا کن</translation>
</message>
<message>
<location line="+3"/>
<source>&Start ncicoin on system login</source>
<translation>اجرای ncicoin در زمان ورود به سیستم</translation>
</message>
<message>
<location line="+35"/>
<source>Reset all client options to default.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Reset Options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>&Network</source>
<translation>شبکه</translation>
</message>
<message>
<location line="+6"/>
<source>Automatically open the ncicoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>
<translation>اتوماتیک باز کردن بندر بیتکویین در روتر . این فقط در مواردی می باشد که روتر با کمک یو پ ن پ کار می کند</translation>
</message>
<message>
<location line="+3"/>
<source>Map port using &UPnP</source>
<translation>درگاه با استفاده از</translation>
</message>
<message>
<location line="+7"/>
<source>Connect to the ncicoin network through a SOCKS proxy (e.g. when connecting through Tor).</source>
<translation>اتصال به شبکه ZETACOIN از طریق پراکسی ساکس (برای مثال وقتی از طریق نرم افزار TOR متصل می شوید)</translation>
</message>
<message>
<location line="+3"/>
<source>&Connect through SOCKS proxy:</source>
<translation>اتصال با پراکسی SOCKS</translation>
</message>
<message>
<location line="+9"/>
<source>Proxy &IP:</source>
<translation>پراکسی و آی.پی.</translation>
</message>
<message>
<location line="+19"/>
<source>IP address of the proxy (e.g. 127.0.0.1)</source>
<translation>درس پروکسی</translation>
</message>
<message>
<location line="+7"/>
<source>&Port:</source>
<translation>درگاه</translation>
</message>
<message>
<location line="+19"/>
<source>Port of the proxy (e.g. 9050)</source>
<translation>درگاه پراکسی (مثال 9050)</translation>
</message>
<message>
<location line="+7"/>
<source>SOCKS &Version:</source>
<translation>SOCKS و نسخه</translation>
</message>
<message>
<location line="+13"/>
<source>SOCKS version of the proxy (e.g. 5)</source>
<translation>نسخه SOCKS از پراکسی (مثال 5)</translation>
</message>
<message>
<location line="+36"/>
<source>&Window</source>
<translation>صفحه</translation>
</message>
<message>
<location line="+6"/>
<source>Show only a tray icon after minimizing the window.</source>
<translation>tray icon را تنها بعد از کوچک کردن صفحه نمایش بده</translation>
</message>
<message>
<location line="+3"/>
<source>&Minimize to the tray instead of the taskbar</source>
<translation>حد اقل رساندن در جای نوار ابزار ها</translation>
</message>
<message>
<location line="+7"/>
<source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source>
<translation>حد اقل رساندن در جای خروج بر نامه وقتیکه پنجره بسته است.وقتیکه این فعال است برنامه خاموش می شود بعد از انتخاب دستور خاموش در منیو</translation>
</message>
<message>
<location line="+3"/>
<source>M&inimize on close</source>
<translation>کوچک کردن صفحه در زمان بستن</translation>
</message>
<message>
<location line="+21"/>
<source>&Display</source>
<translation>نمایش</translation>
</message>
<message>
<location line="+8"/>
<source>User Interface &language:</source>
<translation>میانجی کاربر و زبان</translation>
</message>
<message>
<location line="+13"/>
<source>The user interface language can be set here. This setting will take effect after restarting ncicoin.</source>
<translation>زبان میانجی کاربر می تواند در اینجا تنظیم شود. این تنظیمات بعد از شروع دوباره RESTART در ZETACOIN اجرایی خواهند بود.</translation>
</message>
<message>
<location line="+11"/>
<source>&Unit to show amounts in:</source>
<translation>واحد برای نمایش میزان وجوه در:</translation>
</message>
<message>
<location line="+13"/>
<source>Choose the default subdivision unit to show in the interface and when sending coins.</source>
<translation>بخش فرعی پیش فرض را برای نمایش میانجی و زمان ارسال سکه ها مشخص و انتخاب نمایید</translation>
</message>
<message>
<location line="+9"/>
<source>Whether to show ncicoin addresses in the transaction list or not.</source>
<translation>تا آدرسهای bITCOIN در فهرست تراکنش نمایش داده شوند یا نشوند.</translation>
</message>
<message>
<location line="+3"/>
<source>&Display addresses in transaction list</source>
<translation>نمایش آدرسها در فهرست تراکنش</translation>
</message>
<message>
<location line="+71"/>
<source>&OK</source>
<translation>تایید</translation>
</message>
<message>
<location line="+7"/>
<source>&Cancel</source>
<translation>رد</translation>
</message>
<message>
<location line="+10"/>
<source>&Apply</source>
<translation>انجام</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="+53"/>
<source>default</source>
<translation>پیش فرض</translation>
</message>
<message>
<location line="+130"/>
<source>Confirm options reset</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Some settings may require a client restart to take effect.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Do you want to proceed?</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+42"/>
<location line="+9"/>
<source>Warning</source>
<translation>هشدار</translation>
</message>
<message>
<location line="-9"/>
<location line="+9"/>
<source>This setting will take effect after restarting ncicoin.</source>
<translation>این تنظیمات پس از اجرای دوباره ncicoin اعمال می شوند</translation>
</message>
<message>
<location line="+29"/>
<source>The supplied proxy address is invalid.</source>
<translation>آدرس پراکسی داده شده صحیح نیست</translation>
</message>
</context>
<context>
<name>OverviewPage</name>
<message>
<location filename="../forms/overviewpage.ui" line="+14"/>
<source>Form</source>
<translation>تراز</translation>
</message>
<message>
<location line="+50"/>
<location line="+166"/>
<source>The displayed information may be out of date. Your wallet automatically synchronizes with the ncicoin network after a connection is established, but this process has not completed yet.</source>
<translation>اطلاعات نمایش داده شده روزآمد نیستند.wallet شما به صورت خودکار با شبکه ncicoin بعد از برقراری اتصال روزآمد می شود اما این فرایند هنوز کامل نشده است.</translation>
</message>
<message>
<location line="-124"/>
<source>Balance:</source>
<translation>راز:</translation>
</message>
<message>
<location line="+29"/>
<source>Unconfirmed:</source>
<translation>تایید نشده</translation>
</message>
<message>
<location line="-78"/>
<source>Wallet</source>
<translation>wallet</translation>
</message>
<message>
<location line="+107"/>
<source>Immature:</source>
<translation>نابالغ</translation>
</message>
<message>
<location line="+13"/>
<source>Mined balance that has not yet matured</source>
<translation>بالانس/تتمه حساب استخراج شده، نابالغ است /تکمیل نشده است</translation>
</message>
<message>
<location line="+46"/>
<source><b>Recent transactions</b></source>
<translation>اخرین معاملات&lt</translation>
</message>
<message>
<location line="-101"/>
<source>Your current balance</source>
<translation>تزار جاری شما</translation>
</message>
<message>
<location line="+29"/>
<source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source>
<translation>تعداد معاملات که تایید شده ولی هنوز در تزار جاری شما بر شمار نرفته است</translation>
</message>
<message>
<location filename="../overviewpage.cpp" line="+116"/>
<location line="+1"/>
<source>out of sync</source>
<translation>روزآمد نشده</translation>
</message>
</context>
<context>
<name>PaymentServer</name>
<message>
<location filename="../paymentserver.cpp" line="+107"/>
<source>Cannot start ncicoin: click-to-pay handler</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>QRCodeDialog</name>
<message>
<location filename="../forms/qrcodedialog.ui" line="+14"/>
<source>QR Code Dialog</source>
<translation>دیالوگ QR CODE</translation>
</message>
<message>
<location line="+59"/>
<source>Request Payment</source>
<translation>درخواست پرداخت</translation>
</message>
<message>
<location line="+56"/>
<source>Amount:</source>
<translation>مقدار:</translation>
</message>
<message>
<location line="-44"/>
<source>Label:</source>
<translation>برچسب:</translation>
</message>
<message>
<location line="+19"/>
<source>Message:</source>
<translation>پیام</translation>
</message>
<message>
<location line="+71"/>
<source>&Save As...</source>
<translation>&ذخیره به عنوان...</translation>
</message>
<message>
<location filename="../qrcodedialog.cpp" line="+62"/>
<source>Error encoding URI into QR Code.</source>
<translation>خطا در زمان رمزدار کردن URI در کد QR</translation>
</message>
<message>
<location line="+40"/>
<source>The entered amount is invalid, please check.</source>
<translation>میزان وجه وارد شده صحیح نیست، لطفا بررسی نمایید</translation>
</message>
<message>
<location line="+23"/>
<source>Resulting URI too long, try to reduce the text for label / message.</source>
<translation>URI ذکر شده بسیار طولانی است، متن برچسب/پیام را کوتاه کنید</translation>
</message>
<message>
<location line="+25"/>
<source>Save QR Code</source>
<translation>ذخیره کد QR</translation>
</message>
<message>
<location line="+0"/>
<source>PNG Images (*.png)</source>
<translation>تصاویر با فرمت PNG (*.png)</translation>
</message>
</context>
<context>
<name>RPCConsole</name>
<message>
<location filename="../forms/rpcconsole.ui" line="+46"/>
<source>Client name</source>
<translation>نام مشتری</translation>
</message>
<message>
<location line="+10"/>
<location line="+23"/>
<location line="+26"/>
<location line="+23"/>
<location line="+23"/>
<location line="+36"/>
<location line="+53"/>
<location line="+23"/>
<location line="+23"/>
<location filename="../rpcconsole.cpp" line="+339"/>
<source>N/A</source>
<translation>-</translation>
</message>
<message>
<location line="-217"/>
<source>Client version</source>
<translation>نسخه مشتری</translation>
</message>
<message>
<location line="-45"/>
<source>&Information</source>
<translation>اطلاعات</translation>
</message>
<message>
<location line="+68"/>
<source>Using OpenSSL version</source>
<translation>استفاده از نسخه OPENSSL</translation>
</message>
<message>
<location line="+49"/>
<source>Startup time</source>
<translation>زمان آغاز STARTUP</translation>
</message>
<message>
<location line="+29"/>
<source>Network</source>
<translation>شبکه</translation>
</message>
<message>
<location line="+7"/>
<source>Number of connections</source>
<translation>تعداد اتصالات</translation>
</message>
<message>
<location line="+23"/>
<source>On testnet</source>
<translation>در testnetکها</translation>
</message>
<message>
<location line="+23"/>
<source>Block chain</source>
<translation>زنجیره بلاک</translation>
</message>
<message>
<location line="+7"/>
<source>Current number of blocks</source>
<translation>تعداد کنونی بلاکها</translation>
</message>
<message>
<location line="+23"/>
<source>Estimated total blocks</source>
<translation>تعداد تخمینی بلاکها</translation>
</message>
<message>
<location line="+23"/>
<source>Last block time</source>
<translation>زمان آخرین بلاک</translation>
</message>
<message>
<location line="+52"/>
<source>&Open</source>
<translation>باز کردن</translation>
</message>
<message>
<location line="+16"/>
<source>Command-line options</source>
<translation>گزینه های command-line</translation>
</message>
<message>
<location line="+7"/>
<source>Show the ncicoin-Qt help message to get a list with possible ncicoin command-line options.</source>
<translation>پیام راهنمای ncicoin-Qt را برای گرفتن فهرست گزینه های command-line نشان بده</translation>
</message>
<message>
<location line="+3"/>
<source>&Show</source>
<translation>نمایش</translation>
</message>
<message>
<location line="+24"/>
<source>&Console</source>
<translation>کنسول</translation>
</message>
<message>
<location line="-260"/>
<source>Build date</source>
<translation>ساخت تاریخ</translation>
</message>
<message>
<location line="-104"/>
<source>ncicoin - Debug window</source>
<translation>صفحه اشکال زدایی ncicoin </translation>
</message>
<message>
<location line="+25"/>
<source>ncicoin Core</source>
<translation> هسته ncicoin </translation>
</message>
<message>
<location line="+279"/>
<source>Debug log file</source>
<translation>فایلِ لاگِ اشکال زدایی</translation>
</message>
<message>
<location line="+7"/>
<source>Open the ncicoin debug log file from the current data directory. This can take a few seconds for large log files.</source>
<translation>فایلِ لاگِ اشکال زدایی ncicoin را از دایرکتوری جاری داده ها باز کنید. این عملیات ممکن است برای فایلهای لاگِ حجیم طولانی شود.</translation>
</message>
<message>
<location line="+102"/>
<source>Clear console</source>
<translation>پاکسازی کنسول</translation>
</message>
<message>
<location filename="../rpcconsole.cpp" line="-30"/>
<source>Welcome to the ncicoin RPC console.</source>
<translation>به کنسول ncicoin RPC خوش آمدید</translation>
</message>
<message>
<location line="+1"/>
<source>Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen.</source>
<translation>دکمه های بالا و پایین برای مرور تاریخچه و Ctrl-L برای پاکسازی صفحه</translation>
</message>
<message>
<location line="+1"/>
<source>Type <b>help</b> for an overview of available commands.</source>
<translation>با تایپ عبارت HELP دستورهای در دسترس را مرور خواهید کرد</translation>
</message>
</context>
<context>
<name>SendCoinsDialog</name>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="+14"/>
<location filename="../sendcoinsdialog.cpp" line="+124"/>
<location line="+5"/>
<location line="+5"/>
<location line="+5"/>
<location line="+6"/>
<location line="+5"/>
<location line="+5"/>
<source>Send Coins</source>
<translation>ارسال سکه ها</translation>
</message>
<message>
<location line="+50"/>
<source>Send to multiple recipients at once</source>
<translation>ارسال چندین در یافت ها فورا</translation>
</message>
<message>
<location line="+3"/>
<source>Add &Recipient</source>
<translation>اضافه کردن دریافت کننده</translation>
</message>
<message>
<location line="+20"/>
<source>Remove all transaction fields</source>
<translation>پاک کردن تمام ستونهای تراکنش</translation>
</message>
<message>
<location line="+3"/>
<source>Clear &All</source>
<translation>پاکسازی همه</translation>
</message>
<message>
<location line="+22"/>
<source>Balance:</source>
<translation>تزار :</translation>
</message>
<message>
<location line="+10"/>
<source>123.456 BTC</source>
<translation>123.456 بتس</translation>
</message>
<message>
<location line="+31"/>
<source>Confirm the send action</source>
<translation>عملیت دوم تایید کنید</translation>
</message>
<message>
<location line="+3"/>
<source>S&end</source>
<translation>&;ارسال</translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="-59"/>
<source><b>%1</b> to %2 (%3)</source>
<translation>(%3) تا <b>%1</b> درصد%2</translation>
</message>
<message>
<location line="+5"/>
<source>Confirm send coins</source>
<translation>ارسال سکه ها تایید کنید</translation>
</message>
<message>
<location line="+1"/>
<source>Are you sure you want to send %1?</source>
<translation> %1شما متماینید که می خواهید 1% ارسال کنید ؟</translation>
</message>
<message>
<location line="+0"/>
<source> and </source>
<translation>و</translation>
</message>
<message>
<location line="+23"/>
<source>The recipient address is not valid, please recheck.</source>
<translation>آدرس گیرنده نادرست است، لطفا دوباره بررسی کنید.</translation>
</message>
<message>
<location line="+5"/>
<source>The amount to pay must be larger than 0.</source>
<translation>مبلغ پر داخت باید از 0 بیشتر باشد </translation>
</message>
<message>
<location line="+5"/>
<source>The amount exceeds your balance.</source>
<translation>میزان وجه از بالانس/تتمه حساب شما بیشتر است</translation>
</message>
<message>
<location line="+5"/>
<source>The total exceeds your balance when the %1 transaction fee is included.</source>
<translation>کل میزان وجه از بالانس/تتمه حساب شما بیشتر می شود وقتی %1 هزینه تراکنش نیز به ین میزان افزوده می شود</translation>
</message>
<message>
<location line="+6"/>
<source>Duplicate address found, can only send to each address once per send operation.</source>
<translation>آدرس تکراری یافت شده است، در زمان انجام عملیات به هر آدرس تنها یکبار می توانید اطلاعات ارسال کنید</translation>
</message>
<message>
<location line="+5"/>
<source>Error: Transaction creation failed!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source>
<translation>خطا: تراکنش تایید نشد. این پیام زمانی روی می دهد که مقداری از سکه های WALLET شما استفاده شده اند برای مثال اگر شما از WALLET.DAT استفاده کرده اید، ممکن است سکه ها استفاده شده باشند اما در اینجا نمایش داده نشوند</translation>
</message>
</context>
<context>
<name>SendCoinsEntry</name>
<message>
<location filename="../forms/sendcoinsentry.ui" line="+14"/>
<source>Form</source>
<translation>تراز</translation>
</message>
<message>
<location line="+15"/>
<source>A&mount:</source>
<translation>A&مبلغ :</translation>
</message>
<message>
<location line="+13"/>
<source>Pay &To:</source>
<translation>به&پر داخت :</translation>
</message>
<message>
<location line="+34"/>
<source>The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+60"/>
<location filename="../sendcoinsentry.cpp" line="+26"/>
<source>Enter a label for this address to add it to your address book</source>
<translation>برای آدرس بر پسب وارد کنید که در دفتر آدرس اضافه شود</translation>
</message>
<message>
<location line="-78"/>
<source>&Label:</source>
<translation>&بر چسب </translation>
</message>
<message>
<location line="+28"/>
<source>Choose address from address book</source>
<translation>اآدرسن ازدفتر آدرس انتخاب کنید</translation>
</message>
<message>
<location line="+10"/>
<source>Alt+A</source>
<translation>Alt+A</translation>
</message>
<message>
<location line="+7"/>
<source>Paste address from clipboard</source>
<translation>آدرس از تخته رسم گیره دار پست کنید </translation>
</message>
<message>
<location line="+10"/>
<source>Alt+P</source>
<translation>Alt+P</translation>
</message>
<message>
<location line="+7"/>
<source>Remove this recipient</source>
<translation>بر داشتن این در یافت کننده</translation>
</message>
<message>
<location filename="../sendcoinsentry.cpp" line="+1"/>
<source>Enter a ncicoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source>
<translation>آدرس بیتکویین وارد کنید (bijvoorbeeld: 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation>
</message>
</context>
<context>
<name>SignVerifyMessageDialog</name>
<message>
<location filename="../forms/signverifymessagedialog.ui" line="+14"/>
<source>Signatures - Sign / Verify a Message</source>
<translation>امضا - امضا کردن /شناسایی یک پیام</translation>
</message>
<message>
<location line="+13"/>
<source>&Sign Message</source>
<translation>&امضای پیام</translation>
</message>
<message>
<location line="+6"/>
<source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source>
<translation>شما می توانید پیامها را با آدرس خودتان امضا نمایید تا ثابت شود متعلق به شما هستند. مواظب باشید تا چیزی که بدان مطمئن نیستنید را امضا نکنید زیرا حملات فیشینگ در زمان ورود شما به سیستم فریبنده هستند. تنها مواردی را که حاوی اطلاعات دقیق و قابل قبول برای شما هستند را امضا کنید</translation>
</message>
<message>
<location line="+18"/>
<source>The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source>
<translation>آدرس برای امضا کردن پیام با (برای مثال 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation>
</message>
<message>
<location line="+10"/>
<location line="+213"/>
<source>Choose an address from the address book</source>
<translation>یک آدرس را از فهرست آدرسها انتخاب کنید</translation>
</message>
<message>
<location line="-203"/>
<location line="+213"/>
<source>Alt+A</source>
<translation>Alt+A</translation>
</message>
<message>
<location line="-203"/>
<source>Paste address from clipboard</source>
<translation>آدرس از تخته رسم گیره دار پست کنید </translation>
</message>
<message>
<location line="+10"/>
<source>Alt+P</source>
<translation>Alt+P</translation>
</message>
<message>
<location line="+12"/>
<source>Enter the message you want to sign here</source>
<translation>پیامی را که میخواهید امضا کنید در اینجا وارد کنید</translation>
</message>
<message>
<location line="+7"/>
<source>Signature</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+27"/>
<source>Copy the current signature to the system clipboard</source>
<translation>این امضا را در system clipboard کپی کن</translation>
</message>
<message>
<location line="+21"/>
<source>Sign the message to prove you own this ncicoin address</source>
<translation>پیام را برای اثبات آدرس ZETACOIN خود امضا کنید</translation>
</message>
<message>
<location line="+3"/>
<source>Sign &Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Reset all sign message fields</source>
<translation>تنظیم دوباره تمامی فیلدهای پیام</translation>
</message>
<message>
<location line="+3"/>
<location line="+146"/>
<source>Clear &All</source>
<translation>پاکسازی همه</translation>
</message>
<message>
<location line="-87"/>
<source>&Verify Message</source>
<translation>تایید پیام</translation>
</message>
<message>
<location line="+6"/>
<source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source>
<translation>آدرس/پیام خود را وارد کنید (مطمئن شوید که فاصله بین خطوط، فاصله ها، تب ها و ... را دقیقا کپی می کنید) و سپس امضا کنید تا پیام تایید شود. مراقب باشید که پیام را بیشتر از مطالب درون امضا مطالعه نمایید تا فریب شخص سوم/دزدان اینترنتی را نخورید.</translation>
</message>
<message>
<location line="+21"/>
<source>The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source>
<translation>آدرس برای امضا کردن پیام با (برای مثال 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation>
</message>
<message>
<location line="+40"/>
<source>Verify the message to ensure it was signed with the specified ncicoin address</source>
<translation>پیام را برای اطمنان از ورود به سیستم با آدرس ZETACOIN مشخص خود،تایید کنید</translation>
</message>
<message>
<location line="+3"/>
<source>Verify &Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Reset all verify message fields</source>
<translation>تنظیم دوباره تمامی فیلدهای پیام تایید شده</translation>
</message>
<message>
<location filename="../signverifymessagedialog.cpp" line="+27"/>
<location line="+3"/>
<source>Enter a ncicoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source>
<translation>آدرس بیتکویین وارد کنید (bijvoorbeeld: 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation>
</message>
<message>
<location line="-2"/>
<source>Click "Sign Message" to generate signature</source>
<translation>با کلیک بر "امضای پیام" شما یک امضای جدید درست می کنید</translation>
</message>
<message>
<location line="+3"/>
<source>Enter ncicoin signature</source>
<translation>امضای BITOCOIN خود را وارد کنید</translation>
</message>
<message>
<location line="+82"/>
<location line="+81"/>
<source>The entered address is invalid.</source>
<translation>آدرس وارد شده صحیح نیست</translation>
</message>
<message>
<location line="-81"/>
<location line="+8"/>
<location line="+73"/>
<location line="+8"/>
<source>Please check the address and try again.</source>
<translation>اطفا آدرس را بررسی کرده و دوباره امتحان کنید</translation>
</message>
<message>
<location line="-81"/>
<location line="+81"/>
<source>The entered address does not refer to a key.</source>
<translation>آدرس وارد شده با کلید وارد شده مرتبط نیست</translation>
</message>
<message>
<location line="-73"/>
<source>Wallet unlock was cancelled.</source>
<translation>قفل کردن wallet انجام نشد</translation>
</message>
<message>
<location line="+8"/>
<source>Private key for the entered address is not available.</source>
<translation>کلید شخصی برای آدرس وارد شده در دسترس نیست</translation>
</message>
<message>
<location line="+12"/>
<source>Message signing failed.</source>
<translation>پیام امضا کردن انجام نشد</translation>
</message>
<message>
<location line="+5"/>
<source>Message signed.</source>
<translation>پیام امضا شد</translation>
</message>
<message>
<location line="+59"/>
<source>The signature could not be decoded.</source>
<translation>امضا نمی تواند رمزگشایی شود</translation>
</message>
<message>
<location line="+0"/>
<location line="+13"/>
<source>Please check the signature and try again.</source>
<translation>لطفا امضا را بررسی و دوباره تلاش نمایید</translation>
</message>
<message>
<location line="+0"/>
<source>The signature did not match the message digest.</source>
<translation>امضا با تحلیلِ پیام مطابقت ندارد</translation>
</message>
<message>
<location line="+7"/>
<source>Message verification failed.</source>
<translation>عملیات شناسایی پیام انجام نشد</translation>
</message>
<message>
<location line="+5"/>
<source>Message verified.</source>
<translation>پیام شناسایی شد</translation>
</message>
</context>
<context>
<name>SplashScreen</name>
<message>
<location filename="../splashscreen.cpp" line="+25"/>
<source>The ncicoin developers</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>[testnet]</source>
<translation>آزمایش شبکه</translation>
</message>
</context>
<context>
<name>TransactionDesc</name>
<message>
<location filename="../transactiondesc.cpp" line="+20"/>
<source>Open until %1</source>
<translation>باز کردن تا%1</translation>
</message>
<message>
<location line="+6"/>
<source>%1/offline</source>
<translation>%1 آفلاین</translation>
</message>
<message>
<location line="+2"/>
<source>%1/unconfirmed</source>
<translation>%1 تایید نشده </translation>
</message>
<message>
<location line="+2"/>
<source>%1 confirmations</source>
<translation>ایید %1 </translation>
</message>
<message>
<location line="+18"/>
<source>Status</source>
<translation>وضعیت</translation>
</message>
<message numerus="yes">
<location line="+7"/>
<source>, broadcast through %n node(s)</source>
<translation><numerusform>انتشار از طریق n% گره
انتشار از طریق %n گره</numerusform></translation>
</message>
<message>
<location line="+4"/>
<source>Date</source>
<translation>تاریخ </translation>
</message>
<message>
<location line="+7"/>
<source>Source</source>
<translation>منبع</translation>
</message>
<message>
<location line="+0"/>
<source>Generated</source>
<translation>تولید شده</translation>
</message>
<message>
<location line="+5"/>
<location line="+17"/>
<source>From</source>
<translation>فرستنده</translation>
</message>
<message>
<location line="+1"/>
<location line="+22"/>
<location line="+58"/>
<source>To</source>
<translation>گیرنده</translation>
</message>
<message>
<location line="-77"/>
<location line="+2"/>
<source>own address</source>
<translation>آدرس شما</translation>
</message>
<message>
<location line="-2"/>
<source>label</source>
<translation>برچسب</translation>
</message>
<message>
<location line="+37"/>
<location line="+12"/>
<location line="+45"/>
<location line="+17"/>
<location line="+30"/>
<source>Credit</source>
<translation>بدهی </translation>
</message>
<message numerus="yes">
<location line="-102"/>
<source>matures in %n more block(s)</source>
<translation><numerusform>بلوغ در n% از بیشتر بلاکها
بلوغ در %n از بیشتر بلاکها</numerusform></translation>
</message>
<message>
<location line="+2"/>
<source>not accepted</source>
<translation>غیرقابل قبول</translation>
</message>
<message>
<location line="+44"/>
<location line="+8"/>
<location line="+15"/>
<location line="+30"/>
<source>Debit</source>
<translation>اعتبار</translation>
</message>
<message>
<location line="-39"/>
<source>Transaction fee</source>
<translation>هزینه تراکنش</translation>
</message>
<message>
<location line="+16"/>
<source>Net amount</source>
<translation>هزینه خالص</translation>
</message>
<message>
<location line="+6"/>
<source>Message</source>
<translation>پیام</translation>
</message>
<message>
<location line="+2"/>
<source>Comment</source>
<translation>نظر</translation>
</message>
<message>
<location line="+2"/>
<source>Transaction ID</source>
<translation>شناسه کاربری برای تراکنش</translation>
</message>
<message>
<location line="+3"/>
<source>Generated coins must mature 120 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>
<translation>سکه های ایجاد شده باید 120 بلاک را قبل از استفاده بالغ کنند. در هنگام ایجاد بلاک، آن بلاک در شبکه منتشر می شود تا به زنجیره بلاکها بپیوندد. اگر در زنجیره قرار نگیرد، پیام وضعیت به غیرقابل قبول تغییر می بپیابد و قابل استفاده نیست. این مورد معمولا زمانی پیش می آید که گره دیگری به طور همزمان بلاکی را با فاصل چند ثانیه ای از شما ایجاد کند.</translation>
</message>
<message>
<location line="+7"/>
<source>Debug information</source>
<translation>اشکال زدایی طلاعات</translation>
</message>
<message>
<location line="+8"/>
<source>Transaction</source>
<translation>تراکنش</translation>
</message>
<message>
<location line="+3"/>
<source>Inputs</source>
<translation>درونداد</translation>
</message>
<message>
<location line="+23"/>
<source>Amount</source>
<translation>مبلغ</translation>
</message>
<message>
<location line="+1"/>
<source>true</source>
<translation>صحیح</translation>
</message>
<message>
<location line="+0"/>
<source>false</source>
<translation>نادرست</translation>
</message>
<message>
<location line="-209"/>
<source>, has not been successfully broadcast yet</source>
<translation>هنوز با مو فقیت ارسال نشده</translation>
</message>
<message numerus="yes">
<location line="-35"/>
<source>Open for %n more block(s)</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message>
<location line="+70"/>
<source>unknown</source>
<translation>مشخص نیست </translation>
</message>
</context>
<context>
<name>TransactionDescDialog</name>
<message>
<location filename="../forms/transactiondescdialog.ui" line="+14"/>
<source>Transaction details</source>
<translation>جزییات معاملات</translation>
</message>
<message>
<location line="+6"/>
<source>This pane shows a detailed description of the transaction</source>
<translation>در این قاب شیشه توصیف دقیق معامله نشان می شود</translation>
</message>
</context>
<context>
<name>TransactionTableModel</name>
<message>
<location filename="../transactiontablemodel.cpp" line="+225"/>
<source>Date</source>
<translation>تاریخ</translation>
</message>
<message>
<location line="+0"/>
<source>Type</source>
<translation>نوع</translation>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation>ایل جدا </translation>
</message>
<message>
<location line="+0"/>
<source>Amount</source>
<translation>مبلغ</translation>
</message>
<message numerus="yes">
<location line="+57"/>
<source>Open for %n more block(s)</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message>
<location line="+3"/>
<source>Open until %1</source>
<translation>از شده تا 1%1</translation>
</message>
<message>
<location line="+3"/>
<source>Offline (%1 confirmations)</source>
<translation>افلایین (%1)</translation>
</message>
<message>
<location line="+3"/>
<source>Unconfirmed (%1 of %2 confirmations)</source>
<translation>تایید نشده (%1/%2)</translation>
</message>
<message>
<location line="+3"/>
<source>Confirmed (%1 confirmations)</source>
<translation>تایید شده (%1)</translation>
</message>
<message numerus="yes">
<location line="+8"/>
<source>Mined balance will be available when it matures in %n more block(s)</source>
<translation><numerusform>بالانس/تتمه حساب استخراج شده زمانی که %n از بیشتر بلاکها بالغ شدند در دسترس خواهد بود
بالانس/تتمه حساب استخراج شده زمانی که n% از بیشتر بلاکها بالغ شدند در دسترس خواهد بود</numerusform></translation>
</message>
<message>
<location line="+5"/>
<source>This block was not received by any other nodes and will probably not be accepted!</source>
<translation>این بلوک از دیگر گره ها در یافت نشده بدین دلیل شاید قابل قابول نیست</translation>
</message>
<message>
<location line="+3"/>
<source>Generated but not accepted</source>
<translation>تولید شده ولی قبول نشده</translation>
</message>
<message>
<location line="+43"/>
<source>Received with</source>
<translation>در یافت با :</translation>
</message>
<message>
<location line="+2"/>
<source>Received from</source>
<translation>دریافتی از</translation>
</message>
<message>
<location line="+3"/>
<source>Sent to</source>
<translation>ارسال به :</translation>
</message>
<message>
<location line="+2"/>
<source>Payment to yourself</source>
<translation>پر داخت به خودتان</translation>
</message>
<message>
<location line="+2"/>
<source>Mined</source>
<translation>استخراج</translation>
</message>
<message>
<location line="+38"/>
<source>(n/a)</source>
<translation>(کاربرد ندارد)</translation>
</message>
<message>
<location line="+199"/>
<source>Transaction status. Hover over this field to show number of confirmations.</source>
<translation>وضعیت معالمه . عرصه که تعداد تایید نشان می دهد</translation>
</message>
<message>
<location line="+2"/>
<source>Date and time that the transaction was received.</source>
<translation>تاریخ و ساعت در یافت معامله</translation>
</message>
<message>
<location line="+2"/>
<source>Type of transaction.</source>
<translation>نوع معاملات</translation>
</message>
<message>
<location line="+2"/>
<source>Destination address of transaction.</source>
<translation>آدرس مقصود معاملات </translation>
</message>
<message>
<location line="+2"/>
<source>Amount removed from or added to balance.</source>
<translation>مبلغ از تزار شما خارج یا وارد شده</translation>
</message>
</context>
<context>
<name>TransactionView</name>
<message>
<location filename="../transactionview.cpp" line="+52"/>
<location line="+16"/>
<source>All</source>
<translation>همه</translation>
</message>
<message>
<location line="-15"/>
<source>Today</source>
<translation>امروز</translation>
</message>
<message>
<location line="+1"/>
<source>This week</source>
<translation>این هفته</translation>
</message>
<message>
<location line="+1"/>
<source>This month</source>
<translation>این ماه</translation>
</message>
<message>
<location line="+1"/>
<source>Last month</source>
<translation>ماه گذشته</translation>
</message>
<message>
<location line="+1"/>
<source>This year</source>
<translation>امسال</translation>
</message>
<message>
<location line="+1"/>
<source>Range...</source>
<translation>محدوده </translation>
</message>
<message>
<location line="+11"/>
<source>Received with</source>
<translation>در یافت با</translation>
</message>
<message>
<location line="+2"/>
<source>Sent to</source>
<translation>ارسال به</translation>
</message>
<message>
<location line="+2"/>
<source>To yourself</source>
<translation>به خودتان </translation>
</message>
<message>
<location line="+1"/>
<source>Mined</source>
<translation>استخراج</translation>
</message>
<message>
<location line="+1"/>
<source>Other</source>
<translation>یگر </translation>
</message>
<message>
<location line="+7"/>
<source>Enter address or label to search</source>
<translation>برای جستوجو نشانی یا برچسب را وارد کنید</translation>
</message>
<message>
<location line="+7"/>
<source>Min amount</source>
<translation>حد اقل مبلغ </translation>
</message>
<message>
<location line="+34"/>
<source>Copy address</source>
<translation>کپی آدرس </translation>
</message>
<message>
<location line="+1"/>
<source>Copy label</source>
<translation>کپی بر چسب</translation>
</message>
<message>
<location line="+1"/>
<source>Copy amount</source>
<translation>روگرفت مقدار</translation>
</message>
<message>
<location line="+1"/>
<source>Copy transaction ID</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Edit label</source>
<translation>اصلاح بر چسب</translation>
</message>
<message>
<location line="+1"/>
<source>Show transaction details</source>
<translation>جزئیات تراکنش را نمایش بده</translation>
</message>
<message>
<location line="+139"/>
<source>Export Transaction Data</source>
<translation>صادرات تاریخ معامله</translation>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation>Comma فایل جدا </translation>
</message>
<message>
<location line="+8"/>
<source>Confirmed</source>
<translation>تایید شده</translation>
</message>
<message>
<location line="+1"/>
<source>Date</source>
<translation>تاریخ </translation>
</message>
<message>
<location line="+1"/>
<source>Type</source>
<translation>نوع </translation>
</message>
<message>
<location line="+1"/>
<source>Label</source>
<translation>ر چسب</translation>
</message>
<message>
<location line="+1"/>
<source>Address</source>
<translation>ایل جدا </translation>
</message>
<message>
<location line="+1"/>
<source>Amount</source>
<translation>مبلغ</translation>
</message>
<message>
<location line="+1"/>
<source>ID</source>
<translation>آی دی</translation>
</message>
<message>
<location line="+4"/>
<source>Error exporting</source>
<translation>خطای صادرت</translation>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation>تا فایل %1 نمی شود نوشت</translation>
</message>
<message>
<location line="+100"/>
<source>Range:</source>
<translation>>محدوده</translation>
</message>
<message>
<location line="+8"/>
<source>to</source>
<translation>به</translation>
</message>
</context>
<context>
<name>WalletModel</name>
<message>
<location filename="../walletmodel.cpp" line="+193"/>
<source>Send Coins</source>
<translation>ارسال سکه ها</translation>
</message>
</context>
<context>
<name>WalletView</name>
<message>
<location filename="../walletview.cpp" line="+42"/>
<source>&Export</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Export the data in the current tab to a file</source>
<translation>داده ها نوارِ جاری را به فایل انتقال دهید</translation>
</message>
<message>
<location line="+193"/>
<source>Backup Wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Wallet Data (*.dat)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Backup Failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>There was an error trying to save the wallet data to the new location.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Backup Successful</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>The wallet data was successfully saved to the new location.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>bitcoin-core</name>
<message>
<location filename="../bitcoinstrings.cpp" line="+94"/>
<source>ncicoin version</source>
<translation>سخه بیتکویین</translation>
</message>
<message>
<location line="+102"/>
<source>Usage:</source>
<translation>ستفاده :</translation>
</message>
<message>
<location line="-29"/>
<source>Send command to -server or ncicoind</source>
<translation>ارسال فرمان به سرور یا باتکویین</translation>
</message>
<message>
<location line="-23"/>
<source>List commands</source>
<translation>لیست فومان ها</translation>
</message>
<message>
<location line="-12"/>
<source>Get help for a command</source>
<translation>کمک برای فرمان </translation>
</message>
<message>
<location line="+24"/>
<source>Options:</source>
<translation>تنظیمات</translation>
</message>
<message>
<location line="+24"/>
<source>Specify configuration file (default: ncicoin.conf)</source>
<translation>(: ncicoin.confپیش فرض: )فایل تنظیمی خاص </translation>
</message>
<message>
<location line="+3"/>
<source>Specify pid file (default: ncicoind.pid)</source>
<translation>(ncicoind.pidپیش فرض : ) فایل پید خاص</translation>
</message>
<message>
<location line="-1"/>
<source>Specify data directory</source>
<translation>دایرکتور اطلاعاتی خاص</translation>
</message>
<message>
<location line="-9"/>
<source>Set database cache size in megabytes (default: 25)</source>
<translation>سایز کَش بانک داده را بر حسب مگابایت تنظیم کنید (پیش فرض:25)</translation>
</message>
<message>
<location line="-28"/>
<source>Listen for connections on <port> (default: 8333 or testnet: 18333)</source>
<translation>برای اتصالات به <port> (پیشفرض: 8333 یا تستنت: 18333) گوش کنید</translation>
</message>
<message>
<location line="+5"/>
<source>Maintain at most <n> connections to peers (default: 125)</source>
<translation>حداکثر <n> اتصال با همکاران برقرار داشته باشید (پیشفرض: 125)</translation>
</message>
<message>
<location line="-48"/>
<source>Connect to a node to retrieve peer addresses, and disconnect</source>
<translation>اتصال به گره برای دریافت آدرسهای قرینه و قطع اتصال</translation>
</message>
<message>
<location line="+82"/>
<source>Specify your own public address</source>
<translation>آدرس عمومی خود را ذکر کنید</translation>
</message>
<message>
<location line="+3"/>
<source>Threshold for disconnecting misbehaving peers (default: 100)</source>
<translation>آستانه برای قطع ارتباط با همکاران بدرفتار (پیشفرض: 100)</translation>
</message>
<message>
<location line="-134"/>
<source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source>
<translation>مدت زمان به ثانیه برای جلوگیری از همکاران بدرفتار برای اتصال دوباره (پیشفرض: 86400)</translation>
</message>
<message>
<location line="-29"/>
<source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source>
<translation>در زمان تنظیم درگاه RPX %u در فهرست کردن %s اشکالی رخ داده است</translation>
</message>
<message>
<location line="+27"/>
<source>Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332)</source>
<translation>( 8332پیش فرض :) &lt;poort&gt; JSON-RPC شنوایی برای ارتباطات</translation>
</message>
<message>
<location line="+37"/>
<source>Accept command line and JSON-RPC commands</source>
<translation>JSON-RPC قابل فرمانها و</translation>
</message>
<message>
<location line="+76"/>
<source>Run in the background as a daemon and accept commands</source>
<translation>اجرای در پس زمینه به عنوان شبح و قبول فرمان ها</translation>
</message>
<message>
<location line="+37"/>
<source>Use the test network</source>
<translation>استفاده شبکه آزمایش</translation>
</message>
<message>
<location line="-112"/>
<source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>
<translation>پذیرش اتصالات از بیرون (پیش فرض:1 بدون پراکسی یا اتصال)</translation>
</message>
<message>
<location line="-80"/>
<source>%s, you must set a rpcpassword in the configuration file:
%s
It is recommended you use the following random password:
rpcuser=ncicoinrpc
rpcpassword=%s
(you do not need to remember this password)
The username and password MUST NOT be the same.
If the file does not exist, create it with owner-readable-only file permissions.
It is also recommended to set alertnotify so you are notified of problems;
for example: alertnotify=echo %%s | mail -s "ncicoin Alert" [email protected]
</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+17"/>
<source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Cannot obtain a lock on data directory %s. ncicoin is probably already running.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source>
<translation>حجم حداکثر تراکنشهای با/کم اهمیت را به بایت تنظیم کنید (پیش فرض:27000)</translation>
</message>
<message>
<location line="+6"/>
<source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source>
<translation>هشدار:paytxfee بسیار بالا تعریف شده است! این هزینه تراکنش است که باید در زمان ارسال تراکنش بپردازید</translation>
</message>
<message>
<location line="+3"/>
<source>Warning: Displayed transactions may not be correct! You may need to upgrade, or other nodes may need to upgrade.</source>
<translation>هشدار: تراکنش نمایش داده شده ممکن است صحیح نباشد! شما/یا یکی از گره ها به روزآمد سازی نیاز دارید </translation>
</message>
<message>
<location line="+3"/>
<source>Warning: Please check that your computer's date and time are correct! If your clock is wrong ncicoin will not work properly.</source>
<translation>هشدار: لطفا زمان و تاریخ رایانه خود را تصحیح نمایید! اگر ساعت رایانه شما اشتباه باشد ncicoin ممکن است صحیح کار نکند</translation>
</message>
<message>
<location line="+3"/>
<source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Attempt to recover private keys from a corrupt wallet.dat</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Block creation options:</source>
<translation>بستن گزینه ایجاد</translation>
</message>
<message>
<location line="+5"/>
<source>Connect only to the specified node(s)</source>
<translation>تنها در گره (های) مشخص شده متصل شوید</translation>
</message>
<message>
<location line="+3"/>
<source>Corrupted block database detected</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Discover own IP address (default: 1 when listening and no -externalip)</source>
<translation>آدرس آی.پی. خود را شناسایی کنید (پیش فرض:1 در زمان when listening وno -externalip)</translation>
</message>
<message>
<location line="+1"/>
<source>Do you want to rebuild the block database now?</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Error initializing block database</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Error initializing wallet database environment %s!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Error loading block database</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Error opening block database</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Error: Disk space is low!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Error: Wallet locked, unable to create transaction!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Error: system error: </source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to listen on any port. Use -listen=0 if you want this.</source>
<translation>شنیدن هر گونه درگاه انجام پذیر نیست. ازlisten=0 برای اینکار استفاده کیند.</translation>
</message>
<message>
<location line="+1"/>
<source>Failed to read block info</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to read block</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to sync block index</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write block index</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write block info</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write block</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write file info</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write to coin database</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write transaction index</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write undo data</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Find peers using DNS lookup (default: 1 unless -connect)</source>
<translation>قرینه ها را برای جستجوی DNS بیاب (پیش فرض: 1 مگر در زمان اتصال)</translation>
</message>
<message>
<location line="+1"/>
<source>Generate coins (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>How many blocks to check at startup (default: 288, 0 = all)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>How thorough the block verification is (0-4, default: 3)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>Not enough file descriptors available.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Rebuild block chain index from current blk000??.dat files</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>Set the number of threads to service RPC calls (default: 4)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+26"/>
<source>Verifying blocks...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Verifying wallet...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-69"/>
<source>Imports blocks from external blk000??.dat file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-76"/>
<source>Set the number of script verification threads (up to 16, 0 = auto, <0 = leave that many cores free, default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+77"/>
<source>Information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Invalid -tor address: '%s'</source>
<translation>آدرس نرم افزار تور غلط است %s</translation>
</message>
<message>
<location line="+1"/>
<source>Invalid amount for -minrelaytxfee=<amount>: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Invalid amount for -mintxfee=<amount>: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Maintain a full transaction index (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000)</source>
<translation>حداکثر بافر دریافت شده بر اساس اتصال <n>* 1000 بایت (پیش فرض:5000)</translation>
</message>
<message>
<location line="+1"/>
<source>Maximum per-connection send buffer, <n>*1000 bytes (default: 1000)</source>
<translation>حداکثر بافر دریافت شده بر اساس اتصال <n>* 1000 بایت (پیش فرض:1000)</translation>
</message>
<message>
<location line="+2"/>
<source>Only accept block chain matching built-in checkpoints (default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Only connect to nodes in network <net> (IPv4, IPv6 or Tor)</source>
<translation>تنها =به گره ها در شبکه متصا شوید <net> (IPv4, IPv6 or Tor)</translation>
</message>
<message>
<location line="+2"/>
<source>Output extra debugging information. Implies all other -debug* options</source>
<translation>برونداد اطلاعات اشکال زدایی اضافی. گزینه های اشکال زدایی دیگر رفع شدند</translation>
</message>
<message>
<location line="+1"/>
<source>Output extra network debugging information</source>
<translation>برونداد اطلاعات اشکال زدایی اضافی برای شبکه</translation>
</message>
<message>
<location line="+2"/>
<source>Prepend debug output with timestamp</source>
<translation>به خروجی اشکالزدایی برچسب زمان بزنید</translation>
</message>
<message>
<location line="+5"/>
<source>SSL options: (see the ncicoin Wiki for SSL setup instructions)</source>
<translation>گزینه ssl (به ویکیncicoin برای راهنمای راه اندازی ssl مراجعه شود)</translation>
</message>
<message>
<location line="+1"/>
<source>Select the version of socks proxy to use (4-5, default: 5)</source>
<translation>نسخه ای از پراکسی ساکس را برای استفاده انتخاب کنید (4-5 پیش فرض:5)</translation>
</message>
<message>
<location line="+3"/>
<source>Send trace/debug info to console instead of debug.log file</source>
<translation>اطلاعات ردگیری/اشکالزدایی را به جای فایل لاگ اشکالزدایی به کنسول بفرستید</translation>
</message>
<message>
<location line="+1"/>
<source>Send trace/debug info to debugger</source>
<translation>اطلاعات ردگیری/اشکالزدایی را به اشکالزدا بفرستید</translation>
</message>
<message>
<location line="+5"/>
<source>Set maximum block size in bytes (default: 250000)</source>
<translation>حداکثر سایز بلاک بر اساس بایت تنظیم شود (پیش فرض: 250000)</translation>
</message>
<message>
<location line="+1"/>
<source>Set minimum block size in bytes (default: 0)</source>
<translation>حداقل سایز بلاک بر اساس بایت تنظیم شود (پیش فرض: 0)</translation>
</message>
<message>
<location line="+2"/>
<source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>
<translation>فایل debug.log را در startup مشتری کوچک کن (پیش فرض:1 اگر اشکال زدایی روی نداد)</translation>
</message>
<message>
<location line="+1"/>
<source>Signing transaction failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Specify connection timeout in milliseconds (default: 5000)</source>
<translation>(میلی ثانیه )فاصله ارتباط خاص</translation>
</message>
<message>
<location line="+4"/>
<source>System error: </source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Transaction amount too small</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Transaction amounts must be positive</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Transaction too large</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Use UPnP to map the listening port (default: 0)</source>
<translation>از UPnP برای شناسایی درگاه شنیداری استفاده کنید (پیش فرض:0)</translation>
</message>
<message>
<location line="+1"/>
<source>Use UPnP to map the listening port (default: 1 when listening)</source>
<translation>از UPnP برای شناسایی درگاه شنیداری استفاده کنید (پیش فرض:1 در زمان شنیدن)</translation>
</message>
<message>
<location line="+1"/>
<source>Use proxy to reach tor hidden services (default: same as -proxy)</source>
<translation>برای دستیابی به سرویس مخفیانه نرم افزار تور از پراکسی استفاده کنید (پیش فرض:same as -proxy)</translation>
</message>
<message>
<location line="+2"/>
<source>Username for JSON-RPC connections</source>
<translation>JSON-RPC شناسه برای ارتباطات</translation>
</message>
<message>
<location line="+4"/>
<source>Warning</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Warning: This version is obsolete, upgrade required!</source>
<translation>هشدار: این نسخه قدیمی است، روزآمدسازی مورد نیاز است</translation>
</message>
<message>
<location line="+1"/>
<source>You need to rebuild the databases using -reindex to change -txindex</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>wallet.dat corrupt, salvage failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-50"/>
<source>Password for JSON-RPC connections</source>
<translation>JSON-RPC عبارت عبور برای ارتباطات</translation>
</message>
<message>
<location line="-67"/>
<source>Allow JSON-RPC connections from specified IP address</source>
<translation>از آدرس آی پی خاص JSON-RPC قبول ارتباطات</translation>
</message>
<message>
<location line="+76"/>
<source>Send commands to node running on <ip> (default: 127.0.0.1)</source>
<translation>(127.0.0.1پیش فرض: ) &lt;ip&gt; دادن فرمانها برای استفاده گره ها روی</translation>
</message>
<message>
<location line="-120"/>
<source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>
<translation>زمانی که بهترین بلاک تغییر کرد، دستور را اجرا کن (%s در cmd با block hash جایگزین شده است)</translation>
</message>
<message>
<location line="+147"/>
<source>Upgrade wallet to latest format</source>
<translation>wallet را به جدیدترین فرمت روزآمد کنید</translation>
</message>
<message>
<location line="-21"/>
<source>Set key pool size to <n> (default: 100)</source>
<translation> (100پیش فرض:)&lt;n&gt; گذاشتن اندازه کلید روی </translation>
</message>
<message>
<location line="-12"/>
<source>Rescan the block chain for missing wallet transactions</source>
<translation>اسکان مجدد زنجیر بلوکها برای گم والت معامله</translation>
</message>
<message>
<location line="+35"/>
<source>Use OpenSSL (https) for JSON-RPC connections</source>
<translation>JSON-RPCبرای ارتباطات استفاده کنید OpenSSL (https)</translation>
</message>
<message>
<location line="-26"/>
<source>Server certificate file (default: server.cert)</source>
<translation> (server.certپیش فرض: )گواهی نامه سرور</translation>
</message>
<message>
<location line="+1"/>
<source>Server private key (default: server.pem)</source>
<translation>(server.pemپیش فرض: ) کلید خصوصی سرور</translation>
</message>
<message>
<location line="-151"/>
<source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source>
<translation>رمز های قابل قبول( TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</translation>
</message>
<message>
<location line="+165"/>
<source>This help message</source>
<translation>پیام کمکی</translation>
</message>
<message>
<location line="+6"/>
<source>Unable to bind to %s on this computer (bind returned error %d, %s)</source>
<translation>امکان اتصال به %s از این رایانه وجود ندارد ( bind returned error %d, %s)</translation>
</message>
<message>
<location line="-91"/>
<source>Connect through socks proxy</source>
<translation>اتصال از طریق پراکسی ساکس</translation>
</message>
<message>
<location line="-10"/>
<source>Allow DNS lookups for -addnode, -seednode and -connect</source>
<translation>به DNS اجازه بده تا برای addnode ، seednode و اتصال جستجو کند</translation>
</message>
<message>
<location line="+55"/>
<source>Loading addresses...</source>
<translation>بار گیری آدرس ها</translation>
</message>
<message>
<location line="-35"/>
<source>Error loading wallet.dat: Wallet corrupted</source>
<translation>خطا در بارگیری wallet.dat: کیف پول خراب شده است</translation>
</message>
<message>
<location line="+1"/>
<source>Error loading wallet.dat: Wallet requires newer version of ncicoin</source>
<translation>خطا در بارگیری wallet.dat: کیف پول به ویرایش جدیدتری از Biticon نیاز دارد</translation>
</message>
<message>
<location line="+93"/>
<source>Wallet needed to be rewritten: restart ncicoin to complete</source>
<translation>سلام</translation>
</message>
<message>
<location line="-95"/>
<source>Error loading wallet.dat</source>
<translation>خطا در بارگیری wallet.dat</translation>
</message>
<message>
<location line="+28"/>
<source>Invalid -proxy address: '%s'</source>
<translation>آدرس پراکسی اشتباه %s</translation>
</message>
<message>
<location line="+56"/>
<source>Unknown network specified in -onlynet: '%s'</source>
<translation>شبکه مشخص شده غیرقابل شناسایی در onlynet: '%s'</translation>
</message>
<message>
<location line="-1"/>
<source>Unknown -socks proxy version requested: %i</source>
<translation>نسخه پراکسی ساکس غیرقابل شناسایی درخواست شده است: %i</translation>
</message>
<message>
<location line="-96"/>
<source>Cannot resolve -bind address: '%s'</source>
<translation>آدرس قابل اتصال- شناسایی نیست %s</translation>
</message>
<message>
<location line="+1"/>
<source>Cannot resolve -externalip address: '%s'</source>
<translation>آدرس خارجی قابل اتصال- شناسایی نیست %s</translation>
</message>
<message>
<location line="+44"/>
<source>Invalid amount for -paytxfee=<amount>: '%s'</source>
<translation>میزان وجه اشتباه برای paytxfee=<میزان وجه>: %s</translation>
</message>
<message>
<location line="+1"/>
<source>Invalid amount</source>
<translation>میزان وجه اشتباه</translation>
</message>
<message>
<location line="-6"/>
<source>Insufficient funds</source>
<translation>بود جه نا کافی </translation>
</message>
<message>
<location line="+10"/>
<source>Loading block index...</source>
<translation>بار گیری شاخص بلوک</translation>
</message>
<message>
<location line="-57"/>
<source>Add a node to connect to and attempt to keep the connection open</source>
<translation>به اتصال یک گره اضافه کنید و اتصال را باز نگاه دارید</translation>
</message>
<message>
<location line="-25"/>
<source>Unable to bind to %s on this computer. ncicoin is probably already running.</source>
<translation>اتصال به %s از این رایانه امکان پذیر نیست. ncicoin احتمالا در حال اجراست.</translation>
</message>
<message>
<location line="+64"/>
<source>Fee per KB to add to transactions you send</source>
<translation>پر داجت برای هر کیلو بیت برای اضافه به معامله ارسال</translation>
</message>
<message>
<location line="+19"/>
<source>Loading wallet...</source>
<translation>بار گیری والت</translation>
</message>
<message>
<location line="-52"/>
<source>Cannot downgrade wallet</source>
<translation>امکان تنزل نسخه در wallet وجود ندارد</translation>
</message>
<message>
<location line="+3"/>
<source>Cannot write default address</source>
<translation>آدرس پیش فرض قابل ذخیره نیست</translation>
</message>
<message>
<location line="+64"/>
<source>Rescanning...</source>
<translation>اسکان مجدد</translation>
</message>
<message>
<location line="-57"/>
<source>Done loading</source>
<translation>بار گیری انجام شده است</translation>
</message>
<message>
<location line="+82"/>
<source>To use the %s option</source>
<translation>برای استفاده از %s از انتخابات</translation>
</message>
<message>
<location line="-74"/>
<source>Error</source>
<translation>خطا</translation>
</message>
<message>
<location line="-31"/>
<source>You must set rpcpassword=<password> in the configuration file:
%s
If the file does not exist, create it with owner-readable-only file permissions.</source>
<translation>%s، شما باید یک rpcpassword را در فایل پیکربندی تنظیم کنید :⏎%s⏎ اگر فایل ایجاد نشد، یک فایل فقط متنی ایجاد کنید.
</translation>
</message>
</context>
</TS> | {
"content_hash": "7ad3ff17c83a64af055b99f3aa22bf25",
"timestamp": "",
"source": "github",
"line_count": 2925,
"max_line_length": 405,
"avg_line_length": 37.15418803418803,
"alnum_prop": 0.6132540763370017,
"repo_name": "an420/123",
"id": "f020ad3c82d7694890fdf79197009fc76e2c4cbf",
"size": "119090",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/qt/locale/bitcoin_fa.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "103127"
},
{
"name": "C++",
"bytes": "2473637"
},
{
"name": "CSS",
"bytes": "1127"
},
{
"name": "IDL",
"bytes": "13838"
},
{
"name": "Objective-C",
"bytes": "5711"
},
{
"name": "Python",
"bytes": "3773"
},
{
"name": "Shell",
"bytes": "1144"
},
{
"name": "TypeScript",
"bytes": "5233403"
}
],
"symlink_target": ""
} |
#pragma once
#include "il2cpp-config.h"
#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif
#include <stdint.h>
#include "mscorlib_System_Collections_ArrayList_ArrayListWra3057374748.h"
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Collections.ArrayList/FixedSizeArrayListWrapper
struct FixedSizeArrayListWrapper_t4072394129 : public ArrayListWrapper_t3057374748
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
| {
"content_hash": "1c372656d3cdd87a981d169e743b08d9",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 84,
"avg_line_length": 18.5625,
"alnum_prop": 0.7760942760942761,
"repo_name": "moixxsyc/Unity3dLearningDemos",
"id": "a4ea106c8783cdc725bc80cbd56cb3d4facdafa0",
"size": "596",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "01Dongzuo/Temp/il2cppOutput/il2cppOutput/mscorlib_System_Collections_ArrayList_FixedSizeArr4072394129.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ASP",
"bytes": "118649"
},
{
"name": "C",
"bytes": "5575726"
},
{
"name": "C#",
"bytes": "1643157"
},
{
"name": "C++",
"bytes": "39741079"
},
{
"name": "GLSL",
"bytes": "48675"
},
{
"name": "JavaScript",
"bytes": "2544"
},
{
"name": "Objective-C",
"bytes": "54221"
},
{
"name": "Objective-C++",
"bytes": "246841"
},
{
"name": "Shell",
"bytes": "1420"
}
],
"symlink_target": ""
} |
export class Hero {
id: number;
name: string;
} | {
"content_hash": "b8fce7a380ca71c8b2b460e1480240f3",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 19,
"avg_line_length": 13.75,
"alnum_prop": 0.6,
"repo_name": "betaxer/angular-hero",
"id": "6e1b2c5b9167591b952ac63026dc9c9222910cc6",
"size": "56",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/app/hero.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "3635"
},
{
"name": "HTML",
"bytes": "2025"
},
{
"name": "JavaScript",
"bytes": "1636"
},
{
"name": "TypeScript",
"bytes": "12237"
}
],
"symlink_target": ""
} |
using System;
using System.Globalization;
namespace Bmz.Framework.Localization
{
/// <summary>
/// A class that gets the same string on every localization.
/// </summary>
[Serializable]
public class FixedLocalizableString : ILocalizableString
{
/// <summary>
/// The fixed string.
/// Whenever Localize methods called, this string is returned.
/// </summary>
public virtual string FixedString { get; private set; }
/// <summary>
/// Needed for serialization.
/// </summary>
private FixedLocalizableString()
{
}
/// <summary>
/// Creates a new instance of <see cref="FixedLocalizableString"/>.
/// </summary>
/// <param name="fixedString">
/// The fixed string.
/// Whenever Localize methods called, this string is returned.
/// </param>
public FixedLocalizableString(string fixedString)
{
FixedString = fixedString;
}
public string Localize(ILocalizationContext context)
{
return FixedString;
}
public string Localize(ILocalizationContext context, CultureInfo culture)
{
return FixedString;
}
public override string ToString()
{
return FixedString;
}
}
} | {
"content_hash": "3932637fe74fcab97840d9b90d66d84b",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 81,
"avg_line_length": 25.9811320754717,
"alnum_prop": 0.5708061002178649,
"repo_name": "blademasterzhang/Bmz.Framework",
"id": "d154f300446b585798cb97db738e47ec883f02fd",
"size": "1377",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Bmz.Framework/Localization/FixedLocalizableString.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C#",
"bytes": "1643296"
},
{
"name": "CSS",
"bytes": "4495"
},
{
"name": "JavaScript",
"bytes": "45374"
}
],
"symlink_target": ""
} |
module Entities
class SshServer < Base
include TenantAndProjectScoped
belongs_to :host
validates :name,
:uniqueness => {:scope => [:tenant_id,:project_id]},
:format => {
:with => Regexp.union(Resolv::IPv4::Regex, Resolv::IPv6::Regex),
:message => "Not an valid IPv4 or IPv6 format"
}
end
end | {
"content_hash": "c183649bf69da708defa26c29f48648d",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 72,
"avg_line_length": 23.066666666666666,
"alnum_prop": 0.6040462427745664,
"repo_name": "intrigueio/tapir",
"id": "6769c7191750168823dc53c9e7c4661afb231056",
"size": "347",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "lib/tapir/models/entities/ssh_server.rb",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "CSS",
"bytes": "4004"
},
{
"name": "CoffeeScript",
"bytes": "2385"
},
{
"name": "JavaScript",
"bytes": "9368"
},
{
"name": "Ruby",
"bytes": "302675"
},
{
"name": "Shell",
"bytes": "852"
}
],
"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.9.1"/>
<title>ibisami: Member List</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 style="padding-left: 0.5em;">
<div id="projectname">ibisami
 <span id="projectnumber">0.8</span>
</div>
<div id="projectbrief">Public domain IBIS-AMI model creation infrastructure.</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="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><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">DigitalFilter Member List</div> </div>
</div><!--header-->
<div class="contents">
<p>This is the complete list of members for <a class="el" href="class_digital_filter.html">DigitalFilter</a>, including all inherited members.</p>
<table class="directory">
<tr class="even"><td class="entry"><a class="el" href="class_digital_filter.html#ab9e95357beb9cca85546dfa6714a0fb2">apply</a>(double *sig, const long len)</td><td class="entry"><a class="el" href="class_digital_filter.html">DigitalFilter</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_digital_filter.html#aff805e69237ae6c450221f0d4c253bf9">den_</a></td><td class="entry"><a class="el" href="class_digital_filter.html">DigitalFilter</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_digital_filter.html#aa3d504c14a3dd71c0a8384e03fb9a3b8">DigitalFilter</a>(const std::vector< double > &num, const std::vector< double > &den)</td><td class="entry"><a class="el" href="class_digital_filter.html">DigitalFilter</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_digital_filter.html#abf0263de2d7837bdc002615d3d7ca365">num_</a></td><td class="entry"><a class="el" href="class_digital_filter.html">DigitalFilter</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_digital_filter.html#ad9099f4f1da3f23988591b9e733861d7">num_taps_</a></td><td class="entry"><a class="el" href="class_digital_filter.html">DigitalFilter</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr><td class="entry"><a class="el" href="class_digital_filter.html#a0fe7f91edef50acb1d8fb68957b71129">state_</a></td><td class="entry"><a class="el" href="class_digital_filter.html">DigitalFilter</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_digital_filter.html#a6d4f521ddcfaa2bfabc302cb590cc9e1">~DigitalFilter</a>()</td><td class="entry"><a class="el" href="class_digital_filter.html">DigitalFilter</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">virtual</span></td></tr>
</table></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Sat Nov 26 2016 11:18:10 for ibisami by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.9.1
</small></address>
</body>
</html>
| {
"content_hash": "572419b2eafabd8d83d195b89580165d",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 343,
"avg_line_length": 56.927927927927925,
"alnum_prop": 0.6670359234056021,
"repo_name": "capn-freako/ibisami",
"id": "3341494f83987d04f48413d8b6e678e4e5f996eb",
"size": "6319",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "doc/html/class_digital_filter-members.html",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C++",
"bytes": "53944"
},
{
"name": "EmberScript",
"bytes": "10781"
},
{
"name": "HTML",
"bytes": "861862"
},
{
"name": "Jupyter Notebook",
"bytes": "628535"
},
{
"name": "Makefile",
"bytes": "7413"
},
{
"name": "Python",
"bytes": "11455"
}
],
"symlink_target": ""
} |
require 'fitgem'
require 'wunderground'
consumer_key = ENV['FITBIT_CONSUMER_KEY']
consumer_secret = ENV['FITBIT_CONSUMER_SECRET']
token = ENV['FITBIT_TOKEN']
secret = ENV['FITBIT_SECRET']
user_id = ENV['FITBIT_USER_ID']
client = Fitgem::Client.new(
{ :consumer_key => consumer_key,
:consumer_secret => consumer_secret,
:token => token,
:secret => secret,
:user_id => user_id
}
)
access_token = client.reconnect(token, secret)
device_id = client.devices.first['id']
alarm_id = client.get_alarms(device_id)['trackerAlarms'].first['alarmId']
# https://github.com/wnadeau/wunderground
wug = Wunderground.new(ENV['WUNDERGROUND_API_KEY'])
astronomy = wug.astronomy_for(ENV['STATE'],ENV['CITY'])
sunrise = astronomy['sun_phase']['sunrise']
sunrise_hour = "%02d" % sunrise['hour']
sunrise_minute = "%02d" % sunrise['minute']
sunrise_time = "#{sunrise_hour}:#{sunrise_minute}"
alarm_opts = {
time: sunrise_time,
label: "Sunrise",
enabled: true,
recurring: true,
weekDays: "MONDAY,TUESDAY,WEDNESDAY,THURSDAY,FRIDAY",
snoozeLength: 5,
snoozeCount: 3
}
client.update_alarm(alarm_id, device_id, alarm_opts)
p client.get_alarms(device_id)
| {
"content_hash": "52fe8672af75d0fe8f5555a52beb294d",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 73,
"avg_line_length": 26.863636363636363,
"alnum_prop": 0.6861252115059222,
"repo_name": "wsmoak/fitbit",
"id": "847a87293e32bf77bf9d3f08ab37a72d56eb1efa",
"size": "1246",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "sunrise/set-alarm.rb",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Ruby",
"bytes": "2701"
}
],
"symlink_target": ""
} |
Charades
========
A charades android app containing various topics, including NSFW ones.
| {
"content_hash": "78bd31267459adc5012e7cffe9a2f9bf",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 70,
"avg_line_length": 22.5,
"alnum_prop": 0.7444444444444445,
"repo_name": "IPPETAD/Charades",
"id": "2c68eb279c369c4ea324e0ead055f5b233a5bb51",
"size": "90",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
import unittest
import numpy as np
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from CompartmentalSystems.bins.TsTpField import TsTpField
from testinfrastructure.InDirTest import InDirTest
class TestTsTpField(InDirTest):
def test_init(self):
x, y = 10, 10
s = (x, y)
arr = np.zeros(s)
arr[5, 5] = 10
tss = 0.1 ## the time step size
## This defines 3 things:
## 1. The time between snapshots
## 2. The size of SystemTime bins
## 3. The size of PoolTime bins
##
## 1 is the most obvious but irrelavent here
## 2&3 are need ed to interpret the arr as a Ts,Tp plane
spad = TsTpField(arr, tss)
# fixme:
# we should check that nobody populates the triangular part of the array where
# Tp>Ts
# It is however not totally clear how to do this numerically efficiently
# with the current implementation that uses the full rectangle.
# the best option also in terms of memory usage would
# be not to store the Tp>Ts part at all.
# At the moment this looks as if we would have to craft this in fortran or C...
# An intermediate workaround might be to provide a function to check the field
# on demand but is not called by TsTpFields __init__ automatically
# we at least chek that it is not possible to initialize an array that has room for maxTp>maxTs
with self.assertRaises(Exception) as cm:
f = TsTpMassField(np.zeros(3, 4), 0.1)
def test_plot_surface(self):
x, y = 6, 3
max_shape = (20, 10)
s = (x, y)
arr = np.zeros(s)
val = 10
arr[1, 1] = val
tss = 0.1
spad = TsTpField(arr, tss)
fig = plt.figure()
ax1 = fig.add_subplot(1, 3, 1, projection="3d")
ax2 = fig.add_subplot(1, 3, 2, projection="3d")
ax3 = fig.add_subplot(1, 3, 3, projection="3d")
spad.plot_surface(ax1)
spad.plot_surface(ax2, max_shape)
spad.plot_surface(ax3, max_shape, 20)
fig.savefig("plot.pdf")
def test_plot_bins(self):
x, y = 6, 3
max_shape = (20, 10)
s = (x, y)
arr = np.zeros(s)
val = 10
arr[1, 1] = val
arr[2, 2] = val / 2.0
arr[2, 1] = val / 3.0
arr[2, 1] = val / 3.0
tss = 0.1
spad = TsTpField(arr, tss)
res = spad.default_plot_args()
self.assertEqual(res, ((6, 3), 10.0))
res = spad.default_plot_args(max_shape)
self.assertEqual(res, (max_shape, 10.0))
res = spad.default_plot_args(max_shape, 20)
self.assertEqual(res, (max_shape, 20.0))
fig = plt.figure()
fig.clf()
ax1 = fig.add_subplot(1, 3, 1, projection="3d")
ax2 = fig.add_subplot(1, 3, 2, projection="3d")
ax3 = fig.add_subplot(1, 3, 3, projection="3d")
spad.plot_bins(ax1)
spad.plot_bins(ax2, max_shape)
spad.plot_bins(ax3, max_shape, 20)
fig.savefig("plot.pdf")
def test_getitem(self):
x, y = 10, 10
s = (x, y)
arr = np.zeros(s)
val = 10
arr[5, 5] = val
tss = 0.1
spad = TsTpField(arr, tss)
# indexing is possible directly
self.assertEqual(spad[5, 5], val)
if __name__ == "__main__":
unittest.main()
| {
"content_hash": "d7cbc1a7d0e9ca2027fbc6c460d620da",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 103,
"avg_line_length": 31.706422018348626,
"alnum_prop": 0.5648148148148148,
"repo_name": "MPIBGC-TEE/CompartmentalSystems",
"id": "5536ae653758cf8f9e64320f08b7b9b2b7c1f43a",
"size": "3496",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tests/bins/TestTsTpField.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "895"
},
{
"name": "HTML",
"bytes": "35548556"
},
{
"name": "Jupyter Notebook",
"bytes": "131659124"
},
{
"name": "Makefile",
"bytes": "8783"
},
{
"name": "Python",
"bytes": "1119047"
},
{
"name": "Shell",
"bytes": "2348"
}
],
"symlink_target": ""
} |
import Ember from "ember-metal/core";
import { get } from "ember-metal/property_get";
import run from "ember-metal/run_loop";
import EmberObject from "ember-runtime/system/object";
import jQuery from "ember-views/system/jquery";
import { View as EmberView } from "ember-views/views/view";
var originalLookup = Ember.lookup, lookup, view;
QUnit.module("views/view/view_lifecycle_test - pre-render", {
setup: function() {
Ember.lookup = lookup = {};
},
teardown: function() {
if (view) {
run(function() {
view.destroy();
});
}
Ember.lookup = originalLookup;
}
});
function tmpl(str) {
return function(context, options) {
options.data.buffer.push(str);
};
}
test("should create and append a DOM element after bindings have synced", function() {
var ViewTest;
lookup.ViewTest = ViewTest = {};
run(function() {
ViewTest.fakeController = EmberObject.create({
fakeThing: 'controllerPropertyValue'
});
view = EmberView.createWithMixins({
fooBinding: 'ViewTest.fakeController.fakeThing',
render: function(buffer) {
buffer.push(this.get('foo'));
}
});
ok(!view.get('element'), "precond - does not have an element before appending");
view.append();
});
equal(view.$().text(), 'controllerPropertyValue', "renders and appends after bindings have synced");
});
test("should throw an exception if trying to append a child before rendering has begun", function() {
run(function() {
view = EmberView.create();
});
raises(function() {
view.appendChild(EmberView, {});
}, null, "throws an error when calling appendChild()");
});
test("should not affect rendering if rerender is called before initial render happens", function() {
run(function() {
view = EmberView.create({
template: tmpl("Rerender me!")
});
view.rerender();
view.append();
});
equal(view.$().text(), "Rerender me!", "renders correctly if rerender is called first");
});
test("should not affect rendering if destroyElement is called before initial render happens", function() {
run(function() {
view = EmberView.create({
template: tmpl("Don't destroy me!")
});
view.destroyElement();
view.append();
});
equal(view.$().text(), "Don't destroy me!", "renders correctly if destroyElement is called first");
});
QUnit.module("views/view/view_lifecycle_test - in render", {
setup: function() {
},
teardown: function() {
if (view) {
run(function() {
view.destroy();
});
}
}
});
test("appendChild should work inside a template", function() {
run(function() {
view = EmberView.create({
template: function(context, options) {
var buffer = options.data.buffer;
buffer.push("<h1>Hi!</h1>");
options.data.view.appendChild(EmberView, {
template: tmpl("Inception reached")
});
buffer.push("<div class='footer'>Wait for the kick</div>");
}
});
view.appendTo("#qunit-fixture");
});
ok(view.$('h1').length === 1 && view.$('div').length === 2,
"The appended child is visible");
});
test("rerender should throw inside a template", function() {
raises(function() {
run(function() {
var renderCount = 0;
view = EmberView.create({
template: function(context, options) {
var view = options.data.view;
var child1 = view.appendChild(EmberView, {
template: function(context, options) {
renderCount++;
options.data.buffer.push(String(renderCount));
}
});
var child2 = view.appendChild(EmberView, {
template: function(context, options) {
options.data.buffer.push("Inside child2");
child1.rerender();
}
});
}
});
view.appendTo("#qunit-fixture");
});
}, /Something you did caused a view to re-render after it rendered but before it was inserted into the DOM./);
});
QUnit.module("views/view/view_lifecycle_test - hasElement", {
teardown: function() {
if (view) {
run(function() {
view.destroy();
});
}
}
});
test("createElement puts the view into the hasElement state", function() {
view = EmberView.create({
render: function(buffer) { buffer.push('hello'); }
});
run(function() {
view.createElement();
});
equal(view.currentState, view._states.hasElement, "the view is in the hasElement state");
});
test("trigger rerender on a view in the hasElement state doesn't change its state to inDOM", function() {
view = EmberView.create({
render: function(buffer) { buffer.push('hello'); }
});
run(function() {
view.createElement();
view.rerender();
});
equal(view.currentState, view._states.hasElement, "the view is still in the hasElement state");
});
QUnit.module("views/view/view_lifecycle_test - in DOM", {
teardown: function() {
if (view) {
run(function() {
view.destroy();
});
}
}
});
test("should throw an exception when calling appendChild when DOM element exists", function() {
run(function() {
view = EmberView.create({
template: tmpl("Wait for the kick")
});
view.append();
});
raises(function() {
view.appendChild(EmberView, {
template: tmpl("Ah ah ah! You didn't say the magic word!")
});
}, null, "throws an exception when calling appendChild after element is created");
});
test("should replace DOM representation if rerender() is called after element is created", function() {
run(function() {
view = EmberView.create({
template: function(context, options) {
var buffer = options.data.buffer;
var value = context.get('shape');
buffer.push("Do not taunt happy fun "+value);
},
context: EmberObject.create({
shape: 'sphere'
})
});
view.append();
});
equal(view.$().text(), "Do not taunt happy fun sphere", "precond - creates DOM element");
view.set('context.shape', 'ball');
run(function() {
view.rerender();
});
equal(view.$().text(), "Do not taunt happy fun ball", "rerenders DOM element when rerender() is called");
});
test("should destroy DOM representation when destroyElement is called", function() {
run(function() {
view = EmberView.create({
template: tmpl("Don't fear the reaper")
});
view.append();
});
ok(view.get('element'), "precond - generates a DOM element");
run(function() {
view.destroyElement();
});
ok(!view.get('element'), "destroys view when destroyElement() is called");
});
test("should destroy DOM representation when destroy is called", function() {
run(function() {
view = EmberView.create({
template: tmpl("<div id='warning'>Don't fear the reaper</div>")
});
view.append();
});
ok(view.get('element'), "precond - generates a DOM element");
run(function() {
view.destroy();
});
ok(jQuery('#warning').length === 0, "destroys element when destroy() is called");
});
test("should throw an exception if trying to append an element that is already in DOM", function() {
run(function() {
view = EmberView.create({
template: tmpl('Broseidon, King of the Brocean')
});
view.append();
});
ok(view.get('element'), "precond - creates DOM element");
raises(function() {
run(function() {
view.append();
});
}, null, "raises an exception on second append");
});
QUnit.module("views/view/view_lifecycle_test - destroyed");
test("should throw an exception when calling appendChild after view is destroyed", function() {
run(function() {
view = EmberView.create({
template: tmpl("Wait for the kick")
});
view.append();
});
run(function() {
view.destroy();
});
raises(function() {
view.appendChild(EmberView, {
template: tmpl("Ah ah ah! You didn't say the magic word!")
});
}, null, "throws an exception when calling appendChild");
});
test("should throw an exception when rerender is called after view is destroyed", function() {
run(function() {
view = EmberView.create({
template: tmpl('foo')
});
view.append();
});
run(function() {
view.destroy();
});
raises(function() {
view.rerender();
}, null, "throws an exception when calling rerender");
});
test("should throw an exception when destroyElement is called after view is destroyed", function() {
run(function() {
view = EmberView.create({
template: tmpl('foo')
});
view.append();
});
run(function() {
view.destroy();
});
raises(function() {
view.destroyElement();
}, null, "throws an exception when calling destroyElement");
});
test("trigger rerender on a view in the inDOM state keeps its state as inDOM", function() {
run(function() {
view = EmberView.create({
template: tmpl('foo')
});
view.append();
});
run(function() {
view.rerender();
});
equal(view.currentState, view._states.inDOM, "the view is still in the inDOM state");
run(function() {
view.destroy();
});
});
| {
"content_hash": "1716c3da4e13b736177b370f5d3efb0a",
"timestamp": "",
"source": "github",
"line_count": 380,
"max_line_length": 112,
"avg_line_length": 24.13684210526316,
"alnum_prop": 0.6160052333187963,
"repo_name": "hwclass/ember.js",
"id": "e76077efbd965d1c6f0cd04500d22901185b0cb3",
"size": "9172",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "packages/ember-views/tests/views/view/view_lifecycle_test.js",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
package server
import (
"context"
"fmt"
"net"
"time"
"github.com/pingcap/kvproto/pkg/coprocessor"
"github.com/pingcap/kvproto/pkg/diagnosticspb"
"github.com/pingcap/kvproto/pkg/tikvpb"
"github.com/pingcap/sysutil"
"github.com/pingcap/tidb/config"
"github.com/pingcap/tidb/domain"
"github.com/pingcap/tidb/executor"
"github.com/pingcap/tidb/extension"
"github.com/pingcap/tidb/privilege"
"github.com/pingcap/tidb/privilege/privileges"
"github.com/pingcap/tidb/session"
"github.com/pingcap/tidb/sessionctx/variable"
"github.com/pingcap/tidb/util"
"github.com/pingcap/tidb/util/logutil"
"github.com/pingcap/tidb/util/memory"
"github.com/pingcap/tidb/util/topsql"
"go.uber.org/zap"
"google.golang.org/grpc"
"google.golang.org/grpc/keepalive"
"google.golang.org/grpc/peer"
)
// NewRPCServer creates a new rpc server.
func NewRPCServer(config *config.Config, dom *domain.Domain, sm util.SessionManager) *grpc.Server {
defer func() {
if v := recover(); v != nil {
logutil.BgLogger().Error("panic in TiDB RPC server", zap.Reflect("r", v),
zap.Stack("stack trace"))
}
}()
s := grpc.NewServer(
grpc.KeepaliveParams(keepalive.ServerParameters{
Time: time.Duration(config.Status.GRPCKeepAliveTime) * time.Second,
Timeout: time.Duration(config.Status.GRPCKeepAliveTimeout) * time.Second,
}),
grpc.KeepaliveEnforcementPolicy(keepalive.EnforcementPolicy{
// Allow clients send consecutive pings in every 5 seconds.
// The default value of MinTime is 5 minutes,
// which is too long compared with 10 seconds of TiDB's keepalive time.
MinTime: 5 * time.Second,
}),
grpc.MaxConcurrentStreams(uint32(config.Status.GRPCConcurrentStreams)),
grpc.InitialWindowSize(int32(config.Status.GRPCInitialWindowSize)),
grpc.MaxSendMsgSize(config.Status.GRPCMaxSendMsgSize),
)
rpcSrv := &rpcServer{
DiagnosticsServer: sysutil.NewDiagnosticsServer(config.Log.File.Filename),
dom: dom,
sm: sm,
}
diagnosticspb.RegisterDiagnosticsServer(s, rpcSrv)
tikvpb.RegisterTikvServer(s, rpcSrv)
topsql.RegisterPubSubServer(s)
return s
}
// rpcServer contains below 2 services:
// 1. Diagnose service, it's used for SQL diagnose.
// 2. Coprocessor service, it reuse the TikvServer interface, but only support the Coprocessor interface now.
// Coprocessor service will handle the cop task from other TiDB server. Currently, it's only use for read the cluster memory table.
type rpcServer struct {
*sysutil.DiagnosticsServer
tikvpb.TikvServer
dom *domain.Domain
sm util.SessionManager
}
// Coprocessor implements the TiKVServer interface.
func (s *rpcServer) Coprocessor(ctx context.Context, in *coprocessor.Request) (resp *coprocessor.Response, err error) {
resp = &coprocessor.Response{}
defer func() {
if v := recover(); v != nil {
logutil.BgLogger().Error("panic when RPC server handing coprocessor", zap.Reflect("r", v),
zap.Stack("stack trace"))
resp.OtherError = fmt.Sprintf("panic when RPC server handing coprocessor, stack:%v", v)
}
}()
resp = s.handleCopRequest(ctx, in)
return resp, nil
}
// CoprocessorStream implements the TiKVServer interface.
func (s *rpcServer) CoprocessorStream(in *coprocessor.Request, stream tikvpb.Tikv_CoprocessorStreamServer) (err error) {
resp := &coprocessor.Response{}
defer func() {
if v := recover(); v != nil {
logutil.BgLogger().Error("panic when RPC server handing coprocessor stream", zap.Reflect("r", v),
zap.Stack("stack trace"))
resp.OtherError = fmt.Sprintf("panic when when RPC server handing coprocessor stream, stack:%v", v)
err = stream.Send(resp)
if err != nil {
logutil.BgLogger().Error("panic when RPC server handing coprocessor stream, send response to stream error", zap.Error(err))
}
}
}()
se, err := s.createSession()
if err != nil {
resp.OtherError = err.Error()
return stream.Send(resp)
}
defer se.Close()
h := executor.NewCoprocessorDAGHandler(se)
return h.HandleStreamRequest(context.Background(), in, stream)
}
// BatchCommands implements the TiKVServer interface.
func (s *rpcServer) BatchCommands(ss tikvpb.Tikv_BatchCommandsServer) error {
defer func() {
if v := recover(); v != nil {
logutil.BgLogger().Error("panic when RPC server handing batch commands", zap.Reflect("r", v),
zap.Stack("stack trace"))
}
}()
for {
reqs, err := ss.Recv()
if err != nil {
logutil.BgLogger().Error("RPC server batch commands receive fail", zap.Error(err))
return err
}
responses := make([]*tikvpb.BatchCommandsResponse_Response, 0, len(reqs.Requests))
for _, req := range reqs.Requests {
var response *tikvpb.BatchCommandsResponse_Response
switch request := req.Cmd.(type) {
case *tikvpb.BatchCommandsRequest_Request_Coprocessor:
cop := request.Coprocessor
resp, err := s.Coprocessor(context.Background(), cop)
if err != nil {
return err
}
response = &tikvpb.BatchCommandsResponse_Response{
Cmd: &tikvpb.BatchCommandsResponse_Response_Coprocessor{
Coprocessor: resp,
},
}
case *tikvpb.BatchCommandsRequest_Request_Empty:
response = &tikvpb.BatchCommandsResponse_Response{
Cmd: &tikvpb.BatchCommandsResponse_Response_Empty{
Empty: &tikvpb.BatchCommandsEmptyResponse{
TestId: request.Empty.TestId,
},
},
}
default:
logutil.BgLogger().Info("RPC server batch commands receive unknown request", zap.Any("req", request))
response = &tikvpb.BatchCommandsResponse_Response{
Cmd: &tikvpb.BatchCommandsResponse_Response_Empty{
Empty: &tikvpb.BatchCommandsEmptyResponse{},
},
}
}
responses = append(responses, response)
}
err = ss.Send(&tikvpb.BatchCommandsResponse{
Responses: responses,
RequestIds: reqs.GetRequestIds(),
})
if err != nil {
logutil.BgLogger().Error("RPC server batch commands send fail", zap.Error(err))
return err
}
}
}
// handleCopRequest handles the cop dag request.
func (s *rpcServer) handleCopRequest(ctx context.Context, req *coprocessor.Request) *coprocessor.Response {
resp := &coprocessor.Response{}
se, err := s.createSession()
if err != nil {
resp.OtherError = err.Error()
return resp
}
defer func() {
sc := se.GetSessionVars().StmtCtx
if sc.MemTracker != nil {
sc.MemTracker.Detach()
}
se.Close()
}()
if p, ok := peer.FromContext(ctx); ok {
se.GetSessionVars().SourceAddr = *p.Addr.(*net.TCPAddr)
}
h := executor.NewCoprocessorDAGHandler(se)
return h.HandleRequest(ctx, req)
}
func (s *rpcServer) createSession() (session.Session, error) {
se, err := session.CreateSessionWithDomain(s.dom.Store(), s.dom)
if err != nil {
return nil, err
}
extensions, err := extension.GetExtensions()
if err != nil {
return nil, err
}
do := domain.GetDomain(se)
is := do.InfoSchema()
pm := privileges.NewUserPrivileges(do.PrivilegeHandle(), extensions)
privilege.BindPrivilegeManager(se, pm)
vars := se.GetSessionVars()
vars.TxnCtx.InfoSchema = is
// This is for disable parallel hash agg.
// TODO: remove this.
vars.SetHashAggPartialConcurrency(1)
vars.SetHashAggFinalConcurrency(1)
vars.StmtCtx.InitMemTracker(memory.LabelForSQLText, -1)
vars.StmtCtx.MemTracker.AttachTo(vars.MemTracker)
switch variable.OOMAction.Load() {
case variable.OOMActionCancel:
action := &memory.PanicOnExceed{}
vars.MemTracker.SetActionOnExceed(action)
}
se.SetSessionManager(s.sm)
return se, nil
}
| {
"content_hash": "99273d6a9a7e7a4c329b23312e18c1cf",
"timestamp": "",
"source": "github",
"line_count": 229,
"max_line_length": 131,
"avg_line_length": 32.4235807860262,
"alnum_prop": 0.7175757575757575,
"repo_name": "pingcap/tidb",
"id": "f92deaf802d648845e20139dba13b643dc1e7d09",
"size": "8016",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "server/rpc_server.go",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Dockerfile",
"bytes": "1854"
},
{
"name": "Go",
"bytes": "34056451"
},
{
"name": "HTML",
"bytes": "420"
},
{
"name": "Java",
"bytes": "3694"
},
{
"name": "JavaScript",
"bytes": "900"
},
{
"name": "Jsonnet",
"bytes": "15129"
},
{
"name": "Makefile",
"bytes": "22240"
},
{
"name": "Ragel",
"bytes": "3678"
},
{
"name": "Shell",
"bytes": "439400"
},
{
"name": "Starlark",
"bytes": "574240"
},
{
"name": "TypeScript",
"bytes": "61875"
},
{
"name": "Yacc",
"bytes": "353301"
}
],
"symlink_target": ""
} |
import { Geometry } from '../../core/Geometry';
import { Vector2 } from '../../math/Vector2';
import { Face3 } from '../../core/Face3';
import { Vector3 } from '../../math/Vector3';
import { ShapeUtils } from '../ShapeUtils';
import { TubeGeometry } from './TubeGeometry';
/**
* @author zz85 / http://www.lab4games.net/zz85/blog
*
* Creates extruded geometry from a path shape.
*
* parameters = {
*
* curveSegments: <int>, // number of points on the curves
* steps: <int>, // number of points for z-side extrusions / used for subdividing segments of extrude spline too
* amount: <int>, // Depth to extrude the shape
*
* bevelEnabled: <bool>, // turn on bevel
* bevelThickness: <float>, // how deep into the original shape bevel goes
* bevelSize: <float>, // how far from shape outline is bevel
* bevelSegments: <int>, // number of bevel layers
*
* extrudePath: <THREE.CurvePath> // 3d spline path to extrude shape along. (creates Frames if .frames aren't defined)
* frames: <THREE.TubeGeometry.FrenetFrames> // containing arrays of tangents, normals, binormals
*
* uvGenerator: <Object> // object that provides UV generator functions
*
* }
**/
function ExtrudeGeometry( shapes, options ) {
if ( typeof( shapes ) === "undefined" ) {
shapes = [];
return;
}
Geometry.call( this );
this.type = 'ExtrudeGeometry';
shapes = Array.isArray( shapes ) ? shapes : [ shapes ];
this.addShapeList( shapes, options );
this.computeFaceNormals();
// can't really use automatic vertex normals
// as then front and back sides get smoothed too
// should do separate smoothing just for sides
//this.computeVertexNormals();
//console.log( "took", ( Date.now() - startTime ) );
}
ExtrudeGeometry.prototype = Object.create( Geometry.prototype );
ExtrudeGeometry.prototype.constructor = ExtrudeGeometry;
ExtrudeGeometry.prototype.addShapeList = function ( shapes, options ) {
var sl = shapes.length;
for ( var s = 0; s < sl; s ++ ) {
var shape = shapes[ s ];
this.addShape( shape, options );
}
};
ExtrudeGeometry.prototype.addShape = function ( shape, options ) {
var amount = options.amount !== undefined ? options.amount : 100;
var bevelThickness = options.bevelThickness !== undefined ? options.bevelThickness : 6; // 10
var bevelSize = options.bevelSize !== undefined ? options.bevelSize : bevelThickness - 2; // 8
var bevelSegments = options.bevelSegments !== undefined ? options.bevelSegments : 3;
var bevelEnabled = options.bevelEnabled !== undefined ? options.bevelEnabled : true; // false
var curveSegments = options.curveSegments !== undefined ? options.curveSegments : 12;
var steps = options.steps !== undefined ? options.steps : 1;
var extrudePath = options.extrudePath;
var extrudePts, extrudeByPath = false;
// Use default WorldUVGenerator if no UV generators are specified.
var uvgen = options.UVGenerator !== undefined ? options.UVGenerator : ExtrudeGeometry.WorldUVGenerator;
var splineTube, binormal, normal, position2;
if ( extrudePath ) {
extrudePts = extrudePath.getSpacedPoints( steps );
extrudeByPath = true;
bevelEnabled = false; // bevels not supported for path extrusion
// SETUP TNB variables
// Reuse TNB from TubeGeomtry for now.
// TODO1 - have a .isClosed in spline?
splineTube = options.frames !== undefined ? options.frames : new TubeGeometry.FrenetFrames( extrudePath, steps, false );
// console.log(splineTube, 'splineTube', splineTube.normals.length, 'steps', steps, 'extrudePts', extrudePts.length);
binormal = new Vector3();
normal = new Vector3();
position2 = new Vector3();
}
// Safeguards if bevels are not enabled
if ( ! bevelEnabled ) {
bevelSegments = 0;
bevelThickness = 0;
bevelSize = 0;
}
// Variables initialization
var ahole, h, hl; // looping of holes
var scope = this;
var shapesOffset = this.vertices.length;
var shapePoints = shape.extractPoints( curveSegments );
var vertices = shapePoints.shape;
var holes = shapePoints.holes;
var reverse = ! ShapeUtils.isClockWise( vertices );
if ( reverse ) {
vertices = vertices.reverse();
// Maybe we should also check if holes are in the opposite direction, just to be safe ...
for ( h = 0, hl = holes.length; h < hl; h ++ ) {
ahole = holes[ h ];
if ( ShapeUtils.isClockWise( ahole ) ) {
holes[ h ] = ahole.reverse();
}
}
reverse = false; // If vertices are in order now, we shouldn't need to worry about them again (hopefully)!
}
var faces = ShapeUtils.triangulateShape( vertices, holes );
/* Vertices */
var contour = vertices; // vertices has all points but contour has only points of circumference
for ( h = 0, hl = holes.length; h < hl; h ++ ) {
ahole = holes[ h ];
vertices = vertices.concat( ahole );
}
function scalePt2( pt, vec, size ) {
if ( ! vec ) console.error( "THREE.ExtrudeGeometry: vec does not exist" );
return vec.clone().multiplyScalar( size ).add( pt );
}
var b, bs, t, z,
vert, vlen = vertices.length,
face, flen = faces.length;
// Find directions for point movement
function getBevelVec( inPt, inPrev, inNext ) {
// computes for inPt the corresponding point inPt' on a new contour
// shifted by 1 unit (length of normalized vector) to the left
// if we walk along contour clockwise, this new contour is outside the old one
//
// inPt' is the intersection of the two lines parallel to the two
// adjacent edges of inPt at a distance of 1 unit on the left side.
var v_trans_x, v_trans_y, shrink_by = 1; // resulting translation vector for inPt
// good reading for geometry algorithms (here: line-line intersection)
// http://geomalgorithms.com/a05-_intersect-1.html
var v_prev_x = inPt.x - inPrev.x, v_prev_y = inPt.y - inPrev.y;
var v_next_x = inNext.x - inPt.x, v_next_y = inNext.y - inPt.y;
var v_prev_lensq = ( v_prev_x * v_prev_x + v_prev_y * v_prev_y );
// check for collinear edges
var collinear0 = ( v_prev_x * v_next_y - v_prev_y * v_next_x );
if ( Math.abs( collinear0 ) > Number.EPSILON ) {
// not collinear
// length of vectors for normalizing
var v_prev_len = Math.sqrt( v_prev_lensq );
var v_next_len = Math.sqrt( v_next_x * v_next_x + v_next_y * v_next_y );
// shift adjacent points by unit vectors to the left
var ptPrevShift_x = ( inPrev.x - v_prev_y / v_prev_len );
var ptPrevShift_y = ( inPrev.y + v_prev_x / v_prev_len );
var ptNextShift_x = ( inNext.x - v_next_y / v_next_len );
var ptNextShift_y = ( inNext.y + v_next_x / v_next_len );
// scaling factor for v_prev to intersection point
var sf = ( ( ptNextShift_x - ptPrevShift_x ) * v_next_y -
( ptNextShift_y - ptPrevShift_y ) * v_next_x ) /
( v_prev_x * v_next_y - v_prev_y * v_next_x );
// vector from inPt to intersection point
v_trans_x = ( ptPrevShift_x + v_prev_x * sf - inPt.x );
v_trans_y = ( ptPrevShift_y + v_prev_y * sf - inPt.y );
// Don't normalize!, otherwise sharp corners become ugly
// but prevent crazy spikes
var v_trans_lensq = ( v_trans_x * v_trans_x + v_trans_y * v_trans_y );
if ( v_trans_lensq <= 2 ) {
return new Vector2( v_trans_x, v_trans_y );
} else {
shrink_by = Math.sqrt( v_trans_lensq / 2 );
}
} else {
// handle special case of collinear edges
var direction_eq = false; // assumes: opposite
if ( v_prev_x > Number.EPSILON ) {
if ( v_next_x > Number.EPSILON ) {
direction_eq = true;
}
} else {
if ( v_prev_x < - Number.EPSILON ) {
if ( v_next_x < - Number.EPSILON ) {
direction_eq = true;
}
} else {
if ( Math.sign( v_prev_y ) === Math.sign( v_next_y ) ) {
direction_eq = true;
}
}
}
if ( direction_eq ) {
// console.log("Warning: lines are a straight sequence");
v_trans_x = - v_prev_y;
v_trans_y = v_prev_x;
shrink_by = Math.sqrt( v_prev_lensq );
} else {
// console.log("Warning: lines are a straight spike");
v_trans_x = v_prev_x;
v_trans_y = v_prev_y;
shrink_by = Math.sqrt( v_prev_lensq / 2 );
}
}
return new Vector2( v_trans_x / shrink_by, v_trans_y / shrink_by );
}
var contourMovements = [];
for ( var i = 0, il = contour.length, j = il - 1, k = i + 1; i < il; i ++, j ++, k ++ ) {
if ( j === il ) j = 0;
if ( k === il ) k = 0;
// (j)---(i)---(k)
// console.log('i,j,k', i, j , k)
contourMovements[ i ] = getBevelVec( contour[ i ], contour[ j ], contour[ k ] );
}
var holesMovements = [], oneHoleMovements, verticesMovements = contourMovements.concat();
for ( h = 0, hl = holes.length; h < hl; h ++ ) {
ahole = holes[ h ];
oneHoleMovements = [];
for ( i = 0, il = ahole.length, j = il - 1, k = i + 1; i < il; i ++, j ++, k ++ ) {
if ( j === il ) j = 0;
if ( k === il ) k = 0;
// (j)---(i)---(k)
oneHoleMovements[ i ] = getBevelVec( ahole[ i ], ahole[ j ], ahole[ k ] );
}
holesMovements.push( oneHoleMovements );
verticesMovements = verticesMovements.concat( oneHoleMovements );
}
// Loop bevelSegments, 1 for the front, 1 for the back
for ( b = 0; b < bevelSegments; b ++ ) {
//for ( b = bevelSegments; b > 0; b -- ) {
t = b / bevelSegments;
z = bevelThickness * Math.cos( t * Math.PI / 2 );
bs = bevelSize * Math.sin( t * Math.PI / 2 );
// contract shape
for ( i = 0, il = contour.length; i < il; i ++ ) {
vert = scalePt2( contour[ i ], contourMovements[ i ], bs );
v( vert.x, vert.y, - z );
}
// expand holes
for ( h = 0, hl = holes.length; h < hl; h ++ ) {
ahole = holes[ h ];
oneHoleMovements = holesMovements[ h ];
for ( i = 0, il = ahole.length; i < il; i ++ ) {
vert = scalePt2( ahole[ i ], oneHoleMovements[ i ], bs );
v( vert.x, vert.y, - z );
}
}
}
bs = bevelSize;
// Back facing vertices
for ( i = 0; i < vlen; i ++ ) {
vert = bevelEnabled ? scalePt2( vertices[ i ], verticesMovements[ i ], bs ) : vertices[ i ];
if ( ! extrudeByPath ) {
v( vert.x, vert.y, 0 );
} else {
// v( vert.x, vert.y + extrudePts[ 0 ].y, extrudePts[ 0 ].x );
normal.copy( splineTube.normals[ 0 ] ).multiplyScalar( vert.x );
binormal.copy( splineTube.binormals[ 0 ] ).multiplyScalar( vert.y );
position2.copy( extrudePts[ 0 ] ).add( normal ).add( binormal );
v( position2.x, position2.y, position2.z );
}
}
// Add stepped vertices...
// Including front facing vertices
var s;
for ( s = 1; s <= steps; s ++ ) {
for ( i = 0; i < vlen; i ++ ) {
vert = bevelEnabled ? scalePt2( vertices[ i ], verticesMovements[ i ], bs ) : vertices[ i ];
if ( ! extrudeByPath ) {
v( vert.x, vert.y, amount / steps * s );
} else {
// v( vert.x, vert.y + extrudePts[ s - 1 ].y, extrudePts[ s - 1 ].x );
normal.copy( splineTube.normals[ s ] ).multiplyScalar( vert.x );
binormal.copy( splineTube.binormals[ s ] ).multiplyScalar( vert.y );
position2.copy( extrudePts[ s ] ).add( normal ).add( binormal );
v( position2.x, position2.y, position2.z );
}
}
}
// Add bevel segments planes
//for ( b = 1; b <= bevelSegments; b ++ ) {
for ( b = bevelSegments - 1; b >= 0; b -- ) {
t = b / bevelSegments;
z = bevelThickness * Math.cos ( t * Math.PI / 2 );
bs = bevelSize * Math.sin( t * Math.PI / 2 );
// contract shape
for ( i = 0, il = contour.length; i < il; i ++ ) {
vert = scalePt2( contour[ i ], contourMovements[ i ], bs );
v( vert.x, vert.y, amount + z );
}
// expand holes
for ( h = 0, hl = holes.length; h < hl; h ++ ) {
ahole = holes[ h ];
oneHoleMovements = holesMovements[ h ];
for ( i = 0, il = ahole.length; i < il; i ++ ) {
vert = scalePt2( ahole[ i ], oneHoleMovements[ i ], bs );
if ( ! extrudeByPath ) {
v( vert.x, vert.y, amount + z );
} else {
v( vert.x, vert.y + extrudePts[ steps - 1 ].y, extrudePts[ steps - 1 ].x + z );
}
}
}
}
/* Faces */
// Top and bottom faces
buildLidFaces();
// Sides faces
buildSideFaces();
///// Internal functions
function buildLidFaces() {
if ( bevelEnabled ) {
var layer = 0; // steps + 1
var offset = vlen * layer;
// Bottom faces
for ( i = 0; i < flen; i ++ ) {
face = faces[ i ];
f3( face[ 2 ] + offset, face[ 1 ] + offset, face[ 0 ] + offset );
}
layer = steps + bevelSegments * 2;
offset = vlen * layer;
// Top faces
for ( i = 0; i < flen; i ++ ) {
face = faces[ i ];
f3( face[ 0 ] + offset, face[ 1 ] + offset, face[ 2 ] + offset );
}
} else {
// Bottom faces
for ( i = 0; i < flen; i ++ ) {
face = faces[ i ];
f3( face[ 2 ], face[ 1 ], face[ 0 ] );
}
// Top faces
for ( i = 0; i < flen; i ++ ) {
face = faces[ i ];
f3( face[ 0 ] + vlen * steps, face[ 1 ] + vlen * steps, face[ 2 ] + vlen * steps );
}
}
}
// Create faces for the z-sides of the shape
function buildSideFaces() {
var layeroffset = 0;
sidewalls( contour, layeroffset );
layeroffset += contour.length;
for ( h = 0, hl = holes.length; h < hl; h ++ ) {
ahole = holes[ h ];
sidewalls( ahole, layeroffset );
//, true
layeroffset += ahole.length;
}
}
function sidewalls( contour, layeroffset ) {
var j, k;
i = contour.length;
while ( -- i >= 0 ) {
j = i;
k = i - 1;
if ( k < 0 ) k = contour.length - 1;
//console.log('b', i,j, i-1, k,vertices.length);
var s = 0, sl = steps + bevelSegments * 2;
for ( s = 0; s < sl; s ++ ) {
var slen1 = vlen * s;
var slen2 = vlen * ( s + 1 );
var a = layeroffset + j + slen1,
b = layeroffset + k + slen1,
c = layeroffset + k + slen2,
d = layeroffset + j + slen2;
f4( a, b, c, d, contour, s, sl, j, k );
}
}
}
function v( x, y, z ) {
scope.vertices.push( new Vector3( x, y, z ) );
}
function f3( a, b, c ) {
a += shapesOffset;
b += shapesOffset;
c += shapesOffset;
scope.faces.push( new Face3( a, b, c, null, null, 0 ) );
var uvs = uvgen.generateTopUV( scope, a, b, c );
scope.faceVertexUvs[ 0 ].push( uvs );
}
function f4( a, b, c, d, wallContour, stepIndex, stepsLength, contourIndex1, contourIndex2 ) {
a += shapesOffset;
b += shapesOffset;
c += shapesOffset;
d += shapesOffset;
scope.faces.push( new Face3( a, b, d, null, null, 1 ) );
scope.faces.push( new Face3( b, c, d, null, null, 1 ) );
var uvs = uvgen.generateSideWallUV( scope, a, b, c, d );
scope.faceVertexUvs[ 0 ].push( [ uvs[ 0 ], uvs[ 1 ], uvs[ 3 ] ] );
scope.faceVertexUvs[ 0 ].push( [ uvs[ 1 ], uvs[ 2 ], uvs[ 3 ] ] );
}
};
ExtrudeGeometry.WorldUVGenerator = {
generateTopUV: function ( geometry, indexA, indexB, indexC ) {
var vertices = geometry.vertices;
var a = vertices[ indexA ];
var b = vertices[ indexB ];
var c = vertices[ indexC ];
return [
new Vector2( a.x, a.y ),
new Vector2( b.x, b.y ),
new Vector2( c.x, c.y )
];
},
generateSideWallUV: function ( geometry, indexA, indexB, indexC, indexD ) {
var vertices = geometry.vertices;
var a = vertices[ indexA ];
var b = vertices[ indexB ];
var c = vertices[ indexC ];
var d = vertices[ indexD ];
if ( Math.abs( a.y - b.y ) < 0.01 ) {
return [
new Vector2( a.x, 1 - a.z ),
new Vector2( b.x, 1 - b.z ),
new Vector2( c.x, 1 - c.z ),
new Vector2( d.x, 1 - d.z )
];
} else {
return [
new Vector2( a.y, 1 - a.z ),
new Vector2( b.y, 1 - b.z ),
new Vector2( c.y, 1 - c.z ),
new Vector2( d.y, 1 - d.z )
];
}
}
};
export { ExtrudeGeometry };
| {
"content_hash": "dd70a5e607fe2495b55b756e08a2ecc2",
"timestamp": "",
"source": "github",
"line_count": 710,
"max_line_length": 122,
"avg_line_length": 21.970422535211267,
"alnum_prop": 0.5945893967562024,
"repo_name": "sole/three.js",
"id": "ed87ce72e0161bf8dc7e0f628690663fc87ee09a",
"size": "15599",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/extras/geometries/ExtrudeGeometry.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "139"
},
{
"name": "C",
"bytes": "80088"
},
{
"name": "C++",
"bytes": "116991"
},
{
"name": "CSS",
"bytes": "23395"
},
{
"name": "GLSL",
"bytes": "80553"
},
{
"name": "HTML",
"bytes": "34440"
},
{
"name": "JavaScript",
"bytes": "3664768"
},
{
"name": "MAXScript",
"bytes": "75494"
},
{
"name": "Python",
"bytes": "517599"
},
{
"name": "Shell",
"bytes": "9237"
}
],
"symlink_target": ""
} |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
<meta name="generator" content="AsciiDoc 8.6.6" />
<title>gitcredentials(7)</title>
<style type="text/css">
/* Shared CSS for AsciiDoc xhtml11 and html5 backends */
/* Default font. */
body {
font-family: Georgia,serif;
}
/* Title font. */
h1, h2, h3, h4, h5, h6,
div.title, caption.title,
thead, p.table.header,
#toctitle,
#author, #revnumber, #revdate, #revremark,
#footer {
font-family: Arial,Helvetica,sans-serif;
}
body {
margin: 1em 5% 1em 5%;
}
a {
color: blue;
text-decoration: underline;
}
a:visited {
color: fuchsia;
}
em {
font-style: italic;
color: navy;
}
strong {
font-weight: bold;
color: #083194;
}
h1, h2, h3, h4, h5, h6 {
color: #527bbd;
margin-top: 1.2em;
margin-bottom: 0.5em;
line-height: 1.3;
}
h1, h2, h3 {
border-bottom: 2px solid silver;
}
h2 {
padding-top: 0.5em;
}
h3 {
float: left;
}
h3 + * {
clear: left;
}
h5 {
font-size: 1.0em;
}
div.sectionbody {
margin-left: 0;
}
hr {
border: 1px solid silver;
}
p {
margin-top: 0.5em;
margin-bottom: 0.5em;
}
ul, ol, li > p {
margin-top: 0;
}
ul > li { color: #aaa; }
ul > li > * { color: black; }
pre {
padding: 0;
margin: 0;
}
#author {
color: #527bbd;
font-weight: bold;
font-size: 1.1em;
}
#email {
}
#revnumber, #revdate, #revremark {
}
#footer {
font-size: small;
border-top: 2px solid silver;
padding-top: 0.5em;
margin-top: 4.0em;
}
#footer-text {
float: left;
padding-bottom: 0.5em;
}
#footer-badges {
float: right;
padding-bottom: 0.5em;
}
#preamble {
margin-top: 1.5em;
margin-bottom: 1.5em;
}
div.imageblock, div.exampleblock, div.verseblock,
div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
div.admonitionblock {
margin-top: 1.0em;
margin-bottom: 1.5em;
}
div.admonitionblock {
margin-top: 2.0em;
margin-bottom: 2.0em;
margin-right: 10%;
color: #606060;
}
div.content { /* Block element content. */
padding: 0;
}
/* Block element titles. */
div.title, caption.title {
color: #527bbd;
font-weight: bold;
text-align: left;
margin-top: 1.0em;
margin-bottom: 0.5em;
}
div.title + * {
margin-top: 0;
}
td div.title:first-child {
margin-top: 0.0em;
}
div.content div.title:first-child {
margin-top: 0.0em;
}
div.content + div.title {
margin-top: 0.0em;
}
div.sidebarblock > div.content {
background: #ffffee;
border: 1px solid #dddddd;
border-left: 4px solid #f0f0f0;
padding: 0.5em;
}
div.listingblock > div.content {
border: 1px solid #dddddd;
border-left: 5px solid #f0f0f0;
background: #f8f8f8;
padding: 0.5em;
}
div.quoteblock, div.verseblock {
padding-left: 1.0em;
margin-left: 1.0em;
margin-right: 10%;
border-left: 5px solid #f0f0f0;
color: #888;
}
div.quoteblock > div.attribution {
padding-top: 0.5em;
text-align: right;
}
div.verseblock > pre.content {
font-family: inherit;
font-size: inherit;
}
div.verseblock > div.attribution {
padding-top: 0.75em;
text-align: left;
}
/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
div.verseblock + div.attribution {
text-align: left;
}
div.admonitionblock .icon {
vertical-align: top;
font-size: 1.1em;
font-weight: bold;
text-decoration: underline;
color: #527bbd;
padding-right: 0.5em;
}
div.admonitionblock td.content {
padding-left: 0.5em;
border-left: 3px solid #dddddd;
}
div.exampleblock > div.content {
border-left: 3px solid #dddddd;
padding-left: 0.5em;
}
div.imageblock div.content { padding-left: 0; }
span.image img { border-style: none; }
a.image:visited { color: white; }
dl {
margin-top: 0.8em;
margin-bottom: 0.8em;
}
dt {
margin-top: 0.5em;
margin-bottom: 0;
font-style: normal;
color: navy;
}
dd > *:first-child {
margin-top: 0.1em;
}
ul, ol {
list-style-position: outside;
}
ol.arabic {
list-style-type: decimal;
}
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;
}
div.compact ul, div.compact ol,
div.compact p, div.compact p,
div.compact div, div.compact div {
margin-top: 0.1em;
margin-bottom: 0.1em;
}
tfoot {
font-weight: bold;
}
td > div.verse {
white-space: pre;
}
div.hdlist {
margin-top: 0.8em;
margin-bottom: 0.8em;
}
div.hdlist tr {
padding-bottom: 15px;
}
dt.hdlist1.strong, td.hdlist1.strong {
font-weight: bold;
}
td.hdlist1 {
vertical-align: top;
font-style: normal;
padding-right: 0.8em;
color: navy;
}
td.hdlist2 {
vertical-align: top;
}
div.hdlist.compact tr {
margin: 0;
padding-bottom: 0;
}
.comment {
background: yellow;
}
.footnote, .footnoteref {
font-size: 0.8em;
}
span.footnote, span.footnoteref {
vertical-align: super;
}
#footnotes {
margin: 20px 0 20px 0;
padding: 7px 0 0 0;
}
#footnotes div.footnote {
margin: 0 0 5px 0;
}
#footnotes hr {
border: none;
border-top: 1px solid silver;
height: 1px;
text-align: left;
margin-left: 0;
width: 20%;
min-width: 100px;
}
div.colist td {
padding-right: 0.5em;
padding-bottom: 0.3em;
vertical-align: top;
}
div.colist td img {
margin-top: 0.3em;
}
@media print {
#footer-badges { display: none; }
}
#toc {
margin-bottom: 2.5em;
}
#toctitle {
color: #527bbd;
font-size: 1.1em;
font-weight: bold;
margin-top: 1.0em;
margin-bottom: 0.1em;
}
div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
margin-top: 0;
margin-bottom: 0;
}
div.toclevel2 {
margin-left: 2em;
font-size: 0.9em;
}
div.toclevel3 {
margin-left: 4em;
font-size: 0.9em;
}
div.toclevel4 {
margin-left: 6em;
font-size: 0.9em;
}
span.aqua { color: aqua; }
span.black { color: black; }
span.blue { color: blue; }
span.fuchsia { color: fuchsia; }
span.gray { color: gray; }
span.green { color: green; }
span.lime { color: lime; }
span.maroon { color: maroon; }
span.navy { color: navy; }
span.olive { color: olive; }
span.purple { color: purple; }
span.red { color: red; }
span.silver { color: silver; }
span.teal { color: teal; }
span.white { color: white; }
span.yellow { color: yellow; }
span.aqua-background { background: aqua; }
span.black-background { background: black; }
span.blue-background { background: blue; }
span.fuchsia-background { background: fuchsia; }
span.gray-background { background: gray; }
span.green-background { background: green; }
span.lime-background { background: lime; }
span.maroon-background { background: maroon; }
span.navy-background { background: navy; }
span.olive-background { background: olive; }
span.purple-background { background: purple; }
span.red-background { background: red; }
span.silver-background { background: silver; }
span.teal-background { background: teal; }
span.white-background { background: white; }
span.yellow-background { background: yellow; }
span.big { font-size: 2em; }
span.small { font-size: 0.6em; }
span.underline { text-decoration: underline; }
span.overline { text-decoration: overline; }
span.line-through { text-decoration: line-through; }
/*
* xhtml11 specific
*
* */
tt {
font-family: monospace;
font-size: inherit;
color: navy;
}
div.tableblock {
margin-top: 1.0em;
margin-bottom: 1.5em;
}
div.tableblock > table {
border: 3px solid #527bbd;
}
thead, p.table.header {
font-weight: bold;
color: #527bbd;
}
p.table {
margin-top: 0;
}
/* Because the table frame attribute is overriden by CSS in most browsers. */
div.tableblock > table[frame="void"] {
border-style: none;
}
div.tableblock > table[frame="hsides"] {
border-left-style: none;
border-right-style: none;
}
div.tableblock > table[frame="vsides"] {
border-top-style: none;
border-bottom-style: none;
}
/*
* html5 specific
*
* */
.monospaced {
font-family: monospace;
font-size: inherit;
color: navy;
}
table.tableblock {
margin-top: 1.0em;
margin-bottom: 1.5em;
}
thead, p.tableblock.header {
font-weight: bold;
color: #527bbd;
}
p.tableblock {
margin-top: 0;
}
table.tableblock {
border-width: 3px;
border-spacing: 0px;
border-style: solid;
border-color: #527bbd;
border-collapse: collapse;
}
th.tableblock, td.tableblock {
border-width: 1px;
padding: 4px;
border-style: solid;
border-color: #527bbd;
}
table.tableblock.frame-topbot {
border-left-style: hidden;
border-right-style: hidden;
}
table.tableblock.frame-sides {
border-top-style: hidden;
border-bottom-style: hidden;
}
table.tableblock.frame-none {
border-style: hidden;
}
th.tableblock.halign-left, td.tableblock.halign-left {
text-align: left;
}
th.tableblock.halign-center, td.tableblock.halign-center {
text-align: center;
}
th.tableblock.halign-right, td.tableblock.halign-right {
text-align: right;
}
th.tableblock.valign-top, td.tableblock.valign-top {
vertical-align: top;
}
th.tableblock.valign-middle, td.tableblock.valign-middle {
vertical-align: middle;
}
th.tableblock.valign-bottom, td.tableblock.valign-bottom {
vertical-align: bottom;
}
/*
* manpage specific
*
* */
body.manpage h1 {
padding-top: 0.5em;
padding-bottom: 0.5em;
border-top: 2px solid silver;
border-bottom: 2px solid silver;
}
body.manpage h2 {
border-style: none;
}
body.manpage div.sectionbody {
margin-left: 3em;
}
@media print {
body.manpage div#toc { display: none; }
}
</style>
<script type="text/javascript">
/*<+'])');
// Function that scans the DOM tree for header elements (the DOM2
// nodeIterator API would be a better technique but not supported by all
// browsers).
var iterate = function (el) {
for (var i = el.firstChild; i != null; i = i.nextSibling) {
if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
var mo = re.exec(i.tagName);
if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
}
iterate(i);
}
}
}
iterate(el);
return result;
}
var toc = document.getElementById("toc");
if (!toc) {
return;
}
// Delete existing TOC entries in case we're reloading the TOC.
var tocEntriesToRemove = [];
var i;
for (i = 0; i < toc.childNodes.length; i++) {
var entry = toc.childNodes[i];
if (entry.nodeName == 'div'
&& entry.getAttribute("class")
&& entry.getAttribute("class").match(/^toclevel/))
tocEntriesToRemove.push(entry);
}
for (i = 0; i < tocEntriesToRemove.length; i++) {
toc.removeChild(tocEntriesToRemove[i]);
}
// Rebuild TOC entries.
var entries = tocEntries(document.getElementById("content"), toclevels);
for (var i = 0; i < entries.length; ++i) {
var entry = entries[i];
if (entry.element.id == "")
entry.element.id = "_toc_" + i;
var a = document.createElement("a");
a.href = "#" + entry.element.id;
a.appendChild(document.createTextNode(entry.text));
var div = document.createElement("div");
div.appendChild(a);
div.className = "toclevel" + entry.toclevel;
toc.appendChild(div);
}
if (entries.length == 0)
toc.parentNode.removeChild(toc);
},
/////////////////////////////////////////////////////////////////////
// Footnotes generator
/////////////////////////////////////////////////////////////////////
/* Based on footnote generation code from:
* http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
*/
footnotes: function () {
// Delete existing footnote entries in case we're reloading the footnodes.
var i;
var noteholder = document.getElementById("footnotes");
if (!noteholder) {
return;
}
var entriesToRemove = [];
for (i = 0; i < noteholder.childNodes.length; i++) {
var entry = noteholder.childNodes[i];
if (entry.nodeName == 'div' && entry.getAttribute("class") == "footnote")
entriesToRemove.push(entry);
}
for (i = 0; i < entriesToRemove.length; i++) {
noteholder.removeChild(entriesToRemove[i]);
}
// Rebuild footnote entries.
var cont = document.getElementById("content");
var spans = cont.getElementsByTagName("span");
var refs = {};
var n = 0;
for (i=0; i<spans.length; i++) {
if (spans[i].className == "footnote") {
n++;
var note = spans[i].getAttribute("data-note");
if (!note) {
// Use [\s\S] in place of . so multi-line matches work.
// Because JavaScript has no s (dotall) regex flag.
note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
spans[i].innerHTML =
"[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
"' title='View footnote' class='footnote'>" + n + "</a>]";
spans[i].setAttribute("data-note", note);
}
noteholder.innerHTML +=
"<div class='footnote' id='_footnote_" + n + "'>" +
"<a href='#_footnoteref_" + n + "' title='Return to text'>" +
n + "</a>. " + note + "</div>";
var id =spans[i].getAttribute("id");
if (id != null) refs["#"+id] = n;
}
}
if (n == 0)
noteholder.parentNode.removeChild(noteholder);
else {
// Process footnoterefs.
for (i=0; i<spans.length; i++) {
if (spans[i].className == "footnoteref") {
var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
href = href.match(/#.*/)[0]; // Because IE return full URL.
n = refs[href];
spans[i].innerHTML =
"[<a href='#_footnote_" + n +
"' title='View footnote' class='footnote'>" + n + "</a>]";
}
}
}
},
install: function(toclevels) {
var timerId;
function reinstall() {
asciidoc.footnotes();
if (toclevels) {
asciidoc.toc(toclevels);
}
}
function reinstallAndRemoveTimer() {
clearInterval(timerId);
reinstall();
}
timerId = setInterval(reinstall, 500);
if (document.addEventListener)
document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);
else
window.onload = reinstallAndRemoveTimer;
}
}
asciidoc.install();
/*]]>*/
</script>
</head>
<body class="manpage">
<div id="header">
<h1>
gitcredentials(7) Manual Page
</h1>
<h2>NAME</h2>
<div class="sectionbody">
<p>gitcredentials -
providing usernames and passwords to Git
</p>
</div>
</div>
<div id="content">
<div class="sect1">
<h2 id="_synopsis">SYNOPSIS</h2>
<div class="sectionbody">
<div class="listingblock">
<div class="content">
<pre><tt>git config credential.https://example.com.username myusername
git config credential.helper "$helper $options"</tt></pre>
</div></div>
</div>
</div>
<div class="sect1">
<h2 id="_description">DESCRIPTION</h2>
<div class="sectionbody">
<div class="paragraph"><p>Git will sometimes need credentials from the user in order to perform
operations; for example, it may need to ask for a username and password
in order to access a remote repository over HTTP. This manual describes
the mechanisms Git uses to request these credentials, as well as some
features to avoid inputting these credentials repeatedly.</p></div>
</div>
</div>
<div class="sect1">
<h2 id="_requesting_credentials">REQUESTING CREDENTIALS</h2>
<div class="sectionbody">
<div class="paragraph"><p>Without any credential helpers defined, Git will try the following
strategies to ask the user for usernames and passwords:</p></div>
<div class="olist arabic"><ol class="arabic">
<li>
<p>
If the <tt>GIT_ASKPASS</tt> environment variable is set, the program
specified by the variable is invoked. A suitable prompt is provided
to the program on the command line, and the user’s input is read
from its standard output.
</p>
</li>
<li>
<p>
Otherwise, if the <tt>core.askpass</tt> configuration variable is set, its
value is used as above.
</p>
</li>
<li>
<p>
Otherwise, if the <tt>SSH_ASKPASS</tt> environment variable is set, its
value is used as above.
</p>
</li>
<li>
<p>
Otherwise, the user is prompted on the terminal.
</p>
</li>
</ol></div>
</div>
</div>
<div class="sect1">
<h2 id="_avoiding_repetition">AVOIDING REPETITION</h2>
<div class="sectionbody">
<div class="paragraph"><p>It can be cumbersome to input the same credentials over and over. Git
provides two methods to reduce this annoyance:</p></div>
<div class="olist arabic"><ol class="arabic">
<li>
<p>
Static configuration of usernames for a given authentication context.
</p>
</li>
<li>
<p>
Credential helpers to cache or store passwords, or to interact with
a system password wallet or keychain.
</p>
</li>
</ol></div>
<div class="paragraph"><p>The first is simple and appropriate if you do not have secure storage available
for a password. It is generally configured by adding this to your config:</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>[credential "https://example.com"]
username = me</tt></pre>
</div></div>
<div class="paragraph"><p>Credential helpers, on the other hand, are external programs from which Git can
request both usernames and passwords; they typically interface with secure
storage provided by the OS or other programs.</p></div>
<div class="paragraph"><p>To use a helper, you must first select one to use. Git currently
includes the following helpers:</p></div>
<div class="dlist"><dl>
<dt class="hdlist1">
cache
</dt>
<dd>
<p>
Cache credentials in memory for a short period of time. See
<a href="git-credential-cache.html">git-credential-cache(1)</a> for details.
</p>
</dd>
<dt class="hdlist1">
store
</dt>
<dd>
<p>
Store credentials indefinitely on disk. See
<a href="git-credential-store.html">git-credential-store(1)</a> for details.
</p>
</dd>
</dl></div>
<div class="paragraph"><p>You may also have third-party helpers installed; search for
<tt>credential-*</tt> in the output of <tt>git help -a</tt>, and consult the
documentation of individual helpers. Once you have selected a helper,
you can tell Git to use it by putting its name into the
credential.helper variable.</p></div>
<div class="olist arabic"><ol class="arabic">
<li>
<p>
Find a helper.
</p>
<div class="listingblock">
<div class="content">
<pre><tt>$ git help -a | grep credential-
credential-foo</tt></pre>
</div></div>
</li>
<li>
<p>
Read its description.
</p>
<div class="listingblock">
<div class="content">
<pre><tt>$ git help credential-foo</tt></pre>
</div></div>
</li>
<li>
<p>
Tell Git to use it.
</p>
<div class="listingblock">
<div class="content">
<pre><tt>$ git config --global credential.helper foo</tt></pre>
</div></div>
</li>
</ol></div>
<div class="paragraph"><p>If there are multiple instances of the <tt>credential.helper</tt> configuration
variable, each helper will be tried in turn, and may provide a username,
password, or nothing. Once Git has acquired both a username and a
password, no more helpers will be tried.</p></div>
</div>
</div>
<div class="sect1">
<h2 id="_credential_contexts">CREDENTIAL CONTEXTS</h2>
<div class="sectionbody">
<div class="paragraph"><p>Git considers each credential to have a context defined by a URL. This context
is used to look up context-specific configuration, and is passed to any
helpers, which may use it as an index into secure storage.</p></div>
<div class="paragraph"><p>For instance, imagine we are accessing <tt>https://example.com/foo.git</tt>. When Git
looks into a config file to see if a section matches this context, it will
consider the two a match if the context is a more-specific subset of the
pattern in the config file. For example, if you have this in your config file:</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>[credential "https://example.com"]
username = foo</tt></pre>
</div></div>
<div class="paragraph"><p>then we will match: both protocols are the same, both hosts are the same, and
the "pattern" URL does not care about the path component at all. However, this
context would not match:</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>[credential "https://kernel.org"]
username = foo</tt></pre>
</div></div>
<div class="paragraph"><p>because the hostnames differ. Nor would it match <tt>foo.example.com</tt>; Git
compares hostnames exactly, without considering whether two hosts are part of
the same domain. Likewise, a config entry for <tt>http://example.com</tt> would not
match: Git compares the protocols exactly.</p></div>
</div>
</div>
<div class="sect1">
<h2 id="_configuration_options">CONFIGURATION OPTIONS</h2>
<div class="sectionbody">
<div class="paragraph"><p>Options for a credential context can be configured either in
<tt>credential.*</tt> (which applies to all credentials), or
<tt>credential.<url>.*</tt>, where <url> matches the context as described
above.</p></div>
<div class="paragraph"><p>The following options are available in either location:</p></div>
<div class="dlist"><dl>
<dt class="hdlist1">
helper
</dt>
<dd>
<p>
The name of an external credential helper, and any associated options.
If the helper name is not an absolute path, then the string <tt>git
credential-</tt> is prepended. The resulting string is executed by the
shell (so, for example, setting this to <tt>foo --option=bar</tt> will execute
<tt>git credential-foo --option=bar</tt> via the shell. See the manual of
specific helpers for examples of their use.
</p>
</dd>
<dt class="hdlist1">
username
</dt>
<dd>
<p>
A default username, if one is not provided in the URL.
</p>
</dd>
<dt class="hdlist1">
useHttpPath
</dt>
<dd>
<p>
By default, Git does not consider the "path" component of an http URL
to be worth matching via external helpers. This means that a credential
stored for <tt>https://example.com/foo.git</tt> will also be used for
<tt>https://example.com/bar.git</tt>. If you do want to distinguish these
cases, set this option to <tt>true</tt>.
</p>
</dd>
</dl></div>
</div>
</div>
<div class="sect1">
<h2 id="_custom_helpers">CUSTOM HELPERS</h2>
<div class="sectionbody">
<div class="paragraph"><p>You can write your own custom helpers to interface with any system in
which you keep credentials. See the documentation for Git’s
<a href="technical/api-credentials.html">credentials API</a> for details.</p></div>
</div>
</div>
<div class="sect1">
<h2 id="_git">GIT</h2>
<div class="sectionbody">
<div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
</div>
</div>
</div>
<div id="footnotes"><hr /></div>
<div id="footer">
<div id="footer-text">
Last updated 2013-08-20 08:40:27 PDT
</div>
</div>
</body>
</html>
| {
"content_hash": "bb4e6792358b4d855f2908d99d437a3e",
"timestamp": "",
"source": "github",
"line_count": 990,
"max_line_length": 111,
"avg_line_length": 24.144444444444446,
"alnum_prop": 0.6570723340166507,
"repo_name": "ArcherSys/ArcherSys",
"id": "114f9387b21e0fd451191aa80f9afb209a60a8bc",
"size": "23903",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "gitbin/Git1.9.4/doc/git/html/gitcredentials.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
/*============================================================
**
** Class: CaseInsensitiveComparer
**
** Purpose: Compares two objects for equivalence,
** ignoring the case of strings.
**
============================================================*/
using System.Globalization;
namespace System.Collections
{
public class CaseInsensitiveComparer : IComparer
{
private CompareInfo _compareInfo;
private static volatile CaseInsensitiveComparer s_InvariantCaseInsensitiveComparer;
public CaseInsensitiveComparer()
{
_compareInfo = CultureInfo.CurrentCulture.CompareInfo;
}
public CaseInsensitiveComparer(CultureInfo culture)
{
if (culture == null)
{
throw new ArgumentNullException(nameof(culture));
}
_compareInfo = culture.CompareInfo;
}
public static CaseInsensitiveComparer Default
{
get
{
return new CaseInsensitiveComparer(CultureInfo.CurrentCulture);
}
}
public static CaseInsensitiveComparer DefaultInvariant
{
get
{
if (s_InvariantCaseInsensitiveComparer == null)
{
s_InvariantCaseInsensitiveComparer = new CaseInsensitiveComparer(CultureInfo.InvariantCulture);
}
return s_InvariantCaseInsensitiveComparer;
}
}
// Behaves exactly like Comparer.Default.Compare except that the comparison is case insensitive
// Compares two Objects by calling CompareTo.
// If a == b, 0 is returned.
// If a implements IComparable, a.CompareTo(b) is returned.
// If a doesn't implement IComparable and b does, -(b.CompareTo(a)) is returned.
// Otherwise an exception is thrown.
//
public int Compare(object a, object b)
{
string sa = a as string;
string sb = b as string;
if (sa != null && sb != null)
return _compareInfo.Compare(sa, sb, CompareOptions.IgnoreCase);
else
return Comparer.Default.Compare(a, b);
}
}
}
| {
"content_hash": "92aa902577d95c7096724ee6d91da4bc",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 115,
"avg_line_length": 33.229729729729726,
"alnum_prop": 0.5689304595363969,
"repo_name": "mmitche/corefx",
"id": "7d9faeca728b67d88dfda2e930526669497217aa",
"size": "2459",
"binary": false,
"copies": "44",
"ref": "refs/heads/master",
"path": "src/System.Collections.NonGeneric/src/System/Collections/CaseInsensitiveComparer.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "1C Enterprise",
"bytes": "280724"
},
{
"name": "ASP",
"bytes": "1687"
},
{
"name": "Batchfile",
"bytes": "20096"
},
{
"name": "C",
"bytes": "3730054"
},
{
"name": "C#",
"bytes": "166928159"
},
{
"name": "C++",
"bytes": "117360"
},
{
"name": "CMake",
"bytes": "77718"
},
{
"name": "DIGITAL Command Language",
"bytes": "26402"
},
{
"name": "Groovy",
"bytes": "50984"
},
{
"name": "HTML",
"bytes": "653"
},
{
"name": "Makefile",
"bytes": "13780"
},
{
"name": "OpenEdge ABL",
"bytes": "137969"
},
{
"name": "Perl",
"bytes": "3895"
},
{
"name": "PowerShell",
"bytes": "95072"
},
{
"name": "Python",
"bytes": "1535"
},
{
"name": "Roff",
"bytes": "9387"
},
{
"name": "Shell",
"bytes": "119395"
},
{
"name": "Visual Basic",
"bytes": "1001421"
},
{
"name": "XSLT",
"bytes": "513537"
}
],
"symlink_target": ""
} |
import CardList from './card-list'
export { CardList }
| {
"content_hash": "579ab85a5adca6b1365eb607edba40a7",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 34,
"avg_line_length": 18.666666666666668,
"alnum_prop": 0.7142857142857143,
"repo_name": "clucasalcantara/clucasalcantara.github.io",
"id": "012ba8f85bd94130e5494d901fee1ccd3d85d8cd",
"size": "56",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/components/organisms/index.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "4227"
},
{
"name": "JavaScript",
"bytes": "354717"
}
],
"symlink_target": ""
} |
/**
* ValidWizard javascript class
* This class extends the ValidForm javascript class with added
* support for pagination and other fancy wizard stuff.
*
* @author Robin van Baalen <[email protected]>
*/
ValidWizard.prototype = new ValidForm();
function ValidWizard(strFormId, strMainAlert, options) {
if (typeof ValidForm === "undefined") {
return console.error("ValidForm not included. Cannot initialize ValidWizard without ValidForm.");
}
// Inherit ProposalBase's methods in this class.
ValidForm.apply(this, arguments);
this._name = "ValidWizard";
this.currentPage = jQuery("#" + this.id + " .vf__page:first");
this.hasConfirmPage = false;
this.initialPage = 0;
if (typeof options !== "undefined") {
if (typeof options.confirmPage !== "undefined" && !!options.confirmPage) {
this.hasConfirmPage = true;
}
if (typeof options.initialPage !== "undefined" && parseInt(options.initialPage) > 0) {
this.initialPage = parseInt(options.initialPage);
}
}
}
/**
* Internal initialization method
*/
ValidWizard.prototype._init = function () {
var self = this;
ValidForm.prototype._init.apply(this, arguments);
if (typeof self.initialPage > 0) {
var $objPage = jQuery("#" + this.id + " .vf__page:eq(" + (parseInt(self.initialPage) - 1) + ")");
this.currentPage.hide();
this.currentPage = $objPage;
}
}
/**
* This is the deferred initialization method. It get's called when
* the whole object is filled with fields and ready to use.
*/
ValidWizard.prototype.initialize = function () {
ValidForm.prototype.initialize.apply(this, arguments);
this.showPage(this.currentPage);
if (this.hasConfirmPage) this.addConfirmPage();
// Get the next & previous labels and set them on all page navigation elements.
for (var key in this.labels) {
if (this.labels.hasOwnProperty(key)) {
if (key == "next" || key == "previous") {
for (strPageId in this.pages) {
if (this.pages.hasOwnProperty(strPageId)) {
$("#" + key + "_" + this.pages[strPageId]).html(this.labels[key]);
}
}
}
}
}
}
ValidWizard.prototype.showFirstError = function () {
var __this = this;
if (jQuery("#" + __this.id).has(".vf__error").length > 0) {
var $error = jQuery(".vf__error:first");
var $page = $error.parentsUntil(".vf__page").parent();
__this.currentPage.hide();
__this.showPage($page);
}
}
ValidWizard.prototype.showPage = function ($objPage) {
var self = this;
if (typeof $objPage == "object" && $objPage instanceof jQuery) {
jQuery("#" + self.id).trigger("VF_BeforeShowPage", [{ValidForm: self, objPage: $objPage}]);
if (typeof self.events.beforeShowPage == "function") {
self.events.beforeShowPage($objPage);
} else {
self.cachedEvents.push({"beforeShowPage": $objPage});
}
$objPage.show(0, function () {
jQuery("#" + self.id).trigger("VF_AfterShowPage", [{ValidForm: self, objPage: $objPage}]);
if (typeof self.events.afterShowPage == "function") {
self.events.afterShowPage($objPage);
} else {
self.cachedEvents.push({"afterShowPage": $objPage});
}
});
// Check if this is the last page.
// If that is the case, set the 'next button'-label the submit button value to
// simulate a submit button
var pageIndex = jQuery("#" + self.id + " .vf__page").index($objPage);
if (pageIndex > 0 && pageIndex == self.pages.length - 1) {
jQuery("#" + self.id).find(".vf__navigation").show();
$objPage.find(".vf__pagenavigation").remove();
} else {
jQuery("#" + self.id).find(".vf__navigation").hide();
}
} else {
throw new Error("Invalid object passed to ValidWizard.showPage().");
}
return $objPage;
}
ValidWizard.prototype.addConfirmPage = function () {
$("#" + this.pages[this.pages.length - 1]).after("<div class='vf__page' id='vf_confirm_" + this.id + "'></div>");
this.addPage("vf_confirm_" + this.id);
this.confirmPage = $("vf_confirm_" + this.id);
}
ValidWizard.prototype.addPage = function (strPageId) {
var __this = this;
var $page = jQuery("#" + strPageId);
// Add page to the pages collection
this.pages.push(strPageId);
// Add next / prev navigation
this.addPageNavigation(strPageId);
// If this is not the first page, hide it.
$page.hide();
jQuery("#" + __this.id).find(".vf__navigation").hide();
if (this.pages.length == 1) {
this.showPage($page);
}
if (this.pages.length > 1) {
var blnIsConfirmPage = (strPageId == "vf_confirm_" + this.id);
this.addPreviousButton(strPageId, blnIsConfirmPage);
}
}
ValidWizard.prototype.addPreviousButton = function (strPageId, blnIsConfirmPage) {
var __this = this;
var $page = jQuery("#" + strPageId);
if ($page.index(".vf__page") > 0) {
var $pagenav = $page.find(".vf__pagenavigation");
var $nav = ($pagenav.length > 0 && !blnIsConfirmPage) ? $pagenav : $("#" + this.id).find(".vf__navigation");
//*** Call custom event if set.
jQuery("#" + this.id).trigger("VF_BeforeAddPreviousButton", [__this, {ValidForm: __this, pageId: strPageId}]);
if (typeof __this.events.beforeAddPreviousButton == "function") {
__this.events.beforeAddPreviousButton(strPageId);
}
$nav.append(jQuery("<a href='#' id='previous_" + strPageId + "' class='vf__button vf__previous'></a>"));
jQuery("#previous_" + strPageId).on("click", function () {
__this.previousPage();
return false;
});
//*** Call custom event if set.
jQuery("#" + this.id).trigger("VF_AfterAddPreviousButton", [{ValidForm: __this, pageId: strPageId}]);
if (typeof __this.events.afterAddPreviousButton == "function") {
__this.events.afterAddPreviousButton(strPageId);
} else {
this.cachedEvents.push({"afterAddPreviousButton": strPageId});
}
}
}
ValidWizard.prototype.getPages = function () {
var __this = this;
var objReturn = {};
for (i in this.pages) {
if (this.pages.hasOwnProperty(i)) {
objReturn[this.pages[i]] = jQuery("#" + __this.pages[i]);
}
}
return objReturn;
}
ValidWizard.prototype.nextPage = function () {
this.__continueExecution = true; // reset before triggering custom events
jQuery("#" + this.id).trigger("VF_BeforeNextPage", [{ValidForm: this}]);
if (this.__continueExecution) {
if (typeof this.events.beforeNextPage == "function") {
this.events.beforeNextPage(this);
}
if (this.validate("#" + this.currentPage.attr("id"))) {
if (this.nextIsLast()) {
jQuery("#" + this.id).trigger("VF_ShowOverview", [{ValidForm: this}]);
}
this.currentPage.hide();
// Set the next page as the new current page.
this.currentPage = this.currentPage.next(".vf__page");
this.showPage(this.currentPage);
jQuery("#" + this.id).trigger("VF_AfterNextPage", [{ValidForm: this}]);
if (typeof this.events.afterNextPage == "function") {
this.events.afterNextPage(this);
}
}
}
}
ValidWizard.prototype.nextIsLast = function () {
var $next = this.currentPage.next(".vf__page");
var index = (jQuery("#" + this.id + " .vf__page").index($next) + 1);
return (this.pages.length == index);
}
ValidWizard.prototype.previousPage = function () {
jQuery("#" + this.id).trigger("VF_BeforePreviousPage", [{ValidForm: this}]);
if (typeof this.events.beforePreviousPage == "function") {
this.events.beforePreviousPage(this);
}
this.currentPage.hide();
// Set the next page as the new current page.
this.currentPage = this.currentPage.prev(".vf__page");
this.showPage(this.currentPage);
jQuery("#" + this.id).trigger("VF_AfterPreviousPage", [{ValidForm: this}]);
if (typeof this.events.afterPreviousPage == "function") {
this.events.afterPreviousPage(this);
}
}
ValidWizard.prototype.addPageNavigation = function (strPageId) {
var __this = this;
//*** Call custom event if set.
jQuery("#" + this.id).trigger("VF_BeforeAddPageNavigation", [{ValidForm: __this, pageId: strPageId}]);
if (typeof __this.events.beforeAddPageNavigation == "function") {
__this.events.beforeAddPageNavigation(strPageId);
}
// Button label will be set later in initWizard
var $page = jQuery("#" + strPageId);
var $nextNavigation = jQuery("<div class='vf__pagenavigation vf__cf'><a href='#' id='next_" + strPageId + "' class='vf__button'></a></div>");
jQuery("#" + strPageId).append($nextNavigation);
jQuery("#next_" + strPageId).on("click", function () {
__this.nextPage();
return false;
});
//*** Call custom event if set.
jQuery("#" + this.id).trigger("VF_AfterAddPageNavigation", [{ValidForm: __this, pageId: strPageId}]);
if (typeof __this.events.afterAddPageNavigation == "function") {
__this.events.afterAddPageNavigation(strPageId);
} else {
this.cachedEvents.push({"afterAddPageNavigation": strPageId});
}
} | {
"content_hash": "3523695b075913ab0f4ba81d858daef8",
"timestamp": "",
"source": "github",
"line_count": 282,
"max_line_length": 142,
"avg_line_length": 30.592198581560282,
"alnum_prop": 0.6622232525791121,
"repo_name": "frontenddevguy/unibond-toyota",
"id": "bedb8b2d8a527456e40a749933f391fac08d9f93",
"size": "8627",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "libraries/validwizard.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "125288"
},
{
"name": "JavaScript",
"bytes": "244001"
},
{
"name": "PHP",
"bytes": "308214"
}
],
"symlink_target": ""
} |
A Ruby wrapper for the Twitter API.
## <a name="installation"></a>Installation
gem install twitter
## <a name="documentation"></a>Documentation
[http://rdoc.info/gems/twitter][documentation]
[documentation]: http://rdoc.info/gems/twitter
## <a name="follow"></a>Follow @gem on Twitter
You should [follow @gem][follow] on Twitter for announcements and updates about
the gem.
[follow]: https://twitter.com/gem
## <a name="mailing_list"></a>Mailing List
Please direct any questions about the library to the [mailing list].
[mailing list]: https://groups.google.com/group/ruby-twitter-gem
## <a name="apps"></a>Apps Wiki
Does your project or organization use this gem? Add it to the [apps
wiki][apps]!
[apps]: https://github.com/jnunemaker/twitter/wiki/apps
## <a name="build"></a>Build Status
[][travis]
[travis]: http://travis-ci.org/jnunemaker/twitter
## <a name="dependencies"></a>Dependency Status
[][gemnasium]
[gemnasium]: https://gemnasium.com/jnunemaker/twitter
## <a name="2.0"></a>What new in version 2?
This version introduces a number of new classes, notably:
<table>
<tr>
<td><tt>Twitter::Configuration</tt></td>
<td><tt>Twitter::List</tt></td>
<td><tt>Twitter::Polygon</tt></td>
<td><tt>Twitter::Settings</tt></td>
</tr>
<tr>
<td><tt>Twitter::Cursor</tt></td>
<td><tt>Twitter::Metadata</tt></td>
<td><tt>Twitter::RateLimitStatus</tt></td>
<td><tt>Twitter::Size</tt></td>
</tr>
<tr>
<td><tt>Twitter::DirectMessage</tt></td>
<td><tt>Twitter::Mention</tt></td>
<td><tt>Twitter::Relationship</tt></td>
<td><tt>Twitter::Status</tt></td>
</tr>
<tr>
<td><tt>Twitter::Favorite</tt></td>
<td><tt>Twitter::Photo</tt></td>
<td><tt>Twitter::Reply</tt></td>
<td><tt>Twitter::Suggestion</tt></td>
</tr>
<tr>
<td><tt>Twitter::Follow</tt></td>
<td><tt>Twitter::Place</tt></td>
<td><tt>Twitter::Retweet</tt></td>
<td><tt>Twitter::Trend</tt></td>
</tr>
<tr>
<td><tt>Twitter::Language</tt></td>
<td><tt>Twitter::Point</tt></td>
<td><tt>Twitter::SavedSearch</tt></td>
<td><tt>Twitter::User</tt></td>
</tr>
</table>
These classes (plus Ruby primitives) have replaced all instances of
`Hashie::Mash`. This allows us to remove the gem's dependency on [hashie][] and
eliminate a layer in the middleware stack.
[hashie]: https://github.com/intridea/hashie
This should have the effect of making object instantiation and method
invocation faster and less susceptible to typos. For example, if you typed
`Twitter.user("sferik").loctaion`, a `Hashie::Mash` would return `nil` instead
of raising a `NoMethodError`.
Another benefit of these new objects is instance methods like `created_at` now
return a `Time` instead of a `String`. This should make the objects easier to
work with and better fulfills the promise of this library as a Ruby wrapper for
the Twitter API.
Any instance method that returns a boolean can now be called with a trailing
question mark, for example:
Twitter.user("sferik").protected?
The `Twitter::Search` class has been replaced by the `Twitter::Client#search`
method. This unifies the library's interfaces and will make the code easier to
maintain over time. As a result, you can no longer build queries by chaining
methods (ARel-style). The new syntax is more consistent and concise.
This version also introduces object equivalence, so objects that are logically
equivalent are considered equal, even if they don't occupy the same address in
memory, for example:
Twitter.user("sferik") == Twitter.user("sferik") #=> true
Twitter.user("sferik") == Twitter.user(7505382) #=> true
In previous versions of this gem, both of the above statements would have
returned false. We've stopped short of implementing a true identity map, such
that:
Twitter.user("sferik").object_id == Twitter.user("sferik").object_id
A true identity map may be implemented in future versions of this library.
### Additional Notes
* All deprecated methods have been removed.
* `Twitter::Client#totals` has been removed. Use `Twitter::Client#user`
instead.
* `Twitter.faraday_options` has been renamed to `Twitter.connection_options`.
* `Twitter::Client#friendships` now takes up to 3 arguments instead of 1.
* Support for the XML response format has been removed. This decision was
guided largely by Twitter, which has started removing XML responses available
for [some resources][trends]. This allows us to remove the gem's dependency
on [multi_xml][]. Using JSON is faster than XML, both in terms of parsing
speed and time over the wire.
* All error classes have been moved inside the `Twitter::Error` namespace. If
you were previously rescuing `Twitter::NotFound` you'll need to change that
to `Twitter::Error::NotFound`.
[trends]: https://dev.twitter.com/blog/changing-trends-api
[multi_xml]: https://github.com/sferik/multi_xml
## <a href="performance"></a>Performance
You can improve performance by preloading a faster JSON parsing library. By
default, JSON will be parsed with [okjson][]. For faster JSON parsing, we
recommend [yajl][].
[okjson]: https://github.com/ddollar/okjson
[yajl]: https://github.com/brianmario/yajl-ruby
## <a name="examples"></a>Usage Examples
Return [@sferik][sferik]'s location
Twitter.user("sferik").location
Return [@sferik][sferik]'s most recent Tweet
Twitter.user_timeline("sferik").first.text
Return the text of the Tweet at https://twitter.com/sferik/statuses/27558893223
Twitter.status(27558893223).text
Find the 3 most recent marriage proposals to [@justinbieber][justinbieber]
Twitter.search("to:justinbieber marry me", :rpp => 3, :result_type => "recent").map do |status|
"#{status.from_user}: #{status.text}"
end
Let's find a Japanese-language Tweet tagged #ruby (no retweets)
Twitter.search("#ruby -rt", :lang => "ja", :rpp => 1).first.text
Certain methods require authentication. To get your Twitter OAuth credentials,
register an app at http://dev.twitter.com/apps
Twitter.configure do |config|
config.consumer_key = YOUR_CONSUMER_KEY
config.consumer_secret = YOUR_CONSUMER_SECRET
config.oauth_token = YOUR_OAUTH_TOKEN
config.oauth_token_secret = YOUR_OAUTH_TOKEN_SECRET
end
Update your status
Twitter.update("I'm tweeting with @gem!")
Read the most recent Tweet in your timeline
Twitter.home_timeline.first.text
Get your rate limit status
Twitter.rate_limit_status.remaining_hits.to_s + " Twitter API request(s) remaining this hour"
[sferik]: https://twitter.com/sferik
[justinbieber]: https://twitter.com/justinbieber
## <a name="proxy"></a>Configuration for API Proxy Services
Use of API proxy services, like [Apigee](http://apigee.com), can be used to
attain higher rate limits to the Twitter API.
Twitter.gateway = YOUR_GATEWAY_HOSTNAME # e.g 'twitter.apigee.com'
## <a name="contributing"></a>Contributing
In the spirit of [free software][free-sw], **everyone** is encouraged to help improve
this project.
[free-sw]: http://www.fsf.org/licensing/essays/free-sw.html
Here are some ways *you* can contribute:
* by using alpha, beta, and prerelease versions
* by reporting bugs
* by suggesting new features
* by writing or editing documentation
* by writing specifications
* by writing code (**no patch is too small**: fix typos, add comments, clean up inconsistent whitespace)
* by refactoring code
* by closing [issues][]
* by reviewing patches
* [financially][]
[issues]: https://github.com/jnunemaker/twitter/issues
[financially]: http://pledgie.com/campaigns/1193
All contributors will be added to the [history][] and will receive the respect
and gratitude of the community.
[history]: https://github.com/jnunemaker/twitter/blob/master/HISTORY.md
## <a name="issues"></a>Submitting an Issue
We use the [GitHub issue tracker][issues] to track bugs and features. Before
submitting a bug report or feature request, check to make sure it hasn't
already been submitted. You can indicate support for an existing issue by
voting it up. When submitting a bug report, please include a [gist][] that
includes a stack trace and any details that may be necessary to reproduce the
bug, including your gem version, Ruby version, and operating system. Ideally, a
bug report should include a pull request with failing specs.
[gist]: https://gist.github.com/
## <a name="pulls"></a>Submitting a Pull Request
1. Fork the project.
2. Create a topic branch.
3. Implement your feature or bug fix.
4. Add documentation for your feature or bug fix.
5. Run `bundle exec rake doc:yard`. If your changes are not 100% documented, go
back to step 4.
6. Add specs for your feature or bug fix.
7. Run `bundle exec rake spec`. If your changes are not 100% covered, go back
to step 6.
8. Commit and push your changes.
9. Submit a pull request. Please do not include changes to the gemspec,
version, or history file. (If you want to create your own version for some
reason, please do so in a separate commit.)
## <a name="versions"></a>Supported Ruby Versions
This library aims to support and is [tested against][travis] the following Ruby
implementations:
* Ruby 1.8.7
* Ruby 1.9.2
* Ruby 1.9.3
* [JRuby][]
* [Rubinius][]
* [Ruby Enterprise Edition][ree]
[jruby]: http://www.jruby.org/
[rubinius]: http://rubini.us/
[ree]: http://www.rubyenterpriseedition.com/
If something doesn't work on one of these interpreters, it should be considered
a bug.
This library may inadvertently work (or seem to work) on other Ruby
implementations, however support will only be provided for the versions listed
above.
If you would like this library to support another Ruby version, you may
volunteer to be a maintainer. Being a maintainer entails making sure all tests
run and pass on that implementation. When something breaks on your
implementation, you will be personally responsible for providing patches in a
timely fashion. If critical issues for a particular implementation exist at the
time of a major release, support for that Ruby version may be dropped.
## <a name="copyright"></a>Copyright
Copyright (c) 2011 John Nunemaker, Wynn Netherland, Erik Michaels-Ober, Steve Richert.
See [LICENSE][] for details.
[license]: https://github.com/jnunemaker/twitter/blob/master/LICENSE.md
| {
"content_hash": "b93e8cf7655e657e3cbebf7e429e3a2e",
"timestamp": "",
"source": "github",
"line_count": 281,
"max_line_length": 104,
"avg_line_length": 37.15302491103203,
"alnum_prop": 0.7294061302681992,
"repo_name": "istan/twitter2xx",
"id": "39ae4c4c130296c91b9f262a661f9528fb91af00",
"size": "10463",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "377017"
}
],
"symlink_target": ""
} |
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
<a name="1.0.1"></a>
## [1.0.1](https://github.com/mapbox/d3-metatable/compare/v1.0.0...v1.0.1) (2017-12-03)
<a name="1.0.0"></a>
# [1.0.0](https://github.com/mapbox/d3-metatable/compare/v0.3.0...v1.0.0) (2017-11-27)
### Features
* Compatibility with d3 v4 & ES6 modules ([33f7864](https://github.com/mapbox/d3-metatable/commit/33f7864))
### BREAKING CHANGES
* will no longer play well with d3 v3.
### v0.4.0
- Interfaces like `renameCol`, `deleteCol`, and `newCol` can now be disabled
if the option is passed in metatable.
- Allow a client to pass in a custom interface for renaming or deleting a column.
- HTML Markup cleanup
- Adds `renameprompt` and `deleteprompt` events to disable default behaviour with users own.
| {
"content_hash": "235d52f46729c328597676d934792063",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 174,
"avg_line_length": 31.379310344827587,
"alnum_prop": 0.7186813186813187,
"repo_name": "mapbox/d3-metatable",
"id": "9b3abfdf50fbaa0edc6f1378aaaeedc7cf18c40e",
"size": "924",
"binary": false,
"copies": "1",
"ref": "refs/heads/gh-pages",
"path": "CHANGELOG.md",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "8914"
},
{
"name": "HTML",
"bytes": "2370"
},
{
"name": "JavaScript",
"bytes": "8143"
}
],
"symlink_target": ""
} |
PyObject* MI2Py(const MI_Value& value, MI_Type valueType, MI_Uint32 flags);
std::shared_ptr<MI::MIValue> Py2MI(PyObject* pyValue, MI_Type valueType);
void GetIndexOrName(PyObject *item, std::wstring& name, Py_ssize_t& i);
void SetPyException(const std::exception& ex);
void AllowThreads(PCRITICAL_SECTION cs, std::function<void()> action);
void CallPythonCallback(PyObject* callable, const char* format, ...);
void MIIntervalFromPyDelta(PyObject* pyDelta, MI_Interval& interval);
PyObject* PyDeltaFromMIInterval(const MI_Interval& interval);
bool CheckPyNone(PyObject* obj);
| {
"content_hash": "d580cf7cb64d41f0d368237037d3bf47",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 75,
"avg_line_length": 63.888888888888886,
"alnum_prop": 0.7791304347826087,
"repo_name": "alinbalutoiu/PyMI",
"id": "2f5d831f3bccc2b62046b0323269ed0df1341552",
"size": "728",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "PyMI/Utils.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "2034"
},
{
"name": "C++",
"bytes": "150851"
},
{
"name": "Python",
"bytes": "31012"
}
],
"symlink_target": ""
} |
package org.brackit.server.node.el;
import org.brackit.server.node.XTCdeweyID;
import org.brackit.server.node.el.index.ElPlaceHolderHelper;
import org.brackit.server.util.Calc;
import org.brackit.xquery.atomic.Atomic;
import org.brackit.xquery.atomic.Str;
import org.brackit.xquery.atomic.Una;
import org.brackit.xquery.xdm.Kind;
/**
* En/Decoder for elementless records.
*
* CAVEAT: If changes are made to the encoding one must ensure that the size of
* empty element entries (key + value) is always at most of equal size (in
* bytes)! Otherwise some parts of the replace logic in the index may break or
* have to be adjusted.
*
* @author Sebastian Baechle
*
*/
public class ElRecordAccess implements ElPlaceHolderHelper {
/**
* 0000 0011
*/
protected final static int PCR_SIZE_MASK = 3;
/**
* 0000 0111
*/
protected final static int TYPE_MASK = 7;
public final static int getPCR(byte[] physicalRecord) {
int pcrSize = getPCRsize(physicalRecord);
return (pcrSize > 0) ? Calc.toInt(physicalRecord, 1, pcrSize) : 0;
}
public final static int getPCR(byte[] buf, int offset, int len) {
int pcrSize = ((buf[offset] & PCR_SIZE_MASK) + 1);
return (pcrSize > 0) ? Calc.toInt(buf, offset + 1, pcrSize) : 0;
}
public final static byte getType(byte[] physicalRecord) {
return (byte) ((physicalRecord[0] >> 2) & TYPE_MASK);
}
public final static byte getType(byte[] buf, int offset, int len) {
return (byte) ((buf[offset] >> 2) & TYPE_MASK);
}
public final static void setType(byte[] physicalRecord, byte type) {
physicalRecord[0] = (byte) ((physicalRecord[0] & ~(TYPE_MASK << 2)) | (type << 2));
}
public final static String getValue(byte[] physicalRecord) {
int pcrSize = getPCRsize(physicalRecord);
int valueOffset = 1 + pcrSize;
int valueLength = physicalRecord.length - valueOffset;
String value = "";
if (valueLength > 0) {
value = Calc.toString(physicalRecord, valueOffset, valueLength);
}
return value;
}
public final static String getValue(byte[] buf, int offset, int len) {
int pcrSize = ((buf[offset] & PCR_SIZE_MASK) + 1);
int valueOffset = 1 + pcrSize;
int valueLength = len - valueOffset;
String value = "";
if (valueLength > 0) {
if (offset == 0 && buf.length == len) {
// probably an external value -> do not use an arraycopy again
value = Calc.toString(buf, valueOffset, valueLength);
} else {
byte[] stringBytes = new byte[valueLength];
System.arraycopy(buf, offset + valueOffset, stringBytes, 0, valueLength);
value = Calc.toString(stringBytes);
}
}
return value;
}
public final static Atomic getTypedValue(byte[] physicalRecord) {
String untypedValue = getValue(physicalRecord);
byte type = getType(physicalRecord);
return getTypedValue(type, untypedValue);
}
public final static Atomic getTypedValue(byte[] buf, int offset, int len) {
String untypedValue = getValue(buf, offset, len);
byte type = getType(buf, offset, len);
return getTypedValue(type, untypedValue);
}
public final static Atomic getTypedValue(byte[] buf, int offset, int len, byte type) {
String untypedValue = getValue(buf, offset, len);
return getTypedValue(type, untypedValue);
}
protected static final Atomic getTypedValue(byte type, String untypedValue) {
// default type mapping
if (type == Kind.COMMENT.ID || type == Kind.PROCESSING_INSTRUCTION.ID) {
return new Str(untypedValue);
} else {
return new Una(untypedValue);
}
}
public static final byte[] createRecord(int PCR, byte type, String value) {
int valueLength = 0;
int pcrLength = 0;
byte[] valueBytes = null;
byte[] pcrBytes = null;
if (value != null) {
valueBytes = Calc.fromString(value);
valueLength = valueBytes.length;
}
if (PCR > 0) {
pcrBytes = Calc.fromUIntVar(PCR);
pcrLength = pcrBytes.length;
}
byte[] physicalRecord = new byte[1 + pcrLength + valueLength];
setType(physicalRecord, type);
if (value != null) {
System.arraycopy(valueBytes, 0, physicalRecord, 1 + pcrLength,
valueLength);
}
if (PCR > 0) {
System.arraycopy(pcrBytes, 0, physicalRecord, 1, pcrLength);
setPCRsize(physicalRecord, pcrLength);
}
return physicalRecord;
}
public final static int getPCRsize(byte[] physicalRecord) {
return ((physicalRecord[0] & PCR_SIZE_MASK) + 1);
}
private final static void setPCRsize(byte[] physicalRecord, int pcrSize) {
physicalRecord[0] = (byte) ((physicalRecord[0] & ~PCR_SIZE_MASK) | (PCR_SIZE_MASK & (pcrSize - 1)));
}
public static final String toString(byte[] physicalRecord) {
int pcr = getPCR(physicalRecord);
String value = getValue(physicalRecord);
if (value == null) {
return String.format("(%s)", pcr);
} else {
return String.format("\"%s\"(%s)", value, pcr);
}
}
@Override
public final byte[] createPlaceHolderValue(byte[] value) {
int PCR = getPCR(value);
return createRecord(PCR, Kind.ELEMENT.ID, null);
}
@Override
public final byte[] createPlaceHolderKey(byte[] key, int level) {
XTCdeweyID deweyID = new XTCdeweyID(null, key);
deweyID = deweyID.getAncestor(level);
return deweyID.toBytes();
}
}
| {
"content_hash": "c986ede0ac54368519c9c48a307ed549",
"timestamp": "",
"source": "github",
"line_count": 181,
"max_line_length": 102,
"avg_line_length": 28.475138121546962,
"alnum_prop": 0.6911136980985643,
"repo_name": "x-clone/brackit.brackitdb",
"id": "20ef89ad063a57da9203199f74287bdf59c09221",
"size": "6810",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "brackitdb-server/src/main/java/org/brackit/server/node/el/ElRecordAccess.java",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Java",
"bytes": "3513442"
}
],
"symlink_target": ""
} |
package org.netbeans.editor;
import javax.swing.*;
import javax.swing.text.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.io.IOException;
import java.io.Reader;
import java.io.Writer;
import java.util.*;
import java.util.List;
/**
* Editor kit implementation for base document
*
* @author Miloslav Metelka
* @version 1.00
*/
public class BaseKit extends DefaultEditorKit
{
/** Cycle through annotations on the current line */
public static final String annotationsCyclingAction = "annotations-cycling"; // NOI18N
/** Move one page up and make or extend selection */
public static final String selectionPageUpAction = "selection-page-up"; // NOI18N
/** Move one page down and make or extend selection */
public static final String selectionPageDownAction = "selection-page-down"; // NOI18N
/** Remove indentation */
public static final String removeTabAction = "remove-tab"; // NOI18N
/** Remove selected block or do nothing - useful for popup menu */
public static final String removeSelectionAction = "remove-selection"; // NOI18N
/** Toggle bookmark on the current line */
public static final String toggleBookmarkAction = "bookmark-toggle"; // NOI18N
/** Goto the next bookmark */
public static final String gotoNextBookmarkAction = "bookmark-next"; // NOI18N
/** Expand the abbreviation */
public static final String abbrevExpandAction = "abbrev-expand"; // NOI18N
/** Reset the abbreviation accounting string */
public static final String abbrevResetAction = "abbrev-reset"; // NOI18N
/** Remove to the begining of the word */
public static final String removeWordAction = "remove-word"; // NOI18N
/** Remove to the begining of the line */
public static final String removeLineBeginAction = "remove-line-begin"; // NOI18N
/** Remove line */
public static final String removeLineAction = "remove-line"; // NOI18N
/** Toggle the typing mode to overwrite mode or back to insert mode */
public static final String toggleTypingModeAction = "toggle-typing-mode"; // NOI18N
/** Change the selected text or current character to uppercase */
public static final String toUpperCaseAction = "to-upper-case"; // NOI18N
/** Change the selected text or current character to lowercase */
public static final String toLowerCaseAction = "to-lower-case"; // NOI18N
/** Switch the case of the selected text or current character */
public static final String switchCaseAction = "switch-case"; // NOI18N
/** Find next occurence action */
public static final String findNextAction = "find-next"; // NOI18N
/** Find previous occurence action */
public static final String findPreviousAction = "find-previous"; // NOI18N
/** Toggle highlight search action */
public static final String toggleHighlightSearchAction = "toggle-highlight-search"; // NOI18N
/** Find current word */
public static final String findSelectionAction = "find-selection"; // NOI18N
/** Undo action */
public static final String undoAction = "undo"; // NOI18N
/** Redo action */
public static final String redoAction = "redo"; // NOI18N
/** Word match next */
public static final String wordMatchNextAction = "word-match-next"; // NOI18N
/** Word match prev */
public static final String wordMatchPrevAction = "word-match-prev"; // NOI18N
/** Shift line right action */
public static final String shiftLineRightAction = "shift-line-right"; // NOI18N
/** Shift line left action */
public static final String shiftLineLeftAction = "shift-line-left"; // NOI18N
/** Action that scrolls the window so that caret is at the center of the window */
public static final String adjustWindowCenterAction = "adjust-window-center"; // NOI18N
/** Action that scrolls the window so that caret is at the top of the window */
public static final String adjustWindowTopAction = "adjust-window-top"; // NOI18N
/** Action that scrolls the window so that caret is at the bottom of the window */
public static final String adjustWindowBottomAction = "adjust-window-bottom"; // NOI18N
/** Action that moves the caret so that caret is at the center of the window */
public static final String adjustCaretCenterAction = "adjust-caret-center"; // NOI18N
/** Action that moves the caret so that caret is at the top of the window */
public static final String adjustCaretTopAction = "adjust-caret-top"; // NOI18N
/** Action that moves the caret so that caret is at the bottom of the window */
public static final String adjustCaretBottomAction = "adjust-caret-bottom"; // NOI18N
/** Format part of the document text using Indent */
public static final String formatAction = "format"; // NOI18N
/** First non-white character on the line */
public static final String firstNonWhiteAction = "first-non-white"; // NOI18N
/** Last non-white character on the line */
public static final String lastNonWhiteAction = "last-non-white"; // NOI18N
/** First non-white character on the line */
public static final String selectionFirstNonWhiteAction = "selection-first-non-white"; // NOI18N
/** Last non-white character on the line */
public static final String selectionLastNonWhiteAction = "selection-last-non-white"; // NOI18N
/** Select the nearest identifier around caret */
public static final String selectIdentifierAction = "select-identifier"; // NOI18N
/** Select the next parameter (after the comma) in the given context */
public static final String selectNextParameterAction = "select-next-parameter"; // NOI18N
/** Go to the previous position stored in the jump-list */
public static final String jumpListNextAction = "jump-list-next"; // NOI18N
/** Go to the next position stored in the jump-list */
public static final String jumpListPrevAction = "jump-list-prev"; // NOI18N
/** Go to the last position in the previous component stored in the jump-list */
public static final String jumpListNextComponentAction = "jump-list-next-component"; // NOI18N
/** Go to the next position in the previous component stored in the jump-list */
public static final String jumpListPrevComponentAction = "jump-list-prev-component"; // NOI18N
/** Scroll window one line up */
public static final String scrollUpAction = "scroll-up"; // NOI18N
/** Scroll window one line down */
public static final String scrollDownAction = "scroll-down"; // NOI18N
/** Prefix of all macro-based actions */
public static final String macroActionPrefix = "macro-"; // NOI18N
/** Start recording of macro. Only one macro recording can be active at the time */
public static final String startMacroRecordingAction = "start-macro-recording"; //NOI18N
/** Stop the active recording */
public static final String stopMacroRecordingAction = "stop-macro-recording"; //NOI18N
/** Name of the action moving caret to the first column on the line */
public static final String lineFirstColumnAction = "caret-line-first-column"; // NOI18N
/** Insert the current Date and Time */
public static final String insertDateTimeAction = "insert-date-time"; // NOI18N
/** Name of the action moving caret to the first
* column on the line and extending the selection
*/
public static final String selectionLineFirstColumnAction = "selection-line-first-column";
/** Name of the action for generating of Glyph Gutter popup menu*/
public static final String generateGutterPopupAction = "generate-gutter-popup";
/** Toggle visibility of line numbers*/
public static final String toggleLineNumbersAction = "toggle-line-numbers";
private static final int KIT_CNT_PREALLOC = 57;
static final long serialVersionUID = -8570495408376659348L;
/** [kit-class, kit-instance] pairs are stored here */
Map kits = new HashMap(KIT_CNT_PREALLOC);
/** [kit-class, keymap] pairs */
Map kitKeymaps = new HashMap(KIT_CNT_PREALLOC);
/** [kit, action[]] pairs */
Map kitActions = new HashMap(KIT_CNT_PREALLOC);
/** [kit, action-map] pairs */
Map kitActionMaps = new HashMap(KIT_CNT_PREALLOC);
private CopyAction copyActionDef = new CopyAction();
private CutAction cutActionDef = new CutAction();
private PasteAction pasteActionDef = new PasteAction();
static SettingsChangeListener settingsListener = new SettingsChangeListener()
{
public void settingsChange(SettingsChangeEvent evt)
{
String settingName = (evt != null) ? evt.getSettingName() : null;
boolean clearActions = (settingName == null
|| SettingsNames.CUSTOM_ACTION_LIST.equals(settingName)
|| SettingsNames.MACRO_MAP.equals(settingName));
if (clearActions || SettingsNames.KEY_BINDING_LIST.equals(settingName))
{
// kitKeymaps.clear();
}
if (clearActions)
{
// kitActions.clear();
// kitActionMaps.clear();
}
else
{ // only refresh action settings
/* Iterator i = kitActions.entrySet().iterator();
while (i.hasNext())
{
Map.Entry me = (Map.Entry) i.next();
updateActionSettings((Action[]) me.getValue(), evt, (Class) me.getKey());
}
*/ }
}
};
static
{
Settings.addSettingsChangeListener(settingsListener);
}
private static void updateActionSettings(Action[] actions,
SettingsChangeEvent evt, Class kitClass)
{
for (int i = 0; i < actions.length; i++)
{
if (actions[i] instanceof BaseAction)
{
((BaseAction) actions[i]).settingsChange(evt, kitClass);
}
}
}
public static BaseKit getKit(Class kitClass)
{
synchronized (Settings.class)
{
if (kitClass == null)
{
kitClass = BaseKit.class;
}
BaseKit kit = null;//(BaseKit) kits.get(kitClass);
if (kit == null)
{
try
{
kit = (BaseKit) kitClass.newInstance();
}
catch (IllegalAccessException e)
{
if (Boolean.getBoolean("netbeans.debug.exceptions"))
{ // NOI18N
e.printStackTrace();
}
}
catch (InstantiationException e)
{
if (Boolean.getBoolean("netbeans.debug.exceptions"))
{ // NOI18N
e.printStackTrace();
}
}
// kits.put(kitClass, kit);
}
return kit;
}
}
public BaseKit()
{
// possibly register
synchronized (Settings.class)
{
if (kits.get(this.getClass()) == null)
{
kits.put(this.getClass(), this); // register itself
}
}
}
/** Clone this editor kit */
public Object clone()
{
return this; // no need to create another instance
}
/** Fetches a factory that is suitable for producing
* views of any models that are produced by this
* kit. The default is to have the UI produce the
* factory, so this method has no implementation.
*
* @return the view factory
*/
public ViewFactory getViewFactory()
{
return null;
}
/** Create caret to navigate through document */
public Caret createCaret()
{
return new BaseCaret();
}
/** Create empty document */
public Document createDefaultDocument()
{
return new BaseDocument(this.getClass(), true);
}
/** Create new instance of syntax coloring scanner
* @param doc document to operate on. It can be null in the cases the syntax
* creation is not related to the particular document
*/
public Syntax createSyntax(Document doc)
{
return new Syntax();
}
/** Create the syntax used for formatting */
public Syntax createFormatSyntax(Document doc)
{
return createSyntax(doc);
}
/** Create syntax support */
public SyntaxSupport createSyntaxSupport(BaseDocument doc)
{
return new SyntaxSupport(doc);
}
/** Create the formatter appropriate for this kit */
public Formatter createFormatter()
{
return new Formatter(this.getClass());
}
/** Create text UI */
protected BaseTextUI createTextUI()
{
return new BaseTextUI();
}
/** Create extended UI */
protected EditorUI createEditorUI()
{
return new EditorUI();
}
/** Create extended UI for printing a document. */
protected EditorUI createPrintEditorUI(BaseDocument doc)
{
return new EditorUI(doc);
}
/** This methods gives the class of the first component in the component
* hierarchy that should be called when requesting focus for the other
* component.
* @return class of the component that will be searched in the parents
* in the hierarchy or null to do no search.
*/
public Class getFocusableComponentClass(JTextComponent c)
{
return null;
}
public MultiKeymap getKeymap()
{
synchronized (Settings.class)
{
MultiKeymap km = (MultiKeymap) kitKeymaps.get(this.getClass());
if (km == null)
{ // keymap not yet constructed
// construct new keymap
km = new MultiKeymap("Keymap for " + this.getClass()); // NOI18N
// retrieve key bindings for this kit and super kits
Settings.KitAndValue kv[] = Settings.getValueHierarchy(
this.getClass(), SettingsNames.KEY_BINDING_LIST);
// go through all levels and collect key bindings
for (int i = kv.length - 1; i >= 0; i--)
{
List keyList = (List) kv[i].value;
JTextComponent.KeyBinding[] keys = new JTextComponent.KeyBinding[keyList.size()];
keyList.toArray(keys);
km.load(keys, getActionMap());
}
kitKeymaps.put(this.getClass(), km);
}
return km;
}
}
/** Inserts content from the given stream. */
public void read(Reader in, Document doc, int pos)
throws IOException, BadLocationException
{
if (doc instanceof BaseDocument)
{
((BaseDocument) doc).read(in, pos); // delegate it to document
}
else
{
super.read(in, doc, pos);
}
}
/** Writes content from a document to the given stream */
public void write(Writer out, Document doc, int pos, int len)
throws IOException, BadLocationException
{
if (doc instanceof BaseDocument)
{
((BaseDocument) doc).write(out, pos, len);
}
else
{
super.write(out, doc, pos, len);
}
}
/** Creates map with [name, action] pairs from the given
* array of actions.
*/
public static Map actionsToMap(Action[] actions)
{
Map map = new HashMap();
for (int i = 0; i < actions.length; i++)
{
Action a = actions[i];
String name = (String) a.getValue(Action.NAME);
map.put(((name != null) ? name : ""), a); // NOI18N
}
return map;
}
/** Converts map with [name, action] back
* to array of actions.
*/
public static Action[] mapToActions(Map map)
{
Action[] actions = new Action[map.size()];
int i = 0;
for (Iterator iter = map.values().iterator(); iter.hasNext();)
{
actions[i++] = (Action) iter.next();
}
return actions;
}
/** Called after the kit is installed into JEditorPane */
public void install(JEditorPane c)
{
BaseTextUI ui = createTextUI();
c.setUI(ui);
String propName = "netbeans.editor.noinputmethods";
Object noInputMethods = System.getProperty(propName);
boolean enableIM;
if (noInputMethods != null)
{
enableIM = !Boolean.getBoolean(propName);
}
else
{
enableIM = SettingsUtil.getBoolean(this.getClass(),
SettingsNames.INPUT_METHODS_ENABLED, true);
}
c.enableInputMethods(enableIM);
executeInstallActions(c);
}
protected void executeInstallActions(JEditorPane c)
{
Settings.KitAndValue[] kv = Settings.getValueHierarchy(this.getClass(),
SettingsNames.KIT_INSTALL_ACTION_NAME_LIST);
for (int i = kv.length - 1; i >= 0; i--)
{
List actList = (List) kv[i].value;
actList = translateActionNameList(actList); // translate names to actions
if (actList != null)
{
for (Iterator iter = actList.iterator(); iter.hasNext();)
{
Action a = (Action) iter.next();
a.actionPerformed(new ActionEvent(c, ActionEvent.ACTION_PERFORMED, "")); // NOI18N
}
}
}
}
public void deinstall(JEditorPane c)
{
executeDeinstallActions(c);
c.updateUI();
}
protected void executeDeinstallActions(JEditorPane c)
{
Settings.KitAndValue[] kv = Settings.getValueHierarchy(this.getClass(),
SettingsNames.KIT_DEINSTALL_ACTION_NAME_LIST);
for (int i = kv.length - 1; i >= 0; i--)
{
List actList = (List) kv[i].value;
actList = translateActionNameList(actList); // translate names to actions
if (actList != null)
{
for (Iterator iter = actList.iterator(); iter.hasNext();)
{
Action a = (Action) iter.next();
a.actionPerformed(new ActionEvent(c, ActionEvent.ACTION_PERFORMED, "")); // NOI18N
}
}
}
}
/** Initialize document by adding the draw-layers for example. */
protected void initDocument(BaseDocument doc)
{
}
/** Create actions that this kit supports. To use the actions of the parent kit
* it's better instead of using super.createActions() to use
* getKit(super.getClass()).getActions() because it can reuse existing
* parent actions.
*/
protected Action[] createActions()
{
return new Action[]{
new DefaultKeyTypedAction(),
new InsertContentAction(),
new InsertBreakAction(),
new InsertTabAction(),
new DeleteCharAction(deletePrevCharAction, false),
new DeleteCharAction(deleteNextCharAction, true),
new ReadOnlyAction(),
new WritableAction(),
cutActionDef,
copyActionDef,
pasteActionDef,
new BeepAction(),
new UpAction(upAction, false),
new UpAction(selectionUpAction, true),
new PageUpAction(pageUpAction, false),
new PageUpAction(selectionPageUpAction, true),
new DownAction(downAction, false),
new DownAction(selectionDownAction, true),
new PageDownAction(selectionPageDownAction, true),
new PageDownAction(pageDownAction, false),
new ForwardAction(forwardAction, false),
new ForwardAction(selectionForwardAction, true),
new BackwardAction(backwardAction, false),
new BackwardAction(selectionBackwardAction, true),
new BeginLineAction(lineFirstColumnAction, false, true),
new BeginLineAction(selectionLineFirstColumnAction, true, true),
new BeginLineAction(beginLineAction, false),
new BeginLineAction(selectionBeginLineAction, true),
new EndLineAction(endLineAction, false),
new EndLineAction(selectionEndLineAction, true),
new BeginAction(beginAction, false),
new BeginAction(selectionBeginAction, true),
new EndAction(endAction, false),
new EndAction(selectionEndAction, true),
new NextWordAction(nextWordAction, false),
new NextWordAction(selectionNextWordAction, true),
new PreviousWordAction(previousWordAction, false),
new PreviousWordAction(selectionPreviousWordAction, true),
new BeginWordAction(beginWordAction, false),
new BeginWordAction(selectionBeginWordAction, true),
new EndWordAction(endWordAction, false),
new EndWordAction(selectionEndWordAction, true),
new SelectWordAction(),
new SelectLineAction(),
new SelectAllAction(),
new ActionFactory.RemoveTabAction(),
new ActionFactory.RemoveWordAction(),
new ActionFactory.RemoveLineBeginAction(),
new ActionFactory.RemoveLineAction(),
new ActionFactory.RemoveSelectionAction(),
new ActionFactory.ToggleTypingModeAction(),
new ActionFactory.ToggleBookmarkAction(),
new ActionFactory.GotoNextBookmarkAction(gotoNextBookmarkAction, false),
new ActionFactory.AbbrevExpandAction(),
new ActionFactory.AbbrevResetAction(),
new ActionFactory.ChangeCaseAction(toUpperCaseAction, Utilities.CASE_UPPER),
new ActionFactory.ChangeCaseAction(toLowerCaseAction, Utilities.CASE_LOWER),
new ActionFactory.ChangeCaseAction(switchCaseAction, Utilities.CASE_SWITCH),
new ActionFactory.FindNextAction(),
new ActionFactory.FindPreviousAction(),
new ActionFactory.FindSelectionAction(),
new ActionFactory.ToggleHighlightSearchAction(),
new ActionFactory.UndoAction(),
new ActionFactory.RedoAction(),
new ActionFactory.WordMatchAction(wordMatchNextAction, true),
new ActionFactory.WordMatchAction(wordMatchPrevAction, false),
new ActionFactory.ShiftLineAction(shiftLineLeftAction, false),
new ActionFactory.ShiftLineAction(shiftLineRightAction, true),
new ActionFactory.AdjustWindowAction(adjustWindowTopAction, 0),
new ActionFactory.AdjustWindowAction(adjustWindowCenterAction, 50),
new ActionFactory.AdjustWindowAction(adjustWindowBottomAction, 100),
new ActionFactory.AdjustCaretAction(adjustCaretTopAction, 0),
new ActionFactory.AdjustCaretAction(adjustCaretCenterAction, 50),
new ActionFactory.AdjustCaretAction(adjustCaretBottomAction, 100),
new ActionFactory.FormatAction(),
new ActionFactory.FirstNonWhiteAction(firstNonWhiteAction, false),
new ActionFactory.FirstNonWhiteAction(selectionFirstNonWhiteAction, true),
new ActionFactory.LastNonWhiteAction(lastNonWhiteAction, false),
new ActionFactory.LastNonWhiteAction(selectionLastNonWhiteAction, true),
new ActionFactory.SelectIdentifierAction(),
new ActionFactory.SelectNextParameterAction(),
new ActionFactory.JumpListPrevAction(),
new ActionFactory.JumpListNextAction(),
new ActionFactory.JumpListPrevComponentAction(),
new ActionFactory.JumpListNextComponentAction(),
new ActionFactory.ScrollUpAction(),
new ActionFactory.ScrollDownAction(),
new ActionFactory.StartMacroRecordingAction(),
new ActionFactory.StopMacroRecordingAction(),
new ActionFactory.InsertDateTimeAction(),
new ActionFactory.GenerateGutterPopupAction(),
new ActionFactory.ToggleLineNumbersAction(),
new ActionFactory.AnnotationsCyclingAction()
// Self test actions
// new EditorDebug.SelfTestAction(),
// new EditorDebug.DumpPlanesAction(),
// new EditorDebug.DumpSyntaxMarksAction()
};
}
protected Action[] getCustomActions()
{
Settings.KitAndValue kv[] = Settings.getValueHierarchy(
this.getClass(), SettingsNames.CUSTOM_ACTION_LIST);
if (kv.length == 0)
{
return null;
}
if (kv.length == 1)
{
List l = (List) kv[0].value;
return (Action[]) l.toArray(new Action[l.size()]);
}
// more than one list of actions
List l = new ArrayList();
for (int i = kv.length - 1; i >= 0; i--)
{ // from BaseKit down
l.addAll((List) kv[i].value);
}
return (Action[]) l.toArray(new Action[l.size()]);
}
protected Action[] getMacroActions()
{
Class kitClass = this.getClass();
Map macroMap = (Map) Settings.getValue(kitClass, SettingsNames.MACRO_MAP);
if (macroMap == null) return null;
List actions = new ArrayList();
for (Iterator it = macroMap.keySet().iterator(); it.hasNext();)
{
String macroName = (String) it.next();
actions.add(new ActionFactory.RunMacroAction(macroName));
}
return (Action[]) actions.toArray(new Action[actions.size()]);
}
/** Get actions associated with this kit. createActions() is called
* to get basic list and then customActions are added.
*/
public final Action[] getActions()
{
synchronized (Settings.class)
{ // possibly long running code follows
Class thisClass = this.getClass();
Action[] actions = (Action[]) kitActions.get(thisClass);
if (actions == null)
{
// create map of actions
Action[] createdActions = createActions();
updateActionSettings(createdActions, null, thisClass);
Map actionMap = actionsToMap(createdActions);
// add custom actions
Action[] customActions = getCustomActions();
if (customActions != null)
{
updateActionSettings(customActions, null, thisClass);
actionMap.putAll(actionsToMap(customActions));
}
Action[] macroActions = getMacroActions();
if (macroActions != null)
{
updateActionSettings(macroActions, null, thisClass);
actionMap.putAll(actionsToMap(macroActions));
}
// store for later use
kitActionMaps.put(thisClass, actionMap);
// create action array and store for later use
actions = mapToActions(actionMap);
kitActions.put(thisClass, actions);
// At this moment the actions are constructed completely
// The actions will be updated now if necessary
updateActions();
}
return actions;
}
}
Map getActionMap()
{
Map actionMap = (Map) kitActionMaps.get(this.getClass());
if (actionMap == null)
{
getActions(); // init action map
actionMap = (Map) kitActionMaps.get(this.getClass());
// Fix of #27418
if (actionMap == null)
{
actionMap = Collections.EMPTY_MAP;
}
}
return actionMap;
}
/** Update the actions right after their creation was finished.
* The <code>getActions()</code> and <code>getActionByName()</code>
* can be used safely in this method.
* The implementation must call <code>super.updateActions()</code> so that
* the updating in parent is performed too.
*/
protected void updateActions()
{
}
/** Get action from its name. */
public Action getActionByName(String name)
{
return (name != null) ? (Action) getActionMap().get(name) : null;
}
public List translateActionNameList(List actionNameList)
{
List ret = new ArrayList();
if (actionNameList != null)
{
Iterator i = actionNameList.iterator();
while (i.hasNext())
{
Action a = getActionByName((String) i.next());
if (a != null)
{
ret.add(a);
}
}
}
return ret;
}
/** Default typed action */
public static class DefaultKeyTypedAction extends BaseAction
{
static final long serialVersionUID = 3069164318144463899L;
public DefaultKeyTypedAction()
{
super(defaultKeyTypedAction, MAGIC_POSITION_RESET | SAVE_POSITION
| CLEAR_STATUS_TEXT);
}
private static final boolean isMac = System.getProperty("mrj.version") != null; //NOI18N
public void actionPerformed(ActionEvent evt, JTextComponent target) {
if ((target != null) && (evt != null)) {
// Check whether the modifiers are OK
int mod = evt.getModifiers();
boolean ctrl = ((mod & ActionEvent.CTRL_MASK) != 0);
// On the mac, norwegian and french keyboards use Alt to do bracket characters.
// This replicates Apple's modification DefaultEditorKit.DefaultKeyTypedAction
boolean alt = isMac ? ((mod & ActionEvent.META_MASK) != 0) :
((mod & ActionEvent.ALT_MASK) != 0);
if (alt || ctrl) {
return;
}
// Check whether the target is enabled and editable
if (!target.isEditable() || !target.isEnabled()) {
target.getToolkit().beep();
return;
}
Caret caret = target.getCaret();
BaseDocument doc = (BaseDocument)target.getDocument();
EditorUI editorUI = Utilities.getEditorUI(target);
// determine if typed char is valid
String cmd = evt.getActionCommand();
if ((cmd != null) && (cmd.length() == 1)) {
// Utilities.clearStatusText(target);
doc.atomicLock();
// DocumentUtilities.setTypingModification(doc, true);
try {
char ch = cmd.charAt(0);
if ((ch >= 0x20) && (ch != 0x7F)) { // valid character
editorUI.getWordMatch().clear(); // reset word matching
Boolean overwriteMode = (Boolean)editorUI.getProperty(
EditorUI.OVERWRITE_MODE_PROPERTY);
try {
boolean doInsert = true; // editorUI.getAbbrev().checkAndExpand(ch, evt);
if (doInsert) {
if (caret.isSelectionVisible()) { // valid selection
boolean ovr = (overwriteMode != null && overwriteMode.booleanValue());
replaceSelection(target, caret.getDot(), caret, cmd, ovr);
} else { // no selection
int dotPos = caret.getDot();
if (overwriteMode != null && overwriteMode.booleanValue()
&& dotPos < doc.getLength() && doc.getChars(dotPos, 1)[0] != '\n'
) { // overwrite current char
doc.atomicLock();
try {
insertString(doc, dotPos, caret, cmd, true);
} finally {
doc.atomicUnlock();
}
} else { // insert mode
doc.atomicLock();
try {
insertString(doc, dotPos, caret, cmd, false);
} finally {
doc.atomicUnlock();
}
}
}
}
} catch (BadLocationException e) {
target.getToolkit().beep();
}
}
checkIndent(target, cmd);
} finally {
// DocumentUtilities.setTypingModification(doc, false);
doc.atomicUnlock();
}
}
}
}
/**
* Hook to insert the given string at the given position into
* the given document in insert-mode, no selection, writeable
* document. Designed to be overridden by subclasses that want
* to intercept inserted characters.
*/
protected void insertString(BaseDocument doc,
int dotPos,
Caret caret,
String str,
boolean overwrite)
throws BadLocationException
{
if (overwrite) doc.remove(dotPos, 1);
doc.insertString(dotPos, str, null);
}
/**
* Hook to insert the given string at the given position into
* the given document in insert-mode with selection visible
* Designed to be overridden by subclasses that want
* to intercept inserted characters.
*/
protected void replaceSelection(JTextComponent target,
int dotPos,
Caret caret,
String str,
boolean overwrite)
throws BadLocationException
{
target.replaceSelection(str);
}
/** Check whether there was any important character typed
* so that the line should be possibly reformatted.
*/
protected void checkIndent(JTextComponent target, String typedText)
{
}
}
public static class InsertBreakAction extends BaseAction
{
static final long serialVersionUID = 7966576342334158659L;
public InsertBreakAction()
{
super(insertBreakAction, MAGIC_POSITION_RESET | ABBREV_RESET | WORD_MATCH_RESET);
}
public void actionPerformed(ActionEvent evt, JTextComponent target)
{
if (target != null)
{
if (!target.isEditable() || !target.isEnabled())
{
target.getToolkit().beep();
return;
}
target.replaceSelection("");
Caret caret = target.getCaret();
int dotPos = caret.getDot();
BaseDocument doc = (BaseDocument) target.getDocument();
dotPos = doc.getFormatter().indentNewLine(doc, dotPos);
caret.setDot(dotPos);
}
}
}
public static class InsertTabAction extends BaseAction
{
static final long serialVersionUID = -3379768531715989243L;
public InsertTabAction()
{
super(insertTabAction, MAGIC_POSITION_RESET | ABBREV_RESET | WORD_MATCH_RESET);
}
public void actionPerformed(ActionEvent evt, JTextComponent target)
{
if (target != null)
{
if (!target.isEditable() || !target.isEnabled())
{
target.getToolkit().beep();
return;
}
Caret caret = target.getCaret();
BaseDocument doc = (BaseDocument) target.getDocument();
if (caret.isSelectionVisible())
{ // block selected
try
{
doc.getFormatter().changeBlockIndent(doc,
target.getSelectionStart(), target.getSelectionEnd(), +1);
}
catch (GuardedException e)
{
target.getToolkit().beep();
}
catch (BadLocationException e)
{
e.printStackTrace();
}
}
else
{ // no selected text
int dotPos = caret.getDot();
int caretCol;
// find caret column
try
{
caretCol = doc.getVisColFromPos(dotPos);
}
catch (BadLocationException e)
{
if (Boolean.getBoolean("netbeans.debug.exceptions"))
{ // NOI18N
e.printStackTrace();
}
caretCol = 0;
}
try
{
// find indent of the first previous non-white row
int upperCol = Utilities.getRowIndent(doc, dotPos, false);
if (upperCol == -1)
{ // no prev line with indent
upperCol = 0;
}
// is there any char on this line before cursor?
int indent = Utilities.getRowIndent(doc, dotPos);
// test whether we should indent
if (indent == -1)
{
if (upperCol > caretCol)
{ // upper indent is greater
indent = upperCol;
}
else
{ // simulate insert tab by changing indent
indent = Utilities.getNextTabColumn(doc, dotPos);
}
// Fix of #32240 - #1 of 2
int rowStart = Utilities.getRowStart(doc, dotPos);
doc.getFormatter().changeRowIndent(doc, dotPos, indent);
// Fix of #32240 - #2 of 2
int newDotPos = doc.getOffsetFromVisCol(indent, rowStart);
if (newDotPos >= 0)
{
caret.setDot(newDotPos);
}
}
else
{ // already chars on the line
doc.getFormatter().insertTabString(doc, dotPos);
}
}
catch (BadLocationException e)
{
// use the same pos
}
}
}
}
}
/** Compound action that encapsulates several actions */
public static class CompoundAction extends BaseAction
{
Action[] actions;
static final long serialVersionUID = 1649688300969753758L;
public CompoundAction(String nm, Action actions[])
{
this(nm, 0, actions);
}
public CompoundAction(String nm, int resetMask, Action actions[])
{
super(nm, resetMask);
this.actions = actions;
}
public void actionPerformed(ActionEvent evt, JTextComponent target)
{
if (target != null)
{
for (int i = 0; i < actions.length; i++)
{
Action a = actions[i];
if (a instanceof BaseAction)
{
((BaseAction) a).actionPerformed(evt, target);
}
else
{
a.actionPerformed(evt);
}
}
}
}
}
/** Compound action that gets and executes its actions
* depending on the kit of the component.
* The other advantage is that it doesn't create additional
* instances of compound actions.
*/
public static class KitCompoundAction extends BaseAction
{
private String[] actionNames;
static final long serialVersionUID = 8415246475764264835L;
public KitCompoundAction(String nm, String actionNames[])
{
this(nm, 0, actionNames);
}
public KitCompoundAction(String nm, int resetMask, String actionNames[])
{
super(nm, resetMask);
this.actionNames = actionNames;
}
public void actionPerformed(ActionEvent evt, JTextComponent target)
{
if (target != null)
{
BaseKit kit = Utilities.getKit(target);
if (kit != null)
{
for (int i = 0; i < actionNames.length; i++)
{
Action a = kit.getActionByName(actionNames[i]);
if (a != null)
{
if (a instanceof BaseAction)
{
((BaseAction) a).actionPerformed(evt, target);
}
else
{
a.actionPerformed(evt);
}
}
}
}
}
}
}
public static class InsertContentAction extends BaseAction
{
static final long serialVersionUID = 5647751370952797218L;
public InsertContentAction()
{
super(insertContentAction, MAGIC_POSITION_RESET | ABBREV_RESET
| WORD_MATCH_RESET);
}
public void actionPerformed(ActionEvent evt, JTextComponent target)
{
if ((target != null) && (evt != null))
{
if (!target.isEditable() || !target.isEnabled())
{
target.getToolkit().beep();
return;
}
String content = evt.getActionCommand();
if (content != null)
{
target.replaceSelection(content);
}
else
{
target.getToolkit().beep();
}
}
}
}
/** Insert text specified in constructor */
public static class InsertStringAction extends BaseAction
{
String text;
static final long serialVersionUID = -2755852016584693328L;
public InsertStringAction(String nm, String text)
{
super(nm, MAGIC_POSITION_RESET | ABBREV_RESET | WORD_MATCH_RESET);
this.text = text;
}
public void actionPerformed(ActionEvent evt, JTextComponent target)
{
if (target != null)
{
if (!target.isEditable() || !target.isEnabled())
{
target.getToolkit().beep();
return;
}
target.replaceSelection(text);
}
}
}
/** Remove previous or next character */
public static class DeleteCharAction extends BaseAction
{
boolean nextChar;
static final long serialVersionUID = -4321971925753148556L;
public DeleteCharAction(String nm, boolean nextChar)
{
super(nm, MAGIC_POSITION_RESET | ABBREV_RESET | WORD_MATCH_RESET);
this.nextChar = nextChar;
}
public void actionPerformed(ActionEvent evt, JTextComponent target)
{
if (target != null)
{
if (!target.isEditable() || !target.isEnabled())
{
target.getToolkit().beep();
return;
}
try
{
Document doc = target.getDocument();
Caret caret = target.getCaret();
int dot = caret.getDot();
int mark = caret.getMark();
if (dot != mark)
{ // remove selection
doc.remove(Math.min(dot, mark), Math.abs(dot - mark));
}
else
{
if (nextChar)
{ // remove next char
doc.remove(dot, 1);
}
else
{ // remove previous char
doc.remove(dot - 1, 1);
}
}
}
catch (BadLocationException e)
{
target.getToolkit().beep();
}
}
}
}
public static class ReadOnlyAction extends BaseAction
{
static final long serialVersionUID = 9204335480208463193L;
public ReadOnlyAction()
{
super(readOnlyAction);
}
public void actionPerformed(ActionEvent evt, JTextComponent target)
{
if (target != null)
{
target.setEditable(false);
}
}
}
public static class WritableAction extends BaseAction
{
static final long serialVersionUID = -5982547952800937954L;
public WritableAction()
{
super(writableAction);
}
public void actionPerformed(ActionEvent evt, JTextComponent target)
{
if (target != null)
{
target.setEditable(true);
}
}
}
public static class CutAction extends BaseAction
{
static final long serialVersionUID = 6377157040901778853L;
public CutAction()
{
super(cutAction, ABBREV_RESET | UNDO_MERGE_RESET | WORD_MATCH_RESET);
setEnabled(false);
putValue("helpID", CutAction.class.getName());
}
public void actionPerformed(ActionEvent evt, JTextComponent target)
{
if (target != null)
{
if (!target.isEditable() || !target.isEnabled())
{
target.getToolkit().beep();
return;
}
target.cut();
}
}
}
public static class CopyAction extends BaseAction
{
static final long serialVersionUID = -5119779005431986964L;
public CopyAction()
{
super(copyAction, ABBREV_RESET | UNDO_MERGE_RESET | WORD_MATCH_RESET);
setEnabled(false);
putValue("helpID", CopyAction.class.getName());
}
public void actionPerformed(ActionEvent evt, JTextComponent target)
{
if (target != null)
{
target.copy();
}
}
}
public static class PasteAction extends BaseAction
{
static final long serialVersionUID = 5839791453996432149L;
public PasteAction()
{
super(pasteAction, ABBREV_RESET | UNDO_MERGE_RESET | WORD_MATCH_RESET);
putValue("helpID", PasteAction.class.getName());
}
public void actionPerformed(ActionEvent evt, JTextComponent target)
{
if (target != null)
{
if (!target.isEditable() || !target.isEnabled())
{
target.getToolkit().beep();
return;
}
BaseDocument doc = Utilities.getDocument(target);
if (doc != null)
{
doc.atomicLock();
}
try
{
target.paste();
}
catch (Exception e)
{
target.getToolkit().beep();
}
finally
{
if (doc != null)
{
doc.atomicUnlock();
}
}
}
}
}
public static class BeepAction extends BaseAction
{
static final long serialVersionUID = -4474054576633223968L;
public BeepAction()
{
super(beepAction);
}
public void actionPerformed(ActionEvent evt, JTextComponent target)
{
if (target != null)
{
target.getToolkit().beep();
}
}
}
public static class UpAction extends BaseAction
{
boolean select;
static final long serialVersionUID = 4621760742646981563L;
public UpAction(String nm, boolean select)
{
super(nm, ABBREV_RESET | UNDO_MERGE_RESET | WORD_MATCH_RESET
| CLEAR_STATUS_TEXT);
this.select = select;
}
public void actionPerformed(ActionEvent evt, JTextComponent target)
{
if (target != null)
{
try
{
Caret caret = target.getCaret();
int dot = caret.getDot();
Point p = caret.getMagicCaretPosition();
if (p == null)
{
Rectangle r = target.modelToView(dot);
p = new Point(r.x, r.y);
caret.setMagicCaretPosition(p);
}
try
{
dot = Utilities.getPositionAbove(target, dot, p.x);
if (select)
{
caret.moveDot(dot);
}
else
{
if (caret instanceof BaseCaret)
{
BaseCaret bCaret = (BaseCaret) caret;
bCaret.setDot(dot, bCaret, EditorUI.SCROLL_MOVE);
}
else
{
caret.setDot(dot);
}
}
}
catch (BadLocationException e)
{
// the position stays the same
}
}
catch (BadLocationException ex)
{
target.getToolkit().beep();
}
}
}
}
public static class DownAction extends BaseAction
{
boolean select;
static final long serialVersionUID = -5635702355125266822L;
public DownAction(String nm, boolean select)
{
super(nm, ABBREV_RESET | UNDO_MERGE_RESET | WORD_MATCH_RESET
| CLEAR_STATUS_TEXT);
this.select = select;
}
public void actionPerformed(ActionEvent evt, JTextComponent target)
{
if (target != null)
{
try
{
Caret caret = target.getCaret();
int dot = caret.getDot();
Point p = caret.getMagicCaretPosition();
if (p == null)
{
Rectangle r = target.modelToView(dot);
p = new Point(r.x, r.y);
caret.setMagicCaretPosition(p);
}
try
{
dot = Utilities.getPositionBelow(target, dot, p.x);
if (select)
{
caret.moveDot(dot);
}
else
{
if (caret instanceof BaseCaret)
{
BaseCaret bCaret = (BaseCaret) caret;
bCaret.setDot(dot, bCaret, EditorUI.SCROLL_MOVE);
}
else
{
caret.setDot(dot);
}
}
}
catch (BadLocationException e)
{
// position stays the same
}
}
catch (BadLocationException ex)
{
target.getToolkit().beep();
}
}
}
}
/** Go one page up */
public static class PageUpAction extends BaseAction
{
boolean select;
static final long serialVersionUID = -3107382148581661079L;
public PageUpAction(String nm, boolean select)
{
super(nm, ABBREV_RESET | UNDO_MERGE_RESET | WORD_MATCH_RESET
| CLEAR_STATUS_TEXT);
this.select = select;
}
public void actionPerformed(ActionEvent evt, JTextComponent target)
{
if (target != null)
{
try
{
Caret caret = target.getCaret();
BaseDocument doc = (BaseDocument) target.getDocument();
int dot = caret.getDot();
Rectangle tgtRect = ((BaseTextUI) target.getUI()).modelToView(target, dot);
Point p = caret.getMagicCaretPosition();
if (p == null)
{
p = new Point((int) tgtRect.x, (int) tgtRect.y);
caret.setMagicCaretPosition(p);
}
else
{
p.y = (int) tgtRect.y;
}
EditorUI editorUI = ((BaseTextUI) target.getUI()).getEditorUI();
Rectangle bounds = editorUI.getExtentBounds();
int trHeight = Math.max(tgtRect.height, 1); // prevent division by zero
int baseY = (bounds.y + trHeight - 1) / trHeight * trHeight;
int lines = (int) (bounds.height / trHeight);
int baseHeight = lines * trHeight;
tgtRect.y = Math.max(baseY - baseHeight, 0);
tgtRect.height = bounds.height;
p.y = (int) Math.max(p.y - baseHeight, 0);
int newDot = target.viewToModel(p);
editorUI.scrollRectToVisible(tgtRect, EditorUI.SCROLL_DEFAULT);
if (select)
{
caret.moveDot(newDot);
}
else
{
caret.setDot(newDot);
}
}
catch (BadLocationException ex)
{
target.getToolkit().beep();
}
}
}
}
public static class ForwardAction extends BaseAction
{
boolean select;
static final long serialVersionUID = 8007293230193334414L;
public ForwardAction(String nm, boolean select)
{
super(nm, MAGIC_POSITION_RESET | ABBREV_RESET | UNDO_MERGE_RESET
| WORD_MATCH_RESET | CLEAR_STATUS_TEXT);
this.select = select;
}
public void actionPerformed(ActionEvent evt, JTextComponent target)
{
if (target != null)
{
Caret caret = target.getCaret();
try
{
int pos;
if (!select && caret.isSelectionVisible())
{
pos = target.getSelectionEnd();
if (pos != caret.getDot())
pos--;
}
else
pos = caret.getDot();
int dot = target.getUI().getNextVisualPositionFrom(target,
pos, null, SwingConstants.EAST, null);
if (select)
{
caret.moveDot(dot);
}
else
{
caret.setDot(dot);
}
}
catch (BadLocationException ex)
{
target.getToolkit().beep();
}
}
}
}
/** Go one page down */
public static class PageDownAction extends BaseAction
{
boolean select;
static final long serialVersionUID = 8942534850985048862L;
public PageDownAction(String nm, boolean select)
{
super(nm, ABBREV_RESET | UNDO_MERGE_RESET | WORD_MATCH_RESET
| CLEAR_STATUS_TEXT);
this.select = select;
}
public void actionPerformed(ActionEvent evt, JTextComponent target)
{
if (target != null)
{
try
{
Caret caret = target.getCaret();
BaseDocument doc = (BaseDocument) target.getDocument();
int dot = caret.getDot();
Rectangle tgtRect = ((BaseTextUI) target.getUI()).modelToView(target, dot);
Point p = caret.getMagicCaretPosition();
if (p == null)
{
p = new Point(tgtRect.x, tgtRect.y);
caret.setMagicCaretPosition(p);
}
else
{
p.y = tgtRect.y;
}
EditorUI editorUI = ((BaseTextUI) target.getUI()).getEditorUI();
Rectangle bounds = editorUI.getExtentBounds();
int trHeight = Math.max(tgtRect.height, 1); // prevent division by zero
int baseY = bounds.y / trHeight * trHeight;
int lines = bounds.height / trHeight;
int baseHeight = lines * trHeight;
tgtRect.y = Math.max(baseY + baseHeight, 0);
tgtRect.height = bounds.height;
p.y = Math.max(p.y + baseHeight, 0);
int newDot = target.viewToModel(p);
editorUI.scrollRectToVisible(tgtRect, EditorUI.SCROLL_DEFAULT);
if (select)
{
caret.moveDot(newDot);
}
else
{
if (caret instanceof BaseCaret)
{
BaseCaret bCaret = (BaseCaret) caret;
bCaret.setDot(newDot, bCaret, EditorUI.SCROLL_MOVE);
}
else
{
caret.setDot(newDot);
}
}
}
catch (BadLocationException ex)
{
target.getToolkit().beep();
}
}
}
}
public static class BackwardAction extends BaseAction
{
boolean select;
static final long serialVersionUID = -3048379822817847356L;
public BackwardAction(String nm, boolean select)
{
super(nm, MAGIC_POSITION_RESET | ABBREV_RESET | UNDO_MERGE_RESET
| WORD_MATCH_RESET | CLEAR_STATUS_TEXT);
this.select = select;
}
public void actionPerformed(ActionEvent evt, JTextComponent target)
{
if (target != null)
{
Caret caret = target.getCaret();
try
{
int pos;
if (!select && caret.isSelectionVisible())
{
pos = target.getSelectionStart();
if (pos != caret.getDot())
pos++;
}
else
pos = caret.getDot();
int dot = target.getUI().getNextVisualPositionFrom(target,
pos, null, SwingConstants.WEST, null);
if (select)
{
caret.moveDot(dot);
}
else
{
if (caret instanceof BaseCaret)
{
BaseCaret bCaret = (BaseCaret) caret;
bCaret.setDot(dot, bCaret, EditorUI.SCROLL_MOVE);
}
else
{
caret.setDot(dot);
}
}
}
catch (BadLocationException ex)
{
target.getToolkit().beep();
}
}
}
}
public static class BeginLineAction extends BaseAction
{
protected boolean select;
/** Whether the action should go to the begining of
* the text on the line or to the first column on the line*/
boolean homeKeyColumnOne;
static final long serialVersionUID = 3269462923524077779L;
public BeginLineAction(String nm, boolean select)
{
super(nm, MAGIC_POSITION_RESET | ABBREV_RESET | UNDO_MERGE_RESET
| WORD_MATCH_RESET | CLEAR_STATUS_TEXT);
this.select = select;
homeKeyColumnOne = false;
}
public BeginLineAction(String nm, boolean select, boolean columnOne)
{
this(nm, select);
homeKeyColumnOne = columnOne;
}
public void actionPerformed(ActionEvent evt, JTextComponent target)
{
if (target != null)
{
Caret caret = target.getCaret();
BaseDocument doc = (BaseDocument) target.getDocument();
try
{
int dot = caret.getDot();
int lineStartPos = Utilities.getRowStart(doc, dot, 0);
if (homeKeyColumnOne)
{ // to first column
dot = lineStartPos;
}
else
{ // either to line start or text start
int textStartPos = Utilities.getRowFirstNonWhite(doc, lineStartPos);
if (textStartPos < 0)
{ // no text on the line
textStartPos = Utilities.getRowEnd(doc, lineStartPos);
}
if (dot == lineStartPos)
{ // go to the text start pos
dot = textStartPos;
}
else if (dot <= textStartPos)
{
dot = lineStartPos;
}
else
{
dot = textStartPos;
}
}
if (select)
{
caret.moveDot(dot);
}
else
{
caret.setDot(dot);
}
}
catch (BadLocationException e)
{
target.getToolkit().beep();
}
}
}
}
public static class EndLineAction extends BaseAction
{
protected boolean select;
static final long serialVersionUID = 5216077634055190170L;
public EndLineAction(String nm, boolean select)
{
super(nm, MAGIC_POSITION_RESET | ABBREV_RESET | UNDO_MERGE_RESET
| WORD_MATCH_RESET | CLEAR_STATUS_TEXT);
this.select = select;
}
public void actionPerformed(ActionEvent evt, JTextComponent target)
{
if (target != null)
{
Caret caret = target.getCaret();
try
{
int dot = Utilities.getRowEnd(target, caret.getDot());
if (select)
{
caret.moveDot(dot);
}
else
{
caret.setDot(dot);
}
// now move the magic caret position far to the right
Rectangle r = target.modelToView(dot);
Point p = new Point(Integer.MAX_VALUE / 2, r.y);
caret.setMagicCaretPosition(p);
}
catch (BadLocationException e)
{
target.getToolkit().beep();
}
}
}
}
public static class BeginAction extends BaseAction
{
boolean select;
static final long serialVersionUID = 3463563396210234361L;
public BeginAction(String nm, boolean select)
{
super(nm, MAGIC_POSITION_RESET | ABBREV_RESET | UNDO_MERGE_RESET
| WORD_MATCH_RESET | SAVE_POSITION | CLEAR_STATUS_TEXT);
this.select = select;
}
public void actionPerformed(ActionEvent evt, JTextComponent target)
{
if (target != null)
{
Caret caret = target.getCaret();
int dot = 0; // begin of document
if (select)
{
caret.moveDot(dot);
}
else
{
caret.setDot(dot);
}
}
}
}
public static class EndAction extends BaseAction
{
boolean select;
static final long serialVersionUID = 8547506353130203657L;
public EndAction(String nm, boolean select)
{
super(nm, MAGIC_POSITION_RESET | ABBREV_RESET | UNDO_MERGE_RESET
| WORD_MATCH_RESET | SAVE_POSITION | CLEAR_STATUS_TEXT);
this.select = select;
}
public void actionPerformed(ActionEvent evt, JTextComponent target)
{
if (target != null)
{
Caret caret = target.getCaret();
int dot = target.getDocument().getLength(); // end of document
if (select)
{
caret.moveDot(dot);
}
else
{
caret.setDot(dot);
}
}
}
}
public static class NextWordAction extends BaseAction
{
boolean select;
static final long serialVersionUID = -5909906947175434032L;
public NextWordAction(String nm, boolean select)
{
super(nm, MAGIC_POSITION_RESET | ABBREV_RESET | UNDO_MERGE_RESET
| WORD_MATCH_RESET | CLEAR_STATUS_TEXT);
this.select = select;
}
public void actionPerformed(ActionEvent evt, JTextComponent target)
{
if (target != null)
{
Caret caret = target.getCaret();
try
{
int dotPos = caret.getDot();
dotPos = Utilities.getNextWord(target, dotPos);
if (select)
{
caret.moveDot(dotPos);
}
else
{
caret.setDot(dotPos);
}
}
catch (BadLocationException ex)
{
target.getToolkit().beep();
}
}
}
}
public static class PreviousWordAction extends BaseAction
{
boolean select;
static final long serialVersionUID = -5465143382669785799L;
public PreviousWordAction(String nm, boolean select)
{
super(nm, MAGIC_POSITION_RESET | ABBREV_RESET | UNDO_MERGE_RESET
| WORD_MATCH_RESET | CLEAR_STATUS_TEXT);
this.select = select;
}
public void actionPerformed(ActionEvent evt, JTextComponent target)
{
if (target != null)
{
Caret caret = target.getCaret();
try
{
int dot = Utilities.getPreviousWord(target, caret.getDot());
if (select)
{
caret.moveDot(dot);
}
else
{
caret.setDot(dot);
}
}
catch (BadLocationException ex)
{
target.getToolkit().beep();
}
}
}
}
public static class BeginWordAction extends BaseAction
{
boolean select;
static final long serialVersionUID = 3991338381212491110L;
public BeginWordAction(String nm, boolean select)
{
super(nm, MAGIC_POSITION_RESET | ABBREV_RESET | UNDO_MERGE_RESET
| WORD_MATCH_RESET | CLEAR_STATUS_TEXT);
this.select = select;
}
public void actionPerformed(ActionEvent evt, JTextComponent target)
{
if (target != null)
{
Caret caret = target.getCaret();
try
{
int dot = Utilities.getWordStart(target, caret.getDot());
if (select)
{
caret.moveDot(dot);
}
else
{
caret.setDot(dot);
}
}
catch (BadLocationException ex)
{
target.getToolkit().beep();
}
}
}
}
public static class EndWordAction extends BaseAction
{
boolean select;
static final long serialVersionUID = 3812523676620144633L;
public EndWordAction(String nm, boolean select)
{
super(nm, MAGIC_POSITION_RESET | ABBREV_RESET | UNDO_MERGE_RESET
| WORD_MATCH_RESET | CLEAR_STATUS_TEXT);
this.select = select;
}
public void actionPerformed(ActionEvent evt, JTextComponent target)
{
if (target != null)
{
Caret caret = target.getCaret();
try
{
int dot = Utilities.getWordEnd(target, caret.getDot());
if (select)
{
caret.moveDot(dot);
}
else
{
caret.setDot(dot);
}
}
catch (BadLocationException ex)
{
target.getToolkit().beep();
}
}
}
}
/** Select word around caret */
public static class SelectWordAction extends KitCompoundAction
{
static final long serialVersionUID = 7678848538073016357L;
public SelectWordAction()
{
super(selectWordAction,
new String[]{
beginWordAction,
selectionEndWordAction
}
);
}
}
/** Select line around caret */
public static class SelectLineAction extends KitCompoundAction
{
static final long serialVersionUID = -7407681863035740281L;
public SelectLineAction()
{
super(selectLineAction,
new String[]{
lineFirstColumnAction,
selectionEndLineAction,
selectionForwardAction
}
);
}
}
/** Select text of whole document */
public static class SelectAllAction extends KitCompoundAction
{
static final long serialVersionUID = -3502499718130556524L;
public SelectAllAction()
{
super(selectAllAction,
new String[]{
beginAction,
selectionEndAction
}
);
}
}
}
| {
"content_hash": "2545bec9a8ce2d4a4b7b3a9bc2574128",
"timestamp": "",
"source": "github",
"line_count": 2180,
"max_line_length": 119,
"avg_line_length": 35.12844036697248,
"alnum_prop": 0.481000261164795,
"repo_name": "CharlesSkelton/studio",
"id": "39ce75e3e2e5d5ad933430889ea1d017ed3ce107",
"size": "77058",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/org/netbeans/editor/BaseKit.java",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "1818"
},
{
"name": "Java",
"bytes": "7096773"
}
],
"symlink_target": ""
} |
require "luaScript/CocoStudioTest/CocoStudioGUITest/CocoStudioGUITest"
require "luaScript/CocoStudioTest/CocoStudioSceneTest/CocoStudioSceneTest"
require "luaScript/CocoStudioTest/CocoStudioArmatureTest/CocoStudioArmatureTest"
local LINE_SPACE = 40
local ITEM_TAG_BASIC = 1000
local cocoStudioTestItemNames =
{
{
itemTitle = "CocoStudioArmatureTest",
testScene = function ()
runArmatureTestScene()
end
},
{
itemTitle = "CocoStudioGUITest",
testScene = function ()
runCocosGUITestScene()
end
},
{
itemTitle = "CocoStudioSceneTest",
testScene = function ()
runCocosSceneTestScene()
end
},
}
local CocoStudioTestScene = class("CocoStudioTestScene")
CocoStudioTestScene.__index = CocoStudioTestScene
function CocoStudioTestScene.extend(target)
local t = tolua.getpeer(target)
if not t then
t = {}
tolua.setpeer(target, t)
end
setmetatable(t, CocoStudioTestScene)
return target
end
function CocoStudioTestScene:runThisTest()
--armatureSceneIdx = ArmatureTestIndex.TEST_COCOSTUDIO_WITH_SKELETON
--self:addChild(restartArmatureTest())
end
function CocoStudioTestScene.create()
local scene = CocoStudioTestScene.extend(cc.Scene:create())
return scene
end
local CocoStudioTestLayer = class("CocoStudioTestLayer")
CocoStudioTestLayer.__index = CocoStudioTestLayer
function CocoStudioTestLayer.extend(target)
local t = tolua.getpeer(target)
if not t then
t = {}
tolua.setpeer(target, t)
end
setmetatable(t, CocoStudioTestLayer)
return target
end
function CocoStudioTestLayer.onMenuCallback(tag,sender)
local index = sender:getZOrder() - ITEM_TAG_BASIC
cocoStudioTestItemNames[index].testScene()
end
function CocoStudioTestLayer:createMenu()
local winSize = cc.Director:getInstance():getWinSize()
local menu = cc.Menu:create()
menu:setPosition(cc.p(0,0))
cc.MenuItemFont:setFontName("Arial")
cc.MenuItemFont:setFontSize(24)
for i = 1, table.getn(cocoStudioTestItemNames) do
local menuItem = cc.MenuItemFont:create(cocoStudioTestItemNames[i].itemTitle)
menuItem:setPosition(cc.p(winSize.width / 2, winSize.height - (i + 1) * LINE_SPACE))
menuItem:registerScriptTapHandler(CocoStudioTestLayer.onMenuCallback)
menu:addChild(menuItem, ITEM_TAG_BASIC + i)
end
self:addChild(menu)
end
function CocoStudioTestLayer.create()
local layer = CocoStudioTestLayer.extend(cc.Layer:create())
if nil ~= layer then
layer:createMenu()
end
return layer
end
-------------------------------------
--CocoStudio Test
-------------------------------------
function CocoStudioTestMain()
local newScene = CocoStudioTestScene.create()
newScene:addChild(CreateBackMenuItem())
newScene:addChild(CocoStudioTestLayer.create())
newScene:runThisTest()
return newScene
end
| {
"content_hash": "09a1c453cbc5d21ac5a82e7608e253c2",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 92,
"avg_line_length": 26.92792792792793,
"alnum_prop": 0.694881231180997,
"repo_name": "mcodegeeks/OpenKODE-Framework",
"id": "f830bc194e436fa1a74a65846eea57f54a05d5cd",
"size": "2989",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "03_Tutorial/T02_XMCocos2D-v3-Lua/Resource/luaScript/CocoStudioTest/CocoStudioTest.lua",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "1292072"
},
{
"name": "C",
"bytes": "36964031"
},
{
"name": "C++",
"bytes": "86498790"
},
{
"name": "Cuda",
"bytes": "1295615"
},
{
"name": "GLSL",
"bytes": "244633"
},
{
"name": "Gnuplot",
"bytes": "1174"
},
{
"name": "HLSL",
"bytes": "153769"
},
{
"name": "HTML",
"bytes": "9848"
},
{
"name": "JavaScript",
"bytes": "1610772"
},
{
"name": "Lex",
"bytes": "83193"
},
{
"name": "Limbo",
"bytes": "2257"
},
{
"name": "Logos",
"bytes": "5463744"
},
{
"name": "Lua",
"bytes": "1094038"
},
{
"name": "Makefile",
"bytes": "69477"
},
{
"name": "Objective-C",
"bytes": "502497"
},
{
"name": "Objective-C++",
"bytes": "211576"
},
{
"name": "Perl",
"bytes": "12636"
},
{
"name": "Python",
"bytes": "170481"
},
{
"name": "Shell",
"bytes": "149"
},
{
"name": "Yacc",
"bytes": "40113"
}
],
"symlink_target": ""
} |
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "0a506549cb67081498fc59a96e588cf8",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.23076923076923,
"alnum_prop": 0.6917293233082706,
"repo_name": "mdoering/backbone",
"id": "8370b6a3c719b38f23cdc37e6018515fb22a1fc9",
"size": "206",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Asterales/Asteraceae/Hieracium mexicanum/ Syn. Pilosella mexicana/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
<?php
namespace AppBundle\Entity;
use AppBundle\Entity\Extensions\Timestampable;
use Doctrine\ORM\Mapping as ORM;
/**
* Class Matchday.
*
* @ORM\Entity(repositoryClass="AppBundle\Repository\MatchdayRepository")
* @ORM\Table(name="matchdays")
* @ORM\HasLifecycleCallbacks
*/
class Matchday
{
use Timestampable;
/**
* @var int
*
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @var Competition
*
* @ORM\ManyToOne(targetEntity="Competition", fetch="EAGER")
*/
private $competition;
/**
* @var Phase
*
* @ORM\ManyToOne(targetEntity="Phase", fetch="EAGER")
*/
private $phase;
/**
* @var string
*
* @ORM\Column(type="string")
*/
private $name;
/**
* @var string
*
* @ORM\Column(type="string")
*/
private $alias;
/**
* @var int
*
* @ORM\Column(type="integer")
*/
private $matchdayOrder;
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set name
*
* @param string $name
*
* @return Matchday
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* Get name
*
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Set alias
*
* @param string $alias
*
* @return Matchday
*/
public function setAlias($alias)
{
$this->alias = $alias;
return $this;
}
/**
* Get alias
*
* @return string
*/
public function getAlias()
{
return $this->alias;
}
/**
* Set matchdayOrder
*
* @param integer $matchdayOrder
*
* @return Matchday
*/
public function setMatchdayOrder($matchdayOrder)
{
$this->matchdayOrder = $matchdayOrder;
return $this;
}
/**
* Get matchdayOrder
*
* @return integer
*/
public function getMatchdayOrder()
{
return $this->matchdayOrder;
}
/**
* Set competition
*
* @param \AppBundle\Entity\Competition $competition
*
* @return Matchday
*/
public function setCompetition(\AppBundle\Entity\Competition $competition = null)
{
$this->competition = $competition;
return $this;
}
/**
* Get competition
*
* @return \AppBundle\Entity\Competition
*/
public function getCompetition()
{
return $this->competition;
}
/**
* Set phase
*
* @param \AppBundle\Entity\Phase $phase
*
* @return Matchday
*/
public function setPhase(\AppBundle\Entity\Phase $phase = null)
{
$this->phase = $phase;
return $this;
}
/**
* Get phase
*
* @return \AppBundle\Entity\Phase
*/
public function getPhase()
{
return $this->phase;
}
public function __toString()
{
return $this->getName();
}
}
| {
"content_hash": "8ab697100d115cf8fc4d40d5b83a7d55",
"timestamp": "",
"source": "github",
"line_count": 197,
"max_line_length": 85,
"avg_line_length": 16.131979695431472,
"alnum_prop": 0.5094398993077407,
"repo_name": "rjcorflo/pronosticapp-backend",
"id": "d5496aba05595cb2220186f67cfbb038a5165f3c",
"size": "3178",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/AppBundle/Entity/Matchday.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "3605"
},
{
"name": "CSS",
"bytes": "1105"
},
{
"name": "HTML",
"bytes": "9436"
},
{
"name": "PHP",
"bytes": "352596"
}
],
"symlink_target": ""
} |
#import "CSVStackView.h"
@interface CSVStackView()<UIGestureRecognizerDelegate>
@property (nonatomic, strong) UIPanGestureRecognizer * panRecognizer;
@property (nonatomic, strong) UITapGestureRecognizer * tapRecognizer;
@property (nonatomic, strong) NSMutableArray *viewRects;
@property (nonatomic) NSInteger countOfViews;
@property (nonatomic) NSInteger currentIndex;
@property (nonatomic) CGFloat firstX;
@property (nonatomic) CGFloat firstY;
@property (nonatomic) CGAffineTransform defaultTransform;
@property (nonatomic) CGFloat shift;
@end
@implementation CSVStackView
-(id)initWithCoder:(NSCoder *)aDecoder {
if(self = [super initWithCoder:aDecoder]){
_panRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePan:)];
_tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTap:)];
_viewRects = [NSMutableArray array];
}
return self;
}
#pragma mark - public methods
-(void)reloadData {
[[self subviews] makeObjectsPerformSelector:@selector(removeFromSuperview)];
_currentIndex = 0;
_countOfViews = [_delegate numberOfViews];
if([_shiftDelegate respondsToSelector:@selector(sizeOfShiftStack)]){
_shift = [_shiftDelegate sizeOfShiftStack];
}
[_viewRects removeAllObjects];
for (NSInteger i = 0; i < _countOfViews; i++) {
UIView *stackView = [_delegate stackView:self viewForRowAtIndex:i];
[self insertViewInStackWithView:stackView andIndex:i];
}
[self gestureUpdate];
}
-(void)insertViewInStackWithView:(UIView*)view andIndex:(NSInteger)index {
if(_shift && [_shiftDelegate respondsToSelector:@selector(stackItem:rectViewAtIndex:andShift:)]) {
CGRect frame = [_shiftDelegate stackItem:view rectViewAtIndex:index andShift:_shift];
[view setFrame:frame];
}
[_viewRects insertObject:NSStringFromCGRect(view.frame) atIndex:0];
[self insertSubview:view atIndex:0];
}
-(void)gestureUpdate {
[[[self subviews] lastObject] addGestureRecognizer:_panRecognizer];
[[[self subviews] lastObject] addGestureRecognizer:_tapRecognizer];
}
#pragma mark - UIPanGestureRecognizer
- (IBAction)handlePan:(UIPanGestureRecognizer *)recognizer {
__block CGPoint translation = [recognizer translationInView:recognizer.view];
CGFloat maxOffset = MIN(CGRectGetHeight(recognizer.view.frame), CGRectGetWidth(recognizer.view.frame));
if([recognizer state] == UIGestureRecognizerStateBegan) {
_firstX = [recognizer.view center].x;
_firstY = [recognizer.view center].y;
_defaultTransform = [recognizer.view transform];
}
switch (_typeSliding) {
case CSVStackViewTypeSlidingHorizontal: {
CGAffineTransform transform = CGAffineTransformMakeTranslation(_defaultTransform.tx, _defaultTransform.ty);
transform = CGAffineTransformRotate(transform, (translation.x / maxOffset));
recognizer.view.transform = transform;
translation = CGPointMake(_firstX+translation.x, _firstY);
}
break;
default:
translation = CGPointMake(_firstX+translation.x, _firstY+translation.y);
break;
}
[recognizer.view setCenter:translation];
CGFloat distance = [self distanceBetweenTwoPoints:CGPointMake(_firstX, _firstY) toPoint:translation];
if(_slidingTransparentEffect) {
CGFloat alpha = 1.0 - distance / (maxOffset / 2);
[recognizer.view setAlpha:MAX(alpha, 0.1)];
}
if([recognizer state] == UIGestureRecognizerStateEnded) {
BOOL isSliding = NO;
if (distance > maxOffset / 3) {
[self insertSubview:recognizer.view atIndex:0];
_currentIndex = _currentIndex >= (_countOfViews - 1) ? 0 : _currentIndex + 1;
isSliding = YES;
//willChangeView
if([_delegate respondsToSelector:@selector(stackView:willChangeViewAtIndex:)])
[_delegate stackView:self willChangeViewAtIndex:_currentIndex];
}
[UIView animateWithDuration:0.3 animations:^{
if(_typeSliding == CSVStackViewTypeSlidingHorizontal)
recognizer.view.transform = _defaultTransform;
if(isSliding) {
for (NSInteger i = 0; i < [[self subviews] count]; i++) {
CGRect rect = CGRectFromString(_viewRects[i]);
UIView *view = [self subviews][i];
[view setFrame:rect];
}
} else {
translation = CGPointMake(_firstX, _firstY);
[recognizer.view setCenter:translation];
}
if(_slidingTransparentEffect)
[recognizer.view setAlpha:1.0];
} completion:^(BOOL finished) {
[self gestureUpdate];
//didChangeView
if(isSliding && [_delegate respondsToSelector:@selector(stackView:didChangeViewAtIndex:)]) {
[_delegate stackView:self didChangeViewAtIndex:_currentIndex];
}
}];
}
}
- (IBAction)handleTap:(UIPanGestureRecognizer *)recognizer {
if([_delegate respondsToSelector:@selector(stackView:didSelectViewAtIndex:)])
[_delegate stackView:self didSelectViewAtIndex:_currentIndex];
}
#pragma mark - CGPoint helper
- (CGFloat)distanceBetweenTwoPoints:(CGPoint)fromPoint toPoint:(CGPoint)toPoint
{
float xDist = fromPoint.x - toPoint.x;
float yDist = fromPoint.y - toPoint.y;
float result = sqrt( pow(xDist,2) + pow(yDist,2) );
return result;
}
@end
| {
"content_hash": "af0f12572e4b0441ded46642396e7f99",
"timestamp": "",
"source": "github",
"line_count": 169,
"max_line_length": 123,
"avg_line_length": 35.10650887573964,
"alnum_prop": 0.6312152368110568,
"repo_name": "Djecksan/CustomStackView",
"id": "146bd99f53d2c68dd2fb15c9d286db1ef4cb7fce",
"size": "6162",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "CSVStackView/CSVStackView.m",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Objective-C",
"bytes": "15235"
},
{
"name": "Ruby",
"bytes": "632"
}
],
"symlink_target": ""
} |
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* Copyright 2012 Mozilla Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/* globals CustomStyle, PDFFindController, scrollIntoView */
/**
* TextLayerBuilder provides text-selection
* functionality for the PDF. It does this
* by creating overlay divs over the PDF
* text. This divs contain text that matches
* the PDF text they are overlaying. This
* object also provides for a way to highlight
* text that is being searched for.
*/
var TextLayerBuilder = function textLayerBuilder(options) {
var textLayerFrag = document.createDocumentFragment();
this.textLayerDiv = options.textLayerDiv;
this.layoutDone = false;
this.divContentDone = false;
this.pageIdx = options.pageIndex;
this.matches = [];
this.lastScrollSource = options.lastScrollSource;
if(typeof PDFFindController === 'undefined') {
window.PDFFindController = null;
}
if(typeof this.lastScrollSource === 'undefined') {
this.lastScrollSource = null;
}
this.beginLayout = function textLayerBuilderBeginLayout() {
this.textDivs = [];
this.renderingDone = false;
};
this.endLayout = function textLayerBuilderEndLayout() {
this.layoutDone = true;
this.insertDivContent();
};
this.renderLayer = function textLayerBuilderRenderLayer() {
var self = this;
var textDivs = this.textDivs;
var bidiTexts = this.textContent.bidiTexts;
var textLayerDiv = this.textLayerDiv;
var canvas = document.createElement('canvas');
var ctx = canvas.getContext('2d');
// No point in rendering so many divs as it'd make the browser unusable
// even after the divs are rendered
var MAX_TEXT_DIVS_TO_RENDER = 100000;
if (textDivs.length > MAX_TEXT_DIVS_TO_RENDER)
return;
for (var i = 0, ii = textDivs.length; i < ii; i++) {
var textDiv = textDivs[i];
if ('isWhitespace' in textDiv.dataset) {
continue;
}
textLayerFrag.appendChild(textDiv);
ctx.font = textDiv.style.fontSize + ' ' + textDiv.style.fontFamily;
var width = ctx.measureText(textDiv.textContent).width;
if (width > 0) {
var textScale = textDiv.dataset.canvasWidth / width;
var rotation = textDiv.dataset.angle;
var transform = 'scale(' + textScale + ', 1)';
transform = 'rotate(' + rotation + 'deg) ' + transform;
CustomStyle.setProp('transform' , textDiv, transform);
CustomStyle.setProp('transformOrigin' , textDiv, '0% 0%');
textLayerDiv.appendChild(textDiv);
}
}
this.renderingDone = true;
this.updateMatches();
textLayerDiv.appendChild(textLayerFrag);
};
this.setupRenderLayoutTimer = function textLayerSetupRenderLayoutTimer() {
// Schedule renderLayout() if user has been scrolling, otherwise
// run it right away
var RENDER_DELAY = 200; // in ms
var self = this;
var lastScroll = this.lastScrollSource === null ?
0 : this.lastScrollSource.lastScroll;
if (Date.now() - lastScroll > RENDER_DELAY) {
// Render right away
this.renderLayer();
} else {
// Schedule
if (this.renderTimer)
clearTimeout(this.renderTimer);
this.renderTimer = setTimeout(function() {
self.setupRenderLayoutTimer();
}, RENDER_DELAY);
}
};
this.appendText = function textLayerBuilderAppendText(geom) {
var textDiv = document.createElement('div');
// vScale and hScale already contain the scaling to pixel units
var fontHeight = geom.fontSize * Math.abs(geom.vScale);
textDiv.dataset.canvasWidth = geom.canvasWidth * Math.abs(geom.hScale);
textDiv.dataset.fontName = geom.fontName;
textDiv.dataset.angle = geom.angle * (180 / Math.PI);
textDiv.style.fontSize = fontHeight + 'px';
textDiv.style.fontFamily = geom.fontFamily;
textDiv.style.left = (geom.x + (fontHeight * Math.sin(geom.angle))) + 'px';
textDiv.style.top = (geom.y - (fontHeight * Math.cos(geom.angle))) + 'px';
// The content of the div is set in the `setTextContent` function.
this.textDivs.push(textDiv);
};
this.insertDivContent = function textLayerUpdateTextContent() {
// Only set the content of the divs once layout has finished, the content
// for the divs is available and content is not yet set on the divs.
if (!this.layoutDone || this.divContentDone || !this.textContent)
return;
this.divContentDone = true;
var textDivs = this.textDivs;
var bidiTexts = this.textContent.bidiTexts;
for (var i = 0; i < bidiTexts.length; i++) {
var bidiText = bidiTexts[i];
var textDiv = textDivs[i];
if (!/\S/.test(bidiText.str)) {
textDiv.dataset.isWhitespace = true;
continue;
}
textDiv.textContent = bidiText.str;
// bidiText.dir may be 'ttb' for vertical texts.
textDiv.dir = bidiText.dir;
}
this.setupRenderLayoutTimer();
};
this.setTextContent = function textLayerBuilderSetTextContent(textContent) {
this.textContent = textContent;
this.insertDivContent();
};
this.convertMatches = function textLayerBuilderConvertMatches(matches) {
var i = 0;
var iIndex = 0;
var bidiTexts = this.textContent.bidiTexts;
var end = bidiTexts.length - 1;
var queryLen = PDFFindController === null ?
0 : PDFFindController.state.query.length;
var lastDivIdx = -1;
var pos;
var ret = [];
// Loop over all the matches.
for (var m = 0; m < matches.length; m++) {
var matchIdx = matches[m];
// # Calculate the begin position.
// Loop over the divIdxs.
while (i !== end && matchIdx >= (iIndex + bidiTexts[i].str.length)) {
iIndex += bidiTexts[i].str.length;
i++;
}
// TODO: Do proper handling here if something goes wrong.
if (i == bidiTexts.length) {
console.error('Could not find matching mapping');
}
var match = {
begin: {
divIdx: i,
offset: matchIdx - iIndex
}
};
// # Calculate the end position.
matchIdx += queryLen;
// Somewhat same array as above, but use a > instead of >= to get the end
// position right.
while (i !== end && matchIdx > (iIndex + bidiTexts[i].str.length)) {
iIndex += bidiTexts[i].str.length;
i++;
}
match.end = {
divIdx: i,
offset: matchIdx - iIndex
};
ret.push(match);
}
return ret;
};
this.renderMatches = function textLayerBuilder_renderMatches(matches) {
// Early exit if there is nothing to render.
if (matches.length === 0) {
return;
}
var bidiTexts = this.textContent.bidiTexts;
var textDivs = this.textDivs;
var prevEnd = null;
var isSelectedPage = PDFFindController === null ?
false : (this.pageIdx === PDFFindController.selected.pageIdx);
var selectedMatchIdx = PDFFindController === null ?
-1 : PDFFindController.selected.matchIdx;
var highlightAll = PDFFindController === null ?
false : PDFFindController.state.highlightAll;
var infty = {
divIdx: -1,
offset: undefined
};
function beginText(begin, className) {
var divIdx = begin.divIdx;
var div = textDivs[divIdx];
div.textContent = '';
var content = bidiTexts[divIdx].str.substring(0, begin.offset);
var node = document.createTextNode(content);
if (className) {
var isSelected = isSelectedPage &&
divIdx === selectedMatchIdx;
var span = document.createElement('span');
span.className = className + (isSelected ? ' selected' : '');
span.appendChild(node);
div.appendChild(span);
return;
}
div.appendChild(node);
}
function appendText(from, to, className) {
var divIdx = from.divIdx;
var div = textDivs[divIdx];
var content = bidiTexts[divIdx].str.substring(from.offset, to.offset);
var node = document.createTextNode(content);
if (className) {
var span = document.createElement('span');
span.className = className;
span.appendChild(node);
div.appendChild(span);
return;
}
div.appendChild(node);
}
function highlightDiv(divIdx, className) {
textDivs[divIdx].className = className;
}
var i0 = selectedMatchIdx, i1 = i0 + 1, i;
if (highlightAll) {
i0 = 0;
i1 = matches.length;
} else if (!isSelectedPage) {
// Not highlighting all and this isn't the selected page, so do nothing.
return;
}
for (i = i0; i < i1; i++) {
var match = matches[i];
var begin = match.begin;
var end = match.end;
var isSelected = isSelectedPage && i === selectedMatchIdx;
var highlightSuffix = (isSelected ? ' selected' : '');
if (isSelected)
scrollIntoView(textDivs[begin.divIdx], {top: -50});
// Match inside new div.
if (!prevEnd || begin.divIdx !== prevEnd.divIdx) {
// If there was a previous div, then add the text at the end
if (prevEnd !== null) {
appendText(prevEnd, infty);
}
// clears the divs and set the content until the begin point.
beginText(begin);
} else {
appendText(prevEnd, begin);
}
if (begin.divIdx === end.divIdx) {
appendText(begin, end, 'highlight' + highlightSuffix);
} else {
appendText(begin, infty, 'highlight begin' + highlightSuffix);
for (var n = begin.divIdx + 1; n < end.divIdx; n++) {
highlightDiv(n, 'highlight middle' + highlightSuffix);
}
beginText(end, 'highlight end' + highlightSuffix);
}
prevEnd = end;
}
if (prevEnd) {
appendText(prevEnd, infty);
}
};
this.updateMatches = function textLayerUpdateMatches() {
// Only show matches, once all rendering is done.
if (!this.renderingDone)
return;
// Clear out all matches.
var matches = this.matches;
var textDivs = this.textDivs;
var bidiTexts = this.textContent.bidiTexts;
var clearedUntilDivIdx = -1;
// Clear out all current matches.
for (var i = 0; i < matches.length; i++) {
var match = matches[i];
var begin = Math.max(clearedUntilDivIdx, match.begin.divIdx);
for (var n = begin; n <= match.end.divIdx; n++) {
var div = textDivs[n];
div.textContent = bidiTexts[n].str;
div.className = '';
}
clearedUntilDivIdx = match.end.divIdx + 1;
}
if (PDFFindController === null || !PDFFindController.active)
return;
// Convert the matches on the page controller into the match format used
// for the textLayer.
this.matches = matches =
this.convertMatches(PDFFindController === null ?
[] : (PDFFindController.pageMatches[this.pageIdx] || []));
this.renderMatches(this.matches);
};
};
| {
"content_hash": "e39e9c57bc157182e30bd81b994d1e0c",
"timestamp": "",
"source": "github",
"line_count": 374,
"max_line_length": 80,
"avg_line_length": 30.8475935828877,
"alnum_prop": 0.6320533934298345,
"repo_name": "lentan1029/pdf.js",
"id": "db9b233f86a93299439f6818ee1577b32e6e2bcd",
"size": "11537",
"binary": false,
"copies": "4",
"ref": "refs/heads/1f232de",
"path": "web/text_layer_builder.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "43901"
},
{
"name": "JavaScript",
"bytes": "2252328"
},
{
"name": "Python",
"bytes": "43420"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2014 Commonwealth Computer Research, Inc.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<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">
<parent>
<artifactId>geomesa-convert-accumulo1.5</artifactId>
<groupId>org.locationtech.geomesa</groupId>
<version>1.0.0-rc.5-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>geomesa-convert-avro-accumulo1.5</artifactId>
<name>GeoMesa Convert Avro - [Accumulo 1.5.x]</name>
<dependencies>
<dependency>
<groupId>org.apache.avro</groupId>
<artifactId>avro</artifactId>
</dependency>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
</dependency>
<dependency>
<groupId>org.geotools</groupId>
<artifactId>gt-main</artifactId>
</dependency>
<dependency>
<groupId>com.typesafe</groupId>
<artifactId>config</artifactId>
</dependency>
<dependency>
<groupId>org.locationtech.geomesa</groupId>
<artifactId>geomesa-feature-accumulo1.5</artifactId>
</dependency>
<dependency>
<groupId>org.locationtech.geomesa</groupId>
<artifactId>geomesa-convert-common-accumulo1.5</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.specs2</groupId>
<artifactId>specs2_2.10</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
| {
"content_hash": "27c2b872a90daae9731ad7d0b60e85cb",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 204,
"avg_line_length": 37.507936507936506,
"alnum_prop": 0.6381718154887854,
"repo_name": "kevinwheeler/geomesa",
"id": "308880bd21d084706b2da2f09bd839d75aed8b70",
"size": "2363",
"binary": false,
"copies": "1",
"ref": "refs/heads/accumulo1.5.x/1.x",
"path": "geomesa-convert/geomesa-convert-avro/pom.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "18471"
},
{
"name": "Java",
"bytes": "16633"
},
{
"name": "JavaScript",
"bytes": "7418"
},
{
"name": "Scala",
"bytes": "1965825"
},
{
"name": "Shell",
"bytes": "11932"
}
],
"symlink_target": ""
} |
<h1 *ngIf="!usersResult.length">No users match this pattern!</h1>
<div *ngIf="usersResult.length">
<h1>Users that match the given pattern:</h1>
<ul class="list-group">
<li *ngFor="let user of usersResult" class="list-group-item">
<h3>
<a routerLink="/users/{{user.username}}">{{user.username}}</a>
</h3>
</li>
</ul>
</div>
| {
"content_hash": "888c677ff0731251cdc137e5f76e018d",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 70,
"avg_line_length": 32.45454545454545,
"alnum_prop": 0.6106442577030813,
"repo_name": "Team-Vinkel/Vinkelstone",
"id": "04b55253d337904458362fdac4d671bcad96485d",
"size": "357",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/app/search/search-user/search-user.component.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "6388"
},
{
"name": "HTML",
"bytes": "33239"
},
{
"name": "JavaScript",
"bytes": "1884"
},
{
"name": "TypeScript",
"bytes": "86886"
}
],
"symlink_target": ""
} |
package org.apache.hyracks.algebricks.runtime.operators.aggrun;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.apache.hyracks.algebricks.runtime.base.IEvaluatorContext;
import org.apache.hyracks.algebricks.runtime.base.IRunningAggregateEvaluator;
import org.apache.hyracks.algebricks.runtime.base.IRunningAggregateEvaluatorFactory;
import org.apache.hyracks.algebricks.runtime.evaluators.EvaluatorContext;
import org.apache.hyracks.algebricks.runtime.operators.base.AbstractOneInputOneOutputOneFramePushRuntime;
import org.apache.hyracks.api.comm.IFrameTupleAccessor;
import org.apache.hyracks.api.context.IHyracksTaskContext;
import org.apache.hyracks.api.exceptions.HyracksDataException;
import org.apache.hyracks.data.std.api.IPointable;
import org.apache.hyracks.data.std.primitive.VoidPointable;
import org.apache.hyracks.dataflow.common.comm.io.ArrayTupleBuilder;
import org.apache.hyracks.dataflow.common.data.accessors.FrameTupleReference;
public abstract class AbstractRunningAggregatePushRuntime<T extends IRunningAggregateEvaluator>
extends AbstractOneInputOneOutputOneFramePushRuntime {
protected final IEvaluatorContext ctx;
private final IRunningAggregateEvaluatorFactory[] runningAggFactories;
private final Class<T> runningAggEvalClass;
protected final List<T> runningAggEvals;
private final int[] projectionColumns;
private final int[] projectionToOutColumns;
private final IPointable p = VoidPointable.FACTORY.createPointable();
protected ArrayTupleBuilder tupleBuilder;
private boolean isFirst;
public AbstractRunningAggregatePushRuntime(int[] projectionColumns, int[] runningAggOutColumns,
IRunningAggregateEvaluatorFactory[] runningAggFactories, Class<T> runningAggEvalClass,
IHyracksTaskContext ctx) {
this.ctx = new EvaluatorContext(ctx);
this.projectionColumns = projectionColumns;
this.runningAggFactories = runningAggFactories;
this.runningAggEvalClass = runningAggEvalClass;
runningAggEvals = new ArrayList<>(runningAggFactories.length);
projectionToOutColumns = new int[projectionColumns.length];
for (int j = 0; j < projectionColumns.length; j++) {
projectionToOutColumns[j] = Arrays.binarySearch(runningAggOutColumns, projectionColumns[j]);
}
isFirst = true;
}
@Override
public void open() throws HyracksDataException {
super.open();
if (isFirst) {
isFirst = false;
init();
}
for (T runningAggEval : runningAggEvals) {
runningAggEval.init();
}
}
protected void init() throws HyracksDataException {
tupleBuilder = createOutputTupleBuilder(projectionColumns);
initAccessAppendRef(ctx.getTaskContext());
for (IRunningAggregateEvaluatorFactory runningAggFactory : runningAggFactories) {
IRunningAggregateEvaluator runningAggEval = runningAggFactory.createRunningAggregateEvaluator(ctx);
runningAggEvals.add(runningAggEvalClass.cast(runningAggEval));
}
}
protected ArrayTupleBuilder createOutputTupleBuilder(int[] projectionList) {
return new ArrayTupleBuilder(projectionList.length);
}
protected void produceTuples(IFrameTupleAccessor accessor, int beginIdx, int endIdx, FrameTupleReference tupleRef)
throws HyracksDataException {
for (int t = beginIdx; t <= endIdx; t++) {
tupleRef.reset(accessor, t);
produceTuple(tupleBuilder, accessor, t, tupleRef);
appendToFrameFromTupleBuilder(tupleBuilder);
}
}
protected void produceTuple(ArrayTupleBuilder tb, IFrameTupleAccessor accessor, int tIndex,
FrameTupleReference tupleRef) throws HyracksDataException {
tb.reset();
for (int f = 0; f < projectionColumns.length; f++) {
int k = projectionToOutColumns[f];
if (k >= 0) {
runningAggEvals.get(k).step(tupleRef, p);
tb.addField(p.getByteArray(), p.getStartOffset(), p.getLength());
} else {
tb.addField(accessor, tIndex, projectionColumns[f]);
}
}
}
@Override
public void flush() throws HyracksDataException {
appender.flush(writer);
}
}
| {
"content_hash": "1b87f170d23e0d119da3cbda5d4da736",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 118,
"avg_line_length": 43.277227722772274,
"alnum_prop": 0.722260352322123,
"repo_name": "apache/incubator-asterixdb",
"id": "12d6e9d9b1f22bc9a14e4ab10cbc5e6723ce0196",
"size": "5178",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "hyracks-fullstack/algebricks/algebricks-runtime/src/main/java/org/apache/hyracks/algebricks/runtime/operators/aggrun/AbstractRunningAggregatePushRuntime.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "6115"
},
{
"name": "C",
"bytes": "421"
},
{
"name": "CSS",
"bytes": "4763"
},
{
"name": "Crystal",
"bytes": "453"
},
{
"name": "Gnuplot",
"bytes": "89"
},
{
"name": "HTML",
"bytes": "115120"
},
{
"name": "Java",
"bytes": "10091258"
},
{
"name": "JavaScript",
"bytes": "237719"
},
{
"name": "Python",
"bytes": "281315"
},
{
"name": "Ruby",
"bytes": "3078"
},
{
"name": "Scheme",
"bytes": "1105"
},
{
"name": "Shell",
"bytes": "186924"
},
{
"name": "Smarty",
"bytes": "31412"
}
],
"symlink_target": ""
} |
SELECT track.name, slice.ts, slice.dur, slice.name
FROM slice JOIN track ON slice.track_id = track.id
WHERE track.name = 'mem.dma_buffer';
| {
"content_hash": "c664658e67052401c900390460aa4bd3",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 50,
"avg_line_length": 46.333333333333336,
"alnum_prop": 0.7482014388489209,
"repo_name": "google/perfetto",
"id": "9815ce5f5d2687451bd4e8cfbaab8eb7439ed169",
"size": "139",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "test/trace_processor/memory/dma_buffer_tracks_test.sql",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "58347"
},
{
"name": "C++",
"bytes": "10532953"
},
{
"name": "CSS",
"bytes": "6080"
},
{
"name": "Dockerfile",
"bytes": "6650"
},
{
"name": "HTML",
"bytes": "15653"
},
{
"name": "Java",
"bytes": "12441"
},
{
"name": "JavaScript",
"bytes": "115174"
},
{
"name": "Makefile",
"bytes": "10869"
},
{
"name": "Meson",
"bytes": "1635"
},
{
"name": "Python",
"bytes": "969677"
},
{
"name": "SCSS",
"bytes": "116843"
},
{
"name": "Shell",
"bytes": "79903"
},
{
"name": "Starlark",
"bytes": "222184"
},
{
"name": "TypeScript",
"bytes": "1740641"
}
],
"symlink_target": ""
} |
try:
from django.db import models
django_loaded = True
except ImportError:
django_loaded = False
if django_loaded:
from semantic_version import django_fields as semver_fields
class VersionModel(models.Model):
version = semver_fields.VersionField(verbose_name='my version')
spec = semver_fields.SpecField(verbose_name='my spec')
class PartialVersionModel(models.Model):
partial = semver_fields.VersionField(partial=True, verbose_name='partial version')
optional = semver_fields.VersionField(verbose_name='optional version', blank=True, null=True)
optional_spec = semver_fields.SpecField(verbose_name='optional spec', blank=True, null=True)
class CoerceVersionModel(models.Model):
version = semver_fields.VersionField(verbose_name='my version', coerce=True)
partial = semver_fields.VersionField(verbose_name='partial version', coerce=True, partial=True)
| {
"content_hash": "1f8b33d59c7d6797047c2c13e7dc5310",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 103,
"avg_line_length": 37.76,
"alnum_prop": 0.725635593220339,
"repo_name": "mhrivnak/python-semanticversion",
"id": "f938f7fbb07ada12251d2dbf43f8772540bce55c",
"size": "1012",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tests/django_test_app/models.py",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "Makefile",
"bytes": "449"
},
{
"name": "Python",
"bytes": "61573"
}
],
"symlink_target": ""
} |
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { AddressFormComponent } from './address-form.component';
describe('AddressFormComponent', () => {
let component: AddressFormComponent;
let fixture: ComponentFixture<AddressFormComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AddressFormComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(AddressFormComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should be created', () => {
expect(component).toBeTruthy();
});
});
| {
"content_hash": "f2c44626fed4c955a0ce6b2108ea664d",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 73,
"avg_line_length": 26.72,
"alnum_prop": 0.687125748502994,
"repo_name": "workofartyoga/downdog",
"id": "82fd8a7d27b9ead3978ac57659aedec6a34011a3",
"size": "668",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/client/src/app/address/address-form/address-form.component.spec.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "3495"
},
{
"name": "HTML",
"bytes": "10661"
},
{
"name": "JavaScript",
"bytes": "5583"
},
{
"name": "TypeScript",
"bytes": "66343"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.mschaeffner</groupId>
<artifactId>KamelKaese</artifactId>
<name>KamelKaese</name>
<version>0.0.1-SNAPSHOT</version>
<description>KamelKaese description</description>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<debug>true</debug>
<debuglevel>source,lines</debuglevel>
</configuration>
</plugin>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer>
<mainClass>msio.kamelkaese.Main</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
<exclusions>
<exclusion>
<artifactId>hamcrest-core</artifactId>
<groupId>org.hamcrest</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<version>1.3</version>
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>
| {
"content_hash": "fe3388f0ae0e014b6daae37ab37fdd9d",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 201,
"avg_line_length": 32.417910447761194,
"alnum_prop": 0.5759668508287292,
"repo_name": "mschaeffner/KamelKaese",
"id": "d6da47d4588e260824f19a4dc92a67d036f200ef",
"size": "2172",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "dependency-reduced-pom.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "643"
},
{
"name": "Java",
"bytes": "4375"
},
{
"name": "JavaScript",
"bytes": "358"
}
],
"symlink_target": ""
} |
module Vagrant
module LXC
module Action
class ClearForwardedPorts
def initialize(app, env)
@app = app
@logger = Log4r::Logger.new("vagrant::lxc::action::clear_forwarded_ports")
end
def call(env)
@env = env
if redir_pids.any?
env[:ui].info I18n.t("vagrant.actions.vm.clear_forward_ports.deleting")
redir_pids.each do |pid|
next unless is_redir_pid?(pid)
@logger.debug "Killing pid #{pid}"
system "pkill -TERM -P #{pid}"
end
@logger.info "Removing redir pids files"
remove_redir_pids
else
@logger.info "No redir pids found"
end
@app.call env
end
protected
def redir_pids
@redir_pids = Dir[@env[:machine].data_dir.join('pids').to_s + "/redir_*.pid"].map do |file|
File.read(file).strip.chomp
end
end
def is_redir_pid?(pid)
@logger.debug "Checking if #{pid} is a redir process with `ps -o cmd= #{pid}`"
`ps -o cmd= #{pid}`.strip.chomp =~ /redir/
end
def remove_redir_pids
Dir[@env[:machine].data_dir.join('pids').to_s + "/redir_*.pid"].each do |file|
File.delete file
end
end
end
end
end
end
| {
"content_hash": "93fe2e0255a60f4e93fcfd6227cc03d5",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 101,
"avg_line_length": 26.980392156862745,
"alnum_prop": 0.5130813953488372,
"repo_name": "fpletz/vagrant-lxc",
"id": "48dbe5b23efa8058d0fbbc28fd825564aa64853a",
"size": "1376",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "lib/vagrant-lxc/action/clear_forwarded_ports.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Puppet",
"bytes": "3808"
},
{
"name": "Ruby",
"bytes": "84655"
},
{
"name": "Shell",
"bytes": "23218"
},
{
"name": "VimL",
"bytes": "55"
}
],
"symlink_target": ""
} |
package org.scalatra
package fileupload
import test.scalatest.ScalatraFunSuite
import org.eclipse.jetty.testing.{ServletTester, HttpTester}
import org.apache.commons.io.IOUtils
class MultipleFilterFileUploadSupportTest extends ScalatraFunSuite {
addFilter(new ScalatraFilter with FileUploadSupport {
post("/some-other-url-with-file-upload-support") {}
}, "/*")
addFilter(new ScalatraFilter with FileUploadSupport {
post("/multipart") {
fileParams.get("file") foreach { file => response.setHeader("file", new String(file.get)) }
}
}, "/*")
test("keeps input parameters on multipart request") {
val request = IOUtils.toString(getClass.getResourceAsStream("multipart_request.txt"))
.replace("${PATH}", "/multipart")
val response = new HttpTester("iso-8859-1")
response.parse(tester.getResponses(request))
response.getHeader("file") should equal ("one")
}
}
| {
"content_hash": "ccc512bf07eb7b21d48fc90e72c4e526",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 97,
"avg_line_length": 35,
"alnum_prop": 0.7274725274725274,
"repo_name": "kuochaoyi/scalatra",
"id": "6eb3a10879349a1a7f531ce73875466ae2b93f39",
"size": "910",
"binary": false,
"copies": "2",
"ref": "refs/heads/develop",
"path": "fileupload/src/test/scala/org/scalatra/fileupload/MultipleFilterFileUploadSupportTest.scala",
"mode": "33188",
"license": "bsd-2-clause",
"language": [],
"symlink_target": ""
} |
package com.bird.shen.hotweather.model;
import android.content.Context;
/**
* POJO : the entity class about city.
*/
public class City {
private int id ;
private String cityName;
private String cityCode;
private int provinceId;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getCityName() {
return cityName;
}
public void setCityName(String cityName) {
this.cityName = cityName;
}
public String getCityCode() {
return cityCode;
}
public void setCityCode(String cityCode) {
this.cityCode = cityCode;
}
public int getProvinceId() {
return provinceId;
}
public void setProvinceId(int provinceId) {
this.provinceId = provinceId;
}
}
| {
"content_hash": "67e7323611bc0cab04fa3b81b5a08006",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 53,
"avg_line_length": 21.551020408163264,
"alnum_prop": 0.4810606060606061,
"repo_name": "john-ny1994/hotweather",
"id": "bbb9813424d7741dce4ba68f04c0d39fc5d77e6d",
"size": "1056",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/src/main/java/com/bird/shen/hotweather/model/City.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "42977"
}
],
"symlink_target": ""
} |
using Carbon.Extensions;
namespace Carbon.Platform.Metrics
{
public readonly struct Dimension
{
public Dimension(string name, long value)
: this(name, value.ToString()) { }
public Dimension(string name, string value)
{
Name = name;
Value = value;
}
public readonly string Name;
public readonly string Value;
public override string ToString()
{
return Name + "=" + Value;
}
public void Deconstruct(out string name, out string value)
{
name = Name;
value = Value;
}
// a=b
public static Dimension Parse(string text)
{
var segments = text.Split(Seperators.Equal);
return new Dimension(segments[0], segments[1]);
}
}
}
// AKA labels or tags | {
"content_hash": "c0fb0bdda5691feaeecc6b7b66d17bf4",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 66,
"avg_line_length": 21.75609756097561,
"alnum_prop": 0.5280269058295964,
"repo_name": "carbon/Platform",
"id": "2049a7052dd9b1a3e2e643a6d2e5b34e945318e1",
"size": "894",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Carbon.Platform.Metrics/Models/Dimension.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "228"
},
{
"name": "C#",
"bytes": "1012961"
},
{
"name": "PowerShell",
"bytes": "2854"
},
{
"name": "Smalltalk",
"bytes": "244"
}
],
"symlink_target": ""
} |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import sys
import copy
import inspect
from past.builtins import basestring
from caffe2.python.model_helper import ModelHelper
# flake8: noqa
from caffe2.python.helpers.algebra import *
from caffe2.python.helpers.arg_scope import *
from caffe2.python.helpers.array_helpers import *
from caffe2.python.helpers.control_ops import *
from caffe2.python.helpers.conv import *
from caffe2.python.helpers.db_input import *
from caffe2.python.helpers.dropout import *
from caffe2.python.helpers.elementwise_linear import *
from caffe2.python.helpers.fc import *
from caffe2.python.helpers.nonlinearity import *
from caffe2.python.helpers.normalization import *
from caffe2.python.helpers.pooling import *
from caffe2.python.helpers.tools import *
from caffe2.python.helpers.train import *
class HelperWrapper(object):
_registry = {
'arg_scope': arg_scope,
'fc': fc,
'packed_fc': packed_fc,
'fc_decomp': fc_decomp,
'fc_sparse': fc_sparse,
'fc_prune': fc_prune,
'dropout': dropout,
'max_pool': max_pool,
'average_pool': average_pool,
'max_pool_with_index' : max_pool_with_index,
'lrn': lrn,
'softmax': softmax,
'instance_norm': instance_norm,
'spatial_bn': spatial_bn,
'spatial_gn': spatial_gn,
'relu': relu,
'prelu': prelu,
'tanh': tanh,
'concat': concat,
'depth_concat': depth_concat,
'sum': sum,
'transpose': transpose,
'iter': iter,
'accuracy': accuracy,
'conv': conv,
'conv_nd': conv_nd,
'conv_transpose': conv_transpose,
'group_conv': group_conv,
'group_conv_deprecated': group_conv_deprecated,
'image_input': image_input,
'video_input': video_input,
'add_weight_decay': add_weight_decay,
'elementwise_linear': elementwise_linear,
'layer_norm': layer_norm,
'batch_mat_mul' : batch_mat_mul,
'cond' : cond,
'loop' : loop,
'db_input' : db_input,
}
def __init__(self, wrapped):
self.wrapped = wrapped
def __getattr__(self, helper_name):
if helper_name not in self._registry:
raise AttributeError(
"Helper function {} not "
"registered.".format(helper_name)
)
def scope_wrapper(*args, **kwargs):
new_kwargs = {}
if helper_name != 'arg_scope':
if len(args) > 0 and isinstance(args[0], ModelHelper):
model = args[0]
elif 'model' in kwargs:
model = kwargs['model']
else:
raise RuntimeError(
"The first input of helper function should be model. " \
"Or you can provide it in kwargs as model=<your_model>.")
new_kwargs = copy.deepcopy(model.arg_scope)
func = self._registry[helper_name]
var_names, _, varkw, _= inspect.getargspec(func)
if varkw is None:
# this helper function does not take in random **kwargs
new_kwargs = {
var_name: new_kwargs[var_name]
for var_name in var_names if var_name in new_kwargs
}
cur_scope = get_current_scope()
new_kwargs.update(cur_scope.get(helper_name, {}))
new_kwargs.update(kwargs)
return func(*args, **new_kwargs)
scope_wrapper.__name__ = helper_name
return scope_wrapper
def Register(self, helper):
name = helper.__name__
if name in self._registry:
raise AttributeError(
"Helper {} already exists. Please change your "
"helper name.".format(name)
)
self._registry[name] = helper
def has_helper(self, helper_or_helper_name):
helper_name = (
helper_or_helper_name
if isinstance(helper_or_helper_name, basestring) else
helper_or_helper_name.__name__
)
return helper_name in self._registry
sys.modules[__name__] = HelperWrapper(sys.modules[__name__])
| {
"content_hash": "71b99975c11bb697f942523ad7d27a30",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 73,
"avg_line_length": 33.96875,
"alnum_prop": 0.5800367985280589,
"repo_name": "ryfeus/lambda-packs",
"id": "bb6d3f0c3fcf9d6715cd4b6d41cc59e92e4ea353",
"size": "4417",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "pytorch/source/caffe2/python/brew.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "9768343"
},
{
"name": "C++",
"bytes": "76566960"
},
{
"name": "CMake",
"bytes": "191097"
},
{
"name": "CSS",
"bytes": "153538"
},
{
"name": "Cuda",
"bytes": "61768"
},
{
"name": "Cython",
"bytes": "3110222"
},
{
"name": "Fortran",
"bytes": "110284"
},
{
"name": "HTML",
"bytes": "248658"
},
{
"name": "JavaScript",
"bytes": "62920"
},
{
"name": "MATLAB",
"bytes": "17384"
},
{
"name": "Makefile",
"bytes": "152150"
},
{
"name": "Python",
"bytes": "549307737"
},
{
"name": "Roff",
"bytes": "26398"
},
{
"name": "SWIG",
"bytes": "142"
},
{
"name": "Shell",
"bytes": "7790"
},
{
"name": "Smarty",
"bytes": "4090"
},
{
"name": "TeX",
"bytes": "152062"
},
{
"name": "XSLT",
"bytes": "305540"
}
],
"symlink_target": ""
} |
package com.github.eostermueller.heapspank.leakyspank.jmeter;
import com.github.eostermueller.heapspank.leakyspank.LeakySpankContext;
import com.github.eostermueller.heapspank.leakyspank.Model;
import com.github.eostermueller.heapspank.leakyspank.LeakySpankContext.LeakResult;
import java.io.*;
import java.lang.ProcessBuilder;
import java.util.ArrayList;
import java.util.List;
import org.apache.jmeter.config.Arguments;
import org.apache.jmeter.protocol.java.sampler.JavaSamplerContext;
import org.apache.jmeter.samplers.SampleResult;
import org.apache.jmeter.protocol.java.sampler.AbstractJavaSamplerClient;
public class LeakySpankSampler extends AbstractJavaSamplerClient {
private static final String LEAKY_SPANKY = "ls";
private static final String P_PID = "pid";
private static final String P_INTERVAL_IN_SECONDS = "interval_in_seconds";
private static final String P_INTERVAL_COUNT_PER_WINDOW = "interval_count_per_window";
private static final String P_TOP_N_SUSPECTS_PER_WINDOW = "top_n_suspects_per_window";
private static final ThreadLocal<LeakySpankContext> threadLocal = new ThreadLocal<LeakySpankContext>();
@Override
public Arguments getDefaultParameters() {
Arguments defaultParameters = new Arguments();
defaultParameters.addArgument(P_PID, "${PID}");
defaultParameters.addArgument(P_INTERVAL_IN_SECONDS, "${INTERVAL_IN_SECONDS}");
defaultParameters.addArgument(P_INTERVAL_COUNT_PER_WINDOW, "${INTERVAL_COUNT_PER_WINDOW}");
defaultParameters.addArgument(P_TOP_N_SUSPECTS_PER_WINDOW, "${TOP_N_SUSPECTS_PER_WINDOW}");
return defaultParameters;
}
public SampleResult runTest(JavaSamplerContext jmeterSamplerContext) {
LeakySpankContext ctx = getLeakySpankContext(jmeterSamplerContext);
getLogger().debug("Start of LeakySpankSampler#runTest");
SampleResult result = new SampleResult();
result.setDataType(SampleResult.TEXT);
result.sampleStart(); // start stopwatch
try {
String pidToMonitor = String.valueOf(ctx.getPid());
String jMapProcessOutput = executeJMapHisto(pidToMonitor,result);
if (jMapProcessOutput==null || jMapProcessOutput.trim().length()==0) {
String error = "Tried to execute jmap and got nothing. Is pid [" + ctx.getPid() + "] still active? Found that PID in the HEAPSPANK_PID variable in JMeter. Is jmap even in the PATH? Need JAVA_HOME/bin to be in the OS's PATH variable.";
result.setSuccessful(false);
result.setSamplerData("jmap -histo " + ctx.getPid());
result.setResponseData(error,"UTF-8");
getLogger().error(error);
} else {
result.setSamplerData("jmap -histo " + ctx.getPid() + "\n" + jMapProcessOutput);
this.getLogger().debug(
"Length of jmap output ["
+ jMapProcessOutput.toString().length() + "]");
this.getLogger().debug(
"jmap output [" + jMapProcessOutput.toString() + "]");
Model currentModel = new Model(jMapProcessOutput.toString());
ctx.addJMapHistoRun(currentModel);
//ctx.incrementRunCount();
/**
* Display some results, but only at the end of each 'window', not after every jmap -histo run.
* By default, you get 4 jmap -histo runs per 'window'.
*/
if (ctx.getCurrentRunCount() % ctx.getRunCountPerWindow()==0) {
// LeakResult[] suspects = ctx.getLeakSuspectsOrdered();
// Model resultsForWindow = new Model();
// //select the last N from the array -- the most likely suspects for this window.
// int startIndex = (suspects.length - ctx.getTopNSuspects()) -1;
// if (startIndex < 0) startIndex = 0;
// for(int i = startIndex;
// i < suspects.length;
// i++) {
// resultsForWindow.put(suspects[i].line);
// }
Model resultsForWindow = new Model();
resultsForWindow.add(ctx.getTopResults());
getLogger().info("Rendered output [" + resultsForWindow.renderBytes(LEAKY_SPANKY) + "]");
//The formating of these results is tailored very to work with a
//specially configured "jp@gc Page Data Extractor" from JMeterrPlugins.
result.setResponseData(resultsForWindow.renderBytes(LEAKY_SPANKY), "UTF-8");
}
result.setSuccessful(true);
result.setResponseCodeOK();
result.setResponseOK();
}
result.sampleEnd();// time for all transformations
} catch (Exception e) {
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
e.printStackTrace(pw);
String exception = sw.toString();
getLogger().error(exception);
result.setResponseData(exception, "UTF-8");
result.setSuccessful(false);
}
return result;
}
private LeakySpankContext getLeakySpankContext(JavaSamplerContext arg0) {
LeakySpankContext leakySpankContext = threadLocal.get();
if (leakySpankContext==null) {
long pid = arg0.getLongParameter(P_PID);
int intervalInSeconds = arg0.getIntParameter(P_INTERVAL_IN_SECONDS, 15);
int intervalCountPerWindow = arg0.getIntParameter(P_INTERVAL_COUNT_PER_WINDOW, 4);
int topNSuspectsPerWindow = arg0.getIntParameter(P_TOP_N_SUSPECTS_PER_WINDOW, 2);
leakySpankContext = new LeakySpankContext(
pid,
intervalInSeconds,
intervalCountPerWindow,
topNSuspectsPerWindow);
threadLocal.set(leakySpankContext);
}
return leakySpankContext;
}
private String executeJMapHisto(String pidToMonitor, SampleResult result) throws IOException, InterruptedException {
// String javaHome = System.getenv("JAVA_HOME");
// String fullCmdPath = javaHome + File.separator + "bin" +
// File.separator + "jstat";
// log.info("JAVA_HOME: [" + javaHome + "]");
// log.info("full [" + fullCmdPath + "]");
List<String> processArgs = new ArrayList<String>();
String fullCmdPath = "jmap";
processArgs.add(fullCmdPath);
// String pidToMonitor = arg0.getParameter("PID");
//String pidToMonitor = JMeterUtils.getPropDefault("PID", null);
//String pidToMonitor = "15350";
if (pidToMonitor == null || pidToMonitor.trim().length()==0) {
String error = "Could not find JMeter variable named 'PID', which must have a value of the process id (pid); of the process you want to detect leaks in.";
getLogger().error(error);
result.setResponseData(error, "UTF-8");
result.setResponseCode("500");
result.sampleEnd();// time for all transformations
return LEAKY_SPANKY + "_MISSING_PID=99<BR>\n";
}
processArgs.add("-histo");
processArgs.add(pidToMonitor); // process id
this.getLogger().info(
"Args for invoking jmap: [" + processArgs.toString() + "]");
ProcessBuilder processBuilder = new ProcessBuilder(processArgs);
processBuilder.redirectErrorStream(true);
Process process = processBuilder.start();
StringBuilder processOutput = new StringBuilder();
BufferedReader processOutputReader = new BufferedReader(
new InputStreamReader(process.getInputStream()));
String readLine;
int lineCount = 0;
while ((readLine = processOutputReader.readLine()) != null) {
if (lineCount > 0)
processOutput.append(readLine + System.lineSeparator());
lineCount++;
}
process.waitFor();
return processOutput.toString();
}
}
/**
//Model finalModel = new Model();
//String previousJMapOutput = JMeterUtils.getProperty(JMAP_HISTO_PREVIOUS);
//Model previousModel = null;
//if (previousJMapOutput!=null && previousJMapOutput.trim().length() > 0) {
// previousModel = new Model(previousJMapOutput);
// JMapHistoLine upwardlyMobile[] = currentModel
// .getAllOrderByMostUpwardlyMobileAsComparedTo(previousModel);
// for (int i = upwardlyMobile.length; i >= 0 && i > (upwardlyMobile.length - 3); i--) {
// finalModel.put(upwardlyMobile[i - 1]);
// }
//}
//
//JMapHistoLine[] mostBytes = currentModel.getAllOrderByBytes();
//for (int i = mostBytes.length; i > (mostBytes.length - 3) && i >= 0; i--) {
// finalModel.put(mostBytes[i-1]);
//}
//
//// Get ready for next invocation of jmap -histo
//JMeterUtils.setProperty(JMAP_HISTO_PREVIOUS, jMapProcessOutput.toString() );
*/ | {
"content_hash": "ae47ad8d1bc2139b4330b53192ba6ffe",
"timestamp": "",
"source": "github",
"line_count": 197,
"max_line_length": 241,
"avg_line_length": 40.3248730964467,
"alnum_prop": 0.716012084592145,
"repo_name": "eostermueller/heapSpank",
"id": "3e6956a3dbf68c1280c26afa6b6bed451ed071e1",
"size": "7944",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/com/github/eostermueller/heapspank/leakyspank/jmeter/LeakySpankSampler.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "228898"
}
],
"symlink_target": ""
} |
<div class="ct-topBar ">
<div class="container">
<div class="row">
<div class="col-sm-12 col-md-12">
<div class="ct-panel--user ct-panel--right text-right">
<div class="ct-panel--item search-wrapper">
<form id="slide" role="form" method="get" action="{% url 'persons_list' %}">
<i class="fa fa-search"></i>
<input placeholder="Search" name="q" type="text" class="form-control input-lg ct-input--search">
<button type="submit" style="display: none"></button>
</form>
</div>
<div class="ct-panel--item ct-email">
{% if request.user.is_anonymous %}
<a href="{% url 'login' %}"><i class="fa fa-user"></i> Login</a>
{% else %}
<a href="{% url 'logout' %}"><i class="fa fa-user"></i> Logout</a>
{% endif %}
</div>
<!--<div class="ct-panel--item ct-email">
{% if request.user.is_anonymous %}
<a href="{% url 'registration_register' %}"><i class="fa fa-plus-square"></i> Register</a>
{% endif %}
</div>-->
</div>
</div>
</div>
</div>
</div>
<nav class="navbar ct-navbar--hoverEffectLine" role="navigation" data-heighttopbar="40px" data-startnavbar="0">
<div class="container">
<div class="navbar-header ct-panel--navbar">
<a href="{% url 'firestation_home' %}" class="logo" rel="home"><h1>VIDA</h1></a>
</div>
<div class="collapse navbar-collapse text-uppercase">
<ul class="nav navbar-nav ct-navbar--fadeInUp">
<li class="onepage"><a href="{% url 'firestation_home' %}#about">About</a></li>
<li class="onepage"><a href="{% url 'firestation_home' %}#partners">Partners</a></li>
<li class="onepage active"><a href="{% url 'persons_list' %}">Search</a></li>
</ul>
</div>
<div class="clearfix"></div>
<div class="ct-shapeBottom"></div>
</div>
</nav>
| {
"content_hash": "014be9d163884a4e251dd9968a297a2e",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 120,
"avg_line_length": 51.2,
"alnum_prop": 0.4583333333333333,
"repo_name": "ROGUE-JCTD/vida",
"id": "18cb1cd3e2b0a67c1ced549d4e0fb04f295c7f91",
"size": "2304",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "vida/firestation/templates/firestation/_navbar.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "803732"
},
{
"name": "HTML",
"bytes": "468617"
},
{
"name": "JavaScript",
"bytes": "813398"
},
{
"name": "PHP",
"bytes": "17935"
},
{
"name": "Python",
"bytes": "368990"
},
{
"name": "Shell",
"bytes": "398"
}
],
"symlink_target": ""
} |
/* Generic garbage collection (GC) functions and data, not specific to
any particular GC implementation. */
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "hashtab.h"
#include "ggc.h"
#include "toplev.h"
#include "params.h"
#include "hosthooks.h"
#include "hosthooks-def.h"
#ifdef HAVE_SYS_RESOURCE_H
# include <sys/resource.h>
#endif
#ifdef HAVE_MMAP_FILE
# include <sys/mman.h>
# ifdef HAVE_MINCORE
/* This is on Solaris. */
# include <sys/types.h>
# endif
#endif
#ifndef MAP_FAILED
# define MAP_FAILED ((void *)-1)
#endif
#ifdef ENABLE_VALGRIND_CHECKING
# ifdef HAVE_VALGRIND_MEMCHECK_H
# include <valgrind/memcheck.h>
# elif defined HAVE_MEMCHECK_H
# include <memcheck.h>
# else
# include <valgrind.h>
# endif
#else
/* Avoid #ifdef:s when we can help it. */
#define VALGRIND_DISCARD(x)
#endif
/* When set, ggc_collect will do collection. */
bool ggc_force_collect;
/* Statistics about the allocation. */
static ggc_statistics *ggc_stats;
struct traversal_state;
static int ggc_htab_delete (void **, void *);
static hashval_t saving_htab_hash (const void *);
static int saving_htab_eq (const void *, const void *);
static int call_count (void **, void *);
static int call_alloc (void **, void *);
static int compare_ptr_data (const void *, const void *);
static void relocate_ptrs (void *, void *);
static void write_pch_globals (const struct ggc_root_tab * const *tab,
struct traversal_state *state);
static double ggc_rlimit_bound (double);
/* Maintain global roots that are preserved during GC. */
/* Process a slot of an htab by deleting it if it has not been marked. */
static int
ggc_htab_delete (void **slot, void *info)
{
const struct ggc_cache_tab *r = (const struct ggc_cache_tab *) info;
if (! (*r->marked_p) (*slot))
htab_clear_slot (*r->base, slot);
else
(*r->cb) (*slot);
return 1;
}
/* Iterate through all registered roots and mark each element. */
void
ggc_mark_roots (void)
{
const struct ggc_root_tab *const *rt;
const struct ggc_root_tab *rti;
const struct ggc_cache_tab *const *ct;
const struct ggc_cache_tab *cti;
size_t i;
for (rt = gt_ggc_deletable_rtab; *rt; rt++)
for (rti = *rt; rti->base != NULL; rti++)
memset (rti->base, 0, rti->stride);
for (rt = gt_ggc_rtab; *rt; rt++)
for (rti = *rt; rti->base != NULL; rti++)
for (i = 0; i < rti->nelt; i++)
(*rti->cb)(*(void **)((char *)rti->base + rti->stride * i));
ggc_mark_stringpool ();
/* Now scan all hash tables that have objects which are to be deleted if
they are not already marked. */
for (ct = gt_ggc_cache_rtab; *ct; ct++)
for (cti = *ct; cti->base != NULL; cti++)
if (*cti->base)
{
ggc_set_mark (*cti->base);
htab_traverse_noresize (*cti->base, ggc_htab_delete, (void *) cti);
ggc_set_mark ((*cti->base)->entries);
}
}
/* Allocate a block of memory, then clear it. */
void *
ggc_alloc_cleared_stat (size_t size MEM_STAT_DECL)
{
void *buf = ggc_alloc_stat (size PASS_MEM_STAT);
memset (buf, 0, size);
return buf;
}
/* Resize a block of memory, possibly re-allocating it. */
void *
ggc_realloc_stat (void *x, size_t size MEM_STAT_DECL)
{
void *r;
size_t old_size;
if (x == NULL)
return ggc_alloc_stat (size PASS_MEM_STAT);
old_size = ggc_get_size (x);
if (size <= old_size)
{
/* Mark the unwanted memory as unaccessible. We also need to make
the "new" size accessible, since ggc_get_size returns the size of
the pool, not the size of the individually allocated object, the
size which was previously made accessible. Unfortunately, we
don't know that previously allocated size. Without that
knowledge we have to lose some initialization-tracking for the
old parts of the object. An alternative is to mark the whole
old_size as reachable, but that would lose tracking of writes
after the end of the object (by small offsets). Discard the
handle to avoid handle leak. */
VALGRIND_DISCARD (VALGRIND_MAKE_NOACCESS ((char *) x + size,
old_size - size));
VALGRIND_DISCARD (VALGRIND_MAKE_READABLE (x, size));
return x;
}
r = ggc_alloc_stat (size PASS_MEM_STAT);
/* Since ggc_get_size returns the size of the pool, not the size of the
individually allocated object, we'd access parts of the old object
that were marked invalid with the memcpy below. We lose a bit of the
initialization-tracking since some of it may be uninitialized. */
VALGRIND_DISCARD (VALGRIND_MAKE_READABLE (x, old_size));
memcpy (r, x, old_size);
/* The old object is not supposed to be used anymore. */
ggc_free (x);
return r;
}
/* Like ggc_alloc_cleared, but performs a multiplication. */
void *
ggc_calloc (size_t s1, size_t s2)
{
return ggc_alloc_cleared (s1 * s2);
}
/* These are for splay_tree_new_ggc. */
void *
ggc_splay_alloc (int sz, void *nl)
{
gcc_assert (!nl);
return ggc_alloc (sz);
}
void
ggc_splay_dont_free (void * x ATTRIBUTE_UNUSED, void *nl)
{
gcc_assert (!nl);
}
/* Print statistics that are independent of the collector in use. */
#define SCALE(x) ((unsigned long) ((x) < 1024*10 \
? (x) \
: ((x) < 1024*1024*10 \
? (x) / 1024 \
: (x) / (1024*1024))))
#define LABEL(x) ((x) < 1024*10 ? ' ' : ((x) < 1024*1024*10 ? 'k' : 'M'))
void
ggc_print_common_statistics (FILE *stream ATTRIBUTE_UNUSED,
ggc_statistics *stats)
{
/* Set the pointer so that during collection we will actually gather
the statistics. */
ggc_stats = stats;
/* Then do one collection to fill in the statistics. */
ggc_collect ();
/* At present, we don't really gather any interesting statistics. */
/* Don't gather statistics any more. */
ggc_stats = NULL;
}
/* Functions for saving and restoring GCable memory to disk. */
static htab_t saving_htab;
struct ptr_data
{
void *obj;
void *note_ptr_cookie;
gt_note_pointers note_ptr_fn;
gt_handle_reorder reorder_fn;
size_t size;
void *new_addr;
enum gt_types_enum type;
};
#define POINTER_HASH(x) (hashval_t)((long)x >> 3)
/* Register an object in the hash table. */
int
gt_pch_note_object (void *obj, void *note_ptr_cookie,
gt_note_pointers note_ptr_fn,
enum gt_types_enum type)
{
struct ptr_data **slot;
if (obj == NULL || obj == (void *) 1)
return 0;
slot = (struct ptr_data **)
htab_find_slot_with_hash (saving_htab, obj, POINTER_HASH (obj),
INSERT);
if (*slot != NULL)
{
gcc_assert ((*slot)->note_ptr_fn == note_ptr_fn
&& (*slot)->note_ptr_cookie == note_ptr_cookie);
return 0;
}
*slot = xcalloc (sizeof (struct ptr_data), 1);
(*slot)->obj = obj;
(*slot)->note_ptr_fn = note_ptr_fn;
(*slot)->note_ptr_cookie = note_ptr_cookie;
if (note_ptr_fn == gt_pch_p_S)
(*slot)->size = strlen (obj) + 1;
else
(*slot)->size = ggc_get_size (obj);
(*slot)->type = type;
return 1;
}
/* Register an object in the hash table. */
void
gt_pch_note_reorder (void *obj, void *note_ptr_cookie,
gt_handle_reorder reorder_fn)
{
struct ptr_data *data;
if (obj == NULL || obj == (void *) 1)
return;
data = htab_find_with_hash (saving_htab, obj, POINTER_HASH (obj));
gcc_assert (data && data->note_ptr_cookie == note_ptr_cookie);
data->reorder_fn = reorder_fn;
}
/* Hash and equality functions for saving_htab, callbacks for htab_create. */
static hashval_t
saving_htab_hash (const void *p)
{
return POINTER_HASH (((struct ptr_data *)p)->obj);
}
static int
saving_htab_eq (const void *p1, const void *p2)
{
return ((struct ptr_data *)p1)->obj == p2;
}
/* Handy state for the traversal functions. */
struct traversal_state
{
FILE *f;
struct ggc_pch_data *d;
size_t count;
struct ptr_data **ptrs;
size_t ptrs_i;
};
/* Callbacks for htab_traverse. */
static int
call_count (void **slot, void *state_p)
{
struct ptr_data *d = (struct ptr_data *)*slot;
struct traversal_state *state = (struct traversal_state *)state_p;
ggc_pch_count_object (state->d, d->obj, d->size,
d->note_ptr_fn == gt_pch_p_S,
d->type);
state->count++;
return 1;
}
static int
call_alloc (void **slot, void *state_p)
{
struct ptr_data *d = (struct ptr_data *)*slot;
struct traversal_state *state = (struct traversal_state *)state_p;
d->new_addr = ggc_pch_alloc_object (state->d, d->obj, d->size,
d->note_ptr_fn == gt_pch_p_S,
d->type);
state->ptrs[state->ptrs_i++] = d;
return 1;
}
/* Callback for qsort. */
static int
compare_ptr_data (const void *p1_p, const void *p2_p)
{
struct ptr_data *p1 = *(struct ptr_data *const *)p1_p;
struct ptr_data *p2 = *(struct ptr_data *const *)p2_p;
return (((size_t)p1->new_addr > (size_t)p2->new_addr)
- ((size_t)p1->new_addr < (size_t)p2->new_addr));
}
/* Callbacks for note_ptr_fn. */
static void
relocate_ptrs (void *ptr_p, void *state_p)
{
void **ptr = (void **)ptr_p;
struct traversal_state *state ATTRIBUTE_UNUSED
= (struct traversal_state *)state_p;
struct ptr_data *result;
if (*ptr == NULL || *ptr == (void *)1)
return;
result = htab_find_with_hash (saving_htab, *ptr, POINTER_HASH (*ptr));
gcc_assert (result);
*ptr = result->new_addr;
}
/* Write out, after relocation, the pointers in TAB. */
static void
write_pch_globals (const struct ggc_root_tab * const *tab,
struct traversal_state *state)
{
const struct ggc_root_tab *const *rt;
const struct ggc_root_tab *rti;
size_t i;
for (rt = tab; *rt; rt++)
for (rti = *rt; rti->base != NULL; rti++)
for (i = 0; i < rti->nelt; i++)
{
void *ptr = *(void **)((char *)rti->base + rti->stride * i);
struct ptr_data *new_ptr;
if (ptr == NULL || ptr == (void *)1)
{
if (fwrite (&ptr, sizeof (void *), 1, state->f)
!= 1)
fatal_error ("can't write PCH file: %m");
}
else
{
new_ptr = htab_find_with_hash (saving_htab, ptr,
POINTER_HASH (ptr));
if (fwrite (&new_ptr->new_addr, sizeof (void *), 1, state->f)
!= 1)
fatal_error ("can't write PCH file: %m");
}
}
}
/* Hold the information we need to mmap the file back in. */
struct mmap_info
{
size_t offset;
size_t size;
void *preferred_base;
};
/* Write out the state of the compiler to F. */
void
gt_pch_save (FILE *f)
{
const struct ggc_root_tab *const *rt;
const struct ggc_root_tab *rti;
size_t i;
struct traversal_state state;
char *this_object = NULL;
size_t this_object_size = 0;
struct mmap_info mmi;
const size_t mmap_offset_alignment = host_hooks.gt_pch_alloc_granularity();
gt_pch_save_stringpool ();
saving_htab = htab_create (50000, saving_htab_hash, saving_htab_eq, free);
for (rt = gt_ggc_rtab; *rt; rt++)
for (rti = *rt; rti->base != NULL; rti++)
for (i = 0; i < rti->nelt; i++)
(*rti->pchw)(*(void **)((char *)rti->base + rti->stride * i));
for (rt = gt_pch_cache_rtab; *rt; rt++)
for (rti = *rt; rti->base != NULL; rti++)
for (i = 0; i < rti->nelt; i++)
(*rti->pchw)(*(void **)((char *)rti->base + rti->stride * i));
/* Prepare the objects for writing, determine addresses and such. */
state.f = f;
state.d = init_ggc_pch();
state.count = 0;
htab_traverse (saving_htab, call_count, &state);
mmi.size = ggc_pch_total_size (state.d);
/* Try to arrange things so that no relocation is necessary, but
don't try very hard. On most platforms, this will always work,
and on the rest it's a lot of work to do better.
(The extra work goes in HOST_HOOKS_GT_PCH_GET_ADDRESS and
HOST_HOOKS_GT_PCH_USE_ADDRESS.) */
mmi.preferred_base = host_hooks.gt_pch_get_address (mmi.size, fileno (f));
ggc_pch_this_base (state.d, mmi.preferred_base);
state.ptrs = XNEWVEC (struct ptr_data *, state.count);
state.ptrs_i = 0;
htab_traverse (saving_htab, call_alloc, &state);
qsort (state.ptrs, state.count, sizeof (*state.ptrs), compare_ptr_data);
/* Write out all the scalar variables. */
for (rt = gt_pch_scalar_rtab; *rt; rt++)
for (rti = *rt; rti->base != NULL; rti++)
if (fwrite (rti->base, rti->stride, 1, f) != 1)
fatal_error ("can't write PCH file: %m");
/* Write out all the global pointers, after translation. */
write_pch_globals (gt_ggc_rtab, &state);
write_pch_globals (gt_pch_cache_rtab, &state);
/* Pad the PCH file so that the mmapped area starts on an allocation
granularity (usually page) boundary. */
{
long o;
o = ftell (state.f) + sizeof (mmi);
if (o == -1)
fatal_error ("can't get position in PCH file: %m");
mmi.offset = mmap_offset_alignment - o % mmap_offset_alignment;
if (mmi.offset == mmap_offset_alignment)
mmi.offset = 0;
mmi.offset += o;
}
if (fwrite (&mmi, sizeof (mmi), 1, state.f) != 1)
fatal_error ("can't write PCH file: %m");
if (mmi.offset != 0
&& fseek (state.f, mmi.offset, SEEK_SET) != 0)
fatal_error ("can't write padding to PCH file: %m");
ggc_pch_prepare_write (state.d, state.f);
/* Actually write out the objects. */
for (i = 0; i < state.count; i++)
{
if (this_object_size < state.ptrs[i]->size)
{
this_object_size = state.ptrs[i]->size;
this_object = xrealloc (this_object, this_object_size);
}
memcpy (this_object, state.ptrs[i]->obj, state.ptrs[i]->size);
if (state.ptrs[i]->reorder_fn != NULL)
state.ptrs[i]->reorder_fn (state.ptrs[i]->obj,
state.ptrs[i]->note_ptr_cookie,
relocate_ptrs, &state);
state.ptrs[i]->note_ptr_fn (state.ptrs[i]->obj,
state.ptrs[i]->note_ptr_cookie,
relocate_ptrs, &state);
ggc_pch_write_object (state.d, state.f, state.ptrs[i]->obj,
state.ptrs[i]->new_addr, state.ptrs[i]->size,
state.ptrs[i]->note_ptr_fn == gt_pch_p_S);
if (state.ptrs[i]->note_ptr_fn != gt_pch_p_S)
memcpy (state.ptrs[i]->obj, this_object, state.ptrs[i]->size);
}
ggc_pch_finish (state.d, state.f);
gt_pch_fixup_stringpool ();
free (state.ptrs);
htab_delete (saving_htab);
}
/* Read the state of the compiler back in from F. */
void
gt_pch_restore (FILE *f)
{
const struct ggc_root_tab *const *rt;
const struct ggc_root_tab *rti;
size_t i;
struct mmap_info mmi;
int result;
/* Delete any deletable objects. This makes ggc_pch_read much
faster, as it can be sure that no GCable objects remain other
than the ones just read in. */
for (rt = gt_ggc_deletable_rtab; *rt; rt++)
for (rti = *rt; rti->base != NULL; rti++)
memset (rti->base, 0, rti->stride);
/* Read in all the scalar variables. */
for (rt = gt_pch_scalar_rtab; *rt; rt++)
for (rti = *rt; rti->base != NULL; rti++)
if (fread (rti->base, rti->stride, 1, f) != 1)
fatal_error ("can't read PCH file: %m");
/* Read in all the global pointers, in 6 easy loops. */
for (rt = gt_ggc_rtab; *rt; rt++)
for (rti = *rt; rti->base != NULL; rti++)
for (i = 0; i < rti->nelt; i++)
if (fread ((char *)rti->base + rti->stride * i,
sizeof (void *), 1, f) != 1)
fatal_error ("can't read PCH file: %m");
for (rt = gt_pch_cache_rtab; *rt; rt++)
for (rti = *rt; rti->base != NULL; rti++)
for (i = 0; i < rti->nelt; i++)
if (fread ((char *)rti->base + rti->stride * i,
sizeof (void *), 1, f) != 1)
fatal_error ("can't read PCH file: %m");
if (fread (&mmi, sizeof (mmi), 1, f) != 1)
fatal_error ("can't read PCH file: %m");
result = host_hooks.gt_pch_use_address (mmi.preferred_base, mmi.size,
fileno (f), mmi.offset);
if (result < 0)
fatal_error ("had to relocate PCH");
if (result == 0)
{
if (fseek (f, mmi.offset, SEEK_SET) != 0
|| fread (mmi.preferred_base, mmi.size, 1, f) != 1)
fatal_error ("can't read PCH file: %m");
}
else if (fseek (f, mmi.offset + mmi.size, SEEK_SET) != 0)
fatal_error ("can't read PCH file: %m");
ggc_pch_read (f, mmi.preferred_base);
gt_pch_restore_stringpool ();
}
/* Default version of HOST_HOOKS_GT_PCH_GET_ADDRESS when mmap is not present.
Select no address whatsoever, and let gt_pch_save choose what it will with
malloc, presumably. */
void *
default_gt_pch_get_address (size_t size ATTRIBUTE_UNUSED,
int fd ATTRIBUTE_UNUSED)
{
return NULL;
}
/* Default version of HOST_HOOKS_GT_PCH_USE_ADDRESS when mmap is not present.
Allocate SIZE bytes with malloc. Return 0 if the address we got is the
same as base, indicating that the memory has been allocated but needs to
be read in from the file. Return -1 if the address differs, to relocation
of the PCH file would be required. */
int
default_gt_pch_use_address (void *base, size_t size, int fd ATTRIBUTE_UNUSED,
size_t offset ATTRIBUTE_UNUSED)
{
void *addr = xmalloc (size);
return (addr == base) - 1;
}
/* Default version of HOST_HOOKS_GT_PCH_GET_ADDRESS. Return the
alignment required for allocating virtual memory. Usually this is the
same as pagesize. */
size_t
default_gt_pch_alloc_granularity (void)
{
return getpagesize();
}
#if HAVE_MMAP_FILE
/* Default version of HOST_HOOKS_GT_PCH_GET_ADDRESS when mmap is present.
We temporarily allocate SIZE bytes, and let the kernel place the data
wherever it will. If it worked, that's our spot, if not we're likely
to be in trouble. */
void *
mmap_gt_pch_get_address (size_t size, int fd)
{
void *ret;
ret = mmap (NULL, size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
if (ret == (void *) MAP_FAILED)
ret = NULL;
else
munmap (ret, size);
return ret;
}
/* Default version of HOST_HOOKS_GT_PCH_USE_ADDRESS when mmap is present.
Map SIZE bytes of FD+OFFSET at BASE. Return 1 if we succeeded at
mapping the data at BASE, -1 if we couldn't.
This version assumes that the kernel honors the START operand of mmap
even without MAP_FIXED if START through START+SIZE are not currently
mapped with something. */
int
mmap_gt_pch_use_address (void *base, size_t size, int fd, size_t offset)
{
void *addr;
/* We're called with size == 0 if we're not planning to load a PCH
file at all. This allows the hook to free any static space that
we might have allocated at link time. */
if (size == 0)
return -1;
addr = mmap (base, size, PROT_READ | PROT_WRITE, MAP_PRIVATE,
fd, offset);
return addr == base ? 1 : -1;
}
#endif /* HAVE_MMAP_FILE */
/* Modify the bound based on rlimits. */
static double
ggc_rlimit_bound (double limit)
{
#if defined(HAVE_GETRLIMIT)
struct rlimit rlim;
# if defined (RLIMIT_AS)
/* RLIMIT_AS is what POSIX says is the limit on mmap. Presumably
any OS which has RLIMIT_AS also has a working mmap that GCC will use. */
if (getrlimit (RLIMIT_AS, &rlim) == 0
&& rlim.rlim_cur != (rlim_t) RLIM_INFINITY
&& rlim.rlim_cur < limit)
limit = rlim.rlim_cur;
# elif defined (RLIMIT_DATA)
/* ... but some older OSs bound mmap based on RLIMIT_DATA, or we
might be on an OS that has a broken mmap. (Others don't bound
mmap at all, apparently.) */
if (getrlimit (RLIMIT_DATA, &rlim) == 0
&& rlim.rlim_cur != (rlim_t) RLIM_INFINITY
&& rlim.rlim_cur < limit
/* Darwin has this horribly bogus default setting of
RLIMIT_DATA, to 6144Kb. No-one notices because RLIMIT_DATA
appears to be ignored. Ignore such silliness. If a limit
this small was actually effective for mmap, GCC wouldn't even
start up. */
&& rlim.rlim_cur >= 8 * 1024 * 1024)
limit = rlim.rlim_cur;
# endif /* RLIMIT_AS or RLIMIT_DATA */
#endif /* HAVE_GETRLIMIT */
return limit;
}
/* Heuristic to set a default for GGC_MIN_EXPAND. */
int
ggc_min_expand_heuristic (void)
{
double min_expand = physmem_total();
/* Adjust for rlimits. */
min_expand = ggc_rlimit_bound (min_expand);
/* The heuristic is a percentage equal to 30% + 70%*(RAM/1GB), yielding
a lower bound of 30% and an upper bound of 100% (when RAM >= 1GB). */
min_expand /= 1024*1024*1024;
min_expand *= 70;
min_expand = MIN (min_expand, 70);
min_expand += 30;
return min_expand;
}
/* Heuristic to set a default for GGC_MIN_HEAPSIZE. */
int
ggc_min_heapsize_heuristic (void)
{
double phys_kbytes = physmem_total();
double limit_kbytes = ggc_rlimit_bound (phys_kbytes * 2);
phys_kbytes /= 1024; /* Convert to Kbytes. */
limit_kbytes /= 1024;
/* The heuristic is RAM/8, with a lower bound of 4M and an upper
bound of 128M (when RAM >= 1GB). */
phys_kbytes /= 8;
#if defined(HAVE_GETRLIMIT) && defined (RLIMIT_RSS)
/* Try not to overrun the RSS limit while doing garbage collection.
The RSS limit is only advisory, so no margin is subtracted. */
{
struct rlimit rlim;
if (getrlimit (RLIMIT_RSS, &rlim) == 0
&& rlim.rlim_cur != (rlim_t) RLIM_INFINITY)
phys_kbytes = MIN (phys_kbytes, rlim.rlim_cur / 1024);
}
# endif
/* Don't blindly run over our data limit; do GC at least when the
*next* GC would be within 16Mb of the limit. If GCC does hit the
data limit, compilation will fail, so this tries to be
conservative. */
limit_kbytes = MAX (0, limit_kbytes - 16 * 1024);
limit_kbytes = (limit_kbytes * 100) / (110 + ggc_min_expand_heuristic());
phys_kbytes = MIN (phys_kbytes, limit_kbytes);
phys_kbytes = MAX (phys_kbytes, 4 * 1024);
phys_kbytes = MIN (phys_kbytes, 128 * 1024);
return phys_kbytes;
}
void
init_ggc_heuristics (void)
{
#if !defined ENABLE_GC_CHECKING && !defined ENABLE_GC_ALWAYS_COLLECT
set_param_value ("ggc-min-expand", ggc_min_expand_heuristic());
set_param_value ("ggc-min-heapsize", ggc_min_heapsize_heuristic());
#endif
}
#ifdef GATHER_STATISTICS
/* Datastructure used to store per-call-site statistics. */
struct loc_descriptor
{
const char *file;
int line;
const char *function;
int times;
size_t allocated;
size_t overhead;
size_t freed;
size_t collected;
};
/* Hashtable used for statistics. */
static htab_t loc_hash;
/* Hash table helpers functions. */
static hashval_t
hash_descriptor (const void *p)
{
const struct loc_descriptor *d = p;
return htab_hash_pointer (d->function) | d->line;
}
static int
eq_descriptor (const void *p1, const void *p2)
{
const struct loc_descriptor *d = p1;
const struct loc_descriptor *d2 = p2;
return (d->file == d2->file && d->line == d2->line
&& d->function == d2->function);
}
/* Hashtable converting address of allocated field to loc descriptor. */
static htab_t ptr_hash;
struct ptr_hash_entry
{
void *ptr;
struct loc_descriptor *loc;
size_t size;
};
/* Hash table helpers functions. */
static hashval_t
hash_ptr (const void *p)
{
const struct ptr_hash_entry *d = p;
return htab_hash_pointer (d->ptr);
}
static int
eq_ptr (const void *p1, const void *p2)
{
const struct ptr_hash_entry *p = p1;
return (p->ptr == p2);
}
/* Return descriptor for given call site, create new one if needed. */
static struct loc_descriptor *
loc_descriptor (const char *name, int line, const char *function)
{
struct loc_descriptor loc;
struct loc_descriptor **slot;
loc.file = name;
loc.line = line;
loc.function = function;
if (!loc_hash)
loc_hash = htab_create (10, hash_descriptor, eq_descriptor, NULL);
slot = (struct loc_descriptor **) htab_find_slot (loc_hash, &loc, 1);
if (*slot)
return *slot;
*slot = xcalloc (sizeof (**slot), 1);
(*slot)->file = name;
(*slot)->line = line;
(*slot)->function = function;
return *slot;
}
/* Record ALLOCATED and OVERHEAD bytes to descriptor NAME:LINE (FUNCTION). */
void
ggc_record_overhead (size_t allocated, size_t overhead, void *ptr,
const char *name, int line, const char *function)
{
struct loc_descriptor *loc = loc_descriptor (name, line, function);
struct ptr_hash_entry *p = XNEW (struct ptr_hash_entry);
PTR *slot;
p->ptr = ptr;
p->loc = loc;
p->size = allocated + overhead;
if (!ptr_hash)
ptr_hash = htab_create (10, hash_ptr, eq_ptr, NULL);
slot = htab_find_slot_with_hash (ptr_hash, ptr, htab_hash_pointer (ptr), INSERT);
gcc_assert (!*slot);
*slot = p;
loc->times++;
loc->allocated+=allocated;
loc->overhead+=overhead;
}
/* Helper function for prune_overhead_list. See if SLOT is still marked and
remove it from hashtable if it is not. */
static int
ggc_prune_ptr (void **slot, void *b ATTRIBUTE_UNUSED)
{
struct ptr_hash_entry *p = *slot;
if (!ggc_marked_p (p->ptr))
{
p->loc->collected += p->size;
htab_clear_slot (ptr_hash, slot);
free (p);
}
return 1;
}
/* After live values has been marked, walk all recorded pointers and see if
they are still live. */
void
ggc_prune_overhead_list (void)
{
htab_traverse (ptr_hash, ggc_prune_ptr, NULL);
}
/* Notice that the pointer has been freed. */
void
ggc_free_overhead (void *ptr)
{
PTR *slot = htab_find_slot_with_hash (ptr_hash, ptr, htab_hash_pointer (ptr),
NO_INSERT);
struct ptr_hash_entry *p = *slot;
p->loc->freed += p->size;
htab_clear_slot (ptr_hash, slot);
free (p);
}
/* Helper for qsort; sort descriptors by amount of memory consumed. */
static int
cmp_statistic (const void *loc1, const void *loc2)
{
struct loc_descriptor *l1 = *(struct loc_descriptor **) loc1;
struct loc_descriptor *l2 = *(struct loc_descriptor **) loc2;
return ((l1->allocated + l1->overhead - l1->freed) -
(l2->allocated + l2->overhead - l2->freed));
}
/* Collect array of the descriptors from hashtable. */
struct loc_descriptor **loc_array;
static int
add_statistics (void **slot, void *b)
{
int *n = (int *)b;
loc_array[*n] = (struct loc_descriptor *) *slot;
(*n)++;
return 1;
}
/* Dump per-site memory statistics. */
#endif
void
dump_ggc_loc_statistics (void)
{
#ifdef GATHER_STATISTICS
int nentries = 0;
char s[4096];
size_t collected = 0, freed = 0, allocated = 0, overhead = 0, times = 0;
int i;
ggc_force_collect = true;
ggc_collect ();
loc_array = xcalloc (sizeof (*loc_array), loc_hash->n_elements);
fprintf (stderr, "-------------------------------------------------------\n");
fprintf (stderr, "\n%-48s %10s %10s %10s %10s %10s\n",
"source location", "Garbage", "Freed", "Leak", "Overhead", "Times");
fprintf (stderr, "-------------------------------------------------------\n");
htab_traverse (loc_hash, add_statistics, &nentries);
qsort (loc_array, nentries, sizeof (*loc_array), cmp_statistic);
for (i = 0; i < nentries; i++)
{
struct loc_descriptor *d = loc_array[i];
allocated += d->allocated;
times += d->times;
freed += d->freed;
collected += d->collected;
overhead += d->overhead;
}
for (i = 0; i < nentries; i++)
{
struct loc_descriptor *d = loc_array[i];
if (d->allocated)
{
const char *s1 = d->file;
const char *s2;
while ((s2 = strstr (s1, "gcc/")))
s1 = s2 + 4;
sprintf (s, "%s:%i (%s)", s1, d->line, d->function);
s[48] = 0;
fprintf (stderr, "%-48s %10li:%4.1f%% %10li:%4.1f%% %10li:%4.1f%% %10li:%4.1f%% %10li\n", s,
(long)d->collected,
(d->collected) * 100.0 / collected,
(long)d->freed,
(d->freed) * 100.0 / freed,
(long)(d->allocated + d->overhead - d->freed - d->collected),
(d->allocated + d->overhead - d->freed - d->collected) * 100.0
/ (allocated + overhead - freed - collected),
(long)d->overhead,
d->overhead * 100.0 / overhead,
(long)d->times);
}
}
fprintf (stderr, "%-48s %10ld %10ld %10ld %10ld %10ld\n",
"Total", (long)collected, (long)freed,
(long)(allocated + overhead - freed - collected), (long)overhead,
(long)times);
fprintf (stderr, "%-48s %10s %10s %10s %10s %10s\n",
"source location", "Garbage", "Freed", "Leak", "Overhead", "Times");
fprintf (stderr, "-------------------------------------------------------\n");
#endif
}
| {
"content_hash": "72653e505974bc9b86dce581dc60fa7f",
"timestamp": "",
"source": "github",
"line_count": 985,
"max_line_length": 95,
"avg_line_length": 28.255837563451777,
"alnum_prop": 0.627946248922104,
"repo_name": "shaotuanchen/sunflower_exp",
"id": "6267ea04c19fc96332cd8d6b9ab7e2c824607fe0",
"size": "28610",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "tools/source/gcc-4.2.4/gcc/ggc-common.c",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Assembly",
"bytes": "459993"
},
{
"name": "Awk",
"bytes": "6562"
},
{
"name": "Batchfile",
"bytes": "9028"
},
{
"name": "C",
"bytes": "50326113"
},
{
"name": "C++",
"bytes": "2040239"
},
{
"name": "CSS",
"bytes": "2355"
},
{
"name": "Clarion",
"bytes": "2484"
},
{
"name": "Coq",
"bytes": "61440"
},
{
"name": "DIGITAL Command Language",
"bytes": "69150"
},
{
"name": "Emacs Lisp",
"bytes": "186910"
},
{
"name": "Fortran",
"bytes": "5364"
},
{
"name": "HTML",
"bytes": "2171356"
},
{
"name": "JavaScript",
"bytes": "27164"
},
{
"name": "Logos",
"bytes": "159114"
},
{
"name": "M",
"bytes": "109006"
},
{
"name": "M4",
"bytes": "100614"
},
{
"name": "Makefile",
"bytes": "5409865"
},
{
"name": "Mercury",
"bytes": "702"
},
{
"name": "Module Management System",
"bytes": "56956"
},
{
"name": "OCaml",
"bytes": "253115"
},
{
"name": "Objective-C",
"bytes": "57800"
},
{
"name": "Papyrus",
"bytes": "3298"
},
{
"name": "Perl",
"bytes": "70992"
},
{
"name": "Perl 6",
"bytes": "693"
},
{
"name": "PostScript",
"bytes": "3440120"
},
{
"name": "Python",
"bytes": "40729"
},
{
"name": "Redcode",
"bytes": "1140"
},
{
"name": "Roff",
"bytes": "3794721"
},
{
"name": "SAS",
"bytes": "56770"
},
{
"name": "SRecode Template",
"bytes": "540157"
},
{
"name": "Shell",
"bytes": "1560436"
},
{
"name": "Smalltalk",
"bytes": "10124"
},
{
"name": "Standard ML",
"bytes": "1212"
},
{
"name": "TeX",
"bytes": "385584"
},
{
"name": "WebAssembly",
"bytes": "52904"
},
{
"name": "Yacc",
"bytes": "510934"
}
],
"symlink_target": ""
} |
package peer
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import google_protobuf1 "github.com/golang/protobuf/ptypes/timestamp"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// A ProposalResponse is returned from an endorser to the proposal submitter.
// The idea is that this message contains the endorser's response to the
// request of a client to perform an action over a chaincode (or more
// generically on the ledger); the response might be success/error (conveyed in
// the Response field) together with a description of the action and a
// signature over it by that endorser. If a sufficient number of distinct
// endorsers agree on the same action and produce signature to that effect, a
// transaction can be generated and sent for ordering.
type ProposalResponse struct {
// Version indicates message protocol version
Version int32 `protobuf:"varint,1,opt,name=version" json:"version,omitempty"`
// Timestamp is the time that the message
// was created as defined by the sender
Timestamp *google_protobuf1.Timestamp `protobuf:"bytes,2,opt,name=timestamp" json:"timestamp,omitempty"`
// A response message indicating whether the
// endorsement of the action was successful
Response *Response `protobuf:"bytes,4,opt,name=response" json:"response,omitempty"`
// The payload of response. It is the bytes of ProposalResponsePayload
Payload []byte `protobuf:"bytes,5,opt,name=payload,proto3" json:"payload,omitempty"`
// The endorsement of the proposal, basically
// the endorser's signature over the payload
Endorsement *Endorsement `protobuf:"bytes,6,opt,name=endorsement" json:"endorsement,omitempty"`
}
func (m *ProposalResponse) Reset() { *m = ProposalResponse{} }
func (m *ProposalResponse) String() string { return proto.CompactTextString(m) }
func (*ProposalResponse) ProtoMessage() {}
func (*ProposalResponse) Descriptor() ([]byte, []int) { return fileDescriptor7, []int{0} }
func (m *ProposalResponse) GetTimestamp() *google_protobuf1.Timestamp {
if m != nil {
return m.Timestamp
}
return nil
}
func (m *ProposalResponse) GetResponse() *Response {
if m != nil {
return m.Response
}
return nil
}
func (m *ProposalResponse) GetEndorsement() *Endorsement {
if m != nil {
return m.Endorsement
}
return nil
}
// A response with a representation similar to an HTTP response that can
// be used within another message.
type Response struct {
// A status code that should follow the HTTP status codes.
Status int32 `protobuf:"varint,1,opt,name=status" json:"status,omitempty"`
// A message associated with the response code.
Message string `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"`
// A payload that can be used to include metadata with this response.
Payload []byte `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"`
}
func (m *Response) Reset() { *m = Response{} }
func (m *Response) String() string { return proto.CompactTextString(m) }
func (*Response) ProtoMessage() {}
func (*Response) Descriptor() ([]byte, []int) { return fileDescriptor7, []int{1} }
// ProposalResponsePayload is the payload of a proposal response. This message
// is the "bridge" between the client's request and the endorser's action in
// response to that request. Concretely, for chaincodes, it contains a hashed
// representation of the proposal (proposalHash) and a representation of the
// chaincode state changes and events inside the extension field.
type ProposalResponsePayload struct {
// Hash of the proposal that triggered this response. The hash is used to
// link a response with its proposal, both for bookeeping purposes on an
// asynchronous system and for security reasons (accountability,
// non-repudiation). The hash usually covers the entire Proposal message
// (byte-by-byte). However this implies that the hash can only be verified
// if the entire proposal message is available when ProposalResponsePayload is
// included in a transaction or stored in the ledger. For confidentiality
// reasons, with chaincodes it might be undesirable to store the proposal
// payload in the ledger. If the type is CHAINCODE, this is handled by
// separating the proposal's header and
// the payload: the header is always hashed in its entirety whereas the
// payload can either be hashed fully, or only its hash may be hashed, or
// nothing from the payload can be hashed. The PayloadVisibility field in the
// Header's extension controls to which extent the proposal payload is
// "visible" in the sense that was just explained.
ProposalHash []byte `protobuf:"bytes,1,opt,name=proposalHash,proto3" json:"proposalHash,omitempty"`
// Extension should be unmarshaled to a type-specific message. The type of
// the extension in any proposal response depends on the type of the proposal
// that the client selected when the proposal was initially sent out. In
// particular, this information is stored in the type field of a Header. For
// chaincode, it's a ChaincodeAction message
Extension []byte `protobuf:"bytes,2,opt,name=extension,proto3" json:"extension,omitempty"`
}
func (m *ProposalResponsePayload) Reset() { *m = ProposalResponsePayload{} }
func (m *ProposalResponsePayload) String() string { return proto.CompactTextString(m) }
func (*ProposalResponsePayload) ProtoMessage() {}
func (*ProposalResponsePayload) Descriptor() ([]byte, []int) { return fileDescriptor7, []int{2} }
// An endorsement is a signature of an endorser over a proposal response. By
// producing an endorsement message, an endorser implicitly "approves" that
// proposal response and the actions contained therein. When enough
// endorsements have been collected, a transaction can be generated out of a
// set of proposal responses. Note that this message only contains an identity
// and a signature but no signed payload. This is intentional because
// endorsements are supposed to be collected in a transaction, and they are all
// expected to endorse a single proposal response/action (many endorsements
// over a single proposal response)
type Endorsement struct {
// Identity of the endorser (e.g. its certificate)
Endorser []byte `protobuf:"bytes,1,opt,name=endorser,proto3" json:"endorser,omitempty"`
// Signature of the payload included in ProposalResponse concatenated with
// the endorser's certificate; ie, sign(ProposalResponse.payload + endorser)
Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"`
}
func (m *Endorsement) Reset() { *m = Endorsement{} }
func (m *Endorsement) String() string { return proto.CompactTextString(m) }
func (*Endorsement) ProtoMessage() {}
func (*Endorsement) Descriptor() ([]byte, []int) { return fileDescriptor7, []int{3} }
func init() {
proto.RegisterType((*ProposalResponse)(nil), "protos.ProposalResponse")
proto.RegisterType((*Response)(nil), "protos.Response")
proto.RegisterType((*ProposalResponsePayload)(nil), "protos.ProposalResponsePayload")
proto.RegisterType((*Endorsement)(nil), "protos.Endorsement")
}
func init() { proto.RegisterFile("peer/proposal_response.proto", fileDescriptor7) }
var fileDescriptor7 = []byte{
// 343 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x5c, 0x52, 0xdf, 0x4b, 0xeb, 0x30,
0x14, 0xa6, 0xbb, 0x77, 0xbb, 0xdb, 0xd9, 0x1e, 0x46, 0x2e, 0x68, 0x19, 0x03, 0x47, 0x9f, 0x26,
0x4a, 0x0b, 0x8a, 0xe0, 0xb3, 0x20, 0xfa, 0x38, 0x82, 0xf8, 0xa0, 0x0f, 0x92, 0x6e, 0x67, 0x5d,
0xa1, 0x6d, 0x42, 0x4e, 0x2a, 0xee, 0x0f, 0xf6, 0xff, 0x90, 0xa6, 0x49, 0xb7, 0xf9, 0x54, 0xbe,
0xd3, 0x2f, 0xdf, 0x8f, 0xe4, 0xc0, 0x5c, 0x21, 0xea, 0x44, 0x69, 0xa9, 0x24, 0x89, 0xe2, 0x43,
0x23, 0x29, 0x59, 0x11, 0xc6, 0x4a, 0x4b, 0x23, 0xd9, 0xc0, 0x7e, 0x68, 0x76, 0x91, 0x49, 0x99,
0x15, 0x98, 0x58, 0x98, 0xd6, 0xdb, 0xc4, 0xe4, 0x25, 0x92, 0x11, 0xa5, 0x6a, 0x89, 0xd1, 0x77,
0x00, 0xd3, 0x95, 0x13, 0xe1, 0x4e, 0x83, 0x85, 0xf0, 0xef, 0x13, 0x35, 0xe5, 0xb2, 0x0a, 0x83,
0x45, 0xb0, 0xec, 0x73, 0x0f, 0xd9, 0x3d, 0x8c, 0x3a, 0x85, 0xb0, 0xb7, 0x08, 0x96, 0xe3, 0x9b,
0x59, 0xdc, 0x7a, 0xc4, 0xde, 0x23, 0x7e, 0xf1, 0x0c, 0x7e, 0x20, 0xb3, 0x6b, 0x18, 0xfa, 0x8c,
0xe1, 0x5f, 0x7b, 0x70, 0xda, 0x9e, 0xa0, 0xd8, 0xfb, 0xf2, 0x8e, 0xd1, 0x24, 0x50, 0x62, 0x5f,
0x48, 0xb1, 0x09, 0xfb, 0x8b, 0x60, 0x39, 0xe1, 0x1e, 0xb2, 0x3b, 0x18, 0x63, 0xb5, 0x91, 0x9a,
0xb0, 0xc4, 0xca, 0x84, 0x03, 0x2b, 0xf5, 0xdf, 0x4b, 0x3d, 0x1e, 0x7e, 0xf1, 0x63, 0x5e, 0xf4,
0x0a, 0xc3, 0xae, 0xde, 0x19, 0x0c, 0xc8, 0x08, 0x53, 0x93, 0x6b, 0xe7, 0x50, 0x63, 0x5a, 0x22,
0x91, 0xc8, 0xd0, 0x56, 0x1b, 0x71, 0x0f, 0x8f, 0xe3, 0xfc, 0x39, 0x89, 0x13, 0xbd, 0xc3, 0xf9,
0xef, 0xeb, 0x5b, 0xb9, 0xa4, 0x11, 0x4c, 0xfc, 0xf3, 0x3c, 0x0b, 0xda, 0x59, 0xb3, 0x09, 0x3f,
0x99, 0xb1, 0x39, 0x8c, 0xf0, 0xcb, 0x60, 0x65, 0xef, 0xba, 0x67, 0x09, 0x87, 0x41, 0xf4, 0x04,
0xe3, 0xa3, 0x42, 0x6c, 0x06, 0x43, 0x57, 0x49, 0x3b, 0xb1, 0x0e, 0x37, 0x42, 0x94, 0x67, 0x95,
0x30, 0xb5, 0x46, 0x2f, 0xd4, 0x0d, 0x1e, 0xae, 0xde, 0x2e, 0xb3, 0xdc, 0xec, 0xea, 0x34, 0x5e,
0xcb, 0x32, 0xd9, 0xed, 0x15, 0xea, 0x02, 0x37, 0x19, 0xea, 0x64, 0x2b, 0x52, 0x9d, 0xaf, 0xdb,
0xfd, 0xa0, 0xa4, 0xd9, 0xa9, 0xb4, 0xdd, 0x9d, 0xdb, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x38,
0x84, 0xd8, 0x0f, 0x62, 0x02, 0x00, 0x00,
}
| {
"content_hash": "475f9e6d2274996e1937ac862b09966a",
"timestamp": "",
"source": "github",
"line_count": 169,
"max_line_length": 105,
"avg_line_length": 56.47337278106509,
"alnum_prop": 0.7238055322715843,
"repo_name": "masterDev1985/fabric",
"id": "8024ef1b3a4a9db74bed60ed7429ec041faf9c0b",
"size": "9637",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "protos/peer/proposal_response.pb.go",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Gherkin",
"bytes": "110633"
},
{
"name": "Go",
"bytes": "2918014"
},
{
"name": "Java",
"bytes": "70137"
},
{
"name": "Makefile",
"bytes": "13630"
},
{
"name": "Protocol Buffer",
"bytes": "78675"
},
{
"name": "Python",
"bytes": "166502"
},
{
"name": "Ruby",
"bytes": "3255"
},
{
"name": "Shell",
"bytes": "42783"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8"?>
<CrawlItem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Text>Dobar kebab, došao za nekih 35 minuta (rečeno je 42), malo hladan, ali razumljivo s obzirom koliko je daleko. Luk me malo ubio u pojam, ali pretpostavljam da je to stvar ukusa :)</Text>
<Rating>5</Rating>
<Source>http://pauza.hr/menu/kebab-paradise</Source>
</CrawlItem> | {
"content_hash": "975a9277be523c6b8d38699988279dd4",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 193,
"avg_line_length": 72.83333333333333,
"alnum_prop": 0.7185354691075515,
"repo_name": "Tweety-FER/tar-polarity",
"id": "68993f5979b379cadb2a5b0c8ff4a81d82a08b60",
"size": "439",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "CropinionDataset/reviews_original/Train/comment3270.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "4796"
},
{
"name": "Python",
"bytes": "9870"
}
],
"symlink_target": ""
} |
@interface MemeOnWeb : UIViewController <UIWebViewDelegate>
{
NSString *urlToBeLoaded;
UIWebView *theView;
UIActivityIndicatorView *laRuota;
}
@property (retain, nonatomic) NSString *urlToBeLoaded;
@property (retain, nonatomic) IBOutlet UIWebView *theView;
@property (retain, nonatomic) IBOutlet UIActivityIndicatorView *laRuota;
@end
| {
"content_hash": "15a2e6c477fbcd1ff4c89f9cd2424c49",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 72,
"avg_line_length": 28.333333333333332,
"alnum_prop": 0.8029411764705883,
"repo_name": "ilTofa/Meemi",
"id": "bfdc3aa6e71e54c7e3c4ab32c9b476b9bfb8fa40",
"size": "600",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Classes/MemeOnWeb.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "944"
},
{
"name": "Objective-C",
"bytes": "802177"
}
],
"symlink_target": ""
} |
package org.develnext.jphp.ext.webserver.classes;
import org.develnext.jphp.ext.webserver.WebServerExtension;
import php.runtime.Memory;
import php.runtime.annotation.Reflection;
import php.runtime.annotation.Reflection.Abstract;
import php.runtime.annotation.Reflection.Getter;
import php.runtime.annotation.Reflection.Property;
import php.runtime.annotation.Reflection.Signature;
import php.runtime.env.Environment;
import php.runtime.ext.core.classes.stream.MiscStream;
import php.runtime.ext.core.classes.stream.Stream;
import php.runtime.lang.BaseWrapper;
import php.runtime.memory.ArrayMemory;
import php.runtime.reflection.ClassEntity;
import javax.servlet.ServletInputStream;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
@Abstract
@Reflection.Name("WebRequest")
@Reflection.Namespace(WebServerExtension.NS)
public class PWebRequest extends BaseWrapper<HttpServletRequest> {
interface WrappedInterface {
@Property String authType();
@Property String method();
@Property String scheme();
@Property String pathInfo();
@Property String pathTranslated();
@Property String contextPath();
@Property String queryString();
@Property String remoteUser();
@Property String servletPath();
}
protected String body;
public PWebRequest(Environment env, HttpServletRequest wrappedObject) {
super(env, wrappedObject);
}
public PWebRequest(Environment env, ClassEntity clazz) {
super(env, clazz);
}
@Signature
protected void __construct(PWebRequest parent) {
this.__wrappedObject = parent.getWrappedObject();
}
@Getter
protected String getHost() {
return getWrappedObject().getHeader("host");
}
@Getter
protected String getUserAgent() {
return getWrappedObject().getHeader("user-agent");
}
@Getter
protected int getPort() {
return getWrappedObject().getServerPort();
}
@Getter
protected String getUrl() {
return getWrappedObject().getRequestURL().toString();
}
@Getter
protected String getIp() {
return getWrappedObject().getRemoteAddr();
}
@Signature
public Stream getBodyStream(Environment env) throws IOException {
ServletInputStream inputStream = getWrappedObject().getInputStream();
if (inputStream.isFinished()) {
throw new IOException("Unable to read the body repeatedly");
}
return new MiscStream(env, inputStream);
}
@Getter
public Memory getCookies() {
Cookie[] cookies = getWrappedObject().getCookies();
ArrayMemory result = new ArrayMemory();
if (cookies != null) {
for (Cookie cookie : cookies) {
ArrayMemory item = new ArrayMemory();
item.refOfIndex("name").assign(cookie.getName());
item.refOfIndex("value").assign(cookie.getValue());
item.refOfIndex("path").assign(cookie.getPath());
item.refOfIndex("domain").assign(cookie.getDomain());
item.refOfIndex("maxAge").assign(cookie.getMaxAge());
item.refOfIndex("httpOnly").assign(cookie.isHttpOnly());
item.refOfIndex("secure").assign(cookie.getSecure());
item.refOfIndex("comment").assign(cookie.getComment());
result.add(item);
}
}
return result.toConstant();
}
@Signature
public String getBody(Environment env) throws IOException {
if (body != null) {
return body;
}
StringBuffer jb = new StringBuffer();
String line;
BufferedReader reader = new BufferedReader(new InputStreamReader(getWrappedObject().getInputStream()));
while ((line = reader.readLine()) != null) {
jb.append(line);
}
return body = jb.toString();
}
@Signature
public static PWebRequest current(Environment env) {
return env.getUserValue(PWebRequest.class);
}
}
| {
"content_hash": "53d745b5e252501457293d2ce1823771",
"timestamp": "",
"source": "github",
"line_count": 138,
"max_line_length": 111,
"avg_line_length": 30.340579710144926,
"alnum_prop": 0.6618103654167662,
"repo_name": "livingvirus/jphp",
"id": "04ced9c3f3e85d40e20c1e01e9663be29b5acc34",
"size": "4187",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "jphp-webserver-ext/src/main/java/org/develnext/jphp/ext/webserver/classes/PWebRequest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "112"
},
{
"name": "C++",
"bytes": "510"
},
{
"name": "Groovy",
"bytes": "14969"
},
{
"name": "HTML",
"bytes": "4169"
},
{
"name": "Java",
"bytes": "3522396"
},
{
"name": "PHP",
"bytes": "1129715"
},
{
"name": "Shell",
"bytes": "441"
},
{
"name": "SourcePawn",
"bytes": "90"
}
],
"symlink_target": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.