Dataset Preview
The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
The dataset generation failed
Error code: DatasetGenerationError
Exception: TypeError
Message: Couldn't cast array of type
struct<content_hash: string, timestamp: string, source: string, line_count: int64, max_line_length: int64, avg_line_length: double, alnum_prop: double, repo_name: string, id: string, size: string, binary: bool, copies: string, ref: string, path: string, mode: string, license: string, language: list<item: struct<name: string, bytes: string>>, symlink_target: string>
to
{'content_hash': Value(dtype='string', id=None), 'timestamp': Value(dtype='string', id=None), 'source': Value(dtype='string', id=None), 'line_count': Value(dtype='int64', id=None), 'max_line_length': Value(dtype='int64', id=None), 'avg_line_length': Value(dtype='float64', id=None), 'alnum_prop': Value(dtype='float64', id=None), 'repo_name': Value(dtype='string', id=None), 'id': Value(dtype='string', id=None), 'size': Value(dtype='string', id=None), 'binary': Value(dtype='bool', id=None), 'copies': Value(dtype='string', id=None), 'ref': Value(dtype='string', id=None), 'path': Value(dtype='string', id=None), 'mode': Value(dtype='string', id=None), 'license': Value(dtype='string', id=None), 'language': [{'name': Value(dtype='string', id=None), 'bytes': Value(dtype='string', id=None)}]}
Traceback: Traceback (most recent call last):
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 2011, in _prepare_split_single
writer.write_table(table)
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/arrow_writer.py", line 585, in write_table
pa_table = table_cast(pa_table, self._schema)
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 2302, in table_cast
return cast_table_to_schema(table, schema)
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 2261, in cast_table_to_schema
arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 2261, in <listcomp>
arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 1802, in wrapper
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 1802, in <listcomp>
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 2122, in cast_array_to_feature
raise TypeError(f"Couldn't cast array of type\n{_short_str(array.type)}\nto\n{_short_str(feature)}")
TypeError: Couldn't cast array of type
struct<content_hash: string, timestamp: string, source: string, line_count: int64, max_line_length: int64, avg_line_length: double, alnum_prop: double, repo_name: string, id: string, size: string, binary: bool, copies: string, ref: string, path: string, mode: string, license: string, language: list<item: struct<name: string, bytes: string>>, symlink_target: string>
to
{'content_hash': Value(dtype='string', id=None), 'timestamp': Value(dtype='string', id=None), 'source': Value(dtype='string', id=None), 'line_count': Value(dtype='int64', id=None), 'max_line_length': Value(dtype='int64', id=None), 'avg_line_length': Value(dtype='float64', id=None), 'alnum_prop': Value(dtype='float64', id=None), 'repo_name': Value(dtype='string', id=None), 'id': Value(dtype='string', id=None), 'size': Value(dtype='string', id=None), 'binary': Value(dtype='bool', id=None), 'copies': Value(dtype='string', id=None), 'ref': Value(dtype='string', id=None), 'path': Value(dtype='string', id=None), 'mode': Value(dtype='string', id=None), 'license': Value(dtype='string', id=None), 'language': [{'name': Value(dtype='string', id=None), 'bytes': Value(dtype='string', id=None)}]}
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1529, in compute_config_parquet_and_info_response
parquet_operations = convert_to_parquet(builder)
File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1154, in convert_to_parquet
builder.download_and_prepare(
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1027, in download_and_prepare
self._download_and_prepare(
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1122, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1882, in _prepare_split
for job_id, done, content in self._prepare_split_single(
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 2038, in _prepare_split_single
raise DatasetGenerationError("An error occurred while generating the dataset") from e
datasets.exceptions.DatasetGenerationError: An error occurred while generating the datasetNeed help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.
text
string | meta
dict |
|---|---|
<!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_45) on Mon Apr 29 15:10:36 CEST 2013 -->
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
<TITLE>
org.apache.solr.util.plugin (Solr 4.3.0 API)
</TITLE>
<META NAME="date" CONTENT="2013-04-29">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">
</HEAD>
<BODY BGCOLOR="white">
<FONT size="+1" CLASS="FrameTitleFont">
<A HREF="../../../../../org/apache/solr/util/plugin/package-summary.html" target="classFrame">org.apache.solr.util.plugin</A></FONT>
<TABLE BORDER="0" WIDTH="100%" SUMMARY="">
<TR>
<TD NOWRAP><FONT size="+1" CLASS="FrameHeadingFont">
Interfaces</FONT>
<FONT CLASS="FrameItemFont">
<BR>
<A HREF="MapInitializedPlugin.html" title="interface in org.apache.solr.util.plugin" target="classFrame"><I>MapInitializedPlugin</I></A>
<BR>
<A HREF="NamedListInitializedPlugin.html" title="interface in org.apache.solr.util.plugin" target="classFrame"><I>NamedListInitializedPlugin</I></A>
<BR>
<A HREF="PluginInfoInitialized.html" title="interface in org.apache.solr.util.plugin" target="classFrame"><I>PluginInfoInitialized</I></A>
<BR>
<A HREF="ResourceLoaderAware.html" title="interface in org.apache.solr.util.plugin" target="classFrame"><I>ResourceLoaderAware</I></A>
<BR>
<A HREF="SolrCoreAware.html" title="interface in org.apache.solr.util.plugin" target="classFrame"><I>SolrCoreAware</I></A></FONT></TD>
</TR>
</TABLE>
<TABLE BORDER="0" WIDTH="100%" SUMMARY="">
<TR>
<TD NOWRAP><FONT size="+1" CLASS="FrameHeadingFont">
Classes</FONT>
<FONT CLASS="FrameItemFont">
<BR>
<A HREF="AbstractPluginLoader.html" title="class in org.apache.solr.util.plugin" target="classFrame">AbstractPluginLoader</A>
<BR>
<A HREF="MapPluginLoader.html" title="class in org.apache.solr.util.plugin" target="classFrame">MapPluginLoader</A>
<BR>
<A HREF="NamedListPluginLoader.html" title="class in org.apache.solr.util.plugin" target="classFrame">NamedListPluginLoader</A></FONT></TD>
</TR>
</TABLE>
</BODY>
</HTML>
|
{
"content_hash": "76cf3e9824d0a9249d8e2b9dafd6d5c7",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 148,
"avg_line_length": 38.482142857142854,
"alnum_prop": 0.7146171693735499,
"repo_name": "iluminati182006/ReutersSolr",
"id": "50ff8dc9d9d28befec351a9cdb01566e6179507b",
"size": "2155",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docs/solr-core/org/apache/solr/util/plugin/package-frame.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "143608"
},
{
"name": "JavaScript",
"bytes": "1456622"
},
{
"name": "Shell",
"bytes": "7033"
},
{
"name": "XSLT",
"bytes": "48649"
}
]
}
|
using System;
namespace Microsoft.DirectX.Direct3D
{
public enum Cull
{
CounterClockwise = 3,
Clockwise = 2,
None = 1
}
}
|
{
"content_hash": "f2445531aaecffaae3931035b74ecf9b",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 36,
"avg_line_length": 9.642857142857142,
"alnum_prop": 0.6666666666666666,
"repo_name": "alesliehughes/monoDX",
"id": "f77a16d82b5b24cd72a2a6a3d32dec19c0be1d49",
"size": "1286",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Microsoft.DirectX.Direct3D/Microsoft.DirectX.Direct3D/Cull.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "1153907"
},
{
"name": "Makefile",
"bytes": "76"
},
{
"name": "Shell",
"bytes": "510"
}
]
}
|
<?php
namespace App\Http\Controllers\User;
use Session;
use App\User;
use App\Authorized;
use phpseclib\Crypt\RSA;
use Illuminate\Http\Request;
use App\Exceptions\RSAException;
use PragmaRX\Google2FA\Google2FA;
use App\Http\Controllers\Controller;
class AuthorController extends Controller
{
public function showAuthorPage(){
return view('user.author');
}
public function handleAuthorization(Request $request){
if(!$this->validateToken($request->input('token'))){
return response()->json([], 401);
}
$this->validate($request, [
'student_id' => 'required|integer|digits:5',
]);
}
public function validateGoogle2FA(String $input_token){
$google2fa = new Google2FA();
$user = User::where('username', Session::get('username'))->firstOrFail();
if($google2fa->verifyKey($user->google2fa_secret, $input_token)){
$token = bin2hex(openssl_random_pseudo_bytes(16));
Session::flash('author_key', $token);
return response()->json([
'status' => 'ok',
'token' => $token,
], 200);
}else{
return response()->json([
'status' => 'Invalid 2 factor token'
], 401);
}
}
private function validateToken(String $token){
return ($token === Session::get('author_key'));
}
private function verifyValidCommand(){
}
private function getRSAKey(){
$key['publickey'] = base64_decode(User::where('username', Session::get('username'))->pluck('rsa_key.public_key')[0]);
$key['privatekey'] = base64_decode(User::where('username', Session::get('username'))->pluck('rsa_key.private_key')[0]);
// TODO : Decrypt the keys (Since these keys will be encrypted)
return $key;
}
private function signCheckOutRequest($message){
$rsa = new RSA;
$key = $this->getRSAKey();
if(!$rsa->loadkey($key['privatekey']) || !$rsa->loadkey($key['publickey'])){
throw new RSAException('Cannot load keypair');
}
if(!$rsa->sign($message)){
throw new RSAException('Cannot sign message');
}else{
return bin2hex($rsa->sign($message));
}
}
private function authorizeCheckOut(Int $student_id, String $signature){
Authorized::insert([
'student_id' => $student_id,
'signature' => $signature,
]);
return true;
}
private function validateCheckOutRequest(){
return;
}
}
|
{
"content_hash": "954793078f63a18830089f6f5f4ab770",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 127,
"avg_line_length": 27.978494623655912,
"alnum_prop": 0.578401229823213,
"repo_name": "TriamUdom/CheckOut",
"id": "45dd871374a37f68128774c97bab582de3899c49",
"size": "2602",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/Http/Controllers/User/AuthorController.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "553"
},
{
"name": "HTML",
"bytes": "2763"
},
{
"name": "JavaScript",
"bytes": "1135"
},
{
"name": "PHP",
"bytes": "81690"
},
{
"name": "Vue",
"bytes": "561"
}
]
}
|
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace ProductReviews {
public partial class Register {
/// <summary>
/// form1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// RequiredFieldValidator1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator1;
/// <summary>
/// first_name control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox first_name;
/// <summary>
/// RequiredFieldValidator2 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator2;
/// <summary>
/// last_name control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox last_name;
/// <summary>
/// RequiredFieldValidator3 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator3;
/// <summary>
/// RegularExpressionValidatorEmail control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.RegularExpressionValidator RegularExpressionValidatorEmail;
/// <summary>
/// email control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox email;
/// <summary>
/// RequiredFieldValidator5 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator5;
/// <summary>
/// password control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox password;
/// <summary>
/// RequiredFieldValidator4 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator4;
/// <summary>
/// CompareValidatorPassword control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.CompareValidator CompareValidatorPassword;
/// <summary>
/// confirm_password control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox confirm_password;
/// <summary>
/// RegisterButton control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Button RegisterButton;
}
}
|
{
"content_hash": "7b7016b9e0e0c86c3a55c4d1b4c297f9",
"timestamp": "",
"source": "github",
"line_count": 141,
"max_line_length": 111,
"avg_line_length": 37.212765957446805,
"alnum_prop": 0.5620354488279017,
"repo_name": "tegaphilip/ProductReviews",
"id": "807ba8d086f12aa50f04e99bcc1eed173797fb7a",
"size": "5249",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ProductReviews/Register.aspx.designer.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "15146"
},
{
"name": "C#",
"bytes": "21320"
},
{
"name": "CSS",
"bytes": "489"
},
{
"name": "JavaScript",
"bytes": "484"
}
]
}
|
package life.qzz.springboot.demo5;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
@Component
public class MyBean {
@Value("${name}")
private String name;
@PostConstruct
public void print(){
System.out.println("属性值:" + name);
}
}
|
{
"content_hash": "5ed2f1650e23a65f41efe553a12cf6b8",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 58,
"avg_line_length": 21.235294117647058,
"alnum_prop": 0.7202216066481995,
"repo_name": "qzzsunly/springboot-demo",
"id": "fced521abd166624bd014461754002ce96be7b04",
"size": "369",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "demo5/src/main/java/life/qzz/springboot/demo5/MyBean.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "9988"
},
{
"name": "Java",
"bytes": "14698"
},
{
"name": "Shell",
"bytes": "12936"
}
]
}
|
[Fritbot](https://github.com/Urthen/fritbot) module master template and automation. This script creates a skeleton for clean Fritbot module development intended for public distribution. This script is *not* required if you only wish to develop a module for your own purposes and have no intent to distribute it, you can simply add your module to the `modules/` directory in your bot instance.
## Setup
* Clone this repository into the folder where you want your generated module(s) to go
* `npm install -g grunt-cli` to install grunt-cli globally
* `npm install` to install local requirements
* The first time you use this script, it will prompt you for your name and Github username. This information will be stored and templated in to all future modules you create. It can be modified by changing the `.config.json` file generated.
## Generating Modules
To generate a module, simply run `grunt create --name=your-lovely-module`. This will create a blank module matching that name in the folder containing `fb-module-master/`.
We recommend all module names developed by third parties follow the naming prefix convention:
* **fb-contrib-** for general purpose modules and scripts
* **fb-lang-** for language translation files
* **fb-pkg-** for packages of modules
* **fb-*(name)*-connector** for chat connectors
* Do not use *fb-opt-* or *fb-core-* as they are reserved for modules created and supported by the core Fritbot team.
Check [npmjs](https://www.npmjs.com/) before creating your module as you will need to publish your module, and cannot conflict with any names. If there are conflicts, get creative.
## Developing Modules
This is a quick overview of developing modules. For more information, see other Fritbot modules for examples.
Your `index.js` file is the entry point to your module: It tells Fribot information about the module, initialization functions, commands, listeners, and and child sub-modules the module has. It lives in the root directory of the module, other module code should live in `src/` if it is neccesary (though ultimately code structure is up to you).
As you are developing, you'll find it much easier to run a local version of your module rather than publishing, testing, tweaking, publishing again, etc. To do this, run `npm link` in the module directory, then `npm link (your module name)` in your bot instance directory. This will create a soft-link between the module directory and the node_modules in your bot instance, allowing you to work as if it were installed normally without having to publish it. Note this works locally but you will have to publish your module correctly before pushing a bot using it to Heroku.
The module loader looks for two things when deciding whether or not to load a package as a Fritbot module. If you are having trouble getting your module to load, ensure you have met the following:
* The module must have the *fritbot-module* keyword defined in `package.json`
* The module must have a `displayname` parameter exposed in `module.exports` by `index.js`
## Publishing Modules
Once you've gotten your module ready to go, [publish it to npmjs](https://docs.npmjs.com/getting-started/publishing-npm-packages) as you would any other package. Any other Fritbot user can now install and use your module!
I have also included the grunt [jscs](https://github.com/jscs-dev/grunt-jscs), [jshint](https://github.com/gruntjs/grunt-contrib-jshint), and [push-release](https://github.com/JonnyBGod/grunt-push-release) plugins in the standard gruntfile. Checking your code style is an option step, but preferred if you want your module in the official lists. To check your style, run `grunt style`.
To bump the version and release, run `grunt push:(major/minor/patch)` (which will push to github) and then `npm publish`. We recommend you follow [semantic versioning](http://semver.org/) for determining whether to bump the major, minor, or patch version numbers.
|
{
"content_hash": "11791f9a62a9639c8861ada95bcc1e9c",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 573,
"avg_line_length": 91.5813953488372,
"alnum_prop": 0.7783138649060437,
"repo_name": "Urthen/fritbot-module-master",
"id": "cf44197700e556b621c5d4558c200724c0f0ba31",
"size": "3965",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "3649"
},
{
"name": "Smarty",
"bytes": "602"
}
]
}
|
'-------------------------------------------------------------------------------------------'
' Inicio del codigo
'-------------------------------------------------------------------------------------------'
' Importando librerias
'-------------------------------------------------------------------------------------------'
Imports System.Data
'-------------------------------------------------------------------------------------------'
' Inicio de clase "MCL_fPagos_Cheque01"
'-------------------------------------------------------------------------------------------'
Partial Class MCL_fPagos_Cheque01
Inherits vis2formularios.frmReporte
Dim loObjetoReporte As CrystalDecisions.CrystalReports.Engine.ReportDocument
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Try
Dim loComandoSeleccionar As New StringBuilder()
loComandoSeleccionar.AppendLine("SELECT Pagos.Cod_Pro AS Cod_Pro,")
loComandoSeleccionar.AppendLine(" Proveedores.Nom_Pro AS Nom_Pro,")
loComandoSeleccionar.AppendLine(" Pagos.Documento AS Documento,")
loComandoSeleccionar.AppendLine(" Pagos.Fec_Ini AS Fec_Ini,")
loComandoSeleccionar.AppendLine(" Pagos.Mon_Bru AS Mon_Bru_Enc,")
loComandoSeleccionar.AppendLine(" (Pagos.Mon_Des * -1) AS Mon_Des,")
loComandoSeleccionar.AppendLine(" Pagos.Mon_Net AS Mon_Net_Enc,")
loComandoSeleccionar.AppendLine(" (Pagos.Mon_Ret * -1) AS Mon_Ret_Enc,")
loComandoSeleccionar.AppendLine(" Pagos.Comentario AS Comentario,")
loComandoSeleccionar.AppendLine(" Detalles_Pagos.Num_Doc AS Referencia, ")
loComandoSeleccionar.AppendLine(" Cuentas_Bancarias.Num_Cue AS Num_Cue_Cheque, ")
loComandoSeleccionar.AppendLine(" Bancos.Nom_Ban AS Nom_Ban_Che, ")
loComandoSeleccionar.AppendLine(" Renglones_Pagos.Cod_Tip AS Cod_Tip,")
loComandoSeleccionar.AppendLine(" Renglones_Pagos.Doc_Ori AS Doc_Ori,")
loComandoSeleccionar.AppendLine(" Renglones_Pagos.Renglon AS Renglon,")
loComandoSeleccionar.AppendLine(" Renglones_Pagos.Mon_Bru AS Mon_Bru,")
loComandoSeleccionar.AppendLine(" Renglones_Pagos.Mon_Imp AS Mon_Imp,")
loComandoSeleccionar.AppendLine(" Renglones_Pagos.Mon_Abo AS Mon_Abo,")
loComandoSeleccionar.AppendLine(" Renglones_Pagos.Mon_Net AS Mon_Net_Ren,")
loComandoSeleccionar.AppendLine(" CAST('' as char(400)) AS Mon_Let, ")
loComandoSeleccionar.AppendLine(" Campos_Propiedades.Val_Car AS Nom_Cob ")
loComandoSeleccionar.AppendLine("FROM Pagos ")
loComandoSeleccionar.AppendLine(" JOIN Renglones_Pagos ON Pagos.Documento = Renglones_Pagos.Documento")
loComandoSeleccionar.AppendLine(" JOIN Proveedores ON Pagos.Cod_Pro = Proveedores.Cod_Pro")
loComandoSeleccionar.AppendLine(" JOIN Detalles_Pagos ON (Pagos.Documento = Detalles_Pagos.Documento ")
loComandoSeleccionar.AppendLine(" AND Detalles_Pagos.Tip_Ope = 'Cheque' ")
loComandoSeleccionar.AppendLine(" AND Detalles_Pagos.Renglon = '1')")
loComandoSeleccionar.AppendLine(" JOIN Cuentas_Bancarias ON (Cuentas_Bancarias.Cod_Cue = Detalles_Pagos.Cod_Cue) ")
loComandoSeleccionar.AppendLine(" JOIN Bancos ON (Bancos.Cod_ban = Cuentas_Bancarias.Cod_Ban) ")
loComandoSeleccionar.AppendLine(" LEFT JOIN Campos_Propiedades ON Pagos.Documento = Campos_Propiedades.Cod_Reg ")
loComandoSeleccionar.AppendLine(" AND Campos_Propiedades.Cod_Pro = 'NOMCOBCHE2' ")
loComandoSeleccionar.AppendLine(" AND Campos_Propiedades.Origen = 'Pagos' ")
loComandoSeleccionar.AppendLine("WHERE " & cusAplicacion.goFormatos.pcCondicionPrincipal)
'Me.mEscribirConsulta(loComandoSeleccionar.ToString())
Dim loServicios As New cusDatos.goDatos
Dim laDatosReporte As DataSet = loServicios.mObtenerTodosSinEsquema(loComandoSeleccionar.ToString, "curReportes")
Dim lnMontoNumero As Decimal
For Each loFilas As DataRow In laDatosReporte.Tables(0).Rows
lnMontoNumero = CDec(loFilas.Item("Mon_Net_Enc"))
loFilas.Item("Mon_Let") = goServicios.mConvertirMontoLetras(lnMontoNumero)
Next loFilas
loObjetoReporte = cusAplicacion.goFormatos.mCargarInforme("MCL_fPagos_Cheque01", laDatosReporte)
Me.mTraducirReporte(loObjetoReporte)
Me.mFormatearCamposReporte(loObjetoReporte)
Me.crvMCL_fPagos_Cheque01.ReportSource = loObjetoReporte
Catch loExcepcion As Exception
Me.WbcAdministradorMensajeModal.mMostrarMensajeModal("Error", _
"No se pudo Completar el Proceso: " & loExcepcion.Message, _
vis3Controles.wbcAdministradorMensajeModal.enumTipoMensaje.KN_Error, _
"auto", _
"auto")
End Try
End Sub
Protected Sub Page_Unload(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Unload
Try
loObjetoReporte.Close()
Catch loExcepcion As Exception
End Try
End Sub
End Class
'-------------------------------------------------------------------------------------------'
' Fin del codigo
'-------------------------------------------------------------------------------------------'
' JJD: 13/05/11: Codigo inicial
'-------------------------------------------------------------------------------------------'
' JJD: 11/03/15: Ajuste para el cliente MERCALUM
'-------------------------------------------------------------------------------------------'
' RJG: 09/04/15: Continuacion de los ajustes para el cliente CEGASA: número de cheque, banco'
' y cuenta. Ajuste de posicion de etiquetas. Número de factura de proveedor. '
'-------------------------------------------------------------------------------------------'
|
{
"content_hash": "6a6afdfc81bdbf6d41cb3a804141a96a",
"timestamp": "",
"source": "github",
"line_count": 113,
"max_line_length": 129,
"avg_line_length": 56.424778761061944,
"alnum_prop": 0.5501882057716436,
"repo_name": "kodeitsolutions/ef-reports",
"id": "0c30b20d819df424b346d4ca24e4d58e1737c888",
"size": "6380",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "MCL_fPagos_Cheque01.aspx.vb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "6246816"
},
{
"name": "Visual Basic",
"bytes": "25803337"
}
]
}
|
using System;
namespace SampleWebsite.MoreModels.Nested
{
public class NestedModel
{
public Guid? Id { get; set; }
}
}
|
{
"content_hash": "e4ef34917c99d383513753d70381ffb3",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 41,
"avg_line_length": 15.555555555555555,
"alnum_prop": 0.6357142857142857,
"repo_name": "slovely/TypeScriptDefinitionsGenerator",
"id": "88e5029c317a02441081254c8f045e9cc4b4a99e",
"size": "142",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/SampleWebsite.MoreModels/Nested/NestedModel.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP.NET",
"bytes": "107"
},
{
"name": "Batchfile",
"bytes": "117"
},
{
"name": "C#",
"bytes": "136015"
},
{
"name": "CSS",
"bytes": "315"
},
{
"name": "HTML",
"bytes": "3228"
},
{
"name": "Handlebars",
"bytes": "2514"
},
{
"name": "JavaScript",
"bytes": "133218"
},
{
"name": "TypeScript",
"bytes": "10914"
}
]
}
|
package gitlab
import (
"net/http"
"testing"
"github.com/drone/drone/plugin/remote/gitlab/testdata"
"github.com/drone/drone/shared/model"
"github.com/franela/goblin"
)
func Test_Github(t *testing.T) {
// setup a dummy github server
var server = testdata.NewServer()
defer server.Close()
var gitlab = New(server.URL, false, false)
var user = model.User{
Access: "e3b0c44298fc1c149afbf4c8996fb",
}
/*
var repo = model.Repo{
Owner: "gitlab",
Name: "Hello-World",
}
var commit = model.Commit{
Sha: "6dcb09b5b57875f334f61aebed695e2e4193db5e",
}
*/
g := goblin.Goblin(t)
g.Describe("Gitlab Plugin", func() {
g.It("Should authorize user", func() {
var req, _ = http.NewRequest("GET", "/login/gitlab", nil)
var login, err = gitlab.Authorize(nil, req)
g.Assert(err == nil).IsTrue()
g.Assert(login.Email).Equal("john@example.com")
g.Assert(login.Name).Equal("John Smith")
g.Assert(login.Login).Equal("john_smith")
g.Assert(login.Access).Equal("dd34asd13as")
g.Assert(login.ID).Equal(int64(1))
})
g.It("Should get the repo list", func() {
var repos, err = gitlab.GetRepos(&user)
g.Assert(err == nil).IsTrue()
g.Assert(len(repos)).Equal(2)
g.Assert(repos[0].Name).Equal("diaspora-client")
g.Assert(repos[0].Owner).Equal("diaspora")
g.Assert(repos[0].Host).Equal(gitlab.GetHost())
g.Assert(repos[0].Remote).Equal(gitlab.GetKind())
g.Assert(repos[0].Private).Equal(true)
g.Assert(repos[0].Role.Admin).Equal(true)
g.Assert(repos[0].Role.Read).Equal(true)
g.Assert(repos[0].Role.Write).Equal(true)
})
/*
g.It("Should get the build script", func() {
var script, err = github.GetScript(&user, &repo, &commit)
g.Assert(err == nil).IsTrue()
g.Assert(string(script)).Equal("image: go")
})
g.It("Should activate a public repo", func() {
repo.Private = false
repo.CloneURL = "git://github.com/octocat/Hello-World.git"
repo.SSHURL = "git@github.com:octocat/Hello-World.git"
var err = github.Activate(&user, &repo, "http://example.com")
g.Assert(err == nil).IsTrue()
})
g.It("Should activate a private repo", func() {
repo.Name = "Hola-Mundo"
repo.Private = true
repo.CloneURL = "git@github.com:octocat/Hola-Mundo.git"
repo.SSHURL = "git@github.com:octocat/Hola-Mundo.git"
var err = github.Activate(&user, &repo, "http://example.com")
g.Assert(err == nil).IsTrue()
})
*/
g.It("Should parse a commit hook")
g.It("Should ignore a pull request hook")
})
}
|
{
"content_hash": "60be0ff14219ef86200317bb5a9c8213",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 65,
"avg_line_length": 29.313953488372093,
"alnum_prop": 0.6548988496628322,
"repo_name": "shawnzhu/drone",
"id": "81d0d4e53155a16547cc70b6f24a54be57733b22",
"size": "2521",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "plugin/remote/gitlab/gitlab_test.go",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "42496"
},
{
"name": "Go",
"bytes": "460292"
},
{
"name": "JavaScript",
"bytes": "40765"
},
{
"name": "Makefile",
"bytes": "3660"
},
{
"name": "Shell",
"bytes": "6694"
}
]
}
|
<!DOCTYPE html>
<html devsite>
<head><meta name="robots" content="noindex">
<meta name="project_path" value="/web/tools/workbox/_project.yaml" />
<meta name="book_path" value="/web/tools/workbox/_book.yaml" />
<meta name="gtm_var" data-key="docType" data-value="reference">
<title>Class: Workbox</title>
<link href="jsdoc.css" rel="stylesheet">
</head>
<body>
<div id="jsdoc-body-container">
<div id="jsdoc-content">
<div id="jsdoc-content-container">
<div id="jsdoc-main" role="main">
<header class="page-header">
<h1><small><a href="module-workbox-window.html">workbox-window</a>.<wbr></small><span class="symbol-name">Workbox</span></h1>
<div class="symbol-detail-labels"><span class="label label-kind"><small>class</small></span> <span class="label label-static"><small>static</small></span></div>
<div class="symbol-detail-labels">
<span class="label label-kind"><small>Version</small></span>
<span class="label label-version"><small>5.1.2</small></span>
</div>
<p>A class to aid in handling service worker registration, updates, and
reacting to service worker lifecycle events.</p>
</header>
<section>
<h2>Constructor</h2>
<section>
<h3 id="Workbox" class="symbol-name">Workbox</h3>
<p class="type-signature"> new
Workbox(scriptURL, registerOptions)</p>
<p>Creates a new Workbox instance with a script URL and service worker
options. The script URL and options are the same as those used when
calling <code>navigator.serviceWorker.register(scriptURL, options)</code>. See:
https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/register</p>
<section>
<table class="function param responsive">
<tr>
<th colspan="2">
<h4>Parameter</h4>
</th>
</tr>
<tbody>
<tr>
<td class="details-table-name">
<p>scriptURL</p>
</td>
<td>
<p class="details-table-types">string</p>
<p>The service worker script associated with this
instance.</p>
</td>
</tr>
<tr>
<td class="details-table-name">
<p>registerOptions</p>
</td>
<td>
<p class="details-table-optional">Optional</p>
<p class="details-table-types">Object</p>
<p>The service worker options associated
with this instance.</p>
</td>
</tr>
</tbody>
</table>
</section>
<dl class="dl-compact">
<dt>Fires</dt>
<dd><a href="module-workbox-window.Workbox.html#event:message">message</a></dd>
<dd><a href="module-workbox-window.Workbox.html#event:installed">installed</a></dd>
<dd><a href="module-workbox-window.Workbox.html#event:waiting">waiting</a></dd>
<dd><a href="module-workbox-window.Workbox.html#event:controlling">controlling</a></dd>
<dd><a href="module-workbox-window.Workbox.html#event:activated">activated</a></dd>
<dd><a href="module-workbox-window.Workbox.html#event:redundant">redundant</a></dd>
<dd><a href="module-workbox-window.Workbox.html#event:externalinstalled">externalinstalled</a></dd>
<dd><a href="module-workbox-window.Workbox.html#event:externalwaiting">externalwaiting</a></dd>
<dd><a href="module-workbox-window.Workbox.html#event:externalactivated">externalactivated</a></dd>
</dl>
</section>
</section>
<section>
<h2>Properties</h2>
<section>
<h3 id="active" class="symbol-name">active</h3>
<p class="type-signature"></p>
<p>Resolves to the service worker registered by this instance as soon as it
is active. If a service worker was already controlling at registration
time then it will resolve to that if the script URLs (and optionally
script versions) match, otherwise it will wait until an update is found
and activates.</p>
<dl class="dl-compact">
<dt>Returns</dt>
<dd>
<p><code>Promise containing ServiceWorker</code> </p>
</dd>
</dl>
<h3 id="controlling" class="symbol-name">controlling</h3>
<p class="type-signature"></p>
<p>Resolves to the service worker registered by this instance as soon as it
is controlling the page. If a service worker was already controlling at
registration time then it will resolve to that if the script URLs (and
optionally script versions) match, otherwise it will wait until an update
is found and starts controlling the page.
Note: the first time a service worker is installed it will active but
not start controlling the page unless <code>clients.claim()</code> is called in the
service worker.</p>
<dl class="dl-compact">
<dt>Returns</dt>
<dd>
<p><code>Promise containing ServiceWorker</code> </p>
</dd>
</dl>
</section>
<h2>Methods</h2>
<section>
<h3 id="getSW" class="symbol-name">getSW</h3>
<div class="symbol-detail-labels"><span class="label label-async"><small>async</small></span></div>
<p class="type-signature"> getSW() returns Promise containing ServiceWorker</p>
<p>Resolves with a reference to a service worker that matches the script URL
of this instance, as soon as it's available.</p>
<p>If, at registration time, there's already an active or waiting service
worker with a matching script URL, it will be used (with the waiting
service worker taking precedence over the active service worker if both
match, since the waiting service worker would have been registered more
recently).
If there's no matching active or waiting service worker at registration
time then the promise will not resolve until an update is found and starts
installing, at which point the installing service worker is used.</p>
<dl class="dl-compact">
<dt>Returns</dt>
<dd>
<p><code>Promise containing ServiceWorker</code> </p>
</dd>
</dl>
<h3 id="messageSW" class="symbol-name">messageSW</h3>
<div class="symbol-detail-labels"><span class="label label-async"><small>async</small></span></div>
<p class="type-signature"> messageSW(data) returns Promise containing Object</p>
<p>Sends the passed data object to the service worker registered by this
instance (via <a href="module-workbox-window.Workbox.html#getSW"><code>getSW()</code></a>) and resolves
with a response (if any).</p>
<p>A response can be set in a message handler in the service worker by
calling <code>event.ports[0].postMessage(...)</code>, which will resolve the promise
returned by <code>messageSW()</code>. If no response is set, the promise will never
resolve.</p>
<section>
<table class="function param responsive">
<tr>
<th colspan="2">
<h4>Parameter</h4>
</th>
</tr>
<tbody>
<tr>
<td class="details-table-name">
<p>data</p>
</td>
<td>
<p class="details-table-types">Object</p>
<p>An object to send to the service worker</p>
</td>
</tr>
</tbody>
</table>
</section>
<dl class="dl-compact">
<dt>Returns</dt>
<dd>
<p><code>Promise containing Object</code> </p>
</dd>
</dl>
<h3 id="register" class="symbol-name">register</h3>
<div class="symbol-detail-labels"><span class="label label-async"><small>async</small></span></div>
<p class="type-signature"> register(options)</p>
<p>Registers a service worker for this instances script URL and service
worker options. By default this method delays registration until after
the window has loaded.</p>
<section>
<table class="function param responsive">
<tr>
<th colspan="2">
<h4>Parameter</h4>
</th>
</tr>
<tbody>
<tr>
<td class="details-table-name">
<p>options</p>
</td>
<td>
<p class="details-table-optional">Optional</p>
<p class="details-table-types">Object</p>
<p>Values in <code>options</code> have the following properties:</p>
<table class="function param responsive">
<tr>
<th colspan="2">
<h4>Parameter</h4>
</th>
</tr>
<tbody>
<tr>
<td class="details-table-name">
<p>immediate</p>
</td>
<td>
<p class="details-table-optional">Optional</p>
<p class="details-table-types">function()</p>
<p>Setting this to true will
register the service worker immediately, even if the window has
not loaded (not recommended).</p>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</section>
<dl class="dl-compact">
</dl>
<h3 id="update" class="symbol-name">update</h3>
<div class="symbol-detail-labels"><span class="label label-async"><small>async</small></span></div>
<p class="type-signature"> update()</p>
<p>Checks for updates of the registered service worker.</p>
<dl class="dl-compact">
</dl>
</section>
<h2>Events</h2>
<section>
<h3 id="event:activated" class="symbol-name">activated</h3>
<p class="type-signature">WorkboxEvent</p>
<p>The <code>activated</code> event is dispatched if the state of a
<a href="module-workbox-window.Workbox.html"><code>Workbox</code></a> instance's
<a href="/web/tools/workbox/modules/workbox-precaching#def-registered-sw">registered service worker</a>
changes to <code>activated</code>.</p>
<section>
<h4>Properties</h4>
<table class="function param responsive">
<tr>
<th colspan="2">
<h4>Parameter</h4>
</th>
</tr>
<tbody>
<tr>
<td class="details-table-name">
<p>sw</p>
</td>
<td>
<p class="details-table-types">ServiceWorker</p>
<p>The service worker instance.</p>
</td>
</tr>
<tr>
<td class="details-table-name">
<p>originalEvent</p>
</td>
<td>
<p class="details-table-types">Event</p>
<p>The original <a href="https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorker/onstatechange"><code>statechange</code></a>
event.</p>
</td>
</tr>
<tr>
<td class="details-table-name">
<p>isUpdate</p>
</td>
<td>
<p class="details-table-types">(boolean or undefined)</p>
<p>True if a service worker was already
controlling when this <code>Workbox</code> instance called <code>register()</code>.</p>
</td>
</tr>
<tr>
<td class="details-table-name">
<p>type</p>
</td>
<td>
<p class="details-table-types">string</p>
<p><code>activated</code>.</p>
</td>
</tr>
<tr>
<td class="details-table-name">
<p>target</p>
</td>
<td>
<p class="details-table-types">Workbox</p>
<p>The <code>Workbox</code> instance.</p>
</td>
</tr>
</tbody>
</table>
</section>
<dl class="dl-compact">
</dl>
<h3 id="event:controlling" class="symbol-name">controlling</h3>
<p class="type-signature">WorkboxEvent</p>
<p>The <code>controlling</code> event is dispatched if a
<a href="https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/oncontrollerchange"><code>controllerchange</code></a>
fires on the service worker <a href="https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer">container</a>
and the <a href="https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorker/scriptURL"><code>scriptURL</code></a>
of the new <a href="https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/controller">controller</a>
matches the <code>scriptURL</code> of the <code>Workbox</code> instance's
<a href="/web/tools/workbox/modules/workbox-precaching#def-registered-sw">registered service worker</a>.</p>
<section>
<h4>Properties</h4>
<table class="function param responsive">
<tr>
<th colspan="2">
<h4>Parameter</h4>
</th>
</tr>
<tbody>
<tr>
<td class="details-table-name">
<p>sw</p>
</td>
<td>
<p class="details-table-types">ServiceWorker</p>
<p>The service worker instance.</p>
</td>
</tr>
<tr>
<td class="details-table-name">
<p>originalEvent</p>
</td>
<td>
<p class="details-table-types">Event</p>
<p>The original <a href="https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/oncontrollerchange"><code>controllerchange</code></a>
event.</p>
</td>
</tr>
<tr>
<td class="details-table-name">
<p>isUpdate</p>
</td>
<td>
<p class="details-table-types">(boolean or undefined)</p>
<p>True if a service worker was already
controlling when this service worker was registered.</p>
</td>
</tr>
<tr>
<td class="details-table-name">
<p>type</p>
</td>
<td>
<p class="details-table-types">string</p>
<p><code>controlling</code>.</p>
</td>
</tr>
<tr>
<td class="details-table-name">
<p>target</p>
</td>
<td>
<p class="details-table-types">Workbox</p>
<p>The <code>Workbox</code> instance.</p>
</td>
</tr>
</tbody>
</table>
</section>
<dl class="dl-compact">
</dl>
<h3 id="event:externalactivated" class="symbol-name">externalactivated</h3>
<p class="type-signature">WorkboxEvent</p>
<p>The <code>externalactivated</code> event is dispatched if the state of an
<a href="/web/tools/workbox/modules/workbox-window#when_an_unexpected_version_of_the_service_worker_is_found">external service worker</a>
changes to <code>activated</code>.</p>
<section>
<h4>Properties</h4>
<table class="function param responsive">
<tr>
<th colspan="2">
<h4>Parameter</h4>
</th>
</tr>
<tbody>
<tr>
<td class="details-table-name">
<p>sw</p>
</td>
<td>
<p class="details-table-types">ServiceWorker</p>
<p>The service worker instance.</p>
</td>
</tr>
<tr>
<td class="details-table-name">
<p>originalEvent</p>
</td>
<td>
<p class="details-table-types">Event</p>
<p>The original <a href="https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorker/onstatechange"><code>statechange</code></a>
event.</p>
</td>
</tr>
<tr>
<td class="details-table-name">
<p>type</p>
</td>
<td>
<p class="details-table-types">string</p>
<p><code>externalactivated</code>.</p>
</td>
</tr>
<tr>
<td class="details-table-name">
<p>target</p>
</td>
<td>
<p class="details-table-types">Workbox</p>
<p>The <code>Workbox</code> instance.</p>
</td>
</tr>
</tbody>
</table>
</section>
<dl class="dl-compact">
</dl>
<h3 id="event:externalinstalled" class="symbol-name">externalinstalled</h3>
<p class="type-signature">WorkboxEvent</p>
<p>The <code>externalinstalled</code> event is dispatched if the state of an
<a href="/web/tools/workbox/modules/workbox-window#when_an_unexpected_version_of_the_service_worker_is_found">external service worker</a>
changes to <code>installed</code>.</p>
<section>
<h4>Properties</h4>
<table class="function param responsive">
<tr>
<th colspan="2">
<h4>Parameter</h4>
</th>
</tr>
<tbody>
<tr>
<td class="details-table-name">
<p>sw</p>
</td>
<td>
<p class="details-table-types">ServiceWorker</p>
<p>The service worker instance.</p>
</td>
</tr>
<tr>
<td class="details-table-name">
<p>originalEvent</p>
</td>
<td>
<p class="details-table-types">Event</p>
<p>The original <a href="https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorker/onstatechange"><code>statechange</code></a>
event.</p>
</td>
</tr>
<tr>
<td class="details-table-name">
<p>type</p>
</td>
<td>
<p class="details-table-types">string</p>
<p><code>externalinstalled</code>.</p>
</td>
</tr>
<tr>
<td class="details-table-name">
<p>target</p>
</td>
<td>
<p class="details-table-types">Workbox</p>
<p>The <code>Workbox</code> instance.</p>
</td>
</tr>
</tbody>
</table>
</section>
<dl class="dl-compact">
</dl>
<h3 id="event:externalwaiting" class="symbol-name">externalwaiting</h3>
<p class="type-signature">WorkboxEvent</p>
<p>The <code>externalwaiting</code> event is dispatched if the state of an
<a href="/web/tools/workbox/modules/workbox-window#when_an_unexpected_version_of_the_service_worker_is_found">external service worker</a>
changes to <code>waiting</code>.</p>
<section>
<h4>Properties</h4>
<table class="function param responsive">
<tr>
<th colspan="2">
<h4>Parameter</h4>
</th>
</tr>
<tbody>
<tr>
<td class="details-table-name">
<p>sw</p>
</td>
<td>
<p class="details-table-types">ServiceWorker</p>
<p>The service worker instance.</p>
</td>
</tr>
<tr>
<td class="details-table-name">
<p>originalEvent</p>
</td>
<td>
<p class="details-table-types">Event</p>
<p>The original <a href="https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorker/onstatechange"><code>statechange</code></a>
event.</p>
</td>
</tr>
<tr>
<td class="details-table-name">
<p>type</p>
</td>
<td>
<p class="details-table-types">string</p>
<p><code>externalwaiting</code>.</p>
</td>
</tr>
<tr>
<td class="details-table-name">
<p>target</p>
</td>
<td>
<p class="details-table-types">Workbox</p>
<p>The <code>Workbox</code> instance.</p>
</td>
</tr>
</tbody>
</table>
</section>
<dl class="dl-compact">
</dl>
<h3 id="event:installed" class="symbol-name">installed</h3>
<p class="type-signature">WorkboxEvent</p>
<p>The <code>installed</code> event is dispatched if the state of a
<a href="module-workbox-window.Workbox.html"><code>Workbox</code></a> instance's
<a href="/web/tools/workbox/modules/workbox-precaching#def-registered-sw">registered service worker</a>
changes to <code>installed</code>.</p>
<p>Then can happen either the very first time a service worker is installed,
or after an update to the current service worker is found. In the case
of an update being found, the event's <code>isUpdate</code> property will be <code>true</code>.</p>
<section>
<h4>Properties</h4>
<table class="function param responsive">
<tr>
<th colspan="2">
<h4>Parameter</h4>
</th>
</tr>
<tbody>
<tr>
<td class="details-table-name">
<p>sw</p>
</td>
<td>
<p class="details-table-types">ServiceWorker</p>
<p>The service worker instance.</p>
</td>
</tr>
<tr>
<td class="details-table-name">
<p>originalEvent</p>
</td>
<td>
<p class="details-table-types">Event</p>
<p>The original <a href="https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorker/onstatechange"><code>statechange</code></a>
event.</p>
</td>
</tr>
<tr>
<td class="details-table-name">
<p>isUpdate</p>
</td>
<td>
<p class="details-table-types">(boolean or undefined)</p>
<p>True if a service worker was already
controlling when this <code>Workbox</code> instance called <code>register()</code>.</p>
</td>
</tr>
<tr>
<td class="details-table-name">
<p>type</p>
</td>
<td>
<p class="details-table-types">string</p>
<p><code>installed</code>.</p>
</td>
</tr>
<tr>
<td class="details-table-name">
<p>target</p>
</td>
<td>
<p class="details-table-types">Workbox</p>
<p>The <code>Workbox</code> instance.</p>
</td>
</tr>
</tbody>
</table>
</section>
<dl class="dl-compact">
</dl>
<h3 id="event:message" class="symbol-name">message</h3>
<p class="type-signature">WorkboxEvent</p>
<p>The <code>message</code> event is dispatched any time a <code>postMessage</code> is received.</p>
<section>
<h4>Properties</h4>
<table class="function param responsive">
<tr>
<th colspan="2">
<h4>Parameter</h4>
</th>
</tr>
<tbody>
<tr>
<td class="details-table-name">
<p>data</p>
</td>
<td>
<p class="details-table-types">any type</p>
<p>The <code>data</code> property from the original <code>message</code> event.</p>
</td>
</tr>
<tr>
<td class="details-table-name">
<p>originalEvent</p>
</td>
<td>
<p class="details-table-types">Event</p>
<p>The original <a href="https://developer.mozilla.org/en-US/docs/Web/API/MessageEvent"><code>message</code></a>
event.</p>
</td>
</tr>
<tr>
<td class="details-table-name">
<p>type</p>
</td>
<td>
<p class="details-table-types">string</p>
<p><code>message</code>.</p>
</td>
</tr>
<tr>
<td class="details-table-name">
<p>target</p>
</td>
<td>
<p class="details-table-types">Workbox</p>
<p>The <code>Workbox</code> instance.</p>
</td>
</tr>
</tbody>
</table>
</section>
<dl class="dl-compact">
</dl>
<h3 id="event:redundant" class="symbol-name">redundant</h3>
<p class="type-signature">WorkboxEvent</p>
<p>The <code>redundant</code> event is dispatched if the state of a
<a href="module-workbox-window.Workbox.html"><code>Workbox</code></a> instance's
<a href="/web/tools/workbox/modules/workbox-precaching#def-registered-sw">registered service worker</a>
changes to <code>redundant</code>.</p>
<section>
<h4>Properties</h4>
<table class="function param responsive">
<tr>
<th colspan="2">
<h4>Parameter</h4>
</th>
</tr>
<tbody>
<tr>
<td class="details-table-name">
<p>sw</p>
</td>
<td>
<p class="details-table-types">ServiceWorker</p>
<p>The service worker instance.</p>
</td>
</tr>
<tr>
<td class="details-table-name">
<p>originalEvent</p>
</td>
<td>
<p class="details-table-types">Event</p>
<p>The original <a href="https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorker/onstatechange"><code>statechange</code></a>
event.</p>
</td>
</tr>
<tr>
<td class="details-table-name">
<p>isUpdate</p>
</td>
<td>
<p class="details-table-types">(boolean or undefined)</p>
<p>True if a service worker was already
controlling when this <code>Workbox</code> instance called <code>register()</code>.</p>
</td>
</tr>
<tr>
<td class="details-table-name">
<p>type</p>
</td>
<td>
<p class="details-table-types">string</p>
<p><code>redundant</code>.</p>
</td>
</tr>
<tr>
<td class="details-table-name">
<p>target</p>
</td>
<td>
<p class="details-table-types">Workbox</p>
<p>The <code>Workbox</code> instance.</p>
</td>
</tr>
</tbody>
</table>
</section>
<dl class="dl-compact">
</dl>
<h3 id="event:waiting" class="symbol-name">waiting</h3>
<p class="type-signature">WorkboxEvent</p>
<p>The <code>waiting</code> event is dispatched if the state of a
<a href="module-workbox-window.Workbox.html"><code>Workbox</code></a> instance's
<a href="/web/tools/workbox/modules/workbox-precaching#def-registered-sw">registered service worker</a>
changes to <code>installed</code> and then doesn't immediately change to <code>activating</code>.
It may also be dispatched if a service worker with the same
<a href="https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorker/scriptURL"><code>scriptURL</code></a>
was already waiting when the <a href="module-workbox-window.Workbox.html#register"><code>register()</code></a>
method was called.</p>
<section>
<h4>Properties</h4>
<table class="function param responsive">
<tr>
<th colspan="2">
<h4>Parameter</h4>
</th>
</tr>
<tbody>
<tr>
<td class="details-table-name">
<p>sw</p>
</td>
<td>
<p class="details-table-types">ServiceWorker</p>
<p>The service worker instance.</p>
</td>
</tr>
<tr>
<td class="details-table-name">
<p>originalEvent</p>
</td>
<td>
<p class="details-table-types">(Event or undefined)</p>
<p>The original
<a href="https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorker/onstatechange"><code>statechange</code></a>
event, or <code>undefined</code> in the case where the service worker was waiting
to before <code>.register()</code> was called.</p>
</td>
</tr>
<tr>
<td class="details-table-name">
<p>isUpdate</p>
</td>
<td>
<p class="details-table-types">(boolean or undefined)</p>
<p>True if a service worker was already
controlling when this <code>Workbox</code> instance called <code>register()</code>.</p>
</td>
</tr>
<tr>
<td class="details-table-name">
<p>wasWaitingBeforeRegister</p>
</td>
<td>
<p class="details-table-types">(boolean or undefined)</p>
<p>True if a service worker with
a matching <code>scriptURL</code> was already waiting when this <code>Workbox</code>
instance called <code>register()</code>.</p>
</td>
</tr>
<tr>
<td class="details-table-name">
<p>type</p>
</td>
<td>
<p class="details-table-types">string</p>
<p><code>waiting</code>.</p>
</td>
</tr>
<tr>
<td class="details-table-name">
<p>target</p>
</td>
<td>
<p class="details-table-types">Workbox</p>
<p>The <code>Workbox</code> instance.</p>
</td>
</tr>
</tbody>
</table>
</section>
<dl class="dl-compact">
</dl>
</section>
</section>
</div>
</div>
<nav id="jsdoc-toc-nav" role="navigation"></nav>
</div>
</div>
</body>
</html>
|
{
"content_hash": "bb62ef3e068297a7e72d05e1ca718bf5",
"timestamp": "",
"source": "github",
"line_count": 822,
"max_line_length": 189,
"avg_line_length": 46.54987834549878,
"alnum_prop": 0.41231967384486723,
"repo_name": "myakura/WebFundamentals",
"id": "463236072f89e04dcd65d5048559acfb780f3357",
"size": "38264",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/content/en/tools/workbox/reference-docs/v5/module-workbox-window.Workbox.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "35431"
},
{
"name": "HTML",
"bytes": "4129367"
},
{
"name": "JavaScript",
"bytes": "273072"
},
{
"name": "Python",
"bytes": "256072"
},
{
"name": "Shell",
"bytes": "5080"
},
{
"name": "Smarty",
"bytes": "3872"
}
]
}
|
from collections import defaultdict
import os
import napalm_yang
import yaml
models = [
napalm_yang.models.openconfig_network_instance,
napalm_yang.models.openconfig_interfaces,
napalm_yang.models.openconfig_platform,
napalm_yang.models.openconfig_vlan,
napalm_yang.models.openconfig_system,
]
profile = "dummy"
def nested_dd():
return defaultdict(nested_dd)
def process(model, r_config, r_state):
if model._yang_type in ("container",):
ctr = model
elif model._yang_type in ("list", None):
ctr = model._contained_class()
else:
if model._is_config or model._yang_name == "config":
r_config[model._yang_name] = {"_process": "not_implemented"}
else:
r_state[model._yang_name] = {"_process": "not_implemented"}
return
if model._yang_name == "config":
r_config = r_config[ctr._yang_name]
r_config["_process"] = "not_implemented"
elif model._is_config:
r_config = r_config[ctr._yang_name]
r_config["_process"] = "not_implemented"
r_state = r_state[ctr._yang_name]
r_state["_process"] = "not_implemented"
else:
r_state = r_state[ctr._yang_name]
r_state["_process"] = "not_implemented"
for k, v in ctr:
process_module(v, model._defining_module, r_config, r_state)
def process_module(model, module, r_config=None, r_state=None):
if model._defining_module != module:
r_config = result["config"][
os.path.join(model._defining_module, "{}.yaml".format(model._yang_name))
]
r_state = result["state"][
os.path.join(model._defining_module, "{}.yaml".format(model._yang_name))
]
process(model, r_config, r_state)
def ddict2dict(d):
for k, v in d.items():
if isinstance(v, dict):
d[k] = ddict2dict(v)
return dict(d)
def main():
global result
result = nested_dd()
for model in models:
m = model()
for _, v in m:
process_module(v, None, result["config"], result["state"])
for mode, data in result.items():
for module, model in data.items():
module, filename = module.split("/")
for action in ["parsers", "translators"]:
if action == "translators" and mode == "state":
continue
elif action == "translators":
directory = os.path.join(
"napalm_yang", "mappings", "dummy", action, module
)
else:
directory = os.path.join(
"napalm_yang", "mappings", "dummy", action, mode, module
)
if not os.path.exists(directory):
os.makedirs(directory)
model = ddict2dict(model)
metadata = "---\nmetadata:\n processor: unset\n\n"
with open(os.path.join(directory, filename), "w+") as f:
f.write(
metadata
+ yaml.safe_dump(model, indent=4, default_flow_style=False)
)
if __name__ == "__main__":
main()
|
{
"content_hash": "1d42d4bee24d59a6e93c8ba5ac8d5035",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 84,
"avg_line_length": 29.01801801801802,
"alnum_prop": 0.5402049053089103,
"repo_name": "napalm-automation/napalm-yang",
"id": "2d0433b72fc615819a22af3c6f5d5b54b39f6122",
"size": "3221",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "generate_templates.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "370237"
},
{
"name": "Jupyter Notebook",
"bytes": "152135"
},
{
"name": "Makefile",
"bytes": "1965"
},
{
"name": "Python",
"bytes": "105688785"
},
{
"name": "Roff",
"bytes": "1632"
}
]
}
|
const fs = require('fs');
const child_process = require('child_process');
var CommonConfig = require('../common.config.js');
if(process.env.NODE_ENV == "sync-soft") {
child_process.execFileSync("gsutil", ["-m", "rsync", "-r", CommonConfig.GetLocalFolders().cdn, CommonConfig.GetCloudStorageCdnOrigin()]);
} else if(process.env.NODE_ENV == "sync-hard") {
child_process.execFileSync("gsutil", ["-m", "rsync", "-d", "-r", CommonConfig.GetLocalFolders().cdn, CommonConfig.GetCloudStorageCdnOrigin()]);
}
|
{
"content_hash": "0a98f4e550060c41e7ec90ca51b60429",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 147,
"avg_line_length": 50.9,
"alnum_prop": 0.693516699410609,
"repo_name": "dakom/html5-boilerplate",
"id": "ba11d862cda3ab35a36d9f846785a011930ba8ec",
"size": "509",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "_npm-utils/cdn-sync.js",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "2102"
},
{
"name": "JavaScript",
"bytes": "50312"
},
{
"name": "TypeScript",
"bytes": "42674"
}
]
}
|
package external.communication;
/**
* Interface for the communication with IR playbacktool
*
* @author jeeickme
*/
public interface RPCBrowserInterface {
public void play();
public void stop();
public void seek(long timestamp);
public void pause();
public void quit();
}
|
{
"content_hash": "3f3b02d8386d393c24097b748a0a032f",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 55,
"avg_line_length": 17.11764705882353,
"alnum_prop": 0.7079037800687286,
"repo_name": "dsg-bielefeld/Venice",
"id": "972160f0a1f1444b03304c4b98b90976a739d18e",
"size": "291",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "elan-mod/elan-mod-4.7.3/src/main/java/external/communication/RPCBrowserInterface.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "270"
},
{
"name": "C",
"bytes": "1568"
},
{
"name": "C++",
"bytes": "84561"
},
{
"name": "CSS",
"bytes": "22278"
},
{
"name": "HTML",
"bytes": "2622360"
},
{
"name": "Java",
"bytes": "735712"
},
{
"name": "Protocol Buffer",
"bytes": "3427"
},
{
"name": "Python",
"bytes": "10623"
},
{
"name": "Shell",
"bytes": "323"
},
{
"name": "TeX",
"bytes": "47947"
}
]
}
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="it">
<head>
<!-- Generated by javadoc (1.8.0_60) on Thu Feb 09 18:35:54 CET 2017 -->
<title>Uses of Class experiment.value.bargossipMobile.RoundUpdater</title>
<meta name="date" content="2017-02-09">
<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="Uses of Class experiment.value.bargossipMobile.RoundUpdater";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../experiment/value/bargossipMobile/RoundUpdater.html" title="class in experiment.value.bargossipMobile">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?experiment/value/bargossipMobile/class-use/RoundUpdater.html" target="_top">Frames</a></li>
<li><a href="RoundUpdater.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h2 title="Uses of Class experiment.value.bargossipMobile.RoundUpdater" class="title">Uses of Class<br>experiment.value.bargossipMobile.RoundUpdater</h2>
</div>
<div class="classUseContainer">No usage of experiment.value.bargossipMobile.RoundUpdater</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../experiment/value/bargossipMobile/RoundUpdater.html" title="class in experiment.value.bargossipMobile">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?experiment/value/bargossipMobile/class-use/RoundUpdater.html" target="_top">Frames</a></li>
<li><a href="RoundUpdater.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
|
{
"content_hash": "9c17018d964b2ba65613d5b725a95baa",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 153,
"avg_line_length": 35.70161290322581,
"alnum_prop": 0.6275129884797831,
"repo_name": "glenacota/seine",
"id": "7c1d4d13b8789aee084080bc3353bbdc1ce22410",
"size": "4427",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "seine-src/doc/experiment/value/bargossipMobile/class-use/RoundUpdater.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "AspectJ",
"bytes": "35801"
},
{
"name": "CSS",
"bytes": "13967"
},
{
"name": "HTML",
"bytes": "5487615"
},
{
"name": "Java",
"bytes": "923012"
},
{
"name": "JavaScript",
"bytes": "827"
},
{
"name": "Shell",
"bytes": "1149"
}
]
}
|
/**
* @license Angular v5.2.6
* (c) 2010-2018 Google, Inc. https://angular.io/
* License: MIT
*/
import { EventEmitter, Injectable } from '@angular/core';
import { __extends } from 'tslib';
import { LocationStrategy } from '@angular/common';
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/**
* A spy for {\@link Location} that allows tests to fire simulated location events.
*
* \@experimental
*/
var SpyLocation = /** @class */ (function () {
function SpyLocation() {
this.urlChanges = [];
this._history = [new LocationState('', '')];
this._historyIndex = 0;
/**
* \@internal
*/
this._subject = new EventEmitter();
/**
* \@internal
*/
this._baseHref = '';
/**
* \@internal
*/
this._platformStrategy = /** @type {?} */ ((null));
}
/**
* @param {?} url
* @return {?}
*/
SpyLocation.prototype.setInitialPath = /**
* @param {?} url
* @return {?}
*/
function (url) { this._history[this._historyIndex].path = url; };
/**
* @param {?} url
* @return {?}
*/
SpyLocation.prototype.setBaseHref = /**
* @param {?} url
* @return {?}
*/
function (url) { this._baseHref = url; };
/**
* @return {?}
*/
SpyLocation.prototype.path = /**
* @return {?}
*/
function () { return this._history[this._historyIndex].path; };
/**
* @param {?} path
* @param {?=} query
* @return {?}
*/
SpyLocation.prototype.isCurrentPathEqualTo = /**
* @param {?} path
* @param {?=} query
* @return {?}
*/
function (path, query) {
if (query === void 0) { query = ''; }
var /** @type {?} */ givenPath = path.endsWith('/') ? path.substring(0, path.length - 1) : path;
var /** @type {?} */ currPath = this.path().endsWith('/') ? this.path().substring(0, this.path().length - 1) : this.path();
return currPath == givenPath + (query.length > 0 ? ('?' + query) : '');
};
/**
* @param {?} pathname
* @return {?}
*/
SpyLocation.prototype.simulateUrlPop = /**
* @param {?} pathname
* @return {?}
*/
function (pathname) {
this._subject.emit({ 'url': pathname, 'pop': true, 'type': 'popstate' });
};
/**
* @param {?} pathname
* @return {?}
*/
SpyLocation.prototype.simulateHashChange = /**
* @param {?} pathname
* @return {?}
*/
function (pathname) {
// Because we don't prevent the native event, the browser will independently update the path
this.setInitialPath(pathname);
this.urlChanges.push('hash: ' + pathname);
this._subject.emit({ 'url': pathname, 'pop': true, 'type': 'hashchange' });
};
/**
* @param {?} url
* @return {?}
*/
SpyLocation.prototype.prepareExternalUrl = /**
* @param {?} url
* @return {?}
*/
function (url) {
if (url.length > 0 && !url.startsWith('/')) {
url = '/' + url;
}
return this._baseHref + url;
};
/**
* @param {?} path
* @param {?=} query
* @return {?}
*/
SpyLocation.prototype.go = /**
* @param {?} path
* @param {?=} query
* @return {?}
*/
function (path, query) {
if (query === void 0) { query = ''; }
path = this.prepareExternalUrl(path);
if (this._historyIndex > 0) {
this._history.splice(this._historyIndex + 1);
}
this._history.push(new LocationState(path, query));
this._historyIndex = this._history.length - 1;
var /** @type {?} */ locationState = this._history[this._historyIndex - 1];
if (locationState.path == path && locationState.query == query) {
return;
}
var /** @type {?} */ url = path + (query.length > 0 ? ('?' + query) : '');
this.urlChanges.push(url);
this._subject.emit({ 'url': url, 'pop': false });
};
/**
* @param {?} path
* @param {?=} query
* @return {?}
*/
SpyLocation.prototype.replaceState = /**
* @param {?} path
* @param {?=} query
* @return {?}
*/
function (path, query) {
if (query === void 0) { query = ''; }
path = this.prepareExternalUrl(path);
var /** @type {?} */ history = this._history[this._historyIndex];
if (history.path == path && history.query == query) {
return;
}
history.path = path;
history.query = query;
var /** @type {?} */ url = path + (query.length > 0 ? ('?' + query) : '');
this.urlChanges.push('replace: ' + url);
};
/**
* @return {?}
*/
SpyLocation.prototype.forward = /**
* @return {?}
*/
function () {
if (this._historyIndex < (this._history.length - 1)) {
this._historyIndex++;
this._subject.emit({ 'url': this.path(), 'pop': true });
}
};
/**
* @return {?}
*/
SpyLocation.prototype.back = /**
* @return {?}
*/
function () {
if (this._historyIndex > 0) {
this._historyIndex--;
this._subject.emit({ 'url': this.path(), 'pop': true });
}
};
/**
* @param {?} onNext
* @param {?=} onThrow
* @param {?=} onReturn
* @return {?}
*/
SpyLocation.prototype.subscribe = /**
* @param {?} onNext
* @param {?=} onThrow
* @param {?=} onReturn
* @return {?}
*/
function (onNext, onThrow, onReturn) {
return this._subject.subscribe({ next: onNext, error: onThrow, complete: onReturn });
};
/**
* @param {?} url
* @return {?}
*/
SpyLocation.prototype.normalize = /**
* @param {?} url
* @return {?}
*/
function (url) { return /** @type {?} */ ((null)); };
SpyLocation.decorators = [
{ type: Injectable },
];
/** @nocollapse */
SpyLocation.ctorParameters = function () { return []; };
return SpyLocation;
}());
var LocationState = /** @class */ (function () {
function LocationState(path, query) {
this.path = path;
this.query = query;
}
return LocationState;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/**
* A mock implementation of {\@link LocationStrategy} that allows tests to fire simulated
* location events.
*
* \@stable
*/
var MockLocationStrategy = /** @class */ (function (_super) {
__extends(MockLocationStrategy, _super);
function MockLocationStrategy() {
var _this = _super.call(this) || this;
_this.internalBaseHref = '/';
_this.internalPath = '/';
_this.internalTitle = '';
_this.urlChanges = [];
/**
* \@internal
*/
_this._subject = new EventEmitter();
return _this;
}
/**
* @param {?} url
* @return {?}
*/
MockLocationStrategy.prototype.simulatePopState = /**
* @param {?} url
* @return {?}
*/
function (url) {
this.internalPath = url;
this._subject.emit(new _MockPopStateEvent(this.path()));
};
/**
* @param {?=} includeHash
* @return {?}
*/
MockLocationStrategy.prototype.path = /**
* @param {?=} includeHash
* @return {?}
*/
function (includeHash) {
if (includeHash === void 0) { includeHash = false; }
return this.internalPath;
};
/**
* @param {?} internal
* @return {?}
*/
MockLocationStrategy.prototype.prepareExternalUrl = /**
* @param {?} internal
* @return {?}
*/
function (internal) {
if (internal.startsWith('/') && this.internalBaseHref.endsWith('/')) {
return this.internalBaseHref + internal.substring(1);
}
return this.internalBaseHref + internal;
};
/**
* @param {?} ctx
* @param {?} title
* @param {?} path
* @param {?} query
* @return {?}
*/
MockLocationStrategy.prototype.pushState = /**
* @param {?} ctx
* @param {?} title
* @param {?} path
* @param {?} query
* @return {?}
*/
function (ctx, title, path, query) {
this.internalTitle = title;
var /** @type {?} */ url = path + (query.length > 0 ? ('?' + query) : '');
this.internalPath = url;
var /** @type {?} */ externalUrl = this.prepareExternalUrl(url);
this.urlChanges.push(externalUrl);
};
/**
* @param {?} ctx
* @param {?} title
* @param {?} path
* @param {?} query
* @return {?}
*/
MockLocationStrategy.prototype.replaceState = /**
* @param {?} ctx
* @param {?} title
* @param {?} path
* @param {?} query
* @return {?}
*/
function (ctx, title, path, query) {
this.internalTitle = title;
var /** @type {?} */ url = path + (query.length > 0 ? ('?' + query) : '');
this.internalPath = url;
var /** @type {?} */ externalUrl = this.prepareExternalUrl(url);
this.urlChanges.push('replace: ' + externalUrl);
};
/**
* @param {?} fn
* @return {?}
*/
MockLocationStrategy.prototype.onPopState = /**
* @param {?} fn
* @return {?}
*/
function (fn) { this._subject.subscribe({ next: fn }); };
/**
* @return {?}
*/
MockLocationStrategy.prototype.getBaseHref = /**
* @return {?}
*/
function () { return this.internalBaseHref; };
/**
* @return {?}
*/
MockLocationStrategy.prototype.back = /**
* @return {?}
*/
function () {
if (this.urlChanges.length > 0) {
this.urlChanges.pop();
var /** @type {?} */ nextUrl = this.urlChanges.length > 0 ? this.urlChanges[this.urlChanges.length - 1] : '';
this.simulatePopState(nextUrl);
}
};
/**
* @return {?}
*/
MockLocationStrategy.prototype.forward = /**
* @return {?}
*/
function () { throw 'not implemented'; };
MockLocationStrategy.decorators = [
{ type: Injectable },
];
/** @nocollapse */
MockLocationStrategy.ctorParameters = function () { return []; };
return MockLocationStrategy;
}(LocationStrategy));
var _MockPopStateEvent = /** @class */ (function () {
function _MockPopStateEvent(newUrl) {
this.newUrl = newUrl;
this.pop = true;
this.type = 'popstate';
}
return _MockPopStateEvent;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/**
* @module
* @description
* Entry point for all public APIs of this package.
*/
// This file only reexports content of the `src` folder. Keep it that way.
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Generated bundle index. Do not edit.
*/
export { SpyLocation, MockLocationStrategy };
//# sourceMappingURL=testing.js.map
|
{
"content_hash": "d9e921cbfb3753e3b784b97b6eb12eac",
"timestamp": "",
"source": "github",
"line_count": 438,
"max_line_length": 131,
"avg_line_length": 27.34931506849315,
"alnum_prop": 0.5225811837382085,
"repo_name": "CatsPoo/ShiftOnline",
"id": "793f2ec66a6b432f59827fe87373eec851f8b55e",
"size": "11979",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "angular.src/node_modules/@angular/common/esm5/testing.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "161"
},
{
"name": "CSS",
"bytes": "5541"
},
{
"name": "HTML",
"bytes": "14617"
},
{
"name": "JavaScript",
"bytes": "11827"
},
{
"name": "TypeScript",
"bytes": "50158"
}
]
}
|
<?php
include "conf/config.php";
if (isset($_SESSION["user_id"]))
{
$order = 0;
$abfrage = "";
if (isset($_GET["order"]))
{
$order = $_GET["order"];
}
echo "<input type='search' name='search-mini' id='search-mini' placeholder='Filter' data-mini='true'>
<label for='select-order' class='select'>Sortieren nach:</label>
<select name='select-order' id='select-order' data-theme='a' data-icon='arrow-d' data-inline='true' data-native-menu='false'>
<option value='0' ";if($order == 0 ){echo"selected='selected'";} echo">A-Z</option>
<option value='1' ";if($order == 1 ){echo"selected='selected'";} echo">Z-A</option>
<option value='2' ";if($order == 2 ){echo"selected='selected'";} echo">Zuletzt hinzugefügt</option>
<option value='3' ";if($order == 3 ){echo"selected='selected'";} echo">Erscheinungsdatum absteigend</option>
<option value='4' ";if($order == 4 ){echo"selected='selected'";} echo">Erscheinungsdatum aufsteigend</option>
</select>
<ul data-role='listview' data-inset='true' ";
if ($_SESSION["role"] == 1)
{
echo "data-split-icon='delete' ";
}
else
{
echo "data-split-icon='star' ";
}
echo "data-split-icon='star' data-filter='true' data-input='#search-mini'>";
mysql_query("set names 'utf8'");
switch($order)
{
case 0:
$abfrage = "SELECT * FROM movies order by title asc";
break;
case 1:
$abfrage = "SELECT * FROM movies order by title desc";
break;
case 2:
$abfrage = "SELECT * FROM movies order by add_time desc";
break;
case 3:
$abfrage = "SELECT * FROM movies order by release_date desc";
break;
case 4:
$abfrage = "SELECT * FROM movies order by release_date asc";
break;
}
$result = mysql_query("SELECT COUNT(*) FROM movies");
$movies_count = mysql_result($result,0);
echo "$movies_count Filme";
$ergebnis = mysql_query($abfrage);
while($row = mysql_fetch_object($ergebnis))
{
echo "
<li><a href='index.php?include=movieinfo.php&movie_id=$row->id' data-ajax='false'>
<img class='lazy' data-original='cover$row->cover' />
<h2>$row->title</h2>
<p>Veröffentlicht am: $row->release_date</p>
<p> Kategorien:
";
$quer = "Select * from categories_main where id IN (Select categorie_id from categories where movie_id = $row->id)";
$ret = mysql_query($quer);
while($row2 = mysql_fetch_object($ret))
{
echo "$row2->name ";
}
echo "</p><p style='display:none;'>Schauspieler: ";
$quer = "Select * from credits_main where id IN (Select credits_id from credits where movie_id = $row->id)";
$ret = mysql_query($quer);
while($row2 = mysql_fetch_object($ret))
{
echo "$row2->name ";
}
echo "</p><p style='display:none;'> Regisseur: ";
$quer = "Select * from directors_main where id IN (Select director_id from directors where movie_id = $row->id)";
$ret = mysql_query($quer);
while($row2 = mysql_fetch_object($ret))
{
echo "$row2->name ";
}
echo "</p></a>";
if ($_SESSION["role"] == 1)
{
echo "<a href='includes/deletemovie.php?movie_id=$row->id' data-ajax='false' ></a></li>";
}
else
{
echo "<a href='includes/addwish.php?movie_id=$row->id' data-ajax='false' ></a></li>";
}
}
echo "</ul>";
}
else
{
echo"<script type='text/javascript'> window.location.href='../index.php?message=Sie müssen sich erst einloggen'</script>";
}
?>
<script>
$('#select-order').bind( 'change', function(event, ui) {
var $order_nr = document.getElementById('select-order').value;
window.location.href='index.php?include=movies.php&order=' + $order_nr;
});
</script>
|
{
"content_hash": "ba861845538bb925db4715b793c40bd9",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 129,
"avg_line_length": 32.23931623931624,
"alnum_prop": 0.5927889713679746,
"repo_name": "Ezak91/Muhvieh-Mobile",
"id": "d8656ba91c38b45ac18cc23b7f1e3ad931a6bad3",
"size": "3775",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "includes/movies.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "189"
},
{
"name": "HTML",
"bytes": "797"
},
{
"name": "JavaScript",
"bytes": "9056"
},
{
"name": "PHP",
"bytes": "32255"
}
]
}
|
package com.datamountaineer.streamreactor.connect.hbase.avro
import com.datamountaineer.streamreactor.connect.hbase.PersonAvroSchema
import org.apache.avro.Schema
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec
class AvroSchemaFieldsExistFnTest extends AnyWordSpec with Matchers {
val schema: Schema = new Schema.Parser().parse(PersonAvroSchema.schema)
"AvroSchemaFieldsExistFn" should {
"raise an exception if the field is not present" in {
intercept[IllegalArgumentException] {
AvroSchemaFieldsExistFn(schema, Seq("notpresent"))
}
intercept[IllegalArgumentException] {
AvroSchemaFieldsExistFn(schema, Seq(" lastName"))
}
}
"not raise an exception if the fields are present" in {
AvroSchemaFieldsExistFn(schema, Seq("lastName", "age", "address"))
}
}
}
|
{
"content_hash": "d1d25a4508ffcb6955063f6e33275055",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 73,
"avg_line_length": 30,
"alnum_prop": 0.7459770114942529,
"repo_name": "datamountaineer/stream-reactor",
"id": "b55e339c46f0736118aea5729f876f46b1e73690",
"size": "1465",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "kafka-connect-hbase/src/test/scala/com/datamountaineer/streamreactor/connect/hbase/avro/AvroSchemaFieldsExistFnTest.scala",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "11639"
},
{
"name": "Scala",
"bytes": "1693832"
},
{
"name": "Smarty",
"bytes": "393"
}
]
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace OSky.Web.Http.Messages
{
public class ResourceLocation
{
public Uri Location { get; private set; }
public void Set(Uri location)
{
Location = location;
}
}
}
|
{
"content_hash": "e276444319782b09550ac9dabd940dce",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 49,
"avg_line_length": 17.444444444444443,
"alnum_prop": 0.6210191082802548,
"repo_name": "liumeifu/OSky",
"id": "c9810fe6838e4afd7df4f75679c7f4b8042ffd14",
"size": "316",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/OSky.Web.WebApi/Messages/ResourceLocation.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "1957"
},
{
"name": "C#",
"bytes": "1558970"
}
]
}
|
@interface CXDropDownMenuViewUITests : XCTestCase
@end
@implementation CXDropDownMenuViewUITests
- (void)setUp {
[super setUp];
// Put setup code here. This method is called before the invocation of each test method in the class.
// In UI tests it is usually best to stop immediately when a failure occurs.
self.continueAfterFailure = NO;
// UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method.
[[[XCUIApplication alloc] init] launch];
// In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
}
- (void)tearDown {
// Put teardown code here. This method is called after the invocation of each test method in the class.
[super tearDown];
}
- (void)testExample {
// Use recording to get started writing UI tests.
// Use XCTAssert and related functions to verify your tests produce the correct results.
}
@end
|
{
"content_hash": "b16f874f298c4abaf64c1db7ca33e31a",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 178,
"avg_line_length": 35.233333333333334,
"alnum_prop": 0.7228003784295175,
"repo_name": "WindFlyCloud/Common-functions-List",
"id": "b97639dea14c33c04ceb080bb10ccf73153ed2f6",
"size": "1252",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "CXDropDownMenuView-下拉菜单列表/CXDropDownMenuViewUITests/CXDropDownMenuViewUITests.m",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Objective-C",
"bytes": "40533"
}
]
}
|
/**
* Provides scope classes that control the visibility of bindings.
*/
package io.risotto.binding.scope;
|
{
"content_hash": "8f1bb7f52752e222273f704678dce9b5",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 66,
"avg_line_length": 27,
"alnum_prop": 0.7592592592592593,
"repo_name": "battila7/risotto",
"id": "b5f153e374dcc02b6acc4321677c39832b007e0b",
"size": "108",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/io/risotto/binding/scope/package-info.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "149285"
}
]
}
|
<?php
namespace Kunstmaan\AdminBundle\EventListener;
use Kunstmaan\AdminBundle\Helper\AdminRouteHelper;
use Kunstmaan\AdminBundle\Helper\Toolbar\DataCollector;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
use Symfony\Component\HttpKernel\HttpKernel;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Symfony\Component\Security\Core\Authorization\AuthorizationChecker;
use Symfony\Component\Security\Guard\Token\PostAuthenticationGuardToken;
class ToolbarListener implements EventSubscriberInterface
{
const DISABLED = 1;
const ENABLED = 2;
/**
* @var \Twig_Environment
*/
protected $twig;
/**
* @var UrlGeneratorInterface
*/
protected $urlGenerator;
/**
* @var DataCollector
*/
protected $dataCollector;
/**
* @var AuthorizationChecker
*/
protected $authorizationChecker;
/**
* @var TokenStorageInterface
*/
protected $tokenStorage;
/**
* @var bool
*/
protected $enabled;
/**
* @var ContainerInterface
*/
private $container;
/**
* @var AdminRouteHelper
*/
protected $adminRouteHelper;
/**
* @var array
*/
protected $providerKeys;
/**
* @var array
*/
protected $adminFirewallName;
/**
* ToolbarListener constructor.
*
* @param \Twig_Environment $twig
* @param UrlGeneratorInterface $urlGenerator
* @param DataCollector $dataCollector
* @param AuthorizationChecker $authorizationChecker
* @param TokenStorageInterface $tokenStorage
* @param bool $enabled
* @param ContainerInterface $container
* @param AdminRouteHelper $adminRouteHelper
* @param array $providerKeys
* @param string $adminFirewallName
*/
public function __construct(
\Twig_Environment $twig,
UrlGeneratorInterface $urlGenerator,
DataCollector $dataCollector,
AuthorizationChecker $authorizationChecker,
TokenStorageInterface $tokenStorage,
$enabled,
ContainerInterface $container,
AdminRouteHelper $adminRouteHelper,
array $providerKeys,
$adminFirewallName = 'main'
) {
$this->twig = $twig;
$this->urlGenerator = $urlGenerator;
$this->dataCollector = $dataCollector;
$this->authorizationChecker = $authorizationChecker;
$this->tokenStorage = $tokenStorage;
$this->enabled = $enabled;
$this->container = $container;
$this->adminRouteHelper = $adminRouteHelper;
$this->providerKeys = $providerKeys;
$this->adminFirewallName = $adminFirewallName;
}
/**
* @return array
*/
public static function getSubscribedEvents()
{
return [
KernelEvents::RESPONSE => ['onKernelResponse', -125],
];
}
/**
* @return bool
*/
public function isEnabled()
{
return !$this->container->has('profiler') && $this->enabled;
}
/**
* @param FilterResponseEvent $event
*/
public function onKernelResponse(FilterResponseEvent $event)
{
if (!$this->isEnabled() || HttpKernel::MASTER_REQUEST !== $event->getRequestType()) {
return;
}
$response = $event->getResponse();
$request = $event->getRequest();
$session = $request->getSession();
$url = $event->getRequest()->getRequestUri();
$token = $this->tokenStorage->getToken();
if (null !== $token && method_exists($token, 'getProviderKey')) {
$key = $token->getProviderKey();
} else {
$key = $this->adminFirewallName;
}
// Only enable toolbar when the kunstmaan_admin.toolbar_firewall_names config value contains the current firewall name.
if (!\in_array($key, $this->providerKeys, false)) {
return false;
}
// Only enable toolbar when we can find an authenticated user in the session from the kunstmaan_admin.admin_firewall_name config value.
$authenticated = false;
/* @var PostAuthenticationGuardToken $token */
if ($session->isStarted() && $session->has(sprintf('_security_%s', $this->adminFirewallName))) {
$token = unserialize($session->get(sprintf('_security_%s', $this->adminFirewallName)));
$authenticated = $token->isAuthenticated();
}
// Do not capture redirects or modify XML HTTP Requests
if (!$authenticated || !$event->isMasterRequest() || $request->isXmlHttpRequest() || $this->adminRouteHelper->isAdminRoute($url)) {
return;
}
if ($response->isRedirection() || ($response->headers->has('Content-Type') && false === strpos(
$response->headers->get('Content-Type'),
'html'
))
|| 'html' !== $request->getRequestFormat()
|| false !== stripos($response->headers->get('Content-Disposition'), 'attachment;')
) {
return;
}
$this->injectToolbar($response, $request);
}
/**
* Injects the admin toolbar into the given Response.
*
* @param Response $response A Response instance
*/
protected function injectToolbar(Response $response, Request $request)
{
$content = $response->getContent();
$pos = strripos($content, '</body>');
if (false !== $pos) {
$toolbar = "\n".str_replace(
"\n",
'',
$this->twig->render(
'@KunstmaanAdmin/Toolbar/toolbar.html.twig',
['collectors' => $this->dataCollector->getDataCollectors()]
)
)."\n";
$content = substr($content, 0, $pos).$toolbar.substr($content, $pos);
$response->setContent($content);
}
}
}
|
{
"content_hash": "d754579b2e56c1d09cb55ce340d22105",
"timestamp": "",
"source": "github",
"line_count": 206,
"max_line_length": 143,
"avg_line_length": 30.91747572815534,
"alnum_prop": 0.6026063746271,
"repo_name": "jockri/KunstmaanBundlesCMS",
"id": "44f51a34695c75ad8cbd336f543037794645bb16",
"size": "6369",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/Kunstmaan/AdminBundle/EventListener/ToolbarListener.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "211203"
},
{
"name": "Gherkin",
"bytes": "22178"
},
{
"name": "HTML",
"bytes": "457857"
},
{
"name": "Hack",
"bytes": "20"
},
{
"name": "JavaScript",
"bytes": "726971"
},
{
"name": "PHP",
"bytes": "3598761"
},
{
"name": "Shell",
"bytes": "216"
}
]
}
|
/*
Ported to JavaScript by Lazar Laszlo 2011
lazarsoft@gmail.com, www.lazarsoft.info
*/
/*
*
* Copyright 2007 ZXing 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.
*/
var FORMAT_INFO_MASK_QR = 0x5412;
var FORMAT_INFO_DECODE_LOOKUP = new Array(new Array(0x5412, 0x00), new Array(0x5125, 0x01), new Array(0x5E7C, 0x02), new Array(0x5B4B, 0x03), new Array(0x45F9, 0x04), new Array(0x40CE, 0x05), new Array(0x4F97, 0x06), new Array(0x4AA0, 0x07), new Array(0x77C4, 0x08), new Array(0x72F3, 0x09), new Array(0x7DAA, 0x0A), new Array(0x789D, 0x0B), new Array(0x662F, 0x0C), new Array(0x6318, 0x0D), new Array(0x6C41, 0x0E), new Array(0x6976, 0x0F), new Array(0x1689, 0x10), new Array(0x13BE, 0x11), new Array(0x1CE7, 0x12), new Array(0x19D0, 0x13), new Array(0x0762, 0x14), new Array(0x0255, 0x15), new Array(0x0D0C, 0x16), new Array(0x083B, 0x17), new Array(0x355F, 0x18), new Array(0x3068, 0x19), new Array(0x3F31, 0x1A), new Array(0x3A06, 0x1B), new Array(0x24B4, 0x1C), new Array(0x2183, 0x1D), new Array(0x2EDA, 0x1E), new Array(0x2BED, 0x1F));
var BITS_SET_IN_HALF_BYTE = new Array(0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4);
function FormatInformation(formatInfo)
{
this.errorCorrectionLevel = ErrorCorrectionLevel.forBits((formatInfo >> 3) & 0x03);
this.dataMask = (formatInfo & 0x07);
this.__defineGetter__("ErrorCorrectionLevel", function()
{
return this.errorCorrectionLevel;
});
this.__defineGetter__("DataMask", function()
{
return this.dataMask;
});
this.GetHashCode=function()
{
return (this.errorCorrectionLevel.ordinal() << 3) | this.dataMask;
}
this.Equals=function( o)
{
var other = o;
return this.errorCorrectionLevel == other.errorCorrectionLevel && this.dataMask == other.dataMask;
}
}
FormatInformation.numBitsDiffering=function( a, b)
{
a ^= b; // a now has a 1 bit exactly where its bit differs with b's
// Count bits set quickly with a series of lookups:
return BITS_SET_IN_HALF_BYTE[a & 0x0F] + BITS_SET_IN_HALF_BYTE[(URShift(a, 4) & 0x0F)] + BITS_SET_IN_HALF_BYTE[(URShift(a, 8) & 0x0F)] + BITS_SET_IN_HALF_BYTE[(URShift(a, 12) & 0x0F)] + BITS_SET_IN_HALF_BYTE[(URShift(a, 16) & 0x0F)] + BITS_SET_IN_HALF_BYTE[(URShift(a, 20) & 0x0F)] + BITS_SET_IN_HALF_BYTE[(URShift(a, 24) & 0x0F)] + BITS_SET_IN_HALF_BYTE[(URShift(a, 28) & 0x0F)];
}
FormatInformation.decodeFormatInformation=function( maskedFormatInfo)
{
var formatInfo = FormatInformation.doDecodeFormatInformation(maskedFormatInfo);
if (formatInfo != null)
{
return formatInfo;
}
// Should return null, but, some QR codes apparently
// do not mask this info. Try again by actually masking the pattern
// first
return FormatInformation.doDecodeFormatInformation(maskedFormatInfo ^ FORMAT_INFO_MASK_QR);
}
FormatInformation.doDecodeFormatInformation=function( maskedFormatInfo)
{
// Find the int in FORMAT_INFO_DECODE_LOOKUP with fewest bits differing
var bestDifference = 0xffffffff;
var bestFormatInfo = 0;
for (var i = 0; i < FORMAT_INFO_DECODE_LOOKUP.length; i++)
{
var decodeInfo = FORMAT_INFO_DECODE_LOOKUP[i];
var targetInfo = decodeInfo[0];
if (targetInfo == maskedFormatInfo)
{
// Found an exact match
return new FormatInformation(decodeInfo[1]);
}
var bitsDifference = this.numBitsDiffering(maskedFormatInfo, targetInfo);
if (bitsDifference < bestDifference)
{
bestFormatInfo = decodeInfo[1];
bestDifference = bitsDifference;
}
}
// Hamming distance of the 32 masked codes is 7, by construction, so <= 3 bits
// differing means we found a match
if (bestDifference <= 3)
{
return new FormatInformation(bestFormatInfo);
}
return null;
}
|
{
"content_hash": "4ddacb09b463ea182c9077016aca9a5f",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 842,
"avg_line_length": 39.79807692307692,
"alnum_prop": 0.7194974631553516,
"repo_name": "hshn-labsw-nfc/schnitzel",
"id": "fb202cb9ff1e7811fc402b91204ebca6890d4ae9",
"size": "4139",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "client/src/assets/js/qrcode/formatinf.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "79"
},
{
"name": "CSS",
"bytes": "7598"
},
{
"name": "HTML",
"bytes": "25207"
},
{
"name": "JavaScript",
"bytes": "315512"
},
{
"name": "Shell",
"bytes": "86"
},
{
"name": "TypeScript",
"bytes": "105379"
}
]
}
|
End of preview.
No dataset card yet
- Downloads last month
- 4