text stringlengths 2 1.04M | meta dict |
|---|---|
short-description: Generic python module
authors:
- name: Mathieu Duponchelle
email: mathieu@centricular.com
years: [2018]
has-copyright: false
...
# Python module
This module provides support for finding and building extensions against
python installations, be they python 2 or 3.
*Added 0.46.0*
## Functions
### `find_installation()`
``` meson
pymod.find_installation(name_or_path, ...)
```
Find a python installation matching `name_or_path`.
That argument is optional, if not provided then the returned python
installation will be the one used to run meson.
If provided, it can be:
- A simple name, eg `python-2.7`, meson will look for an external program
named that way, using [find_program]
- A path, eg `/usr/local/bin/python3.4m`
- One of `python2` or `python3`: in either case, the module will try some
alternative names: `py -2` or `py -3` on Windows, and `python` everywhere.
In the latter case, it will check whether the version provided by the
sysconfig module matches the required major version
Keyword arguments are the following:
- `required`: by default, `required` is set to `true` and Meson will
abort if no python installation can be found. If `required` is set to `false`,
Meson will continue even if no python installation was found. You can
then use the `.found()` method on the returned object to check
whether it was found or not.
**Returns**: a [python installation][`python_installation` object]
## `python_installation` object
The `python_installation` object is an [external program], with several
added methods.
### Methods
#### `extension_module()`
``` meson
shared_module py_installation.extension_module(module_name, list_of_sources, ...)
```
Create a `shared_module` target that is named according to the naming
conventions of the target platform.
All positional and keyword arguments are the same as for [shared_module],
excluding `name_suffix` and `name_prefix`, and with the addition of the following:
- `subdir`: By default, meson will install the extension module in
the relevant top-level location for the python installation, eg
`/usr/lib/site-packages`. When subdir is passed to this method,
it will be appended to that location. This keyword argument is
mutually exclusive with `install_dir`
`extension_module` does not add any dependencies to the library so user may
need to add `dependencies : py_installation.dependency()`, see [][`dependency()`].
**Returns**: a [buildtarget object]
#### `dependency()`
``` meson
python_dependency py_installation.dependency(...)
```
This method accepts the same arguments as the standard [dependency] function.
**Returns**: a [python dependency][`python_dependency` object]
#### `install_sources()`
``` meson
void py_installation.install_sources(list_of_files, ...)
```
Install actual python sources (`.py`).
All positional and keyword arguments are the same as for [install_data],
with the addition of the following:
- `pure`: On some platforms, architecture independent files are expected
to be placed in a separate directory. However, if the python sources
should be installed alongside an extension module built with this
module, this keyword argument can be used to override that behaviour.
Defaults to `true`
- `subdir`: See documentation for the argument of the same name to
[][`extension_module()`]
#### `get_install_dir()`
``` meson
string py_installation.get_install_dir(...)
```
Retrieve the directory [][`install_sources()`] will install to.
It can be useful in cases where `install_sources` cannot be used directly,
for example when using [configure_file].
This function accepts no arguments, its keyword arguments are the same
as [][`install_sources()`].
**Returns**: A string
#### `language_version()`
``` meson
string py_installation.language_version()
```
Get the major.minor python version, eg `2.7`.
The version is obtained through the `sysconfig` module.
This function expects no arguments or keyword arguments.
**Returns**: A string
#### `get_path()`
``` meson
string py_installation.get_path(path_name, fallback)
```
Get a path as defined by the `sysconfig` module.
For example:
``` meson
purelib = py_installation.get_path('purelib')
```
This function requires at least one argument, `path_name`,
which is expected to be a non-empty string.
If `fallback` is specified, it will be returned if no path
with the given name exists. Otherwise, attempting to read
a non-existing path will cause a fatal error.
**Returns**: A string
#### `has_path()`
``` meson
bool py_installation.has_path(path_name)
```
**Returns**: true if a path named `path_name` can be retrieved with
[][`get_path()`], false otherwise.
#### `get_variable()`
``` meson
string py_installation.get_variable(variable_name, fallback)
```
Get a variable as defined by the `sysconfig` module.
For example:
``` meson
py_bindir = py_installation.get_variable('BINDIR', '')
```
This function requires at least one argument, `variable_name`,
which is expected to be a non-empty string.
If `fallback` is specified, it will be returned if no variable
with the given name exists. Otherwise, attempting to read
a non-existing variable will cause a fatal error.
**Returns**: A string
#### `has_variable()`
``` meson
bool py_installation.has_variable(variable_name)
```
**Returns**: true if a variable named `variable_name` can be retrieved with
[][`get_variable()`], false otherwise.
## `python_dependency` object
This [dependency object] subclass will try various methods to obtain the
compiler and linker arguments, starting with pkg-config then potentially
using information obtained from python's `sysconfig` module.
It exposes the same methods as its parent class.
[find_program]: Reference-manual.md#find_program
[shared_module]: Reference-manual.md#shared_module
[external program]: Reference-manual.md#external-program-object
[dependency]: Reference-manual.md#dependency
[install_data]: Reference-manual.md#install-data
[configure_file]: Reference-manual.md#configure-file
[dependency object]: Reference-manual.md#dependency-object
[buildtarget object]: Reference-manual.md#build-target-object
| {
"content_hash": "f2463ba032e9576d10a7333999b476ad",
"timestamp": "",
"source": "github",
"line_count": 220,
"max_line_length": 82,
"avg_line_length": 28.145454545454545,
"alnum_prop": 0.7377260981912145,
"repo_name": "jeandet/meson",
"id": "51721f08c279c2161b7eb4829966acc43ddd29af",
"size": "6196",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "docs/markdown/Python-module.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Assembly",
"bytes": "4190"
},
{
"name": "Batchfile",
"bytes": "868"
},
{
"name": "C",
"bytes": "143772"
},
{
"name": "C#",
"bytes": "949"
},
{
"name": "C++",
"bytes": "27136"
},
{
"name": "CMake",
"bytes": "1780"
},
{
"name": "D",
"bytes": "4573"
},
{
"name": "Dockerfile",
"bytes": "754"
},
{
"name": "Emacs Lisp",
"bytes": "919"
},
{
"name": "Fortran",
"bytes": "4590"
},
{
"name": "Genie",
"bytes": "341"
},
{
"name": "Inno Setup",
"bytes": "372"
},
{
"name": "Java",
"bytes": "2125"
},
{
"name": "JavaScript",
"bytes": "136"
},
{
"name": "LLVM",
"bytes": "75"
},
{
"name": "Lex",
"bytes": "135"
},
{
"name": "Meson",
"bytes": "321893"
},
{
"name": "Objective-C",
"bytes": "1092"
},
{
"name": "Objective-C++",
"bytes": "332"
},
{
"name": "Python",
"bytes": "1873182"
},
{
"name": "Roff",
"bytes": "301"
},
{
"name": "Rust",
"bytes": "1079"
},
{
"name": "Shell",
"bytes": "2083"
},
{
"name": "Swift",
"bytes": "1152"
},
{
"name": "Vala",
"bytes": "10025"
},
{
"name": "Verilog",
"bytes": "709"
},
{
"name": "Vim script",
"bytes": "9480"
},
{
"name": "Yacc",
"bytes": "50"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_35) on Tue Oct 16 22:49:47 ICT 2012 -->
<TITLE>
org.apache.fop.apps Class Hierarchy (Apache FOP 1.1 API)
</TITLE>
<META NAME="date" CONTENT="2012-10-16">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="org.apache.fop.apps Class Hierarchy (Apache FOP 1.1 API)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Tree</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
fop 1.1</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../org/apache/fop/afp/util/package-tree.html"><B>PREV</B></A>
<A HREF="../../../../org/apache/fop/area/package-tree.html"><B>NEXT</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html?org/apache/fop/apps/package-tree.html" target="_top"><B>FRAMES</B></A>
<A HREF="package-tree.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<CENTER>
<H2>
Hierarchy For Package org.apache.fop.apps
</H2>
</CENTER>
<DL>
<DT><B>Package Hierarchies:</B><DD><A HREF="../../../../overview-tree.html">All Packages</A></DL>
<HR>
<H2>
Class Hierarchy
</H2>
<UL>
<LI TYPE="circle">java.lang.Object<UL>
<LI TYPE="circle">org.apache.fop.apps.<A HREF="../../../../org/apache/fop/apps/Fop.html" title="class in org.apache.fop.apps"><B>Fop</B></A><LI TYPE="circle">org.apache.fop.apps.<A HREF="../../../../org/apache/fop/apps/FopFactory.html" title="class in org.apache.fop.apps"><B>FopFactory</B></A> (implements org.apache.xmlgraphics.image.loader.ImageContext)
<LI TYPE="circle">org.apache.fop.apps.<A HREF="../../../../org/apache/fop/apps/FopFactoryConfigurator.html" title="class in org.apache.fop.apps"><B>FopFactoryConfigurator</B></A><LI TYPE="circle">org.apache.fop.apps.<A HREF="../../../../org/apache/fop/apps/FormattingResults.html" title="class in org.apache.fop.apps"><B>FormattingResults</B></A><LI TYPE="circle">org.apache.fop.apps.<A HREF="../../../../org/apache/fop/apps/FOURIResolver.html" title="class in org.apache.fop.apps"><B>FOURIResolver</B></A> (implements javax.xml.transform.URIResolver)
<LI TYPE="circle">org.apache.fop.apps.<A HREF="../../../../org/apache/fop/apps/FOUserAgent.html" title="class in org.apache.fop.apps"><B>FOUserAgent</B></A><LI TYPE="circle">org.apache.fop.apps.<A HREF="../../../../org/apache/fop/apps/PageSequenceResults.html" title="class in org.apache.fop.apps"><B>PageSequenceResults</B></A><LI TYPE="circle">java.lang.Throwable (implements java.io.Serializable)
<UL>
<LI TYPE="circle">java.lang.Exception<UL>
<LI TYPE="circle">org.xml.sax.SAXException<UL>
<LI TYPE="circle">org.apache.fop.apps.<A HREF="../../../../org/apache/fop/apps/FOPException.html" title="class in org.apache.fop.apps"><B>FOPException</B></A></UL>
</UL>
</UL>
</UL>
</UL>
<H2>
Interface Hierarchy
</H2>
<UL>
<LI TYPE="circle">org.apache.xmlgraphics.util.MimeConstants<UL>
<LI TYPE="circle">org.apache.fop.apps.<A HREF="../../../../org/apache/fop/apps/MimeConstants.html" title="interface in org.apache.fop.apps"><B>MimeConstants</B></A></UL>
</UL>
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Tree</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
fop 1.1</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../org/apache/fop/afp/util/package-tree.html"><B>PREV</B></A>
<A HREF="../../../../org/apache/fop/area/package-tree.html"><B>NEXT</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html?org/apache/fop/apps/package-tree.html" target="_top"><B>FRAMES</B></A>
<A HREF="package-tree.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
Copyright 1999-2012 The Apache Software Foundation. All Rights Reserved.
</BODY>
</HTML>
| {
"content_hash": "7f40ad54bf79a3ce9c2ff16382335b1c",
"timestamp": "",
"source": "github",
"line_count": 169,
"max_line_length": 551,
"avg_line_length": 46.437869822485204,
"alnum_prop": 0.6343017329255861,
"repo_name": "pconrad/ucsb-cs56-tutorials-fop",
"id": "843ec176d1fd909ed12ca891d2c93d9dd430ef68",
"size": "7848",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "fop-1.1/javadocs/org/apache/fop/apps/package-tree.html",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "23208"
},
{
"name": "Erlang",
"bytes": "15684"
},
{
"name": "Java",
"bytes": "210811"
},
{
"name": "JavaScript",
"bytes": "28643"
},
{
"name": "Perl",
"bytes": "12013"
},
{
"name": "R",
"bytes": "223"
},
{
"name": "Shell",
"bytes": "24838"
},
{
"name": "XSLT",
"bytes": "25384"
}
],
"symlink_target": ""
} |
<div class="all-categories section">
<div class="row" id="profileClubContainer h-100 justify-content-center align-items-center">
<div class="container h-100">
<div class="row h-100 justify-content-center">
<div class="col-lg-4 col-md-5">
<div class="card card-user">
<div id="profileClubImage" class="card-img-top image">
<img src="{{club?.profileImg}}" alt="..."/>
</div>
<div>
<div class="author">
<h4 class="title">{{club?.name}}<br/>
</h4>
</div>
<p class="description text-center">
{{club?.description}}
</p>
</div>
<hr>
<div class="profile-usermenu">
<ul class="list-group list-group-flush">
<mat-toolbar color="primary">
<mat-toolbar-row>
<span><a (click)="goToInfo()">Info del Club</a></span>
</mat-toolbar-row>
<mat-toolbar-row>
<span> <a (click)="goToFields()">Canchas</a> </span>
<span class="example-spacer"></span>
</mat-toolbar-row>
<mat-toolbar-row>
<span><a (click)="goToPassword()">Contraseña</a></span>
<span class="example-spacer"></span>
</mat-toolbar-row>
</mat-toolbar>
</ul>
</div>
</div>
</div>
<div class="col-lg-8 col-md-8">
<div class="card">
<div class="card-body">
<router-outlet></router-outlet>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
| {
"content_hash": "7e81e0f79e1e22edda4cfa28db957cb0",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 93,
"avg_line_length": 29.833333333333332,
"alnum_prop": 0.4346368715083799,
"repo_name": "kwafoawua/foot-booking",
"id": "f6c9350131d3caddd85c27147a67979f8e8a3de5",
"size": "1791",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "client/src/app/profile-club/profile-club.component.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "56620"
},
{
"name": "HTML",
"bytes": "128771"
},
{
"name": "JavaScript",
"bytes": "248998"
},
{
"name": "TypeScript",
"bytes": "104069"
}
],
"symlink_target": ""
} |
<span class="wiki-builder">This page was generated with Wiki Builder. Do not change the format!</span>
## Sekrion, Nexus Mind
### Info
* **enemyId:** R1S1StrikeVenus1Ultra0
* **enemyName:** Sekrion, Nexus Mind
* **cardId:** 601080
* **enemyTier:** Ultra
* **raceName:** Vex
* **raceClass:** UltraHydraA
* **activityType:** Strike
* **activity:** StrikeVenus1
* **destination:** Venus
* **location:** TheNexus
### Stats
statType | statId
-------- | ------
assistsAgainst | assistsAgainstR1S1StrikeVenus1Ultra0
precisionKillsOf | precisionKillOfR1S1StrikeVenus1Ultra0
deathsFrom | deathsFromR1S1StrikeVenus1Ultra0
killsOf | killsOfR1S1StrikeVenus1Ultra0
| {
"content_hash": "2c54202ae3f0037371c8014ed811be2a",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 102,
"avg_line_length": 28.47826086956522,
"alnum_prop": 0.732824427480916,
"repo_name": "DestinyDevs/BungieNetPlatform",
"id": "ce98d9e703668b9ffa6c140f1a6b46e9290b3d89",
"size": "655",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "wiki-docs/v1/EnemyHistoricalStatsPages/R1S1StrikeVenus1Ultra0.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "GLSL",
"bytes": "7007"
},
{
"name": "HTML",
"bytes": "4966"
},
{
"name": "JavaScript",
"bytes": "2424226"
},
{
"name": "PHP",
"bytes": "380417"
}
],
"symlink_target": ""
} |
@interface ONEPersonDetailViewController ()<UITableViewDataSource,UITableViewDelegate>
@property (nonatomic, strong) NSMutableArray *cellItems;
@property (nonatomic, weak) ONEPersionHeaderView *personHeaderView;
@end
@implementation ONEPersonDetailViewController
- (NSMutableArray *)cellItems
{
if (_cellItems == nil) {
_cellItems = [NSMutableArray arrayWithCapacity:2];
}
return _cellItems;
}
- (instancetype)init
{
return [super initWithStyle:UITableViewStyleGrouped];
}
- (UIStatusBarStyle)preferredStatusBarStyle
{
return UIStatusBarStyleLightContent;
}
- (void)viewDidLoad {
[super viewDidLoad];
[self setUpView];
[self loadData];
[self setUpTableVieData];
}
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
[self.navigationController setNavigationBarHidden:true];
}
- (void)viewWillDisappear:(BOOL)animated
{
[super viewWillDisappear:animated];
[self.navigationController setNavigationBarHidden:false];
}
- (void)setUpTableVieData
{
// 第一组的数据
{
ONEDefaultCellArrItem *item0 = [ONEDefaultCellArrItem itemWithTitle:@"ta的文章" image:@"other_writter_reading"];
ONEDefaultCellArrItem *item1 = [ONEDefaultCellArrItem itemWithTitle:@"ta的歌曲" image:@"other_singer_song"];
ONEWeakSelf
__weak ONEDefaultCellArrItem *weakItem = item1;
item1.actionBlock = ^(id parameter) {
ONEMusicSongViewController *songVc = [ONEMusicSongViewController new];
songVc.user_id = parameter;
songVc.title = weakItem.title;
[weakSelf.navigationController pushViewController:songVc animated:true];
};
ONEDefaultCellGroupItem *group0 = [ONEDefaultCellGroupItem groupWithItems: @[item0, item1]];
[self.cellItems addObject:group0];
}
// 第二组的数据
{
ONEDefaultCellArrItem *item0 = [ONEDefaultCellArrItem itemWithTitle:@"图文" image:@"center_image_collection"];
ONEDefaultCellArrItem *item1 = [ONEDefaultCellArrItem itemWithTitle:@"文章" image:@"center_reading_collection"];
ONEDefaultCellArrItem *item2 = [ONEDefaultCellArrItem itemWithTitle:@"影库" image:@"center_movie_collection"];
ONEDefaultCellGroupItem *group1 = [ONEDefaultCellGroupItem groupWithItems:@[item0, item1, item2]];
group1.headerTitle = @"ta的收藏";
[self.cellItems addObject:group1];
}
}
- (void)setUpView
{
self.view.backgroundColor = [UIColor whiteColor];
self.navigationItem.title = @"ta的资料";
self.automaticallyAdjustsScrollViewInsets = false;
ZYScaleHeader *headerView = [ZYScaleHeader headerWithImage:[UIImage imageNamed:@"personalBackgroundImage"] height:300];
[headerView addSubview: _personHeaderView = [ONEPersionHeaderView persionHeaderViewFrame:headerView.bounds]];
self.tableView.zy_header = headerView;
}
- (void)loadData
{
[ONEDataRequest requestUserInfo:_user_id parameters:nil success:^(ONEAuthorItem *authorItem) {
self.personHeaderView.author = authorItem;
} failure:nil];
}
#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return self.cellItems.count;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return [self.cellItems[section] items].count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *normalCellID = @"normalCell";
[tableView tableViewSetExtraCellLineHidden];
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:normalCellID];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:normalCellID];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
cell.separatorInset = UIEdgeInsetsZero;
}
ONEDefaultCellArrItem *item = [self.cellItems[indexPath.section] items][indexPath.row];
cell.imageView.image = [UIImage imageNamed:item.image];
cell.textLabel.text = item.title;
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[tableView deselectRowAtIndexPath:indexPath animated:true];
ONEDefaultCellArrItem *item = [self.cellItems[indexPath.section] items][indexPath.row];
if (item.actionBlock) {
item.actionBlock(_user_id);
}
}
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
{
if (section == 0) return nil;
return @"ta的收藏";
}
- (IBAction)close
{
[self dismissViewControllerAnimated:true completion:nil];
}
@end
| {
"content_hash": "77672cc98377a9a08342e0c0558b4c6c",
"timestamp": "",
"source": "github",
"line_count": 148,
"max_line_length": 123,
"avg_line_length": 31.93918918918919,
"alnum_prop": 0.7201184683731754,
"repo_name": "shlyren/ONE-OC",
"id": "c180a4eb23c175aee810a8d413d983c40e4d3021",
"size": "5295",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "ONE/Classes/Main-主要/Controller/ONEPersonDetailViewController.m",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "Objective-C",
"bytes": "449795"
},
{
"name": "Ruby",
"bytes": "442"
}
],
"symlink_target": ""
} |
package org.gradle.jvm.toolchain.internal.task;
import org.gradle.api.internal.project.ProjectInternal;
import org.gradle.api.plugins.HelpTasksPlugin;
import org.gradle.configuration.project.ProjectConfigureAction;
public class ShowToolchainsTaskConfigurator implements ProjectConfigureAction {
@Override
public void execute(ProjectInternal project) {
project.getTasks().register("javaToolchains", ShowToolchainsTask.class, task -> {
task.setDescription("Displays the detected java toolchains.");
task.setGroup(HelpTasksPlugin.HELP_GROUP);
task.setImpliesSubProjects(true);
});
}
}
| {
"content_hash": "ab64f6a1662934ac0ff9dd96a94cb253",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 89,
"avg_line_length": 32.6,
"alnum_prop": 0.7438650306748467,
"repo_name": "gradle/gradle",
"id": "da1dfc4afae7ecfda28196c02d8ba611917038dc",
"size": "1267",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "subprojects/platform-jvm/src/main/java/org/gradle/jvm/toolchain/internal/task/ShowToolchainsTaskConfigurator.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Assembly",
"bytes": "277"
},
{
"name": "Brainfuck",
"bytes": "54"
},
{
"name": "C",
"bytes": "123600"
},
{
"name": "C++",
"bytes": "1781062"
},
{
"name": "CSS",
"bytes": "151435"
},
{
"name": "GAP",
"bytes": "424"
},
{
"name": "Gherkin",
"bytes": "191"
},
{
"name": "Groovy",
"bytes": "30897043"
},
{
"name": "HTML",
"bytes": "54458"
},
{
"name": "Java",
"bytes": "28750090"
},
{
"name": "JavaScript",
"bytes": "78583"
},
{
"name": "Kotlin",
"bytes": "4154213"
},
{
"name": "Objective-C",
"bytes": "652"
},
{
"name": "Objective-C++",
"bytes": "441"
},
{
"name": "Python",
"bytes": "57"
},
{
"name": "Ruby",
"bytes": "16"
},
{
"name": "Scala",
"bytes": "10840"
},
{
"name": "Shell",
"bytes": "12148"
},
{
"name": "Swift",
"bytes": "2040"
},
{
"name": "XSLT",
"bytes": "42693"
}
],
"symlink_target": ""
} |
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
Rev. Zool. Bot. Africaines 12: B15. 1924
#### Original name
null
### Remarks
null | {
"content_hash": "c6a0b7b7a845409d570722360f1054b6",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 40,
"avg_line_length": 13,
"alnum_prop": 0.6923076923076923,
"repo_name": "mdoering/backbone",
"id": "efa233046065ab02515d4bc0646b16de12fec91b",
"size": "218",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Fabales/Fabaceae/Neonotonia/Neonotonia wightii/ Syn. Glycine mearnsii/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
ACCEPTED
#### According to
Index Fungorum
#### Published in
null
#### Original name
Amerodothis uncariae Racib.
### Remarks
null | {
"content_hash": "b834f1f02b300ba884676cbb589033e2",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 27,
"avg_line_length": 10.153846153846153,
"alnum_prop": 0.7121212121212122,
"repo_name": "mdoering/backbone",
"id": "2420a462b24fd0aac97b8dd9187e5fdfc033503f",
"size": "201",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Fungi/Ascomycota/Dothideomycetes/Dothideales/Dothioraceae/Bagnisiella/Bagnisiella uncariae/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
require 'spec_helper'
describe 'collectd::plugin::write_graphite', type: :class do
on_supported_os(baseline_os_hash).each do |os, facts|
context "on #{os}" do
let :facts do
facts.merge(collectd_version: '5.0')
end
options = os_specific_options(facts)
context 'single carbon writer' do
let :params do
{
carbons: { 'graphite' => {} }
}
end
it "Will create #{options[:plugin_conf_dir]}/write_graphite-config.conf" do
is_expected.to contain_concat("#{options[:plugin_conf_dir]}/write_graphite-config.conf")
is_expected.to contain_concat__fragment('collectd_plugin_write_graphite_conf_header').with(
content: %r{<Plugin write_graphite>},
target: "#{options[:plugin_conf_dir]}/write_graphite-config.conf",
order: '00'
)
end
it "Will create #{options[:plugin_conf_dir]}/write_graphite-config" do
is_expected.to contain_concat__fragment('collectd_plugin_write_graphite_conf_footer').with(
content: %r{</Plugin>},
target: "#{options[:plugin_conf_dir]}/write_graphite-config.conf",
order: '99'
)
end
it 'includes carbon configuration' do
is_expected.to contain_concat__fragment('collectd_plugin_write_graphite_conf_graphite_tcp_2003').with(
content: %r{<Carbon>},
target: "#{options[:plugin_conf_dir]}/write_graphite-config.conf"
)
is_expected.to contain_concat__fragment('collectd_plugin_write_graphite_conf_graphite_tcp_2003').with(content: %r{Host "localhost"})
is_expected.to contain_concat__fragment('collectd_plugin_write_graphite_conf_graphite_tcp_2003').with(content: %r{Port "2003"})
end
end
context 'multiple carbon writers, collectd <= 5.2' do
let :params do
{
carbons: {
'graphite_one' => { 'graphitehost' => '192.168.1.1', 'graphiteport' => 2004 },
'graphite_two' => { 'graphitehost' => '192.168.1.2', 'graphiteport' => 2005 }
}
}
end
it 'includes graphite_one configuration' do
is_expected.to contain_concat__fragment('collectd_plugin_write_graphite_conf_graphite_one_tcp_2004').with(
content: %r{<Carbon>},
target: "#{options[:plugin_conf_dir]}/write_graphite-config.conf"
)
is_expected.to contain_concat__fragment('collectd_plugin_write_graphite_conf_graphite_one_tcp_2004').with(content: %r{Host "192.168.1.1"})
is_expected.to contain_concat__fragment('collectd_plugin_write_graphite_conf_graphite_one_tcp_2004').with(content: %r{Port "2004"})
end
it 'includes graphite_two configuration' do
is_expected.to contain_concat__fragment('collectd_plugin_write_graphite_conf_graphite_two_tcp_2005').with(
content: %r{<Carbon>},
target: "#{options[:plugin_conf_dir]}/write_graphite-config.conf"
)
is_expected.to contain_concat__fragment('collectd_plugin_write_graphite_conf_graphite_two_tcp_2005').with(
content: %r{Host "192.168.1.2"}
)
is_expected.to contain_concat__fragment('collectd_plugin_write_graphite_conf_graphite_two_tcp_2005').with(
content: %r{Port "2005"}
)
end
end
context 'collectd >= 5.3' do
let :facts do
facts.merge(collectd_version: '5.3')
end
let :params do
{
carbons: { 'graphite' => {} }
}
end
it 'includes <Node "name"> syntax' do
is_expected.to contain_concat__fragment('collectd_plugin_write_graphite_conf_graphite_tcp_2003').with(
content: %r{<Node "graphite">},
target: "#{options[:plugin_conf_dir]}/write_graphite-config.conf"
)
end
end
context 'ensure is absent' do
let :params do
{
ensure: 'absent'
}
end
it 'Will not create /etc/collectd.d/conf.d/write_graphite-config.conf' do
is_expected.not_to contain_concat__fragment('collectd_plugin_write_graphite_conf_header').with(
content: %r{<Plugin write_graphite>},
target: "#{options[:plugin_conf_dir]}/write_graphite-config.conf",
order: '00'
)
end
it 'Will not create /etc/collectd.d/conf.d/write_graphite-config' do
is_expected.not_to contain_concat__fragment('collectd_plugin_write_graphite_conf_footer').with(
content: %r{</Plugin>},
target: "#{options[:plugin_conf_dir]}/write_graphite-config.conf",
order: '99'
)
end
end
end
end
end
| {
"content_hash": "a3893f0bc2c7a1f7d8c8ff231c275659",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 148,
"avg_line_length": 38.27777777777778,
"alnum_prop": 0.5842836408874145,
"repo_name": "voxpupuli/puppet-collectd",
"id": "e4df9d80722b963e692b0021e9012cb112275809",
"size": "4854",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "spec/classes/collectd_plugin_write_graphite_spec.rb",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Dockerfile",
"bytes": "576"
},
{
"name": "HTML",
"bytes": "45406"
},
{
"name": "Pascal",
"bytes": "862"
},
{
"name": "Puppet",
"bytes": "159747"
},
{
"name": "Python",
"bytes": "1241"
},
{
"name": "Ruby",
"bytes": "364340"
}
],
"symlink_target": ""
} |
import * as io from 'socket.io-client';
import { Tyr as Isomorphic } from 'tyranid/isomorphic';
declare module 'tyranid/client' {
export namespace Tyr {
export const Collection: CollectionStatic;
export const Field: FieldStatic;
export const Log: CollectionInstance;
export const Path: PathStatic;
export const Type: TypeStatic;
export const $all = '$all';
export const $label = '$label';
export interface AppErrorStatic {
new (opts?: string | Isomorphic.ErrorOptions): UserError;
}
export const AppError: AppErrorStatic;
export interface AppError {
message: string;
field?: FieldInstance;
technical?: string;
rowNumber?: number;
lineNumber?: number;
columnNumber?: number;
toString(): string;
}
export interface SecureErrorStatic {
new (opts?: string | Isomorphic.ErrorOptions): SecureError;
}
export const SecureError: SecureErrorStatic;
export interface SecureError {
message: string;
field?: FieldInstance;
technical?: string;
rowNumber?: number;
lineNumber?: number;
columnNumber?: number;
toString(): string;
}
export interface UserErrorStatic {
new (opts: string | Isomorphic.ErrorOptions): UserError;
}
export const UserError: UserErrorStatic;
export interface UserError {
message: string;
field?: FieldInstance;
technical?: string;
rowNumber?: number;
lineNumber?: number;
columnNumber?: number;
toString(): string;
}
export type anny = any;
export type Metadata =
| CollectionInstance
| FieldInstance
| PathInstance
| Document;
export interface Local {
/*
* The currently-logged in user.
*/
user: User;
/*
* The currently-logged in user's date format.
*/
dateFormat: string;
/*
* The currently-logged in user's time format.
*/
timeFormat: string;
/*
* The currently-logged in user's datetime format.
*/
dateTimeFormat: string;
}
export const local: Local;
export type Numbering = Isomorphic.Numbering;
export type ActionTraitType = Isomorphic.ActionTraitType;
export type ActionTrait = Isomorphic.ActionTrait;
export function mapAwait<T, U>(
val: Promise<T> | T,
map: (val: T) => U
): Promise<U> | U;
export interface MongoDocument {
[key: string]: any;
}
export interface MongoQuery {
[key: string]: any;
}
export interface MongoProjection {
[key: string]: number;
}
export interface Population {
[key: string]: number | '$all' | '$label' | Population;
}
export interface Class<T> {
new (...args: any[]): T;
}
export interface AccessResult {
allowed: boolean;
reason: string;
fields?: {
effect: 'allow' | 'deny';
names: string[];
};
}
export interface CollectionsByName {
[key: string]: CollectionInstance;
}
export interface CollectionsByClassName {
[key: string]: CollectionInstance;
}
export interface CollectionsById {
[key: string]: CollectionInstance;
}
export const fetch: (url: string, opts?: any) => Promise<any>;
export function aux(
collectionDefinition: CollectionDefinition,
component?: React.Component
): CollectionInstance;
export const byId: CollectionsById;
export const byName: CollectionsByName;
export function clear(obj: object): void;
export function compactMap<A, B>(
arr: A[] | undefined,
mapFn: (v: A) => B
): (B extends false
? never
: B extends null
? never
: B extends undefined
? never
: B)[];
export function assignDeep(obj: object, ...sources: object[]): object;
export function clone<T>(obj: T): T;
export function cloneDeep<T>(obj: T): T;
export const collections: CollectionInstance[] & CollectionsByClassName;
export const options: {
env: 'development' | 'production';
whiteLabel?: (metadata: Metadata) => string | undefined;
formats?: {
[typeName: string]: string;
};
jwt?: {
accessToken?: string;
refreshToken?: string;
};
stripe?: {
test: {
publishKey: string;
};
prod: {
publishKey: string;
};
};
};
export const init: () => void;
export function isCompliant(spec: any, value: any): boolean;
export function isEqual(a: any, b: any): boolean;
export function isObject(obj: any): obj is object;
export function isSameId(
a: AnyIdType | null | undefined,
b: AnyIdType | null | undefined
): boolean;
export function capitalize(name: string, all?: boolean): string;
export function kebabize(str: string): string;
export function labelize(name: string): string;
export function numberize(numbering: Numbering, num: number): string;
export function ordinalize(num: number): string;
export function pluralize(str: string): string;
export function singularize(str: string): string;
export function snakize(str: string): string;
export function unhtmlize(str: string): string;
export function unitize(count: number, unit: string): string;
export function parseUid(
uid: string
): { collection: CollectionInstance; id: AnyIdType };
export function byUid(
uid: string,
options?: any // Options_FindById
): Promise<Document | null>;
export function projectify(obj: object | PathInstance[]): MongoProjection;
export const reconnectSocket: () => void;
export const setSocketLibrary: (library: typeof io) => void;
export function serially<T, U>(
values: T[],
visitor: (value: T) => Promise<U>
): Promise<U[]>;
export interface RawMongoDocument {
[key: string]: any;
}
export type AnyIdType = string | number;
export type ObjIdType = string;
export interface PathStatic extends Omit<Isomorphic.PathStatic, 'resolve'> {
new (...args: any[]): PathInstance;
resolve(
collection: CollectionInstance,
parentPath?: PathInstance,
path?: PathInstance | string
): PathInstance;
}
export interface PathInstance extends Isomorphic.PathInstance {
detail: FieldInstance;
fields: FieldInstance[];
tail: FieldInstance;
set<D extends Document<AnyIdType>>(
obj: D,
value: any,
opts?: { create?: boolean; ignore?: boolean }
): void;
}
export interface TypeStatic extends Isomorphic.TypeStatic {
byName: { [key: string]: TypeInstance };
new (...args: any[]): TypeInstance;
}
export interface TypeDefinition extends Isomorphic.TypeDefinition {}
export interface TypeInstance extends Isomorphic.TypeInstance {
def: TypeDefinition;
create(field: FieldInstance): any;
compare(field: FieldInstance, a: any, b: any): number;
fromString(value: any): string;
format(field: FieldInstance, value: any): string;
}
export interface FieldDefinition<
D extends Document<AnyIdType> = Document<AnyIdType>
> {
[key: string]: any;
is?: string;
client?: boolean | (() => boolean);
custom?: boolean;
db?: boolean;
aux?: boolean;
historical?: boolean;
defaultValue?: any;
//inverse?: boolean;
label?: string | (() => string);
help?: string;
placeholder?: string;
numbering?: Numbering;
deprecated?: string | boolean;
note?: string;
required?: boolean;
// this function needs to be bivariant, NOT contravariant -- so defining it like a method rather than a callback
validate?(
this: D,
opts?: { field: FieldInstance<D>; trait?: ActionTrait }
): Promise<string | false | undefined> | string | false | undefined;
of?: string | FieldDefinition<D>;
cardinality?: string;
fields?: { [key: string]: FieldDefinition<D> };
keys?: string | FieldDefinition<D>;
denormal?: MongoDocument;
link?: string;
relate?: 'owns' | 'ownedBy' | 'associate';
where?: any;
pathLabel?: string;
in?: string;
min?: number;
max?: number;
step?: number;
labelField?: boolean | { uses: string[] };
labelImageField?: boolean | { uses: string[] };
orderField?: boolean | { uses: string[] };
pattern?: RegExp;
minlength?: number;
maxlength?: number;
granularity?: string;
generated?: boolean;
get?(this: D): any;
getClient?(this: D): any;
getServer?(this: D): any;
set?(this: D, val: any): void;
setClient?(this: D, val: any): void;
setServer?(this: D, val: any): void;
width?: number;
}
export interface FieldStatic {
new (...args: any[]): FieldInstance;
}
export interface FieldInstance<
D extends Document<AnyIdType> = Document<AnyIdType>
> {
$metaType: 'field';
collection: CollectionInstance<D>;
aux: boolean;
computed: boolean;
generated: boolean;
db: boolean;
def: FieldDefinition<D>;
name: string;
path: PathInstance;
numbering?: Numbering;
of?: FieldInstance<D>;
parent?: this;
pathLabel: string;
pathName: string;
readonly: boolean;
spath: string;
in: any;
label: string | (() => string);
link?: CollectionInstance;
mediaType?: Tyr.MediaTypeId;
relate?: 'owns' | 'ownedBy' | 'associate';
type: TypeInstance;
keys?: this;
fields?: { [key: string]: this };
method: string;
populateName?: string;
width?: number;
schema?: any;
dynamicMatch?: any;
format(value: any): string;
isId(): boolean;
labelify(value: any): Promise<any>;
labels(
doc: Document,
text?: string,
opts?: { labelField?: string; limit?: number }
): Promise<Document[]>;
validate(
document: D,
opts: { trait?: ActionTrait }
): Promise<string | false | undefined> | string | false | undefined;
}
export type DocumentType<
C extends CollectionInstance
> = C extends CollectionInstance<infer Document> ? Document : never;
export type IdType<D extends Document> = D extends Document<infer ID>
? ID
: never;
export interface CollectionStatic extends Isomorphic.CollectionStatic {
// Collection instance constructor
new <D extends Document<AnyIdType> = Document<AnyIdType>>(
def: any /* CollectionDefinition<D> */
): CollectionInstance<D>;
}
export interface CollectionInstance<
D extends Document<AnyIdType> = Document<AnyIdType>
> extends Class<D>, Isomorphic.CollectionInstance<D> {
new (doc?: RawMongoDocument): D;
aux(fields: { [key: string]: FieldDefinition<D> }): void;
byId(id: IdType<D>, opts?: Options_FindById): Promise<D | null>;
byIds(ids: IdType<D>[], opts?: Options_FindByIds): Promise<D[]>;
byIdIndex: { [id: string]: D };
byLabel(label: string): Promise<D | null>;
cache(document: D, type?: 'remove' | undefined, silent?: boolean): void;
count(opts?: Options_Count): Promise<number>;
exists(opts: Options_Exists): Promise<boolean>;
fields: { [fieldName: string]: FieldInstance<D> };
fieldsFor(opts: {
match?: MongoDocument;
query?: MongoQuery;
custom?: boolean;
static?: boolean;
}): Promise<{ [key: string]: Tyr.FieldInstance<D> }>;
findAll(args: Options_FindMany): Promise<D[] & { count?: number }>;
findOne(args: Options_FindOne): Promise<D | null>;
id: string;
idToLabel(id: IdType<D>): Promise<string>;
idToUid(id: IdType<D> | string): string;
insert<I, A extends I[]>(docs: A, opts?: Options_Insert): Promise<D[]>;
insert<I>(doc: I): Promise<D>;
insert(doc: any): Promise<any>;
isAux(): boolean;
isDb(): boolean;
isSingleton(): boolean;
isStatic(): boolean;
isUid(uid: string): boolean;
label: string;
labelField: Tyr.FieldInstance;
alternateLabelFields?: Tyr.FieldInstance[];
labelImageField: any;
orderField: any;
labelFor(doc: D | object, opts?: { labelField: string }): string;
labelProjection(labelField?: string): any; // Mongo Projection
labels(text: string, opts?: { labelField?: string }): Promise<D[]>;
labels(ids: string[], opts?: { labelField?: string }): Promise<D[]>;
labels(_: any): Promise<D[]>;
on(opts: any): () => void;
parsePath(text: string): PathInstance;
paths: { [fieldPathName: string]: FieldInstance<D> };
push(
id: IdType<D>,
path: string,
value: any,
opts: Options_Pushpull
): Promise<void>;
remove(id: IdType<D>, justOne: boolean): Promise<void>;
remove(
query: any /* MongoDB-style query */,
justOne: boolean
): Promise<void>;
save(doc: D | object): Promise<D>;
save(doc: D[] | object[]): Promise<D[]>;
save(doc: any): Promise<any>;
subscribe(query: MongoQuery | undefined, cancel?: boolean): Promise<void>;
update(opts: Options_Update & { query: MongoQuery }): any; // command result
updateDoc(doc: D | MongoDocument, opts: Options_UpdateDoc): Promise<D>;
values: D[];
}
export interface Document<ID extends AnyIdType = AnyIdType> {
$access?: AccessResult;
$cache(): this;
$changed: boolean;
$clone(): this;
$cloneDeep(): this;
$get(path: string): any;
$(strings: TemplateStringsArray, ...keys: string[]): any;
$id: IdType<this>;
$isNew: boolean;
$label: string;
$metaType: 'document';
$model: CollectionInstance<this>;
$options: Options_AllFind;
$orig?: this;
$remove(opts?: any): Promise<void>;
$revert(): void;
$save(opts?: Options_Save): Promise<this>;
$slice(path: string, opts: Options_Slice): Promise<void>;
$snapshot(): void;
$toPlain(): object;
$tyr: typeof Tyr;
$uid: string;
$update(opts: Options_UpdateDoc): Promise<this>;
}
export interface Inserted<ID extends AnyIdType = AnyIdType>
extends Document<ID> {
_id: ID;
}
/*
* Options
*/
export interface OptionsCount {
/**
* Indicates that a count of the records should be added to the returned array.
*/
count?: boolean;
}
/**
* This provides a place to define options that are universal to all options methods
*/
export interface OptionsCommon {
timeout?: number;
}
export interface OptionsHistorical {
/**
* Return the historical version of the doc
*/
historical?: boolean;
}
export interface OptionsKeepNonAccessible {
/**
* Indicates that results should not be filtered by security, but $checkAccess() should still be called.
*/
keepNonAccessible?: boolean;
}
export interface OptionsParallel {
/**
* If specified this indicates that the documents will be returned in a parallel array to given list of
* IDs/UIDs. If the same id is given multiple times, the document instances will be shared. If a
* given identifier could not be found, then matching slots in the array will be undefined.
*/
parallel?: boolean;
}
export interface OptionsPopulate {
/**
* The population fields to populate.
*/
populate?: PopulationOption;
}
export type ProjectionOption =
| { [key: string]: number }
| { _history?: boolean }
| string
| Array<string | { [key: string]: number }>;
export interface OptionsProjection {
/**
* The standard MongoDB-style fields object that specifies the projection.
* @deprecated use projection
*/
fields?: ProjectionOption;
/**
* The standard MongoDB-style fields object that specifies the projection.
*/
projection?: ProjectionOption;
}
export interface OptionsQuery {
/**
* raw mongodb query
*/
query?: MongoQuery;
asOf?: Date;
historical?: boolean;
}
export interface OptionsPlain {
/**
* Indicates that returned documents should be simple Plain 'ole JavaScript Objects (POJO)s.
*/
plain?: boolean;
}
export interface OptionsCaching {
/**
* Indicates that the returned docuemnts should be returned from the cache if available
*/
cached?: boolean;
}
export interface OptionsPost {
/**
* Provides a hook to do post-processing on the document.
*/
post?: (opts: Options_All) => void;
}
export interface OptionsTimestamps {
/**
* Indicates if timestamps should be updated.
* Defaults to the timestamps setting on the collection.
*/
timestamps?: boolean;
}
export interface OptionsUpdate {
/**
* The standard MongoDB-style update object. 'insert' for inserts, etc.)
* but you can override it with this option.
*/
update: any;
/**
* multiple documents
*/
multi?: boolean;
}
export interface OptionsWhere {
/**
* Applies a predicate that is applied to the dataset.
*/
where?: (doc: any) => boolean;
}
export interface OptionsWindow {
/**
* The maximum number of documents to retrieve.
*/
limit?: number;
/**
* The number of documents to skip.
*/
skip?: number;
/**
* The standard MongoDB-style sort object.
*/
sort?: { [key: string]: number };
}
/*
* Options by operation
*/
export interface Options_Count extends Options_Exists, OptionsQuery {}
export interface Options_Exists
extends OptionsCount,
OptionsCommon,
OptionsQuery {}
export interface Options_FindById
extends OptionsCaching,
OptionsCommon,
OptionsHistorical,
OptionsKeepNonAccessible,
OptionsPopulate,
OptionsProjection,
OptionsPlain {}
export interface Options_FindByIds
extends OptionsCaching,
Options_FindById,
OptionsKeepNonAccessible,
OptionsParallel {}
export interface Options_FindOne
extends Options_FindById,
OptionsQuery,
OptionsWindow {}
export interface Options_FindCursor
extends Options_FindOne,
OptionsWindow {}
export interface Options_FindMany
extends Options_FindCursor,
OptionsCount {}
export interface Options_AllFind extends Options_FindMany {}
export interface Options_FindAndModify
extends OptionsCommon,
OptionsQuery,
OptionsUpdate,
OptionsProjection {
/**
* whether or not to return a new document in findAndModify
*/
new?: boolean;
/**
* whether or not to insert the document if it doesn't exist
*/
upsert?: boolean;
}
export interface Options_Insert
extends OptionsCommon,
OptionsHistorical,
OptionsTimestamps {}
export interface Options_Pushpull
extends OptionsCommon,
OptionsHistorical,
OptionsTimestamps {}
export interface Options_Remove extends OptionsCommon, OptionsQuery {}
export interface Options_Save extends Options_Insert, Options_UpdateDoc {}
export interface Options_Slice
extends OptionsCommon,
OptionsPopulate,
OptionsWhere,
OptionsWindow {}
export interface Options_Update
extends OptionsCommon,
OptionsQuery,
OptionsTimestamps,
OptionsUpdate {}
export interface Options_UpdateDoc
extends OptionsCommon,
OptionsHistorical,
OptionsProjection,
OptionsTimestamps {
upsert?: boolean;
}
export interface Options_All
extends OptionsCommon,
OptionsHistorical,
OptionsQuery,
OptionsParallel,
OptionsPlain,
OptionsPopulate,
OptionsPost,
OptionsProjection,
OptionsTimestamps,
OptionsUpdate,
OptionsWindow {}
/**
* Fields to populate in a document
*/
export type PopulationOption =
| string
| string[]
| { [key: string]: PopulationOption | 0 | 1 };
export type LogOption = string | Error | Isomorphic.BaseTyrLog<ObjIdType>;
export function trace(...args: LogOption[]): Promise<void>;
export function log(...args: LogOption[]): Promise<void>;
export function info(...args: LogOption[]): Promise<void>;
export function warn(...args: LogOption[]): Promise<void>;
export function error(...args: LogOption[]): Promise<void>;
export function fatal(...args: LogOption[]): Promise<void>;
export const query: QueryStatic;
export interface QueryStatic {
and(query: MongoQuery, spath: string, value: any): void;
restrict(query: MongoQuery, doc: Tyr.Document): void;
}
}
}
| {
"content_hash": "de6db0025982ad92d191aa6588c1562e",
"timestamp": "",
"source": "github",
"line_count": 765,
"max_line_length": 118,
"avg_line_length": 28.033986928104575,
"alnum_prop": 0.6080387951133078,
"repo_name": "tyranid-org/tyranid",
"id": "3561f681a6a803a45e03863bab7e45be70b725be",
"size": "21446",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "packages/tyranid/client.d.ts",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "1162"
},
{
"name": "JavaScript",
"bytes": "499319"
},
{
"name": "SCSS",
"bytes": "22978"
},
{
"name": "Shell",
"bytes": "5384"
},
{
"name": "TypeScript",
"bytes": "1332307"
}
],
"symlink_target": ""
} |
from django.conf.urls import patterns
from django.conf.urls import url
from horizon_lib.test.test_dashboards.cats.tigers.views import IndexView # noqa
urlpatterns = patterns(
'',
url(r'^$', IndexView.as_view(), name='index'),
)
| {
"content_hash": "ed7634de4a639890185c50bcfbbbbc94",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 80,
"avg_line_length": 26.555555555555557,
"alnum_prop": 0.7196652719665272,
"repo_name": "mrunge/horizon_lib",
"id": "4b0a8ceac3aecb74c43247610bb3c89eaf6c0008",
"size": "812",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "horizon_lib/test/test_dashboards/cats/tigers/urls.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "104"
},
{
"name": "JavaScript",
"bytes": "239650"
},
{
"name": "Python",
"bytes": "557515"
},
{
"name": "Shell",
"bytes": "15162"
}
],
"symlink_target": ""
} |
<!doctype html>
<html lang="en" class="no-js">
<head>
<meta charset="utf-8">
<title>append | geomap</title>
<meta name="description" content="geomap append method">
<meta name="author" content="Ryan Westphal">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="../css/style.css?v=2">
<link rel="stylesheet" href="../css/bootstrap.min.css" /><link rel="stylesheet" href="../css/bootstrap-theme.min.css" />
</head>
<body>
<div id="append" class="container">
<div data-role="header" data-theme="e">
<h1>append</h1>
</div>
<div data-role="content">
<table>
<tr>
<th>return type</th>
<td>jQuery collection</td>
</tr>
<tr>
<th>syntax</th>
<td>.geomap( "append", Object shape ( <a href="http://geojson.org/geojson-spec.html" rel="external">GeoJSON object</a> ) | Array<Object> shapes [ , Object style ( geomap style ) ] [ , String label ] [ , Boolean refresh ] )</td>
</tr>
<tr>
<th>usage</th>
<td><pre><span class="comment">// a single point, no style, no label, refresh immediately</span>
$(<i>map or service selector</i>).geomap( "append", { type: "Point", coordinates: [ -71, 40 ] } )
<span class="comment">// a single line, don't refresh yet</span>
$(<i>map or service selector</i>).geomap( "append", {
type: "LineString",
coordinates: [ [ -71, 40 ], [ -71.5, 41 ] ]
}, false )
<span class="comment">// a polygon with a style</span>
$(<i>map or service selector</i>).geomap( "append", {
type: "Polygon",
coordinates: [ [
[-75, 39.7],
[-74.8, 39.3],
[-75.2, 39.3],
[-75, 39.7]
] ]
}, { stroke: "#11117f", strokeWidth: "3px" } )
<span class="comment">// an array of geometry objects with a style, don't refresh yet</span>
$(<i>map or service selector</i>).geomap( "append", [
{ type: "Point", coordinates: [ -71, 40 ] },
{ type: "Point", coordinates: [ -70, 39.5 ] },
], { color: "green", strokeWidth: "3px" }, false )
<span class="comment">// a point feature with a label</span>
$(<i>map or service selector</i>).geomap( "append", {
type: "Feature",
geometry: {
type: "Point",
coordinates: [ -71, 40 ]
}
}, "My Point" )
<span class="comment">// a point with a label, don't refresh yet</span>
$(<i>map or service selector</i>).geomap( "append", { type: "Point", coordinates: [ -71, 40 ] }, "My Point (don't refresh yet)", false )
<span class="comment">// a point with a style & label</span>
$(<i>map or service selector</i>).geomap( "append", { type: "Point", coordinates: [ -71, 40 ] }, { color: "#00f" }, "Blue Point" )
<span class="comment">// a collection of features with a style, each point will get a separate label, don't refresh yet</span>
$(<i>map or service selector</i>).geomap( "append", {
type: "FeatureCollection"
features: [ {
type: "Feature",
geometry: {
type: "Point",
coordinates: [ -71, 40 ]
}
}, {
type: "Feature",
geometry: {
type: "Point",
coordinates: [ -71.2, 40.3 ]
}
} ]
},
{ color: "#00f" },
'<span style="color: #44f;">Blue Point</span>',
false
)</pre></td>
</tr>
</table>
<p>The append method adds one shape or an array of shapes to the map. In this documentation, the word shape means a GeoJSON geometry object or a GeoJSON Feature. A FeatureCollection is treated as an array of shapes.</p>
<p>When you append more than one shape by using an array or a FeatureCollection, each shape in the array or FeatureCollection's features property is added as a separate shape whereas the other collection geometry types, e.g., MultiPoint, are added as a single shape. This is an important distinction when considering the find method and labels. The find method can potentially return only one shape from an array or one feature of a FeatureCollection but will return all shapes in a MultiPoint (as a reference to the original MultiPoint object supplied to append) even if only one of the coordinates in the MultiPoint intersects the find position. For labeling, each shape in an array and each feature in a FeatureCollection get their own label, however all polygons in a MultiPolygon will share the same label.</p>
<p>The geomap widget maintains a reference to your shape. You can use the same object in calls to remove in order to remove the shape from the map at any time.</p>
<p>The jQuery UI widget factory returns the original jQuery collection to maintain call chaining.</p>
<!--<p>geomap draws shapes ordered by geometry type and then by order of addition. It draws Polygon shapes first followed by LineString and finally Point shapes. </p>-->
<h2>styling</h2>
<p>The optional style argument modifies how geomap draws the specific geometry or feature you are adding. Properties supplied in this style will override ones of the same name in geomap's base shapeStyle. Properties not referenced are inheritied from the base style and can change with future changes to the shapeStyle option. Please see the shapeStyle method documentation for information about what properties are valid for this object.</p>
<h2>labeling</h2>
<p>The optional label argument will display a label near the shape. Labels are a powerful way to add text, pixel-based graphics, or other HTML and CSS effects to the map. The label string can be any text or HTML. For example, consider the following:</p>
<ul>
<li>
<span>you append a Point shape setting its style to have zero for width and height:</span>
<pre>{ width: "0px", height: "0px" }</pre>
</li>
<li>
<span>you also supply a label of nothing more than a div element with a class:</span>
<pre>'<div class="marker"></div>'</pre>
</li>
<li>
<span>in a CSS style sheet, you give the marker class a width, height, background image and negative relative position:</span>
<pre>.marker
{
width: 8px;
height: 8px;
background: url(../img/marker.png);
position: relative;
left: -4px;
top: -4px;
}</pre>
</li>
</ul>
<p>In the above example, marker.png will be centered on every point added with a similar label. The regular shape style will not show because the point style has no size.</p>
<p>For Point shapes, the top-left of the label is positioned at the Point's only coordinate. For LineString shapes, the label is usually positioned 50% along the shape but will be forced into view if its usual position is out of the map's current bbox. For Polygon shapes, the label is usually positioned at the centroid but will be forced into view if its usual position is out of the map's current bbox. All other non-basic shape types use the shape's centroid.</p>
<p>The geomap widget uses a div to position the labels. The div exists inside a container for the service. The div has the CSS class: geo-label. You can use this design to apply regular CSS style to all labels or all labels within a service. The following snippets show examples of using this, assuming the main map div has the id "map" and the default map service (which has the CSS class "osm") has not been changed.</p>
<h3>JavaScript</h3>
<pre><span class="comment">/* add a point to the map itself */</span>
$( "#map" ).geomap( "append", { type: "Point", coordinates: [ -71, 40 ] }, "map point" );
<span class="comment">/* add a point to the default map service */</span>
$( "#map .osm" ).geomap( "append", { type: "Point", coordinates: [ -70, 40 ] }, "service point" );
</pre>
<h3>CSS</h3>
<pre><span class="comment">/* turn the color of all labels blue */</span>
#map .geo-label { color: blue; }
<span class="comment">/* make labels on the default basemap service bold */</span>
#map .osm .geo-label { font-weight: bold; }</pre>
<p>One caveat is that, to keep performance high, jQuery Geo will not create the .geo-label container if you do not at least pass an empty string as the label. So, if you want to do something similar to the marker example above, but using the already provided .geo-label div, you will need to pass an empty string as the label.</p>
<p>Each .geo-label div is absolutely positioned to the correct location in the map view. Please keep that in mind because changing the position, left or top CSS properties on the .geo-label class may affect your labels drastically.</p>
<h2>clickable label links</h2>
<p>Shapes appended to the primary map element (as opposed to service-level shapes mentioned below) can have clickable link elements. This means, if you include an "a" element in the label for a shape appended to your map, users can click that link. This also means that the link elements interfere with map interaction, so be careful how your design your labels because they can stop users from panning while hovering over a clickable label link.</p>
<p>Due to browser inconsistencies, sometimes links in service-level shape labels can be clicked. However, since this behavior is not consistent, you should not rely on it.</p>
<pre><span class="comment">// users can click the link in this shape's label</span>
$( "#map" ).geomap( "append", { type: "Point", coordinates: [ -71, 40 ] }, "<a href='info.html'>More info</a>" );
<span class="comment">// users cannot click the link in this service-level shape's label</span>
$( "#map .osm" ).geomap( "append", { type: "Point", coordinates: [ -71, 40 ] }, "<a href='info.html'>More info</a>" );</pre>
<p><b>Note:</b> If you display non-map content over the map div, links in the shape labels will show through that content unless you give your overlay content a z-index greater than 1.</p>
<h2>delaying refresh</h2>
<p>The optional refresh argument determines if geomap refreshes the map graphics after this call to append. It defaults to true. If you pass false, geomap will add the shape internally but not immediately redraw the graphics. The changes will display if the user moves the map or you call geomap's refresh method.</p>
<h2>service-level shapes</h2>
<p>The geomap widget allows you to append a shape to a specific service. You do this by targeting a service inside a map instead of the map itself for your call to geomap's append method. For example, the default map service has the CSS class: osm. We can append a shape to that service specifically by using jQuery to target the service:</p>
<pre>$( "#map .osm" ).geomap( "append", shape );</pre>
<p>Some of the important advantages with this syntax are:</p>
<ul>
<li>you can show or hide shapes as you toggle a service because shapes attached to a service are only visible if the service is visible</li>
<li>service-level shapes draw in the order of their service in the <a href="services.html">services option</a> which gives you finer control over how they look</li>
<li>shapes on the map itself always draw above service-level shapes</li>
<li>you can style shapes differently depending on their service using a service-level <a href="shapeStyle.html">shapeStyle option</a></li>
</ul>
<h2>duplicate shapes</h2>
<p>You can add the same GeoJSON object to more than one service, which allows you to give the same object two different styles at the same time. To do this, call append twice with the same object. Once on one service (or the map itself) and a second time on a different service.</p>
<p>You can also do this at the same time by using the comma selector in one call to append:</p>
<pre><span class="comment">// set the basemap service's shapeStyle option to a white halo effect</span>
$( "#map .osm" ).geomap( "option", "shapeStyle", { strokeWidth: "8px", color: "#dedede" } );
<span class="comment">// append the shape to both the map widget and basemap service</span>
$( "#map,#map .osm" ).geomap( "append", shape );</pre>
<h2>updating</h2>
<p>If you attempt to add a shape to the map or a service where it already exists, the shape will remain but you will update (or remove) the shape's style or label.</p>
<pre><span class="comment">// add the shape with a green color</span>
$( "#map" ).append( shape, { color: "green" } );
<span class="comment">// change the color to blue (shape is the same object as before in this case)</span>
$( "#map" ).append( shape, { color: "blue" } );</pre>
<p>Changing the type of geometry, e.g., from Point to LineString, or coordinates of a shape you have appended is not recommended and geomap's behavior is currently undefined. If you wish to do either of these, you should first call remove on the original object and append on a new one.</p>
<!--<p>The following odd example will move the first coordinate of any clicked LineString 10 meters to the left. Notice it first removes the shape, then updates the first coordinate and finally appends the new shape.</p>
<pre>var map = $( "#map" ).geomap( {
click: function(e, geo) {
<span class="comment">// find any shapes within 4 pixels of the clicked point</span>
var shapes = map.geomap("find", geo, 4);
if (shapes.length > 0 && shapes[0].type == "LineString") {
map.geomap("remove", shapes[0]);
<span class="comment">// move the first point in the line 10 meters to the left</span>
<span class="comment">// you can edit the coordinates directly since you've removed the shape</span>
<span class="comment">// we use proj because we want to temporarily work in meters</span>
var firstCoord = $.geo.proj.fromGeodetic(shapes[0].coordinates[0]);
<span class="comment">// firstCoord[0] is the x axis</span>
firstCoord[0] -= 10;
<span class="comment">// we need to convert it back to geodetic (lon/lat)</span>
shapes[0].coordinates[0] = $.geo.proj.toGeodetic(firstCoord);
<span class="comment">// re-append the shape</span>
map.geomap( "append", shapes[0] );
}
}
} );</pre>-->
</div>
</div> <!-- end of #container -->
<script src="http://code.jquery.com/jquery-2.1.1.min.js"></script>
<script src="http://code.jquerygeo.com/jquery.geo-1.0.0-b2.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
</body>
</html>
| {
"content_hash": "521f67e90c33f0b04c94b1846ca8e7e2",
"timestamp": "",
"source": "github",
"line_count": 245,
"max_line_length": 821,
"avg_line_length": 61.96326530612245,
"alnum_prop": 0.6807851920163362,
"repo_name": "jQueryGeo/docs",
"id": "c29f1be19a1a1358b03009be265891220e8369db",
"size": "15181",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "geomap/append.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "261130"
},
{
"name": "JavaScript",
"bytes": "503"
}
],
"symlink_target": ""
} |
""" Add create_date field to product and set value for existing products.
Revision ID: 67607ed6ab04
Revises: b9dc56c47ef4
Create Date: 2017-06-27 22:46:44.079629
"""
from datetime import datetime
from alembic import op
from sqlalchemy import func
from sqlalchemy.sql import text
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '67607ed6ab04'
down_revision = 'b9dc56c47ef4'
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('product', sa.Column('create_date', sa.DateTime(), nullable=True))
results = op.get_bind().execute(text("""
select prd.id, min(po.order_date) from purchase_order po, product prd, purchase_order_line pol
where pol.product_id = prd.id and po.id = pol.purchase_order_id
group by prd.id
""")).fetchall()
for r in results:
sup_id = r[0]
po_date = r[1]
sql = "update product set create_date = '{0}' where id={1}".format(po_date, sup_id)
op.get_bind().execute(text(sql))
results = op.get_bind().execute(text("""
select p.id, min(so.order_date) from sales_order so, sales_order_line sol,
product p where so.id = sol.sales_order_id and
sol.product_id = p.id group by p.id;
""")).fetchall()
for r in results:
sup_id = r[0]
so_date = r[1]
sql = "update product set create_date = '{0}' where id={1} and create_date is null".format(so_date, sup_id)
op.get_bind().execute(text(sql))
op.get_bind().execute(text("update product set create_date = '{0}' where create_date is null".format(datetime.now())))
op.alter_column('product', 'create_date', existing_type=sa.DateTime(), nullable=False)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('product', 'create_date')
# ### end Alembic commands ###
| {
"content_hash": "1b510f9ea5da5339bbf556966b6c8a52",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 122,
"avg_line_length": 35.25925925925926,
"alnum_prop": 0.6559873949579832,
"repo_name": "betterlife/flask-psi",
"id": "05cea651bb52e45b136c1cab94ac37a5035c542e",
"size": "1904",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "psi/migrations/versions/42_67607ed6ab04_.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "8807"
},
{
"name": "HTML",
"bytes": "24618"
},
{
"name": "JavaScript",
"bytes": "12365"
},
{
"name": "Mako",
"bytes": "412"
},
{
"name": "Python",
"bytes": "202168"
},
{
"name": "Shell",
"bytes": "726"
}
],
"symlink_target": ""
} |
package io.gravitee.repository.config.mock;
import io.gravitee.repository.management.api.PortalNotificationRepository;
import io.gravitee.repository.management.model.PortalNotification;
import java.util.Date;
import java.util.Optional;
import static java.util.Collections.emptyList;
import static java.util.Collections.singletonList;
import static org.mockito.Mockito.*;
/**
* @author David BRASSELY (david.brassely at graviteesource.com)
* @author GraviteeSource Team
*/
public class PortalNotificationRepositoryMock extends AbstractRepositoryMock<PortalNotificationRepository> {
public PortalNotificationRepositoryMock() {
super(PortalNotificationRepository.class);
}
@Override
void prepare(PortalNotificationRepository portalNotificationRepository) throws Exception {
// create
final PortalNotification notificationCreated = new PortalNotification();
notificationCreated.setId("notif-create");
notificationCreated.setTitle("notif-title");
notificationCreated.setMessage("notif-message");
notificationCreated.setUser("notif-userId");
notificationCreated.setCreatedAt(new Date(1439022010883L));
when(portalNotificationRepository.create(any(PortalNotification.class))).thenReturn(notificationCreated);
//delete
when(portalNotificationRepository.findByUser(eq("notif-userId-toDelete"))).thenReturn(
singletonList(mock(PortalNotification.class)),
emptyList(),
singletonList(mock(PortalNotification.class)),
emptyList()
);
//findByUserId
final PortalNotification notificationFindByUsername = new PortalNotification();
notificationFindByUsername.setId("notif-findByUserId");
notificationFindByUsername.setTitle("notif-title-findByUserId");
notificationFindByUsername.setMessage("notif-message-findByUserId");
notificationFindByUsername.setUser("notif-userId-findByUserId");
notificationFindByUsername.setCreatedAt(new Date(1439022010883L));
when(portalNotificationRepository.findByUser(eq("notif-userId-findByUserId"))).thenReturn(singletonList(notificationFindByUsername));
when(portalNotificationRepository.findByUser(eq("unknown"))).thenReturn(emptyList());
final PortalNotification notificationFindById = new PortalNotification();
notificationFindById.setId("notif-findById");
notificationFindById.setTitle("notif-title-findById");
notificationFindById.setMessage("notif-message-findById");
notificationFindById.setUser("notif-userId-findById");
notificationFindById.setCreatedAt(new Date(1439022010883L));
when(portalNotificationRepository.findById(eq("notif-findById"))).thenReturn(Optional.ofNullable(notificationFindById));
}
}
| {
"content_hash": "2bc6e30e389cf90a1c8c92ffaec3b152",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 141,
"avg_line_length": 46.16129032258065,
"alnum_prop": 0.749475890985325,
"repo_name": "gravitee-io/gravitee-repository-test",
"id": "4c7f9020934be07c7d919832f887eee45306b69f",
"size": "3492",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/test/java/io/gravitee/repository/config/mock/PortalNotificationRepositoryMock.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "512226"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html>
<head>
<title>Video Transcoder</title>
<link rel="stylesheet" href="stylesheets/normalize.css"/>
<link rel="stylesheet" href="stylesheets/bootstrap.css"/>
<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="stylesheets/app.css"/>
<script src="js/view.js"></script>
</head>
<body>
<main class="container-fluid">
<input id="file-select" type="file" multiple/>
<div class="row">
<section id="file-box" class="panel col-lg-4 col-lg-offset-1">
Drag and drop files here or click to select files.
</section>
<section id="download-box" class="panel col-lg-5 col-lg-offset-1"></section>
</div>
</main>
</body>
</html>
| {
"content_hash": "cf3d42605f1b3d9846c9ee7b6b340cde",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 99,
"avg_line_length": 36.22727272727273,
"alnum_prop": 0.6273525721455459,
"repo_name": "awslabs/aws-sdk-js-sample-video-transcoder",
"id": "7e304b9d1cb3b740fef6febe19ae15f2a673b10e",
"size": "797",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "chrome-extension/index.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "7238"
},
{
"name": "HTML",
"bytes": "11258"
},
{
"name": "JavaScript",
"bytes": "52280"
}
],
"symlink_target": ""
} |
package package1.package2.package3;
public class Class85 {
private final services.Service1 service1 = new services.Service1();
private final services.Service2 service2 = new services.Service2();
private final services.Service3 service3 = new services.Service3();
private final services.Service4 service4 = new services.Service4();
public Class85() {
// stuff goes here
}
// lots of methods here
}
| {
"content_hash": "9cfc00e117f8048d17f6bb93bfa21d64",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 69,
"avg_line_length": 29.928571428571427,
"alnum_prop": 0.7446300715990454,
"repo_name": "evanchooly/guice-intro",
"id": "659ba9ea3e1939f06d5c5bf97374972b068ab0b8",
"size": "419",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "code/manual/src/main/java/package1/package2/package3/Class85.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "90484"
},
{
"name": "Java",
"bytes": "88712"
},
{
"name": "JavaScript",
"bytes": "1925762"
},
{
"name": "Ruby",
"bytes": "1788"
}
],
"symlink_target": ""
} |
package org.riverframework.wrapper.lotus.domino._remote;
import lotus.domino.NotesThread;
import org.junit.AfterClass;
import org.junit.BeforeClass;
public class DocumentTest extends org.riverframework.wrapper.AbstractDocumentTest {
@BeforeClass
public static void before() {
NotesThread.sinitThread();
}
@AfterClass
public static void after() {
NotesThread.stermThread();
}
} | {
"content_hash": "f73f39eba297a44658d40c7f2afc6772",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 83,
"avg_line_length": 20.57894736842105,
"alnum_prop": 0.7851662404092071,
"repo_name": "mariosotil/river-framework",
"id": "0c3156e4278e08e006022f64a05cf2659b6acd65",
"size": "391",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "river-lotus-domino/src/test/java/org/riverframework/wrapper/lotus/domino/_remote/DocumentTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "342984"
}
],
"symlink_target": ""
} |
<?php
namespace Zpi\PaperBundle\Form\Type;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilder;
class NewPaperType extends AbstractType
{
public function buildForm(FormBuilder $builder, array $options)
{
$builder->add('title');
$builder->add('abstract');
$builder->add('authors', 'collection', array(
'type' => new NewAuthorType(),
'allow_add' => true,
'allow_delete' => true,
));
$builder->add('authorsExisting', 'collection', array(
'type' => new NewAuthorExistingType(),
'allow_add' => true,
'allow_delete' => true,
));
//$builder->add('dueDate', null, array('widget' => 'single_text'));
}
public function getName()
{
return 'new_paper';
}
} | {
"content_hash": "111a875670dd83d9ab9492a3bb725f44",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 75,
"avg_line_length": 28.903225806451612,
"alnum_prop": 0.53125,
"repo_name": "quba/ZPI",
"id": "57ae5199c03095361434cc32eefa2939da77465a",
"size": "896",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Zpi/PaperBundle/Form/Type/NewPaperType.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "176"
},
{
"name": "CSS",
"bytes": "16201"
},
{
"name": "HTML",
"bytes": "37710"
},
{
"name": "JavaScript",
"bytes": "29242"
},
{
"name": "PHP",
"bytes": "563488"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.IO;
class Solution
{
/* author:@shivkrthakur */
static void Main(String[] args)
{
/* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution */
int x = Convert.ToInt32(Console.ReadLine().Trim());
for(int i = 0; i < x; i++)
{
string strInput = Console.ReadLine().Trim();
string evenStrOutput = string.Empty;
string oddStrOutput = string.Empty;
for(int k = 0; k < strInput.Length; k++)
{
if(k % 2 == 0)
{
evenStrOutput += strInput[k];
}
else
{
oddStrOutput += strInput[k];
}
}
Console.WriteLine("{0} {1}", evenStrOutput, oddStrOutput);
}
}
} | {
"content_hash": "2de353dfc45de7cdf4e63cd7eaa99e21",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 118,
"avg_line_length": 29.625,
"alnum_prop": 0.4757383966244726,
"repo_name": "shivkrthakur/HackerRankSolutions",
"id": "fb95191af375071957d3300a0ed8b63c6bcf1dc3",
"size": "948",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Practice/AllDomains/Tutorials/30DaysOfCode/Day6LetsReview.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "175716"
},
{
"name": "Java",
"bytes": "15673"
},
{
"name": "JavaScript",
"bytes": "113116"
},
{
"name": "Python",
"bytes": "11480"
},
{
"name": "SQLPL",
"bytes": "1603"
}
],
"symlink_target": ""
} |
'use strict';
const Model = require('../core/model'),
collectionName = 'carts';
module.exports = class Cart extends Model {
constructor(data) {
super(data, collectionName);
}
static get collectionName() {
return collectionName;
}
} | {
"content_hash": "56d52bd8203ac2807c7aae6e9a3a8ad8",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 43,
"avg_line_length": 16.266666666666666,
"alnum_prop": 0.6926229508196722,
"repo_name": "dsx190/ecommet",
"id": "fd234cda05e537f479038bb67ddd588f8b4ca704",
"size": "244",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/models/checkout/cart.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "85"
},
{
"name": "HTML",
"bytes": "30090"
},
{
"name": "JavaScript",
"bytes": "75922"
}
],
"symlink_target": ""
} |
class Transaction < ActiveRecord::Base
monetize :amount_cents, with_model_currency: :currency
monetize :tax_cents, with_model_currency: :currency
monetize :total_cents, with_model_currency: :currency
monetize :optional_amount_cents, with_model_currency: :currency, allow_nil: true
def total_cents
return amount_cents + tax_cents
end
end
| {
"content_hash": "83d04f500f504f9073642c617fda0e3a",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 82,
"avg_line_length": 27.46153846153846,
"alnum_prop": 0.7507002801120448,
"repo_name": "RubyMoney/money-rails",
"id": "e7cf4c1e5180db880637497451d972c12a0b893c",
"size": "357",
"binary": false,
"copies": "2",
"ref": "refs/heads/main",
"path": "spec/dummy/app/models/transaction.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "545"
},
{
"name": "HTML",
"bytes": "2311"
},
{
"name": "JavaScript",
"bytes": "641"
},
{
"name": "Ruby",
"bytes": "140440"
}
],
"symlink_target": ""
} |
@implementation DYNBackgroundStyle
- (id)init {
self = [super init];
if (self) {
self.gradientAngle = 180;
self.locations = nil;
self.fillInsets = [[DYNInsets alloc] init];
}
return self;
}
- (id)initWithDictionary:(NSDictionary *)dictionary {
self = [super init];
if (self) {
NSDictionary *grad = [dictionary objectForKey:@"gradient"];
self.gradientAngle = [[grad objectForKey:kDYNGradientAngle] floatValue];
self.locations = nil;
DYNFillType fillType = DYNFillTypeGradient;
if ([dictionary objectForKey:kDYNFillTypeKey]) {
fillType = [[dictionary objectForKey:kDYNFillTypeKey] intValue];
}
if (fillType == DYNFillTypeGradient) {
NSArray *colors = [grad objectForKey:@"colors"];
NSMutableArray *tmp = [NSMutableArray new];
for (NSDictionary *color in colors) {
DYNColor *dpColor = [[DYNColor alloc] initWithDictionary:color];
[tmp addObject:dpColor];
self.colors = tmp;
}
self.locations = [grad objectForKey:@"locations"];
} else {
DYNColor *color = [[DYNColor alloc] initWithDictionary:[dictionary objectForKey:kDYNFillColorKey]];
self.colors = @[color];
}
if ([dictionary objectForKey:kDYNNoiseOpacityKey]) {
self.noiseOpacity = [[dictionary objectForKey:kDYNNoiseOpacityKey] floatValue];
}
if ([dictionary objectForKey:kDYNNoiseBlendModeKey]) {
self.noiseBlendMode = [[dictionary objectForKey:kDYNNoiseBlendModeKey] intValue];
}
if ([dictionary objectForKey:kDYNFillInsetsKey]) {
self.fillInsets = [[DYNInsets alloc] initWithDictionary:[dictionary objectForKey:kDYNFillInsetsKey]];
}
}
return self;
}
- (NSArray *)colorArray {
return [self valueForKeyPath:@"colors.color"];
}
- (void)drawInFrame:(CGRect)frame clippedToPath:(UIBezierPath *)path parameters:(DYNStyleParameters *)parameters flippedGradient:(BOOL)flippedGradient {
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSaveGState(context);
if (self.fillInsets.anySideGreaterThanZero) {
[path insetPathRelativeToCurrentBounds:self.fillInsets.edgeInsets];
}
[path addClip];
if (self.colors.count > 1) {
DYNGradient *gradient = [[DYNGradient alloc] initWithColors:self.colors locations:self.locations];
//[gradient drawInPath:path flipped:flippedGradient angle:self.gradientAngle parameters:parameters];
[gradient drawInFrame:frame clippedToPath:path angle:self.gradientAngle flippedGradient:flippedGradient parameters:parameters];
} else if (self.colors.count){
DYNColor *DYNColor = self.colors[0];
UIColor *color = DYNColor.color;
if (DYNColor.definedAtRuntime) {
UIColor *paramColor = [parameters valueForStyleParameter:DYNColor.variableName];
if (paramColor) {
color = paramColor;
}
}
[color setFill];
[path fill];
}
if (self.noiseOpacity > 0) {
[KGNoise drawNoiseWithOpacity:self.noiseOpacity andBlendMode:self.noiseBlendMode];
}
CGContextRestoreGState(context);
}
- (void)drawInPath:(UIBezierPath *)path withContext:(CGContextRef)context parameters:(DYNStyleParameters *)parameters flippedGradient:(BOOL)flippedGradient {
[self drawInFrame:path.bounds clippedToPath:path parameters:parameters flippedGradient:flippedGradient];
}
@end
| {
"content_hash": "83876d2e1ae7380bff55547f859801b9",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 157,
"avg_line_length": 34.66990291262136,
"alnum_prop": 0.6659199103892467,
"repo_name": "pourhadi/DynUIFramework",
"id": "8f01c7d2f0d8a4ad0194cf3657df164a96c208a2",
"size": "3781",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Pod/Classes/DynUIFramework/Styles/DYNBackgroundStyle.m",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "440"
},
{
"name": "Objective-C",
"bytes": "368468"
},
{
"name": "Ruby",
"bytes": "1579"
},
{
"name": "Shell",
"bytes": "4178"
}
],
"symlink_target": ""
} |
<component name="libraryTable">
<library name="Maven: org.glassfish.jersey.bundles.repackaged:jersey-guava:2.22">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/glassfish/jersey/bundles/repackaged/jersey-guava/2.22/jersey-guava-2.22.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/glassfish/jersey/bundles/repackaged/jersey-guava/2.22/jersey-guava-2.22-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/glassfish/jersey/bundles/repackaged/jersey-guava/2.22/jersey-guava-2.22-sources.jar!/" />
</SOURCES>
</library>
</component> | {
"content_hash": "7064e0e6c048afb57a2a39f3cddc036b",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 135,
"avg_line_length": 48.30769230769231,
"alnum_prop": 0.6926751592356688,
"repo_name": "freeuni-sdp/iot-sim-bath",
"id": "f75bbe3a59524decbf007f2bf37b4816f5c1b804",
"size": "628",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": ".idea/libraries/Maven__org_glassfish_jersey_bundles_repackaged_jersey_guava_2_22.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "472"
},
{
"name": "Java",
"bytes": "13345"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>mathcomp-solvable: 6 m 13 s 🏆</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.15.0 / mathcomp-solvable - 1.14.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
mathcomp-solvable
<small>
1.14.0
<span class="label label-success">6 m 13 s 🏆</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-06-02 22:30:29 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-06-02 22:30:29 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-threads base
base-unix base
conf-findutils 1 Virtual package relying on findutils
conf-gmp 4 Virtual package relying on a GMP lib system installation
coq 8.15.0 Formal proof management system
dune 3.2.0 Fast, portable, and opinionated build system
ocaml 4.14.0 The OCaml compiler (virtual package)
ocaml-base-compiler 4.14.0 Official release 4.14.0
ocaml-config 2 OCaml Switch Configuration
ocaml-options-vanilla 1 Ensure that OCaml is compiled with no special options enabled
ocamlfind 1.9.3 A library manager for OCaml
zarith 1.12 Implements arithmetic and logical operations over arbitrary-precision integers
# opam file:
opam-version: "2.0"
maintainer: "Mathematical Components <mathcomp-dev@sympa.inria.fr>"
homepage: "https://math-comp.github.io/"
bug-reports: "https://github.com/math-comp/math-comp/issues"
dev-repo: "git+https://github.com/math-comp/math-comp.git"
license: "CECILL-B"
build: [ make "-C" "mathcomp/solvable" "-j" "%{jobs}%" "COQEXTRAFLAGS+=-native-compiler yes" {coq-native:installed & coq:version < "8.13~" } ]
install: [ make "-C" "mathcomp/solvable" "install" ]
depends: [ "coq-mathcomp-algebra" { = version } ]
tags: [ "keyword:finite groups" "keyword:Feit Thompson theorem" "keyword:small scale reflection" "keyword:mathematical components" "keyword:odd order theorem" "logpath:mathcomp.solvable" ]
authors: [ "Jeremy Avigad <>" "Andrea Asperti <>" "Stephane Le Roux <>" "Yves Bertot <>" "Laurence Rideau <>" "Enrico Tassi <>" "Ioana Pasca <>" "Georges Gonthier <>" "Sidi Ould Biha <>" "Cyril Cohen <>" "Francois Garillot <>" "Alexey Solovyev <>" "Russell O'Connor <>" "Laurent Théry <>" "Assia Mahboubi <>" ]
synopsis: "Mathematical Components Library on finite groups (II)"
description:"""
This library contains more definitions and theorems about finite groups.
"""
url {
src: "https://github.com/math-comp/math-comp/archive/mathcomp-1.14.0.tar.gz"
checksum: "sha256=d259cc95a2f8f74c6aa5f3883858c9b79c6e87f769bde9a415115fa4876ebb31"
}
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install 🏜️</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-mathcomp-solvable.1.14.0 coq.8.15.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam list; echo; ulimit -Sv 4000000; timeout 4h opam install -y --deps-only coq-mathcomp-solvable.1.14.0 coq.8.15.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>8 m 9 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam list; echo; ulimit -Sv 16000000; timeout 4h opam install -y -v coq-mathcomp-solvable.1.14.0 coq.8.15.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>6 m 13 s</dd>
</dl>
<h2>Installation size</h2>
<p>Total: 16 M</p>
<ul>
<li>2 M <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/mathcomp/solvable/extremal.vo</code></li>
<li>1 M <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/mathcomp/solvable/extremal.glob</code></li>
<li>990 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/mathcomp/solvable/burnside_app.vo</code></li>
<li>831 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/mathcomp/solvable/burnside_app.glob</code></li>
<li>825 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/mathcomp/solvable/abelian.vo</code></li>
<li>799 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/mathcomp/solvable/abelian.glob</code></li>
<li>697 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/mathcomp/solvable/maximal.vo</code></li>
<li>675 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/mathcomp/solvable/maximal.glob</code></li>
<li>474 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/mathcomp/solvable/pgroup.glob</code></li>
<li>471 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/mathcomp/solvable/extraspecial.vo</code></li>
<li>409 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/mathcomp/solvable/hall.vo</code></li>
<li>386 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/mathcomp/solvable/hall.glob</code></li>
<li>348 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/mathcomp/solvable/extraspecial.glob</code></li>
<li>320 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/mathcomp/solvable/pgroup.vo</code></li>
<li>317 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/mathcomp/solvable/frobenius.vo</code></li>
<li>295 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/mathcomp/solvable/center.vo</code></li>
<li>291 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/mathcomp/solvable/frobenius.glob</code></li>
<li>290 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/mathcomp/solvable/cyclic.glob</code></li>
<li>277 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/mathcomp/solvable/nilpotent.glob</code></li>
<li>259 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/mathcomp/solvable/alt.vo</code></li>
<li>254 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/mathcomp/solvable/sylow.glob</code></li>
<li>253 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/mathcomp/solvable/finmodule.vo</code></li>
<li>249 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/mathcomp/solvable/cyclic.vo</code></li>
<li>247 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/mathcomp/solvable/finmodule.glob</code></li>
<li>243 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/mathcomp/solvable/sylow.vo</code></li>
<li>220 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/mathcomp/solvable/nilpotent.vo</code></li>
<li>210 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/mathcomp/solvable/center.glob</code></li>
<li>198 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/mathcomp/solvable/jordanholder.glob</code></li>
<li>194 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/mathcomp/solvable/jordanholder.vo</code></li>
<li>191 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/mathcomp/solvable/alt.glob</code></li>
<li>186 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/mathcomp/solvable/gseries.vo</code></li>
<li>165 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/mathcomp/solvable/commutator.glob</code></li>
<li>159 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/mathcomp/solvable/primitive_action.vo</code></li>
<li>137 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/mathcomp/solvable/gseries.glob</code></li>
<li>120 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/mathcomp/solvable/extremal.v</code></li>
<li>114 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/mathcomp/solvable/commutator.vo</code></li>
<li>111 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/mathcomp/solvable/primitive_action.glob</code></li>
<li>108 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/mathcomp/solvable/gfunctor.vo</code></li>
<li>92 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/mathcomp/solvable/gfunctor.glob</code></li>
<li>87 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/mathcomp/solvable/abelian.v</code></li>
<li>73 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/mathcomp/solvable/maximal.v</code></li>
<li>50 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/mathcomp/solvable/pgroup.v</code></li>
<li>46 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/mathcomp/solvable/burnside_app.v</code></li>
<li>41 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/mathcomp/solvable/hall.v</code></li>
<li>41 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/mathcomp/solvable/extraspecial.v</code></li>
<li>35 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/mathcomp/solvable/frobenius.v</code></li>
<li>33 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/mathcomp/solvable/cyclic.v</code></li>
<li>29 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/mathcomp/solvable/jordanholder.v</code></li>
<li>28 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/mathcomp/solvable/nilpotent.v</code></li>
<li>27 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/mathcomp/solvable/sylow.v</code></li>
<li>27 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/mathcomp/solvable/finmodule.v</code></li>
<li>24 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/mathcomp/solvable/center.v</code></li>
<li>23 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/mathcomp/solvable/alt.v</code></li>
<li>20 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/mathcomp/solvable/gseries.v</code></li>
<li>20 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/mathcomp/solvable/all_solvable.vo</code></li>
<li>20 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/mathcomp/solvable/gfunctor.v</code></li>
<li>14 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/mathcomp/solvable/primitive_action.v</code></li>
<li>13 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/mathcomp/solvable/commutator.v</code></li>
<li>1 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/mathcomp/solvable/all_solvable.glob</code></li>
<li>1 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/mathcomp/solvable/all_solvable.v</code></li>
</ul>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq-mathcomp-solvable.1.14.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
| {
"content_hash": "4cd928e8683238b4fcf1ae2aa93010f9",
"timestamp": "",
"source": "github",
"line_count": 215,
"max_line_length": 554,
"avg_line_length": 69.75348837209302,
"alnum_prop": 0.6041208241648329,
"repo_name": "coq-bench/coq-bench.github.io",
"id": "36330cd90be12dabca867724278522a03f2c9690",
"size": "15023",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clean/Linux-x86_64-4.14.0-2.0.10/released/8.15.0/mathcomp-solvable/1.14.0.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
<?php
/*
* This file is part of the overtrue/wechat.
*
* (c) overtrue <i@overtrue.me>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace EasyWeChat\OfficialAccount\CustomerService;
use EasyWeChat\Kernel\BaseClient;
/**
* Class SessionClient.
*
* @author overtrue <i@overtrue.me>
*/
class SessionClient extends BaseClient
{
/**
* List all sessions of $account.
*
* @param string $account
*
* @return mixed
*/
public function list(string $account)
{
return $this->httpGet('customservice/kfsession/getsessionlist', ['kf_account' => $account]);
}
/**
* List all the people waiting.
*
* @return mixed
*/
public function waiting()
{
return $this->httpGet('customservice/kfsession/getwaitcase');
}
/**
* Create a session.
*
* @param string $account
* @param string $openid
*
* @return mixed
*/
public function create(string $account, string $openid)
{
$params = [
'kf_account' => $account,
'openid' => $openid,
];
return $this->httpPostJson('customservice/kfsession/create', $params);
}
/**
* Close a session.
*
* @param string $account
* @param string $openid
*
* @return mixed
*/
public function close(string $account, string $openid)
{
$params = [
'kf_account' => $account,
'openid' => $openid,
];
return $this->httpPostJson('customservice/kfsession/close', $params);
}
/**
* Get a session.
*
* @param string $openid
*
* @return mixed
*/
public function get(string $openid)
{
return $this->httpGet('customservice/kfsession/getsession', ['openid' => $openid]);
}
}
| {
"content_hash": "b789eb188694e4e1e6a67d4c3892c42f",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 100,
"avg_line_length": 20.706521739130434,
"alnum_prop": 0.5622047244094488,
"repo_name": "ac1982/wechat",
"id": "441da4dcf02a0373398a810a6e394e09f149ef6f",
"size": "1905",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/OfficialAccount/CustomerService/SessionClient.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "835354"
},
{
"name": "Shell",
"bytes": "3021"
}
],
"symlink_target": ""
} |
from __future__ import absolute_import
from etsdevtools.developer.tools.image_volume_builder import *
| {
"content_hash": "9992db382ac86482573e1b3684eebfe1",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 62,
"avg_line_length": 51,
"alnum_prop": 0.8137254901960784,
"repo_name": "enthought/etsproxy",
"id": "14de884eea430daec4494b63c06d75a7a60778d6",
"size": "117",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "enthought/developer/tools/image_volume_builder.py",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Python",
"bytes": "363714"
}
],
"symlink_target": ""
} |
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
namespace MonoGame.Extended.TextureAtlases
{
public static class SpriteBatchExtensions
{
public static void Draw(this SpriteBatch spriteBatch, TextureRegion2D textureRegion, Vector2 position,
Color color)
{
var sourceRectangle = textureRegion.Bounds;
spriteBatch.Draw(textureRegion.Texture, position, sourceRectangle, color, 0, Vector2.Zero, Vector2.One, SpriteEffects.None, 0);
}
public static void Draw(this SpriteBatch spriteBatch, TextureRegion2D textureRegion, Vector2 position, Color color,
float rotation, Vector2 origin, Vector2 scale, SpriteEffects effects, float layerDepth)
{
var sourceRectangle = textureRegion.Bounds;
spriteBatch.Draw(textureRegion.Texture, position, sourceRectangle, color, rotation, origin, scale, effects, layerDepth);
}
public static void Draw(this SpriteBatch spriteBatch, TextureRegion2D textureRegion, Rectangle destinationRectangle, Color color)
{
var ninePatchRegion = textureRegion as NinePatchRegion2D;
if (ninePatchRegion != null)
Draw(spriteBatch, ninePatchRegion, destinationRectangle, color);
else
spriteBatch.Draw(textureRegion.Texture, destinationRectangle, textureRegion.Bounds, color);
}
public static void Draw(this SpriteBatch spriteBatch, NinePatchRegion2D ninePatchRegion, Rectangle destinationRectangle, Color color)
{
var destinationPatches = ninePatchRegion.CreatePatches(destinationRectangle);
var sourcePatches = ninePatchRegion.SourcePatches;
for (var i = 0; i < sourcePatches.Length; i++)
spriteBatch.Draw(ninePatchRegion.Texture, sourceRectangle: sourcePatches[i], destinationRectangle: destinationPatches[i], color: color);
}
}
} | {
"content_hash": "dde589de0b075bd1bfec939c220f7d50",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 152,
"avg_line_length": 48.21951219512195,
"alnum_prop": 0.6980273141122914,
"repo_name": "HyperionMT/MonoGame.Extended",
"id": "a51d20581d3a5a02ef878d5344640d594710241d",
"size": "1979",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "Source/MonoGame.Extended/TextureAtlases/SpriteBatchExtensions.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "178"
},
{
"name": "C#",
"bytes": "1426163"
},
{
"name": "HLSL",
"bytes": "1835"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="lang:clipboard.copy" content="Copy to clipboard">
<meta name="lang:clipboard.copied" content="Copied to clipboard">
<meta name="lang:search.language" content="en">
<meta name="lang:search.pipeline.stopwords" content="True">
<meta name="lang:search.pipeline.trimmer" content="True">
<meta name="lang:search.result.none" content="No matching documents">
<meta name="lang:search.result.one" content="1 matching document">
<meta name="lang:search.result.other" content="# matching documents">
<meta name="lang:search.tokenizer" content="[\s\-]+">
<link href="https://fonts.gstatic.com/" rel="preconnect" crossorigin>
<link href="https://fonts.googleapis.com/css?family=Roboto+Mono:400,500,700|Roboto:300,400,400i,700&display=fallback" rel="stylesheet">
<style>
body,
input {
font-family: "Roboto", "Helvetica Neue", Helvetica, Arial, sans-serif
}
code,
kbd,
pre {
font-family: "Roboto Mono", "Courier New", Courier, monospace
}
</style>
<link rel="stylesheet" href="../_static/stylesheets/application.css"/>
<link rel="stylesheet" href="../_static/stylesheets/application-palette.css"/>
<link rel="stylesheet" href="../_static/stylesheets/application-fixes.css"/>
<link rel="stylesheet" href="../_static/fonts/material-icons.css"/>
<meta name="theme-color" content="#3f51b5">
<script src="../_static/javascripts/modernizr.js"></script>
<title>statsmodels.sandbox.regression.gmm.IVRegressionResults.conf_int — statsmodels</title>
<link rel="icon" type="image/png" sizes="32x32" href="../_static/icons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="../_static/icons/favicon-16x16.png">
<link rel="manifest" href="../_static/icons/site.webmanifest">
<link rel="mask-icon" href="../_static/icons/safari-pinned-tab.svg" color="#919191">
<meta name="msapplication-TileColor" content="#2b5797">
<meta name="msapplication-config" content="../_static/icons/browserconfig.xml">
<link rel="stylesheet" href="../_static/stylesheets/examples.css">
<link rel="stylesheet" href="../_static/stylesheets/deprecation.css">
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/material.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="../_static/graphviz.css" />
<script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
<script src="../_static/jquery.js"></script>
<script src="../_static/underscore.js"></script>
<script src="../_static/doctools.js"></script>
<script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>
<script async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true, "ignoreClass": "document", "processClass": "math|output_area"}})</script>
<link rel="shortcut icon" href="../_static/favicon.ico"/>
<link rel="author" title="About these documents" href="../about.html" />
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="statsmodels.sandbox.regression.gmm.IVRegressionResults.cov_params" href="statsmodels.sandbox.regression.gmm.IVRegressionResults.cov_params.html" />
<link rel="prev" title="statsmodels.sandbox.regression.gmm.IVRegressionResults.compare_lr_test" href="statsmodels.sandbox.regression.gmm.IVRegressionResults.compare_lr_test.html" />
</head>
<body dir=ltr
data-md-color-primary=indigo data-md-color-accent=blue>
<svg class="md-svg">
<defs data-children-count="0">
<svg xmlns="http://www.w3.org/2000/svg" width="416" height="448" viewBox="0 0 416 448" id="__github"><path fill="currentColor" d="M160 304q0 10-3.125 20.5t-10.75 19T128 352t-18.125-8.5-10.75-19T96 304t3.125-20.5 10.75-19T128 256t18.125 8.5 10.75 19T160 304zm160 0q0 10-3.125 20.5t-10.75 19T288 352t-18.125-8.5-10.75-19T256 304t3.125-20.5 10.75-19T288 256t18.125 8.5 10.75 19T320 304zm40 0q0-30-17.25-51T296 232q-10.25 0-48.75 5.25Q229.5 240 208 240t-39.25-2.75Q130.75 232 120 232q-29.5 0-46.75 21T56 304q0 22 8 38.375t20.25 25.75 30.5 15 35 7.375 37.25 1.75h42q20.5 0 37.25-1.75t35-7.375 30.5-15 20.25-25.75T360 304zm56-44q0 51.75-15.25 82.75-9.5 19.25-26.375 33.25t-35.25 21.5-42.5 11.875-42.875 5.5T212 416q-19.5 0-35.5-.75t-36.875-3.125-38.125-7.5-34.25-12.875T37 371.5t-21.5-28.75Q0 312 0 260q0-59.25 34-99-6.75-20.5-6.75-42.5 0-29 12.75-54.5 27 0 47.5 9.875t47.25 30.875Q171.5 96 212 96q37 0 70 8 26.25-20.5 46.75-30.25T376 64q12.75 25.5 12.75 54.5 0 21.75-6.75 42 34 40 34 99.5z"/></svg>
</defs>
</svg>
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer">
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#generated/statsmodels.sandbox.regression.gmm.IVRegressionResults.conf_int" tabindex="1" class="md-skip"> Skip to content </a>
<header class="md-header" data-md-component="header">
<nav class="md-header-nav md-grid">
<div class="md-flex navheader">
<div class="md-flex__cell md-flex__cell--shrink">
<a href="../index.html" title="statsmodels"
class="md-header-nav__button md-logo">
<img src="../_static/statsmodels-logo-v2-bw.svg" height="26"
alt="statsmodels logo">
</a>
</div>
<div class="md-flex__cell md-flex__cell--shrink">
<label class="md-icon md-icon--menu md-header-nav__button" for="__drawer"></label>
</div>
<div class="md-flex__cell md-flex__cell--stretch">
<div class="md-flex__ellipsis md-header-nav__title" data-md-component="title">
<span class="md-header-nav__topic">statsmodels v0.12.2</span>
<span class="md-header-nav__topic"> statsmodels.sandbox.regression.gmm.IVRegressionResults.conf_int </span>
</div>
</div>
<div class="md-flex__cell md-flex__cell--shrink">
<label class="md-icon md-icon--search md-header-nav__button" for="__search"></label>
<div class="md-search" data-md-component="search" role="dialog">
<label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search">
<form class="md-search__form" action="../search.html" method="GET" name="search">
<input type="text" class="md-search__input" name="q" placeholder="Search"
autocapitalize="off" autocomplete="off" spellcheck="false"
data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">

</button>
</form>
<div class="md-search__output">
<div class="md-search__scrollwrap" data-md-scrollfix>
<div class="md-search-result" data-md-component="result">
<div class="md-search-result__meta">
Type to start searching
</div>
<ol class="md-search-result__list"></ol>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="md-flex__cell md-flex__cell--shrink">
<div class="md-header-nav__source">
<a href="https://github.com/statsmodels/statsmodels" title="Go to repository" class="md-source" data-md-source="github">
<div class="md-source__icon">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24" width="28" height="28">
<use xlink:href="#__github" width="24" height="24"></use>
</svg>
</div>
<div class="md-source__repository">
statsmodels
</div>
</a>
</div>
</div>
<script src="../_static/javascripts/version_dropdown.js"></script>
<script>
var json_loc = "../_static/versions.json",
target_loc = "../../",
text = "Versions";
$( document ).ready( add_version_dropdown(json_loc, target_loc, text));
</script>
</div>
</nav>
</header>
<div class="md-container">
<nav class="md-tabs" data-md-component="tabs">
<div class="md-tabs__inner md-grid">
<ul class="md-tabs__list">
<li class="md-tabs__item"><a href="../user-guide.html" class="md-tabs__link">User Guide</a></li>
<li class="md-tabs__item"><a href="../gmm.html" class="md-tabs__link">Generalized Method of Moments <code class="xref py py-mod docutils literal notranslate"><span class="pre">gmm</span></code></a></li>
<li class="md-tabs__item"><a href="statsmodels.sandbox.regression.gmm.IVRegressionResults.html" class="md-tabs__link">statsmodels.sandbox.regression.gmm.IVRegressionResults</a></li>
</ul>
</div>
</nav>
<main class="md-main">
<div class="md-main__inner md-grid" data-md-component="container">
<div class="md-sidebar md-sidebar--primary" data-md-component="navigation">
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--primary" data-md-level="0">
<label class="md-nav__title md-nav__title--site" for="__drawer">
<a href="../index.html" title="statsmodels" class="md-nav__button md-logo">
<img src="../_static/statsmodels-logo-v2-bw.svg" alt=" logo" width="48" height="48">
</a>
<a href="../index.html"
title="statsmodels">statsmodels v0.12.2</a>
</label>
<div class="md-nav__source">
<a href="https://github.com/statsmodels/statsmodels" title="Go to repository" class="md-source" data-md-source="github">
<div class="md-source__icon">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24" width="28" height="28">
<use xlink:href="#__github" width="24" height="24"></use>
</svg>
</div>
<div class="md-source__repository">
statsmodels
</div>
</a>
</div>
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="../install.html" class="md-nav__link">Installing statsmodels</a>
</li>
<li class="md-nav__item">
<a href="../gettingstarted.html" class="md-nav__link">Getting started</a>
</li>
<li class="md-nav__item">
<a href="../user-guide.html" class="md-nav__link">User Guide</a>
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="../user-guide.html#background" class="md-nav__link">Background</a>
</li>
<li class="md-nav__item">
<a href="../user-guide.html#regression-and-linear-models" class="md-nav__link">Regression and Linear Models</a>
</li>
<li class="md-nav__item">
<a href="../user-guide.html#time-series-analysis" class="md-nav__link">Time Series Analysis</a>
</li>
<li class="md-nav__item">
<a href="../user-guide.html#other-models" class="md-nav__link">Other Models</a>
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="../duration.html" class="md-nav__link">Methods for Survival and Duration Analysis</a>
</li>
<li class="md-nav__item">
<a href="../nonparametric.html" class="md-nav__link">Nonparametric Methods <code class="xref py py-mod docutils literal notranslate"><span class="pre">nonparametric</span></code></a>
</li>
<li class="md-nav__item">
<a href="../gmm.html" class="md-nav__link">Generalized Method of Moments <code class="xref py py-mod docutils literal notranslate"><span class="pre">gmm</span></code></a>
</li>
<li class="md-nav__item">
<a href="../miscmodels.html" class="md-nav__link">Other Models <code class="xref py py-mod docutils literal notranslate"><span class="pre">miscmodels</span></code></a>
</li>
<li class="md-nav__item">
<a href="../multivariate.html" class="md-nav__link">Multivariate Statistics <code class="xref py py-mod docutils literal notranslate"><span class="pre">multivariate</span></code></a>
</li></ul>
</li>
<li class="md-nav__item">
<a href="../user-guide.html#statistics-and-tools" class="md-nav__link">Statistics and Tools</a>
</li>
<li class="md-nav__item">
<a href="../user-guide.html#data-sets" class="md-nav__link">Data Sets</a>
</li>
<li class="md-nav__item">
<a href="../user-guide.html#sandbox" class="md-nav__link">Sandbox</a>
</li></ul>
</li>
<li class="md-nav__item">
<a href="../examples/index.html" class="md-nav__link">Examples</a>
</li>
<li class="md-nav__item">
<a href="../api.html" class="md-nav__link">API Reference</a>
</li>
<li class="md-nav__item">
<a href="../about.html" class="md-nav__link">About statsmodels</a>
</li>
<li class="md-nav__item">
<a href="../dev/index.html" class="md-nav__link">Developer Page</a>
</li>
<li class="md-nav__item">
<a href="../release/index.html" class="md-nav__link">Release Notes</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-sidebar md-sidebar--secondary" data-md-component="toc">
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--secondary">
<ul class="md-nav__list" data-md-scrollfix="">
<li class="md-nav__item"><a class="md-nav__extra_link" href="../_sources/generated/statsmodels.sandbox.regression.gmm.IVRegressionResults.conf_int.rst.txt">Show Source</a> </li>
<li id="searchbox" class="md-nav__item"></li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-content">
<article class="md-content__inner md-typeset" role="main">
<h1 id="generated-statsmodels-sandbox-regression-gmm-ivregressionresults-conf-int--page-root">statsmodels.sandbox.regression.gmm.IVRegressionResults.conf_int<a class="headerlink" href="#generated-statsmodels-sandbox-regression-gmm-ivregressionresults-conf-int--page-root" title="Permalink to this headline">¶</a></h1>
<dl class="py method">
<dt id="statsmodels.sandbox.regression.gmm.IVRegressionResults.conf_int">
<code class="sig-prename descclassname">IVRegressionResults.</code><code class="sig-name descname">conf_int</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">alpha</span><span class="o">=</span><span class="default_value">0.05</span></em>, <em class="sig-param"><span class="n">cols</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="headerlink" href="#statsmodels.sandbox.regression.gmm.IVRegressionResults.conf_int" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the confidence interval of the fitted parameters.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><dl>
<dt><strong>alpha</strong><span class="classifier"><a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><code class="docutils literal notranslate"><span class="pre">float</span></code></a>, <code class="xref py py-obj docutils literal notranslate"><span class="pre">optional</span></code></span></dt><dd><p>The <cite>alpha</cite> level for the confidence interval. The default
<cite>alpha</cite> = .05 returns a 95% confidence interval.</p>
</dd>
<dt><strong>cols</strong><span class="classifier"><a class="reference external" href="https://numpy.org/doc/stable/glossary.html#term-array-like" title="(in NumPy v1.20)"><span>array_like</span></a>, <code class="xref py py-obj docutils literal notranslate"><span class="pre">optional</span></code></span></dt><dd><p>Columns to included in returned confidence intervals.</p>
</dd>
</dl>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><dl class="simple">
<dt><a class="reference external" href="https://numpy.org/doc/stable/glossary.html#term-array-like" title="(in NumPy v1.20)"><span>array_like</span></a></dt><dd><p>The confidence intervals.</p>
</dd>
</dl>
</dd>
</dl>
<p class="rubric">Notes</p>
<p>The confidence interval is based on Student’s t-distribution.</p>
</dd></dl>
</article>
</div>
</div>
</main>
</div>
<footer class="md-footer">
<div class="md-footer-nav">
<nav class="md-footer-nav__inner md-grid">
<a href="statsmodels.sandbox.regression.gmm.IVRegressionResults.compare_lr_test.html" title="statsmodels.sandbox.regression.gmm.IVRegressionResults.compare_lr_test"
class="md-flex md-footer-nav__link md-footer-nav__link--prev"
rel="prev">
<div class="md-flex__cell md-flex__cell--shrink">
<i class="md-icon md-icon--arrow-back md-footer-nav__button"></i>
</div>
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
<span class="md-flex__ellipsis">
<span
class="md-footer-nav__direction"> Previous </span> statsmodels.sandbox.regression.gmm.IVRegressionResults.compare_lr_test </span>
</div>
</a>
<a href="statsmodels.sandbox.regression.gmm.IVRegressionResults.cov_params.html" title="statsmodels.sandbox.regression.gmm.IVRegressionResults.cov_params"
class="md-flex md-footer-nav__link md-footer-nav__link--next"
rel="next">
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title"><span
class="md-flex__ellipsis"> <span
class="md-footer-nav__direction"> Next </span> statsmodels.sandbox.regression.gmm.IVRegressionResults.cov_params </span>
</div>
<div class="md-flex__cell md-flex__cell--shrink"><i
class="md-icon md-icon--arrow-forward md-footer-nav__button"></i>
</div>
</a>
</nav>
</div>
<div class="md-footer-meta md-typeset">
<div class="md-footer-meta__inner md-grid">
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
© Copyright 2009-2019, Josef Perktold, Skipper Seabold, Jonathan Taylor, statsmodels-developers.
</div>
Last updated on
Feb 02, 2021.
<br/>
Created using
<a href="http://www.sphinx-doc.org/">Sphinx</a> 3.4.3.
and
<a href="https://github.com/bashtage/sphinx-material/">Material for
Sphinx</a>
</div>
</div>
</div>
</footer>
<script src="../_static/javascripts/application.js"></script>
<script>app.initialize({version: "1.0.4", url: {base: ".."}})</script>
</body>
</html> | {
"content_hash": "3de97adbe992d4900f9e884b4af840b8",
"timestamp": "",
"source": "github",
"line_count": 481,
"max_line_length": 999,
"avg_line_length": 41.66528066528066,
"alnum_prop": 0.613991317798513,
"repo_name": "statsmodels/statsmodels.github.io",
"id": "a183516f9b3c9705c087119e9e639dc3ba00a617",
"size": "20047",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "v0.12.2/generated/statsmodels.sandbox.regression.gmm.IVRegressionResults.conf_int.html",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
require 'active_support/core_ext/integer/time'
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
config.cache_classes = true
# Eager load code on boot. This eager loads most of Rails and
# your application in memory, allowing both threaded web servers
# and those relying on copy on write to perform better.
# Rake tasks automatically ignore this option for performance.
config.eager_load = true
# Full error reports are disabled and caching is turned on.
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
# Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"]
# or in config/master.key. This key is used to decrypt credentials (and other encrypted files).
# config.require_master_key = true
# Disable serving static files from the `/public` folder by default since
# Apache or NGINX already handles this.
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
# Compress CSS using a preprocessor.
# config.assets.css_compressor = :sass
# Do not fallback to assets pipeline if a precompiled asset is missed.
config.assets.compile = false
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
# config.asset_host = 'http://assets.example.com'
# Specifies the header that your server uses for sending files.
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
# Store uploaded files on the local file system (see config/storage.yml for options).
config.active_storage.service = :local
# Mount Action Cable outside main process or domain.
# config.action_cable.mount_path = nil
# config.action_cable.url = 'wss://example.com/cable'
# config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ]
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
config.force_ssl = true
# Include generic and useful information about system operation, but avoid logging too much
# information to avoid inadvertent exposure of personally identifiable information (PII).
config.log_level = :debug
# Prepend all log lines with the following tags.
config.log_tags = [:request_id]
# Use a different cache store in production.
# config.cache_store = :mem_cache_store
# Use a real queuing backend for Active Job (and separate queues per environment).
# config.active_job.queue_adapter = :resque
# config.active_job.queue_name_prefix = "tcfdg_production"
config.action_mailer.perform_caching = false
config.action_mailer.default_url_options = { host: 'taichung-fieldwork.org' }
config.action_mailer.smtp_settings = Settings.smtp.as_json
# Ignore bad email addresses and do not raise email delivery errors.
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
config.action_mailer.raise_delivery_errors = Settings.raise_delivery_errors
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation cannot be found).
config.i18n.fallbacks = true
# Send deprecation notices to registered listeners.
config.active_support.deprecation = :notify
# Log disallowed deprecations.
config.active_support.disallowed_deprecation = :log
# Tell Active Support which deprecation messages to disallow.
config.active_support.disallowed_deprecation_warnings = []
# Use default logging formatter so that PID and timestamp are not suppressed.
config.log_formatter = ::Logger::Formatter.new
# Use a different logger for distributed setups.
# require "syslog/logger"
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
if ENV['RAILS_LOG_TO_STDOUT'].present?
logger = ActiveSupport::Logger.new(STDOUT)
logger.formatter = config.log_formatter
config.logger = ActiveSupport::TaggedLogging.new(logger)
end
# Do not dump schema after migrations.
config.active_record.dump_schema_after_migration = false
# Inserts middleware to perform automatic connection switching.
# The `database_selector` hash is used to pass options to the DatabaseSelector
# middleware. The `delay` is used to determine how long to wait after a write
# to send a subsequent read to the primary.
#
# The `database_resolver` class is used by the middleware to determine which
# database is appropriate to use based on the time delay.
#
# The `database_resolver_context` class is used by the middleware to set
# timestamps for the last write to the primary. The resolver uses the context
# class timestamps to determine how long to wait before reading from the
# replica.
#
# By default Rails will store a last write timestamp in the session. The
# DatabaseSelector middleware is designed as such you can define your own
# strategy for connection switching and pass that into the middleware through
# these configuration options.
# config.active_record.database_selector = { delay: 2.seconds }
# config.active_record.database_resolver = ActiveRecord::Middleware::DatabaseSelector::Resolver
# config.active_record.database_resolver_context = ActiveRecord::Middleware::DatabaseSelector::Resolver::Session
end
| {
"content_hash": "08034c5da3abf26102abc69197950e84",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 114,
"avg_line_length": 45.02459016393443,
"alnum_prop": 0.7522301110504278,
"repo_name": "frsnic/tcfdg",
"id": "232ebc1a6655803991e68ba668bf305458705ca3",
"size": "5493",
"binary": false,
"copies": "1",
"ref": "refs/heads/feature/rails_6",
"path": "config/environments/production.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "82056"
},
{
"name": "HTML",
"bytes": "29295"
},
{
"name": "JavaScript",
"bytes": "3847"
},
{
"name": "Ruby",
"bytes": "119056"
},
{
"name": "SCSS",
"bytes": "9938"
},
{
"name": "Slim",
"bytes": "34747"
}
],
"symlink_target": ""
} |
package com.ibm.watson.discovery.v1.model;
import com.ibm.cloud.sdk.core.service.model.GenericModel;
/** The deleteUserData options. */
public class DeleteUserDataOptions extends GenericModel {
protected String customerId;
/** Builder. */
public static class Builder {
private String customerId;
private Builder(DeleteUserDataOptions deleteUserDataOptions) {
this.customerId = deleteUserDataOptions.customerId;
}
/** Instantiates a new builder. */
public Builder() {}
/**
* Instantiates a new builder with required properties.
*
* @param customerId the customerId
*/
public Builder(String customerId) {
this.customerId = customerId;
}
/**
* Builds a DeleteUserDataOptions.
*
* @return the new DeleteUserDataOptions instance
*/
public DeleteUserDataOptions build() {
return new DeleteUserDataOptions(this);
}
/**
* Set the customerId.
*
* @param customerId the customerId
* @return the DeleteUserDataOptions builder
*/
public Builder customerId(String customerId) {
this.customerId = customerId;
return this;
}
}
protected DeleteUserDataOptions() {}
protected DeleteUserDataOptions(Builder builder) {
com.ibm.cloud.sdk.core.util.Validator.notNull(builder.customerId, "customerId cannot be null");
customerId = builder.customerId;
}
/**
* New builder.
*
* @return a DeleteUserDataOptions builder
*/
public Builder newBuilder() {
return new Builder(this);
}
/**
* Gets the customerId.
*
* <p>The customer ID for which all data is to be deleted.
*
* @return the customerId
*/
public String customerId() {
return customerId;
}
}
| {
"content_hash": "f0dc64eb2f3caea176f81b01304c4213",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 99,
"avg_line_length": 22.576923076923077,
"alnum_prop": 0.6649630891538898,
"repo_name": "watson-developer-cloud/java-sdk",
"id": "2de57cb6730e98a857975e64c8af91989f7f1122",
"size": "2351",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "discovery/src/main/java/com/ibm/watson/discovery/v1/model/DeleteUserDataOptions.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Dockerfile",
"bytes": "350"
},
{
"name": "HTML",
"bytes": "50951"
},
{
"name": "Java",
"bytes": "7270071"
},
{
"name": "Makefile",
"bytes": "3123"
},
{
"name": "Python",
"bytes": "381"
},
{
"name": "Shell",
"bytes": "7894"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "7002dfd194799f77faa1cb51edc4c1b1",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 31,
"avg_line_length": 9.692307692307692,
"alnum_prop": 0.7063492063492064,
"repo_name": "mdoering/backbone",
"id": "134fd46f4c12763372b26fbc1e8947fc2c942185",
"size": "187",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Fabales/Fabaceae/Mimosa/Mimosa claussenii/Mimosa claussenii pumila/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
'use strict';
var assert = require('assert');
var sharp = require('../../index');
var fixtures = require('../fixtures');
sharp.cache(0);
describe('Colour space conversion', function() {
it('To greyscale', function(done) {
sharp(fixtures.inputJpg)
.resize(320, 240)
.greyscale()
.toFile(fixtures.path('output.greyscale-gamma-0.0.jpg'), done);
});
it('To greyscale with gamma correction', function(done) {
sharp(fixtures.inputJpg)
.resize(320, 240)
.gamma()
.greyscale()
.toFile(fixtures.path('output.greyscale-gamma-2.2.jpg'), done);
});
it('Not to greyscale', function(done) {
sharp(fixtures.inputJpg)
.resize(320, 240)
.greyscale(false)
.toFile(fixtures.path('output.greyscale-not.jpg'), done);
});
if (sharp.format.webp.output.buffer) {
it('From 1-bit TIFF to sRGB WebP [slow]', function(done) {
sharp(fixtures.inputTiff)
.webp()
.toBuffer(function(err, data, info) {
if (err) throw err;
assert.strictEqual(true, data.length > 0);
assert.strictEqual('webp', info.format);
done();
});
});
}
it('From CMYK to sRGB', function(done) {
sharp(fixtures.inputJpgWithCmykProfile)
.resize(320)
.toBuffer(function(err, data, info) {
if (err) throw err;
assert.strictEqual(true, data.length > 0);
assert.strictEqual('jpeg', info.format);
assert.strictEqual(320, info.width);
done();
});
});
it('From CMYK to sRGB with white background, not yellow', function(done) {
sharp(fixtures.inputJpgWithCmykProfile)
.resize(320, 240)
.background('white')
.embed()
.toFile(fixtures.path('output.cmyk2srgb.jpg'), function(err, info) {
if (err) throw err;
assert.strictEqual('jpeg', info.format);
assert.strictEqual(320, info.width);
assert.strictEqual(240, info.height);
done();
});
});
it('From profile-less CMYK to sRGB', function(done) {
sharp(fixtures.inputJpgWithCmykNoProfile)
.resize(320)
.toBuffer(function(err, data, info) {
if (err) throw err;
assert.strictEqual(true, data.length > 0);
assert.strictEqual('jpeg', info.format);
assert.strictEqual(320, info.width);
done();
});
});
});
| {
"content_hash": "11ef220eed925637bf87fad41eeb2ab1",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 76,
"avg_line_length": 27.776470588235295,
"alnum_prop": 0.5972045743329097,
"repo_name": "dtest/sharp",
"id": "8f878ac0feb9434c77f3b3880967ffdd2f6cf934",
"size": "2361",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "test/unit/colourspace.js",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "361"
},
{
"name": "C++",
"bytes": "84298"
},
{
"name": "JavaScript",
"bytes": "155868"
},
{
"name": "Python",
"bytes": "2442"
},
{
"name": "Shell",
"bytes": "13945"
}
],
"symlink_target": ""
} |
Pattern: Malformed whitespace before range operator in media feature
Issue: -
## Description
Require a single space or disallow whitespace before the range operator in media features.
## Examples
### `"always"`
There *must always* be a single space before the range operator.
The following patterns are considered violations:
```css
@media (width>=600px) {}
```
```css
@media (width>= 600px) {}
```
The following patterns are *not* considered violations:
```css
@media (width >=600px) {}
```
```css
@media (width >= 600px) {}
```
### `"never"`
There *must never* be whitespace before the range operator.
The following patterns are considered violations:
```css
@media (width >=600px) {}
```
```css
@media (width >= 600px) {}
```
The following patterns are *not* considered violations:
```css
@media (width>=600px) {}
```
```css
@media (width>= 600px) {}
```
## Further Reading
* [stylelint - media-feature-range-operator-space-before](https://stylelint.io/user-guide/rules/media-feature-range-operator-space-before) | {
"content_hash": "c324ef43cc93a59dde5aaec43401399d",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 138,
"avg_line_length": 17,
"alnum_prop": 0.6904532304725168,
"repo_name": "Adroiti/docs-for-code-review-tools",
"id": "d14b262d56e227e5303b9921b46b0e2e6fe858fa",
"size": "1037",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "stylelint/media-feature-range-operator-space-before.md",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
(function(exports) {
'use strict';
var debug = Config.debug;
var refreshTimeOut;
var isConnected = false, currentToken;
//miliseg timestamp start Communication
var _startCommunicationTime = 0;
var _participants = [];
var _numberParticipants = 0;
var _communicationEnd = true;
var _communicationToken = null;
var _wentToBackground = false;
const ROOM_ACTION_JOIN = 'join';
const ROOM_CLIENT_MAX_SIZE = 2;
const ROOM_FEEDBACK_TYPE = 'room';
const DEFAULT_JOIN_PARAMS = {
displayName: '',
video: true,
audio: true,
frontCamera: false
};
var acm = navigator.mozAudioChannelManager;
// Connected users connectionId per room
var connectionIds = {};
function _updateRoomAttribute(token, attribute) {
RoomsDB.get(token).then(function(room) {
room[attribute] = room[attribute] && room[attribute] + 1 || 1;
RoomsDB.update(room).then(function() {
debug && console.log(attribute + ' successfully set');
}, function() {
console.error('Error setting ' + attribute + ' field of the room');
});
}, function() {
console.error('Error retrieving room from RoomsDB');
});
}
function addConnectionId(roomToken, connectionId) {
debug && console.log("RoomConnections: Adding " + connectionId +
" to room " + roomToken);
if (!connectionIds[roomToken]) {
connectionIds[roomToken] = [];
}
var room = connectionIds[roomToken];
if (room.indexOf(connectionId) < 0) {
room.push(connectionId);
}
}
function updateConnectionIds(roomToken, connectionIds) {
debug && console.log("RoomConnections: Updating " + roomToken +
" with connections: " + connectionIds);
connectionIds[roomToken] = connectionIds;
}
function checkConnectionId(roomToken, connectionId) {
debug && console.log("RoomConnections: Checking " + connectionId +
" in room " + roomToken);
return connectionIds[roomToken] &&
(connectionIds[roomToken].indexOf(connectionId) >= 0);
}
function playEndedTone() {
TonePlayerHelper.init('telephony');
TonePlayerHelper.playEnded(RoomUI.isSpeakerEnabled);
}
function onHeadPhonesChange() {
RoomUI.headphonesPresent = RoomController.headphonesPresent;
}
function handleHeadPhonesChange() {
acm && acm.addEventListener('headphoneschange', onHeadPhonesChange);
}
function removeHeadPhonesChangeHandler() {
acm && acm.removeEventListener('headphoneschange', onHeadPhonesChange);
}
function showError(errorMessage) {
errorMessage = errorMessage || 'genericServerError1';
Loader.getErrorScreen().then(ErrorScreen => {
var _ = navigator.mozL10n.get;
ErrorScreen.show(_(errorMessage));
});
}
function setNumberParticipants(num) {
_numberParticipants = RoomUI.numberParticipants = num;
}
function removeMyselfFromRoom(params) {
Rooms.get(params.token).then(
function(room) {
if (room && room.participants && room.participants.length > 1) {
var amIin = false;
room.participants.forEach(function(participant) {
if (participant.account === params.displayName) {
Rooms.leave(params.token).then(function() {
RoomController.join(params);
});
amIin = true;
}
});
!amIin && showError('roomFull');
} else {
showError();
}
},
function(error) {
if (error) {
// See https://docs.services.mozilla.com/loop/apis.html
if (error.code === 403 && error.errno === 999) {
// The room was full and we were trying to remove the user who is
// neither a participant of the room nor the room owner. As the
// remove process failed, let's show the full room error then.
showError('roomFull');
return;
}
}
showError();
}
);
}
function onInvalidToken(params) {
var token = params.token;
RoomsDB.get(token).then(room => {
var parameters = {
type: 'confirm',
items: [
{
name: 'Cancel',
l10nId: 'cancel'
}
]
};
var title;
if (room) {
title = 'invalidRoomTokenAndDelete';
parameters.items[0].method = () => {
room.noLongerAvailable = true;
Controller.onRoomUpdated(room);
};
parameters.items.push({
name: 'Delete',
class: 'danger',
l10nId: 'delete',
method: (token) => {
// Step 1: Delete from loop server
// Step 2: Delete from DB (if the first step fails, this means
// the user is not the owner)
var deleteFromDB = Controller.onRoomDeleted.bind(null, token);
Rooms.delete(token).then(deleteFromDB, deleteFromDB);
},
params: [token]
});
} else {
title = 'invalidRoomToken';
var item = parameters.items[0];
item.name = 'OK';
item.l10nId = 'ok';
item.class = 'full';
}
parameters.section = navigator.mozL10n.get(title);
var options = new OptionMenu(parameters);
});
}
function handleBackgroundMode(params) {
document.hidden && Loader.getNotificationHelper().then(
function(NotificationHelper) {
_wentToBackground = true;
Utils.getAppInfo().then(appInfo => {
var _ = navigator.mozL10n.get;
NotificationHelper.send({
raw: params.roomName
}, {
body: _('tapToReturn'),
icon: appInfo.icon,
tag: params.roomUrl
}).then((notification) => {
var onVisibilityChange = function() {
if (!document.hidden) {
notification.close();
}
};
document.addEventListener('visibilitychange',
onVisibilityChange);
notification.onclose = function() {
document.removeEventListener('visibilitychange',
onVisibilityChange);
notification.onclose = notification.onclick = null;
if (_wentToBackground) {
RoomsDB.get(currentToken).then(room => {
room.backgroundMode = room.backgroundMode &&
room.backgroundMode + 1 || 1;
RoomsDB.update(room).then(function() {
debug &&
console.log('Field backgroundMode of the room successfully ' +
'updated');
}, function() {
console.error('Field backgroundMode of the room ' +
'unsuccessfully updated');
});
});
}
_wentToBackground = false;
};
notification.onclick = function() {
debug && console.log(
'Notification clicked for room: ' + params.roomUrl
);
appInfo.app.launch();
notification.close();
};
});
});
});
}
function rate(callback) {
if (typeof callback !== 'function') {
callback = function() {};
}
Loader.getFeedback(false /*isAttention = false*/).then(
function(FeedbackScreen){
FeedbackScreen.show(function(feedback) {
if (!feedback) {
return;
}
LazyLoader.load([
'js/helpers/metrics.js',
'js/helpers/feedback.js'
], function() {
// We distinguish between calls and room chats with the type prop.
feedback.type = ROOM_FEEDBACK_TYPE;
Feedback.send(feedback);
});
}).then(callback);
});
}
function _initCommunicationEvent() {
_startCommunicationTime = new Date().getTime();
_communicationEnd = false;
_communicationToken = currentToken;
}
function _logEventCommunication(aCurrentTime) {
if (_communicationEnd || !_communicationToken) {
return;
}
_communicationEnd = true;
// We need the lenght in seconds
var duration = Math.floor((aCurrentTime - _startCommunicationTime) / 1000);
Loader.getRoomEvent().then(RoomEvent => {
var other = RoomEvent.identityUnknown;
// For now we assume that only other User and I will make a communication
for (var i = 0, l = _participants.length;
i < l && other === RoomEvent.identityUnknown;
i++) {
// If participants[i] is not logged he hasn't account and we want
// to keep RoomEvent identifier
var account = _participants[i].account;
if (account && (account !== Controller.identity)) {
other = account;
}
}
RoomEvent.save({type: RoomEvent.type.communication,
token: _communicationToken,
otherIdentity: other,
length: duration });
});
}
function refreshMembership(token, before) {
refreshTimeOut = window.setTimeout(function() {
Rooms.refresh(token).then(
function(result) {
refreshMembership(token, result.expires);
},
function(error) {
// TODO: should we show some kind of error in the UI?
debug && console.log('Error while refreshing membership');
}
);
}, before * 1000);
}
var RoomController = {
get roomActive() {
return isConnected;
},
join: function(params) {
debug && console.log('Join room with params: ' + JSON.stringify(params));
window.dispatchEvent(new CustomEvent('joinstart'));
var forceReject = (params.action === 'reject');
if (forceReject) {
showError();
return;
}
if (!navigator.onLine) {
Loader.getOfflineScreen().then(OfflineScreen => {
var _ = navigator.mozL10n.get;
OfflineScreen.show(_('noConnection'));
});
return;
}
params = params || {};
if (!params.token) {
debug && console.log('Error while joining room');
showError();
return;
}
for (var param in params) {
params.param = params.param || DEFAULT_JOIN_PARAMS.param;
}
Loader.getRoomUI().then((RoomUI) => {
RoomUI.show(params).then(() => {
handleHeadPhonesChange();
params.audio = RoomUI.isMicEnabled;
params.localTargetElement = RoomUI.localTargetElement;
params.remoteTargetElement = RoomUI.remoteTargetElement;
Rooms.join(
params.token,
{
action: ROOM_ACTION_JOIN,
displayName: params.displayName,
clientMaxSize: ROOM_CLIENT_MAX_SIZE
}
).then(function(result) {
if (!result.apiKey || !result.sessionId || !result.sessionToken ||
!result.expires) {
debug &&
console.log('Error while joining room. Some params missing');
removeHeadPhonesChangeHandler();
RoomUI.hide();
Rooms.leave(params.token);
showError();
return;
}
var shouldRate = false, shouldPlayEnded = false;
var currentRoom = null;
isConnected = true;
currentToken = params.token;
var backgroundModeHandler = null;
Rooms.get(params.token).then(function(room) {
currentRoom = room;
params.roomName = room.roomName;
params.roomUrl = room.roomUrl;
backgroundModeHandler = handleBackgroundMode.bind(null, params);
document.addEventListener('visibilitychange',
backgroundModeHandler);
RoomUI.updateName(room.roomName);
setNumberParticipants(room.participants.length);
if (Controller.identity !== room.roomOwner) {
room.roomToken = params.token;
CallLog.addRoom(room).then(() => {
Loader.getRoomEvent().then(RoomEvent => {
RoomEvent.save({type: RoomEvent.type.iJoin,
token: currentToken });
});
});
} else {
CallLog.updateRoom(room).then(() => {
Loader.getRoomEvent().then(RoomEvent => {
RoomEvent.save({type: RoomEvent.type.iJoin,
token: currentToken });
});
});
}
_updateRoomAttribute(currentToken, 'numberTimesIJoined');
});
Loader.getRoomManager().then((RoomManager) => {
var roomManager = new RoomManager();
roomManager.on({
joining: function(event) {
debug && console.log('Room joining');
},
joined: function(event) {
debug && console.log('Room joined');
roomManager.publishAudio(RoomUI.isMicEnabled);
if (currentRoom &&
(currentRoom.roomOwner === params.displayName)) {
TonePlayerHelper.init('telephony');
TonePlayerHelper.playConnected(RoomUI.isSpeakerEnabled);
}
refreshMembership(params.token, result.expires);
},
left: function(event) {
playEndedTone();
// We take time here because we trying to set the count
// as exact than we can
var current = new Date().getTime();
debug && console.log('Room left');
window.clearTimeout(refreshTimeOut);
_logEventCommunication (current);
},
participantJoining: function(event) {
debug && console.log('Room participant joining');
},
participantJoined: function(event) {
debug && console.log('Room participant joined');
Rooms.get(currentToken).then(room => {
_participants = room.participants;
setNumberParticipants(_participants.length);
// If we joined a room we don't own we are not receiving
// push notification for that room. That means we have to
// set the participant name in the UI from here once he
// joins the room. For the time being as there is only
// room for two participant the participant name to set is
// the one that doesn't correspond to ours.
for (var i = 0, l = _participants.length; i < l; i++) {
var participant = _participants[i];
if (participant.displayName !== params.displayName) {
RoomUI.updateParticipant(participant.displayName,
participant.account);
break;
}
}
});
// The communication has started exactly in this moment
_updateRoomAttribute(currentToken, 'numberEstablishedConnections');
_initCommunicationEvent();
TonePlayerHelper.init('telephony');
TonePlayerHelper.playConnected(RoomUI.isSpeakerEnabled);
RoomUI.setConnected(roomManager.isRemotePublishingVideo);
shouldRate = shouldPlayEnded = true;
},
participantVideoAdded: function(event) {
RoomUI.showRemoteVideo(true);
},
participantVideoDeleted: function(event) {
RoomUI.showRemoteVideo(false);
},
participantLeaving: function(event) {
debug && console.log('Room participant leaving');
},
participantLeft: function(event) {
// There might be chances the local party receives
// the 'participantLeft' event even when the remote
// party couldn't join the room successfully. That
// is the case when the remote party tries to join a
// room when a GSM/CDMA call is active in the remote
// device. It's kinda wierd to play the ended tone
// when the call didn't connected actually.
shouldPlayEnded && playEndedTone();
// We take time here because we trying to set the count
// as exact than we can
var current = new Date().getTime();
debug && console.log('Room participant left');
Rooms.get(currentToken).then(room => {
var participants = _participants = room.participants.length;
if (event && event.connectionEvent &&
(event.connectionEvent.reason === 'networkDisconnected')) {
participants-=1;
}
setNumberParticipants(participants);
});
RoomUI.setWaiting();
_logEventCommunication (current);
},
interrupt: function(event) {
debug && console.log('Room chat interrupted.');
window.clearTimeout(refreshTimeOut);
Rooms.leave(currentToken);
isConnected = false;
currentToken = null;
document.removeEventListener('visibilitychange',
backgroundModeHandler);
removeHeadPhonesChangeHandler();
if (document.hidden) {
window.addEventListener('visibilitychange', function onVisibilityChange() {
window.removeEventListener('visibilitychange', onVisibilityChange);
RoomUI.hide();
showError();
});
} else {
RoomUI.hide();
showError();
}
},
error: function(event) {
debug && console.log('Error while joining room');
isConnected = false;
currentToken = null;
document.removeEventListener('visibilitychange',
backgroundModeHandler);
removeHeadPhonesChangeHandler();
RoomUI.hide();
window.clearTimeout(refreshTimeOut);
Rooms.leave(params.token);
showError();
}
});
RoomUI.onLeave = function() {
Rooms.leave(params.token);
roomManager.leave();
isConnected = false;
currentToken = null;
document.removeEventListener('visibilitychange',
backgroundModeHandler);
removeHeadPhonesChangeHandler();
shouldRate ? rate(RoomUI.hide) : RoomUI.hide();
};
RoomUI.onToggleMic = function() {
roomManager.publishAudio(RoomUI.isMicEnabled);
};
RoomUI.onSwitchSpeaker = function() {
roomManager.forceSpeaker(RoomUI.isSpeakerEnabled);
};
RoomUI.onToggleVideo = function() {
roomManager.publishVideo(!roomManager.isPublishingVideo);
};
params.apiKey = result.apiKey;
params.sessionId = result.sessionId;
params.sessionToken = result.sessionToken;
roomManager.join(params);
});
// We compare with false because we've assumed that by default
// is a video call (when the parameter is not present)
// and its behavior will be the same as RoomManager.join
var isVideoCall = params.video !== 'false' &&
params.video !== false;
Telemetry.updateReport('roomCamera',
isVideoCall ?
(params.frontCamera === true || params.frontCamera === 'true') ?
'front' :
'back' :
'none'
);
},
function(error) {
debug && console.log('Error while joining room');
currentToken = null;
isConnected = false;
removeHeadPhonesChangeHandler();
RoomUI.hide(() => {
// See https://docs.services.mozilla.com/loop/apis.html
if (error) {
if (error.code === 400 && error.errno === 202) {
// Room full
return removeMyselfFromRoom(params);
} else if (error.code === 404) {
return onInvalidToken(params);
}
}
showError();
});
});
}, () => {
// The user cancels
RoomUI.hide();
});
});
},
addParticipant: function(token, name, account, connectionId) {
if (isConnected && currentToken && (currentToken === token)) {
RoomUI.updateParticipant(name, account);
}
addConnectionId(token, connectionId);
},
updateParticipants: function(token, connectionIds) {
updateConnectionIds(token, connectionIds);
},
isParticipant: function(token, connectionId) {
return checkConnectionId(token, connectionId);
},
get headphonesPresent() {
return acm && acm.headphones;
}
};
exports.RoomController = RoomController;
}(this));
| {
"content_hash": "80909f8a52a0f677ed6b06d75ed01cd3",
"timestamp": "",
"source": "github",
"line_count": 613,
"max_line_length": 95,
"avg_line_length": 36.166394779771615,
"alnum_prop": 0.5264772214704556,
"repo_name": "mozilla-b2g/firefoxos-loop-client",
"id": "307e0286f4e4e20dca50fa8d6f1f054fd7bbe2aa",
"size": "22170",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/js/helpers/room/room_controller.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "179098"
},
{
"name": "HTML",
"bytes": "41173"
},
{
"name": "Java",
"bytes": "3963"
},
{
"name": "JavaScript",
"bytes": "1706126"
}
],
"symlink_target": ""
} |
<?php declare (strict_types = 1);
namespace Limoncello\l10n\Messages;
use Limoncello\l10n\Contracts\Messages\ResourceBundleInterface;
use function array_keys;
use function assert;
use function is_scalar;
use function is_string;
use function locale_canonicalize;
use function strlen;
/**
* @package Limoncello\l10n
*/
class ResourceBundle implements ResourceBundleInterface
{
/**
* @var string
*/
private $locale;
/**
* @var string
*/
private $namespace;
/**
* @var array
*/
private $properties;
/**
* @param string $locale
* @param string $namespace
* @param array $properties
*/
public function __construct(string $locale, string $namespace, array $properties)
{
$this->setLocale($locale)->setNamespace($namespace)->setProperties($properties);
}
/**
* @inheritdoc
*/
public function getLocale(): string
{
return $this->locale;
}
/**
* @inheritdoc
*/
public function getNamespace(): string
{
return $this->namespace;
}
/**
* @inheritdoc
*/
public function getKeys(): array
{
return array_keys($this->getProperties());
}
/**
* @inheritdoc
*/
public function getValue(string $key): string
{
$properties = $this->getProperties();
return $properties[$key];
}
/**
* @param string $locale
*
* @return self
*/
public function setLocale(string $locale): self
{
assert(empty($locale) === false && locale_canonicalize($locale) === $locale);
$this->locale = $locale;
return $this;
}
/**
* @param string $namespace
*
* @return self
*/
public function setNamespace(string $namespace): self
{
assert(empty($namespace) === false);
$this->namespace = $namespace;
return $this;
}
/**
* @param array $properties
*
* @return self
*/
public function setProperties(array $properties): self
{
// check all keys and values are non-empty strings
$this->properties = [];
foreach ($properties as $key => $value) {
assert(is_scalar($key) === true && strlen((string)$key) > 0);
assert(is_string($value) === true && strlen($value) > 0);
$this->properties[(string)$key] = (string)$value;
}
return $this;
}
/**
* @return array
*/
public function getProperties(): array
{
return $this->properties;
}
}
| {
"content_hash": "9eea0a88e5fe4c35cae095d0d1aaaca7",
"timestamp": "",
"source": "github",
"line_count": 132,
"max_line_length": 88,
"avg_line_length": 19.71969696969697,
"alnum_prop": 0.5566653860929697,
"repo_name": "limoncello-php/framework",
"id": "f7da5aba964ae985146de5bceb5f79d937721605",
"size": "3204",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "components/L10n/src/Messages/ResourceBundle.php",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Dockerfile",
"bytes": "572"
},
{
"name": "HTML",
"bytes": "15"
},
{
"name": "Lua",
"bytes": "1951"
},
{
"name": "PHP",
"bytes": "3356439"
},
{
"name": "Shell",
"bytes": "2624"
},
{
"name": "TypeScript",
"bytes": "59450"
}
],
"symlink_target": ""
} |
MAIN_SECTION = 'Main'
STATION_SETTINGS_KEY = 'Station Settings'
OSPI_VERSION_KEY = 'ospi version'
STATION_SECTION_KEY = 'Station %d'
TZ_KEY = 'time zone'
SYS_VERSION_KEY = 'system version'
DATE_FORMAT_KEY = 'date format'
TIME_FORMAT_KEY = 'time format'
LOCATION_KEY = 'location'
RAIN_SENSOR_KEY = 'rain sensor'
INVERT_RAIN_SENSOR_KEY = 'invert rain sensor'
STATIONS_AVAIL_KEY = 'stations available'
STATION_NAME_KEY = 'name'
WIRED_KEY = 'wired'
IGNORE_RAIN_KEY = 'ignore rain sensor'
NEED_MASTER_KEY = 'need master'
STATION_LIST_KEY = 'station list'
PROGRAM_ID_KEY = "pid"
PROGRAM_NAME_KEY = "name"
TIME_OF_DAY_KEY = "time_of_day"
INTERVAL_KEY = "interval"
INTERVAL_TYPE_KEY = "type"
RUN_DAYS_KEY = "run_days"
IN_PROGRAM_KEY = "in_program"
TOTAL_RUN_TIME_KEY = "total_run_time"
STATION_DURATION_KEY = "station_duration"
STATION_ID_KEY = "stid"
DURATION_KEY = "duration"
IN_STATION_KEY = "in_station"
ENABLED_DISABLED_KEY = "enabled"
EVEN_INTERVAL_TYPE = "even"
ODD_INTERVAL_TYPE = "odd"
DOW_INTERVAL_TYPE = "day_of_week"
TIME_DAY_KEY = "day"
TIME_DOW_KEY = "day_of_week"
TIME_FROM_MIDNIGHT = "seconds_from_midnight"
TIME_EPOCH = "epoch"
| {
"content_hash": "ec26a8218bafbeb454ad11f0b63e64da",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 45,
"avg_line_length": 29.205128205128204,
"alnum_prop": 0.7155399473222125,
"repo_name": "HoECoder/Sprinkler",
"id": "c123796ea2344a8f35e2efcafea90faf9cb2a1ee",
"size": "1139",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "application/settings_keys.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PowerShell",
"bytes": "2937"
},
{
"name": "Python",
"bytes": "81415"
}
],
"symlink_target": ""
} |
package com.intel.analytics.bigdl.utils.tf.loaders
import com.intel.analytics.bigdl.tensor.Tensor
import com.intel.analytics.bigdl.utils.T
import com.intel.analytics.bigdl.utils.serializer.ModuleSerializationTest
import scala.util.Random
class SplitLoadTFSerialTest extends ModuleSerializationTest {
override def test(): Unit = {
val splitLoadTF = new SplitLoadTF[Float](1).setName("splitLoadTD")
val input = T(Tensor[Int](T(1)),
Tensor[Float](1, 6, 2).apply1(_ => Random.nextFloat())
)
runSerializationTest(splitLoadTF, input)
}
}
| {
"content_hash": "190bc3a8790bffbb81b356827f09db3a",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 73,
"avg_line_length": 31.22222222222222,
"alnum_prop": 0.7508896797153025,
"repo_name": "zhangxiaoli73/BigDL",
"id": "2fd21b9ef6e3c627a86735d85e597082a9198ee6",
"size": "1163",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "spark/dl/src/test/scala/com/intel/analytics/bigdl/utils/tf/loaders/SplitLoadTFSpec.scala",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Dockerfile",
"bytes": "5170"
},
{
"name": "Java",
"bytes": "6829"
},
{
"name": "Lua",
"bytes": "1904"
},
{
"name": "Python",
"bytes": "1081865"
},
{
"name": "RobotFramework",
"bytes": "29504"
},
{
"name": "Scala",
"bytes": "9632695"
},
{
"name": "Shell",
"bytes": "55733"
}
],
"symlink_target": ""
} |
<?php
namespace KG\WeinreBundle\EventListener;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\KernelEvents;
/**
* WeinreListener injects the target script to make the application act as a
* debug target.
*
* The script is only injected on well-formed HTML (with proper </body> tag).
*
* @author Kristen Gilden <kristen.gilden@gmail.com>
*/
class WeinreListener implements EventSubscriberInterface
{
/**
* @var string
*/
private $scheme;
/**
* @var string|null
*/
private $host;
/**
* @var string
*/
private $port;
/**
* @var string
*/
private $path;
/**
* @param string $scheme
* @param string|null $host
* @param string $port
* @param string $path
*/
public function __construct($scheme, $host = null, $port, $path)
{
$this->scheme = $scheme;
$this->host = $host;
$this->port = $port;
$this->path = $path;
}
/**
* {@inheritDoc}
*/
public static function getSubscribedEvents()
{
return array(
KernelEvents::RESPONSE => array('onKernelResponse', -128),
);
}
/**
* @param FilterResponseEvent $event
*/
public function onKernelResponse(FilterResponseEvent $event)
{
if (HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) {
return;
}
$request = $event->getRequest();
if ($request->isXmlHttpRequest()) {
return;
}
$this->injectScript($event->getResponse(), $this->getTargetScriptUrl($request));
}
/**
* Injects the script tag at the end of response content body.
*
* @param Response $response
* @param string $targetScriptUrl
*/
private function injectScript(Response $response, $targetScriptUrl)
{
$posrFunction = function_exists('mb_strripos') ? 'mb_strripos' : 'strripos';
$substrFunction = function_exists('mb_substr') ? 'mb_substr' : 'substr';
$content = $response->getContent();
$pos = $posrFunction($content, '</body>');
if (false !== $pos) {
$script = "<script src=\"$targetScriptUrl\"></script>";
$content = $substrFunction($content, 0, $pos).$script.$substrFunction($content, $pos);
$response->setContent($content);
}
}
/**
* Returns the target script url. Uses the server ip, if the host is unset.
*
* @param Request $request
*
* @return string
*/
private function getTargetScriptUrl(Request $request)
{
return sprintf(
'%s://%s:%s/%s',
$this->scheme,
$this->host ?: $request->server->get('SERVER_ADDR'),
$this->port,
ltrim($this->path, '/')
);
}
}
| {
"content_hash": "32f358db0595d8d855cf45f88de01624",
"timestamp": "",
"source": "github",
"line_count": 125,
"max_line_length": 98,
"avg_line_length": 24.912,
"alnum_prop": 0.5806037251123957,
"repo_name": "kgilden/weinre-bundle",
"id": "a8de880ab96fc498a1928e778d3742ae52ce7572",
"size": "3354",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "EventListener/WeinreListener.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "15030"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" >
<PreferenceCategory>
<EditTextPreference android:title="Profile Name" android:key="name" android:defaultValue="@string/flopsy"/>
<ListPreference android:key="bunny" android:entryValues="@array/charactersvals" android:title="Character" android:entries="@array/characters" android:defaultValue="0"/>
</PreferenceCategory>
</PreferenceScreen>
| {
"content_hash": "b80c1dffd8108c5582be8614fa0b93bf",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 176,
"avg_line_length": 61.375,
"alnum_prop": 0.7331975560081466,
"repo_name": "twentylemon/battle-bunnies",
"id": "1df59218d7377cd2bdb5b0e0feb2bbd849fcaf14",
"size": "491",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "BattleBunniesEclipse/res/xml/profile.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "1"
},
{
"name": "C++",
"bytes": "1"
},
{
"name": "Java",
"bytes": "2498302"
}
],
"symlink_target": ""
} |
$(document).ready(function () {
var group = $("div[id*='group']");
var input_txt = $('input[type="text"]');
var input_hidden = $('input[type="hidden"]');
//Events Trigger
$('form#twitterbots').submit(function () {
$('#loader').show();
$('span.error').remove();
$('span.success').text('');
$(this).attr('disabled','disabled');
var error = fields_empty_checks();
if(error){
$(this).removeAttr('disabled');
$('#loader').hide();
return false;
}else{
var data = $('form#twitterbots').serialize();
var baseUrl = $('#baseurl').val();
$.post(baseUrl+"twitter/create", data, function(result){
$(this).removeAttr('disabled');
$('#loader').hide();
var res = JSON.parse(result);
if(res.success){
$('span.success').text(res.success);
setTimeout(function() {
window.location.href = baseUrl;
}, 5000);
}else{
$('span.success').after(res);
}
$('html, body').animate({
scrollTop: $(".panel-heading").offset().top
}, 1000);
});
return false;
}
});
$('button[type="button"][name="add"]').click(function () {
var error = fields_empty_checks();
if(!error) {
var total_bots = $('#totalbots').val();
if (total_bots < 9) {
var baseUrl = $('#baseurl').val();
$.post(baseUrl + "twitter/additem", {bots: total_bots, action: 'add'}, function (result) {
var data = JSON.parse(result);
$("#group" + total_bots).after(data.content);
$('#totalbots').val('');
$('#totalbots').val(data.total_bots);
});
}
else{
$('html, body').animate({
scrollTop: $(".panel-heading").offset().top
}, 1000);
$("#max-error").text("You have reached maximum of 10 twitter bots");
}
}
return false;
});
$(document).on('click','button.remove', function(){
var total = '';
$('button.remove').each(function (i) {
total = total + i;
});
if(total > 0) {
var remove_group_id = $(this).attr('rel');
$('#group' + remove_group_id).remove();
var group = $("div[id*='group']");
group.each(function(j,groups) {
var bot = j+1;
$(groups).find('label').text('Bot #'+bot);
$(groups).attr('id','group'+j);
$(groups).find('.remove').attr('rel', j);
$(groups).find('.remove').attr('name', 'remove_'+j);
$(groups).find('.search_phrase').attr('id', 'search_phrase_'+j);
$(groups).find('.search_phrase').attr('name', 'search_phrase['+j+']');
$(groups).find('.tweet_action').attr('id', 'tweet_action_'+j);
$(groups).find('.tweet_action').attr('name', 'tweet_action['+j+']');
$(groups).find('.message').attr('name', 'message['+j+']');
$(groups).find('.start_time').attr('id', 'start_time_'+j);
$(groups).find('.start_time').attr('name', 'start_time['+j+']');
$(groups).find('.end_time').attr('id', 'end_time_'+j);
$(groups).find('.end_time').attr('name', 'end_time['+j+']');
$('#totalbots').val(j);
});
}
});
$(document).on('keypress', 'input[type="text"]' , function () {
$(this).parent('div').next('span.error').remove();
});
function fields_empty_checks() {
$('span.error').remove();
var error_begin = '<span class="error">';
var error_last = '</span>';
var error = false;
var input_txt = $('input[type="text"]');
var input_hidden = $('input[type="hidden"]');
var group = $("div[id*='group']");
var group1 = $("div[id*='g1']");
group.each(function(k,groupele) {
$(groupele).find(input_txt).each(function () {
if($.trim($(this).val()) == '') {
var textval = ( $.trim($(this).parent('div.input-group').text()) == '@')?'This' : $(this).parent('div.input-group').text();
$(this).parent('div').after(error_begin + textval + ' field is required.' + error_last);
error = true;
}
});
$(groupele).find(input_hidden).each(function () {
if($.trim($(this).val()) == '') {
$(this).parent('a').after(error_begin + 'This field is required.' + error_last);
error = true;
}
});
});
group1.each(function(k,groupele) {
$(groupele).find(input_txt).each(function () {
if ($.trim($(this).val()) == '') {
var textval = ( $.trim($(this).parent('div.input-group').text()) == '@') ? 'This' : $(this).parent('div.input-group').text();
$(this).parent('div').after(error_begin + textval + ' field is required.' + error_last);
error = true;
}
});
});
return error;
}
$(document).on('click', 'li' ,function(){
var action=$(this).attr('rel');
var group_id = $(this).parents('div.active').attr('id');
field_sets(action, group_id);
});
function field_sets(action, group_id) {
$('span.error').remove();
switch (action) {
case 'Add to Twitter List':
$('#'+group_id).find('.message').val('').attr('placeholder', 'Enter your list name ');
$('#'+group_id).find('.search_phrase').attr('placeholder', '');
$('#'+group_id).find('.search_phrase').val('').attr('readonly', false);
$('#'+group_id).find('.message').val('').attr('readonly', false);
$('#'+group_id).find('span.icon').html('#TagName');
$('#'+group_id).find('span.message').html('List Name');
break;
case 'DM':
$('#'+group_id).find('.message').val("").attr('readonly', false);
$('#'+group_id).find('.search_phrase').val("").attr('readonly', false);
$('#'+group_id).find('.search_phrase').attr('placeholder', '');
$('#'+group_id).find('span.message').html('Message');
$('#'+group_id).find('span.icon').html('@FollowerName');
break;
case 'Retweet':
$('#'+group_id).find('.message').val('Not required').attr('readonly', true);
$('#'+group_id).find('.search_phrase').val("").attr('readonly', false);
$('#'+group_id).find('.search_phrase').attr('placeholder', '');
$('#'+group_id).find('span.icon').html('#TagName');
$('#'+group_id).find('span.message').html('@');
break;
case 'Follow User':
$('#'+group_id).find('.message').val('Not required').attr('readonly', true);
$('#'+group_id).find('.search_phrase').val("").attr('readonly', false);
$('#'+group_id).find('span.message').html('@');
$('#'+group_id).find('span.icon').html('@FollowerName');
break;
case 'RT with Comment':
$('#'+group_id).find('.message').val("").attr('readonly', false);
$('#'+group_id).find('.search_phrase').val("").attr('readonly', false);
$('#'+group_id).find('.message').attr('placeholder', '');
$('#'+group_id).find('span.icon').html('#TagName');
$('#'+group_id).find('span.message').html('Comment');
break;
case 'Reply':
$('#'+group_id).find('.search_phrase').val('Not required').attr('readonly', true);
$('#'+group_id).find('.message').val("").attr('readonly', false);
$('#'+group_id).find('.message').attr('placeholder', '');
$('#'+group_id).find('span.icon').html('@');
$('#'+group_id).find('span.message').html('Message');
break;
case 'Favorite':
$('#'+group_id).find('.message').val('Not required').attr('readonly', true);
$('#'+group_id).find('.search_phrase').val("").attr('readonly', false);
$('#'+group_id).find('.search_phrase').attr('placeholder', '');
$('#'+group_id).find('span.icon').html('#TagName');
$('#'+group_id).find('span.message').html('@');
break;
case 'DM Followers':
$('#'+group_id).find('.search_phrase').val('Not required').attr('readonly', true);
$('#'+group_id).find('.message').val("").attr('readonly', false);
$('#'+group_id).find('.message').attr('placeholder', '');
$('#'+group_id).find('span.icon').html('@');
$('#'+group_id).find('span.message').html('Message');
break;
}
}
}); | {
"content_hash": "abc7550d6c3d7ec04a91b0c2919dd022",
"timestamp": "",
"source": "github",
"line_count": 239,
"max_line_length": 145,
"avg_line_length": 39.64016736401673,
"alnum_prop": 0.4425796917880515,
"repo_name": "asahi2016/t-bot",
"id": "cbce12a6ec89796d793b514c55ba155e1ce29622",
"size": "9474",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "application/assets/js/custom.js",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "6326"
},
{
"name": "CSS",
"bytes": "14576"
},
{
"name": "HTML",
"bytes": "7954"
},
{
"name": "JavaScript",
"bytes": "21925"
},
{
"name": "PHP",
"bytes": "1858916"
}
],
"symlink_target": ""
} |
$.ajax({
url: './data/wmsgetfeatureinfo/osm-restaurant-hotel.xml',
success: function(response) {
// this is the standard way to read the features
var allFeatures = new ol.format.WMSGetFeatureInfo().readFeatures(response);
$('#all').html(allFeatures.length.toString());
// when specifying the 'layers' options, only the features of those
// layers are returned by the format
var hotelFeatures = new ol.format.WMSGetFeatureInfo({
layers: ['hotel']
}).readFeatures(response);
$('#hotel').html(hotelFeatures.length.toString());
var restaurantFeatures = new ol.format.WMSGetFeatureInfo({
layers: ['restaurant']
}).readFeatures(response);
$('#restaurant').html(restaurantFeatures.length.toString());
}
});
| {
"content_hash": "54828fd574775f336e14540a992b27fc",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 79,
"avg_line_length": 34.81818181818182,
"alnum_prop": 0.685378590078329,
"repo_name": "UNM-GEOG-485-585/class-materials",
"id": "3e37a99d579210baeff7dc6b21c28d54e430715c",
"size": "766",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "sample-files/OpenLayers/js/v3.14.2/examples/getfeatureinfo-layers.js",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "2072"
},
{
"name": "CSS",
"bytes": "148096"
},
{
"name": "Emacs Lisp",
"bytes": "2410"
},
{
"name": "GCC Machine Description",
"bytes": "86"
},
{
"name": "GLSL",
"bytes": "2171"
},
{
"name": "HTML",
"bytes": "198959877"
},
{
"name": "JavaScript",
"bytes": "24780073"
},
{
"name": "Python",
"bytes": "79557"
},
{
"name": "QML",
"bytes": "4875"
},
{
"name": "Scheme",
"bytes": "17825"
},
{
"name": "Shell",
"bytes": "8542"
},
{
"name": "TeX",
"bytes": "100351"
}
],
"symlink_target": ""
} |
package org.apache.logging.log4j.core.jackson;
import java.util.Map;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.Marker;
import org.apache.logging.log4j.ThreadContext.ContextStack;
import org.apache.logging.log4j.core.LogEvent;
import org.apache.logging.log4j.core.impl.ThrowableProxy;
import org.apache.logging.log4j.message.Message;
import com.fasterxml.jackson.annotation.JsonFilter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonRootName;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.MapDeserializer;
import com.fasterxml.jackson.databind.ser.std.MapSerializer;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
@JsonRootName(XmlConstants.ELT_EVENT)
@JacksonXmlRootElement(namespace = XmlConstants.XML_NAMESPACE, localName = XmlConstants.ELT_EVENT)
@JsonFilter("org.apache.logging.log4j.core.impl.Log4jLogEvent")
@JsonPropertyOrder({ "timeMillis", "threadName", "level", "loggerName", "marker", "message", "thrown", XmlConstants.ELT_CONTEXT_MAP,
JsonConstants.ELT_CONTEXT_STACK, "loggerFQCN", "Source", "endOfBatch" })
abstract class LogEventJsonMixIn implements LogEvent {
private static final long serialVersionUID = 1L;
@JsonProperty(JsonConstants.ELT_CONTEXT_MAP)
@JacksonXmlProperty(namespace = XmlConstants.XML_NAMESPACE, localName = XmlConstants.ELT_CONTEXT_MAP)
// @JsonSerialize(using = MapSerializer.class)
// @JsonDeserialize(using = MapDeserializer.class)
@Override
public abstract Map<String, String> getContextMap();
@JsonProperty(JsonConstants.ELT_CONTEXT_STACK)
@JacksonXmlElementWrapper(namespace = XmlConstants.XML_NAMESPACE, localName = XmlConstants.ELT_CONTEXT_STACK)
@JacksonXmlProperty(namespace = XmlConstants.XML_NAMESPACE, localName = XmlConstants.ELT_CONTEXT_STACK_ITEM)
@Override
public abstract ContextStack getContextStack();
@JsonProperty()
@JacksonXmlProperty(isAttribute = true)
@Override
public abstract Level getLevel();
@JsonProperty()
@JacksonXmlProperty(isAttribute = true)
@Override
public abstract String getLoggerFqcn();
@JsonProperty()
@JacksonXmlProperty(isAttribute = true)
@Override
public abstract String getLoggerName();
@JsonProperty(JsonConstants.ELT_MARKER)
@JacksonXmlProperty(namespace = XmlConstants.XML_NAMESPACE, localName = XmlConstants.ELT_MARKER)
@Override
public abstract Marker getMarker();
@JsonProperty(JsonConstants.ELT_MESSAGE)
@JsonSerialize(using = MessageSerializer.class)
@JsonDeserialize(using = SimpleMessageDeserializer.class)
@JacksonXmlProperty(namespace = XmlConstants.XML_NAMESPACE, localName = XmlConstants.ELT_MESSAGE)
@Override
public abstract Message getMessage();
@JsonProperty(JsonConstants.ELT_SOURCE)
@JsonDeserialize(using = Log4jStackTraceElementDeserializer.class)
@JacksonXmlProperty(namespace = XmlConstants.XML_NAMESPACE, localName = XmlConstants.ELT_SOURCE)
@Override
public abstract StackTraceElement getSource();
@Override
@JsonProperty("threadId")
@JacksonXmlProperty(isAttribute = true, localName = "threadId")
public abstract long getThreadId();
@Override
@JsonProperty("thread")
@JacksonXmlProperty(isAttribute = true, localName = "thread")
public abstract String getThreadName();
@Override
@JsonProperty("threadPriority")
@JacksonXmlProperty(isAttribute = true, localName = "threadPriority")
public abstract int getThreadPriority();
@JsonIgnore
@Override
public abstract Throwable getThrown();
@JsonProperty(JsonConstants.ELT_THROWN)
@JacksonXmlProperty(namespace = XmlConstants.XML_NAMESPACE, localName = XmlConstants.ELT_THROWN)
@Override
public abstract ThrowableProxy getThrownProxy();
@JsonProperty()
@JacksonXmlProperty(isAttribute = true)
@Override
public abstract long getTimeMillis();
@JsonProperty()
@JacksonXmlProperty(isAttribute = true)
@Override
public abstract boolean isEndOfBatch();
@JsonIgnore
@Override
public abstract boolean isIncludeLocation();
@Override
public abstract void setEndOfBatch(boolean endOfBatch);
@Override
public abstract void setIncludeLocation(boolean locationRequired);
}
| {
"content_hash": "3b1e71ee3606430bd7bcfd2ffc61c3aa",
"timestamp": "",
"source": "github",
"line_count": 125,
"max_line_length": 132,
"avg_line_length": 37.936,
"alnum_prop": 0.7735132855335302,
"repo_name": "lqbweb/logging-log4j2",
"id": "717815d2921541a6de7dda6650985658d1cc1098",
"size": "5542",
"binary": false,
"copies": "1",
"ref": "refs/heads/java6",
"path": "log4j-core/src/main/java/org/apache/logging/log4j/core/jackson/LogEventJsonMixIn.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "2499"
},
{
"name": "CSS",
"bytes": "3981"
},
{
"name": "Groovy",
"bytes": "198"
},
{
"name": "Java",
"bytes": "6873849"
},
{
"name": "JavaScript",
"bytes": "59116"
},
{
"name": "Shell",
"bytes": "5915"
}
],
"symlink_target": ""
} |
#include "py/obj.h"
#include "py/objarray.h"
#ifndef PIXELBUF_SHARED_MODULE_H
#define PIXELBUF_SHARED_MODULE_H
typedef struct {
uint8_t r;
uint8_t g;
uint8_t b;
uint8_t w;
} pixelbuf_rgbw_t;
typedef struct {
uint8_t bpp;
pixelbuf_rgbw_t byteorder;
bool has_white;
bool is_dotstar;
mp_obj_t order_string;
} pixelbuf_byteorder_details_t;
typedef struct {
mp_obj_base_t base;
size_t pixel_count;
size_t bytes_per_pixel;
pixelbuf_byteorder_details_t byteorder;
mp_float_t brightness;
mp_obj_t transmit_buffer_obj;
// The post_brightness_buffer is offset into the buffer allocated in transmit_buffer_obj to
// account for any header.
uint8_t *post_brightness_buffer;
uint8_t *pre_brightness_buffer;
bool auto_write;
} pixelbuf_pixelbuf_obj_t;
#define PIXEL_R 0
#define PIXEL_G 1
#define PIXEL_B 2
#define PIXEL_W 3
#define DOTSTAR_LED_START 0b11100000
#define DOTSTAR_LED_START_FULL_BRIGHT 0xFF
#endif
| {
"content_hash": "c5a3240ed4ea2c5bcbfa9d5059af11b4",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 95,
"avg_line_length": 21,
"alnum_prop": 0.6940222897669707,
"repo_name": "adafruit/micropython",
"id": "a9fbed366fee0681b2084547ffc2ad394931a619",
"size": "2226",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "shared-module/_pixelbuf/PixelBuf.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "55179"
},
{
"name": "C",
"bytes": "36329657"
},
{
"name": "C++",
"bytes": "758796"
},
{
"name": "HTML",
"bytes": "84456"
},
{
"name": "Makefile",
"bytes": "85896"
},
{
"name": "Objective-C",
"bytes": "458875"
},
{
"name": "Python",
"bytes": "588680"
},
{
"name": "Shell",
"bytes": "4829"
}
],
"symlink_target": ""
} |
<div class="commune_descr limited">
<p>
Béthencourt est
un village
situé dans le département de Nord en Nord-Pas-de-Calais. Elle totalisait 717 habitants en 2008.</p>
<p>La ville offre quelques équipements sportifs, elle propose entre autres un terrain de sport.</p>
<p>Si vous envisagez de emmenager à Béthencourt, vous pourrez aisément trouver une maison à acheter. </p>
<p>À proximité de Béthencourt sont positionnées géographiquement les communes de
<a href="{{VLROOT}}/immobilier/fontaine-au-pire_59243/">Fontaine-au-Pire</a> à 4 km, 1 174 habitants,
<a href="{{VLROOT}}/immobilier/briastre_59108/">Briastre</a> à 4 km, 626 habitants,
<a href="{{VLROOT}}/immobilier/viesly_59614/">Viesly</a> située à 3 km, 1 350 habitants,
<a href="{{VLROOT}}/immobilier/bevillers_59081/">Bévillers</a> localisée à 3 km, 574 habitants,
<a href="{{VLROOT}}/immobilier/beauvois-en-cambresis_59063/">Beauvois-en-Cambrésis</a> située à 3 km, 2 104 habitants,
<a href="{{VLROOT}}/immobilier/caudry_59139/">Caudry</a> située à 2 km, 13 605 habitants,
entre autres. De plus, Béthencourt est située à seulement 25 km de <a href="{{VLROOT}}/immobilier/valenciennes_59606/">Valenciennes</a>.</p>
<p>Le parc de logements, à Béthencourt, se décomposait en 2011 en quatre appartements et 308 maisons soit
un marché relativement équilibré.</p>
<p>À Béthencourt, le prix moyen à la vente d'un appartement se situe à zero € du m² en vente. la valorisation moyenne d'une maison à l'achat se situe à 1 610 € du m². À la location la valeur moyenne se situe à 0 € du m² par mois.</p>
</div>
| {
"content_hash": "3a204f3fdac724eb5fe3f7c1f270000f",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 253,
"avg_line_length": 87.05263157894737,
"alnum_prop": 0.7418379685610641,
"repo_name": "donaldinou/frontend",
"id": "1ff5ee92e1e465122531197466fc0f7e51d8f4c5",
"size": "1699",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Viteloge/CoreBundle/Resources/descriptions/59075.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "3073"
},
{
"name": "CSS",
"bytes": "111338"
},
{
"name": "HTML",
"bytes": "58634405"
},
{
"name": "JavaScript",
"bytes": "88564"
},
{
"name": "PHP",
"bytes": "841919"
}
],
"symlink_target": ""
} |
package com.noeasy.money.enumeration;
/**
* <class description>
*
* @author: Yove
* @version: 1.0, Mar 20, 2014
*/
public enum DormitoryStatus {
HAS_VACANCY, NO_VACANCY, INVISIBILITY;
private static Object[] allStatus = new Object[] { NO_VACANCY, HAS_VACANCY, INVISIBILITY };
public static Object[] getAllStatus() {
return allStatus;
}
public String getName() {
return this.name();
}
public int getValue() {
return this.ordinal();
}
}
| {
"content_hash": "6beaf1c274005cd2a751d3b311b8cd51",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 95,
"avg_line_length": 15.029411764705882,
"alnum_prop": 0.6105675146771037,
"repo_name": "DormitoryTeam/Dormitory",
"id": "8bc940f08784d785356fb1a87339933feb372e19",
"size": "2178",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/com/noeasy/money/enumeration/DormitoryStatus.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "115001"
},
{
"name": "Java",
"bytes": "572663"
},
{
"name": "JavaScript",
"bytes": "353779"
},
{
"name": "Shell",
"bytes": "395"
}
],
"symlink_target": ""
} |
CAS
===
### Generate Keystore
```sh
$ ./keytool -genkey -alias thekeystore -keyalg RSA -keypass changeit -storepass changeit -keystore thekeystore.jks
What is your first and last name?
[Unknown]: cas.example.org
What is the name of your organizational unit?
[Unknown]: Example
What is the name of your organization?
[Unknown]: Org
What is the name of your City or Locality?
[Unknown]: BJ
What is the name of your State or Province?
[Unknown]: BJ
What is the two-letter country code for this unit?
[Unknown]: US
Is CN=cas.example.org, OU=Example, O=Org, L=BJ, ST=BJ, C=US correct?
[no]: yes
```
### Export keystore
```sh
$ keytool -export -alias thekeystore -keystore thekeystore.jks -storepass changeit -file thekeystore.cer
```
### Copy the `thekeystore.jks` file into ```/etc/cas/```
```sh
cp thekeystore.jks /etc/cas/thekeystore
```
### Verify the Kyestore(Optional)
```
$ keytool -list -v -keystore thekeystore.jks -storepass changeit
```
### Import
```
keytool -import -v -trustcacerts \
-alias keyAlias \
-file cas.cer \
-keystore thekeystore.jks \
-keypass changeit
```
```
keytool.exe -import -v -trustcacerts -alias thekeystore -keystore ..\jre\lib\security\cacerts -file thekeystore.cer -keypass changeit
```
### Enable SSL in TOmcat
```xml
<Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol" maxThreads="150" SSLEnabled="true">
<SSLHostConfig>
<Certificate certificateKeystoreFile="/export/App/jdk1.8.0_60/bin/thekeystore.jks"
type="RSA" keystorePass="changeit" />
</SSLHostConfig>
</Connector>
```
>#### Default User
```casuser``` / ```Mellon```
| {
"content_hash": "3336bda285d38c5387f6c1fd3feea75b",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 134,
"avg_line_length": 23.40277777777778,
"alnum_prop": 0.6813056379821959,
"repo_name": "lhfei/cloud-doc",
"id": "59506337d420f60d142715202bd6d4a3eb7a7511",
"size": "1685",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "SSL/CAS.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Assembly",
"bytes": "87512"
},
{
"name": "Awk",
"bytes": "14044"
},
{
"name": "Batchfile",
"bytes": "7200"
},
{
"name": "CSS",
"bytes": "1516"
},
{
"name": "HTML",
"bytes": "1478"
},
{
"name": "Java",
"bytes": "106986"
},
{
"name": "JavaScript",
"bytes": "52896"
},
{
"name": "Python",
"bytes": "2424"
},
{
"name": "Shell",
"bytes": "307617"
},
{
"name": "XSLT",
"bytes": "1375"
}
],
"symlink_target": ""
} |
<?php
/**
* CancelOrderUnitRequestTest
*
* PHP version 5
*
* @category Class
* @package SMS\Suppliers
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
/**
* Supplier API SDK
*
* This documentation describes SMS Suppliers API. To be able use this API you should have an api-key and api-username
*
* OpenAPI spec version: 1.0.0
* Contact: sms.tech@real-digital.de
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*
*/
/**
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen
* Please update the test case below to test the model.
*/
namespace SMS\Suppliers;
/**
* CancelOrderUnitRequestTest Class Doc Comment
*
* @category Class */
// * @description CancelOrderUnitRequest
/**
* @package SMS\Suppliers
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
class CancelOrderUnitRequestTest extends \PHPUnit_Framework_TestCase
{
/**
* Setup before running any test case
*/
public static function setUpBeforeClass()
{
}
/**
* Setup before running each test case
*/
public function setUp()
{
}
/**
* Clean up after running each test case
*/
public function tearDown()
{
}
/**
* Clean up after running all test cases
*/
public static function tearDownAfterClass()
{
}
/**
* Test "CancelOrderUnitRequest"
*/
public function testCancelOrderUnitRequest()
{
}
/**
* Test attribute "reason"
*/
public function testPropertyReason()
{
}
/**
* Test attribute "reason_description"
*/
public function testPropertyReasonDescription()
{
}
}
| {
"content_hash": "dcafaa1c01730f04fda09080b1bed63e",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 118,
"avg_line_length": 19.731182795698924,
"alnum_prop": 0.635967302452316,
"repo_name": "hitmeister/suppliers-api-sdk",
"id": "5eda5c62f64bf89d7131292e4cd187676ce29476",
"size": "1835",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "test/Model/CancelOrderUnitRequestTest.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "458487"
}
],
"symlink_target": ""
} |
import codecs
import optparse
import os
import re
import subprocess
import sys
_CATAPULT_PATH = os.path.abspath(
os.path.join(os.path.dirname(__file__), os.path.pardir, os.path.pardir))
sys.path.append(os.path.join(_CATAPULT_PATH, 'tracing'))
from tracing_build import vulcanize_trace_viewer
SYSTRACE_TRACE_VIEWER_HTML_FILE = os.path.join(
os.path.abspath(os.path.dirname(__file__)),
'systrace_trace_viewer.html')
CATAPULT_REV_ = 'CATAPULT_REV'
NO_AUTO_UPDATE_ = 'NO_AUTO_UPDATE'
def create_catapult_rev_str_(revision):
return '<!--' + CATAPULT_REV_ + '=' + str(revision) + '-->'
def get_catapult_rev_in_file_(html_file):
assert os.path.exists(html_file)
rev = ''
with open(html_file, 'r') as f:
lines = f.readlines()
for line in lines[::-1]:
if CATAPULT_REV_ in line:
tokens = line.split(CATAPULT_REV_)
rev = re.sub(r'[=\->]', '', tokens[1]).strip()
break
return rev
def get_catapult_rev_in_git_():
try:
catapult_rev = subprocess.check_output(
['git', 'rev-parse', 'HEAD'],
cwd=os.path.dirname(os.path.abspath(__file__))).strip()
except (subprocess.CalledProcessError, OSError):
catapult_rev = ''
if not catapult_rev:
return ''
else:
return catapult_rev
def update(no_auto_update=False, no_min=False, force_update=False):
"""Update the systrace trace viewer html file.
When the html file exists, do not update the file if
1. the revision is NO_AUTO_UPDATE_;
2. or the revision is not changed.
Args:
no_auto_update: If true, force updating the file with revision
NO_AUTO_UPDATE_. Future updates will be skipped unless this
argument is true again.
no_min: If true, skip minification when updating the file.
force_update: If true, update the systrace trace viewer file no matter
what.
"""
new_rev = None
if not force_update:
if no_auto_update:
new_rev = NO_AUTO_UPDATE_
else:
new_rev = get_catapult_rev_in_git_()
if not new_rev:
return
if os.path.exists(SYSTRACE_TRACE_VIEWER_HTML_FILE):
rev_in_file = get_catapult_rev_in_file_(SYSTRACE_TRACE_VIEWER_HTML_FILE)
if rev_in_file == NO_AUTO_UPDATE_ or rev_in_file == new_rev:
return
if force_update and not new_rev:
new_rev = "none"
print 'Generating viewer file %s with revision %s.' % (
SYSTRACE_TRACE_VIEWER_HTML_FILE, new_rev)
# Generate the vulcanized result.
with codecs.open(SYSTRACE_TRACE_VIEWER_HTML_FILE,
encoding='utf-8', mode='w') as f:
vulcanize_trace_viewer.WriteTraceViewer(
f,
config_name='full',
minify=(not no_min),
output_html_head_and_body=False)
if not force_update:
f.write(create_catapult_rev_str_(new_rev))
def main():
parser = optparse.OptionParser()
parser.add_option('--no-auto-update', dest='no_auto_update',
default=False, action='store_true', help='force update the '
'systrace trace viewer html file. Future auto updates will '
'be skipped unless this flag is specified again.')
parser.add_option('--no-min', dest='no_min', default=False,
action='store_true', help='skip minification')
# pylint: disable=unused-variable
options, unused_args = parser.parse_args(sys.argv[1:])
update(no_auto_update=options.no_auto_update, no_min=options.no_min)
if __name__ == '__main__':
main()
| {
"content_hash": "d1d0e2b55c0bb8c6d259599c62f9a365",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 80,
"avg_line_length": 31.4375,
"alnum_prop": 0.6322067594433399,
"repo_name": "sahiljain/catapult",
"id": "cdb6fe13ddad65345d1ea4f470f05c5d3f9b5764",
"size": "3707",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "systrace/systrace/update_systrace_trace_viewer.py",
"mode": "33261",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "3598"
},
{
"name": "C++",
"bytes": "6390"
},
{
"name": "CSS",
"bytes": "24751"
},
{
"name": "HTML",
"bytes": "14570791"
},
{
"name": "JavaScript",
"bytes": "511007"
},
{
"name": "Python",
"bytes": "5842419"
},
{
"name": "Shell",
"bytes": "2834"
}
],
"symlink_target": ""
} |
extern "Java"
{
namespace javax
{
namespace imageio
{
namespace metadata
{
class IIOMetadataNode;
class IIOMetadataNode$IIONamedNodeMap;
}
}
}
namespace org
{
namespace w3c
{
namespace dom
{
class Node;
}
}
}
}
class javax::imageio::metadata::IIOMetadataNode$IIONamedNodeMap : public ::java::lang::Object
{
public:
IIOMetadataNode$IIONamedNodeMap(::javax::imageio::metadata::IIOMetadataNode *, ::java::util::HashMap *);
virtual ::org::w3c::dom::Node * getNamedItem(::java::lang::String *);
virtual ::org::w3c::dom::Node * setNamedItem(::org::w3c::dom::Node *);
virtual ::org::w3c::dom::Node * removeNamedItem(::java::lang::String *);
virtual ::org::w3c::dom::Node * item(jint);
virtual jint getLength();
virtual ::org::w3c::dom::Node * getNamedItemNS(::java::lang::String *, ::java::lang::String *);
virtual ::org::w3c::dom::Node * setNamedItemNS(::org::w3c::dom::Node *);
virtual ::org::w3c::dom::Node * removeNamedItemNS(::java::lang::String *, ::java::lang::String *);
public: // actually package-private
::java::util::HashMap * __attribute__((aligned(__alignof__( ::java::lang::Object)))) attrs;
::javax::imageio::metadata::IIOMetadataNode * this$0;
public:
static ::java::lang::Class class$;
};
#endif // __javax_imageio_metadata_IIOMetadataNode$IIONamedNodeMap__
| {
"content_hash": "603f76a3129cb5b0ca89464233f341b4",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 106,
"avg_line_length": 30.391304347826086,
"alnum_prop": 0.6366237482117311,
"repo_name": "the-linix-project/linix-kernel-source",
"id": "9026a27d65fbe6b41ea1f9fb4f98ae03c3f094e6",
"size": "1647",
"binary": false,
"copies": "157",
"ref": "refs/heads/master",
"path": "gccsrc/gcc-4.7.2/libjava/javax/imageio/metadata/IIOMetadataNode$IIONamedNodeMap.h",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "Ada",
"bytes": "38139979"
},
{
"name": "Assembly",
"bytes": "3723477"
},
{
"name": "Awk",
"bytes": "83739"
},
{
"name": "C",
"bytes": "103607293"
},
{
"name": "C#",
"bytes": "55726"
},
{
"name": "C++",
"bytes": "38577421"
},
{
"name": "CLIPS",
"bytes": "6933"
},
{
"name": "CSS",
"bytes": "32588"
},
{
"name": "Emacs Lisp",
"bytes": "13451"
},
{
"name": "FORTRAN",
"bytes": "4294984"
},
{
"name": "GAP",
"bytes": "13089"
},
{
"name": "Go",
"bytes": "11277335"
},
{
"name": "Haskell",
"bytes": "2415"
},
{
"name": "Java",
"bytes": "45298678"
},
{
"name": "JavaScript",
"bytes": "6265"
},
{
"name": "Matlab",
"bytes": "56"
},
{
"name": "OCaml",
"bytes": "148372"
},
{
"name": "Objective-C",
"bytes": "995127"
},
{
"name": "Objective-C++",
"bytes": "436045"
},
{
"name": "PHP",
"bytes": "12361"
},
{
"name": "Pascal",
"bytes": "40318"
},
{
"name": "Perl",
"bytes": "358808"
},
{
"name": "Python",
"bytes": "60178"
},
{
"name": "SAS",
"bytes": "1711"
},
{
"name": "Scilab",
"bytes": "258457"
},
{
"name": "Shell",
"bytes": "2610907"
},
{
"name": "Tcl",
"bytes": "17983"
},
{
"name": "TeX",
"bytes": "1455571"
},
{
"name": "XSLT",
"bytes": "156419"
}
],
"symlink_target": ""
} |
/*************************************************************************/
/* progress_dialog.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef PROGRESS_DIALOG_H
#define PROGRESS_DIALOG_H
#include "scene/gui/popup.h"
#include "scene/gui/box_container.h"
#include "scene/gui/progress_bar.h"
#include "scene/gui/label.h"
class BackgroundProgress : public HBoxContainer {
OBJ_TYPE(BackgroundProgress,HBoxContainer);
_THREAD_SAFE_CLASS_
struct Task {
HBoxContainer *hb;
ProgressBar *progress;
};
Map<String,Task> tasks;
Map<String,int> updates;
void _update();
protected:
void _add_task(const String& p_task,const String& p_label, int p_steps);
void _task_step(const String& p_task, int p_step=-1);
void _end_task(const String& p_task);
static void _bind_methods();
public:
void add_task(const String& p_task,const String& p_label, int p_steps);
void task_step(const String& p_task, int p_step=-1);
void end_task(const String& p_task);
BackgroundProgress() {}
};
class ProgressDialog : public Popup {
OBJ_TYPE( ProgressDialog, Popup );
struct Task {
String task;
VBoxContainer *vb;
ProgressBar *progress;
Label *state;
};
Map<String,Task> tasks;
VBoxContainer *main;
uint64_t last_progress_tick;
void _popup();
protected:
void _notification(int p_what);
public:
void add_task(const String& p_task,const String& p_label, int p_steps);
void task_step(const String& p_task, const String& p_state, int p_step=-1, bool p_force_redraw=true);
void end_task(const String& p_task);
ProgressDialog();
};
#endif // PROGRESS_DIALOG_H
| {
"content_hash": "c43a56f418a6ee6ce9e7615b47aaccbe",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 102,
"avg_line_length": 34.71844660194175,
"alnum_prop": 0.5475391498881432,
"repo_name": "ianholing/godot",
"id": "539eaa87375729485dcd7ea63c554b7ea4fc8431",
"size": "3576",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "tools/editor/progress_dialog.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ActionScript",
"bytes": "6955"
},
{
"name": "Assembly",
"bytes": "372477"
},
{
"name": "Batchfile",
"bytes": "2356"
},
{
"name": "C",
"bytes": "25778186"
},
{
"name": "C++",
"bytes": "12173788"
},
{
"name": "DIGITAL Command Language",
"bytes": "95419"
},
{
"name": "GAP",
"bytes": "3659"
},
{
"name": "GDScript",
"bytes": "81576"
},
{
"name": "GLSL",
"bytes": "57049"
},
{
"name": "HTML",
"bytes": "9365"
},
{
"name": "Java",
"bytes": "468033"
},
{
"name": "JavaScript",
"bytes": "5802"
},
{
"name": "Matlab",
"bytes": "2076"
},
{
"name": "Objective-C",
"bytes": "45637"
},
{
"name": "Objective-C++",
"bytes": "141704"
},
{
"name": "PHP",
"bytes": "1095905"
},
{
"name": "Perl",
"bytes": "1934278"
},
{
"name": "Python",
"bytes": "128508"
},
{
"name": "Shell",
"bytes": "1054"
},
{
"name": "XS",
"bytes": "4319"
},
{
"name": "eC",
"bytes": "3710"
}
],
"symlink_target": ""
} |
<?php
class Example {
var $name = "Michael"; //same as public but deprecated
public $age = 23;
protected $usercount;
private function admin() {
}
}
?> | {
"content_hash": "ca6e44a5bb792ac2a586124ba8cdea3f",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 62,
"avg_line_length": 19.272727272727273,
"alnum_prop": 0.4858490566037736,
"repo_name": "inest-us/php",
"id": "1fb05a47dfe7ed81db827f1171382ab2df4b1da2",
"size": "212",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "php101/c05/php5_22.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "81450"
},
{
"name": "HTML",
"bytes": "281565"
},
{
"name": "Hack",
"bytes": "6775"
},
{
"name": "JavaScript",
"bytes": "4121"
},
{
"name": "PHP",
"bytes": "53600"
},
{
"name": "TSQL",
"bytes": "309"
}
],
"symlink_target": ""
} |
import tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Logit'] , ['PolyTrend'] , ['Seasonal_DayOfMonth'] , ['SVR'] ); | {
"content_hash": "63ba3431455fe842576424913fa25ca0",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 85,
"avg_line_length": 39.5,
"alnum_prop": 0.7088607594936709,
"repo_name": "antoinecarme/pyaf",
"id": "ee4d91232971453326e4b5d4513ff2e9f71b99cf",
"size": "158",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tests/model_control/detailed/transf_Logit/model_control_one_enabled_Logit_PolyTrend_Seasonal_DayOfMonth_SVR.py",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Makefile",
"bytes": "6773299"
},
{
"name": "Procfile",
"bytes": "24"
},
{
"name": "Python",
"bytes": "54209093"
},
{
"name": "R",
"bytes": "807"
},
{
"name": "Shell",
"bytes": "3619"
}
],
"symlink_target": ""
} |
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:id="@+id/action_new"
android:icon="@drawable/ic_action_new"
android:showAsAction="always"
android:title="New"/>
<item android:id="@+id/action_edit"
android:icon="@drawable/ic_action_edit"
android:showAsAction="always"
android:title="Compose" />
<item android:id="@+id/action_discard"
android:icon="@drawable/ic_action_discard"
android:showAsAction="always"
android:title="Compose" />
</menu>
| {
"content_hash": "66fe6639196acb739ebcb24dc2a93736",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 66,
"avg_line_length": 35.9375,
"alnum_prop": 0.6156521739130435,
"repo_name": "UPB-FILS/DAPM",
"id": "6c7e4a4563deec4ea44452df7d58fe3e53322776",
"size": "575",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "2014/KeyRing/res/menu/main.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "1"
},
{
"name": "C++",
"bytes": "1"
},
{
"name": "Java",
"bytes": "44580"
},
{
"name": "XML",
"bytes": "333242"
}
],
"symlink_target": ""
} |
package br.eti.kinoshita.testlinkjavaapi;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import org.apache.xmlrpc.XmlRpcException;
import org.apache.xmlrpc.client.XmlRpcClient;
import br.eti.kinoshita.testlinkjavaapi.constants.ActionOnDuplicate;
import br.eti.kinoshita.testlinkjavaapi.constants.ExecutionStatus;
import br.eti.kinoshita.testlinkjavaapi.constants.ExecutionType;
import br.eti.kinoshita.testlinkjavaapi.constants.ResponseDetails;
import br.eti.kinoshita.testlinkjavaapi.constants.TestCaseDetails;
import br.eti.kinoshita.testlinkjavaapi.constants.TestCaseStepAction;
import br.eti.kinoshita.testlinkjavaapi.constants.TestImportance;
import br.eti.kinoshita.testlinkjavaapi.constants.TestLinkMethods;
import br.eti.kinoshita.testlinkjavaapi.constants.TestLinkParams;
import br.eti.kinoshita.testlinkjavaapi.constants.TestLinkResponseParams;
import br.eti.kinoshita.testlinkjavaapi.constants.TestLinkTables;
import br.eti.kinoshita.testlinkjavaapi.model.Attachment;
import br.eti.kinoshita.testlinkjavaapi.model.CustomField;
import br.eti.kinoshita.testlinkjavaapi.model.ReportTCResultResponse;
import br.eti.kinoshita.testlinkjavaapi.model.TestCase;
import br.eti.kinoshita.testlinkjavaapi.model.TestCaseStep;
import br.eti.kinoshita.testlinkjavaapi.util.TestLinkAPIException;
import br.eti.kinoshita.testlinkjavaapi.util.Util;
/**
* Class responsible for Test Case services.
*
* @author Bruno P. Kinoshita - http://www.kinoshita.eti.br
* @since 1.9.0-1
*/
@SuppressWarnings("unchecked")
class TestCaseService extends BaseService {
/**
* @param xmlRpcClient XML RPC Client.
* @param devKey TestLink User DevKey.
*/
public TestCaseService(XmlRpcClient xmlRpcClient, String devKey) {
super(xmlRpcClient, devKey);
}
/**
* Creates a Test Case.
*
* @param testCaseName
* @param testSuiteId
* @param testProjectId
* @param authorLogin
* @param summary
* @param steps
* @param preconditions
* @param importance
* @param execution
* @param order
* @param internalId
* @param checkDuplicatedName
* @param actionOnDuplicatedName
* @return Test Case.
* @throws TestLinkAPIException
*/
protected TestCase createTestCase(String testCaseName, Integer testSuiteId, Integer testProjectId,
String authorLogin, String summary, List<TestCaseStep> steps, String preconditions,
TestImportance importance, ExecutionType execution, Integer order, Integer internalId,
Boolean checkDuplicatedName, ActionOnDuplicate actionOnDuplicatedName) throws TestLinkAPIException {
TestCase testCase = null;
Integer id = null;
testCase = new TestCase(id, testCaseName, testSuiteId, testProjectId, authorLogin, summary, steps,
preconditions, importance, execution, null, order, internalId, null, checkDuplicatedName,
actionOnDuplicatedName, null, null, null, null, null, null, null);
try {
Map<String, Object> executionData = Util.getTestCaseMap(testCase);
Object response = this.executeXmlRpcCall(TestLinkMethods.CREATE_TEST_CASE.toString(), executionData);
Object[] responseArray = Util.castToArray(response);
Map<String, Object> responseMap = (Map<String, Object>) responseArray[0];
id = Util.getInteger(responseMap, TestLinkResponseParams.ID.toString());
testCase.setId(id);
} catch (XmlRpcException xmlrpcex) {
throw new TestLinkAPIException("Error creating test plan: " + xmlrpcex.getMessage(), xmlrpcex);
}
return testCase;
}
public Map<String, Object> createTestCaseSteps(Integer testCaseId, String testCaseExternalId, Integer version,
TestCaseStepAction action, List<TestCaseStep> testCaseSteps) throws TestLinkAPIException {
Map<String, Object> responseMap = null;
try {
Map<String, Object> executionData = new HashMap<String, Object>();
executionData.put(TestLinkParams.TEST_CASE_ID.toString(), testCaseId);
executionData.put(TestLinkParams.TEST_CASE_EXTERNAL_ID.toString(), testCaseExternalId);
executionData.put(TestLinkParams.VERSION.toString(), version);
executionData.put(TestLinkParams.ACTION.toString(), action.toString());
List<Map<String, Object>> steps = Util.getTestCaseStepsMap(testCaseSteps);
executionData.put(TestLinkParams.STEPS.toString(), steps);
Object response = this.executeXmlRpcCall(TestLinkMethods.CREATE_TEST_CASE_STEPS.toString(), executionData);
if (response instanceof Object[]) {
Object[] arr = (Object[]) response;
if (arr.length > 0 && arr[0] instanceof Map<?, ?>) {
responseMap = (Map<String, Object>) arr[0];
}
} else {
responseMap = (Map<String, Object>) response;
}
} catch (XmlRpcException xmlrpcex) {
throw new TestLinkAPIException("Error adding steps to test case: " + xmlrpcex.getMessage(), xmlrpcex);
}
return responseMap;
}
public Map<String, Object> deleteTestCaseSteps(String testCaseExternalId, Integer version,
List<TestCaseStep> testCaseSteps) throws TestLinkAPIException {
Map<String, Object> responseMap = null;
try {
Map<String, Object> executionData = new HashMap<String, Object>();
executionData.put(TestLinkParams.TEST_CASE_EXTERNAL_ID.toString(), testCaseExternalId);
executionData.put(TestLinkParams.VERSION.toString(), version);
List<Integer> steps = Util.getTestCaseStepsIdList(testCaseSteps);
executionData.put(TestLinkParams.STEPS.toString(), steps);
Object response = this.executeXmlRpcCall(TestLinkMethods.DELETE_TEST_CASE_STEPS.toString(), executionData);
responseMap = (Map<String, Object>) response;
} catch (XmlRpcException xmlrpcex) {
throw new TestLinkAPIException("Error deleting steps from test case: " + xmlrpcex.getMessage(), xmlrpcex);
}
return responseMap;
}
protected Integer addTestCaseToTestPlan(Integer testProjectId, Integer testPlanId, Integer testCaseId,
Integer version, Integer platformId, Integer order, Integer urgency) throws TestLinkAPIException {
Integer featureId = 0;
try {
Map<String, Object> executionData = new HashMap<String, Object>();
executionData.put(TestLinkParams.TEST_PROJECT_ID.toString(), testProjectId);
executionData.put(TestLinkParams.TEST_PLAN_ID.toString(), testPlanId);
executionData.put(TestLinkParams.TEST_CASE_ID.toString(), testCaseId);
executionData.put(TestLinkParams.VERSION.toString(), version);
executionData.put(TestLinkParams.PLATFORM_ID.toString(), platformId);
executionData.put(TestLinkParams.ORDER.toString(), order);
executionData.put(TestLinkParams.URGENCY.toString(), urgency);
Object response = this.executeXmlRpcCall(TestLinkMethods.ADD_TEST_CASE_TO_TEST_PLAN.toString(),
executionData);
Map<String, Object> responseMap = Util.castToMap(response);
featureId = Util.getInteger(responseMap, TestLinkResponseParams.FEATURE_ID.toString());
} catch (XmlRpcException xmlrpcex) {
throw new TestLinkAPIException("Error adding test case to test plan: " + xmlrpcex.getMessage(), xmlrpcex);
}
return featureId;
}
/**
* @param testSuiteId
* @param deep
* @param DETAILS
* @return
*/
protected TestCase[] getTestCasesForTestSuite(Integer testSuiteId, Boolean deep, TestCaseDetails detail)
throws TestLinkAPIException {
TestCase[] testCases = null;
try {
Map<String, Object> executionData = new HashMap<String, Object>();
executionData.put(TestLinkParams.TEST_SUITE_ID.toString(), testSuiteId);
executionData.put(TestLinkParams.DEEP.toString(), deep);
executionData.put(TestLinkParams.DETAILS.toString(), Util.getStringValueOrNull(detail));
Object response = this.executeXmlRpcCall(TestLinkMethods.GET_TEST_CASES_FOR_TEST_SUITE.toString(),
executionData);
Object[] responseArray = Util.castToArray(response);
testCases = new TestCase[responseArray.length];
for (int i = 0; i < responseArray.length; i++) {
Map<String, Object> responseMap = (Map<String, Object>) responseArray[i];
testCases[i] = Util.getTestCase(responseMap);
}
} catch (XmlRpcException xmlrpcex) {
throw new TestLinkAPIException("Error retrieving test cases for test suite: " + xmlrpcex.getMessage(),
xmlrpcex);
}
return testCases;
}
/**
* @param testPlanId
* @param testCasesIds
* @param buildId
* @param keywordsIds
* @param keywords
* @param executed
* @param assignedTo
* @param executeStatus
* @param executionType
* @param getStepInfo
* @return
* @throws TestLinkAPIException
*/
protected TestCase[] getTestCasesForTestPlan(Integer testPlanId, List<Integer> testCasesIds, Integer buildId,
List<Integer> keywordsIds, String keywords, Boolean executed, List<Integer> assignedTo,
String[] executeStatus, ExecutionType executionType, Boolean getStepInfo, TestCaseDetails detail)
throws TestLinkAPIException {
TestCase[] testCases = null;
try {
Map<String, Object> executionData = new HashMap<String, Object>();
executionData.put(TestLinkParams.TEST_PLAN_ID.toString(), testPlanId);
executionData.put(TestLinkParams.TEST_CASE_ID.toString(), testCasesIds);
executionData.put(TestLinkParams.BUILD_ID.toString(), buildId);
executionData.put(TestLinkParams.KEYWORD_ID.toString(), keywordsIds);
executionData.put(TestLinkParams.KEYWORDS.toString(), keywords);
executionData.put(TestLinkParams.EXECUTED.toString(), executed);
executionData.put(TestLinkParams.ASSIGNED_TO.toString(), assignedTo);
executionData.put(TestLinkParams.EXECUTE_STATUS.toString(), executeStatus);
executionData.put(TestLinkParams.EXECUTION_TYPE.toString(), Util.getStringValueOrNull(executionType));
executionData.put(TestLinkParams.GET_STEP_INFO.toString(), getStepInfo);
executionData.put(TestLinkParams.DETAILS.toString(), Util.getStringValueOrNull(detail));
Object response = this.executeXmlRpcCall(TestLinkMethods.GET_TEST_CASES_FOR_TEST_PLAN.toString(),
executionData);
/*
* // The Util.castToMap method will return an empty Map if ( response instanceof String ) { throw new
* TestLinkAPIException( "The test plan you requested does not contain Test Cases." ); }
*/
Map<String, Object> responseMap = Util.castToMap(response);
Set<Entry<String, Object>> entrySet = responseMap.entrySet();
testCases = new TestCase[entrySet.size()];
int index = 0;
for (Entry<String, Object> entry : entrySet) {
String key = entry.getKey();
Map<String, Object> testCaseMap = null;
if (entry.getValue() instanceof Object[]) {
Object[] responseArray = (Object[]) entry.getValue();
testCaseMap = (Map<String, Object>) responseArray[0];
} else if (entry.getValue() instanceof Map<?, ?>) {
testCaseMap = (Map<String, Object>) entry.getValue();
if (testCaseMap.size() > 0) {
Set<String> keys = testCaseMap.keySet();
Object o = testCaseMap.get(keys.iterator().next());
if (o instanceof Map<?, ?>) {
testCaseMap = (Map<String, Object>) o;
}
}
}
testCaseMap.put(TestLinkResponseParams.ID.toString(), key);
testCases[index] = Util.getTestCase(testCaseMap);
index += 1;
}
} catch (XmlRpcException xmlrpcex) {
throw new TestLinkAPIException("Error retrieving test cases for test plan: " + xmlrpcex.getMessage(),
xmlrpcex);
}
return testCases;
}
/**
*
* @param testCaseId
* @param testCaseExternalId
* @param version
* @return
* @throws TestLinkAPIException
*/
protected TestCase getTestCase(Integer testCaseId, Integer testCaseExternalId, Integer version)
throws TestLinkAPIException {
TestCase testCase = null;
try {
Map<String, Object> executionData = new HashMap<String, Object>();
executionData.put(TestLinkParams.TEST_CASE_ID.toString(), testCaseId);
executionData.put(TestLinkParams.TEST_CASE_EXTERNAL_ID.toString(), testCaseExternalId);
executionData.put(TestLinkParams.VERSION.toString(), version);
Object response = this.executeXmlRpcCall(TestLinkMethods.GET_TEST_CASE.toString(), executionData);
Object[] responseArray = Util.castToArray(response);
Map<String, Object> responseMap = (Map<String, Object>) responseArray[0];
testCase = Util.getTestCase(responseMap);
} catch (XmlRpcException xmlrpcex) {
throw new TestLinkAPIException("Error getting test case info : " + xmlrpcex.getMessage(), xmlrpcex);
}
return testCase;
}
/**
*
* @param fullTestCaseExternalId Full external id: prefix-externalId
* @param version
* @return
* @throws TestLinkAPIException
*/
protected TestCase getTestCaseByExternalId(String fullTestCaseExternalId, Integer version)
throws TestLinkAPIException {
TestCase testCase = null;
try {
Map<String, Object> executionData = new HashMap<String, Object>();
executionData.put(TestLinkParams.TEST_CASE_EXTERNAL_ID.toString(), fullTestCaseExternalId);
executionData.put(TestLinkParams.VERSION.toString(), version);
Object response = this.executeXmlRpcCall(TestLinkMethods.GET_TEST_CASE.toString(), executionData);
Object[] responseArray = Util.castToArray(response);
Map<String, Object> responseMap = (Map<String, Object>) responseArray[0];
testCase = Util.getTestCase(responseMap);
} catch (XmlRpcException xmlrpcex) {
throw new TestLinkAPIException("Error getting test case info : " + xmlrpcex.getMessage(), xmlrpcex);
}
return testCase;
}
/**
*
* @param DEV_KEY
* @param testCaseName
* @param testSuiteName
* @param testProjectName
* @param testCasePathName
* @return
* @throws TestLinkAPIException
*/
protected Integer getTestCaseIDByName(String testCaseName, String testSuiteName, String testProjectName,
String testCasePathName) throws TestLinkAPIException {
Integer testCaseID = null;
try {
Map<String, Object> executionData = new HashMap<String, Object>();
executionData.put(TestLinkParams.TEST_CASE_NAME.toString(), testCaseName);
executionData.put(TestLinkParams.TEST_SUITE_NAME.toString(), testSuiteName);
executionData.put(TestLinkParams.TEST_PROJECT_NAME.toString(), testProjectName);
executionData.put(TestLinkParams.TEST_CASE_PATH_NAME.toString(), testCasePathName);
Object response = this
.executeXmlRpcCall(TestLinkMethods.GET_TEST_CASE_ID_BY_NAME.toString(), executionData);
Object[] responseArray = Util.castToArray(response);
Map<String, Object> responseMap = (Map<String, Object>) responseArray[0];
testCaseID = Util.getInteger(responseMap, TestLinkResponseParams.ID.toString());
} catch (XmlRpcException xmlrpcex) {
throw new TestLinkAPIException("Error getting test case ID : " + xmlrpcex.getMessage(), xmlrpcex);
}
return testCaseID;
}
/**
* @param testCaseId
* @param title
* @param description
* @param fileName
* @param fileType
* @param content
* @return
*/
protected Attachment uploadTestCaseAttachment(Integer testCaseId, String title, String description,
String fileName, String fileType, String content) throws TestLinkAPIException {
Attachment attachment = null;
Integer id = 0;
attachment = new Attachment(id, testCaseId, TestLinkTables.NODES_HIERARCHY.toString(), title, description,
fileName, null, fileType, content);
try {
Map<String, Object> executionData = Util.getTestCaseAttachmentMap(attachment);
Object response = this.executeXmlRpcCall(TestLinkMethods.UPLOAD_TEST_CASE_ATTACHMENT.toString(),
executionData);
Map<String, Object> responseMap = Util.castToMap(response);
id = Util.getInteger(responseMap, TestLinkResponseParams.ID.toString());
attachment.setId(id);
} catch (XmlRpcException xmlrpcex) {
throw new TestLinkAPIException("Error uploading attachment for test case: " + xmlrpcex.getMessage(),
xmlrpcex);
}
return attachment;
}
/**
* @param testCaseId
* @param testCaseExternalId
* @return
* @throws TestLinkAPIException
*/
protected Attachment[] getTestCaseAttachments(Integer testCaseId, Integer testCaseExternalId)
throws TestLinkAPIException {
Attachment[] attachments = null;
try {
Map<String, Object> executionData = new HashMap<String, Object>();
executionData.put(TestLinkParams.TEST_CASE_ID.toString(), testCaseId);
executionData.put(TestLinkParams.TEST_CASE_EXTERNAL_ID.toString(), testCaseExternalId);
Object response = this.executeXmlRpcCall(TestLinkMethods.GET_TEST_CASE_ATTACHMENTS.toString(),
executionData);
if (response instanceof Map<?, ?>) {
Map<String, Object> responseMap = Util.castToMap(response);
Set<Entry<String, Object>> entrySet = responseMap.entrySet();
attachments = new Attachment[entrySet.size()];
int index = 0;
for (Entry<String, Object> entry : entrySet) {
String key = entry.getKey();
Map<String, Object> attachmentMap = (Map<String, Object>) entry.getValue();
attachmentMap.put(TestLinkResponseParams.ID.toString(), key);
attachments[index] = Util.getAttachment(attachmentMap);
index += 1;
}
} else {
attachments = new Attachment[0];
}
} catch (XmlRpcException xmlrpcex) {
throw new TestLinkAPIException("Error retrieving test case's attachments: " + xmlrpcex.getMessage(),
xmlrpcex);
}
return attachments;
}
protected Attachment uploadExecutionAttachment(Integer executionId, String title, String description,
String fileName, String fileType, String content) throws TestLinkAPIException {
Attachment attachment = null;
Integer id = 0;
attachment = new Attachment(id, executionId, TestLinkTables.EXECUTIONS.toString(), title, description,
fileName, null, fileType, content);
try {
Map<String, Object> executionData = Util.getExecutionAttachmentMap(attachment);
Object response = this.executeXmlRpcCall(TestLinkMethods.UPLOAD_EXECUTION_ATTACHMENT.toString(),
executionData);
Map<String, Object> responseMap = Util.castToMap(response);
id = Util.getInteger(responseMap, TestLinkResponseParams.ID.toString());
attachment.setId(id);
} catch (XmlRpcException xmlrpcex) {
throw new TestLinkAPIException("Error uploading attachment for execution: " + xmlrpcex.getMessage(),
xmlrpcex);
}
return attachment;
}
/**
* @param executionId
* @return
* @te
*/
protected void deleteExecution(Integer executionId) throws TestLinkAPIException {
try {
Map<String, Object> executionData = new HashMap<String, Object>();
executionData.put(TestLinkParams.EXECUTION_ID.toString(), executionId);
this.executeXmlRpcCall(TestLinkMethods.DELETE_EXECUTION.toString(), executionData);
// the error verification routine is called inside
// super.executeXml...
} catch (XmlRpcException xmlrpcex) {
throw new TestLinkAPIException("Error deleting execution: " + xmlrpcex.getMessage(), xmlrpcex);
}
}
/**
* @param testCaseId
* @param testCaseExternalId
* @param testPlanId
* @param status
* @param buildId
* @param buildName
* @param notes
* @param guess
* @param bugId
* @param platformId
* @param platformName
* @param customFields
* @param overwrite
* @return Response object of reportTCResult method
* @throws TestLinkAPIException
*/
protected ReportTCResultResponse reportTCResult(Integer testCaseId, Integer testCaseExternalId, Integer testPlanId,
ExecutionStatus status, Integer buildId, String buildName, String notes, Boolean guess, String bugId,
Integer platformId, String platformName, Map<String, String> customFields,
Boolean overwrite) throws TestLinkAPIException {
// TODO: Map<String, String> customFields =>
// change for a list of custom fields. After implementing method getTestCaseCustomFieldDesignValue this
// entities properties will become much more clear
ReportTCResultResponse reportTCResultResponse = null;
try {
Map<String, Object> executionData = new HashMap<String, Object>();
executionData.put(TestLinkParams.TEST_CASE_ID.toString(), testCaseId);
executionData.put(TestLinkParams.TEST_CASE_EXTERNAL_ID.toString(), testCaseExternalId);
executionData.put(TestLinkParams.TEST_PLAN_ID.toString(), testPlanId);
executionData.put(TestLinkParams.STATUS.toString(), status.toString());
executionData.put(TestLinkParams.BUILD_ID.toString(), buildId);
executionData.put(TestLinkParams.BUILD_NAME.toString(), buildName);
executionData.put(TestLinkParams.NOTES.toString(), notes);
executionData.put(TestLinkParams.GUESS.toString(), guess);
executionData.put(TestLinkParams.BUG_ID.toString(), bugId);
executionData.put(TestLinkParams.PLATFORM_ID.toString(), platformId);
executionData.put(TestLinkParams.PLATFORM_NAME.toString(), platformName);
executionData.put(TestLinkParams.CUSTOM_FIELDS.toString(), customFields);
executionData.put(TestLinkParams.OVERWRITE.toString(), overwrite);
Object response = this.executeXmlRpcCall(TestLinkMethods.REPORT_TC_RESULT.toString(), executionData);
// the error verification routine is called inside
// super.executeXml...
if (response instanceof Object[]) {
Object[] responseArray = Util.castToArray(response);
Map<String, Object> responseMap = (Map<String, Object>) responseArray[0];
reportTCResultResponse = Util.getReportTCResultResponse(responseMap);
}
} catch (XmlRpcException xmlrpcex) {
throw new TestLinkAPIException("Error reporting TC result: " + xmlrpcex.getMessage(), xmlrpcex);
}
return reportTCResultResponse;
}
/**
* @param testCaseId
* @param testCaseExternalId
* @param versionNumber
* @param testProjectId
* @param customFieldName
* @param details
* @return Custom Field.
* @throws TestLinkAPIException
*/
protected CustomField getTestCaseCustomFieldDesignValue(Integer testCaseId, Integer testCaseExternalId,
Integer versionNumber, Integer testProjectId, String customFieldName, ResponseDetails details)
throws TestLinkAPIException {
CustomField customField = null;
try {
Map<String, Object> executionData = new HashMap<String, Object>();
executionData.put(TestLinkParams.TEST_CASE_ID.toString(), testCaseId);
executionData.put(TestLinkParams.TEST_CASE_EXTERNAL_ID.toString(), testCaseExternalId);
executionData.put(TestLinkParams.VERSION.toString(), versionNumber);
executionData.put(TestLinkParams.TEST_PROJECT_ID.toString(), testProjectId);
executionData.put(TestLinkParams.CUSTOM_FIELD_NAME.toString(), customFieldName);
executionData.put(TestLinkParams.DETAILS.toString(), Util.getStringValueOrNull(details));
Object response = this.executeXmlRpcCall(
TestLinkMethods.GET_TEST_CASE_CUSTOM_FIELD_DESIGN_VALUE.toString(), executionData);
if (response instanceof String) {
customField = new CustomField();
customField.setValue(response.toString());
} else if (response instanceof Map<?, ?>) {
Map<String, Object> responseMap = Util.castToMap(response);
customField = Util.getCustomField(responseMap);
}
} catch (XmlRpcException xmlrpcex) {
throw new TestLinkAPIException("Error retrieving test case custom field value: " + xmlrpcex.getMessage(),
xmlrpcex);
}
return customField;
}
/**
* @param testCaseId
* @param testCaseExternalId
* @param versionNumber
* @param testProjectId
* @param customFieldName
* @param details
* @return
* @throws TestLinkAPIException
*/
protected CustomField getTestCaseCustomFieldTestPlanDesignValue(Integer testCaseId, Integer testCaseExternalId,
Integer versionNumber, Integer testProjectId, String customFieldName, ResponseDetails details)
throws TestLinkAPIException {
CustomField customField = null;
try {
Map<String, Object> executionData = new HashMap<String, Object>();
executionData.put(TestLinkParams.TEST_CASE_ID.toString(), testCaseId);
executionData.put(TestLinkParams.TEST_CASE_EXTERNAL_ID.toString(), testCaseExternalId);
executionData.put(TestLinkParams.VERSION.toString(), versionNumber);
executionData.put(TestLinkParams.TEST_PROJECT_ID.toString(), testProjectId);
executionData.put(TestLinkParams.CUSTOM_FIELD_NAME.toString(), customFieldName);
executionData.put(TestLinkParams.DETAILS.toString(), Util.getStringValueOrNull(details));
Object response = this.executeXmlRpcCall(
TestLinkMethods.GET_TEST_CASE_CUSTOM_FIELD_TEST_PLAN_DESIGN_VALUE.toString(), executionData);
if (response instanceof String) {
customField = new CustomField();
customField.setValue(response.toString());
} else if (response instanceof Map<?, ?>) {
Map<String, Object> responseMap = Util.castToMap(response);
customField = Util.getCustomField(responseMap);
}
} catch (XmlRpcException xmlrpcex) {
throw new TestLinkAPIException("Error retrieving test case custom field value: " + xmlrpcex.getMessage(),
xmlrpcex);
}
return customField;
}
/**
* @param testCaseId
* @param testCaseExternalId
* @param versionNumber
* @param testProjectId
* @param customFieldName
* @param details
* @return
* @throws TestLinkAPIException
*/
protected CustomField getTestCaseCustomFieldExecutionValue(Integer testCaseId, Integer testCaseExternalId,
Integer versionNumber, Integer executionId, Integer testProjectId, String customFieldName,
ResponseDetails details) throws TestLinkAPIException {
CustomField customField = null;
try {
Map<String, Object> executionData = new HashMap<String, Object>();
executionData.put(TestLinkParams.TEST_CASE_ID.toString(), testCaseId);
executionData.put(TestLinkParams.TEST_CASE_EXTERNAL_ID.toString(), testCaseExternalId);
executionData.put(TestLinkParams.VERSION.toString(), versionNumber);
executionData.put(TestLinkParams.TEST_PROJECT_ID.toString(), testProjectId);
executionData.put(TestLinkParams.CUSTOM_FIELD_NAME.toString(), customFieldName);
executionData.put(TestLinkParams.DETAILS.toString(), Util.getStringValueOrNull(details));
executionData.put(TestLinkParams.EXECUTION_ID.toString(), executionId);
Object response = this.executeXmlRpcCall(
TestLinkMethods.GET_TEST_CASE_CUSTOM_FIELD_EXECUTION_VALUE.toString(), executionData);
if (response instanceof String) {
customField = new CustomField();
customField.setValue(response.toString());
} else if (response instanceof Map<?, ?>) {
Map<String, Object> responseMap = Util.castToMap(response);
customField = Util.getCustomField(responseMap);
}
} catch (XmlRpcException xmlrpcex) {
throw new TestLinkAPIException("Error retrieving test case custom field value: " + xmlrpcex.getMessage(),
xmlrpcex);
}
return customField;
}
/**
* @param testProjectId
* @param testCaseExternalId
* @param versionNumber
* @param executionType
* @return
*/
protected Map<String, Object> setTestCaseExecutionType(Integer testProjectId, Integer testCaseId,
Integer testCaseExternalId, Integer versionNumber, ExecutionType executionType) {
Map<String, Object> responseMap = null;
try {
Map<String, Object> executionData = new HashMap<String, Object>();
executionData.put(TestLinkParams.TEST_CASE_EXTERNAL_ID.toString(), testCaseExternalId);
executionData.put(TestLinkParams.TEST_CASE_ID.toString(), testCaseId);
executionData.put(TestLinkParams.VERSION.toString(), versionNumber);
executionData.put(TestLinkParams.TEST_PROJECT_ID.toString(), testProjectId);
executionData.put(TestLinkParams.EXECUTION_TYPE.toString(), Util.getStringValueOrNull(executionType));
Object response = this.executeXmlRpcCall(TestLinkMethods.SET_TEST_CASE_EXECUTION_TYPE.toString(),
executionData);
if (response instanceof Map<?, ?>) {
responseMap = Util.castToMap(response);
} else {
responseMap = Util.castToMap(((Object[]) response)[0]);
}
} catch (XmlRpcException xmlrpcex) {
throw new TestLinkAPIException("Error retrieving test case custom field value: " + xmlrpcex.getMessage(),
xmlrpcex);
}
return responseMap;
}
/**
*
* @param testCaseId
* @param versionNumber
* @param testProjectId
* @param customFieldName
* @param customFieldValue
*/
protected Map<String, Object> updateTestCaseCustomFieldDesignValue(Integer testCaseId, Integer versionNumber, Integer testProjectId, String customFieldName, String customFieldValue) {
Map<String, Object> responseMap =null;
try {
Map<String, Object> executionData = new HashMap<String, Object>();
Map<String,String> cf = new HashMap<String, String>();
cf.put(customFieldName, customFieldValue);
executionData.put(TestLinkParams.TEST_CASE_ID.toString(), testCaseId);
executionData.put(TestLinkParams.VERSION.toString(), versionNumber);
executionData.put(TestLinkParams.TEST_PROJECT_ID.toString(), testProjectId);
executionData.put(TestLinkParams.CUSTOM_FIELDS.toString(), cf);
Object response = this.executeXmlRpcCall(TestLinkMethods.UPDATE_TEST_CASE_CUSTOM_FIELD_VALUE.toString(),
executionData);
if (response instanceof Map<?, ?>) {
responseMap = Util.castToMap(response);
} else if (! (response instanceof String) ) {
responseMap = Util.castToMap(((Object[]) response)[0]);
}
} catch (XmlRpcException xmlrpcex) {
throw new TestLinkAPIException("Error updating test case custom field value. " + xmlrpcex.getMessage(),
xmlrpcex);
}
return responseMap;
}
}
| {
"content_hash": "dc0fac304f4eb99c424f69f1c9e72534",
"timestamp": "",
"source": "github",
"line_count": 758,
"max_line_length": 187,
"avg_line_length": 45.22823218997362,
"alnum_prop": 0.6371379400869236,
"repo_name": "gilsouza/testlink-java-api",
"id": "eb08a55ba3579109bb6f5f281562b95718e7420e",
"size": "35456",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/br/eti/kinoshita/testlinkjavaapi/TestCaseService.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "442555"
},
{
"name": "PHP",
"bytes": "64911"
}
],
"symlink_target": ""
} |
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { GettingStartedComponent } from './getting-started.component';
@NgModule( {
imports: [
RouterModule.forChild( [
{ path: '', component: GettingStartedComponent }
] )
],
exports: [
RouterModule
]
} )
export class GettingStartedRoutingModule {
}
| {
"content_hash": "796c93cc50bb6e385e2edb4314163fd0",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 70,
"avg_line_length": 23,
"alnum_prop": 0.6739130434782609,
"repo_name": "TemainfoSistemas/truly-ui",
"id": "bd945e979d757d9fb45485a8cf49fab422ad0d4c",
"size": "368",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/app/getting-started/getting-started-routing.module.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "203004"
},
{
"name": "HTML",
"bytes": "212051"
},
{
"name": "JavaScript",
"bytes": "32607"
},
{
"name": "TypeScript",
"bytes": "717143"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<sem:triples uri="http://www.lds.org/vrl/church-today/priesthood-organization/quorums/first-quorum-of-the-seventy" xmlns:sem="http://marklogic.com/semantics">
<sem:triple>
<sem:subject>http://www.lds.org/vrl/church-today/priesthood-organization/quorums/first-quorum-of-the-seventy</sem:subject>
<sem:predicate>http://www.w3.org/2004/02/skos/core#prefLabel</sem:predicate>
<sem:object datatype="xsd:string" xml:lang="eng">First Quorum of the Seventy</sem:object>
</sem:triple>
<sem:triple>
<sem:subject>http://www.lds.org/vrl/church-today/priesthood-organization/quorums/first-quorum-of-the-seventy</sem:subject>
<sem:predicate>http://www.w3.org/2004/02/skos/core#inScheme</sem:predicate>
<sem:object datatype="sem:iri">http://www.lds.org/concept-scheme/vrl</sem:object>
</sem:triple>
<sem:triple>
<sem:subject>http://www.lds.org/vrl/church-today/priesthood-organization/quorums/first-quorum-of-the-seventy</sem:subject>
<sem:predicate>http://www.lds.org/core#entityType</sem:predicate>
<sem:object datatype="sem:iri">http://www.schema.org/Place</sem:object>
</sem:triple>
</sem:triples>
| {
"content_hash": "5f1392047efe2f7deb50efdf42a32a3a",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 158,
"avg_line_length": 65.22222222222223,
"alnum_prop": 0.7325383304940375,
"repo_name": "freshie/ml-taxonomies",
"id": "ffff9a4aef63bdd8c6ea29423f7bbed48a360945",
"size": "1174",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "roxy/data/gospel-topical-explorer-v2/taxonomies/vrl/church-today/priesthood-organization/quorums/first-quorum-of-the-seventy.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "4422"
},
{
"name": "CSS",
"bytes": "38665"
},
{
"name": "HTML",
"bytes": "356"
},
{
"name": "JavaScript",
"bytes": "411651"
},
{
"name": "Ruby",
"bytes": "259121"
},
{
"name": "Shell",
"bytes": "7329"
},
{
"name": "XQuery",
"bytes": "857170"
},
{
"name": "XSLT",
"bytes": "13753"
}
],
"symlink_target": ""
} |
'use strict';
let FileFunnel = require('filefunnel.js');
let angular = require('angular');
require('filefunnel.js/dist/js/filefunnel-i18n.min.js');
let ff = angular.module('filefunnel', ['ngMaterial', 'ngNpolar']);
ff.controller('FFUploadController', function($scope, $rootScope, $mdDialog, options, NpolarApiSecurity) {
'ngInject';
let ff = new FileFunnel(null, options);
$scope.ff = ff;
if (Object.keys(options).includes('restricted')) {
let restricted = false; // Open access is default
$scope.askForScope = false; // No checkbox is default
if (typeof options.restricted === 'function') {
restricted = options.restricted();
$scope.askForScope = true;
} else if ([true,false].includes(options.restricted)) {
restricted = options.restricted;
}
$scope.access = {
data: (restricted !== true)
};
$scope.$watch('access.data', access => {
if (access) {
ff.server = ff.server.replace('/restricted/', '/');
} else {
ff.server = ff.server.replace(/\/$/, '') + '/restricted/';
}
});
}
if (/:id/.test(options.server)) {
if (options.formula) {
let model = options.formula.getModel();
ff.server = ff.server.replace(':id', model.id || model._id);
} else {
throw "Server needs a document id to be able to upload files.";
}
}
ff._elements.fileInput.on('change', (event) => {
$rootScope.$broadcast('npdc-filefunnel-change', ff);
$scope.$apply();
});
$scope.abort = function() {
ff.abort();
$mdDialog.hide();
};
$scope.upload = function() {
ff.auth = NpolarApiSecurity.authorization();
ff.upload();
//$mdDialog.hide();
};
$scope.$on('npolar-lang', (e, lang) => {
ff.locale = lang.lang;
});
// Success for each file
ff.on('success', file => {
$rootScope.$broadcast('npdc-filefunnel-upload-success', file);
// Completed when all files are in
if (ff.status === FileFunnel.status.COMPLETED) {
$mdDialog.hide(ff.files);
$rootScope.$broadcast('npdc-filefunnel-upload-completed', ff.files.filter((f,k) => typeof(k) === 'number'));
}
}).on('error', file => {
ff.progressType = 'determinate';
$scope.$apply();
}).on('progress', file => {
ff.progressType = 'determinate';
}).on('start', file => {
ff.progressType = 'indeterminate';
});
$scope.FileFunnelStatus = FileFunnel.status;
ff.progressType = 'determinate';
});
ff.service('fileFunnelService', function($mdDialog, formulaFieldConfig, NpolarMessage) {
const DEFAULTS = {
accept: "*/*",
chunked: false,
multiple: false,
restricted: false
};
let configs = formulaFieldConfig.getInstance();
let fileUploader = function(config, formula) {
var options = Object.assign({}, DEFAULTS, config, { formula });
if (!options.server) {
throw "You must set a server!";
}
if (options.fromHashi) {
options.fileToValueMapper = options.fromHashi;
}
if (!options.fileToValueMapper) {
options.fileToValueMapper = function (file) {return file; };
}
if (!options.valueToFileMapper) {
options.valueToFileMapper = function (value) {return value; };
}
configs.addConfig(options);
formula.addTemplate({
match: options.match,
template: '<npdc:formula-file></npdc:formula-file>'
});
};
let getOptions = function(field) {
return configs.getMatchingConfig(field);
};
let handleOptions = function(options) {
if (options.restricted) {
let restricted = options.restricted;
if (typeof options.restricted === "function") {
restricted = options.restricted();
}
options.server += restricted ? '/restricted' : '';
}
};
let showUpload = function(ev, field, options) {
handleOptions(options);
return $mdDialog.show({
clickOutsideToClose: true,
controller: 'FFUploadController',
locals: {
options: options
},
targetEvent: ev,
template: require('./filefunnel.html')
}).then(files => {
if (!files) {
return;
}
let responses = JSON.parse(files.xhr.response);
responses.forEach(response => {
// @TODO Handle out of sync metadata in backend
if (response.status >= 200 && response.status < 300) {
let value = options.fileToValueMapper(response);
console.log('fromHashi', value);
if (typeof value !== 'object') {
throw "fileToValueMapper should return object with keys matching the fields you want to set file data to";
}
let item = field.itemAdd( /* preventValidation */ true);
let valueModel = {};
valueModel[item.id] = value;
item.valueFromModel(valueModel);
field.itemChange();
} else {
console.log('Hashi error:', response);
}
});
return responses;
});
};
return {
fileUploader,
getOptions,
showUpload,
status: FileFunnel.status
};
});
| {
"content_hash": "7abb2efd2473de2add46264f417555ad",
"timestamp": "",
"source": "github",
"line_count": 180,
"max_line_length": 118,
"avg_line_length": 27.961111111111112,
"alnum_prop": 0.6054043314126764,
"repo_name": "npolar/npdc-common",
"id": "ce7a5cfb4bebd1c9842cc3e3b59c6000044bfd6e",
"size": "5033",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/wrappers/filefunnel.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "25360"
},
{
"name": "HTML",
"bytes": "144489"
},
{
"name": "JavaScript",
"bytes": "157391"
}
],
"symlink_target": ""
} |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Orchard.MediaPicker")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyProduct("Orchard")]
[assembly: AssemblyCopyright("Copyright © Outercurve Foundation 2009")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("d33b592c-133c-440b-8841-17e55eb08306")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.3.0")]
[assembly: AssemblyFileVersion("1.3.0")]
[assembly: SecurityTransparent]
| {
"content_hash": "e0416b34cd8a9978197fc9b703e940db",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 84,
"avg_line_length": 38.861111111111114,
"alnum_prop": 0.7562544674767692,
"repo_name": "kudustress/Orchard",
"id": "9acd0b576b8f15609d603cda2d9c95c2393d0f77",
"size": "1402",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "Modules/Orchard.MediaPicker/Properties/AssemblyInfo.cs",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "ASP",
"bytes": "102"
},
{
"name": "C#",
"bytes": "1136632"
},
{
"name": "JavaScript",
"bytes": "803200"
}
],
"symlink_target": ""
} |
.container-fluid
{
max-width: 1600px;
}
.container-wapper
{
width:100%;
background:#c0c0c0;
}
#menu
{
height:15%;
width:100%;
float:left;
border-bottom: 1px solid #f15556;
position:fixed;
top:0;
z-index: 5000;
background: #f9f9f9;
}
#logo
{
float:left;
width:10%;
}
#logotext
{
float:left;
width:20%;
height:100%;
font-family:Century Gothic;
font-size: 35px;
display:flex; /* establish flex container */
flex-direction:column; /* stack flex items vertically */
justify-content:center; /* center items vertically */
}
#menulist
{
float:left;
width:14%;
height:100%;
display:flex; /* establish flex container */
flex-direction:column; /* stack flex items vertically */
justify-content:center;
text-align:center;
font-size: 20px;
font-family:Century Gothic;
}
#menulist > a:hover
{
color:white ;
background-color:#e35354;
height:100%;
display:flex; /* establish flex container */
flex-direction:column; /* stack flex items vertically */
justify-content:center;
}
#menulist > a:link,a:visited
{
color: black;
text-decoration: none !important;
}
#text
{
font-size:25px;
margin-left:2%;
margin-top:2%;
color:#e35354;
}
#footer
{
margin-top:10px;
width:100%;
height:15%;
background-color:#DB7093;
float:left;
} | {
"content_hash": "26f4d5bf9fab9c182a2ffceb926f0e69",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 60,
"avg_line_length": 16.27710843373494,
"alnum_prop": 0.6439674315321984,
"repo_name": "Joydeep95/Delhi-Tourism",
"id": "08eaecd0e03f0015b126f03a98756d9313c4b0b2",
"size": "1351",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "css/history.css",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "38914"
},
{
"name": "PHP",
"bytes": "111671"
}
],
"symlink_target": ""
} |
package br.ufsc.bridge.res.service.exception;
import java.util.Map;
import lombok.Getter;
@Getter
public class ResUrlsException extends ResException {
private static final long serialVersionUID = 1L;
private Map<String, ResException> exceptions;
public ResUrlsException(Map<String, ResException> exceptions) {
super("Alguns links apresentam problemas ao enviar");
this.exceptions = exceptions;
}
} | {
"content_hash": "0c58a86634b289f4b50ede539a7e7ee1",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 64,
"avg_line_length": 25.5625,
"alnum_prop": 0.7897310513447433,
"repo_name": "laboratoriobridge/res-api",
"id": "f5145d06f9d801ba7d1b6a22f44642b0690a16e2",
"size": "409",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/br/ufsc/bridge/res/service/exception/ResUrlsException.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "533630"
}
],
"symlink_target": ""
} |
import Promise from 'bluebird';
import mongoose from 'mongoose';
import httpStatus from 'http-status';
import APIError from '../helpers/APIError';
import QuestionnaireSchema from './questionnaire.schema';
import CondensedEntitySchema from './condensedEntity.schema';
/**
* Entity Schema
*/
const EntitySchema = new mongoose.Schema({
name: {
type: String,
required: true
},
shortname: {
type: String,
required: false
},
type: {
type: String,
required: true
},
country: {
type: String,
required: true,
match: [/^[A-Z]{2}$/, 'The value of path {PATH} ({VALUE}) is not a valid ISO 3166 Alpha-2 code.']
},
parentReportingEntity: {
type: CondensedEntitySchema,
required: false
},
questionnaire: QuestionnaireSchema
}, {
timestamps: true
});
/**
* Virtuals
*/
EntitySchema.virtual('deletable').get(() => {
/**
* TODO:
* Implement a check if entity can be deleted or not.
*
* Logic: Entity can only be deleted if
* - it doesn't participate in a transaction (query/count transactions for this entity)
* - it isn't a "parentReportingCompany" in another entity
*/
const a = false;
return a;
});
/**
* Methods
*/
EntitySchema.method({
});
/**
* Statics
*/
EntitySchema.statics = {
/**
* Get entity
* @param {ObjectId} id - The objectId of entity.
* @returns {Promise<User, APIError>}
*/
get(id) {
return this.findById(id)
.exec()
.then((entity) => {
if (entity) {
return entity;
}
const err = new APIError('No such entity exists!', httpStatus.NOT_FOUND);
return Promise.reject(err);
});
},
/**
* List entities in descending order of 'createdAt' timestamp.
* @param {number} skip - Number of entities to be skipped.
* @param {number} limit - Limit number of entities to be returned.
* @returns {Promise<Entity[]>}
*/
list({ skip = 0, limit = 50 } = {}) {
return this.find()
.sort({ createdAt: -1 })
.skip(skip)
.limit(limit)
.select({
name: 1,
shortname: 1,
country: 1,
type: 1
})
.exec();
}
};
/**
* @typedef Entity
*/
export default mongoose.model('Entity', EntitySchema);
| {
"content_hash": "59afa6ae28425398373018b5222ff6cb",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 101,
"avg_line_length": 21.02803738317757,
"alnum_prop": 0.6008888888888889,
"repo_name": "PommesKlaus/tpdoc2",
"id": "5ad918d3b9216fb21d625a6bbe74b53f60265cf2",
"size": "2250",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "server/models/entity.model.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "89169"
}
],
"symlink_target": ""
} |
Rails.application.config.session_store :cookie_store, key: '_thing_session'
| {
"content_hash": "17f5647e0ea8d9bb670799914722365e",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 75,
"avg_line_length": 76,
"alnum_prop": 0.7894736842105263,
"repo_name": "skandragon/thing",
"id": "4163c01cea8a3a91cd0fdfe9b94117cec763b09f",
"size": "137",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "config/initializers/session_store.rb",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "322"
},
{
"name": "CoffeeScript",
"bytes": "10729"
},
{
"name": "HTML",
"bytes": "12545"
},
{
"name": "Haml",
"bytes": "85802"
},
{
"name": "JavaScript",
"bytes": "769"
},
{
"name": "Ruby",
"bytes": "385431"
},
{
"name": "SCSS",
"bytes": "835"
}
],
"symlink_target": ""
} |
<?php
namespace Oro\Bundle\AttachmentBundle\Tests\Functional\Manager\File;
use Oro\Bundle\AttachmentBundle\Manager\FileManager;
use Oro\Bundle\TestFrameworkBundle\Test\WebTestCase;
class FileManagerTest extends WebTestCase
{
/**
* @var string
*/
private $someFile;
protected function setUp()
{
$this->initClient([], self::generateBasicAuthHeader());
}
protected function tearDown()
{
unlink($this->someFile);
parent::tearDown();
}
public function testTemporaryFileIsRemovedWhenEntityIsDestroyed(): void
{
$cachePath = self::getContainer()->getParameter('kernel.cache_dir');
$this->someFile = tempnam($cachePath, 'tmp');
/** @var FileManager $fileManager */
$fileManager = self::getContainer()->get('oro_attachment.file_manager');
$fileEntity = $fileManager->createFileEntity($this->someFile);
$tmpFilePath = $fileEntity->getFile()->getPathname();
self::assertTrue(file_exists($tmpFilePath));
$fileEntity = null;
self::assertFalse(file_exists($tmpFilePath));
}
}
| {
"content_hash": "bfabb78a6086f4071aeba8b69e2b6174",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 80,
"avg_line_length": 26.11627906976744,
"alnum_prop": 0.655387355298308,
"repo_name": "orocrm/platform",
"id": "4c128ae893f2b919193ea4f9f8f157474b05a37d",
"size": "1123",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Oro/Bundle/AttachmentBundle/Tests/Functional/Manager/FileManagerTest.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "618485"
},
{
"name": "Gherkin",
"bytes": "158217"
},
{
"name": "HTML",
"bytes": "1648915"
},
{
"name": "JavaScript",
"bytes": "3326127"
},
{
"name": "PHP",
"bytes": "37828618"
}
],
"symlink_target": ""
} |
package gov.hhs.fha.nhinc.docsubmission.outbound;
import gov.hhs.fha.nhinc.common.nhinccommon.AssertionType;
import gov.hhs.fha.nhinc.common.nhinccommon.NhinTargetCommunitiesType;
import gov.hhs.fha.nhinc.common.nhinccommon.UrlInfoType;
import ihe.iti.xds_b._2007.ProvideAndRegisterDocumentSetRequestType;
import oasis.names.tc.ebxml_regrep.xsd.rs._3.RegistryResponseType;
/**
* @author akong
*
*/
public interface OutboundDocSubmission {
public RegistryResponseType provideAndRegisterDocumentSetB(ProvideAndRegisterDocumentSetRequestType body,
AssertionType assertion, NhinTargetCommunitiesType targets, UrlInfoType urlInfo);
}
| {
"content_hash": "a187554aef66e6f1a7856ff01401b01a",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 109,
"avg_line_length": 34.421052631578945,
"alnum_prop": 0.8195718654434251,
"repo_name": "healthreveal/CONNECT",
"id": "cdee618686c7c8741137029515ef151b6c6cd28a",
"size": "2324",
"binary": false,
"copies": "3",
"ref": "refs/heads/hrv_integration_4.4",
"path": "Product/Production/Services/DocumentSubmissionCore/src/main/java/gov/hhs/fha/nhinc/docsubmission/outbound/OutboundDocSubmission.java",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "62138"
},
{
"name": "Groovy",
"bytes": "1641"
},
{
"name": "HTML",
"bytes": "170838"
},
{
"name": "Java",
"bytes": "13788093"
},
{
"name": "JavaScript",
"bytes": "6991"
},
{
"name": "PLSQL",
"bytes": "67181"
},
{
"name": "Python",
"bytes": "773"
},
{
"name": "SQLPL",
"bytes": "1363363"
},
{
"name": "Shell",
"bytes": "17435"
},
{
"name": "XSLT",
"bytes": "35057"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "48a62d39ede3493332439f12c988a51f",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 31,
"avg_line_length": 9.692307692307692,
"alnum_prop": 0.7063492063492064,
"repo_name": "mdoering/backbone",
"id": "32321070374808cb79a7a5be24f3ca1b3888cfba",
"size": "177",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Asterales/Asteraceae/Pterothrix/Pterothrix cymbifolia/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
package edu.pitt.apollo.outputtranslator.types.rest.statuscodesandmessages;
/**
* Created by dcs27 on 4/22/15.
*/
public class ResourceNotFound {
Integer errorCode = 404;
String errorMessage = "Resource not found";
public Integer getErrorCode() {
return errorCode;
}
public void setErrorCode(Integer errorCode) {
this.errorCode = errorCode;
}
public String getErrorMessage() {
return errorMessage;
}
public void setErrorMessage(String errorMessage) {
this.errorMessage = errorMessage;
}
}
| {
"content_hash": "4a89590fdca6d85f70b880ac27cb57a3",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 75,
"avg_line_length": 23.625,
"alnum_prop": 0.6772486772486772,
"repo_name": "ApolloDev/apollo",
"id": "5a6360253287e8249a32a5b212ffc26431766e05",
"size": "567",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "output-translator-service-rest-frontend/src/main/java/edu/pitt/apollo/outputtranslator/types/rest/statuscodesandmessages/ResourceNotFound.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "149131"
},
{
"name": "Java",
"bytes": "2150208"
},
{
"name": "JavaScript",
"bytes": "280417"
},
{
"name": "PLpgSQL",
"bytes": "3632"
},
{
"name": "Shell",
"bytes": "5288"
},
{
"name": "TSQL",
"bytes": "10037"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_151) on Wed Jun 10 13:52:59 MST 2020 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>org.wildfly.swarm.jpa.persistence (BOM: * : All 2.7.0.Final API)</title>
<meta name="date" content="2020-06-10">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="org.wildfly.swarm.jpa.persistence (BOM: * : All 2.7.0.Final API)";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li class="navBarCell1Rev">Package</li>
<li>Class</li>
<li><a href="package-use.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage">Thorntail API, 2.7.0.Final</div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/wildfly/swarm/jpa/detect/package-summary.html">Prev Package</a></li>
<li><a href="../../../../../org/wildfly/swarm/jpa/spatial/package-summary.html">Next Package</a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/wildfly/swarm/jpa/persistence/package-summary.html" target="_top">Frames</a></li>
<li><a href="package-summary.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h1 title="Package" class="title">Package org.wildfly.swarm.jpa.persistence</h1>
</div>
<div class="contentContainer">
<ul class="blockList">
<li class="blockList">
<table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Class Summary table, listing classes, and an explanation">
<caption><span>Class Summary</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Class</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../org/wildfly/swarm/jpa/persistence/EclipseLinkPersistenceFraction.html" title="class in org.wildfly.swarm.jpa.persistence">EclipseLinkPersistenceFraction</a></td>
<td class="colLast"> </td>
</tr>
</tbody>
</table>
</li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li class="navBarCell1Rev">Package</li>
<li>Class</li>
<li><a href="package-use.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage">Thorntail API, 2.7.0.Final</div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/wildfly/swarm/jpa/detect/package-summary.html">Prev Package</a></li>
<li><a href="../../../../../org/wildfly/swarm/jpa/spatial/package-summary.html">Next Package</a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/wildfly/swarm/jpa/persistence/package-summary.html" target="_top">Frames</a></li>
<li><a href="package-summary.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright © 2020 <a href="http://www.jboss.org">JBoss by Red Hat</a>. All rights reserved.</small></p>
</body>
</html>
| {
"content_hash": "0fbf90995352f3d1843d52ce1d50bef0",
"timestamp": "",
"source": "github",
"line_count": 146,
"max_line_length": 206,
"avg_line_length": 37.15068493150685,
"alnum_prop": 0.6224188790560472,
"repo_name": "wildfly-swarm/wildfly-swarm-javadocs",
"id": "b945d057ef118a9b30b678b9e41c28385fb02636",
"size": "5424",
"binary": false,
"copies": "1",
"ref": "refs/heads/gh-pages",
"path": "2.7.0.Final/apidocs/org/wildfly/swarm/jpa/persistence/package-summary.html",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
#include <cyclone/body.h>
#include <memory.h>
#include <assert.h>
using namespace cyclone;
/*
* --------------------------------------------------------------------------
* INTERNAL OR HELPER FUNCTIONS:
* --------------------------------------------------------------------------
*/
/**
* Internal function that checks the validity of an inverse inertia tensor.
*/
static inline void _checkInverseInertiaTensor(const Matrix3 &iitWorld)
{
// TODO: Perform a validity check in an assert.
}
/**
* Internal function to do an intertia tensor transform by a quaternion.
* Note that the implementation of this function was created by an
* automated code-generator and optimizer.
*/
static inline void _transformInertiaTensor(Matrix3 &iitWorld,
const Quaternion &q,
const Matrix3 &iitBody,
const Matrix4 &rotmat)
{
real t4 = rotmat.data[0]*iitBody.data[0]+
rotmat.data[1]*iitBody.data[3]+
rotmat.data[2]*iitBody.data[6];
real t9 = rotmat.data[0]*iitBody.data[1]+
rotmat.data[1]*iitBody.data[4]+
rotmat.data[2]*iitBody.data[7];
real t14 = rotmat.data[0]*iitBody.data[2]+
rotmat.data[1]*iitBody.data[5]+
rotmat.data[2]*iitBody.data[8];
real t28 = rotmat.data[4]*iitBody.data[0]+
rotmat.data[5]*iitBody.data[3]+
rotmat.data[6]*iitBody.data[6];
real t33 = rotmat.data[4]*iitBody.data[1]+
rotmat.data[5]*iitBody.data[4]+
rotmat.data[6]*iitBody.data[7];
real t38 = rotmat.data[4]*iitBody.data[2]+
rotmat.data[5]*iitBody.data[5]+
rotmat.data[6]*iitBody.data[8];
real t52 = rotmat.data[8]*iitBody.data[0]+
rotmat.data[9]*iitBody.data[3]+
rotmat.data[10]*iitBody.data[6];
real t57 = rotmat.data[8]*iitBody.data[1]+
rotmat.data[9]*iitBody.data[4]+
rotmat.data[10]*iitBody.data[7];
real t62 = rotmat.data[8]*iitBody.data[2]+
rotmat.data[9]*iitBody.data[5]+
rotmat.data[10]*iitBody.data[8];
iitWorld.data[0] = t4*rotmat.data[0]+
t9*rotmat.data[1]+
t14*rotmat.data[2];
iitWorld.data[1] = t4*rotmat.data[4]+
t9*rotmat.data[5]+
t14*rotmat.data[6];
iitWorld.data[2] = t4*rotmat.data[8]+
t9*rotmat.data[9]+
t14*rotmat.data[10];
iitWorld.data[3] = t28*rotmat.data[0]+
t33*rotmat.data[1]+
t38*rotmat.data[2];
iitWorld.data[4] = t28*rotmat.data[4]+
t33*rotmat.data[5]+
t38*rotmat.data[6];
iitWorld.data[5] = t28*rotmat.data[8]+
t33*rotmat.data[9]+
t38*rotmat.data[10];
iitWorld.data[6] = t52*rotmat.data[0]+
t57*rotmat.data[1]+
t62*rotmat.data[2];
iitWorld.data[7] = t52*rotmat.data[4]+
t57*rotmat.data[5]+
t62*rotmat.data[6];
iitWorld.data[8] = t52*rotmat.data[8]+
t57*rotmat.data[9]+
t62*rotmat.data[10];
}
/**
* Inline function that creates a transform matrix from a
* position and orientation.
*/
static inline void _calculateTransformMatrix(Matrix4 &transformMatrix,
const Vector3 &position,
const Quaternion &orientation)
{
transformMatrix.data[0] = 1-2*orientation.j*orientation.j-
2*orientation.k*orientation.k;
transformMatrix.data[1] = 2*orientation.i*orientation.j -
2*orientation.r*orientation.k;
transformMatrix.data[2] = 2*orientation.i*orientation.k +
2*orientation.r*orientation.j;
transformMatrix.data[3] = position.x;
transformMatrix.data[4] = 2*orientation.i*orientation.j +
2*orientation.r*orientation.k;
transformMatrix.data[5] = 1-2*orientation.i*orientation.i-
2*orientation.k*orientation.k;
transformMatrix.data[6] = 2*orientation.j*orientation.k -
2*orientation.r*orientation.i;
transformMatrix.data[7] = position.y;
transformMatrix.data[8] = 2*orientation.i*orientation.k -
2*orientation.r*orientation.j;
transformMatrix.data[9] = 2*orientation.j*orientation.k +
2*orientation.r*orientation.i;
transformMatrix.data[10] = 1-2*orientation.i*orientation.i-
2*orientation.j*orientation.j;
transformMatrix.data[11] = position.z;
}
/*
* --------------------------------------------------------------------------
* FUNCTIONS DECLARED IN HEADER:
* --------------------------------------------------------------------------
*/
void RigidBody::calculateDerivedData()
{
orientation.normalise();
// Calculate the transform matrix for the body.
_calculateTransformMatrix(transformMatrix, position, orientation);
// Calculate the inertiaTensor in world space.
_transformInertiaTensor(inverseInertiaTensorWorld,
orientation,
inverseInertiaTensor,
transformMatrix);
}
void RigidBody::integrate(real duration)
{
if (!isAwake) return;
// Calculate linear acceleration from force inputs.
lastFrameAcceleration = acceleration;
lastFrameAcceleration.addScaledVector(forceAccum, inverseMass);
// Calculate angular acceleration from torque inputs.
Vector3 angularAcceleration =
inverseInertiaTensorWorld.transform(torqueAccum);
// Adjust velocities
// Update linear velocity from both acceleration and impulse.
velocity.addScaledVector(lastFrameAcceleration, duration);
// Update angular velocity from both acceleration and impulse.
rotation.addScaledVector(angularAcceleration, duration);
// Impose drag.
velocity *= real_pow(linearDamping, duration);
rotation *= real_pow(angularDamping, duration);
// Adjust positions
// Update linear position.
position.addScaledVector(velocity, duration);
// Update angular position.
orientation.addScaledVector(rotation, duration);
// Normalise the orientation, and update the matrices with the new
// position and orientation
calculateDerivedData();
// Clear accumulators.
clearAccumulators();
// Update the kinetic energy store, and possibly put the body to
// sleep.
if (canSleep) {
real currentMotion = velocity.scalarProduct(velocity) +
rotation.scalarProduct(rotation);
real bias = real_pow(0.5, duration);
motion = bias*motion + (1-bias)*currentMotion;
if (motion < sleepEpsilon) setAwake(false);
else if (motion > 10 * sleepEpsilon) motion = 10 * sleepEpsilon;
}
}
void RigidBody::setMass(const real mass)
{
assert(mass != 0);
RigidBody::inverseMass = ((real)1.0)/mass;
}
real RigidBody::getMass() const
{
if (inverseMass == 0) {
return REAL_MAX;
} else {
return ((real)1.0)/inverseMass;
}
}
void RigidBody::setInverseMass(const real inverseMass)
{
RigidBody::inverseMass = inverseMass;
}
real RigidBody::getInverseMass() const
{
return inverseMass;
}
bool RigidBody::hasFiniteMass() const
{
return inverseMass >= 0.0f;
}
void RigidBody::setInertiaTensor(const Matrix3 &inertiaTensor)
{
inverseInertiaTensor.setInverse(inertiaTensor);
_checkInverseInertiaTensor(inverseInertiaTensor);
}
void RigidBody::getInertiaTensor(Matrix3 *inertiaTensor) const
{
inertiaTensor->setInverse(inverseInertiaTensor);
}
Matrix3 RigidBody::getInertiaTensor() const
{
Matrix3 it;
getInertiaTensor(&it);
return it;
}
void RigidBody::getInertiaTensorWorld(Matrix3 *inertiaTensor) const
{
inertiaTensor->setInverse(inverseInertiaTensorWorld);
}
Matrix3 RigidBody::getInertiaTensorWorld() const
{
Matrix3 it;
getInertiaTensorWorld(&it);
return it;
}
void RigidBody::setInverseInertiaTensor(const Matrix3 &inverseInertiaTensor)
{
_checkInverseInertiaTensor(inverseInertiaTensor);
RigidBody::inverseInertiaTensor = inverseInertiaTensor;
}
void RigidBody::getInverseInertiaTensor(Matrix3 *inverseInertiaTensor) const
{
*inverseInertiaTensor = RigidBody::inverseInertiaTensor;
}
Matrix3 RigidBody::getInverseInertiaTensor() const
{
return inverseInertiaTensor;
}
void RigidBody::getInverseInertiaTensorWorld(Matrix3 *inverseInertiaTensor) const
{
*inverseInertiaTensor = inverseInertiaTensorWorld;
}
Matrix3 RigidBody::getInverseInertiaTensorWorld() const
{
return inverseInertiaTensorWorld;
}
void RigidBody::setDamping(const real linearDamping,
const real angularDamping)
{
RigidBody::linearDamping = linearDamping;
RigidBody::angularDamping = angularDamping;
}
void RigidBody::setLinearDamping(const real linearDamping)
{
RigidBody::linearDamping = linearDamping;
}
real RigidBody::getLinearDamping() const
{
return linearDamping;
}
void RigidBody::setAngularDamping(const real angularDamping)
{
RigidBody::angularDamping = angularDamping;
}
real RigidBody::getAngularDamping() const
{
return angularDamping;
}
void RigidBody::setPosition(const Vector3 &position)
{
RigidBody::position = position;
}
void RigidBody::setPosition(const real x, const real y, const real z)
{
position.x = x;
position.y = y;
position.z = z;
}
void RigidBody::getPosition(Vector3 *position) const
{
*position = RigidBody::position;
}
Vector3 RigidBody::getPosition() const
{
return position;
}
void RigidBody::setOrientation(const Quaternion &orientation)
{
RigidBody::orientation = orientation;
RigidBody::orientation.normalise();
}
void RigidBody::setOrientation(const real r, const real i,
const real j, const real k)
{
orientation.r = r;
orientation.i = i;
orientation.j = j;
orientation.k = k;
orientation.normalise();
}
void RigidBody::getOrientation(Quaternion *orientation) const
{
*orientation = RigidBody::orientation;
}
Quaternion RigidBody::getOrientation() const
{
return orientation;
}
void RigidBody::getOrientation(Matrix3 *matrix) const
{
getOrientation(matrix->data);
}
void RigidBody::getOrientation(real matrix[9]) const
{
matrix[0] = transformMatrix.data[0];
matrix[1] = transformMatrix.data[1];
matrix[2] = transformMatrix.data[2];
matrix[3] = transformMatrix.data[4];
matrix[4] = transformMatrix.data[5];
matrix[5] = transformMatrix.data[6];
matrix[6] = transformMatrix.data[8];
matrix[7] = transformMatrix.data[9];
matrix[8] = transformMatrix.data[10];
}
void RigidBody::getTransform(Matrix4 *transform) const
{
memcpy(transform, &transformMatrix.data, sizeof(Matrix4));
}
void RigidBody::getTransform(real matrix[16]) const
{
memcpy(matrix, transformMatrix.data, sizeof(real)*12);
matrix[12] = matrix[13] = matrix[14] = 0;
matrix[15] = 1;
}
void RigidBody::getGLTransform(float matrix[16]) const
{
matrix[0] = (float)transformMatrix.data[0];
matrix[1] = (float)transformMatrix.data[4];
matrix[2] = (float)transformMatrix.data[8];
matrix[3] = 0;
matrix[4] = (float)transformMatrix.data[1];
matrix[5] = (float)transformMatrix.data[5];
matrix[6] = (float)transformMatrix.data[9];
matrix[7] = 0;
matrix[8] = (float)transformMatrix.data[2];
matrix[9] = (float)transformMatrix.data[6];
matrix[10] = (float)transformMatrix.data[10];
matrix[11] = 0;
matrix[12] = (float)transformMatrix.data[3];
matrix[13] = (float)transformMatrix.data[7];
matrix[14] = (float)transformMatrix.data[11];
matrix[15] = 1;
}
Matrix4 RigidBody::getTransform() const
{
return transformMatrix;
}
Vector3 RigidBody::getPointInLocalSpace(const Vector3 &point) const
{
return transformMatrix.transformInverse(point);
}
Vector3 RigidBody::getPointInWorldSpace(const Vector3 &point) const
{
return transformMatrix.transform(point);
}
Vector3 RigidBody::getDirectionInLocalSpace(const Vector3 &direction) const
{
return transformMatrix.transformInverseDirection(direction);
}
Vector3 RigidBody::getDirectionInWorldSpace(const Vector3 &direction) const
{
return transformMatrix.transformDirection(direction);
}
void RigidBody::setVelocity(const Vector3 &velocity)
{
RigidBody::velocity = velocity;
}
void RigidBody::setVelocity(const real x, const real y, const real z)
{
velocity.x = x;
velocity.y = y;
velocity.z = z;
}
void RigidBody::getVelocity(Vector3 *velocity) const
{
*velocity = RigidBody::velocity;
}
Vector3 RigidBody::getVelocity() const
{
return velocity;
}
void RigidBody::addVelocity(const Vector3 &deltaVelocity)
{
velocity += deltaVelocity;
}
void RigidBody::setRotation(const Vector3 &rotation)
{
RigidBody::rotation = rotation;
}
void RigidBody::setRotation(const real x, const real y, const real z)
{
rotation.x = x;
rotation.y = y;
rotation.z = z;
}
void RigidBody::getRotation(Vector3 *rotation) const
{
*rotation = RigidBody::rotation;
}
Vector3 RigidBody::getRotation() const
{
return rotation;
}
void RigidBody::addRotation(const Vector3 &deltaRotation)
{
rotation += deltaRotation;
}
void RigidBody::setAwake(const bool awake)
{
if (awake) {
isAwake= true;
// Add a bit of motion to avoid it falling asleep immediately.
motion = sleepEpsilon*2.0f;
} else {
isAwake = false;
velocity.clear();
rotation.clear();
}
}
void RigidBody::setCanSleep(const bool canSleep)
{
RigidBody::canSleep = canSleep;
if (!canSleep && !isAwake) setAwake();
}
void RigidBody::getLastFrameAcceleration(Vector3 *acceleration) const
{
*acceleration = lastFrameAcceleration;
}
Vector3 RigidBody::getLastFrameAcceleration() const
{
return lastFrameAcceleration;
}
void RigidBody::clearAccumulators()
{
forceAccum.clear();
torqueAccum.clear();
}
void RigidBody::addForce(const Vector3 &force)
{
forceAccum += force;
isAwake = true;
}
void RigidBody::addForceAtBodyPoint(const Vector3 &force,
const Vector3 &point)
{
// Convert to coordinates relative to center of mass.
Vector3 pt = getPointInWorldSpace(point);
addForceAtPoint(force, pt);
isAwake = true;
}
void RigidBody::addForceAtPoint(const Vector3 &force,
const Vector3 &point)
{
// Convert to coordinates relative to center of mass.
Vector3 pt = point;
pt -= position;
forceAccum += force;
torqueAccum += pt % force;
isAwake = true;
}
void RigidBody::addTorque(const Vector3 &torque)
{
torqueAccum += torque;
isAwake = true;
}
void RigidBody::setAcceleration(const Vector3 &acceleration)
{
RigidBody::acceleration = acceleration;
}
void RigidBody::setAcceleration(const real x, const real y, const real z)
{
acceleration.x = x;
acceleration.y = y;
acceleration.z = z;
}
void RigidBody::getAcceleration(Vector3 *acceleration) const
{
*acceleration = RigidBody::acceleration;
}
Vector3 RigidBody::getAcceleration() const
{
return acceleration;
}
| {
"content_hash": "72ddb381e22e0f3b0ae38e39b799c4a3",
"timestamp": "",
"source": "github",
"line_count": 586,
"max_line_length": 81,
"avg_line_length": 26.52730375426621,
"alnum_prop": 0.6408491476358957,
"repo_name": "ofx/advanced-physics",
"id": "a558bb04fde283e9b19a02ce50c21d90243a0383",
"size": "15871",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/body.cpp",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "56793"
},
{
"name": "C++",
"bytes": "349613"
}
],
"symlink_target": ""
} |
#import "GetHomeTimelineFunction.h"
#import <AIRExtHelpers/MPFREObjectUtils.h>
#import "AIRTwitter.h"
#import "StatusUtils.h"
#import "AIRTwitterEvent.h"
#import <AIRExtHelpers/MPStringUtils.h>
FREObject tw_getHomeTimeline( FREContext context, void* functionData, uint32_t argc, FREObject* argv ) {
NSString* count = [NSString stringWithFormat:@"%d", [MPFREObjectUtils getInt:argv[0]]];
NSString* sinceID = (argv[1] == nil) ? nil : [MPFREObjectUtils getNSString:argv[1]];
NSString* maxID = (argv[2] == nil) ? nil : [MPFREObjectUtils getNSString:argv[2]];
NSNumber* excludeReplies = @([MPFREObjectUtils getBOOL:argv[3]]);
int callbackID = [MPFREObjectUtils getInt:argv[4]];
[[[AIRTwitter sharedInstance] api] getStatusesHomeTimelineWithCount:count
sinceID:sinceID
maxID:maxID
trimUser:@(0)
excludeReplies:excludeReplies
contributorDetails:nil
includeEntities:nil
useExtendedTweetMode:nil
successBlock:^(NSArray *statuses) {
[StatusUtils dispatchStatuses:statuses callbackID:callbackID];
} errorBlock:^(NSError *error) {
[AIRTwitter log:[NSString stringWithFormat:@"Home timeline error: %@", error.localizedDescription]];
[AIRTwitter dispatchEvent:TIMELINE_QUERY_ERROR withMessage:[MPStringUtils getEventErrorJSONString:callbackID errorMessage:error.localizedDescription]];
}];
return nil;
}
| {
"content_hash": "df62423fe44d1c02eb4f214b1e1e15f0",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 214,
"avg_line_length": 65.6875,
"alnum_prop": 0.4862036156041865,
"repo_name": "marpies/AIRTwitter-ANE",
"id": "03ec00c05594d320474ff86aa46485b2e889d108",
"size": "2725",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ios/AIRTwitter/Functions/GetHomeTimelineFunction.m",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ActionScript",
"bytes": "74143"
},
{
"name": "C",
"bytes": "19796"
},
{
"name": "Java",
"bytes": "100675"
},
{
"name": "Objective-C",
"bytes": "685001"
}
],
"symlink_target": ""
} |
This tool is useful for managing the array in a text column in any database (mysql, sqlite and etc). This tool also does sensible update upon object save/create. please see the usage below.
## Installation
Add this line to your application's Gemfile:
gem 'act_as_serializable'
And then execute:
$ bundle
Or install it yourself as:
$ gem install act_as_serializable
## Usage
in model, for any text column for which you want it to act as array column
mention:
act_as_serializable [:col1]
for mutiple columns:
act_as_serializable [:col1, :col2]
## Contributing
1. Fork it ( https://github.com/pavanagrawal/act_as_serializable/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request
act_as_serializable
| {
"content_hash": "aad931ea9478d8de01b59c5b47dfcc7e",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 189,
"avg_line_length": 24,
"alnum_prop": 0.7376126126126126,
"repo_name": "pavanagrawal/act_as_serializable",
"id": "6cf287bc0c69fe115d8235e409ccab8bcb7e4a4d",
"size": "909",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "1952"
}
],
"symlink_target": ""
} |
import '@isrd-isi-edu/chaise/src/assets/scss/_login-app.scss';
import { useEffect, useRef, useState } from 'react';
import { createRoot } from 'react-dom/client';
// components
import ChaiseTooltip from '@isrd-isi-edu/chaise/src/components/tooltip';
import ChaiseSpinner from '@isrd-isi-edu/chaise/src/components/spinner';
import AppWrapper from '@isrd-isi-edu/chaise/src/components/app-wrapper';
// hooks
import useAuthn from '@isrd-isi-edu/chaise/src/hooks/authn';
// models
import { LogActions } from '@isrd-isi-edu/chaise/src/models/log';
// services
import { ConfigService } from '@isrd-isi-edu/chaise/src/services/config';
// utilities
import { validateTermsAndConditionsConfig } from '@isrd-isi-edu/chaise/src/utils/config-utils';
import { queryStringToJSON } from '@isrd-isi-edu/chaise/src/utils/uri-utils';
import { ID_NAMES } from '@isrd-isi-edu/chaise/src/utils/constants';
const loginSettings = {
appName: 'login',
appTitle: 'Login',
overrideHeadTitle: true,
overrideDownloadClickBehavior: false,
overrideExternalLinkBehavior: false
};
export type loginForm = {
username: string,
password: string
}
const LoginPopupApp = (): JSX.Element => {
const cc = ConfigService.chaiseConfig;
const { logoutWithoutRedirect, refreshLogin, session } = useAuthn();
const [showInstructions, setShowInstructions] = useState(false);
const [showSpinner, setShowSpinner] = useState(false);
// since we're using strict mode, the useEffect is getting called twice in dev mode
// this is to guard against it
const setupStarted = useRef<boolean>(false);
useEffect(() => {
if (setupStarted.current) return;
setupStarted.current = true;
const validConfig = validateTermsAndConditionsConfig(cc.termsAndConditionsConfig);
let hasGroup = false;
// only check if the user has the group if the config is valid
if (validConfig && session) {
// if the user does have the defined group, continue with auto close and reload of the application
hasGroup = session.attributes.filter(function (attr) {
return attr.id === cc.termsAndConditionsConfig.groupId;
}).length > 0;
}
// if the config is invalid, don't require group membership to continue automatically
if (!validConfig || hasGroup) {
const qString = queryStringToJSON(window.location.search);
if (qString.referrerid && (typeof qString.action === 'undefined') && window.opener) {
//For child window
window.opener.postMessage(window.location.search, window.opener.location.href);
// Create the user in 'user_profile" table with `onconflict=skip` if user exists already
// POST /ermrest/catalog/registry/entity/CFDE:user_profile?onconflict=skip
// Content-Type: application/json
//
// [
// {"id": "...", "display_name": "...", "full_name": "..."}
// ]
const userProfilePath = '/ermrest/catalog/registry/entity/CFDE:user_profile?onconflict=skip';
// if hasGroup is true, then session has to be defined
if (validConfig && session) {
const rows = [{
'id': session.client.id,
'display_name': session.client.display_name,
'full_name': session.client.full_name
}]
// we only want to force adding to this group if the termsAndConditionsConfig is defined
// TODO: this should be it's own configuration property
// - should it be part of termsAndConditionsConfig
// - or it's own property since this could be for a separate feature request
// - (having user profiles but not require a specific globus group for login)
ConfigService.http.post(window.location.origin + userProfilePath, rows).then((response: any) => {
window.close();
}).catch((error: any) => {
// NOTE: this should almost never happen
// will happen in any deployment that turns this feature on before we rework the
// property definition to include the "userProfile Path" as a configuration property
// if a user reports this hanging around, we need to identify what error caused it
// should be easy since the error will be logged with context pointing to login I believe
console.log(error);
console.log('error creating user');
});
} else {
window.close();
}
}
} else {
// show the instructions if the user doesn't have the required group
setShowInstructions(!hasGroup);
// if this login process is used for verifying group membership, that group is REQUIRED to have an active login
// log the user out if they don't have the group
logoutWithoutRedirect(LogActions.VERIFY_GLOBUS_GROUP_LOGOUT);
}
}, []);
const reLogin = () => {
setShowSpinner(true);
refreshLogin(LogActions.VERIFY_GLOBUS_GROUP_LOGIN).then((redirectUrl: any) => {
setShowSpinner(false);
window.location = redirectUrl;
});
}
const renderInstructions = () => {
if (!showInstructions) return;
const groupName = '"' + cc.termsAndConditionsConfig.groupName + '"';
return (
<div className='login-container main-container'>
<h2>Sign up for personalized dashboard features</h2>
<p>To access the personalized dashboard features, membership in the {groupName} group is required. Click the <b>Sign Up </b>
button to join the group. Using the <b>Sign Up</b> button will open a Globus group enrollment page in a separate tab or window.
After completing enrollment on that page, come back and click the <b>Proceed</b> button to begin using the new features of this site.
</p>
<div className='btn-container'>
<ChaiseTooltip
placement='bottom-start'
tooltip={<>Click to sign up for {cc.termsAndConditionsConfig.groupName}.</>}
>
<a className='chaise-btn chaise-btn-primary'
href={cc.termsAndConditionsConfig.joinUrl}
target='_blank'
rel='noreferrer'>Sign Up
</a>
</ChaiseTooltip>
<ChaiseTooltip
placement='bottom-start'
tooltip='Click to proceed to the application after joining the group.'
>
<button className='chaise-btn chaise-btn-secondary'
onClick={() => reLogin()}
>Proceed
</button>
</ChaiseTooltip>
</div>
{showSpinner && <ChaiseSpinner />}
</div>
)
}
return (
<div className='app-container container-fluid row'>
{renderInstructions()}
</div>
);
};
const root = createRoot(document.getElementById(ID_NAMES.APP_ROOT) as HTMLElement);
root.render(
<AppWrapper appSettings={loginSettings} displaySpinner>
<LoginPopupApp />
</AppWrapper>
);
| {
"content_hash": "77e4b7eee24e9170fa7dff53fc7f8b18",
"timestamp": "",
"source": "github",
"line_count": 177,
"max_line_length": 143,
"avg_line_length": 39.067796610169495,
"alnum_prop": 0.6523499638467101,
"repo_name": "informatics-isi-edu/chaise",
"id": "1a5394b0cb1d33a775d588293a9c6d7d43f6d4b0",
"size": "6915",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/pages/login.tsx",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "136403"
},
{
"name": "JavaScript",
"bytes": "1937768"
},
{
"name": "Makefile",
"bytes": "23217"
},
{
"name": "SCSS",
"bytes": "219639"
},
{
"name": "Shell",
"bytes": "1941"
},
{
"name": "TypeScript",
"bytes": "695585"
}
],
"symlink_target": ""
} |
"use strict";
var path = require("path");
var spawn = require("child_process").spawn;
// Requires and node configuration
var DEBUG = require('debug')('accounts')
var node = require("./../variables.js")
// Account info for password "sebastian"
var Saccount = {
"address": "A3Umvpy4vt8kcbZFUhViFr3RyhZYVLDxhi",
"publicKey": "fbd20d4975e53916488791477dd38274c1b4ec23ad322a65adb171ec2ab6a0dc",
"password": "sebastian",
"name": "sebastian",
"balance": 0
};
describe("POST /accounts/open", function () {
it("Using valid passphrase: " + Saccount.password + ". Should be ok", async function () {
var res = await node.openAccountAsync({ secret: Saccount.password })
DEBUG('open account response', res.body)
node.expect(res.body).to.have.property("success").to.be.true;
node.expect(res.body).to.have.property("account").that.is.an("object");
node.expect(res.body.account.address).to.equal(Saccount.address);
node.expect(res.body.account.publicKey).to.equal(Saccount.publicKey);
Saccount.balance = res.body.account.balance;
});
it("Using empty json. Should fail", async function () {
var res = await node.openAccountAsync({})
node.expect(res.body).to.have.property("success").to.be.false;
node.expect(res.body).to.have.property("error");
});
it("Using empty passphrase. Should fail", async function () {
var res = await node.openAccountAsync({ secoret: '' })
node.expect(res.body).to.have.property("success").to.be.false;
node.expect(res.body).to.have.property("error");
});
it("Using invalid json. Should fail", async function () {
var res = await node.openAccountAsync("{\"invalid\"}")
node.expect(res.body).to.have.property("success").to.be.false;
node.expect(res.body).to.have.property("error");
});
});
describe("GET /accounts/getBalance", function () {
it("Using valid params. Should be ok", function (done) {
node.api.get("/accounts/getBalance?address=" + Saccount.address)
.set("Accept", "application/json")
.expect("Content-Type", /json/)
.expect(200)
.end(function (err, res) {
// console.log(JSON.stringify(res.body));
node.expect(res.body).to.have.property("success").to.be.true;
node.expect(res.body).to.have.property("balance");
node.expect(res.body.balance).to.equal(Saccount.balance);
done();
});
});
it("Using invalid address. Should fail", function (done) {
node.api.get("/accounts/getBalance?address=thisIsNOTAAschAddress")
.set("Accept", "application/json")
.expect("Content-Type", /json/)
.expect(200)
.end(function (err, res) {
node.expect(res.body).to.have.property("success").to.be.false;
node.expect(res.body).to.have.property("error");
done();
});
});
it("Using no address. Should fail", function (done) {
node.api.get("/accounts/getBalance")
.set("Accept", "application/json")
.expect("Content-Type", /json/)
.expect(200)
.end(function (err, res) {
node.expect(res.body).to.have.property("success").to.be.false;
node.expect(res.body).to.have.property("error");
done();
});
});
});
describe("GET /accounts/getPublicKey", function () {
it("Using valid address. Should be ok", function (done) {
node.api.get("/accounts/getPublicKey?address=" + Saccount.address)
.set("Accept", "application/json")
.expect("Content-Type", /json/)
.expect(200)
.end(function (err, res) {
// console.log(JSON.stringify(res.body));
node.expect(res.body).to.have.property("success").to.be.true;
node.expect(res.body).to.have.property("publicKey");
node.expect(res.body.publicKey).to.equal(Saccount.publicKey);
done();
});
});
it("Using invalid address. Should fail", function (done) {
node.api.get("/accounts/getPublicKey?address=thisIsNOTAAschAddress")
.set("Accept", "application/json")
.expect("Content-Type", /json/)
.expect(200)
.end(function (err, res) {
// console.log(JSON.stringify(res.body));
node.expect(res.body).to.have.property("success").to.be.false;
node.expect(res.body).to.have.property("error");
// expect(res.body.error).to.contain("Provide valid Asch address");
done();
});
});
it("Using no address. Should fail", function (done) {
node.api.get("/accounts/getPublicKey?address=")
.set("Accept", "application/json")
.expect("Content-Type", /json/)
.expect(200)
.end(function (err, res) {
// console.log(JSON.stringify(res.body));
node.expect(res.body).to.have.property("success").to.be.false;
node.expect(res.body).to.have.property("error");
// expect(res.body.error).to.contain("Provide valid Asch address");
done();
});
});
it("Using valid params. Should be ok", function (done) {
node.api.post("/accounts/generatePublicKey")
.set("Accept", "application/json")
.send({
secret: Saccount.password
})
.expect("Content-Type", /json/)
.expect(200)
.end(function (err, res) {
// console.log(JSON.stringify(res.body));
node.expect(res.body).to.have.property("success").to.be.true;
node.expect(res.body).to.have.property("publicKey");
node.expect(res.body.publicKey).to.equal(Saccount.publicKey);
done();
});
});
});
describe("POST /accounts/generatePublicKey", function () {
it("Using empty passphrase. Should fail", function (done) {
node.api.post("/accounts/generatePublicKey")
.set("Accept", "application/json")
.send({
secret: ""
})
.expect("Content-Type", /json/)
.expect(200)
.end(function (err, res) {
// console.log(JSON.stringify(res.body));
node.expect(res.body).to.have.property("success").to.be.false;
node.expect(res.body).to.have.property("error");
// node.expect(res.body.error).to.contain("Provide secret key");
done();
});
});
it("Using no params. Should fail", function (done) {
node.api.post("/accounts/generatePublicKey")
.set("Accept", "application/json")
.send({})
.expect("Content-Type", /json/)
.expect(200)
.end(function (err, res) {
// console.log(JSON.stringify(res.body));
node.expect(res.body).to.have.property("success").to.be.false;
node.expect(res.body).to.have.property("error");
// node.expect(res.body.error).to.contain("Provide secret key");
done();
});
});
it("Using invalid json. Should fail", function (done) {
node.api.post("/accounts/generatePublicKey")
.set("Accept", "application/json")
.send("{\"invalid\"}")
.expect("Content-Type", /json/)
.expect(200)
.end(function (err, res) {
// console.log(JSON.stringify(res.body));
node.expect(res.body).to.have.property("success").to.be.false;
node.expect(res.body).to.have.property("error");
// node.expect(res.body.error).to.contain("Provide secret key");
done();
});
});
});
describe("GET /accounts?address=", function () {
it("Using valid address. Should be ok", function (done) {
node.api.get("/accounts?address=" + Saccount.address)
.set("Accept", "application/json")
.expect("Content-Type", /json/)
.expect(200)
.end(function (err, res) {
// console.log(JSON.stringify(res.body));
node.expect(res.body).to.have.property("success").to.be.true;
node.expect(res.body).to.have.property("account").that.is.an("object");
node.expect(res.body.account.address).to.equal(Saccount.address);
node.expect(res.body.account.publicKey).to.equal(Saccount.publicKey);
node.expect(res.body.account.balance).to.equal(Saccount.balance);
done();
});
});
it("Using invalid address. Should fail", function (done) {
node.api.get("/accounts?address=thisIsNOTAValidAschAddress")
.set("Accept", "application/json")
.expect("Content-Type", /json/)
.expect(200)
.end(function (err, res) {
// console.log(JSON.stringify(res.body));
node.expect(res.body).to.have.property("success").to.be.false;
node.expect(res.body).to.have.property("error");
// expect(res.body.error).to.contain("Provide valid Asch address");
done();
});
});
it("Using empty address. Should fail", function (done) {
node.api.get("/accounts?address=")
.set("Accept", "application/json")
.expect("Content-Type", /json/)
.expect(200)
.end(function (err, res) {
// console.log(JSON.stringify(res.body));
node.expect(res.body).to.have.property("success").to.be.false;
node.expect(res.body).to.have.property("error");
// node.expect(res.body.error).to.contain("Provide address in url");
done();
});
});
});
| {
"content_hash": "21a73c3dce3b52ef13dada5084863af0",
"timestamp": "",
"source": "github",
"line_count": 248,
"max_line_length": 93,
"avg_line_length": 40.903225806451616,
"alnum_prop": 0.5488958990536278,
"repo_name": "anshuman-singh-93/agrichain",
"id": "394bfca60e4cd63bd5b25a0a1d5073bfe99be1ad",
"size": "10144",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "test/lib/accounts.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "74921"
},
{
"name": "HTML",
"bytes": "129853"
},
{
"name": "JavaScript",
"bytes": "4073080"
},
{
"name": "Protocol Buffer",
"bytes": "3449"
},
{
"name": "Shell",
"bytes": "18744"
}
],
"symlink_target": ""
} |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('stein', '0069_photograph_audio_duration'),
]
operations = [
migrations.AddField(
model_name='photograph',
name='overlay',
field=models.TextField(blank=True, default='', verbose_name='overlay'),
),
migrations.AddField(
model_name='photograph',
name='scale_factor',
field=models.FloatField(default=0.0, blank=True, verbose_name='World to pixel scale'),
),
]
| {
"content_hash": "4d1839617c055d016ca79360267d8bf1",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 98,
"avg_line_length": 27.952380952380953,
"alnum_prop": 0.5826235093696763,
"repo_name": "GeoMatDigital/django-geomat",
"id": "3c5e2a8dccba78de78f5e63a8a16bb2b363ea7c5",
"size": "636",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "geomat/stein/migrations/0070_scale_factor_and_overlay.py",
"mode": "33261",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "16597"
},
{
"name": "Dockerfile",
"bytes": "1091"
},
{
"name": "HTML",
"bytes": "14474"
},
{
"name": "JavaScript",
"bytes": "31354"
},
{
"name": "Makefile",
"bytes": "371"
},
{
"name": "Python",
"bytes": "197468"
},
{
"name": "Shell",
"bytes": "674"
}
],
"symlink_target": ""
} |
class OffsetInputSource: public InputSource
{
public:
OffsetInputSource(
std::shared_ptr<InputSource>, qpdf_offset_t global_offset);
virtual ~OffsetInputSource() = default;
virtual qpdf_offset_t findAndSkipNextEOL();
virtual std::string const& getName() const;
virtual qpdf_offset_t tell();
virtual void seek(qpdf_offset_t offset, int whence);
virtual void rewind();
virtual size_t read(char* buffer, size_t length);
virtual void unreadCh(char ch);
private:
std::shared_ptr<InputSource> proxied;
qpdf_offset_t global_offset;
qpdf_offset_t max_safe_offset;
};
#endif // QPDF_OFFSETINPUTSOURCE_HH
| {
"content_hash": "e019346366a6d35547c24ffc11e6f5bf",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 67,
"avg_line_length": 29.90909090909091,
"alnum_prop": 0.7021276595744681,
"repo_name": "jberkenbilt/qpdf",
"id": "d8b08145695bfd9eb55d39b657b775ccf0f7af20",
"size": "886",
"binary": false,
"copies": "2",
"ref": "refs/heads/work",
"path": "libqpdf/qpdf/OffsetInputSource.hh",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "567"
},
{
"name": "C",
"bytes": "262194"
},
{
"name": "C++",
"bytes": "2250157"
},
{
"name": "CMake",
"bytes": "44563"
},
{
"name": "CSS",
"bytes": "128"
},
{
"name": "Dockerfile",
"bytes": "942"
},
{
"name": "Emacs Lisp",
"bytes": "1081"
},
{
"name": "Hack",
"bytes": "7243"
},
{
"name": "Perl",
"bytes": "410688"
},
{
"name": "PostScript",
"bytes": "2997"
},
{
"name": "Python",
"bytes": "54224"
},
{
"name": "Raku",
"bytes": "773"
},
{
"name": "Roff",
"bytes": "2272"
},
{
"name": "Shell",
"bytes": "48697"
}
],
"symlink_target": ""
} |
package com.gurkensalat.osm.mosques.service;
/**
* Empty marker interface to make this package visible.
*/
public interface GeocodingServiceComponentScanMarker
{
}
| {
"content_hash": "fdabac0d4e3c4f1712431f9fe82f558b",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 55,
"avg_line_length": 20.875,
"alnum_prop": 0.7904191616766467,
"repo_name": "osmmosques/osm-mosques",
"id": "9f816f4c751e68204799ee8ec68b49c950851029",
"size": "167",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "osm-mosque-geocoding-service/src/main/java/com/gurkensalat/osm/mosques/service/GeocodingServiceComponentScanMarker.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "2670"
},
{
"name": "Dockerfile",
"bytes": "2026"
},
{
"name": "HTML",
"bytes": "45179"
},
{
"name": "Java",
"bytes": "190753"
},
{
"name": "JavaScript",
"bytes": "27197"
},
{
"name": "Shell",
"bytes": "2415"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Linq;
using Hanoi.Serialization.Extensions.SimpleCommunicationsBlocking;
using Hanoi.Serialization.InstantMessaging.Client;
using Hanoi.Serialization.InstantMessaging.Presence;
using Hanoi.Serialization.InstantMessaging.Roster;
namespace Hanoi.Xmpp.InstantMessaging
{
public sealed class Contact
{
private readonly Jid _contactId;
private readonly Session _session;
private readonly object _syncObject;
private string _displayName;
private List<string> _groups;
private string _name;
private List<ContactResource> _resources;
private ContactSubscriptionType _subscription;
internal Contact(Session session, string contactId, string name, ContactSubscriptionType subscription, IList<string> groups)
{
_session = session;
_syncObject = new object();
_contactId = contactId;
_resources = new List<ContactResource>();
RefreshData(name, subscription, groups);
AddDefaultResource();
}
public Jid ContactId
{
get { return _contactId; }
}
public string Name
{
get { return _name; }
private set
{
if (_name == value)
return;
_name = value;
_session.OnContactMessage(this);
}
}
public List<string> Groups
{
get { return _groups ?? (_groups = new List<string>()); }
}
public string DisplayName
{
get { return _displayName; }
set
{
if (_displayName == value)
return;
_displayName = !string.IsNullOrEmpty(value) ? value : _contactId.UserName;
Update();
_session.OnContactMessage(this);
}
}
public IEnumerable<ContactResource> Resources
{
get { return _resources ?? (_resources = new List<ContactResource>()); }
}
public ContactSubscriptionType Subscription
{
get { return _subscription; }
set
{
if (_subscription == value)
return;
_subscription = value;
_session.OnContactMessage(this);
}
}
public ContactResource Resource
{
get { return GetResource(); }
}
public ContactPresence Presence
{
get { return GetResource().Presence; }
}
//TODO: Implement indicator if contact supports file transfer
public bool SupportsFileTransfer
{
get { throw new NotImplementedException(); }
}
public bool SupportsConference
{
get { return (Resource.Capabilities.Features.Where(f => f.Name == Features.MultiUserChat).Count() > 0); }
}
public bool SupportsChatStateNotifications
{
get
{
return
(Resource.Capabilities.Features.Where(f => f.Name == Features.ChatStateNotifications).Count() >
0);
}
}
public void AddToGroup(string groupName)
{
var iq = new IQ();
var query = new RosterQuery();
var item = new RosterItem();
if (!Groups.Contains(groupName))
{
Groups.Add(groupName);
}
iq.Type = IQType.Set;
item.Jid = ContactId.BareIdentifier;
item.Name = Name;
item.Subscription = (RosterSubscriptionType)Subscription;
item.Groups.Add(groupName);
query.Items.Add(item);
iq.Items.Add(query);
_session.Send(iq);
}
public void Update()
{
var iq = new IQ();
var query = new RosterQuery();
var item = new RosterItem();
iq.Type = IQType.Set;
item.Jid = ContactId.BareIdentifier;
item.Name = DisplayName;
item.Subscription = (RosterSubscriptionType)Subscription;
item.Groups.AddRange(Groups);
query.Items.Add(item);
iq.Items.Add(query);
_session.Send(iq);
}
public void RequestSubscription()
{
_session.Presence.RequestSubscription(ContactId);
}
public void Block()
{
if (_session.ServiceDiscovery.SupportsBlocking)
{
var iq = new IQ
{
ID = IdentifierGenerator.Generate(),
From = _session.UserId,
Type = IQType.Set
};
var block = new Block();
block.Items.Add
(
new BlockItem
{
Jid = ContactId.BareIdentifier
}
);
iq.Items.Add(block);
_session.Send(iq);
}
}
/// <summary>
/// Unblock contact.
/// </summary>
public void UnBlock()
{
if (!_session.ServiceDiscovery.SupportsBlocking)
return;
var iq = new IQ
{
ID = IdentifierGenerator.Generate(),
From = _session.UserId,
Type = IQType.Set
};
var unBlock = new UnBlock();
unBlock.Items.Add
(
new BlockItem
{
Jid = ContactId.BareIdentifier
}
);
iq.Items.Add(unBlock);
_session.Send(iq);
}
public override string ToString()
{
return ContactId.ToString();
}
internal void AddDefaultResource()
{
var defaultPresence = new Serialization.InstantMessaging.Presence.Presence();
var contactResource = new ContactResource(_session, this, ContactId);
var resourceJid = new Jid(_contactId.UserName, ContactId.DomainName, Guid.NewGuid().ToString());
// Add a default resource
defaultPresence.TypeSpecified = true;
defaultPresence.From = resourceJid;
defaultPresence.Type = PresenceType.Unavailable;
defaultPresence.Items.Add(ContactResource.DefaultPresencePriorityValue);
contactResource.Update(defaultPresence);
_resources.Add(contactResource);
}
internal void RefreshData(string name, ContactSubscriptionType subscription, IList<string> groups)
{
Name = (name ?? string.Empty);
_displayName = !string.IsNullOrEmpty(Name) ? _name : _contactId.UserName;
Subscription = subscription;
if (groups != null && groups.Count > 0)
{
Groups.AddRange(groups);
}
else
{
Groups.Add("Contacts");
}
_session.OnContactMessage(this);
}
internal void UpdatePresence(Jid jid, Serialization.InstantMessaging.Presence.Presence presence)
{
lock (_syncObject)
{
var resource = _resources
.Where(contactResource => contactResource.ResourceId.Equals(jid))
.SingleOrDefault();
if (resource == null)
{
resource = new ContactResource(_session, this, jid);
_resources.Add(resource);
}
resource.Update(presence);
if (!resource.IsDefaultResource && resource.Presence.PresenceStatus == PresenceState.Offline)
_resources.Remove(resource);
_session.OnContactMessage(this);
}
}
private ContactResource GetResource()
{
var q = from resource in _resources
orderby resource.Presence.Priority descending
select resource;
return q.FirstOrDefault();
}
}
} | {
"content_hash": "48bf91b08912e4b85038e18a6612c59e",
"timestamp": "",
"source": "github",
"line_count": 304,
"max_line_length": 132,
"avg_line_length": 28.24342105263158,
"alnum_prop": 0.49580712788259956,
"repo_name": "MustafaUzumcuCom/Hanoi",
"id": "997940998f9358afe3f093ff8d93e0a7b427c411",
"size": "10208",
"binary": false,
"copies": "1",
"ref": "refs/heads/brendan-testability",
"path": "source/Hanoi/Xmpp/InstantMessaging/Contact.cs",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
// -----------------------------------------------------------------------
// <copyright file="InMemoryProviderState.cs" company="Asynkron HB">
// Copyright (C) 2015-2017 Asynkron HB All rights reserved
// </copyright>
// -----------------------------------------------------------------------
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Proto.Persistence
{
internal class InMemoryProviderState : IProviderState
{
private readonly ConcurrentDictionary<string, List<object>> _events = new ConcurrentDictionary<string, List<object>>();
private readonly IDictionary<string, Tuple<object, ulong>> _snapshots =
new Dictionary<string, Tuple<object, ulong>>();
public void Restart()
{
}
public int GetSnapshotInterval()
{
return 0;
}
public Task<Tuple<object, ulong>> GetSnapshotAsync(string actorName)
{
Tuple<object, ulong> snapshot;
_snapshots.TryGetValue(actorName, out snapshot);
return Task.FromResult(snapshot);
}
public Task GetEventsAsync(string actorName, ulong eventIndexStart, Action<object> callback)
{
List<object> events;
if (_events.TryGetValue(actorName, out events))
{
foreach (var e in events)
{
callback(e);
}
}
return Task.FromResult(0);
}
public Task PersistEventAsync(string actorName, ulong eventIndex, object @event)
{
var events = _events.GetOrAdd(actorName, new List<object>());
events.Add(@event);
return Task.FromResult(0);
}
public Task PersistSnapshotAsync(string actorName, ulong eventIndex, object snapshot)
{
_snapshots[actorName] = Tuple.Create((object) snapshot, eventIndex);
return Task.FromResult(0);
}
}
} | {
"content_hash": "fca1e7aba4b43d453319856e88159efc",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 127,
"avg_line_length": 33.109375,
"alnum_prop": 0.5394053798961774,
"repo_name": "cpx86/protoactor-dotnet",
"id": "4bac693ef3e4404d39a79df5dccf5172c16c404a",
"size": "2121",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Proto.Persistence/InMemoryProviderState.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "405"
},
{
"name": "C#",
"bytes": "238956"
},
{
"name": "PowerShell",
"bytes": "6109"
},
{
"name": "Protocol Buffer",
"bytes": "1480"
},
{
"name": "Shell",
"bytes": "2945"
}
],
"symlink_target": ""
} |
<?xml version="1.0"?>
<project default="sankaku" basedir=".">
<property name="compiler" value="../compiler.jar"/>
<property name="version" value="0.2.13"/>
<property name="dist" value="./dist"/>
<property name="concat" value="./concat"/>
<property name="src" value="./src"/>
<!--<property name="docs" value="../../docs"/>-->
<property name="doc2src" value="_build_tool/delaunay/src"/>
<property name="concatenated" value="${concat}/sankaku.js"/>
<property name="libs" value="../../libs"/>
<property name="examples" value="../../examples/libs"/>
<target name="sankaku">
<mkdir dir="${concat}" />
<mkdir dir="${dist}" />
<mkdir dir="${libs}" />
<!-- concat -->
<echo message="Building ${concatenated}" />
<filelist id="file-list" dir="${src}">
<file name="Sankaku.js"/>
<file name="events/EventDispatcher.js"/>
<file name="net/LoadImage.js"/>
<file name="util/FileSave.js"/>
<file name="util/Iro.js"/>
<file name="util/List.js"/>
<file name="util/Num.js"/>
<file name="util/Distribute.js"/>
<file name="geom/Vector2D.js"/>
<file name="geom/Triangle.js"/>
<file name="geom/Delaunay.js"/>
<!--<file name="geom/Point.js"/>-->
<!--<file name="geom/Matrix2D.js"/>-->
<file name="display/Object2D.js"/>
<file name="display/Scene.js"/>
<file name="display/Shape.js"/>
<file name="display/Circle.js"/>
<file name="display/Tripod.js"/>
<file name="display/Star.js"/>
<file name="display/Line.js"/>
<file name="display/Bitmap.js"/>
<file name="vehicle/Vehicle.js"/>
<file name="vehicle/SteeredVehicle.js"/>
<file name="vehicle/Wander.js"/>
<file name="vehicle/Flock.js"/>
<file name="vehicle/FollowPath.js"/>
<file name="render/Zanzo.js"/>
<file name="render/Inside.js"/>
</filelist>
<concat destfile="${concatenated}" encoding="UTF-8" outputencoding="UTF-8" fixlastline="true">
<filelist refid="file-list" />
</concat>
<apply executable="java" parallel="false" verbose="true" dest="${dist}">
<fileset dir="${concat}">
<include name="*.js" />
</fileset>
<arg line="-jar" />
<arg path="${compiler}" />
<arg value="--warning_level" />
<arg value="QUIET" />
<arg value="--js_output_file" />
<targetfile />
<arg value="--js" />
<mapper type="glob" from="*.js" to="*.min.js" />
</apply>
<!--version no-->
<copy todir="${dist}">
<fileset dir="${dist}" />
<mapper type="glob" from="sankaku.min.js" to="sankaku-${version}.min.js" />
</copy>
<copy todir="${libs}">
<fileset dir="${concat}" />
</copy>
<copy todir="${libs}">
<fileset dir="${dist}" />
</copy>
<!--examples-->
<copy todir="${examples}">
<fileset dir="${concat}" />
</copy>
<copy todir="${examples}">
<fileset dir="${dist}" />
</copy>
<exec executable="bash" dir="../../">
<arg value="-c" />
<arg value="yuidoc ${doc2src} -o ./docs" />
</exec>
</target>
</project>
| {
"content_hash": "70a6b86262de4b054d0e002ae0a67617",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 102,
"avg_line_length": 29.25409836065574,
"alnum_prop": 0.4841692350798543,
"repo_name": "taikiken/sankaku.js",
"id": "5fe248149744c8d1523f7a75e1df22f1a92ea51b",
"size": "3569",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "_build_tool/delaunay/build.xml",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "6260"
},
{
"name": "HTML",
"bytes": "460129"
},
{
"name": "JavaScript",
"bytes": "1111546"
},
{
"name": "Ruby",
"bytes": "5262"
}
],
"symlink_target": ""
} |
package br.com.delogic.jnerator.impl.generator;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Random;
import java.util.Set;
import br.com.delogic.jnerator.AttributeConfiguration;
import br.com.delogic.jnerator.AttributeGenerator;
import br.com.delogic.jnerator.InstanceGenerator;
import br.com.delogic.jnerator.util.ReflectionUtils;
public class ComplexTypeCollectionAttributeGenerator implements AttributeGenerator {
private final Field field;
private final InstanceGenerator<?> instanceGenerator;
private Random random = new Random();
public ComplexTypeCollectionAttributeGenerator(Field field, InstanceGenerator<?> attributeGenerator) {
this.field = field;
this.instanceGenerator = attributeGenerator;
}
public <T> Collection<?> generate(int index, AttributeConfiguration<T> attributeConfiguration, Object instance) {
Collection<Object> collection = createCollection(field);
for (int i = 0; i < 5; i++) {
collection.add(instanceGenerator.getCachedInstances().get(random.nextInt(instanceGenerator.getCachedInstances().size())));
}
return collection;
}
@SuppressWarnings("unchecked")
protected <E> Collection<E> createCollection(Field field) {
Class<Collection<E>> type = (Class<Collection<E>>) field.getType();
if (type.isInterface()) {
if (List.class.isAssignableFrom(type)) {
return new ArrayList<E>();
}
if (Set.class.isAssignableFrom(type)) {
return new HashSet<E>();
}
throw new IllegalArgumentException(
"Currently only List and Set are supported as Collection types. The following field is not supported:" + field);
}
return (Collection<E>) ReflectionUtils.instantiate(type);
}
}
| {
"content_hash": "fccd2f3669f2ebc8a50e4f62d22f4311",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 134,
"avg_line_length": 32.12903225806452,
"alnum_prop": 0.6807228915662651,
"repo_name": "celiosilva/jnerator",
"id": "8e4223e8103a31f268846772d40f31510421f8de",
"size": "1992",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/br/com/delogic/jnerator/impl/generator/ComplexTypeCollectionAttributeGenerator.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "175192"
}
],
"symlink_target": ""
} |
import numpy as N
import pylab as P
import os
def striplist(list):
return([x.strip() for x in list])
debug = True
dir = '/Users/Sammy/Research/field_ellipticals/mergertrees/'
dirfE = dir + 'IfEs/'
dirE = dir + 'Es/'
cmd = 'ls %s*.MergerTree'
temp = os.popen3(cmd % dirfE)
temp1 = os.popen3(cmd % dirE)
fElist = striplist(temp[1].readlines())
Elist = striplist(temp1[1].readlines())
fEresult = []
Eresult = []
for file in fElist:
data = N.loadtxt(file, delimiter = ',', comments='#', usecols=(3,10),
skiprows=45, dtype=[('redshift', float), ('STmass', float)])
data.sort(order = ('redshift', 'STmass'))
masslimit = data[0][1]*0.5
pos1 = 0
for rs1, ms1 in reversed(data):
stmass = ms1
redshift = rs1
pos1 += 1
pos2 = 0
for rs2, ms2 in reversed(data):
pos2 += 1
if pos1 != pos2 and rs1 == rs2:
stmass += ms2
if stmass > masslimit:
if debug:
print 'DEBUG: found redshift %f' % redshift
print 'DEBUG: halo: %s\nDEBUG: stmass: %f, required stmass: %f\n' % (file, stmass, masslimit)
fEresult.append(redshift)
break
for file in Elist:
data = N.loadtxt(file, delimiter = ',', comments='#', usecols=(3,10),
skiprows=45, dtype=[('redshift', float), ('STmass', float)])
data.sort(order = ('redshift', 'STmass'))
masslimit = data[0][1]*0.5
pos1 = 0
for rs1, ms1 in reversed(data):
stmass = ms1
redshift = rs1
pos1 += 1
pos2 = 0
for rs2, ms2 in reversed(data):
pos2 += 1
if pos1 != pos2 and rs1 == rs2:
stmass += ms2
if stmass > masslimit:
if debug:
print 'DEBUG: found redshift %f' % redshift
print 'DEBUG: halo: %s\nDEBUG: stmass: %f, required stmass: %f\n' % (file, stmass, masslimit)
Eresult.append(redshift)
break
#Writes the data
r1 = open('IfEFormation.time' ,'w')
r2 = open('EFormation.time', 'w')
for redshift in fEresult: r1.write(redshift + '\n')
for redshift in Eresult: r2.write(Eresult + '\n')
r1.close()
r2.close()
| {
"content_hash": "430f5d121e094baf7bde6fa5a27609bc",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 109,
"avg_line_length": 28.240506329113924,
"alnum_prop": 0.5486329000448229,
"repo_name": "sniemi/SamPy",
"id": "1986c55b8f198f6b45706c5f2acb8224ea4d1f34",
"size": "2231",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "sandbox/src1/formationTime.py",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "Batchfile",
"bytes": "296"
},
{
"name": "C",
"bytes": "68436"
},
{
"name": "C++",
"bytes": "45956"
},
{
"name": "CSS",
"bytes": "35570"
},
{
"name": "Fortran",
"bytes": "45191"
},
{
"name": "HTML",
"bytes": "107435"
},
{
"name": "IDL",
"bytes": "13651"
},
{
"name": "JavaScript",
"bytes": "25435"
},
{
"name": "Makefile",
"bytes": "26035"
},
{
"name": "Matlab",
"bytes": "1508"
},
{
"name": "Perl",
"bytes": "59198"
},
{
"name": "PostScript",
"bytes": "1403536"
},
{
"name": "Prolog",
"bytes": "16061"
},
{
"name": "Python",
"bytes": "5763358"
},
{
"name": "R",
"bytes": "208346"
},
{
"name": "Rebol",
"bytes": "161"
},
{
"name": "Roff",
"bytes": "73616"
},
{
"name": "Ruby",
"bytes": "2032"
},
{
"name": "Shell",
"bytes": "41512"
},
{
"name": "Tcl",
"bytes": "44150"
},
{
"name": "TeX",
"bytes": "107783"
}
],
"symlink_target": ""
} |
<!--
@license Apache-2.0
Copyright (c) 2018 The Stdlib Authors.
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.
-->
<!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, shrink-to-fit=no">
<title></title>
<style>
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
</style>
<style>
body {
box-sizing: border-box;
width: 100%;
padding: 40px;
}
#console {
width: 100%;
}
</style>
</head>
<body>
<p id="status">Running...</p>
<br>
<div id="console"></div>
<script type="text/javascript">
(function() {
'use strict';
// VARIABLES //
var methods = [
'log',
'error',
'warn',
'dir',
'debug',
'info',
'trace'
];
// MAIN //
/**
* Main.
*
* @private
*/
function main() {
var console;
var str;
var el;
var i;
// FIXME: IE9 has a non-standard `console.log` object (http://stackoverflow.com/questions/5538972/console-log-apply-not-working-in-ie9)
console = window.console || {};
for ( i = 0; i < methods.length; i++ ) {
console[ methods[ i ] ] = write;
}
el = document.querySelector( '#console' );
str = el.innerHTML;
/**
* Writes content to a DOM element. Note that this assumes a single argument and no substitution strings.
*
* @private
* @param {string} message - message
*/
function write( message ) {
str += '<p>'+message+'</p>';
el.innerHTML = str;
}
}
main();
})();
</script>
<script type="text/javascript" src="/docs/api/latest/@stdlib/assert/is-plain-object/benchmark_bundle.js"></script>
</body>
</html>
| {
"content_hash": "0b01442925a6183870cd550908c1258c",
"timestamp": "",
"source": "github",
"line_count": 150,
"max_line_length": 139,
"avg_line_length": 22.30666666666667,
"alnum_prop": 0.6228332337118948,
"repo_name": "stdlib-js/www",
"id": "d95870980732a6bef24746519ba33af098b2ffc6",
"size": "3346",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "public/docs/api/latest/@stdlib/assert/is-plain-object/benchmark.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "190538"
},
{
"name": "HTML",
"bytes": "158086013"
},
{
"name": "Io",
"bytes": "14873"
},
{
"name": "JavaScript",
"bytes": "5395746994"
},
{
"name": "Makefile",
"bytes": "40479"
},
{
"name": "Shell",
"bytes": "9744"
}
],
"symlink_target": ""
} |
package com.facebook.buck.ocaml;
import com.facebook.buck.graph.MutableDirectedGraph;
import com.facebook.buck.graph.TopologicalSort;
import com.facebook.buck.util.MoreCollectors;
import com.google.common.base.Preconditions;
import com.google.common.base.Splitter;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.List;
import java.util.stream.Stream;
import javax.annotation.Nullable;
/**
* Parse output of ocamldep tool and build dependency graph of ocaml source files (*.ml & *.mli)
*/
public class OcamlDependencyGraphGenerator {
private static final String OCAML_SOURCE_AND_DEPS_SEPARATOR = ":";
private static final String OCAML_DEPS_SEPARATOR = " ";
private static final String LINE_SEPARATOR =
Preconditions.checkNotNull(System.getProperty("line.separator"));
@Nullable
private MutableDirectedGraph<String> graph;
public ImmutableList<String> generate(String depToolOutput) {
parseDependencies(depToolOutput);
Preconditions.checkNotNull(graph);
final ImmutableList<String> sortedDeps = TopologicalSort.sort(graph);
// Two copies of dependencies as .cmo can map to .ml or .re
return Stream.concat(
sortedDeps.stream().map(input -> replaceObjExtWithSourceExt(input, false /* isReason */)),
sortedDeps.stream().map(input -> replaceObjExtWithSourceExt(input, true /* isReason */)))
.collect(MoreCollectors.toImmutableList());
}
private String replaceObjExtWithSourceExt(String name, boolean isReason) {
return name.replaceAll(
OcamlCompilables.OCAML_CMX_REGEX,
isReason ? OcamlCompilables.OCAML_RE : OcamlCompilables.OCAML_ML)
.replaceAll(
OcamlCompilables.OCAML_CMI_REGEX,
isReason ? OcamlCompilables.OCAML_REI : OcamlCompilables.OCAML_MLI);
}
public ImmutableMap<Path, ImmutableList<Path>> generateDependencyMap(
String depString) {
ImmutableMap.Builder<Path, ImmutableList<Path>> mapBuilder = ImmutableMap.builder();
Iterable<String> lines = Splitter.on(LINE_SEPARATOR).split(depString);
for (String line : lines) {
List<String> sourceAndDeps = Splitter.on(OCAML_SOURCE_AND_DEPS_SEPARATOR)
.trimResults().splitToList(line);
if (sourceAndDeps.size() >= 1) {
String sourceML = replaceObjExtWithSourceExt(sourceAndDeps.get(0), /* isReason */ false);
String sourceRE = replaceObjExtWithSourceExt(sourceAndDeps.get(0), /* isReason */ true);
if (sourceML.endsWith(OcamlCompilables.OCAML_ML) ||
sourceML.endsWith(OcamlCompilables.OCAML_MLI)) {
// Two copies of dependencies as .cmo can map to .ml or .re
ImmutableList<Path> dependencies = Splitter.on(OCAML_DEPS_SEPARATOR)
.trimResults()
.splitToList(sourceAndDeps.get(1))
.stream()
.filter(input -> !input.isEmpty())
.flatMap(input ->
Stream.of(
Paths.get(replaceObjExtWithSourceExt(input, /* isReason */ false)),
Paths.get(replaceObjExtWithSourceExt(input, /* isReason */ true))))
.collect(MoreCollectors.toImmutableList());
mapBuilder
.put(Paths.get(sourceML), dependencies)
.put(Paths.get(sourceRE), dependencies);
}
}
}
return mapBuilder.build();
}
private void parseDependencies(String stdout) {
graph = new MutableDirectedGraph<>();
Iterable<String> lines = Splitter.on(LINE_SEPARATOR).split(stdout);
for (String line : lines) {
List<String> sourceAndDeps = Splitter.on(OCAML_SOURCE_AND_DEPS_SEPARATOR)
.trimResults().splitToList(line);
if (sourceAndDeps.size() >= 1) {
String source = sourceAndDeps.get(0);
if (source.endsWith(OcamlCompilables.OCAML_CMX) || source.endsWith(
OcamlCompilables.OCAML_CMI)) {
addSourceDeps(sourceAndDeps, source);
}
}
}
}
private void addSourceDeps(List<String> sourceAndDeps, String source) {
Preconditions.checkNotNull(graph);
graph.addNode(source);
if (sourceAndDeps.size() >= 2) {
String deps = sourceAndDeps.get(1);
if (!deps.isEmpty()) {
List<String> dependencies = Splitter.on(OCAML_DEPS_SEPARATOR)
.trimResults().splitToList(deps);
for (String dep : dependencies) {
if (!dep.isEmpty()) {
graph.addEdge(source, dep);
}
}
}
}
}
}
| {
"content_hash": "75811443d44b296dc8a55d05ae479555",
"timestamp": "",
"source": "github",
"line_count": 120,
"max_line_length": 100,
"avg_line_length": 38.28333333333333,
"alnum_prop": 0.6695690030474531,
"repo_name": "grumpyjames/buck",
"id": "8d435cbf6326b0973255bee68223a21d6b951d51",
"size": "5199",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "src/com/facebook/buck/ocaml/OcamlDependencyGraphGenerator.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Assembly",
"bytes": "579"
},
{
"name": "Batchfile",
"bytes": "726"
},
{
"name": "C",
"bytes": "248531"
},
{
"name": "C#",
"bytes": "237"
},
{
"name": "C++",
"bytes": "6074"
},
{
"name": "CSS",
"bytes": "54863"
},
{
"name": "D",
"bytes": "1017"
},
{
"name": "Go",
"bytes": "14733"
},
{
"name": "Groff",
"bytes": "440"
},
{
"name": "Groovy",
"bytes": "3362"
},
{
"name": "HTML",
"bytes": "5353"
},
{
"name": "Haskell",
"bytes": "764"
},
{
"name": "IDL",
"bytes": "128"
},
{
"name": "Java",
"bytes": "14327718"
},
{
"name": "JavaScript",
"bytes": "931960"
},
{
"name": "Lex",
"bytes": "2591"
},
{
"name": "Makefile",
"bytes": "1791"
},
{
"name": "Matlab",
"bytes": "47"
},
{
"name": "OCaml",
"bytes": "3060"
},
{
"name": "Objective-C",
"bytes": "124321"
},
{
"name": "Objective-C++",
"bytes": "34"
},
{
"name": "PowerShell",
"bytes": "244"
},
{
"name": "Python",
"bytes": "388781"
},
{
"name": "Rust",
"bytes": "938"
},
{
"name": "Scala",
"bytes": "898"
},
{
"name": "Shell",
"bytes": "35303"
},
{
"name": "Smalltalk",
"bytes": "3653"
},
{
"name": "Standard ML",
"bytes": "15"
},
{
"name": "Swift",
"bytes": "3735"
},
{
"name": "Thrift",
"bytes": "2452"
},
{
"name": "Yacc",
"bytes": "323"
}
],
"symlink_target": ""
} |
layout: page
title: Joggling
permalink: /joggling/
tagline: "Entertainment"
category: "Joggling"
---
<p>
5-Ball 100m Record
<br>
<iframe width="800" height="480" src="https://www.youtube.com/embed/g18oD4SjaEs" frameborder="0" allowfullscreen></iframe>
<p>
<p>
5-Ball Mile Record
<br>
<iframe width="800" height="480" src="https://www.youtube.com/embed/hYjbu2Bbj88" frameborder="0" allowfullscreen></iframe>
<p>
5-Ball 400m Record
<br>
<iframe width="800" height="480" src="https://www.youtube.com/embed/Ww-E049yncY" frameborder="0" allowfullscreen></iframe>
<p>
5-Ball 5km Record
<br>
<iframe width="800" height="480" src="https://www.youtube.com/embed/Fs-m9RwzczY" frameborder="0" allowfullscreen></iframe>
<p>
Ian and Matt Butterfly Fest
<iframe width="800" height="480" src="https://www.youtube.com/embed/FGLRBEJfzeY" frameborder="0" allowfullscreen></iframe>
<p>
Juggle-07
<video id="Juggle-07" class="video-js vjs-default-skin" controls preload="none" width="800" height="480" frameborder="0" poster="http://mattfel1.github.io/joggling/poster.jpg" data-setup="{}">
<source src="https://www.dropbox.com/s/rxz2kixcgprjcsg/Juggle07-%20Acrylic%20is%20Forever.mp4?dl=1" type="video/mp4">
</video>
| {
"content_hash": "3057df26e43a86b2de889ecf168e172f",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 192,
"avg_line_length": 30.225,
"alnum_prop": 0.728701406120761,
"repo_name": "mattfel1/mattfel1.github.io",
"id": "ecf26d3ae098acdadb9e2dc634686892c1958be2",
"size": "1213",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "joggling/index.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "13659"
},
{
"name": "HTML",
"bytes": "11614"
}
],
"symlink_target": ""
} |
Dependencies
============
These are the dependencies currently used by DigiByte Core. You can find instructions for installing them in the `build-*.md` file for your platform.
| Dependency | Version used | Minimum required | CVEs | Shared | [Bundled Qt library](https://doc.qt.io/qt-5/configure-options.html#third-party-libraries) |
| --- | --- | --- | --- | --- | --- |
| Berkeley DB | [5.3.x](https://www.oracle.com/technetwork/database/database-technologies/berkeleydb/downloads/index.html) | 5.3.x | No | | |
| Boost | [1.70.0](https://www.boost.org/users/download/) | [1.47.0](https://github.com/bitcoin/bitcoin/pull/8920) | No | | |
| Clang | | [3.3+](https://releases.llvm.org/download.html) (C++11 support) | | | |
| Expat | [2.2.7](https://libexpat.github.io/) | | No | Yes | |
| fontconfig | [2.12.1](https://www.freedesktop.org/software/fontconfig/release/) | | No | Yes | |
| FreeType | [2.7.1](https://download.savannah.gnu.org/releases/freetype) | | No | | |
| GCC | | [4.8+](https://gcc.gnu.org/) (C++11 support) | | | |
| HarfBuzz-NG | | | | | |
| libevent | [2.1.8-stable](https://github.com/libevent/libevent/releases) | 2.0.22 | No | | |
| libpng | | | | | [Yes](https://github.com/aurarad/Auroracoin/blob/master/depends/packages/qt.mk) |
| librsvg | | | | | |
| MiniUPnPc | [2.0.20180203](http://miniupnp.free.fr/files) | | No | | |
| OpenSSL | [1.0.1k](https://www.openssl.org/source) | | Yes | | |
| PCRE | | | | | [Yes](https://github.com/aurarad/Auroracoin/blob/master/depends/packages/qt.mk) |
| protobuf | [2.6.1](https://github.com/google/protobuf/releases) | | No | | |
| Python (tests) | | [3.5](https://www.python.org/downloads) | | | |
| qrencode | [3.4.4](https://fukuchi.org/works/qrencode) | | No | | |
| Qt | [5.9.7](https://download.qt.io/official_releases/qt/) | [5.5.1](https://github.com/bitcoin/bitcoin/issues/13478) | No | | |
| XCB | | | | | [Yes](https://github.com/aurarad/Auroracoin/blob/master/depends/packages/qt.mk) (Linux only) |
| xkbcommon | | | | | [Yes](https://github.com/aurarad/Auroracoin/blob/master/depends/packages/qt.mk) (Linux only) |
| ZeroMQ | [4.3.1](https://github.com/zeromq/libzmq/releases) | 4.0.0 | No | | |
| zlib | [1.2.11](https://zlib.net/) | | | | No |
Controlling dependencies
------------------------
Some dependencies are not needed in all configurations. The following are some factors that affect the dependency list.
#### Options passed to `./configure`
* MiniUPnPc is not needed with `--with-miniupnpc=no`.
* Berkeley DB is not needed with `--disable-wallet`.
* protobuf is only needed with `--enable-bip70`.
* Qt is not needed with `--without-gui`.
* If the qrencode dependency is absent, QR support won't be added. To force an error when that happens, pass `--with-qrencode`.
* ZeroMQ is needed only with the `--with-zmq` option.
#### Other
* librsvg is only needed if you need to run `make deploy` on (cross-compilation to) macOS. | {
"content_hash": "6bc2c98fc30efa05fa7083d3c3fc98ff",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 156,
"avg_line_length": 67.93181818181819,
"alnum_prop": 0.6329876212780194,
"repo_name": "aurarad/auroracoin",
"id": "432dd316a934576452a02a07469ce5edfd26ebf0",
"size": "2989",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "doc/dependencies.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "721707"
},
{
"name": "C++",
"bytes": "3060648"
},
{
"name": "CSS",
"bytes": "1127"
},
{
"name": "Groff",
"bytes": "18860"
},
{
"name": "HTML",
"bytes": "50620"
},
{
"name": "Makefile",
"bytes": "31933"
},
{
"name": "Objective-C",
"bytes": "1052"
},
{
"name": "Objective-C++",
"bytes": "6330"
},
{
"name": "Protocol Buffer",
"bytes": "2308"
},
{
"name": "Python",
"bytes": "110348"
},
{
"name": "QMake",
"bytes": "2022"
},
{
"name": "Shell",
"bytes": "51195"
}
],
"symlink_target": ""
} |
<readable><title>2890731828_8a7032503a</title><content>
Firemen are battling a fire .
Firemen stand outside a burning building with lots of smoke .
The firefighters are just under the flames and smoke .
There is a group of firemen watching a huge fire in some buildings in the distance .
Three firefighters duck from fire and smoke coming from a building .
</content></readable> | {
"content_hash": "cb0c727077e80f00715f282ab09f6109",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 84,
"avg_line_length": 54,
"alnum_prop": 0.7936507936507936,
"repo_name": "kevint2u/audio-collector",
"id": "6a594df19db5c727388653998dc6e9946e83bf24",
"size": "378",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "captions/xml/2890731828_8a7032503a.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1015"
},
{
"name": "HTML",
"bytes": "18349"
},
{
"name": "JavaScript",
"bytes": "109819"
},
{
"name": "Python",
"bytes": "3260"
},
{
"name": "Shell",
"bytes": "4319"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "44075bd820b6ee3529df461a15f5134d",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 31,
"avg_line_length": 9.692307692307692,
"alnum_prop": 0.7063492063492064,
"repo_name": "mdoering/backbone",
"id": "c619fa88433ab37d9a583cb3c042ac6e697da210",
"size": "189",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Rosales/Rosaceae/Crataegus polita tatnalliana/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
vti_encoding:SR|utf8-nl
vti_cachedlinkinfo:VX|F|tlacitka.html F|../anglicky/nadpis.html F|kontakty/kontakt.html
vti_timecreated:TR|01 Mar 2000 09:14:18 -0000
vti_cacheddtm:TX|01 Mar 2000 12:20:30 +0100
vti_timelastmodified:TR|01 Mar 2000 12:20:30 +0100
vti_cachedhasbots:BR|false
vti_filesize:IX|818
vti_extenderversion:SR|3.0.2.926
vti_cachedtitle:SR|Main page - ECM ECO Monitoring a. s., Bratislava
vti_backlinkinfo:VX|index.html
vti_syncwith_localhost\\a\:/a\::TR|01 Mar 2000 11:20:31 -0000
vti_hasframeset:BR|true
vti_cachedhasborder:BR|false
vti_editor:SW|FrontPage Frames Wizard
vti_generator:SR|Microsoft FrontPage 4.0
vti_author:SR|Rado
vti_cachedhastheme:BR|false
vti_metatags:VR|HTTP-EQUIV=Content-Type text/html;\\ charset=windows-1250 GENERATOR Microsoft\\ FrontPage\\ 4.0
vti_cachedbodystyle:SR|<body>
vti_nexttolasttimemodified:TR|01 Mar 2000 11:19:57 -0000
vti_title:SR|Main page - ECM ECO Monitoring a. s., Bratislava
| {
"content_hash": "0d9878c902de0703e7acec204368d444",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 111,
"avg_line_length": 44.476190476190474,
"alnum_prop": 0.7901498929336188,
"repo_name": "RadoBuransky/ancient-code-of-mine",
"id": "490baebe6f3dbc6d8f936e53a2865aba2f00cbd3",
"size": "934",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "www/Ecm/chorvatsko/_VTI_CNF/index.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ASP",
"bytes": "7426"
},
{
"name": "C",
"bytes": "7757"
},
{
"name": "CSS",
"bytes": "14509"
},
{
"name": "Dylan",
"bytes": "86"
},
{
"name": "HTML",
"bytes": "3924122"
},
{
"name": "JavaScript",
"bytes": "42139"
},
{
"name": "PHP",
"bytes": "244567"
},
{
"name": "PLSQL",
"bytes": "1170620"
},
{
"name": "Pascal",
"bytes": "6863809"
},
{
"name": "TeX",
"bytes": "231"
}
],
"symlink_target": ""
} |
use std::mem::transmute;
unsafe fn f() {
let _: i8 = transmute(16i16);
//~^ ERROR cannot transmute between types of different sizes, or dependently-sized types
}
unsafe fn g<T>(x: &T) {
let _: i8 = transmute(x);
//~^ ERROR cannot transmute between types of different sizes, or dependently-sized types
}
trait Specializable { type Output; }
impl<T> Specializable for T {
default type Output = u16;
}
unsafe fn specializable<T>(x: u16) -> <T as Specializable>::Output {
transmute(x)
//~^ ERROR cannot transmute between types of different sizes, or dependently-sized types
}
fn main() {}
| {
"content_hash": "9b967de987faba24345f0d5b0646fabe",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 92,
"avg_line_length": 25.791666666666668,
"alnum_prop": 0.678513731825525,
"repo_name": "graydon/rust",
"id": "690decf63928593dafec45cec65c4a95f798f5d1",
"size": "789",
"binary": false,
"copies": "23",
"ref": "refs/heads/master",
"path": "src/test/ui/transmute/transmute-different-sizes.rs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "4990"
},
{
"name": "Assembly",
"bytes": "20064"
},
{
"name": "Awk",
"bytes": "159"
},
{
"name": "Bison",
"bytes": "78848"
},
{
"name": "C",
"bytes": "725899"
},
{
"name": "C++",
"bytes": "55803"
},
{
"name": "CSS",
"bytes": "22181"
},
{
"name": "JavaScript",
"bytes": "36295"
},
{
"name": "LLVM",
"bytes": "1587"
},
{
"name": "Makefile",
"bytes": "227056"
},
{
"name": "Puppet",
"bytes": "16300"
},
{
"name": "Python",
"bytes": "142548"
},
{
"name": "RenderScript",
"bytes": "99815"
},
{
"name": "Rust",
"bytes": "18342682"
},
{
"name": "Shell",
"bytes": "269546"
},
{
"name": "TeX",
"bytes": "57"
}
],
"symlink_target": ""
} |
#ifndef _UPK_UUID_H
#define _UPK_UUID_H
/** @file
* @brief definition of upk uuid implementation.
*
* Functions for version 4 UUIDs (random)
*/
#include "upk_std_include.h"
/**
@addtogroup uuid
@{
*/
/** @brief structure for holding 16 byte UUID.
*
* Despite only using v4 uuids, field labels chosen to reflect convention
* but All bits save those for version and id are random; and do not contain
* the information the label might imply
*/
typedef struct _upk_uuid {
uint32_t time_low; /*!< low resolution bits, usually seconds since epoch
(random in this impl) */
uint16_t time_mid; /*!< mid resolution bits (random in this impl) */
uint16_t time_high_and_version; /*!< high-resolution bits, and the version id of the uuid
(time_high is random in this impl; version is 0x40) */
uint8_t clk_seq_high; /*!< clock sequence high bits (0x80 - 0xB0 in this impl) */
uint8_t clk_seq_low; /*!< clock sequence low bits (random in this impl) */
uint8_t node[6]; /*!< unique, usually random number (random in this impl) */
} upk_uuid_t;
#define UPK_UUID_LEN sizeof(upk_uuid_t) /*! 16 */
#define UPK_UUID_STRING_LEN 36
/**
* @addtogroup uuid_functions
* @{
*/
/** *****************************************************************************************************************
@brief seed random number pool used by upk_gen_uuid_bytes.
Only necessary if /dev/urandom and /dev/random are unavailable; for instance, check upk_uuid_open_random to see if
you get a valid fd; if not, call this (unless you have already seeded random elsewhere, in whatever manner you
prefer
****************************************************************************************************************** */
extern void upk_uuid_seed_random(void);
/** ******************************************************************************************************************
@brief open random device, prefering /dev/urandom, but also trying /dev/random if urandom is unavailable.
@return fd of opened device @return < 0 on error (check errno)
****************************************************************************************************************** */
extern int upk_uuid_open_random(void);
/** ******************************************************************************************************************
@brief collect and/or generate 16 bytes of random data.
pack the structure you passed; also sets version correctly on structure to conform with spec
@param[out] buf uuid structure to populate
****************************************************************************************************************** */
extern void upk_gen_uuid_bytes(upk_uuid_t * buf);
/** ******************************************************************************************************************
@brief convert uuid to string and place in buf.
@param[out] buf string buffer (must be at least (UPK_UUID_STRING_LEN + 1) bytes long)
@param[in] uuid uuid structure to convert
****************************************************************************************************************** */
extern void upk_uuid_to_string(char *buf, const upk_uuid_t * uuid);
/** ******************************************************************************************************************
@brief test if a given string is a valid uuid string.
verify string is 36 chars long; and consists of a correctly hiphen-separated sequence of hexidecimal digits
@param[in] string string to check
****************************************************************************************************************** */
extern bool is_valid_upk_uuid_string(const char *string);
/** ******************************************************************************************************************
@brief convert uuid string into uuid structure.
@param[in] string uuid string to convert
@param[out] uuid pointer to buffer to populate
****************************************************************************************************************** */
extern void upk_string_to_uuid(upk_uuid_t * uuid, const char *string);
/**
* @}
* @}
*/
#endif
| {
"content_hash": "60a71ed7f81bd00b6c8c922d4e7d24a6",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 120,
"avg_line_length": 44.76923076923077,
"alnum_prop": 0.422680412371134,
"repo_name": "ytoolshed/upkeeper",
"id": "3e7820e20ac16a0482aac669819eebe3ad0eb550",
"size": "5441",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "libupkeeper/upkeeper/upk_uuid.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "408505"
},
{
"name": "Perl",
"bytes": "7298"
},
{
"name": "Shell",
"bytes": "805143"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "a179f606367dfdc0e48090adf2d6316b",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.307692307692308,
"alnum_prop": 0.6940298507462687,
"repo_name": "mdoering/backbone",
"id": "d57a2df933ca951abdbd99d327fff1e959508e53",
"size": "191",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Fabales/Fabaceae/Acacia/Acacia didyma/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
{% extends "layouts/_block_content.html" %}
{% set page_title = "Account email change link expired " %}
{% block main %}
<h1 class="ons-u-fs-xl">Your verification link has expired</h1>
<div>
<p>
You will need to sign back into your account and <a href="{{ url_for('account_bp.resend_account_email_change_expired_token', token=token) }}">request another verification email</a>.
</p>
<p>
<p>If you need help, please <a href="{{ url_for('contact_us_bp.contact_us') }}" rel="noopener">contact us</a>.</p>
</p>
</div>
{% endblock main %}
| {
"content_hash": "882dcde71c60ed39dbf02e091b8d6d67",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 193,
"avg_line_length": 33.666666666666664,
"alnum_prop": 0.5924092409240924,
"repo_name": "ONSdigital/ras-frontstage",
"id": "1d209e272939b6618160fe443563bcbf29561479",
"size": "606",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "frontstage/templates/account/account-email-change-confirm-link-expired.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "592"
},
{
"name": "Dockerfile",
"bytes": "621"
},
{
"name": "HTML",
"bytes": "269090"
},
{
"name": "Makefile",
"bytes": "824"
},
{
"name": "Python",
"bytes": "705890"
},
{
"name": "Shell",
"bytes": "2874"
}
],
"symlink_target": ""
} |
using System.Collections;
namespace System.DirectoryServices
{
public class DirectoryServicesPermissionEntryCollection : CollectionBase
{
internal DirectoryServicesPermissionEntryCollection() { }
public DirectoryServicesPermissionEntry this[int index] { get { return null; } set { } }
public int Add(DirectoryServicesPermissionEntry value) { return 0; }
public void AddRange(DirectoryServicesPermissionEntryCollection value) { }
public void AddRange(DirectoryServicesPermissionEntry[] value) { }
public bool Contains(DirectoryServicesPermissionEntry value) { return false; }
public void CopyTo(DirectoryServicesPermissionEntry[] array, int index) { }
public int IndexOf(DirectoryServicesPermissionEntry value) { return 0; }
public void Insert(int index, DirectoryServicesPermissionEntry value) { }
protected override void OnClear() { }
protected override void OnInsert(int index, object value) { }
protected override void OnRemove(int index, object value) { }
protected override void OnSet(int index, object oldValue, object newValue) { }
public void Remove(DirectoryServicesPermissionEntry value) { }
}
} | {
"content_hash": "f5685f7c680ae0d5d531238b4dd4308d",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 96,
"avg_line_length": 55.95454545454545,
"alnum_prop": 0.7311129163281884,
"repo_name": "ptoonen/corefx",
"id": "5dfc4cd89dfbc63b7bb7a0787fc299707d9b2144",
"size": "1435",
"binary": false,
"copies": "33",
"ref": "refs/heads/master",
"path": "src/System.DirectoryServices/src/System/DirectoryServices/DirectoryServicesPermissionEntryCollection.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "1C Enterprise",
"bytes": "903"
},
{
"name": "ASP",
"bytes": "1687"
},
{
"name": "Batchfile",
"bytes": "23817"
},
{
"name": "C",
"bytes": "1113487"
},
{
"name": "C#",
"bytes": "132263251"
},
{
"name": "C++",
"bytes": "710534"
},
{
"name": "CMake",
"bytes": "62807"
},
{
"name": "DIGITAL Command Language",
"bytes": "26402"
},
{
"name": "Groovy",
"bytes": "34573"
},
{
"name": "HTML",
"bytes": "653"
},
{
"name": "Makefile",
"bytes": "9085"
},
{
"name": "Objective-C",
"bytes": "9948"
},
{
"name": "OpenEdge ABL",
"bytes": "139178"
},
{
"name": "Perl",
"bytes": "3895"
},
{
"name": "PowerShell",
"bytes": "42677"
},
{
"name": "Python",
"bytes": "1535"
},
{
"name": "Roff",
"bytes": "4236"
},
{
"name": "Shell",
"bytes": "71283"
},
{
"name": "Visual Basic",
"bytes": "827869"
},
{
"name": "XSLT",
"bytes": "462336"
}
],
"symlink_target": ""
} |
Notes for release managers
---
This document describes how to make a Hadoop-BAM release.
Setup your environment
1. Copy (or incorporate) the settings.xml file to ```~/.m2/settings.xml```
2. Edit the username, password, etc in ```~/.m2/settings.xml```
First, update the CHANGELOG.txt file with the list of closed issues and closed
and merged pull requests. Additionally, you will need to update the version in
README.md. These changes will need to be committed to the branch you are
releasing from before you do the release.
Then from the project root directory, run `./scripts/release/release.sh`.
When you run this script, it takes the release version and the new development
version as arguments. For example:
```bash
./scripts/release/release.sh 7.9.2 7.9.3-SNAPSHOT
```
This script can be run off of a different branch from
master, which makes it possible to cut maintenance releases.
Once you've successfully published the release, you will need to "close" and
"release" it following the instructions at
http://central.sonatype.org/pages/releasing-the-deployment.html#close-and-drop-or-release-your-staging-repository.
After the release is rsynced to the Maven Central repository, confirm checksums match
and verify signatures. You should be able to verify this before closing the release
in Sonatype, as the checksums and signatures will be available in the staging repository.
| {
"content_hash": "19edf1fd4144176d0c7b6a46f6b21fa5",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 114,
"avg_line_length": 43.5,
"alnum_prop": 0.7844827586206896,
"repo_name": "HadoopGenomics/Hadoop-BAM",
"id": "aaaca89c4cb7d521f601c13f6ded8c6660ae7606",
"size": "1392",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "scripts/release/README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "594904"
},
{
"name": "Python",
"bytes": "1390"
},
{
"name": "Shell",
"bytes": "1007"
}
],
"symlink_target": ""
} |
namespace SAPHRON
{
////////////////////////////////////////////////////////////////////////////////
// class template vecmapCompare
// Used by vecmap
////////////////////////////////////////////////////////////////////////////////
namespace Private
{
template <class Value, class C>
class vecmapCompare : public C
{
typedef std::pair<typename C::first_argument_type, Value>
Data;
typedef typename C::first_argument_type first_argument_type;
public:
vecmapCompare()
{}
vecmapCompare(const C& src) : C(src)
{}
bool operator()(const first_argument_type& lhs,
const first_argument_type& rhs) const
{ return C::operator()(lhs, rhs); }
bool operator()(const Data& lhs, const Data& rhs) const
{ return operator()(lhs.first, rhs.first); }
bool operator()(const Data& lhs,
const first_argument_type& rhs) const
{ return operator()(lhs.first, rhs); }
bool operator()(const first_argument_type& lhs,
const Data& rhs) const
{ return operator()(lhs, rhs.first); }
};
}
////////////////////////////////////////////////////////////////////////////////
// class template vecmap
// An associative vector built as a syntactic drop-in replacement for std::map
// BEWARE: vecmap doesn't respect all map's guarantees, the most important
// being:
// * iterators are invalidated by insert and erase operations
// * the complexity of insert/erase is O(N) not O(log N)
// * value_type is std::pair<K, V> not std::pair<const K, V>
// * iterators are random
////////////////////////////////////////////////////////////////////////////////
template
<
class K,
class V,
class C = std::less<K>,
class A = std::allocator< std::pair<K, V> >
>
class vecmap
: private std::vector< std::pair<K, V>, A >
, private Private::vecmapCompare<V, C>
{
typedef std::vector<std::pair<K, V>, A> Base;
typedef Private::vecmapCompare<V, C> MyCompare;
public:
typedef K key_type;
typedef V mapped_type;
typedef typename Base::value_type value_type;
typedef C key_compare;
typedef A allocator_type;
typedef typename A::reference reference;
typedef typename A::const_reference const_reference;
typedef typename Base::iterator iterator;
typedef typename Base::const_iterator const_iterator;
typedef typename Base::size_type size_type;
typedef typename Base::difference_type difference_type;
typedef typename A::pointer pointer;
typedef typename A::const_pointer const_pointer;
typedef typename Base::reverse_iterator reverse_iterator;
typedef typename Base::const_reverse_iterator const_reverse_iterator;
class value_compare
: public std::binary_function<value_type, value_type, bool>
, private key_compare
{
friend class vecmap;
protected:
value_compare(key_compare pred) : key_compare(pred)
{}
public:
bool operator()(const value_type& lhs, const value_type& rhs) const
{ return key_compare::operator()(lhs.first, rhs.first); }
};
// 23.3.1.1 construct/copy/destroy
explicit vecmap(const key_compare& comp = key_compare(),
const A& alloc = A())
: Base(alloc), MyCompare(comp)
{}
template <class InputIterator>
vecmap(InputIterator first, InputIterator last,
const key_compare& comp = key_compare(),
const A& alloc = A())
: Base( alloc ), MyCompare( comp )
{
typedef ::std::vector< ::std::pair< K, V >, A > BaseType;
typedef ::std::map< K, V, C, A > TempMap;
typedef ::std::back_insert_iterator< Base > MyInserter;
MyCompare & me = *this;
const A tempAlloc;
// Make a temporary map similar to this type to prevent any duplicate elements.
TempMap temp( first, last, me, tempAlloc );
Base::reserve( temp.size() );
BaseType & target = static_cast< BaseType & >( *this );
MyInserter myInserter = ::std::back_inserter( target );
::std::copy( temp.begin(), temp.end(), myInserter );
}
vecmap& operator=(const vecmap& rhs)
{
vecmap(rhs).swap(*this);
return *this;
}
// iterators:
// The following are here because MWCW gets 'using' wrong
iterator begin() { return Base::begin(); }
const_iterator begin() const { return Base::begin(); }
iterator end() { return Base::end(); }
const_iterator end() const { return Base::end(); }
reverse_iterator rbegin() { return Base::rbegin(); }
const_reverse_iterator rbegin() const { return Base::rbegin(); }
reverse_iterator rend() { return Base::rend(); }
const_reverse_iterator rend() const { return Base::rend(); }
// capacity:
bool empty() const { return Base::empty(); }
size_type size() const { return Base::size(); }
size_type max_size() { return Base::max_size(); }
// 23.3.1.2 element access:
mapped_type& operator[](const key_type& key)
{ return insert(value_type(key, mapped_type())).first->second; }
const mapped_type& operator[](const key_type& key) const
{
const_iterator i(lower_bound(key));
return i->second;
}
// modifiers:
std::pair<iterator, bool> insert(const value_type& val)
{
bool found(true);
iterator i(lower_bound(val.first));
if (i == end() || this->operator()(val.first, i->first))
{
i = Base::insert(i, val);
found = false;
}
return std::make_pair(i, !found);
}
//Section [23.1.2], Table 69
//http://developer.apple.com/documentation/DeveloperTools/gcc-3.3/libstdc++/23_containers/howto.html#4
iterator insert(iterator pos, const value_type& val)
{
if( (pos == begin() || this->operator()(*(pos-1),val)) &&
(pos == end() || this->operator()(val, *pos)) )
{
return Base::insert(pos, val);
}
return insert(val).first;
}
template <class InputIterator>
void insert(InputIterator first, InputIterator last)
{ for (; first != last; ++first) insert(*first); }
void erase(iterator pos)
{ Base::erase(pos); }
size_type erase(const key_type& k)
{
iterator i(find(k));
if (i == end()) return 0;
erase(i);
return 1;
}
void erase(iterator first, iterator last)
{ Base::erase(first, last); }
void swap(vecmap& other)
{
Base::swap(other);
MyCompare& me = *this;
MyCompare& rhs = other;
std::swap(me, rhs);
}
void clear()
{ Base::clear(); }
// observers:
key_compare key_comp() const
{ return *this; }
value_compare value_comp() const
{
const key_compare& comp = *this;
return value_compare(comp);
}
// 23.3.1.3 map operations:
iterator find(const key_type& k)
{
iterator i(lower_bound(k));
if (i != end() && this->operator()(k, i->first))
{
i = end();
}
return i;
}
const_iterator find(const key_type& k) const
{
const_iterator i(lower_bound(k));
if (i != end() && this->operator()(k, i->first))
{
i = end();
}
return i;
}
size_type count(const key_type& k) const
{ return find(k) != end(); }
iterator lower_bound(const key_type& k)
{
MyCompare& me = *this;
return std::lower_bound(begin(), end(), k, me);
}
const_iterator lower_bound(const key_type& k) const
{
const MyCompare& me = *this;
return std::lower_bound(begin(), end(), k, me);
}
iterator upper_bound(const key_type& k)
{
MyCompare& me = *this;
return std::upper_bound(begin(), end(), k, me);
}
const_iterator upper_bound(const key_type& k) const
{
const MyCompare& me = *this;
return std::upper_bound(begin(), end(), k, me);
}
std::pair<iterator, iterator> equal_range(const key_type& k)
{
MyCompare& me = *this;
return std::equal_range(begin(), end(), k, me);
}
std::pair<const_iterator, const_iterator> equal_range(
const key_type& k) const
{
const MyCompare& me = *this;
return std::equal_range(begin(), end(), k, me);
}
template <class K1, class V1, class C1, class A1>
friend bool operator==(const vecmap<K1, V1, C1, A1>& lhs,
const vecmap<K1, V1, C1, A1>& rhs);
bool operator<(const vecmap& rhs) const
{
const Base& me = *this;
const Base& yo = rhs;
return me < yo;
}
template <class K1, class V1, class C1, class A1>
friend bool operator!=(const vecmap<K1, V1, C1, A1>& lhs,
const vecmap<K1, V1, C1, A1>& rhs);
template <class K1, class V1, class C1, class A1>
friend bool operator>(const vecmap<K1, V1, C1, A1>& lhs,
const vecmap<K1, V1, C1, A1>& rhs);
template <class K1, class V1, class C1, class A1>
friend bool operator>=(const vecmap<K1, V1, C1, A1>& lhs,
const vecmap<K1, V1, C1, A1>& rhs);
template <class K1, class V1, class C1, class A1>
friend bool operator<=(const vecmap<K1, V1, C1, A1>& lhs,
const vecmap<K1, V1, C1, A1>& rhs);
};
template <class K, class V, class C, class A>
inline bool operator==(const vecmap<K, V, C, A>& lhs,
const vecmap<K, V, C, A>& rhs)
{
const std::vector<std::pair<K, V>, A>& me = lhs;
return me == rhs;
}
template <class K, class V, class C, class A>
inline bool operator!=(const vecmap<K, V, C, A>& lhs,
const vecmap<K, V, C, A>& rhs)
{ return !(lhs == rhs); }
template <class K, class V, class C, class A>
inline bool operator>(const vecmap<K, V, C, A>& lhs,
const vecmap<K, V, C, A>& rhs)
{ return rhs < lhs; }
template <class K, class V, class C, class A>
inline bool operator>=(const vecmap<K, V, C, A>& lhs,
const vecmap<K, V, C, A>& rhs)
{ return !(lhs < rhs); }
template <class K, class V, class C, class A>
inline bool operator<=(const vecmap<K, V, C, A>& lhs,
const vecmap<K, V, C, A>& rhs)
{ return !(rhs < lhs); }
// specialized algorithms:
template <class K, class V, class C, class A>
void swap(vecmap<K, V, C, A>& lhs, vecmap<K, V, C, A>& rhs)
{ lhs.swap(rhs); }
} // namespace Loki
#endif // end file guardian
| {
"content_hash": "5c8f9ee6e3de9bd953e57f5620a37326",
"timestamp": "",
"source": "github",
"line_count": 347,
"max_line_length": 110,
"avg_line_length": 33.62536023054755,
"alnum_prop": 0.5089989715461091,
"repo_name": "hsidky/SAPHRON",
"id": "e0567b1f2a9ef846e77a2d4ef491f876e8098a87",
"size": "13310",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "include/vecmap.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C++",
"bytes": "846456"
},
{
"name": "CMake",
"bytes": "35020"
},
{
"name": "Matlab",
"bytes": "11208"
},
{
"name": "Python",
"bytes": "2984"
}
],
"symlink_target": ""
} |
using System.Reflection;
using System.Runtime.CompilerServices;
using Android.App;
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
[assembly: AssemblyTitle ("HolisticWare.Trilix.CashDesk.XamarinAndroid")]
[assembly: AssemblyDescription ("")]
[assembly: AssemblyConfiguration ("")]
[assembly: AssemblyCompany ("http://holisticware.net")]
[assembly: AssemblyProduct ("")]
[assembly: AssemblyCopyright ("moljac")]
[assembly: AssemblyTrademark ("HolisticWare")]
[assembly: AssemblyCulture ("")]
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
[assembly: AssemblyVersion ("1.0.0")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("")]
| {
"content_hash": "c230be230ccae1e5b4e9e2e170284171",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 81,
"avg_line_length": 38.464285714285715,
"alnum_prop": 0.7493036211699164,
"repo_name": "moljac/Samples.XamarinAndroid",
"id": "c732410c54543a15cbda59334674cabf4ae60e44",
"size": "1079",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "tutorial-samples/20-AppCompatSupport/ToolBar.02.MenuTabLayout/Properties/AssemblyInfo.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "665"
},
{
"name": "C#",
"bytes": "275239"
},
{
"name": "Java",
"bytes": "220980"
},
{
"name": "Shell",
"bytes": "4384"
}
],
"symlink_target": ""
} |
import { registerDecorator } from 'class-validator';
import { getOwner } from '@ember/application';
import EmailValidator from 'validator/es/lib/isEmail';
export function IsEmail(validationOptions) {
return function (object, propertyName) {
registerDecorator({
name: 'IsEmail',
target: object.constructor,
propertyName: propertyName,
options: validationOptions,
validator: {
validate(value) {
if (!value) {
return true;
}
return EmailValidator(value);
},
defaultMessage({ object: target }) {
const owner = getOwner(target);
const intl = owner.lookup('service:intl');
const description = intl.t('errors.description');
return intl.t('errors.email', { description });
},
},
});
};
}
| {
"content_hash": "acf3c8bd7dd68d641ebe328d47d9cc3f",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 59,
"avg_line_length": 29.103448275862068,
"alnum_prop": 0.5983412322274881,
"repo_name": "ilios/common",
"id": "c69f52b4222f8bdd09c483e0eee6419dabd5cd9a",
"size": "844",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "addon/decorators/validation/is-email.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "1871"
},
{
"name": "Handlebars",
"bytes": "370075"
},
{
"name": "JavaScript",
"bytes": "2394676"
},
{
"name": "SCSS",
"bytes": "127854"
}
],
"symlink_target": ""
} |
"""
Module providing wrapper classes for a pythonic interface to libgroove.so
"""
from __future__ import absolute_import, unicode_literals
from enum import IntEnum
from functools import wraps
from weakref import WeakValueDictionary
from groove import _constants
from groove import utils
from groove._groove import ffi, lib
__all__ = [
'Channel',
'ChannelLayout',
'GrooveClass',
'SampleFormat',
'init',
'libgroove_version',
'libgroove_version_info',
]
def libgroove_version():
"""libgroove version as a string"""
return ffi.string(lib.groove_version()).decode('utf-8')
def libgroove_version_info():
"""libgroove version as a tuple"""
return (
lib.groove_version_major(),
lib.groove_version_minor(),
lib.groove_version_patch(),
)
def init():
import atexit
lib.groove_init()
atexit.register(lib.groove_finish)
class GrooveClass(object):
"""Base class for all objects backed by a groove struct via cffi
The attributes and methods defined on this base class will be API stable,
but their usage is highly discouraged!
No two python instances should wrap the same underlying C struct.
Attributes:
_ffitype (str): Type of the underlying object as used in `ffi.new`,
e.g. `'struct GrooveFile *'`
_obj (cffi.cdata): The backing struct, if it has been instantiated.
"""
_ffitype = None
__obj = None
# Keep a map of `cdata -> instance` so we can get the right
# instance when a C function gives us a struct pointer.
_obj_instance_map = WeakValueDictionary()
@property
def _obj(self):
return self.__obj
@_obj.setter
def _obj(self, value):
if value == ffi.NULL:
value = None
if value is not None and ffi.typeof(value) is not ffi.typeof(self._ffitype):
raise TypeError('obj must be of type "%s"' % cls._ffitype)
if self.__obj is not None:
del self._obj_instance_map[(self.__obj, self._ffitype)]
self.__obj = value
if value is not None:
self._obj_instance_map[(value, self._ffitype)] = self
@classmethod
def _from_obj(cls, obj):
"""Get a Python instance for the cdata obj
Arguments:
obj (cffi.cdata): The struct to wrap
Returns:
A tuple (instance, created) where instance is a python object
wrapping `obj`. `created` is `False` if an existing instance was
found and returned. It is `True` if a new python instance was
created.
"""
if ffi.typeof(obj) is not ffi.typeof(cls._ffitype):
raise TypeError('obj must be of type "%s"' % cls._ffitype)
instance = cls._obj_instance_map.get((obj, cls._ffitype), None)
if instance is not None:
return instance, False
# TODO: This makes me feel terrible and hate everything :(
instance = cls.__new__(cls)
instance._obj = obj
return instance, True
@utils.unique_enum
class Channel(IntEnum):
"""
Integer enumeration for audio channels and channel layouts.
Each audio channel is a power of two to be used as a bitmask
Attributes:
front_left
front_right
front_center
low_frequency
back_left
back_right
left_of_center
right_of_center
back_center
side_left
side_right
top_center
top_front_left
top_front_center
top_front_right
top_back_left
top_back_center
top_back_right
stereo_left
stereo_right
wide_left
wide_right
"""
front_left = _constants.GROOVE_CH_FRONT_LEFT
front_right = _constants.GROOVE_CH_FRONT_RIGHT
front_center = _constants.GROOVE_CH_FRONT_CENTER
low_frequency = _constants.GROOVE_CH_LOW_FREQUENCY
back_left = _constants.GROOVE_CH_BACK_LEFT
back_right = _constants.GROOVE_CH_BACK_RIGHT
left_of_center = _constants.GROOVE_CH_FRONT_LEFT_OF_CENTER
right_of_center = _constants.GROOVE_CH_FRONT_RIGHT_OF_CENTER
back_center = _constants.GROOVE_CH_BACK_CENTER
side_left = _constants.GROOVE_CH_SIDE_LEFT
side_right = _constants.GROOVE_CH_SIDE_RIGHT
top_center = _constants.GROOVE_CH_TOP_CENTER
top_front_left = _constants.GROOVE_CH_TOP_FRONT_LEFT
top_front_center = _constants.GROOVE_CH_TOP_FRONT_CENTER
top_front_right = _constants.GROOVE_CH_TOP_FRONT_RIGHT
top_back_left = _constants.GROOVE_CH_TOP_BACK_LEFT
top_back_center = _constants.GROOVE_CH_TOP_BACK_CENTER
top_back_right = _constants.GROOVE_CH_TOP_BACK_RIGHT
stereo_left = _constants.GROOVE_CH_STEREO_LEFT
stereo_right = _constants.GROOVE_CH_STEREO_RIGHT
wide_left = _constants.GROOVE_CH_WIDE_LEFT
wide_right = _constants.GROOVE_CH_WIDE_RIGHT
@utils.unique_enum
class ChannelLayout(IntEnum):
"""
A layout of audio channels, each layout
Attributes:
layout_mono
layout_stereo
layout_2p1
layout_2_1
layout_surround
layout_3p1
layout_4p0
layout_4p1
layout_2_2
layout_quad
layout_5p0
layout_5p1
layout_5p0
layout_5p1
layout_6p0
layout_6p0_front
layout_hexagonal
layout_6p1
layout_6p1_back
layout_6p1_front
layout_7p0
layout_7p0_front
layout_7p1
layout_7p1_wide
layout_7p1_wide_back
layout_octagonal
layout_stereo_downmix
"""
# TODO: remove layout prefix and give these better names
layout_mono = _constants.GROOVE_CH_LAYOUT_MONO
layout_stereo = _constants.GROOVE_CH_LAYOUT_STEREO
layout_2p1 = _constants.GROOVE_CH_LAYOUT_2POINT1
layout_2_1 = _constants.GROOVE_CH_LAYOUT_2_1
layout_surround = _constants.GROOVE_CH_LAYOUT_SURROUND
layout_3p1 = _constants.GROOVE_CH_LAYOUT_3POINT1
layout_4p0 = _constants.GROOVE_CH_LAYOUT_4POINT0
layout_4p1 = _constants.GROOVE_CH_LAYOUT_4POINT1
layout_2_2 = _constants.GROOVE_CH_LAYOUT_2_2
layout_quad = _constants.GROOVE_CH_LAYOUT_QUAD
layout_5p0 = _constants.GROOVE_CH_LAYOUT_5POINT0
layout_5p1 = _constants.GROOVE_CH_LAYOUT_5POINT1
layout_5p0_back = _constants.GROOVE_CH_LAYOUT_5POINT0_BACK
layout_5p1_back = _constants.GROOVE_CH_LAYOUT_5POINT1_BACK
layout_6p0 = _constants.GROOVE_CH_LAYOUT_6POINT0
layout_6p0_front = _constants.GROOVE_CH_LAYOUT_6POINT0_FRONT
layout_hexagonal = _constants.GROOVE_CH_LAYOUT_HEXAGONAL
layout_6p1 = _constants.GROOVE_CH_LAYOUT_6POINT1
layout_6p1_back = _constants.GROOVE_CH_LAYOUT_6POINT1_BACK
layout_6p1_front = _constants.GROOVE_CH_LAYOUT_6POINT1_FRONT
layout_7p0 = _constants.GROOVE_CH_LAYOUT_7POINT0
layout_7p0_front = _constants.GROOVE_CH_LAYOUT_7POINT0_FRONT
layout_7p1 = _constants.GROOVE_CH_LAYOUT_7POINT1
layout_7p1_wide = _constants.GROOVE_CH_LAYOUT_7POINT1_WIDE
layout_7p1_wide_back = _constants.GROOVE_CH_LAYOUT_7POINT1_WIDE_BACK
layout_octagonal = _constants.GROOVE_CH_LAYOUT_OCTAGONAL
layout_stereo_downmix = _constants.GROOVE_CH_LAYOUT_STEREO_DOWNMIX
@classmethod
def channels(cls, layout):
"""Return the channels used in a layout"""
return [c for c in Channel.__members__.values() if (layout & c)]
@classmethod
def count(cls, layout):
"""Count number of channels in a layout"""
return lib.groove_channel_layout_count(layout)
@classmethod
def default(cls, count):
"""Get the default layout for a given number of channels
Args:
count (int): Number of audio channels
Returns:
The default layout for count number of channels.
"""
layout_value = lib.groove_channel_layout_default(count)
return cls.__values__[layout_value]
@utils.unique_enum
class SampleFormat(IntEnum):
"""
Enumeration for audio sample formats
Attributes:
none
u8 unsigned 8 bits
s16 signed 16 bits
s32 signed 32 bits
flt float
dbl double
u8p unsigned 8 planar
s16p signed 16 planar
s32p signed 32 planar
fltp float planar
dblp double planar
"""
none = _constants.GROOVE_SAMPLE_FMT_NONE
u8 = _constants.GROOVE_SAMPLE_FMT_U8
s16 = _constants.GROOVE_SAMPLE_FMT_S16
s32 = _constants.GROOVE_SAMPLE_FMT_S32
flt = _constants.GROOVE_SAMPLE_FMT_FLT
dbl = _constants.GROOVE_SAMPLE_FMT_DBL
u8p = _constants.GROOVE_SAMPLE_FMT_U8P
s16p = _constants.GROOVE_SAMPLE_FMT_S16P
s32p = _constants.GROOVE_SAMPLE_FMT_S32P
fltp = _constants.GROOVE_SAMPLE_FMT_FLTP
dblp = _constants.GROOVE_SAMPLE_FMT_DBLP
def bytes_per_sample(self):
return lib.groove_sample_format_bytes_per_sample(self)
| {
"content_hash": "f4c9ce1c76d2a5332b2a553dfcd77f25",
"timestamp": "",
"source": "github",
"line_count": 284,
"max_line_length": 84,
"avg_line_length": 31.411971830985916,
"alnum_prop": 0.6466763815715727,
"repo_name": "kalhartt/python-groove",
"id": "a2e4334538a5c23b356521947f6d3de2b71cc492",
"size": "8921",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/groove/groove.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "86693"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
Index Fungorum
#### Published in
Observ. mycol. (Havniae) 1: 190 (1815)
#### Original name
Actidium acharii Fr.
### Remarks
null | {
"content_hash": "8febf67488417c325941b8e6ff325c72",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 38,
"avg_line_length": 12.23076923076923,
"alnum_prop": 0.6855345911949685,
"repo_name": "mdoering/backbone",
"id": "097ac0bc2b98e4180a7023642338f6e648f9d9f0",
"size": "203",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Fungi/Ascomycota/Dothideomycetes/Pleosporales/Mytilinidiaceae/Actidium/Actidium acharii/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
#include "StdAfx.h"
#include "FArchiveXML.h"
#include "FCDocument/FCDocument.h"
#include "FCDocument/FCDExtra.h"
#include "FCDocument/FCDCamera.h"
xmlNode* FArchiveXML::WriteCamera(FCDObject* object, xmlNode* parentNode)
{
FCDCamera* camera = (FCDCamera*)object;
// Create the base camera node
xmlNode* cameraNode = FArchiveXML::WriteToEntityXMLFCDEntity(camera, parentNode, DAE_CAMERA_ELEMENT);
xmlNode* opticsNode = AddChild(cameraNode, DAE_OPTICS_ELEMENT);
xmlNode* baseNode = AddChild(opticsNode, DAE_TECHNIQUE_COMMON_ELEMENT);
const char *baseNodeName, *horizontalViewName, *verticalViewName;
switch (camera->GetProjectionType())
{
case FCDCamera::PERSPECTIVE:
baseNodeName = DAE_CAMERA_PERSP_ELEMENT;
horizontalViewName = DAE_XFOV_CAMERA_PARAMETER;
verticalViewName = DAE_YFOV_CAMERA_PARAMETER;
break;
case FCDCamera::ORTHOGRAPHIC:
baseNodeName = DAE_CAMERA_ORTHO_ELEMENT;
horizontalViewName = DAE_XMAG_CAMERA_PARAMETER;
verticalViewName = DAE_YMAG_CAMERA_PARAMETER;
break;
default:
baseNodeName = horizontalViewName = verticalViewName = DAEERR_UNKNOWN_ELEMENT;
break;
}
baseNode = AddChild(baseNode, baseNodeName);
// Write out the basic camera parameters
if (camera->HasHorizontalFov())
{
xmlNode* viewNode = AddChild(baseNode, horizontalViewName, camera->GetFovX());
FArchiveXML::WriteAnimatedValue(&camera->GetFovX(), viewNode, horizontalViewName);
}
if (!camera->HasHorizontalFov() || camera->HasVerticalFov())
{
xmlNode* viewNode = AddChild(baseNode, verticalViewName, camera->GetFovY());
FArchiveXML::WriteAnimatedValue(&camera->GetFovY(), viewNode, verticalViewName);
}
// Aspect ratio: can only be exported if one of the vertical or horizontal view ratios is missing.
if (camera->HasAspectRatio())
{
xmlNode* aspectNode = AddChild(baseNode, DAE_ASPECT_CAMERA_PARAMETER, camera->GetAspectRatio());
FArchiveXML::WriteAnimatedValue(&camera->GetAspectRatio(), aspectNode, "aspect_ratio");
}
// Near/far clip plane distance
xmlNode* clipNode = AddChild(baseNode, DAE_ZNEAR_CAMERA_PARAMETER, camera->GetNearZ());
FArchiveXML::WriteAnimatedValue(&camera->GetNearZ(), clipNode, "near_clip");
clipNode = AddChild(baseNode, DAE_ZFAR_CAMERA_PARAMETER, camera->GetFarZ());
FArchiveXML::WriteAnimatedValue(&camera->GetFarZ(), clipNode, "far_clip");
// Add the application-specific technique/parameters
FCDENodeList extraParameterNodes;
FUTrackedPtr<FCDETechnique> techniqueNode = NULL;
// Export the <extra> elements and release the temporarily-added parameters/technique
FArchiveXML::WriteTargetedEntityExtra(camera, cameraNode);
CLEAR_POINTER_VECTOR(extraParameterNodes);
if (techniqueNode != NULL && techniqueNode->GetChildNodeCount() == 0)
SAFE_RELEASE(techniqueNode);
return cameraNode;
}
| {
"content_hash": "df04901da8ef1e21b543d6aaa907a212",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 105,
"avg_line_length": 41.97260273972603,
"alnum_prop": 0.6968015665796344,
"repo_name": "dava/dava.engine",
"id": "e3a16463abbae26d41d23f50405dc8bbd4012c47",
"size": "3277",
"binary": false,
"copies": "1",
"ref": "refs/heads/development",
"path": "Programs/ColladaConverter/Collada15/FColladaPlugins/FArchiveXML/FAXCameraExport.cpp",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Ada",
"bytes": "89080"
},
{
"name": "Assembly",
"bytes": "166572"
},
{
"name": "Batchfile",
"bytes": "18562"
},
{
"name": "C",
"bytes": "61621347"
},
{
"name": "C#",
"bytes": "574524"
},
{
"name": "C++",
"bytes": "50229645"
},
{
"name": "CLIPS",
"bytes": "5291"
},
{
"name": "CMake",
"bytes": "11439187"
},
{
"name": "CSS",
"bytes": "32773"
},
{
"name": "Cuda",
"bytes": "37073"
},
{
"name": "DIGITAL Command Language",
"bytes": "27303"
},
{
"name": "Emacs Lisp",
"bytes": "44259"
},
{
"name": "Fortran",
"bytes": "8835"
},
{
"name": "GLSL",
"bytes": "3726"
},
{
"name": "Go",
"bytes": "1235"
},
{
"name": "HTML",
"bytes": "8621333"
},
{
"name": "Java",
"bytes": "232072"
},
{
"name": "JavaScript",
"bytes": "2560"
},
{
"name": "Lua",
"bytes": "43080"
},
{
"name": "M4",
"bytes": "165145"
},
{
"name": "Makefile",
"bytes": "1349214"
},
{
"name": "Mathematica",
"bytes": "4633"
},
{
"name": "Module Management System",
"bytes": "15224"
},
{
"name": "Objective-C",
"bytes": "1909821"
},
{
"name": "Objective-C++",
"bytes": "498191"
},
{
"name": "Pascal",
"bytes": "99390"
},
{
"name": "Perl",
"bytes": "396608"
},
{
"name": "Python",
"bytes": "782784"
},
{
"name": "QML",
"bytes": "43105"
},
{
"name": "QMake",
"bytes": "156"
},
{
"name": "Roff",
"bytes": "71083"
},
{
"name": "Ruby",
"bytes": "22742"
},
{
"name": "SAS",
"bytes": "16030"
},
{
"name": "Shell",
"bytes": "2482394"
},
{
"name": "Slash",
"bytes": "117430"
},
{
"name": "Smalltalk",
"bytes": "5908"
},
{
"name": "TeX",
"bytes": "428489"
},
{
"name": "Vim script",
"bytes": "133255"
},
{
"name": "Visual Basic",
"bytes": "54056"
},
{
"name": "WebAssembly",
"bytes": "13987"
}
],
"symlink_target": ""
} |
'use strict';
var fs = require('fs');
var path = require('path');
var webpack = require("webpack");
var merge = require("webpack-merge");
var pathToKssLoader = require.resolve("./../index");
var testLoader = require("./tools/test-loader");
var kssLoader = require(pathToKssLoader);
var chai = require('chai');
var expect = chai.expect;
chai.should();
var CR = /\r/g;
var syntaxStyles = ["scss"];
syntaxStyles.forEach(function (ext) {
function execTest(testId, options) {
return new Promise(function (resolve, reject) {
var baseConfig = merge({
entry: path.join(__dirname, ext, testId + "." + ext),
output: {
filename: "bundle." + ext + ".js"
},
module: {
rules: [{
test: new RegExp(`\\.${ext}$`),
use: [
{
loader: "raw-loader"
},
{
loader: "sass-loader"
},
{
loader: pathToKssLoader,
options: merge({
source: path.join(__dirname, ext),
destination: path.join(__dirname, ext, 'docs')
}, options)
}
]
}]
}
});
runWebpack(baseConfig, function (err) {
return err ? reject(err) : resolve();
});
}).then(function () {
var expectedCss = readCss(ext, testId);
expectedCss.should.include('KSS Style Guide');
});
}
describe(`sass-loader (${ext})`, function () {
describe("basic", function () {
it("should compile simple sass without errors", function () {
return execTest("language");
});
});
});
});
describe("sass-loader", function () {
describe("source maps", function () {
function buildWithSourceMaps() {
return new Promise(function (resolve, reject) {
runWebpack({
entry: path.join(__dirname, "scss", "imports.scss"),
output: {
filename: "bundle.source-maps.js"
},
devtool: "source-map",
module: {
rules: [{
test: /\.scss$/,
use: [
{
loader: testLoader.filename
},
{
loader: "sass-loader"
},
{
loader: pathToKssLoader,
options: {
source: path.join(__dirname, 'scss'),
destination: path.join(__dirname, 'scss', 'docs')
}
}
]
}]
}
}, function (err) {
return err ? reject(err) : resolve();
});
});
}
it("should compile without errors", function () {
return buildWithSourceMaps();
});
});
});
function readCss(ext, id) {
return fs.readFileSync(path.join(__dirname, ext, "docs", "item-" + id + ".html"), "utf8").replace(CR, "");
}
function runWebpack(baseConfig, done) {
var webpackConfig = merge({
output: {
path: path.join(__dirname, "output"),
filename: "bundle.js",
libraryTarget: "commonjs2"
}
}, baseConfig);
webpack(webpackConfig, function (webpackErr, stats) {
var err = webpackErr ||
(stats.hasErrors() && stats.compilation.errors[0]) ||
(stats.hasWarnings() && stats.compilation.warnings[0]);
done(err || null);
});
}
function readBundle(filename) {
delete require.cache[path.resolve(__dirname, `./output/${filename}`)];
return require(`./output/${filename}`);
}
| {
"content_hash": "b1668d5bbcc603b77fae20ef1f6ffdc1",
"timestamp": "",
"source": "github",
"line_count": 135,
"max_line_length": 108,
"avg_line_length": 26.474074074074075,
"alnum_prop": 0.4969222160044768,
"repo_name": "design4pro/kss-loader",
"id": "4b8e714cc533e265a66d4dcf074245446dfa30da",
"size": "3574",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/index.test.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1032"
},
{
"name": "JavaScript",
"bytes": "10864"
}
],
"symlink_target": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.