Dataset Preview
Duplicate
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 dataset

Need 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
using System; using System.Linq; using System.Collections.Generic; using Foundation; using UIKit; namespace WPDMS.iOS { // The UIApplicationDelegate for the application. This class is responsible for launching the // User Interface of the application, as well as listening (and optionally responding) to // application events from iOS. [Register ("AppDelegate")] public partial class AppDelegate : UIApplicationDelegate { // class-level declarations public override UIWindow Window { get; set; } // This method is invoked when the application is about to move from active to inactive state. // OpenGL applications should use this method to pause. public override void OnResignActivation (UIApplication application) { } // This method should be used to release shared resources and it should store the application state. // If your application supports background exection this method is called instead of WillTerminate // when the user quits. public override void DidEnterBackground (UIApplication application) { } // This method is called as part of the transiton from background to active state. public override void WillEnterForeground (UIApplication application) { } // This method is called when the application is about to terminate. Save data, if needed. public override void WillTerminate (UIApplication application) { } } }
{ "content_hash": "c724ac5d8dadda83e79e99d644e8a512", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 102, "avg_line_length": 29.97872340425532, "alnum_prop": 0.7558552164655784, "repo_name": "fabianwilliams/xCreateWordPhoneDialerMultiScreen", "id": "d8377fbba3d56ec22a2b2af4ccdf500c88ea6aa4", "size": "1411", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "WPDMS/WPDMS.iOS/AppDelegate.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Assembly", "bytes": "22669939" }, { "name": "C#", "bytes": "7986" }, { "name": "Objective-C", "bytes": "73058" } ] }
package com.compositesw.services.system.admin; import javax.xml.ws.WebFault; import com.compositesw.services.system.util.common.Fault; /** * This class was generated by the JAX-WS RI. * JAX-WS RI 2.2.1-b01- * Generated source version: 2.2 * */ @WebFault(name = "fault", targetNamespace = "http://www.compositesw.com/services/system/util/common") public class GetConnectorGroupNamesSoapFault extends Exception { /** * Java type that goes as soapenv:Fault detail element. * */ private Fault faultInfo; /** * * @param message * @param faultInfo */ public GetConnectorGroupNamesSoapFault(String message, Fault faultInfo) { super(message); this.faultInfo = faultInfo; } /** * * @param message * @param faultInfo * @param cause */ public GetConnectorGroupNamesSoapFault(String message, Fault faultInfo, Throwable cause) { super(message, cause); this.faultInfo = faultInfo; } /** * * @return * returns fault bean: com.compositesw.services.system.util.common.Fault */ public Fault getFaultInfo() { return faultInfo; } }
{ "content_hash": "c2ec1c3c02abccc7ff57c818b22b1570", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 101, "avg_line_length": 21.87272727272727, "alnum_prop": 0.6334164588528678, "repo_name": "dvbu-test/PDTool", "id": "6c2c5f24498f8a2eafe846438da86a7cc625fe67", "size": "1203", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "CISAdminApi7.0.0/src/com/compositesw/services/system/admin/GetConnectorGroupNamesSoapFault.java", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Batchfile", "bytes": "1004538" }, { "name": "HTML", "bytes": "852584" }, { "name": "Java", "bytes": "7945910" }, { "name": "Perl", "bytes": "9840" }, { "name": "Python", "bytes": "3299" }, { "name": "Shell", "bytes": "117180" }, { "name": "XSLT", "bytes": "242648" } ] }
package org.wso2.developerstudio.eclipse.gmf.esb.diagram.custom.sheet; import org.eclipse.core.commands.operations.OperationHistoryFactory; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.edit.domain.EditingDomain; import org.eclipse.emf.edit.domain.IEditingDomainProvider; import org.eclipse.emf.transaction.NotificationFilter; import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.gmf.runtime.diagram.ui.properties.sections.AbstractModelerPropertySection; import org.eclipse.gmf.runtime.emf.ui.properties.sections.UndoableModelPropertySheetEntry; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.CLabel; import org.eclipse.swt.layout.FormAttachment; import org.eclipse.swt.layout.FormData; import org.eclipse.swt.widgets.Composite; import org.eclipse.ui.IActionBars; import org.eclipse.ui.IWorkbenchPart; import org.eclipse.ui.views.properties.IPropertySourceProvider; import org.eclipse.ui.views.properties.PropertySheetPage; import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage; import org.wso2.developerstudio.eclipse.gmf.esb.diagram.custom.sheet.EsbCustomPropertySheetEntry; import org.wso2.developerstudio.eclipse.gmf.esb.diagram.custom.sheet.EsbCustomPropertySheetPage; public class CustomAdvancedPropertySection extends AbstractModelerPropertySection { // ........................................... IMPORTANT // ...............................................................// // ..// This class is created by copy pasting the // org.eclipse.gmf.runtime.diagram.ui.properties.sections.AdvancedPropertySection // ..// And then changed the following lines of codes in // .. page = new EsbRestApiPropertySheetPage(); // UndoableModelPropertySheetEntry root = new // RestApiBasicPropertySheetEntry(OperationHistoryFactory.getOperationHistory()); // Then EsbPropertySection is extend by this class instead of extending by AdvancedPropertySection // ........................................... IMPORTANT // ...............................................................// /** * the property sheet page for this section */ protected PropertySheetPage page; /* * (non-Javadoc) * * @see org.eclipse.ui.views.properties.tabbed.ISection#createControls(org.eclipse.swt.widgets.Composite, * org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage) */ public void createControls(final Composite parent, TabbedPropertySheetPage aTabbedPropertySheetPage) { super.createControls(parent, aTabbedPropertySheetPage); Composite composite = getWidgetFactory().createFlatFormComposite(parent); FormData data = null; String tableLabelStr = getTableLabel(); CLabel tableLabel = null; if (tableLabelStr != null && tableLabelStr.length() > 0) { tableLabel = getWidgetFactory().createCLabel(composite, tableLabelStr); data = new FormData(); data.left = new FormAttachment(0, 0); data.top = new FormAttachment(0, 0); tableLabel.setLayoutData(data); } // .............................. here is our change ................................... // Use EsbRestApiPropertySheetPage to provide custom properties behavior page = new EsbCustomPropertySheetPage(); // Use EsbRestApiPropertySheetPage to provide custom properties behavior UndoableModelPropertySheetEntry root = new EsbCustomPropertySheetEntry( OperationHistoryFactory.getOperationHistory()); // ......................................................................................... root.setPropertySourceProvider(getPropertySourceProvider()); page.setRootEntry(root); page.createControl(composite); data = new FormData(); data.left = new FormAttachment(0, 0); data.right = new FormAttachment(100, 0); if (tableLabel == null) { data.top = new FormAttachment(0, 0); } else { data.top = new FormAttachment(tableLabel, 0, SWT.BOTTOM); } data.bottom = new FormAttachment(100, 0); data.height = 100; data.width = 100; page.getControl().setLayoutData(data); setActionBars(aTabbedPropertySheetPage.getSite().getActionBars()); } /** * Sets and prepares the actionBars for this section * * @param actionBars the action bars for this page * @see org.eclipse.gmf.runtime.common.ui.properties.TabbedPropertySheetPage#setActionBars(org.eclipse.ui.IActionBars) */ public void setActionBars(IActionBars actionBars) { if (actionBars != null) { actionBars.getMenuManager().removeAll(); actionBars.getToolBarManager().removeAll(); actionBars.getStatusLineManager().removeAll(); page.makeContributions(actionBars.getMenuManager(), actionBars.getToolBarManager(), actionBars.getStatusLineManager()); actionBars.getToolBarManager().update(true); } } /** * Returns the PropertySource provider. The default implementation returns * static adapter factory for the properties services. If the extending * class needs to use a different provider then this method has to be * overwriten. * * @return The PropertySource provider */ protected IPropertySourceProvider getPropertySourceProvider() { return propertiesProvider; } /** * Returns the label for the table. The default implementation returns null, * that is, there is no label. * * @return The label for the table */ protected String getTableLabel() { return null; } /* * (non-Javadoc) * * @see org.eclipse.ui.views.properties.tabbed.ISection#setInput(org.eclipse.ui.IWorkbenchPart, * org.eclipse.jface.viewers.ISelection) */ public void setInput(IWorkbenchPart part, ISelection selection) { IEditingDomainProvider provider = (IEditingDomainProvider) part.getAdapter(IEditingDomainProvider.class); if (provider != null) { EditingDomain theEditingDomain = provider.getEditingDomain(); if (theEditingDomain instanceof TransactionalEditingDomain) { setEditingDomain((TransactionalEditingDomain) theEditingDomain); } } // Set the eObject for the section, too. The workbench part may not // adapt to IEditingDomainProvider, in which case the selected EObject // will be used to derive the editing domain. if (!selection.isEmpty() && selection instanceof IStructuredSelection) { Object firstElement = ((IStructuredSelection) selection).getFirstElement(); if (firstElement != null) { EObject adapted = unwrap(firstElement); if (adapted != null) { setEObject(adapted); } } } page.selectionChanged(part, selection); } /* * (non-Javadoc) * * @see org.eclipse.ui.views.properties.tabbed.ISection#dispose() */ public void dispose() { super.dispose(); if (page != null) { page.dispose(); page = null; } } /* * (non-Javadoc) * * @see org.eclipse.ui.views.properties.tabbed.ISection#refresh() */ public void refresh() { page.refresh(); } /* * (non-Javadoc) * * @see org.eclipse.ui.views.properties.tabbed.ISection#shouldUseExtraSpace() */ public boolean shouldUseExtraSpace() { return true; } /** * Update if nessesary, upon receiving the model event. * * @see #aboutToBeShown() * @see #aboutToBeHidden() * @param notification - * even notification * @param element - * element that has changed */ public void update(final Notification notification, EObject element) { if (!isDisposed()) { postUpdateRequest(new Runnable() { public void run() { if (!isDisposed() && !isNotifierDeleted(notification)) refresh(); } }); } } /* * (non-Javadoc) * * @see org.eclipse.gmf.runtime.emf.core.edit.IDemuxedMListener#getFilter() */ public NotificationFilter getFilter() { return NotificationFilter.createEventTypeFilter(Notification.SET) .or(NotificationFilter.createEventTypeFilter(Notification.UNSET)) .or(NotificationFilter.createEventTypeFilter(Notification.ADD)) .or(NotificationFilter.createEventTypeFilter(Notification.ADD_MANY)) .or(NotificationFilter.createEventTypeFilter(Notification.REMOVE)) .or(NotificationFilter.createEventTypeFilter(Notification.REMOVE_MANY)) .and(NotificationFilter.createNotifierTypeFilter(EObject.class)); } /* * (non-Javadoc) * * @see * org.eclipse.gmf.runtime.diagram.ui.properties.sections.AbstractModelerPropertySection#addToEObjectList(java.lang. * Object) */ protected boolean addToEObjectList(Object object) { /* not implemented */ return true; } }
{ "content_hash": "df87e16c5d97f167c11a69f478382ce8", "timestamp": "", "source": "github", "line_count": 256, "max_line_length": 122, "avg_line_length": 37.37109375, "alnum_prop": 0.6395944392181457, "repo_name": "prabushi/devstudio-tooling-esb", "id": "10190d3d8395b5d43c92d26fcdb2917df4374fcf", "size": "10206", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "plugins/org.wso2.developerstudio.eclipse.gmf.esb.diagram/src/org/wso2/developerstudio/eclipse/gmf/esb/diagram/custom/sheet/CustomAdvancedPropertySection.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "41098" }, { "name": "HTML", "bytes": "731356" }, { "name": "Java", "bytes": "77332976" }, { "name": "JavaScript", "bytes": "475592" }, { "name": "Shell", "bytes": "7727" } ] }
import { Injector, QueryList, ViewChildren } from '@angular/core'; import { AbstractControl } from '@angular/forms'; import { OMatErrorDirective } from '../../../../directives/o-mat-error.directive'; import { O_MAT_ERROR_OPTIONS } from '../../../../services/factories'; import { OMatErrorOptions } from '../../../../types/o-mat-error.type'; import { Codes } from '../../../../util/codes'; import { Util } from '../../../../util/util'; export class OTableBaseDialogClass { protected errorOptions: OMatErrorOptions; @ViewChildren(OMatErrorDirective) protected oMatErrorChildren: QueryList<OMatErrorDirective>; protected formControl: AbstractControl; constructor( protected injector: Injector ) { try { this.errorOptions = this.injector.get(O_MAT_ERROR_OPTIONS) || {}; } catch (e) { this.errorOptions = {}; } } protected setFormControl(formControl: AbstractControl) { this.formControl = formControl; } get tooltipClass(): string { let result: string; const liteError = this.errorOptions.type === Codes.O_MAT_ERROR_LITE; if (liteError && Util.isDefined(this.formControl) && this.formControlHasErrors()) { result = `o-tooltip o-mat-error`; } return result; } get tooltipText(): string { let result: string; const liteError = this.errorOptions.type === Codes.O_MAT_ERROR_LITE; if (liteError && this.formControlHasErrors() && this.oMatErrorChildren && this.oMatErrorChildren.length > 0) { result = this.oMatErrorChildren .filter((oMatError: OMatErrorDirective) => Util.isDefined(oMatError.text)) .map((oMatError: OMatErrorDirective) => oMatError.text) .join('\n'); } return result; } protected formControlHasErrors(): boolean { return Util.isDefined(this.formControl) && this.formControl.touched && Util.isDefined(this.formControl.errors); } public hasError(fControl: AbstractControl, error: string): boolean { return fControl && fControl.touched && fControl.hasError(error); } }
{ "content_hash": "7fc2bd61cbee3575f503c2e5aa41dbba", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 115, "avg_line_length": 34.440677966101696, "alnum_prop": 0.6791338582677166, "repo_name": "OntimizeWeb/ontimize-web-ngx", "id": "ea389cce117f59c72880bd5dc01acebd0684d3dc", "size": "2032", "binary": false, "copies": "1", "ref": "refs/heads/8.x.x", "path": "projects/ontimize-web-ngx/src/lib/components/table/extensions/dialog/o-table-base-dialog.class.ts", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "HTML", "bytes": "190381" }, { "name": "JavaScript", "bytes": "7594" }, { "name": "SCSS", "bytes": "125972" }, { "name": "TypeScript", "bytes": "1533764" } ] }
<html> <head> <title>LG-H340n Mozilla/5.0 (Linux; Android 5.0.1; LG-H340n Build/LRX21Y) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/38.0.2125.102 Mobile Safari/537.36</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.3/css/materialize.min.css"> <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> </head> <body> <div class="container"> <div class="section"> <h1 class="header center orange-text">User agent detail</h1> <div class="row center"> LG-H340n Mozilla/5.0 (Linux; Android 5.0.1; LG-H340n Build/LRX21Y) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/38.0.2125.102 Mobile Safari/537.36 <p> Detected by 8 of 8 providers<br /> As bot detected by 0 of 7 </p> </div> </div> <div class="section"> <table class="striped"><tr><th></th><th colspan="3">General</th><th colspan="5">Device</th><th colspan="3">Bot</th><th></th></tr><tr><th>Provider</th><th>Browser</th><th>Engine</th><th>OS</th><th>Brand</th><th>Model</th><th>Type</th><th>Is mobile</th><th>Is touch</th><th>Is bot</th><th>Name</th><th>Type</th><th>Actions</th></tr><tr><td>BrowscapPhp<br /><small>6011</small></td><td>Android WebView 4.0</td><td>Blink </td><td>Android 5.0</td><td></td><td></td><td>Mobile Phone</td><td>yes</td><td>yes</td><td></td><td></td><td></td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-cbfe2df3-330b-4abd-b5df-0ca181549ca9">Detail</a> <!-- Modal Structure --> <div id="modal-cbfe2df3-330b-4abd-b5df-0ca181549ca9" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>BrowscapPhp result detail</h4> <p><pre><code class="php">stdClass Object ( [browser_name_regex] => /^.*mozilla\/5\.0 \(.*linux.*android.5\.0.*\) applewebkit\/.*khtml, like gecko\) version\/4\.0.*chrome.*safari.*$/ [browser_name_pattern] => *mozilla/5.0 (*linux*android?5.0*) applewebkit/*khtml, like gecko) version/4.0*chrome*safari* [parent] => Android WebView 4.0 [comment] => Android WebView 4.0 [browser] => Android WebView [browser_type] => Browser [browser_bits] => 32 [browser_maker] => Google Inc [browser_modus] => unknown [version] => 4.0 [majorver] => 4 [minorver] => 0 [platform] => Android [platform_version] => 5.0 [platform_description] => Android OS [platform_bits] => 32 [platform_maker] => Google Inc [alpha] => [beta] => [win16] => [win32] => [win64] => [frames] => 1 [iframes] => 1 [tables] => 1 [cookies] => 1 [backgroundsounds] => [javascript] => 1 [vbscript] => [javaapplets] => [activexcontrols] => [ismobiledevice] => 1 [istablet] => [issyndicationreader] => [crawler] => [cssversion] => 3 [aolversion] => 0 [device_name] => general Mobile Phone [device_maker] => unknown [device_type] => Mobile Phone [device_pointing_method] => touchscreen [device_code_name] => general Mobile Phone [device_brand_name] => unknown [renderingengine_name] => Blink [renderingengine_version] => unknown [renderingengine_description] => a WebKit Fork by Google [renderingengine_maker] => Google Inc ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>DonatjUAParser<br /><small>v0.5.0</small></td><td>Chrome 38.0.2125.102</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-6fae891b-b0d5-4415-b07d-355015c3af67">Detail</a> <!-- Modal Structure --> <div id="modal-6fae891b-b0d5-4415-b07d-355015c3af67" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>DonatjUAParser result detail</h4> <p><pre><code class="php">Array ( [platform] => Android [browser] => Chrome [version] => 38.0.2125.102 ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>PiwikDeviceDetector<br /><small>3.5.1</small></td><td>Chrome Mobile 38.0</td><td>Blink </td><td>Android 5.0</td><td>LG</td><td>H340n</td><td>smartphone</td><td>yes</td><td></td><td></td><td></td><td></td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-fc0f1b55-50d8-49c2-bb12-4cc1d8144ebf">Detail</a> <!-- Modal Structure --> <div id="modal-fc0f1b55-50d8-49c2-bb12-4cc1d8144ebf" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>PiwikDeviceDetector result detail</h4> <p><pre><code class="php">Array ( [client] => Array ( [type] => browser [name] => Chrome Mobile [short_name] => CM [version] => 38.0 [engine] => Blink ) [operatingSystem] => Array ( [name] => Android [short_name] => AND [version] => 5.0 [platform] => ) [device] => Array ( [brand] => LG [brandName] => LG [model] => H340n [device] => 1 [deviceName] => smartphone ) [bot] => [extra] => Array ( [isBot] => [isBrowser] => 1 [isFeedReader] => [isMobileApp] => [isPIM] => [isLibrary] => [isMediaPlayer] => [isCamera] => [isCarBrowser] => [isConsole] => [isFeaturePhone] => [isPhablet] => [isPortableMediaPlayer] => [isSmartDisplay] => [isSmartphone] => 1 [isTablet] => [isTV] => [isDesktop] => [isMobile] => 1 [isTouchEnabled] => ) ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>SinergiBrowserDetector<br /><small>6.0.0</small></td><td>Chrome 38.0.2125.102</td><td><i class="material-icons">close</i></td><td>Android 5.0.1</td><td><i class="material-icons">close</i></td><td></td><td><i class="material-icons">close</i></td><td>yes</td><td><i class="material-icons">close</i></td><td></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-8c08f104-4e61-421b-9405-291b09c383dc">Detail</a> <!-- Modal Structure --> <div id="modal-8c08f104-4e61-421b-9405-291b09c383dc" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>SinergiBrowserDetector result detail</h4> <p><pre><code class="php">Array ( [browser] => Sinergi\BrowserDetector\Browser Object ( [userAgent:Sinergi\BrowserDetector\Browser:private] => Sinergi\BrowserDetector\UserAgent Object ( [userAgentString:Sinergi\BrowserDetector\UserAgent:private] => LG-H340n Mozilla/5.0 (Linux; Android 5.0.1; LG-H340n Build/LRX21Y) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/38.0.2125.102 Mobile Safari/537.36 ) [name:Sinergi\BrowserDetector\Browser:private] => Chrome [version:Sinergi\BrowserDetector\Browser:private] => 38.0.2125.102 [isRobot:Sinergi\BrowserDetector\Browser:private] => [isChromeFrame:Sinergi\BrowserDetector\Browser:private] => ) [operatingSystem] => Sinergi\BrowserDetector\Os Object ( [name:Sinergi\BrowserDetector\Os:private] => Android [version:Sinergi\BrowserDetector\Os:private] => 5.0.1 [isMobile:Sinergi\BrowserDetector\Os:private] => 1 [userAgent:Sinergi\BrowserDetector\Os:private] => Sinergi\BrowserDetector\UserAgent Object ( [userAgentString:Sinergi\BrowserDetector\UserAgent:private] => LG-H340n Mozilla/5.0 (Linux; Android 5.0.1; LG-H340n Build/LRX21Y) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/38.0.2125.102 Mobile Safari/537.36 ) ) [device] => Sinergi\BrowserDetector\Device Object ( [name:Sinergi\BrowserDetector\Device:private] => unknown [userAgent:Sinergi\BrowserDetector\Device:private] => Sinergi\BrowserDetector\UserAgent Object ( [userAgentString:Sinergi\BrowserDetector\UserAgent:private] => LG-H340n Mozilla/5.0 (Linux; Android 5.0.1; LG-H340n Build/LRX21Y) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/38.0.2125.102 Mobile Safari/537.36 ) ) ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>UAParser<br /><small>v3.4.5</small></td><td>Chrome Mobile 38.0.2125</td><td><i class="material-icons">close</i></td><td>Android 5.0.1</td><td>LG</td><td>H340n</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td></td><td></td><td><i class="material-icons">close</i></td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-8f4c86c5-433e-4536-b799-ad26d77264e0">Detail</a> <!-- Modal Structure --> <div id="modal-8f4c86c5-433e-4536-b799-ad26d77264e0" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>UAParser result detail</h4> <p><pre><code class="php">UAParser\Result\Client Object ( [ua] => UAParser\Result\UserAgent Object ( [major] => 38 [minor] => 0 [patch] => 2125 [family] => Chrome Mobile ) [os] => UAParser\Result\OperatingSystem Object ( [major] => 5 [minor] => 0 [patch] => 1 [patchMinor] => [family] => Android ) [device] => UAParser\Result\Device Object ( [brand] => LG [model] => H340n [family] => LG-H340n ) [originalUserAgent] => LG-H340n Mozilla/5.0 (Linux; Android 5.0.1; LG-H340n Build/LRX21Y) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/38.0.2125.102 Mobile Safari/537.36 ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>WhichBrowser<br /><small>2.0.9</small></td><td>LG Browser </td><td>Blink 537.36</td><td>Android 5.0.1</td><td>LG</td><td>Leon</td><td>mobile:smart</td><td>yes</td><td><i class="material-icons">close</i></td><td></td><td></td><td><i class="material-icons">close</i></td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-62f1f3a3-0c44-4ecb-9ee2-48145e35736b">Detail</a> <!-- Modal Structure --> <div id="modal-62f1f3a3-0c44-4ecb-9ee2-48145e35736b" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>WhichBrowser result detail</h4> <p><pre><code class="php">Array ( [browser] => Array ( [name] => LG Browser [type] => browser ) [engine] => Array ( [name] => Blink [version] => 537.36 ) [os] => Array ( [name] => Android [version] => 5.0.1 ) [device] => Array ( [type] => mobile [subtype] => smart [manufacturer] => LG [model] => Leon ) ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>Woothee<br /><small>v1.2.0</small></td><td>Chrome 38.0.2125.102</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>smartphone</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td></td><td></td><td><i class="material-icons">close</i></td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-bd437f52-91e9-4ce8-88f7-6e5206ed6635">Detail</a> <!-- Modal Structure --> <div id="modal-bd437f52-91e9-4ce8-88f7-6e5206ed6635" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>Woothee result detail</h4> <p><pre><code class="php">Array ( [name] => Chrome [vendor] => Google [version] => 38.0.2125.102 [category] => smartphone [os] => Android [os_version] => 5.0.1 ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>Wurfl<br /><small>1.6.4</small></td><td>Chromium 38</td><td><i class="material-icons">close</i></td><td>Android 5.0</td><td>LG</td><td>H340n</td><td>Smartphone</td><td>yes</td><td>yes</td><td></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-3a72b31e-c3c1-4317-a357-7a6d5e3c7027">Detail</a> <!-- Modal Structure --> <div id="modal-3a72b31e-c3c1-4317-a357-7a6d5e3c7027" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>Wurfl result detail</h4> <p><pre><code class="php">Array ( [virtual] => Array ( [is_android] => true [is_ios] => false [is_windows_phone] => false [is_app] => false [is_full_desktop] => false [is_largescreen] => true [is_mobile] => true [is_robot] => false [is_smartphone] => true [is_touchscreen] => true [is_wml_preferred] => false [is_xhtmlmp_preferred] => false [is_html_preferred] => true [advertised_device_os] => Android [advertised_device_os_version] => 5.0 [advertised_browser] => Chromium [advertised_browser_version] => 38 [complete_device_name] => LG H340n (Leon 4G LTE) [form_factor] => Smartphone [is_phone] => true [is_app_webview] => true ) [all] => Array ( [brand_name] => LG [model_name] => H340n [unique] => true [ununiqueness_handler] => [is_wireless_device] => true [device_claims_web_support] => true [has_qwerty_keyboard] => true [can_skip_aligned_link_row] => true [uaprof] => http://gsm.lge.com/html/gsm/0W_43_22MIQ_HNMe/H340n-M6-D1.xml [uaprof2] => [uaprof3] => [nokia_series] => 0 [nokia_edition] => 0 [device_os] => Android [mobile_browser] => Chromium [mobile_browser_version] => 38 [device_os_version] => 5.0 [pointing_method] => touchscreen [release_date] => 2015_march [marketing_name] => Leon 4G LTE [model_extra_info] => [nokia_feature_pack] => 0 [can_assign_phone_number] => true [is_tablet] => false [manufacturer_name] => [is_bot] => false [is_google_glass] => false [proportional_font] => false [built_in_back_button_support] => false [card_title_support] => true [softkey_support] => false [table_support] => true [numbered_menus] => false [menu_with_select_element_recommended] => false [menu_with_list_of_links_recommended] => true [icons_on_menu_items_support] => false [break_list_of_links_with_br_element_recommended] => true [access_key_support] => false [wrap_mode_support] => false [times_square_mode_support] => false [deck_prefetch_support] => false [elective_forms_recommended] => true [wizards_recommended] => false [image_as_link_support] => false [insert_br_element_after_widget_recommended] => false [wml_can_display_images_and_text_on_same_line] => false [wml_displays_image_in_center] => false [opwv_wml_extensions_support] => false [wml_make_phone_call_string] => wtai://wp/mc; [chtml_display_accesskey] => false [emoji] => false [chtml_can_display_images_and_text_on_same_line] => false [chtml_displays_image_in_center] => false [imode_region] => none [chtml_make_phone_call_string] => tel: [chtml_table_support] => false [xhtml_honors_bgcolor] => true [xhtml_supports_forms_in_table] => true [xhtml_support_wml2_namespace] => false [xhtml_autoexpand_select] => false [xhtml_select_as_dropdown] => false [xhtml_select_as_radiobutton] => false [xhtml_select_as_popup] => false [xhtml_display_accesskey] => false [xhtml_supports_invisible_text] => false [xhtml_supports_inline_input] => false [xhtml_supports_monospace_font] => false [xhtml_supports_table_for_layout] => true [xhtml_supports_css_cell_table_coloring] => true [xhtml_format_as_css_property] => false [xhtml_format_as_attribute] => false [xhtml_nowrap_mode] => false [xhtml_marquee_as_css_property] => false [xhtml_readable_background_color1] => #FFFFFF [xhtml_readable_background_color2] => #FFFFFF [xhtml_allows_disabled_form_elements] => true [xhtml_document_title_support] => true [xhtml_preferred_charset] => iso-8859-1 [opwv_xhtml_extensions_support] => false [xhtml_make_phone_call_string] => tel: [xhtmlmp_preferred_mime_type] => text/html [xhtml_table_support] => true [xhtml_send_sms_string] => sms: [xhtml_send_mms_string] => mms: [xhtml_file_upload] => supported [cookie_support] => true [accept_third_party_cookie] => true [xhtml_supports_iframe] => full [xhtml_avoid_accesskeys] => true [xhtml_can_embed_video] => none [ajax_support_javascript] => true [ajax_manipulate_css] => true [ajax_support_getelementbyid] => true [ajax_support_inner_html] => true [ajax_xhr_type] => standard [ajax_manipulate_dom] => true [ajax_support_events] => true [ajax_support_event_listener] => true [ajax_preferred_geoloc_api] => w3c_api [xhtml_support_level] => 4 [preferred_markup] => html_web_4_0 [wml_1_1] => false [wml_1_2] => false [wml_1_3] => false [html_wi_w3_xhtmlbasic] => true [html_wi_oma_xhtmlmp_1_0] => true [html_wi_imode_html_1] => false [html_wi_imode_html_2] => false [html_wi_imode_html_3] => false [html_wi_imode_html_4] => false [html_wi_imode_html_5] => false [html_wi_imode_htmlx_1] => false [html_wi_imode_htmlx_1_1] => false [html_wi_imode_compact_generic] => false [html_web_3_2] => true [html_web_4_0] => true [voicexml] => false [multipart_support] => false [total_cache_disable_support] => false [time_to_live_support] => false [resolution_width] => 480 [resolution_height] => 854 [columns] => 60 [max_image_width] => 320 [max_image_height] => 640 [rows] => 40 [physical_screen_width] => 57 [physical_screen_height] => 100 [dual_orientation] => true [density_class] => 1.0 [wbmp] => true [bmp] => false [epoc_bmp] => false [gif_animated] => false [jpg] => true [png] => true [tiff] => false [transparent_png_alpha] => true [transparent_png_index] => true [svgt_1_1] => true [svgt_1_1_plus] => false [greyscale] => false [gif] => true [colors] => 65536 [webp_lossy_support] => true [webp_lossless_support] => true [post_method_support] => true [basic_authentication_support] => true [empty_option_value_support] => true [emptyok] => false [nokia_voice_call] => false [wta_voice_call] => false [wta_phonebook] => false [wta_misc] => false [wta_pdc] => false [https_support] => true [phone_id_provided] => false [max_data_rate] => 3600 [wifi] => true [sdio] => false [vpn] => false [has_cellular_radio] => true [max_deck_size] => 2000000 [max_url_length_in_requests] => 256 [max_url_length_homepage] => 0 [max_url_length_bookmark] => 0 [max_url_length_cached_page] => 0 [max_no_of_connection_settings] => 0 [max_no_of_bookmarks] => 0 [max_length_of_username] => 0 [max_length_of_password] => 0 [max_object_size] => 0 [downloadfun_support] => false [directdownload_support] => true [inline_support] => false [oma_support] => true [ringtone] => false [ringtone_3gpp] => false [ringtone_midi_monophonic] => false [ringtone_midi_polyphonic] => false [ringtone_imelody] => false [ringtone_digiplug] => false [ringtone_compactmidi] => false [ringtone_mmf] => false [ringtone_rmf] => false [ringtone_xmf] => false [ringtone_amr] => false [ringtone_awb] => false [ringtone_aac] => false [ringtone_wav] => false [ringtone_mp3] => false [ringtone_spmidi] => false [ringtone_qcelp] => false [ringtone_voices] => 1 [ringtone_df_size_limit] => 0 [ringtone_directdownload_size_limit] => 0 [ringtone_inline_size_limit] => 0 [ringtone_oma_size_limit] => 0 [wallpaper] => false [wallpaper_max_width] => 0 [wallpaper_max_height] => 0 [wallpaper_preferred_width] => 0 [wallpaper_preferred_height] => 0 [wallpaper_resize] => none [wallpaper_wbmp] => false [wallpaper_bmp] => false [wallpaper_gif] => false [wallpaper_jpg] => false [wallpaper_png] => false [wallpaper_tiff] => false [wallpaper_greyscale] => false [wallpaper_colors] => 2 [wallpaper_df_size_limit] => 0 [wallpaper_directdownload_size_limit] => 0 [wallpaper_inline_size_limit] => 0 [wallpaper_oma_size_limit] => 0 [screensaver] => false [screensaver_max_width] => 0 [screensaver_max_height] => 0 [screensaver_preferred_width] => 0 [screensaver_preferred_height] => 0 [screensaver_resize] => none [screensaver_wbmp] => false [screensaver_bmp] => false [screensaver_gif] => false [screensaver_jpg] => false [screensaver_png] => false [screensaver_greyscale] => false [screensaver_colors] => 2 [screensaver_df_size_limit] => 0 [screensaver_directdownload_size_limit] => 0 [screensaver_inline_size_limit] => 0 [screensaver_oma_size_limit] => 0 [picture] => false [picture_max_width] => 0 [picture_max_height] => 0 [picture_preferred_width] => 0 [picture_preferred_height] => 0 [picture_resize] => none [picture_wbmp] => false [picture_bmp] => false [picture_gif] => false [picture_jpg] => false [picture_png] => false [picture_greyscale] => false [picture_colors] => 2 [picture_df_size_limit] => 0 [picture_directdownload_size_limit] => 0 [picture_inline_size_limit] => 0 [picture_oma_size_limit] => 0 [video] => false [oma_v_1_0_forwardlock] => false [oma_v_1_0_combined_delivery] => false [oma_v_1_0_separate_delivery] => false [streaming_video] => true [streaming_3gpp] => true [streaming_mp4] => true [streaming_mov] => false [streaming_video_size_limit] => 0 [streaming_real_media] => none [streaming_flv] => false [streaming_3g2] => false [streaming_vcodec_h263_0] => 10 [streaming_vcodec_h263_3] => -1 [streaming_vcodec_mpeg4_sp] => 2 [streaming_vcodec_mpeg4_asp] => -1 [streaming_vcodec_h264_bp] => 3.0 [streaming_acodec_amr] => nb [streaming_acodec_aac] => lc [streaming_wmv] => none [streaming_preferred_protocol] => http [streaming_preferred_http_protocol] => apple_live_streaming [wap_push_support] => false [connectionless_service_indication] => false [connectionless_service_load] => false [connectionless_cache_operation] => false [connectionoriented_unconfirmed_service_indication] => false [connectionoriented_unconfirmed_service_load] => false [connectionoriented_unconfirmed_cache_operation] => false [connectionoriented_confirmed_service_indication] => false [connectionoriented_confirmed_service_load] => false [connectionoriented_confirmed_cache_operation] => false [utf8_support] => true [ascii_support] => false [iso8859_support] => false [expiration_date] => false [j2me_cldc_1_0] => false [j2me_cldc_1_1] => false [j2me_midp_1_0] => false [j2me_midp_2_0] => false [doja_1_0] => false [doja_1_5] => false [doja_2_0] => false [doja_2_1] => false [doja_2_2] => false [doja_3_0] => false [doja_3_5] => false [doja_4_0] => false [j2me_jtwi] => false [j2me_mmapi_1_0] => false [j2me_mmapi_1_1] => false [j2me_wmapi_1_0] => false [j2me_wmapi_1_1] => false [j2me_wmapi_2_0] => false [j2me_btapi] => false [j2me_3dapi] => false [j2me_locapi] => false [j2me_nokia_ui] => false [j2me_motorola_lwt] => false [j2me_siemens_color_game] => false [j2me_siemens_extension] => false [j2me_heap_size] => 0 [j2me_max_jar_size] => 0 [j2me_storage_size] => 0 [j2me_max_record_store_size] => 0 [j2me_screen_width] => 0 [j2me_screen_height] => 0 [j2me_canvas_width] => 0 [j2me_canvas_height] => 0 [j2me_bits_per_pixel] => 0 [j2me_audio_capture_enabled] => false [j2me_video_capture_enabled] => false [j2me_photo_capture_enabled] => false [j2me_capture_image_formats] => none [j2me_http] => false [j2me_https] => false [j2me_socket] => false [j2me_udp] => false [j2me_serial] => false [j2me_gif] => false [j2me_gif89a] => false [j2me_jpg] => false [j2me_png] => false [j2me_bmp] => false [j2me_bmp3] => false [j2me_wbmp] => false [j2me_midi] => false [j2me_wav] => false [j2me_amr] => false [j2me_mp3] => false [j2me_mp4] => false [j2me_imelody] => false [j2me_rmf] => false [j2me_au] => false [j2me_aac] => false [j2me_realaudio] => false [j2me_xmf] => false [j2me_wma] => false [j2me_3gpp] => false [j2me_h263] => false [j2me_svgt] => false [j2me_mpeg4] => false [j2me_realvideo] => false [j2me_real8] => false [j2me_realmedia] => false [j2me_left_softkey_code] => 0 [j2me_right_softkey_code] => 0 [j2me_middle_softkey_code] => 0 [j2me_select_key_code] => 0 [j2me_return_key_code] => 0 [j2me_clear_key_code] => 0 [j2me_datefield_no_accepts_null_date] => false [j2me_datefield_broken] => false [receiver] => false [sender] => false [mms_max_size] => 0 [mms_max_height] => 0 [mms_max_width] => 0 [built_in_recorder] => false [built_in_camera] => true [mms_jpeg_baseline] => false [mms_jpeg_progressive] => false [mms_gif_static] => false [mms_gif_animated] => false [mms_png] => false [mms_bmp] => false [mms_wbmp] => false [mms_amr] => false [mms_wav] => false [mms_midi_monophonic] => false [mms_midi_polyphonic] => false [mms_midi_polyphonic_voices] => 0 [mms_spmidi] => false [mms_mmf] => false [mms_mp3] => false [mms_evrc] => false [mms_qcelp] => false [mms_ota_bitmap] => false [mms_nokia_wallpaper] => false [mms_nokia_operatorlogo] => false [mms_nokia_3dscreensaver] => false [mms_nokia_ringingtone] => false [mms_rmf] => false [mms_xmf] => false [mms_symbian_install] => false [mms_jar] => false [mms_jad] => false [mms_vcard] => false [mms_vcalendar] => false [mms_wml] => false [mms_wbxml] => false [mms_wmlc] => false [mms_video] => false [mms_mp4] => false [mms_3gpp] => false [mms_3gpp2] => false [mms_max_frame_rate] => 0 [nokiaring] => false [picturemessage] => false [operatorlogo] => false [largeoperatorlogo] => false [callericon] => false [nokiavcard] => false [nokiavcal] => false [sckl_ringtone] => false [sckl_operatorlogo] => false [sckl_groupgraphic] => false [sckl_vcard] => false [sckl_vcalendar] => false [text_imelody] => false [ems] => false [ems_variablesizedpictures] => false [ems_imelody] => false [ems_odi] => false [ems_upi] => false [ems_version] => 0 [siemens_ota] => false [siemens_logo_width] => 101 [siemens_logo_height] => 29 [siemens_screensaver_width] => 101 [siemens_screensaver_height] => 50 [gprtf] => false [sagem_v1] => false [sagem_v2] => false [panasonic] => false [sms_enabled] => true [wav] => false [mmf] => false [smf] => false [mld] => false [midi_monophonic] => false [midi_polyphonic] => false [sp_midi] => false [rmf] => false [xmf] => false [compactmidi] => false [digiplug] => false [nokia_ringtone] => false [imelody] => false [au] => false [amr] => false [awb] => false [aac] => true [mp3] => true [voices] => 1 [qcelp] => false [evrc] => false [flash_lite_version] => [fl_wallpaper] => false [fl_screensaver] => false [fl_standalone] => false [fl_browser] => false [fl_sub_lcd] => false [full_flash_support] => false [css_supports_width_as_percentage] => true [css_border_image] => webkit [css_rounded_corners] => webkit [css_gradient] => none [css_spriting] => true [css_gradient_linear] => none [is_transcoder] => false [transcoder_ua_header] => user-agent [rss_support] => false [pdf_support] => true [progressive_download] => true [playback_vcodec_h263_0] => 10 [playback_vcodec_h263_3] => -1 [playback_vcodec_mpeg4_sp] => 0 [playback_vcodec_mpeg4_asp] => -1 [playback_vcodec_h264_bp] => 3.0 [playback_real_media] => none [playback_3gpp] => true [playback_3g2] => false [playback_mp4] => true [playback_mov] => false [playback_acodec_amr] => nb [playback_acodec_aac] => none [playback_df_size_limit] => 0 [playback_directdownload_size_limit] => 0 [playback_inline_size_limit] => 0 [playback_oma_size_limit] => 0 [playback_acodec_qcelp] => false [playback_wmv] => none [hinted_progressive_download] => true [html_preferred_dtd] => html4 [viewport_supported] => true [viewport_width] => device_width_token [viewport_userscalable] => no [viewport_initial_scale] => [viewport_maximum_scale] => [viewport_minimum_scale] => [mobileoptimized] => false [handheldfriendly] => false [canvas_support] => full [image_inlining] => true [is_smarttv] => false [is_console] => false [nfc_support] => false [ux_full_desktop] => false [jqm_grade] => A [is_sencha_touch_ok] => false [controlcap_is_smartphone] => default [controlcap_is_ios] => default [controlcap_is_android] => default [controlcap_is_robot] => default [controlcap_is_app] => default [controlcap_advertised_device_os] => default [controlcap_advertised_device_os_version] => default [controlcap_advertised_browser] => default [controlcap_advertised_browser_version] => default [controlcap_is_windows_phone] => default [controlcap_is_full_desktop] => default [controlcap_is_largescreen] => default [controlcap_is_mobile] => default [controlcap_is_touchscreen] => default [controlcap_is_wml_preferred] => default [controlcap_is_xhtmlmp_preferred] => default [controlcap_is_html_preferred] => default [controlcap_form_factor] => default [controlcap_complete_device_name] => default ) ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr></table> </div> <div class="section"> <h1 class="header center orange-text">About this comparison</h1> <div class="row center"> <h5 class="header light"> The primary goal of this project is simple<br /> I wanted to know which user agent parser is the most accurate in each part - device detection, bot detection and so on...<br /> <br /> The secondary goal is to provide a source for all user agent parsers to improve their detection based on this results.<br /> <br /> You can also improve this further, by suggesting ideas at <a href="https://github.com/ThaDafinser/UserAgentParserComparison">ThaDafinser/UserAgentParserComparison</a><br /> <br /> The comparison is based on the abstraction by <a href="https://github.com/ThaDafinser/UserAgentParser">ThaDafinser/UserAgentParser</a> </h5> </div> </div> <div class="card"> <div class="card-content"> Comparison created <i>2016-01-26 16:39:43</i> | by <a href="https://github.com/ThaDafinser">ThaDafinser</a> </div> </div> </div> <script src="https://code.jquery.com/jquery-2.1.4.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.3/js/materialize.min.js"></script> <script src="http://cdnjs.cloudflare.com/ajax/libs/list.js/1.1.1/list.min.js"></script> <script> $(document).ready(function(){ // the "href" attribute of .modal-trigger must specify the modal ID that wants to be triggered $('.modal-trigger').leanModal(); }); </script> </body> </html>
{ "content_hash": "a07bbda7acba3938e5e692c60a7a45e4", "timestamp": "", "source": "github", "line_count": 974, "max_line_length": 553, "avg_line_length": 40.18788501026694, "alnum_prop": 0.5231842219553943, "repo_name": "ThaDafinser/UserAgentParserComparison", "id": "5d7c1c9dc75aef7f9ff99ef5bb23ec728a26f1e4", "size": "39144", "binary": false, "copies": "1", "ref": "refs/heads/gh-pages", "path": "v3/user-agent-detail/bb/b8/bbb87388-4483-4e39-be0e-07fbdbe89aba.html", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "2060859160" } ] }
package dkpro.similarity.algorithms.style; import java.util.List; import org.apache.uima.fit.util.JCasUtil; import org.apache.uima.jcas.JCas; import org.apache.uima.jcas.tcas.Annotation; import de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Sentence; import de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Token; import dkpro.similarity.algorithms.api.JCasTextSimilarityMeasureBase; import dkpro.similarity.algorithms.api.SimilarityException; /** * Computes the average number of tokens per sentence. * */ public class AvgTokensPerSentenceMeasure extends JCasTextSimilarityMeasureBase { @Override public double getSimilarity(JCas jcas1, JCas jcas2, Annotation coveringAnnotation1, Annotation coveringAnnotation2) throws SimilarityException { List<Sentence> s1 = JCasUtil.selectCovered(jcas1, Sentence.class, coveringAnnotation1); List<Sentence> s2 = JCasUtil.selectCovered(jcas2, Sentence.class, coveringAnnotation2); int noOfTokens = 0; for (Sentence sentence : s1) { noOfTokens += JCasUtil.selectCovered(jcas1, Token.class, sentence).size(); } for (Sentence sentence : s2) { noOfTokens += JCasUtil.selectCovered(jcas1, Token.class, sentence).size(); } return (double) noOfTokens / (s1.size() + s2.size()); } }
{ "content_hash": "c484ff98770caac8ac2ca5f322181e11", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 89, "avg_line_length": 32.1219512195122, "alnum_prop": 0.7463933181473045, "repo_name": "TitasNandi/Summer_Project", "id": "2c66ef2471a45d4b1df051333702d624760fa946", "size": "2135", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "com.stud.titas.sandbox/dkpro-similarity-master/dkpro-similarity-algorithms-style-asl/src/main/java/dkpro/similarity/algorithms/style/AvgTokensPerSentenceMeasure.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "AMPL", "bytes": "291" }, { "name": "Batchfile", "bytes": "119331" }, { "name": "C", "bytes": "620" }, { "name": "CSS", "bytes": "746530" }, { "name": "Groff", "bytes": "8389332" }, { "name": "Groovy", "bytes": "887" }, { "name": "HTML", "bytes": "84461564" }, { "name": "Java", "bytes": "22523686" }, { "name": "JavaScript", "bytes": "1254038" }, { "name": "Jupyter Notebook", "bytes": "413571" }, { "name": "Makefile", "bytes": "4287" }, { "name": "Perl", "bytes": "15597" }, { "name": "Python", "bytes": "1888984" }, { "name": "Shell", "bytes": "177570" }, { "name": "XQuery", "bytes": "11244" }, { "name": "XSLT", "bytes": "390648" } ] }
class Profile; namespace policy { class UserCommandsFactoryAsh : public RemoteCommandsFactory { public: explicit UserCommandsFactoryAsh(Profile* profile); UserCommandsFactoryAsh(const UserCommandsFactoryAsh&) = delete; UserCommandsFactoryAsh& operator=(const UserCommandsFactoryAsh&) = delete; ~UserCommandsFactoryAsh() override; // RemoteCommandsFactory: std::unique_ptr<RemoteCommandJob> BuildJobForType( enterprise_management::RemoteCommand_Type type, RemoteCommandsService* service) override; private: Profile* const profile_; }; } // namespace policy #endif // CHROME_BROWSER_ASH_POLICY_REMOTE_COMMANDS_USER_COMMANDS_FACTORY_ASH_H_
{ "content_hash": "195ffd88a2fa557ebdcd2b989f21727f", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 81, "avg_line_length": 27, "alnum_prop": 0.7777777777777778, "repo_name": "ric2b/Vivaldi-browser", "id": "f58f5b24c084861b857255a7e3ba19263623d14f", "size": "1103", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "chromium/chrome/browser/ash/policy/remote_commands/user_commands_factory_ash.h", "mode": "33188", "license": "bsd-3-clause", "language": [] }
package com.github.dandelion.datatables.core.option.processor.ajax; import com.github.dandelion.core.option.AbstractOptionProcessor; import com.github.dandelion.core.option.OptionProcessingContext; import com.github.dandelion.core.util.StringUtils; import com.github.dandelion.datatables.core.extension.feature.AjaxFeature; import com.github.dandelion.datatables.core.option.DatatableOptions; import com.github.dandelion.datatables.core.option.TableConfiguration; /** * <p> * Processor used when the table uses an AJAX source. * </p> * * <p> * Note that the passed URL is not processed here but in each module * corresponding to the template engine currently being used. * </p> * * @author Thibault Duchateau * @since 0.9.0 */ public class AjaxSourceProcessor extends AbstractOptionProcessor { @Override protected Object getProcessedValue(OptionProcessingContext context) { TableConfiguration tc = (TableConfiguration) context.getRequest() .getAttribute(TableConfiguration.class.getCanonicalName()); if (StringUtils.isNotBlank(context.getValueAsString())) { Boolean serverSide = DatatableOptions.AJAX_SERVERSIDE.valueFrom(tc.getOptions()); Boolean serverSideEnabled = serverSide != null && serverSide; if (!serverSideEnabled) { tc.registerExtension(AjaxFeature.AJAX_FEATURE_NAME); } } return context.getValueAsString(); } }
{ "content_hash": "339b106afe864535adf98ff1aa848c07", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 90, "avg_line_length": 33.44186046511628, "alnum_prop": 0.7454798331015299, "repo_name": "RizziCR/dandelion-datatables", "id": "586f94b23f5420ed506ca703d94105661fcd4e3d", "size": "2961", "binary": false, "copies": "3", "ref": "refs/heads/wip/1.1.0", "path": "datatables-core/src/main/java/com/github/dandelion/datatables/core/option/processor/ajax/AjaxSourceProcessor.java", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "CSS", "bytes": "938867" }, { "name": "HTML", "bytes": "8466" }, { "name": "Java", "bytes": "1681582" }, { "name": "JavaScript", "bytes": "809656" } ] }
ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
{ "content_hash": "8d283d1a99e51b754490499f1091429f", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 31, "avg_line_length": 9.692307692307692, "alnum_prop": 0.7063492063492064, "repo_name": "mdoering/backbone", "id": "a924401ff808d40487d9f779ff58837283690e23", "size": "193", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Fabales/Fabaceae/Cyanothyrsus/Cyanothyrsus pynaertii/README.md", "mode": "33188", "license": "apache-2.0", "language": [] }
package org.apache.camel.component.sjms.consumer; import java.util.HashSet; import java.util.Set; import java.util.concurrent.ScheduledExecutorService; import javax.jms.Connection; import javax.jms.ConnectionFactory; import javax.jms.ExceptionListener; import javax.jms.JMSException; import javax.jms.Message; import javax.jms.MessageConsumer; import javax.jms.MessageListener; import javax.jms.Session; import org.apache.camel.CamelContext; import org.apache.camel.component.sjms.SessionMessageListener; import org.apache.camel.component.sjms.SjmsEndpoint; import org.apache.camel.component.sjms.jms.DestinationCreationStrategy; import org.apache.camel.support.service.ServiceSupport; import org.apache.camel.util.backoff.BackOff; import org.apache.camel.util.backoff.BackOffTimer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import static org.apache.camel.component.sjms.SjmsHelper.*; public class SimpleMessageListenerContainer extends ServiceSupport implements org.apache.camel.component.sjms.MessageListenerContainer, ExceptionListener { private static final Logger LOG = LoggerFactory.getLogger(SimpleMessageListenerContainer.class); private final SjmsEndpoint endpoint; private SessionMessageListener messageListener; private String clientId; private int concurrentConsumers = 1; private ExceptionListener exceptionListener; private String destinationName; private DestinationCreationStrategy destinationCreationStrategy; private final Object connectionLock = new Object(); private Connection connection; private volatile boolean connectionStarted; private final Object consumerLock = new Object(); private Set<MessageConsumer> consumers; private Set<Session> sessions; private BackOffTimer.Task recoverTask; private ScheduledExecutorService scheduler; public SimpleMessageListenerContainer(SjmsEndpoint endpoint) { this.endpoint = endpoint; } public SjmsEndpoint getEndpoint() { return endpoint; } public void setMessageListener(SessionMessageListener messageListener) { this.messageListener = messageListener; } public void setExceptionListener(ExceptionListener exceptionListener) { this.exceptionListener = exceptionListener; } public String getClientId() { return clientId; } public void setClientId(String clientId) { this.clientId = clientId; } public String getDestinationName() { return destinationName; } public void setDestinationName(String destinationName) { this.destinationName = destinationName; } public DestinationCreationStrategy getDestinationCreationStrategy() { return destinationCreationStrategy; } public void setDestinationCreationStrategy(DestinationCreationStrategy destinationCreationStrategy) { this.destinationCreationStrategy = destinationCreationStrategy; } public int getConcurrentConsumers() { return concurrentConsumers; } public void setConcurrentConsumers(int concurrentConsumers) { this.concurrentConsumers = concurrentConsumers; } @Override public void afterPropertiesConfigured(CamelContext camelContext) { // noop } @Override public ConnectionFactory getConnectionFactory() { return endpoint.getConnectionFactory(); } protected void configureConsumer(MessageConsumer consumer, Session session) throws Exception { consumer.setMessageListener(new SimpleMessageListener(messageListener, session)); } private class SimpleMessageListener implements MessageListener { private final SessionMessageListener messageListener; private final Session session; public SimpleMessageListener(SessionMessageListener messageListener, Session session) { this.messageListener = messageListener; this.session = session; } @Override public void onMessage(Message message) { try { doOnMessage(message); } catch (Exception e) { if (e instanceof JMSException) { if (endpoint.getExceptionListener() != null) { endpoint.getExceptionListener().onException((JMSException) e); } } else { LOG.warn("Execution of JMS message listener failed. This exception is ignored.", e); } } } protected void doOnMessage(Message message) throws Exception { try { messageListener.onMessage(message, session); } catch (Exception e) { // unexpected error so rollback rollbackIfNeeded(session); throw e; } // success then commit if we need to commitIfNeeded(session, message); } } @Override public void onException(JMSException exception) { if (exceptionListener != null) { try { exceptionListener.onException(exception); } catch (Exception e) { // ignore } } if (endpoint.getExceptionListener() != null) { try { endpoint.getExceptionListener().onException(exception); } catch (Exception e) { // ignore } } synchronized (this.connectionLock) { this.sessions = null; this.consumers = null; } scheduleConnectionRecovery(); } protected boolean recoverConnection(BackOffTimer.Task task) throws Exception { LOG.debug("Recovering from JMS Connection exception (attempt: {})", task.getCurrentAttempts()); try { refreshConnection(); initConsumers(); LOG.debug("Successfully recovered JMS Connection (attempt: {})", task.getCurrentAttempts()); // success so do not try again return false; } catch (Exception e) { if (LOG.isDebugEnabled()) { LOG.debug("Failed to recover JMS Connection. Will try again in " + task.getCurrentDelay() + " millis", e); } // try again return true; } } protected void scheduleConnectionRecovery() { if (scheduler == null) { this.scheduler = endpoint.getCamelContext().getExecutorServiceManager().newSingleThreadScheduledExecutor(this, "SimpleMessageListenerContainer"); } // we need to recover using a background task if (recoverTask == null || recoverTask.getStatus() != BackOffTimer.Task.Status.Active) { BackOff backOff = BackOff.builder().delay(endpoint.getRecoveryInterval()).build(); recoverTask = new BackOffTimer(scheduler).schedule(backOff, this::recoverConnection); } } @Override protected void doStart() throws Exception { createConnection(); initConsumers(); startConnection(); } @Override protected void doStop() throws Exception { if (recoverTask != null) { recoverTask.cancel(); } stopConnection(); stopConsumers(); if (scheduler != null) { endpoint.getCamelContext().getExecutorServiceManager().shutdown(scheduler); scheduler = null; } } protected void initConsumers() throws Exception { synchronized (this.consumerLock) { if (consumers == null) { LOG.debug("Initializing {} concurrent consumers as JMS listener on destination: {}", concurrentConsumers, destinationName); sessions = new HashSet<>(concurrentConsumers); consumers = new HashSet<>(concurrentConsumers); for (int i = 0; i < this.concurrentConsumers; i++) { Session session = createSession(connection, endpoint); MessageConsumer consumer = createMessageConsumer(session); configureConsumer(consumer, session); sessions.add(session); consumers.add(consumer); } } } } protected Session createSession(Connection connection, SjmsEndpoint endpoint) throws Exception { return connection.createSession(endpoint.isTransacted(), endpoint.getAcknowledgementMode().intValue()); } protected MessageConsumer createMessageConsumer(Session session) throws Exception { return endpoint.getJmsObjectFactory().createMessageConsumer(session, endpoint); } protected void stopConsumers() { synchronized (this.consumerLock) { if (consumers != null) { LOG.debug("Stopping JMS MessageConsumers"); for (MessageConsumer consumer : this.consumers) { closeConsumer(consumer); } if (this.sessions != null) { LOG.debug("Stopping JMS Sessions"); for (Session session : this.sessions) { closeSession(session); } } } } } protected void createConnection() throws Exception { synchronized (this.connectionLock) { if (this.connection == null) { Connection con = null; try { con = endpoint.getConnectionFactory().createConnection(); String cid = clientId != null ? clientId : endpoint.getClientId(); if (cid != null) { con.setClientID(cid); } con.setExceptionListener(this); } catch (JMSException e) { closeConnection(con); throw e; } this.connection = con; LOG.debug("Created JMS Connection"); } } } protected final void refreshConnection() throws Exception { synchronized (this.connectionLock) { closeConnection(connection); this.connection = null; createConnection(); if (this.connectionStarted) { startConnection(); } } } protected void startConnection() throws Exception { synchronized (this.connectionLock) { this.connectionStarted = true; if (this.connection != null) { try { this.connection.start(); } catch (javax.jms.IllegalStateException e) { // ignore as it may already be started } } } } protected void stopConnection() { synchronized (this.connectionLock) { this.connectionStarted = false; if (this.connection != null) { try { this.connection.stop(); } catch (Exception e) { LOG.debug("Error stopping connection. This exception is ignored.", e); } } } } }
{ "content_hash": "a637c63a58e1cd728b92f9e27a82d10c", "timestamp": "", "source": "github", "line_count": 328, "max_line_length": 122, "avg_line_length": 34.35060975609756, "alnum_prop": 0.6124079169255348, "repo_name": "pax95/camel", "id": "371582655b7eeebaed7922b7979f9740dccc0789", "size": "12069", "binary": false, "copies": "8", "ref": "refs/heads/CAMEL-17322", "path": "components/camel-sjms/src/main/java/org/apache/camel/component/sjms/consumer/SimpleMessageListenerContainer.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Apex", "bytes": "6519" }, { "name": "Batchfile", "bytes": "1518" }, { "name": "CSS", "bytes": "30373" }, { "name": "Elm", "bytes": "10852" }, { "name": "FreeMarker", "bytes": "11410" }, { "name": "Groovy", "bytes": "54390" }, { "name": "HTML", "bytes": "190919" }, { "name": "Java", "bytes": "68575773" }, { "name": "JavaScript", "bytes": "90399" }, { "name": "Makefile", "bytes": "513" }, { "name": "PLSQL", "bytes": "1419" }, { "name": "Python", "bytes": "36" }, { "name": "Ruby", "bytes": "4802" }, { "name": "Scala", "bytes": "323702" }, { "name": "Shell", "bytes": "17107" }, { "name": "Tcl", "bytes": "4974" }, { "name": "Thrift", "bytes": "6979" }, { "name": "XQuery", "bytes": "546" }, { "name": "XSLT", "bytes": "284638" } ] }
class TokyoMetro::Api::StationTimetable::Info::TrainTime::Info::Note::ConnectionInfo def initialize( station , connection ) @station = station @connection = connection end attr_reader :station , :connection def seed_and_get_id( railway_line_info_ids ) station_info_in_db = ::Station::Info.find_by( name_ja: @station , railway_line_info_id: railway_line_info_ids ) connection_info_h = { station_info_id: station_info_in_db.id , connection: @connection , note: self.to_s } ::StationTimetableConnectionInfo.find_or_create_by( connection_info_h ).id # ::TrainTimetableConnectionInfo.find_or_create_by( connection_info_h ).id end def to_s "" end end
{ "content_hash": "70626d00eb45a9a687df6a1ff4536972", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 115, "avg_line_length": 29.708333333333332, "alnum_prop": 0.6830294530154277, "repo_name": "osorubeki-fujita/odpt_tokyo_metro", "id": "434cdc27eee53db9c4498af314548621aebae0ec", "size": "713", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/tokyo_metro/api/station_timetable/info/train_time/info/note/connection_info.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "1712210" }, { "name": "Shell", "bytes": "115" } ] }
<?php namespace Symfony\Component\DomCrawler; use Symfony\Component\DomCrawler\Field\ChoiceFormField; use Symfony\Component\DomCrawler\Field\FormField; /** * Form represents an HTML form. * * @author Fabien Potencier <fabien@symfony.com> */ class Form extends Link implements \ArrayAccess { /** * @var \DOMElement */ private $button; /** * @var FormFieldRegistry */ private $fields; /** * @var string */ private $baseHref; /** * @param \DOMElement $node A \DOMElement instance * @param string|null $currentUri The URI of the page where the form is embedded * @param string|null $method The method to use for the link (if null, it defaults to the method defined by the form) * @param string|null $baseHref The URI of the <base> used for relative links, but not for empty action * * @throws \LogicException if the node is not a button inside a form tag */ public function __construct(\DOMElement $node, string $currentUri = null, string $method = null, string $baseHref = null) { parent::__construct($node, $currentUri, $method); $this->baseHref = $baseHref; $this->initialize(); } /** * Gets the form node associated with this form. * * @return \DOMElement */ public function getFormNode() { return $this->node; } /** * Sets the value of the fields. * * @param array $values An array of field values * * @return $this */ public function setValues(array $values) { foreach ($values as $name => $value) { $this->fields->set($name, $value); } return $this; } /** * Gets the field values. * * The returned array does not include file fields (@see getFiles). * * @return array */ public function getValues() { $values = []; foreach ($this->fields->all() as $name => $field) { if ($field->isDisabled()) { continue; } if (!$field instanceof Field\FileFormField && $field->hasValue()) { $values[$name] = $field->getValue(); } } return $values; } /** * Gets the file field values. * * @return array */ public function getFiles() { if (!\in_array($this->getMethod(), ['POST', 'PUT', 'DELETE', 'PATCH'])) { return []; } $files = []; foreach ($this->fields->all() as $name => $field) { if ($field->isDisabled()) { continue; } if ($field instanceof Field\FileFormField) { $files[$name] = $field->getValue(); } } return $files; } /** * Gets the field values as PHP. * * This method converts fields with the array notation * (like foo[bar] to arrays) like PHP does. * * @return array */ public function getPhpValues() { $values = []; foreach ($this->getValues() as $name => $value) { $qs = http_build_query([$name => $value], '', '&'); if (!empty($qs)) { parse_str($qs, $expandedValue); $varName = substr($name, 0, \strlen(key($expandedValue))); $values = array_replace_recursive($values, [$varName => current($expandedValue)]); } } return $values; } /** * Gets the file field values as PHP. * * This method converts fields with the array notation * (like foo[bar] to arrays) like PHP does. * The returned array is consistent with the array for field values * (@see getPhpValues), rather than uploaded files found in $_FILES. * For a compound file field foo[bar] it will create foo[bar][name], * instead of foo[name][bar] which would be found in $_FILES. * * @return array */ public function getPhpFiles() { $values = []; foreach ($this->getFiles() as $name => $value) { $qs = http_build_query([$name => $value], '', '&'); if (!empty($qs)) { parse_str($qs, $expandedValue); $varName = substr($name, 0, \strlen(key($expandedValue))); array_walk_recursive( $expandedValue, function (&$value, $key) { if (ctype_digit($value) && ('size' === $key || 'error' === $key)) { $value = (int) $value; } } ); reset($expandedValue); $values = array_replace_recursive($values, [$varName => current($expandedValue)]); } } return $values; } /** * Gets the URI of the form. * * The returned URI is not the same as the form "action" attribute. * This method merges the value if the method is GET to mimics * browser behavior. * * @return string */ public function getUri() { $uri = parent::getUri(); if (!\in_array($this->getMethod(), ['POST', 'PUT', 'DELETE', 'PATCH'])) { $query = parse_url($uri, \PHP_URL_QUERY); $currentParameters = []; if ($query) { parse_str($query, $currentParameters); } $queryString = http_build_query(array_merge($currentParameters, $this->getValues()), '', '&'); $pos = strpos($uri, '?'); $base = false === $pos ? $uri : substr($uri, 0, $pos); $uri = rtrim($base.'?'.$queryString, '?'); } return $uri; } protected function getRawUri() { // If the form was created from a button rather than the form node, check for HTML5 action overrides if ($this->button !== $this->node && $this->button->getAttribute('formaction')) { return $this->button->getAttribute('formaction'); } return $this->node->getAttribute('action'); } /** * Gets the form method. * * If no method is defined in the form, GET is returned. * * @return string */ public function getMethod() { if (null !== $this->method) { return $this->method; } // If the form was created from a button rather than the form node, check for HTML5 method override if ($this->button !== $this->node && $this->button->getAttribute('formmethod')) { return strtoupper($this->button->getAttribute('formmethod')); } return $this->node->getAttribute('method') ? strtoupper($this->node->getAttribute('method')) : 'GET'; } /** * Gets the form name. * * If no name is defined on the form, an empty string is returned. */ public function getName(): string { return $this->node->getAttribute('name'); } /** * Returns true if the named field exists. * * @return bool */ public function has(string $name) { return $this->fields->has($name); } /** * Removes a field from the form. */ public function remove(string $name) { $this->fields->remove($name); } /** * Gets a named field. * * @return FormField|FormField[]|FormField[][] * * @throws \InvalidArgumentException When field is not present in this form */ public function get(string $name) { return $this->fields->get($name); } /** * Sets a named field. */ public function set(FormField $field) { $this->fields->add($field); } /** * Gets all fields. * * @return FormField[] */ public function all() { return $this->fields->all(); } /** * Returns true if the named field exists. * * @param string $name The field name * * @return bool */ #[\ReturnTypeWillChange] public function offsetExists($name) { return $this->has($name); } /** * Gets the value of a field. * * @param string $name The field name * * @return FormField|FormField[]|FormField[][] * * @throws \InvalidArgumentException if the field does not exist */ #[\ReturnTypeWillChange] public function offsetGet($name) { return $this->fields->get($name); } /** * Sets the value of a field. * * @param string $name The field name * @param string|array $value The value of the field * * @return void * * @throws \InvalidArgumentException if the field does not exist */ #[\ReturnTypeWillChange] public function offsetSet($name, $value) { $this->fields->set($name, $value); } /** * Removes a field from the form. * * @param string $name The field name * * @return void */ #[\ReturnTypeWillChange] public function offsetUnset($name) { $this->fields->remove($name); } /** * Disables validation. * * @return self */ public function disableValidation() { foreach ($this->fields->all() as $field) { if ($field instanceof Field\ChoiceFormField) { $field->disableValidation(); } } return $this; } /** * Sets the node for the form. * * Expects a 'submit' button \DOMElement and finds the corresponding form element, or the form element itself. * * @throws \LogicException If given node is not a button or input or does not have a form ancestor */ protected function setNode(\DOMElement $node) { $this->button = $node; if ('button' === $node->nodeName || ('input' === $node->nodeName && \in_array(strtolower($node->getAttribute('type')), ['submit', 'button', 'image']))) { if ($node->hasAttribute('form')) { // if the node has the HTML5-compliant 'form' attribute, use it $formId = $node->getAttribute('form'); $form = $node->ownerDocument->getElementById($formId); if (null === $form) { throw new \LogicException(sprintf('The selected node has an invalid form attribute (%s).', $formId)); } $this->node = $form; return; } // we loop until we find a form ancestor do { if (null === $node = $node->parentNode) { throw new \LogicException('The selected node does not have a form ancestor.'); } } while ('form' !== $node->nodeName); } elseif ('form' !== $node->nodeName) { throw new \LogicException(sprintf('Unable to submit on a "%s" tag.', $node->nodeName)); } $this->node = $node; } /** * Adds form elements related to this form. * * Creates an internal copy of the submitted 'button' element and * the form node or the entire document depending on whether we need * to find non-descendant elements through HTML5 'form' attribute. */ private function initialize() { $this->fields = new FormFieldRegistry(); $xpath = new \DOMXPath($this->node->ownerDocument); // add submitted button if it has a valid name if ('form' !== $this->button->nodeName && $this->button->hasAttribute('name') && $this->button->getAttribute('name')) { if ('input' == $this->button->nodeName && 'image' == strtolower($this->button->getAttribute('type'))) { $name = $this->button->getAttribute('name'); $this->button->setAttribute('value', '0'); // temporarily change the name of the input node for the x coordinate $this->button->setAttribute('name', $name.'.x'); $this->set(new Field\InputFormField($this->button)); // temporarily change the name of the input node for the y coordinate $this->button->setAttribute('name', $name.'.y'); $this->set(new Field\InputFormField($this->button)); // restore the original name of the input node $this->button->setAttribute('name', $name); } else { $this->set(new Field\InputFormField($this->button)); } } // find form elements corresponding to the current form if ($this->node->hasAttribute('id')) { // corresponding elements are either descendants or have a matching HTML5 form attribute $formId = Crawler::xpathLiteral($this->node->getAttribute('id')); $fieldNodes = $xpath->query(sprintf('( descendant::input[@form=%s] | descendant::button[@form=%1$s] | descendant::textarea[@form=%1$s] | descendant::select[@form=%1$s] | //form[@id=%1$s]//input[not(@form)] | //form[@id=%1$s]//button[not(@form)] | //form[@id=%1$s]//textarea[not(@form)] | //form[@id=%1$s]//select[not(@form)] )[not(ancestor::template)]', $formId)); foreach ($fieldNodes as $node) { $this->addField($node); } } else { // do the xpath query with $this->node as the context node, to only find descendant elements // however, descendant elements with form attribute are not part of this form $fieldNodes = $xpath->query('( descendant::input[not(@form)] | descendant::button[not(@form)] | descendant::textarea[not(@form)] | descendant::select[not(@form)] )[not(ancestor::template)]', $this->node); foreach ($fieldNodes as $node) { $this->addField($node); } } if ($this->baseHref && '' !== $this->node->getAttribute('action')) { $this->currentUri = $this->baseHref; } } private function addField(\DOMElement $node) { if (!$node->hasAttribute('name') || !$node->getAttribute('name')) { return; } $nodeName = $node->nodeName; if ('select' == $nodeName || 'input' == $nodeName && 'checkbox' == strtolower($node->getAttribute('type'))) { $this->set(new Field\ChoiceFormField($node)); } elseif ('input' == $nodeName && 'radio' == strtolower($node->getAttribute('type'))) { // there may be other fields with the same name that are no choice // fields already registered (see https://github.com/symfony/symfony/issues/11689) if ($this->has($node->getAttribute('name')) && $this->get($node->getAttribute('name')) instanceof ChoiceFormField) { $this->get($node->getAttribute('name'))->addChoice($node); } else { $this->set(new Field\ChoiceFormField($node)); } } elseif ('input' == $nodeName && 'file' == strtolower($node->getAttribute('type'))) { $this->set(new Field\FileFormField($node)); } elseif ('input' == $nodeName && !\in_array(strtolower($node->getAttribute('type')), ['submit', 'button', 'image'])) { $this->set(new Field\InputFormField($node)); } elseif ('textarea' == $nodeName) { $this->set(new Field\TextareaFormField($node)); } } }
{ "content_hash": "e3ee1e093171497286337f1d57a73eee", "timestamp": "", "source": "github", "line_count": 494, "max_line_length": 376, "avg_line_length": 31.220647773279353, "alnum_prop": 0.5358879595409454, "repo_name": "oleg-andreyev/symfony", "id": "f795ce5963f7ea574f1ce2cb686b59f52584d766", "size": "15652", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Symfony/Component/DomCrawler/Form.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "49607" }, { "name": "HTML", "bytes": "356956" }, { "name": "Hack", "bytes": "26" }, { "name": "JavaScript", "bytes": "27650" }, { "name": "PHP", "bytes": "18500484" }, { "name": "Shell", "bytes": "3136" } ] }
module Data.SBV.Bridge.MathSAT ( -- * MathSAT specific interface sbvCurrentSolver -- ** Proving and checking satisfiability , prove, sat, allSat, isVacuous, isTheorem, isSatisfiable -- ** Optimization routines , optimize, minimize, maximize -- * Non-MathSAT specific SBV interface -- $moduleExportIntro , module Data.SBV ) where import Data.SBV hiding (prove, sat, allSat, isVacuous, isTheorem, isSatisfiable, optimize, minimize, maximize, sbvCurrentSolver) -- | Current solver instance, pointing to cvc4. sbvCurrentSolver :: SMTConfig sbvCurrentSolver = mathSAT -- | Prove theorems, using the CVC4 SMT solver prove :: Provable a => a -- ^ Property to check -> IO ThmResult -- ^ Response from the SMT solver, containing the counter-example if found prove = proveWith sbvCurrentSolver -- | Find satisfying solutions, using the CVC4 SMT solver sat :: Provable a => a -- ^ Property to check -> IO SatResult -- ^ Response of the SMT Solver, containing the model if found sat = satWith sbvCurrentSolver -- | Find all satisfying solutions, using the CVC4 SMT solver allSat :: Provable a => a -- ^ Property to check -> IO AllSatResult -- ^ List of all satisfying models allSat = allSatWith sbvCurrentSolver -- | Check vacuity of the explicit constraints introduced by calls to the 'constrain' function, using the CVC4 SMT solver isVacuous :: Provable a => a -- ^ Property to check -> IO Bool -- ^ True if the constraints are unsatisifiable isVacuous = isVacuousWith sbvCurrentSolver -- | Check if the statement is a theorem, with an optional time-out in seconds, using the CVC4 SMT solver isTheorem :: Provable a => Maybe Int -- ^ Optional time-out, specify in seconds -> a -- ^ Property to check -> IO (Maybe Bool) -- ^ Returns Nothing if time-out expires isTheorem = isTheoremWith sbvCurrentSolver -- | Check if the statement is satisfiable, with an optional time-out in seconds, using the CVC4 SMT solver isSatisfiable :: Provable a => Maybe Int -- ^ Optional time-out, specify in seconds -> a -- ^ Property to check -> IO (Maybe Bool) -- ^ Returns Nothing if time-out expiers isSatisfiable = isSatisfiableWith sbvCurrentSolver -- | Optimize cost functions, using the CVC4 SMT solver optimize :: (SatModel a, SymWord a, Show a, SymWord c, Show c) => OptimizeOpts -- ^ Parameters to optimization (Iterative, Quantified, etc.) -> (SBV c -> SBV c -> SBool) -- ^ Betterness check: This is the comparison predicate for optimization -> ([SBV a] -> SBV c) -- ^ Cost function -> Int -- ^ Number of inputs -> ([SBV a] -> SBool) -- ^ Validity function -> IO (Maybe [a]) -- ^ Returns Nothing if there is no valid solution, otherwise an optimal solution optimize = optimizeWith sbvCurrentSolver -- | Minimize cost functions, using the CVC4 SMT solver minimize :: (SatModel a, SymWord a, Show a, SymWord c, Show c) => OptimizeOpts -- ^ Parameters to optimization (Iterative, Quantified, etc.) -> ([SBV a] -> SBV c) -- ^ Cost function to minimize -> Int -- ^ Number of inputs -> ([SBV a] -> SBool) -- ^ Validity function -> IO (Maybe [a]) -- ^ Returns Nothing if there is no valid solution, otherwise an optimal solution minimize = minimizeWith sbvCurrentSolver -- | Maximize cost functions, using the CVC4 SMT solver maximize :: (SatModel a, SymWord a, Show a, SymWord c, Show c) => OptimizeOpts -- ^ Parameters to optimization (Iterative, Quantified, etc.) -> ([SBV a] -> SBV c) -- ^ Cost function to maximize -> Int -- ^ Number of inputs -> ([SBV a] -> SBool) -- ^ Validity function -> IO (Maybe [a]) -- ^ Returns Nothing if there is no valid solution, otherwise an optimal solution maximize = maximizeWith sbvCurrentSolver {- $moduleExportIntro The remainder of the SBV library that is common to all back-end SMT solvers, directly coming from the "Data.SBV" module. -}
{ "content_hash": "304ed8f516c45fb6056ca78b3f896dd1", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 128, "avg_line_length": 50.41379310344828, "alnum_prop": 0.6244870041039672, "repo_name": "TomMD/cryptol", "id": "51f285612ff79f5a502f763bb37e1625273cf98e", "size": "5015", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "sbv/Data/SBV/Bridge/MathSAT.hs", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "CSS", "bytes": "144" }, { "name": "Haskell", "bytes": "1130032" }, { "name": "JavaScript", "bytes": "1763" }, { "name": "Perl", "bytes": "31978" }, { "name": "Python", "bytes": "101051" }, { "name": "Shell", "bytes": "839" }, { "name": "TeX", "bytes": "711983" } ] }
:orphan: `plasmapy.conftest` =================== .. currentmodule:: plasmapy.conftest .. automodapi:: plasmapy.conftest
{ "content_hash": "4f4de0fd5612cf98d0f33ae2527a3a16", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 36, "avg_line_length": 15.5, "alnum_prop": 0.6209677419354839, "repo_name": "StanczakDominik/PlasmaPy", "id": "874d2081b9765610f3cb145942ddc59d22155d89", "size": "124", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "docs/api_static/plasmapy.conftest.rst", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Jupyter Notebook", "bytes": "1285" }, { "name": "Python", "bytes": "2148684" } ] }
using System.Collections.Generic; public class EdmondsKarp { private static int[][] graph; private static int[] parents; public static int FindMaxFlow(int[][] targetGraph) { graph = targetGraph; parents = new int[graph.Length]; for (int i = 0; i < graph.Length; i++) { parents[i] = -1; } int maxFlow = 0; int start = 0; int end = graph.Length - 1; while (BFS(start, end)) { int pathFlow = int.MaxValue; int currentNode = end; while (currentNode != start) { int previousNode = parents[currentNode]; if (graph[previousNode][currentNode] < pathFlow) { pathFlow = graph[previousNode][currentNode]; } currentNode = previousNode; } maxFlow += pathFlow; currentNode = end; while (currentNode != start) { int previousNode = parents[currentNode]; graph[previousNode][currentNode] -= pathFlow; graph[currentNode][previousNode] += pathFlow; currentNode = previousNode; } } return maxFlow; } private static bool BFS(int start, int end) { var visited = new bool[graph.Length]; Queue<int> queue = new Queue<int>(); queue.Enqueue(start); while (queue.Count > 0) { int currentNode = queue.Dequeue(); visited[currentNode] = true; for (int child = 0; child < graph[currentNode].Length; child++) { if (!visited[child] && graph[currentNode][child] > 0) { queue.Enqueue(child); parents[child] = currentNode; } } } return visited[end]; } }
{ "content_hash": "69d89d9bbc9c226244b193c2eac1fc97", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 75, "avg_line_length": 25.166666666666668, "alnum_prop": 0.4803871625063678, "repo_name": "MrPIvanov/SoftUni", "id": "2d4f53837691e0307e23ac734d95468751c8f42f", "size": "1965", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "13-Algorithms/14_ADVANCED GRAPH ALGORITHMS - PART II/AdvancedGraphsPart02Lab/MaxFlowEdmondsKarp/EdmondsKarp.cs", "mode": "33188", "license": "mit", "language": [ { "name": "ASP", "bytes": "108" }, { "name": "Batchfile", "bytes": "3626" }, { "name": "C#", "bytes": "4493116" }, { "name": "CSS", "bytes": "5970658" }, { "name": "Dockerfile", "bytes": "576" }, { "name": "HTML", "bytes": "7383994" }, { "name": "Hack", "bytes": "5211" }, { "name": "Java", "bytes": "16968" }, { "name": "JavaScript", "bytes": "3319467" }, { "name": "PHP", "bytes": "14435" }, { "name": "PLSQL", "bytes": "583827" }, { "name": "PLpgSQL", "bytes": "16958" }, { "name": "Ruby", "bytes": "5904" }, { "name": "TSQL", "bytes": "2034451" } ] }
"""Convert trace output for Chrome. Takes a loading trace from 'analyze.py log_requests' and outputs a json file that can be loaded by chrome's about:tracing.. """ import argparse import json if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('input') parser.add_argument('output') args = parser.parse_args() with file(args.output, 'w') as output_f, file(args.input) as input_f: events = json.load(input_f)['tracing_track']['events'] json.dump({'traceEvents': events, 'metadata': {}}, output_f)
{ "content_hash": "8c422834b948d331daf924b701a5f180", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 76, "avg_line_length": 32.1764705882353, "alnum_prop": 0.6892138939670932, "repo_name": "axinging/chromium-crosswalk", "id": "23c3632a095cd66cd0e20a8dc2785b9265dd0203", "size": "729", "binary": false, "copies": "10", "ref": "refs/heads/master", "path": "tools/android/loading/trace_to_chrome_trace.py", "mode": "33261", "license": "bsd-3-clause", "language": [ { "name": "ApacheConf", "bytes": "8242" }, { "name": "AppleScript", "bytes": "6973" }, { "name": "Arduino", "bytes": "464" }, { "name": "Assembly", "bytes": "23945" }, { "name": "C", "bytes": "4103204" }, { "name": "C++", "bytes": "225022948" }, { "name": "CSS", "bytes": "949808" }, { "name": "Dart", "bytes": "74976" }, { "name": "Go", "bytes": "18155" }, { "name": "HTML", "bytes": "28206993" }, { "name": "Java", "bytes": "7651204" }, { "name": "JavaScript", "bytes": "18831169" }, { "name": "Makefile", "bytes": "96270" }, { "name": "Objective-C", "bytes": "1228122" }, { "name": "Objective-C++", "bytes": "7563676" }, { "name": "PHP", "bytes": "97817" }, { "name": "Perl", "bytes": "63937" }, { "name": "Protocol Buffer", "bytes": "418221" }, { "name": "Python", "bytes": "7855597" }, { "name": "Shell", "bytes": "472586" }, { "name": "Standard ML", "bytes": "4965" }, { "name": "XSLT", "bytes": "418" }, { "name": "nesC", "bytes": "18335" } ] }
'use strict'; angular.module('app.directives').directive('validUniqueUsername', ['UserService', '$q', function (UserService, $q) { return { restrict: 'A', require: "ngModel", link: function (scope, elem, attrs, ngModelCtrl) { ngModelCtrl.$asyncValidators.uniqueUsername = function (modelValue, viewValue) { var value = modelValue || viewValue; var def = $q.defer(); UserService.findFirstUserByName(value).then(function () { def.reject(); }, function () { def.resolve(); }); return def.promise; }; } }; }]);
{ "content_hash": "46605e95ac1c237bb03ef427b750e010", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 116, "avg_line_length": 32.27272727272727, "alnum_prop": 0.5028169014084507, "repo_name": "zhenyong/DoitWeb", "id": "6f67665b7f2dd851ee1246583ff8ae6453798e7f", "size": "710", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/common/directives/validUniqueUsernameDirective.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "2487" }, { "name": "HTML", "bytes": "117697" }, { "name": "JavaScript", "bytes": "16230" } ] }
(function() { var hi; hi = function() { return [document.title, "Hello JavaScript"].join(": "); }; }).call(this);
{ "content_hash": "d3508422f49eb297e4e031190a7804cb", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 57, "avg_line_length": 15.25, "alnum_prop": 0.5655737704918032, "repo_name": "Caraxiong/CoffeeScript_demo", "id": "6c5b1dad28c892d4d98ca880b91053fbce8bb809", "size": "158", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/js/code.js", "mode": "33188", "license": "mit", "language": [ { "name": "CoffeeScript", "bytes": "16600" } ] }
FROM balenalib/coral-dev-ubuntu:focal-build ENV NODE_VERSION 12.22.1 ENV YARN_VERSION 1.22.4 RUN for key in \ 6A010C5166006599AA17F08146C2130DFD2497F5 \ ; do \ gpg --keyserver pgp.mit.edu --recv-keys "$key" || \ gpg --keyserver keyserver.pgp.com --recv-keys "$key" || \ gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" ; \ done \ && curl -SLO "http://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-arm64.tar.gz" \ && echo "917c582b7f7ae5ff8b2d97e05d00598011f9fbfcc4f76952da3ed477405c9c1a node-v$NODE_VERSION-linux-arm64.tar.gz" | sha256sum -c - \ && tar -xzf "node-v$NODE_VERSION-linux-arm64.tar.gz" -C /usr/local --strip-components=1 \ && rm "node-v$NODE_VERSION-linux-arm64.tar.gz" \ && curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz" \ && curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz.asc" \ && gpg --batch --verify yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \ && mkdir -p /opt/yarn \ && tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/yarn --strip-components=1 \ && ln -s /opt/yarn/bin/yarn /usr/local/bin/yarn \ && ln -s /opt/yarn/bin/yarn /usr/local/bin/yarnpkg \ && rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \ && npm config set unsafe-perm true -g --unsafe-perm \ && rm -rf /tmp/* CMD ["echo","'No CMD command was set in Dockerfile! Details about CMD command could be found in Dockerfile Guide section in our Docs. Here's the link: https://balena.io/docs"] RUN curl -SLO "https://raw.githubusercontent.com/balena-io-library/base-images/8accad6af708fca7271c5c65f18a86782e19f877/scripts/assets/tests/test-stack@node.sh" \ && echo "Running test-stack@node" \ && chmod +x test-stack@node.sh \ && bash test-stack@node.sh \ && rm -rf test-stack@node.sh RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo 'Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): \nArchitecture: ARM v8 \nOS: Ubuntu focal \nVariant: build variant \nDefault variable(s): UDEV=off \nThe following software stack is preinstalled: \nNode.js v12.22.1, Yarn v1.22.4 \nExtra features: \n- Easy way to install packages with `install_packages <package-name>` command \n- Run anywhere with cross-build feature (for ARM only) \n- Keep the container idling with `balena-idle` command \n- Show base image details with `balena-info` command' > /.balena/messages/image-info RUN echo '#!/bin/sh.real\nbalena-info\nrm -f /bin/sh\ncp /bin/sh.real /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \ && chmod +x /bin/sh-shim \ && cp /bin/sh /bin/sh.real \ && mv /bin/sh-shim /bin/sh
{ "content_hash": "f65384a0fceb92451c7c78a166956a94", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 693, "avg_line_length": 66.70731707317073, "alnum_prop": 0.7093235831809872, "repo_name": "nghiant2710/base-images", "id": "1800c4d8a4f2322dc068ab8812b4c63efe08c340", "size": "2756", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "balena-base-images/node/coral-dev/ubuntu/focal/12.22.1/build/Dockerfile", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Dockerfile", "bytes": "144558581" }, { "name": "JavaScript", "bytes": "16316" }, { "name": "Shell", "bytes": "368690" } ] }
package org.apache.ibatis.submitted.cacheorder; import static org.junit.jupiter.api.Assertions.assertEquals; import java.io.Reader; import org.apache.ibatis.BaseDataTest; import org.apache.ibatis.cache.Cache; import org.apache.ibatis.io.Resources; import org.apache.ibatis.mapping.MappedStatement; import org.apache.ibatis.session.SqlSessionFactory; import org.apache.ibatis.session.SqlSessionFactoryBuilder; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; class CacheOrderTest { private static SqlSessionFactory sqlSessionFactory; @BeforeAll static void setUp() throws Exception { // create a SqlSessionFactory try (Reader reader = Resources.getResourceAsReader("org/apache/ibatis/submitted/cacheorder/mybatis-config.xml")) { sqlSessionFactory = new SqlSessionFactoryBuilder().build(reader); } // populate in-memory database BaseDataTest.runScript(sqlSessionFactory.getConfiguration().getEnvironment().getDataSource(), "org/apache/ibatis/submitted/cacheorder/CreateDB.sql"); } @Test void shouldResolveACacheRefNotYetRead() { MappedStatement ms = sqlSessionFactory.getConfiguration().getMappedStatement("getUser"); Cache cache = ms.getCache(); assertEquals("org.apache.ibatis.submitted.cacheorder.Mapper2", cache.getId()); } }
{ "content_hash": "704c1dac07e8430a1d0638cb7af57719", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 118, "avg_line_length": 33.2, "alnum_prop": 0.7778614457831325, "repo_name": "wuwen5/mybatis-3", "id": "f8cadfd927db92e031eed8da67f5fd8fa8271c01", "size": "1976", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/test/java/org/apache/ibatis/submitted/cacheorder/CacheOrderTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "8370" }, { "name": "Java", "bytes": "3276208" }, { "name": "PLpgSQL", "bytes": "5675" }, { "name": "TSQL", "bytes": "5683" } ] }
package com.devilwwj.jni; /** * com.devilwwj.jnidemo * Created by devilwwj on 16/4/30. */ public class TestJNI { public native String hello(); public native boolean Init(); public native int Add(int x, int y); public native void destory(); public native void createANativeCrash(); public native void createANativeCrash2(); }
{ "content_hash": "163dd6b08325c319c97099e9ae4da90f", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 45, "avg_line_length": 22.1875, "alnum_prop": 0.6901408450704225, "repo_name": "devilWwj/Android-Tech", "id": "660860db259f186848bd866e4fa0bb671d0592a5", "size": "355", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "JNIDemo/mylib/src/main/java/com/devilwwj/jni/TestJNI.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "70" }, { "name": "C", "bytes": "1685" }, { "name": "C++", "bytes": "1458" }, { "name": "Groovy", "bytes": "12702" }, { "name": "Java", "bytes": "123973" }, { "name": "Makefile", "bytes": "32685" } ] }
<?php /** * Enable theme features */ add_theme_support('root-relative-urls'); // Enable relative URLs add_theme_support('bootstrap-top-navbar'); // Enable Bootstrap's top navbar add_theme_support('bootstrap-gallery'); // Enable Bootstrap's thumbnails component on [gallery] add_theme_support('nice-search'); // Enable /?s= to /search/ redirect add_theme_support('jquery-cdn'); // Enable to load jQuery from the Google CDN /** * Configuration values */ define('GOOGLE_ANALYTICS_ID', ''); // UA-XXXXX-Y (Note: Universal Analytics only, not Classic Analytics) define('POST_EXCERPT_LENGTH', 40); // Length in words for excerpt_length filter (http://codex.wordpress.org/Plugin_API/Filter_Reference/excerpt_length) /** * .main classes */ function roots_main_class() { if (roots_display_sidebar()) { // Classes on pages with the sidebar $class = 'col-sm-9'; } else { // Classes on full width pages $class = ''; } return $class; } /** * .sidebar classes */ function roots_sidebar_class() { return 'col-sm-3'; } /** * Define which pages shouldn't have the sidebar * * See lib/sidebar.php for more details */ function roots_display_sidebar() { $sidebar_config = new Roots_Sidebar( /** * Conditional tag checks (http://codex.wordpress.org/Conditional_Tags) * Any of these conditional tags that return true won't show the sidebar * * To use a function that accepts arguments, use the following format: * * array('function_name', array('arg1', 'arg2')) * * The second element must be an array even if there's only 1 argument. */ array( 'is_404', 'is_front_page', 'is_search' ), /** * Page template checks (via is_page_template()) * Any of these page templates that return true won't show the sidebar */ array( // 'template-custom.php', ) ); return apply_filters('roots_display_sidebar', $sidebar_config->display); } /** * $content_width is a global variable used by WordPress for max image upload sizes * and media embeds (in pixels). * * Example: If the content area is 640px wide, set $content_width = 620; so images and videos will not overflow. * Default: 1140px is the default Bootstrap container width. */ if (!isset($content_width)) { $content_width = 1140; }
{ "content_hash": "07ef0a00da0be4e8d6694df39d59397a", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 151, "avg_line_length": 29.3375, "alnum_prop": 0.6553046442266723, "repo_name": "piggy1979/redbike", "id": "7804c570aedda525c884c0e66a2835b508e1cdec", "size": "2347", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/config.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "242990" }, { "name": "JavaScript", "bytes": "118733" }, { "name": "PHP", "bytes": "84077" } ] }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd"> <HTML> <HEAD> <meta name="generator" content="JDiff v1.0.9"> <!-- Generated by the JDiff Javadoc doclet --> <!-- (http://www.jdiff.org) --> <meta name="description" content="JDiff is a Javadoc doclet which generates an HTML report of all the packages, classes, constructors, methods, and fields which have been removed, added or changed in any way, including their documentation, when two APIs are compared."> <meta name="keywords" content="diff, jdiff, javadiff, java diff, java difference, API difference, difference between two APIs, API diff, Javadoc, doclet"> <TITLE> Method Additions Index </TITLE> <LINK REL="stylesheet" TYPE="text/css" HREF="../stylesheet-jdiff.css" TITLE="Style"> </HEAD> <BODY> <a NAME="topheader"></a> <table summary="Index for Methods" width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td bgcolor="#FFFFCC"> <font size="+1"><a href="methods_index_all.html" class="staysblack">All Methods</a></font> </td> </tr> <tr> <td bgcolor="#FFFFFF"> <FONT SIZE="-1"> <A HREF="methods_index_removals.html" class="hiddenlink">Removals</A> </FONT> </td> </tr> <tr> <td bgcolor="#FFFFFF"> <FONT SIZE="-1"> <b>Additions</b> </FONT> </td> </tr> <tr> <td bgcolor="#FFFFFF"> <FONT SIZE="-1"> <A HREF="methods_index_changes.html"class="hiddenlink">Changes</A> </FONT> </td> </tr> <tr> <td> <font size="-2"><b>Bold</b>&nbsp;is&nbsp;New,&nbsp;<strike>strike</strike>&nbsp;is&nbsp;deleted</font> </td> </tr> </table><br> <A NAME="A"></A> <br><font size="+2">A</font>&nbsp; <a href="#C"><font size="-2">C</font></a> <a href="#E"><font size="-2">E</font></a> <a href="#G"><font size="-2">G</font></a> <a href="#I"><font size="-2">I</font></a> <a href="#M"><font size="-2">M</font></a> <a href="#P"><font size="-2">P</font></a> <a href="#Q"><font size="-2">Q</font></a> <a href="#S"><font size="-2">S</font></a> <a href="#T"><font size="-2">T</font></a> <a href="#topheader"><font size="-2">TOP</font></a> <br> <nobr><A HREF="org.apache.zookeeper.ZooKeeperMain.html#org.apache.zookeeper.ZooKeeperMain.addToHistory_added(int, java.lang.String)" class="hiddenlink" target="rightframe"><b>addToHistory</b> (<code>int, String</code>)</A></nobr><br> <A NAME="C"></A> <br><font size="+2">C</font>&nbsp; <a href="#A"><font size="-2">A</font></a> <a href="#E"><font size="-2">E</font></a> <a href="#G"><font size="-2">G</font></a> <a href="#I"><font size="-2">I</font></a> <a href="#M"><font size="-2">M</font></a> <a href="#P"><font size="-2">P</font></a> <a href="#Q"><font size="-2">Q</font></a> <a href="#S"><font size="-2">S</font></a> <a href="#T"><font size="-2">T</font></a> <a href="#topheader"><font size="-2">TOP</font></a> <br> <nobr><A HREF="org.apache.zookeeper.ZooKeeperMain.html#org.apache.zookeeper.ZooKeeperMain.connectToZK_added(java.lang.String)" class="hiddenlink" target="rightframe"><b>connectToZK</b> (<code>String</code>)</A></nobr><br> <A NAME="E"></A> <br><font size="+2">E</font>&nbsp; <a href="#A"><font size="-2">A</font></a> <a href="#C"><font size="-2">C</font></a> <a href="#G"><font size="-2">G</font></a> <a href="#I"><font size="-2">I</font></a> <a href="#M"><font size="-2">M</font></a> <a href="#P"><font size="-2">P</font></a> <a href="#Q"><font size="-2">Q</font></a> <a href="#S"><font size="-2">S</font></a> <a href="#T"><font size="-2">T</font></a> <a href="#topheader"><font size="-2">TOP</font></a> <br> <nobr><A HREF="org.apache.zookeeper.ZooKeeperMain.html#org.apache.zookeeper.ZooKeeperMain.executeLine_added(java.lang.String)" class="hiddenlink" target="rightframe"><b>executeLine</b> (<code>String</code>)</A></nobr><br> <A NAME="G"></A> <br><font size="+2">G</font>&nbsp; <a href="#A"><font size="-2">A</font></a> <a href="#C"><font size="-2">C</font></a> <a href="#E"><font size="-2">E</font></a> <a href="#I"><font size="-2">I</font></a> <a href="#M"><font size="-2">M</font></a> <a href="#P"><font size="-2">P</font></a> <a href="#Q"><font size="-2">Q</font></a> <a href="#S"><font size="-2">S</font></a> <a href="#T"><font size="-2">T</font></a> <a href="#topheader"><font size="-2">TOP</font></a> <br> <i>getChildren</i><br> &nbsp;&nbsp;<nobr><A HREF="org.apache.zookeeper.ZooKeeper.html#org.apache.zookeeper.ZooKeeper.getChildren_added(java.lang.String, boolean, org.apache.zookeeper.data.Stat)" class="hiddenlink" target="rightframe">type&nbsp;<b> (<code>String, boolean, Stat</code>)</b>&nbsp;in&nbsp;org.apache.zookeeper.ZooKeeper </A></nobr><br> &nbsp;&nbsp;<nobr><A HREF="org.apache.zookeeper.ZooKeeper.html#org.apache.zookeeper.ZooKeeper.getChildren_added(java.lang.String, org.apache.zookeeper.Watcher, org.apache.zookeeper.data.Stat)" class="hiddenlink" target="rightframe">type&nbsp;<b> (<code>String, Watcher, Stat</code>)</b>&nbsp;in&nbsp;org.apache.zookeeper.ZooKeeper </A></nobr><br> &nbsp;&nbsp;<nobr><A HREF="org.apache.zookeeper.ZooKeeper.html#org.apache.zookeeper.ZooKeeper.getChildren_added(java.lang.String, boolean, org.apache.zookeeper.AsyncCallback.Children2Callback, java.lang.Object)" class="hiddenlink" target="rightframe">type&nbsp;<b> (<code>String, boolean, Children2Callback, Object</code>)</b>&nbsp;in&nbsp;org.apache.zookeeper.ZooKeeper </A></nobr><br> &nbsp;&nbsp;<nobr><A HREF="org.apache.zookeeper.ZooKeeper.html#org.apache.zookeeper.ZooKeeper.getChildren_added(java.lang.String, org.apache.zookeeper.Watcher, org.apache.zookeeper.AsyncCallback.Children2Callback, java.lang.Object)" class="hiddenlink" target="rightframe">type&nbsp;<b> (<code>String, Watcher, Children2Callback, Object</code>)</b>&nbsp;in&nbsp;org.apache.zookeeper.ZooKeeper </A></nobr><br> <nobr><A HREF="org.apache.zookeeper.ZooKeeperMain.html#org.apache.zookeeper.ZooKeeperMain.getCommands_added()" class="hiddenlink" target="rightframe"><b>getCommands</b> ()</A></nobr><br> <nobr><A HREF="org.apache.zookeeper.ClientCnxn.html#org.apache.zookeeper.ClientCnxn.getDisableAutoResetWatch_added()" class="hiddenlink" target="rightframe"><b>getDisableAutoResetWatch</b> ()</A></nobr><br> <nobr><A HREF="org.apache.zookeeper.ZooKeeperMain.html#org.apache.zookeeper.ZooKeeperMain.getPrintWatches_added()" class="hiddenlink" target="rightframe"><b>getPrintWatches</b> ()</A></nobr><br> <nobr><A HREF="org.apache.zookeeper.ZooKeeperMain.html#org.apache.zookeeper.ZooKeeperMain.getPrompt_added()" class="hiddenlink" target="rightframe"><b>getPrompt</b> ()</A></nobr><br> <nobr><A HREF="org.apache.zookeeper.KeeperException.html#org.apache.zookeeper.KeeperException.getResults_added()" class="hiddenlink" target="rightframe"><b>getResults</b> ()</A></nobr><br> <i>getSessionTimeout</i><br> &nbsp;&nbsp;<nobr><A HREF="org.apache.zookeeper.ClientCnxn.html#org.apache.zookeeper.ClientCnxn.getSessionTimeout_added()" class="hiddenlink" target="rightframe">type&nbsp;<b> ()</b>&nbsp;in&nbsp;org.apache.zookeeper.ClientCnxn </A></nobr><br> &nbsp;&nbsp;<nobr><A HREF="org.apache.zookeeper.ZooKeeper.html#org.apache.zookeeper.ZooKeeper.getSessionTimeout_added()" class="hiddenlink" target="rightframe">type&nbsp;<b> ()</b>&nbsp;in&nbsp;org.apache.zookeeper.ZooKeeper </A></nobr><br> <A NAME="I"></A> <br><font size="+2">I</font>&nbsp; <a href="#A"><font size="-2">A</font></a> <a href="#C"><font size="-2">C</font></a> <a href="#E"><font size="-2">E</font></a> <a href="#G"><font size="-2">G</font></a> <a href="#M"><font size="-2">M</font></a> <a href="#P"><font size="-2">P</font></a> <a href="#Q"><font size="-2">Q</font></a> <a href="#S"><font size="-2">S</font></a> <a href="#T"><font size="-2">T</font></a> <a href="#topheader"><font size="-2">TOP</font></a> <br> <nobr><A HREF="org.apache.zookeeper.ZooKeeper.States.html#org.apache.zookeeper.ZooKeeper.States.isConnected_added()" class="hiddenlink" target="rightframe"><b>isConnected</b> ()</A></nobr><br> <A NAME="M"></A> <br><font size="+2">M</font>&nbsp; <a href="#A"><font size="-2">A</font></a> <a href="#C"><font size="-2">C</font></a> <a href="#E"><font size="-2">E</font></a> <a href="#G"><font size="-2">G</font></a> <a href="#I"><font size="-2">I</font></a> <a href="#P"><font size="-2">P</font></a> <a href="#Q"><font size="-2">Q</font></a> <a href="#S"><font size="-2">S</font></a> <a href="#T"><font size="-2">T</font></a> <a href="#topheader"><font size="-2">TOP</font></a> <br> <nobr><A HREF="org.apache.zookeeper.ZooKeeper.html#org.apache.zookeeper.ZooKeeper.multi_added(java.lang.Iterable)" class="hiddenlink" target="rightframe"><b>multi</b> (<code>Iterable</code>)</A></nobr><br> <nobr><A HREF="org.apache.zookeeper.ZooKeeper.html#org.apache.zookeeper.ZooKeeper.multiInternal_added(org.apache.zookeeper.MultiTransactionRecord)" class="hiddenlink" target="rightframe"><b>multiInternal</b> (<code>MultiTransactionRecord</code>)</A></nobr><br> <A NAME="P"></A> <br><font size="+2">P</font>&nbsp; <a href="#A"><font size="-2">A</font></a> <a href="#C"><font size="-2">C</font></a> <a href="#E"><font size="-2">E</font></a> <a href="#G"><font size="-2">G</font></a> <a href="#I"><font size="-2">I</font></a> <a href="#M"><font size="-2">M</font></a> <a href="#Q"><font size="-2">Q</font></a> <a href="#S"><font size="-2">S</font></a> <a href="#T"><font size="-2">T</font></a> <a href="#topheader"><font size="-2">TOP</font></a> <br> <nobr><A HREF="org.apache.zookeeper.ZooKeeperMain.html#org.apache.zookeeper.ZooKeeperMain.printMessage_added(java.lang.String)" class="hiddenlink" target="rightframe"><b>printMessage</b> (<code>String</code>)</A></nobr><br> <nobr><A HREF="org.apache.zookeeper.ZooKeeperMain.html#org.apache.zookeeper.ZooKeeperMain.processCmd_added(org.apache.zookeeper.ZooKeeperMain.MyCommandOptions)" class="hiddenlink" target="rightframe"><b>processCmd</b> (<code>MyCommandOptions</code>)</A></nobr><br> <nobr><A HREF="org.apache.zookeeper.ZooKeeperMain.html#org.apache.zookeeper.ZooKeeperMain.processZKCmd_added(org.apache.zookeeper.ZooKeeperMain.MyCommandOptions)" class="hiddenlink" target="rightframe"><b>processZKCmd</b> (<code>MyCommandOptions</code>)</A></nobr><br> <A NAME="Q"></A> <br><font size="+2">Q</font>&nbsp; <a href="#A"><font size="-2">A</font></a> <a href="#C"><font size="-2">C</font></a> <a href="#E"><font size="-2">E</font></a> <a href="#G"><font size="-2">G</font></a> <a href="#I"><font size="-2">I</font></a> <a href="#M"><font size="-2">M</font></a> <a href="#P"><font size="-2">P</font></a> <a href="#S"><font size="-2">S</font></a> <a href="#T"><font size="-2">T</font></a> <a href="#topheader"><font size="-2">TOP</font></a> <br> <nobr><A HREF="org.apache.zookeeper.ClientCnxn.html#org.apache.zookeeper.ClientCnxn.queuePacket_added(org.apache.zookeeper.proto.RequestHeader, org.apache.zookeeper.proto.ReplyHeader, org.apache.jute.Record, org.apache.jute.Record, org.apache.zookeeper.AsyncCallback)" class="hiddenlink" target="rightframe"><b>queuePacket</b> (<code>RequestHeader, ReplyHeader, Record, Record, AsyncCallback</code>)</A></nobr><br> <A NAME="S"></A> <br><font size="+2">S</font>&nbsp; <a href="#A"><font size="-2">A</font></a> <a href="#C"><font size="-2">C</font></a> <a href="#E"><font size="-2">E</font></a> <a href="#G"><font size="-2">G</font></a> <a href="#I"><font size="-2">I</font></a> <a href="#M"><font size="-2">M</font></a> <a href="#P"><font size="-2">P</font></a> <a href="#Q"><font size="-2">Q</font></a> <a href="#T"><font size="-2">T</font></a> <a href="#topheader"><font size="-2">TOP</font></a> <br> <nobr><A HREF="org.apache.zookeeper.ClientCnxn.html#org.apache.zookeeper.ClientCnxn.setDisableAutoResetWatch_added(boolean)" class="hiddenlink" target="rightframe"><b>setDisableAutoResetWatch</b> (<code>boolean</code>)</A></nobr><br> <nobr><A HREF="org.apache.zookeeper.ClientCnxn.html#org.apache.zookeeper.ClientCnxn.start_added()" class="hiddenlink" target="rightframe"><b>start</b> ()</A></nobr><br> <A NAME="T"></A> <br><font size="+2">T</font>&nbsp; <a href="#A"><font size="-2">A</font></a> <a href="#C"><font size="-2">C</font></a> <a href="#E"><font size="-2">E</font></a> <a href="#G"><font size="-2">G</font></a> <a href="#I"><font size="-2">I</font></a> <a href="#M"><font size="-2">M</font></a> <a href="#P"><font size="-2">P</font></a> <a href="#Q"><font size="-2">Q</font></a> <a href="#S"><font size="-2">S</font></a> <a href="#topheader"><font size="-2">TOP</font></a> <br> <nobr><A HREF="org.apache.zookeeper.ZooKeeper.html#org.apache.zookeeper.ZooKeeper.testableLocalSocketAddress_added()" class="hiddenlink" target="rightframe"><b>testableLocalSocketAddress</b> ()</A></nobr><br> <nobr><A HREF="org.apache.zookeeper.ZooKeeper.html#org.apache.zookeeper.ZooKeeper.testableRemoteSocketAddress_added()" class="hiddenlink" target="rightframe"><b>testableRemoteSocketAddress</b> ()</A></nobr><br> <nobr><A HREF="org.apache.zookeeper.ZooKeeper.html#org.apache.zookeeper.ZooKeeper.testableWaitForShutdown_added(int)" class="hiddenlink" target="rightframe"><b>testableWaitForShutdown</b> (<code>int</code>)</A></nobr><br> <nobr><A HREF="org.apache.zookeeper.ZooKeeper.html#org.apache.zookeeper.ZooKeeper.toString_added()" class="hiddenlink" target="rightframe"><b>toString</b> ()</A></nobr><br> <nobr><A HREF="org.apache.zookeeper.ZooKeeper.html#org.apache.zookeeper.ZooKeeper.transaction_added()" class="hiddenlink" target="rightframe"><b>transaction</b> ()</A></nobr><br> </BODY> </HTML>
{ "content_hash": "629ffce55080c02ef630849205c9795b", "timestamp": "", "source": "github", "line_count": 244, "max_line_length": 326, "avg_line_length": 55.15163934426229, "alnum_prop": 0.6586906442743553, "repo_name": "crtynes/zookeeper", "id": "5ba203a93c7f4d17033bf71c38901e951efca76a", "size": "13457", "binary": false, "copies": "6", "ref": "refs/heads/trunk", "path": "docs/jdiff/changes/methods_index_additions.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "4458" }, { "name": "C", "bytes": "448709" }, { "name": "C#", "bytes": "430100" }, { "name": "C++", "bytes": "605710" }, { "name": "CSS", "bytes": "4016" }, { "name": "Groff", "bytes": "807763" }, { "name": "HTML", "bytes": "53298" }, { "name": "Java", "bytes": "2721383" }, { "name": "JavaScript", "bytes": "239387" }, { "name": "Makefile", "bytes": "932" }, { "name": "Mako", "bytes": "13678" }, { "name": "Perl", "bytes": "74492" }, { "name": "Perl6", "bytes": "74223" }, { "name": "Python", "bytes": "126044" }, { "name": "Shell", "bytes": "311196" }, { "name": "XS", "bytes": "66448" }, { "name": "XSLT", "bytes": "6024" } ] }
package org.beatific.daram.mbean; import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; import javax.management.MalformedObjectNameException; import javax.management.ObjectName; public class MBean { private ObjectName objectName; private Map<String, String> attributes = new HashMap<String, String>(); public void setObjectName(String objectName) { try { this.objectName = new ObjectName(objectName); } catch (MalformedObjectNameException e) { throw new ObjectNameCreateException(e); } } public Map<String, String> getAttributes() { return attributes; } public void setAttribute(String name, String attribute) { this.attributes.put(name, attribute); } public Map<String, Object> loadMBean(MBeanConnection connection) { Map<String, Object> result = new HashMap<String, Object>(); for(Entry<String, String> entry : attributes.entrySet()) try { Object value = connection.getAttribute(objectName, entry.getValue()); result.put(entry.getKey(), value); } catch (Exception e) { e.printStackTrace(); } return result; } @Override public String toString() { return "MBean [objectName=" + objectName + ", attributes=" + attributes + "]"; } }
{ "content_hash": "5bf7e297998a485873f141adbdcb2a45", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 75, "avg_line_length": 26.102040816326532, "alnum_prop": 0.6927286942924159, "repo_name": "beatific/daram", "id": "3af08cc7a423eba1b4990eb5664b6266c4c01e6e", "size": "1279", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "daram-core/src/main/java/org/beatific/daram/mbean/MBean.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "14992" }, { "name": "Java", "bytes": "96412" }, { "name": "JavaScript", "bytes": "15208" }, { "name": "PLSQL", "bytes": "146" } ] }
// // GTLServiceMirror.m // // ---------------------------------------------------------------------------- // NOTE: This file is generated from Google APIs Discovery Service. // Service: // Google Mirror API (mirror/v1) // Description: // API for interacting with Glass users via the timeline. // Documentation: // https://developers.google.com/glass // Classes: // GTLServiceMirror (0 custom class methods, 0 custom properties) #import "GTLMirror.h" @implementation GTLServiceMirror #if DEBUG // Method compiled in debug builds just to check that all the needed support // classes are present at link time. + (NSArray *)checkClasses { NSArray *classes = [NSArray arrayWithObjects: [GTLQueryMirror class], [GTLMirrorAccount class], [GTLMirrorAttachment class], [GTLMirrorAttachmentsListResponse class], [GTLMirrorAuthToken class], [GTLMirrorCommand class], [GTLMirrorContact class], [GTLMirrorContactsListResponse class], [GTLMirrorLocation class], [GTLMirrorLocationsListResponse class], [GTLMirrorMenuItem class], [GTLMirrorMenuValue class], [GTLMirrorNotification class], [GTLMirrorNotificationConfig class], [GTLMirrorSetting class], [GTLMirrorSubscription class], [GTLMirrorSubscriptionsListResponse class], [GTLMirrorTimelineItem class], [GTLMirrorTimelineListResponse class], [GTLMirrorUserAction class], [GTLMirrorUserData class], nil]; return classes; } #endif // DEBUG - (id)init { self = [super init]; if (self) { // Version from discovery. self.apiVersion = @"v1"; // From discovery. Where to send JSON-RPC. // Turn off prettyPrint for this service to save bandwidth (especially on // mobile). The fetcher logging will pretty print. self.rpcURL = [NSURL URLWithString:@"https://www.googleapis.com/rpc?prettyPrint=false"]; self.rpcUploadURL = [NSURL URLWithString:@"https://www.googleapis.com/upload/rpc?uploadType=resumable&prettyPrint=false"]; } return self; } @end
{ "content_hash": "df33453059c380dd39408a78eed3f66f", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 126, "avg_line_length": 35.64705882352941, "alnum_prop": 0.5779702970297029, "repo_name": "shaoke/iOS-examples", "id": "26c7528666894f02e8de20383583e06970db508e", "size": "3019", "binary": false, "copies": "8", "ref": "refs/heads/master", "path": "GoogleDriveExample/Pods/Google-API-Client/Source/Services/Mirror/Generated/GTLServiceMirror.m", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "165561" }, { "name": "C++", "bytes": "6854" }, { "name": "Objective-C", "bytes": "10718903" }, { "name": "Ruby", "bytes": "323" }, { "name": "Shell", "bytes": "8056" } ] }
static struct netconn *listeningConn; static xQueueHandle connectionQueue; static xTaskHandle dataTask; volatile shttpConfig *shttpServerConfig; ICACHE_FLASH_ATTR static bool bind_and_listen(uint16_t port) { listeningConn = netconn_new(NETCONN_TCP); if (listeningConn == NULL) { LOG(ERROR, "shttp: creating new netconn failed"); return false; } netconn_bind(listeningConn, NULL, port); netconn_listen(listeningConn); // we are listening return true; } void readTask(void *userData) { struct netconn *conn; struct netbuf *inbuf = NULL; char *recv_buffer; uint16_t buflen; err_t err; shttpParserState *parser; while(1) { // fetch a connection from the queue xQueueReceive(connectionQueue, &conn, portMAX_DELAY); // create a parser parser = shttp_parser_init_state(); // receive data while(1) { err = netconn_recv(conn, &inbuf); if (err != ERR_OK) { LOG(DEBUG, "shttp: client disconnected"); break; } else { netbuf_data(inbuf, (void **)&recv_buffer, &buflen); // received some bytes, run parser on it if (!shttp_parse(parser, recv_buffer, buflen, conn)) { // parser thinks we should close the connection LOG(DEBUG, "shttp: parse called for quit"); break; } } } // clean up netconn_close(conn); netbuf_delete(inbuf); netconn_delete(conn); shttp_destroy_parser(parser); LOG(DEBUG, "shttp: connection closed"); } } ICACHE_FLASH_ATTR void shttp_listen(shttpConfig *config) { struct netconn *incoming; err_t err; // bind and listen bool result = bind_and_listen(config->port); if (result == false){ LOG(ERROR, "shttp: Giving up"); return; } // Create data processing queue connectionQueue = xQueueCreate(SHTTP_MAX_QUEUED_CONNECTIONS, sizeof(int)); if (connectionQueue == NULL) { LOG(ERROR, "shttp: Could not create connection queue, terminating"); netconn_close(listeningConn); netconn_delete(listeningConn); return; } // start data processing task if (xTaskCreate(readTask, "shttp.read", SHTTP_STACK_SIZE, NULL, SHTTP_PRIO, &dataTask) != pdPASS) { LOG(ERROR, "shttp: Could not create data processing task, terminating"); vQueueDelete(connectionQueue); netconn_close(listeningConn); netconn_delete(listeningConn); return; } shttpServerConfig = config; LOG(DEBUG, "shttp: server ready to accept connections"); // accept connections while(1) { // this blocks until a client connects err = netconn_accept(listeningConn, &incoming); if (err == ERR_OK) { LOG(TRACE, "shttp: Client connected, signaling communications thread"); xQueueSendToBack(connectionQueue, &incoming, portMAX_DELAY); } else { LOG(ERROR, "shttp: Could not accept connection, terminating"); vTaskDelete(dataTask); vQueueDelete(connectionQueue); netconn_close(listeningConn); netconn_delete(listeningConn); } } }
{ "content_hash": "679371276b5aaef3d5bef8c87ea42ac6", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 103, "avg_line_length": 29.946428571428573, "alnum_prop": 0.5974955277280859, "repo_name": "dunkelstern/simplehttp-esp8266", "id": "76579dbabec32030d3667b13600982fd0b6a7123", "size": "3675", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "library/server.c", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C", "bytes": "48464" }, { "name": "Makefile", "bytes": "4484" } ] }
<?php App::uses('AppController', 'Controller'); /** * Experiences Controller * * @property Experience $Experience * @property PaginatorComponent $Paginator */ class ExperiencesController extends AppController { /** * Components * * @var array */ public $components = array('Paginator'); /** * index method * * @return void */ public function index() { $this->Experience->recursive = 0; $this->set('experiences', $this->Paginator->paginate()); } /** * view method * * @throws NotFoundException * @param string $id * @return void */ public function view($id = null) { if (!$this->Experience->exists($id)) { throw new NotFoundException(__('Invalid experience')); } $options = array('conditions' => array('Experience.' . $this->Experience->primaryKey => $id)); $this->set('experience', $this->Experience->find('first', $options)); } /** * add method * * @return void */ public function add() { if ($this->request->is('post')) { $this->Experience->create(); if ($this->Experience->save($this->request->data)) { $this->Session->setFlash(__('The experience has been saved.')); return $this->redirect(array('action' => 'index')); } else { $this->Session->setFlash(__('The experience could not be saved. Please, try again.')); } } $cvs = $this->Experience->Cv->find('list'); $this->set(compact('cvs')); } /** * edit method * * @throws NotFoundException * @param string $id * @return void */ public function edit($id = null) { if (!$this->Experience->exists($id)) { throw new NotFoundException(__('Invalid experience')); } if ($this->request->is('post') || $this->request->is('put')) { if ($this->Experience->save($this->request->data)) { $this->Session->setFlash(__('The experience has been saved.')); return $this->redirect(array('action' => 'index')); } else { $this->Session->setFlash(__('The experience could not be saved. Please, try again.')); } } else { $options = array('conditions' => array('Experience.' . $this->Experience->primaryKey => $id)); $this->request->data = $this->Experience->find('first', $options); } $cvs = $this->Experience->Cv->find('list'); $this->set(compact('cvs')); } /** * delete method * * @throws NotFoundException * @param string $id * @return void */ public function delete($id = null) { $this->Experience->id = $id; if (!$this->Experience->exists()) { throw new NotFoundException(__('Invalid experience')); } $this->request->onlyAllow('post', 'delete'); if ($this->Experience->delete()) { $this->Session->setFlash(__('The experience has been deleted.')); } else { $this->Session->setFlash(__('The experience could not be deleted. Please, try again.')); } return $this->redirect(array('action' => 'index')); }}
{ "content_hash": "e10a65178ccdf6b105d7ec3ded36caf0", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 97, "avg_line_length": 26.22429906542056, "alnum_prop": 0.6225944404846757, "repo_name": "steinkel/cakefest-basic-workshop-2013", "id": "f65bcfba54dde23b96d8483cd46a88d6c110b2f1", "size": "2806", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Controller/ExperiencesController.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "15489" }, { "name": "JavaScript", "bytes": "140" }, { "name": "PHP", "bytes": "157715" }, { "name": "Shell", "bytes": "2598" } ] }
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE127_Buffer_Underread__new_wchar_t_loop_82_goodG2B.cpp Label Definition File: CWE127_Buffer_Underread__new.label.xml Template File: sources-sink-82_goodG2B.tmpl.cpp */ /* * @description * CWE: 127 Buffer Under-read * BadSource: Set data pointer to before the allocated memory buffer * GoodSource: Set data pointer to the allocated memory buffer * Sinks: loop * BadSink : Copy data to string using a loop * Flow Variant: 82 Data flow: data passed in a parameter to a virtual method called via a pointer * * */ #ifndef OMITGOOD #include "std_testcase.h" #include "CWE127_Buffer_Underread__new_wchar_t_loop_82.h" namespace CWE127_Buffer_Underread__new_wchar_t_loop_82 { void CWE127_Buffer_Underread__new_wchar_t_loop_82_goodG2B::action(wchar_t * data) { { size_t i; wchar_t dest[100]; wmemset(dest, L'C', 100-1); /* fill with 'C's */ dest[100-1] = L'\0'; /* null terminate */ /* POTENTIAL FLAW: Possibly copy from a memory location located before the source buffer */ for (i = 0; i < 100; i++) { dest[i] = data[i]; } /* Ensure null termination */ dest[100-1] = L'\0'; printWLine(dest); /* INCIDENTAL CWE-401: Memory Leak - data may not point to location * returned by new [] so can't safely call delete [] on it */ } } } #endif /* OMITGOOD */
{ "content_hash": "181482a5e0ddbd82418dac2a80895ccd", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 99, "avg_line_length": 32.77777777777778, "alnum_prop": 0.6250847457627119, "repo_name": "JianpingZeng/xcc", "id": "a8a7019cd9fcf057bc0955b99d098ed854d60dad", "size": "1475", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "xcc/test/juliet/testcases/CWE127_Buffer_Underread/s03/CWE127_Buffer_Underread__new_wchar_t_loop_82_goodG2B.cpp", "mode": "33188", "license": "bsd-3-clause", "language": [] }
import logging import logstash import sys host = 'localhost' test_logger = logging.getLogger('python-logstash-logger') test_logger.setLevel(logging.INFO) test_logger.addHandler(logstash.LogstashHandler(host, 5959, version=1)) # test_logger.addHandler(logstash.TCPLogstashHandler(host, 5959, version=1)) test_logger.error('python-logstash: test logstash error message.') test_logger.info('python-logstash: test logstash info message.') test_logger.warning('python-logstash: test logstash warning message.') # add extra field to logstash message extra = { 'test_string': 'python version: ' + repr(sys.version_info), 'test_boolean': True, 'test_dict': {'a': 1, 'b': 'c'}, 'test_float': 1.23, 'test_integer': 123, 'test_list': [1, 2, '3'], } test_logger.info('python-logstash: test extra fields', extra=extra)
{ "content_hash": "599989e088bfe6b7bebeee3639e7a313", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 76, "avg_line_length": 33.36, "alnum_prop": 0.7182254196642686, "repo_name": "jimmyho/python-logstash", "id": "ad4d8e9bf3a50dbae3a3db98107a0b5d6a90d875", "size": "834", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "example1.py", "mode": "33188", "license": "mit", "language": [ { "name": "Python", "bytes": "13953" } ] }
layout: post title: "The Lion City" date: 2015-06-20 backgrounds: - https://github.com/kadie16/kadie16.github.io/raw/master/assets/images/posts/lion-city/bayBackground.JPG thumb: https://github.com/kadie16/kadie16.github.io/raw/master/assets/images/posts/lion-city/meAtBay.JPG category: Singapore tags: Singapore --- Today is my third day (I think?) in Singapore. I am sitting at Starbucks resting my feet, eating a cupcake and drinking some green tea lemonade. The cup cake snickers flavored: a chocolate peanut butter cake with peanut butter frosting and salted caramel and chocolate syrup drizzled with a snicker on top 😍. Best cupcake I've ever had. Oh and I just discovered it has a caramel and salted peanuts center!! Ok I realize I just described the most stereotypical thing I could be doing right now... I promise I'm not being boring. I just ate spicy fish and stirfry and rice at a hawker market (like a food court ... same same but different) and tried rambutan (nom nom tropical fruit) with the other girls who are interning at A*STAR this summer. I'm writing this at Bugis Junction, one of the malls in this neighborhood. Across the street is Bugis+ (another mall) and Bugis Street which is a little market with stands that sell fruits, teas, toys and souvenirs, purses and clothes etc. I wandered through there for the first time yesterday while I was heading back from Sim Lim Square: a six story mall that is entirely dedicated to selling electronics and computer stuff. There must be fifty stores in there selling the same thing. Singapore is pretty much composed of malls and food courts. On my first day here I walked through five different malls. By now I think I have been to 15 or 16 different ones (one entire mall mostly dedicated to lamps). I'd guess I've been through three times as many food courts? It is basically impossible to get from point A to point B without walking through a mall or food court or hawker. Singapore things that are making me feel like I don't want to go back to America: - Everything you could ever want comes in a Hello Kitty or Minnie/Mickey Mouse version. - My deliciouslunch today was S$2.70 ($2.01 USD). - The MRT (subway) system goes almost everywhere. It's easy and cheap. - Kiwis on a stick, sky crackers, pocky sticks and fresh sugar cane juice. - The whole shopping malls and affordable foodcourts thing is pretty convenient. - I can fly roundtrip to most places in Asia for around $150 - TWG Tea - The humidity makes my wrinkly clothes smooth themselves out - Someone said "touch wood or whatever" today instead of "knock on wood". Lol Another thing about Singapore; everything is very structured and systematic. There are always signs and often voices on loudspeakers telling you what you should be doing. Everywhere. It sounds kind of stifling, but so far I don't mind it and it helps everything run effeciently. > **How to Escalator like a Singapore Local:** <br> > When riding an escalator, stay on the left side if you are going to stand. This makes room for those who are in a hurry to walk up on the right. So efficient. At first I didn't know this escalator convention, but by now I am already rolling my eyes when I see someone standing on the right side and blocking people from walking. Lol. ![Me and Mel](https://github.com/kadie16/kadie16.github.io/raw/master/assets/images/posts/lion-city/Mel.JPG)_<center> Mel, My First Friend In Singapore :) </center>_ I've become addicted to wandering. On my first day, I asked Mel, a girl who works at my hostel, where I should go. She suggested I take the MRT to Bugis. At first I felt a little strange walking around with no direction. I ended up in a mall and I felt like I didn't want to be at a mall because I could go to a mall anywhere. This was before I realized that Singapore is mostly malls. After I explored Bugis for a while, I asked someone else where I should go. They suggested Marina Bay Sands and showed me the way. Every time I started to walk home, I kept finding new things and staying out longer and longer. The next night I went out for dinner in China town where my hostel is. I had already explored quite a bit that day so I was expecting to grab something quick, but I ended up drifting again for hours through Chinatown and downtown to the Fullerton Hotel. It is such a good feeling to be able to explore on your own and find so many exciting new things. #Some Pictures from My Adventures ![Marina Bay](https://github.com/kadie16/kadie16.github.io/raw/master/assets/images/posts/lion-city/marinaBay.JPG) ![TWG](https://github.com/kadie16/kadie16.github.io/raw/master/assets/images/posts/lion-city/TWG.JPG) _<center>500 different kinds of tea, 15 kinds of earl grey, all with paragraph long descriptions in this book lol</center>_ ![TWG TEA](https://github.com/kadie16/kadie16.github.io/raw/master/assets/images/posts/lion-city/IMG_5349.JPG) ![Chess](https://github.com/kadie16/kadie16.github.io/raw/master/assets/images/posts/lion-city/IMG_5377.JPG)_<center>About to lose to the bartender @ Raffles Hotel </center>_ ***
{ "content_hash": "015a6fcf4bc336c0155b4009a9009ce0", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 881, "avg_line_length": 92.8, "alnum_prop": 0.7748824451410659, "repo_name": "kadie16/kadie16.github.io", "id": "2a63e9c40d0fd6c28aafba6cf9118b3e33b666b3", "size": "5111", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "abroad/_posts/2015-06-21-lion-city.md", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "20009" }, { "name": "HTML", "bytes": "524012" }, { "name": "JavaScript", "bytes": "4846" } ] }
<?php defined('SYSPATH') OR die('No direct script access.'); abstract class Deta_Model_PagerButton extends Deta_Core_Model_PagerButton {}
{ "content_hash": "4fc9abf6f674ef4e30240cbafa9d103c", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 76, "avg_line_length": 46.333333333333336, "alnum_prop": 0.762589928057554, "repo_name": "johnpancoast/renamedetaold", "id": "0c5765aec743ad8e924d4495f23b61326d0f1483", "size": "139", "binary": false, "copies": "2", "ref": "refs/heads/0.4.0/master", "path": "classes/Deta/Model/PagerButton.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "87" }, { "name": "PHP", "bytes": "63708" } ] }
ChangeLog --------- ### v0.9.0 (2015-05-15) * added support for `JavaX` Plist key (fixes #9) ### v0.8.1 (2015-03-26) * Bugfix for `JVMVersion` key present but no JVMs in `/usr/libexec/java_home` ### v0.8.0 (2015-02-22) * support for `JVMVersion` key (fixes #13, Thanks to @Dylan-M for his contribution) * use `$HOME` instead of `~` to set the users home directory (fixes #11) * WorkingDirectory: improved substitution of variables ($JAVAROOT, $APP_PACKAGE, $USER_HOME) (fixes #12) * use different non-zero exit codes ### v0.7.0 (2014-10-12) * read ClassPath from ApplePlist in either Array or String style (PR #5, Thanks to Philipp Holzschneider for his contribution) * read StartOnMainThread (issue #4, Thanks to @wrstlbrnft for his contribution) ### v0.6.3 (2014-07-31) * check Info.plist for Apple style Java keys. Better indicator to distinguish between Apple or Oracle parsing... ### v0.6.2 (2014-07-28) * minor code refactoring and bugfixes ### v0.6.1 (2014-07-27) * Standard Working Directory for Apple PList apparently is the AppRoot directory ### v0.6 *(2014-07-12)* * also catch fixed paths for Plist key `JVMWorkDir` *(thanks @dpolivaev)* ### v0.5 *(2014-06-30)* * bugfix for pathes / App bundles containing spaces (#2) ### v0.4 *(2014-06-30)* * read and set WorkingDirectory based on the key in `Info.plist` (#1) * interpret the 3 different values $JAVAROOT, $APP_PACKAGE, $USER_HOME * fallback to root / as standard ### v0.3 *(2014-03-16)* * enable drag&drop to the dock icon ### v0.2 *(2014-03-16)* * trim whitespace from variables and commandline * don't show errors in output for Info.plist querying ### v0.1 *(2014-03-09)* * initial release of 'universalJavaApplicationStub'
{ "content_hash": "08deb63e39fd7ad839c0350e786f33c1", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 126, "avg_line_length": 35.5625, "alnum_prop": 0.7053309900410076, "repo_name": "cxbrooks/universalJavaApplicationStub", "id": "6316c630169c8111aa4a505d1c0c13adddfd2aa3", "size": "1707", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "CHANGELOG.md", "mode": "33188", "license": "mit", "language": [ { "name": "Shell", "bytes": "12591" } ] }
<?php /** Zend_Controller_Request_Http */ require_once 'Zend/Controller/Request/Http.php'; /** Zend_Uri */ require_once 'Zend/Uri.php'; /** * Zend_Controller_Request_Apache404 * * HTTP request object for use with Zend_Controller family. Extends basic HTTP * request object to allow for two edge cases when using Apache: * - Using Apache's 404 handler instead of mod_rewrite to direct requests * - Using the PT flag in rewrite rules * * In each case, the URL to check against is found in REDIRECT_URL, not * REQUEST_URI. * * @uses Zend_Controller_Request_Http * @package Zend_Controller * @subpackage Request */ class Zend_Controller_Request_Apache404 extends Zend_Controller_Request_Http { public function setRequestUri($requestUri = null) { $parseUriGetVars = false; if ($requestUri === null) { if (isset($_SERVER['HTTP_X_REWRITE_URL'])) { // check this first so IIS will catch $requestUri = $_SERVER['HTTP_X_REWRITE_URL']; } elseif (isset($_SERVER['REDIRECT_URL'])) { // Check if using mod_rewrite $requestUri = $_SERVER['REDIRECT_URL']; if (isset($_SERVER['REDIRECT_QUERYSTRING'])) { $parseUriGetVars = $_SERVER['REDIRECT_QUERYSTRING']; } } elseif (isset($_SERVER['REQUEST_URI'])) { $requestUri = $_SERVER['REQUEST_URI']; } elseif (isset($_SERVER['ORIG_PATH_INFO'])) { // IIS 5.0, PHP as CGI $requestUri = $_SERVER['ORIG_PATH_INFO']; if (!empty($_SERVER['QUERY_STRING'])) { $requestUri .= '?' . $_SERVER['QUERY_STRING']; } } else { return $this; } } elseif (!is_string($requestUri)) { return $this; } else { if (false !== ($pos = strpos($requestUri, '?'))) { $parseUriGetVars = substr($requestUri, $pos + 1); } } if ($parseUriGetVars) { // Set GET items, if available parse_str($parseUriGetVars, $_GET); } $this->_requestUri = $requestUri; return $this; } }
{ "content_hash": "6147c23aeea95987c1d274612d64e3ce", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 94, "avg_line_length": 34.484375, "alnum_prop": 0.5523334843679203, "repo_name": "tjohns/zf", "id": "33a0e7785b7b3b5283e9c5fb860a5e3d5cbd1b8a", "size": "2903", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "library/Zend/Controller/Request/Apache404.php", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "JavaScript", "bytes": "30072" }, { "name": "PHP", "bytes": "27836564" }, { "name": "Shell", "bytes": "5278" } ] }
package com.xeiam.xchange.quoine.service.polling; import java.io.IOException; import com.xeiam.xchange.Exchange; import com.xeiam.xchange.exceptions.ExchangeException; import com.xeiam.xchange.quoine.QuoineAuthenticated; import com.xeiam.xchange.quoine.QuoineExchange; import com.xeiam.xchange.service.BaseExchangeService; import com.xeiam.xchange.service.polling.BasePollingService; import si.mazi.rescu.HttpStatusIOException; import si.mazi.rescu.RestProxyFactory; public class QuoineBasePollingService extends BaseExchangeService implements BasePollingService { protected QuoineAuthenticated quoine; protected final String device; protected final String userID; protected final String userToken; /** * Constructor * * @param exchange */ public QuoineBasePollingService(Exchange exchange) { super(exchange); quoine = RestProxyFactory.createProxy(QuoineAuthenticated.class, exchange.getExchangeSpecification().getSslUri()); device = (String) exchange.getExchangeSpecification().getExchangeSpecificParameters().get(QuoineExchange.KEY_DEVICE_NAME); userID = (String) exchange.getExchangeSpecification().getExchangeSpecificParameters().get(QuoineExchange.KEY_USER_ID); userToken = (String) exchange.getExchangeSpecification().getExchangeSpecificParameters().get(QuoineExchange.KEY_USER_TOKEN); } protected RuntimeException handleHttpError(HttpStatusIOException exception) throws IOException { throw new ExchangeException(exception.getHttpBody(), exception); } }
{ "content_hash": "2fb0ab6eaed9e20df38675902ecf6ac7", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 128, "avg_line_length": 37.170731707317074, "alnum_prop": 0.8090551181102362, "repo_name": "nivertech/XChange", "id": "46ce2fc4f67412895569a6283f4736b7247b6982", "size": "1524", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "xchange-quoine/src/main/java/com/xeiam/xchange/quoine/service/polling/QuoineBasePollingService.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "4604003" } ] }
from django.conf.urls import patterns, include, url from openbudgets.apps.interactions.views import CommentFeed, toggleable_interaction urlpatterns = patterns('', url(r'^feed/(?P<model>[-\w]+)/(?P<uuid>[-\w]+)/discussion\.atom$', CommentFeed(), name='comment_feed'), url(r'^toggle/$', toggleable_interaction, name='toggleable_interaction'), )
{ "content_hash": "adc4fe57eafe3bd98adaea957833a3be", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 83, "avg_line_length": 28.615384615384617, "alnum_prop": 0.6774193548387096, "repo_name": "shaib/openbudgets", "id": "2347d198b4695e96c0a37c38fed9023bdd9dcec8", "size": "372", "binary": false, "copies": "5", "ref": "refs/heads/develop", "path": "openbudgets/apps/interactions/urls.py", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "CSS", "bytes": "355833" }, { "name": "JavaScript", "bytes": "1185878" }, { "name": "Python", "bytes": "487714" } ] }
package com.intellij.lang.ant.config.impl; import com.intellij.lang.ant.AntBundle; import com.intellij.lang.ant.config.ExecutionEvent; import org.jetbrains.annotations.NonNls; public final class ExecuteAfterCompilationEvent extends ExecutionEvent { @NonNls public static final String TYPE_ID = "afterCompilation"; private static final ExecuteAfterCompilationEvent ourInstance = new ExecuteAfterCompilationEvent(); private ExecuteAfterCompilationEvent() { } public static ExecuteAfterCompilationEvent getInstance() { return ourInstance; } @Override public String getTypeId() { return TYPE_ID; } @Override public String getPresentableName() { return AntBundle.message("ant.event.after.compilation.presentable.name"); } }
{ "content_hash": "a119ea5849051e0a4a20984e4434bbd0", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 101, "avg_line_length": 26.310344827586206, "alnum_prop": 0.7785058977719528, "repo_name": "mdanielwork/intellij-community", "id": "df5dd0c59d1708795af81c7d91f4e7a6180d9860", "size": "1363", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "plugins/ant/src/com/intellij/lang/ant/config/impl/ExecuteAfterCompilationEvent.java", "mode": "33188", "license": "apache-2.0", "language": [] }
namespace network { class SimpleURLLoader; } // WebUIURLFetcher downloads the content of a file by giving its |url| on WebUI. // Each WebUIURLFetcher is associated with a given |render_process_id, // render_view_id| pair. class WebUIURLFetcher { public: // Called when a file URL request is complete. // Parameters: // - whether the request is success. // - If yes, the content of the file. using WebUILoadFileCallback = base::OnceCallback<void(bool, std::unique_ptr<std::string>)>; WebUIURLFetcher(int render_process_id, int render_frame_id, const GURL& url, WebUILoadFileCallback callback); WebUIURLFetcher(const WebUIURLFetcher&) = delete; WebUIURLFetcher& operator=(const WebUIURLFetcher&) = delete; ~WebUIURLFetcher(); void Start(); private: void OnURLLoaderComplete(std::unique_ptr<std::string> response_body); int render_process_id_; int render_frame_id_; GURL url_; WebUILoadFileCallback callback_; std::unique_ptr<network::SimpleURLLoader> fetcher_; }; #endif // EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_UI_WEB_UI_URL_FETCHER_H_
{ "content_hash": "3fa1c148fe245ac7c21c4c29ce21a0cc", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 80, "avg_line_length": 29.307692307692307, "alnum_prop": 0.6990376202974629, "repo_name": "ric2b/Vivaldi-browser", "id": "385687f625397875f56fb2f00dc2e98e2e4dc926", "size": "1531", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "chromium/extensions/browser/guest_view/web_view/web_ui/web_ui_url_fetcher.h", "mode": "33188", "license": "bsd-3-clause", "language": [] }
import {PlatformTest, Req} from "@tsed/common"; import {InjectorService} from "@tsed/di"; import {expect} from "chai"; import Passport from "passport"; import Sinon from "sinon"; import {stub} from "../../../../../test/helper/tools"; import {Protocol, ProtocolsService} from "../index"; const sandbox = Sinon.createSandbox(); // tslint:disable-next-line:variable-name const Strategy = Sinon.stub(); describe("ProtocolsService", () => { @Protocol({ name: "local", useStrategy: Strategy as any, settings: { prop1: "prop1", prop2: "prop2" } }) class LocalProtocol { $onInstall() {} $onVerify(@Req() req: Req) { return {id: 0}; } } beforeEach(() => PlatformTest.create({ passport: { protocols: { local: { settings: { prop2: "prop2-server", prop3: "prop3" } } } } }) ); afterEach(PlatformTest.reset); beforeEach(() => { sandbox.stub(LocalProtocol.prototype, "$onInstall"); sandbox.stub(LocalProtocol.prototype, "$onVerify"); sandbox.stub(Passport, "use"); Strategy.resetHistory(); }); afterEach(() => { sandbox.restore(); }); it( "should create a protocol", PlatformTest.inject([ProtocolsService, InjectorService], (protocolService: ProtocolsService, injector: InjectorService) => { // GIVEN const provider = injector.getProvider(LocalProtocol)!; // WHEN const result = protocolService.invoke(provider); // THEN expect(result).to.be.instanceof(LocalProtocol); expect(result.$onInstall).to.have.been.calledWithExactly(protocolService.strategies.get("local")); expect(Passport.use).to.have.been.calledWithExactly("local", protocolService.strategies.get("local")); expect(Strategy).to.have.been.calledWithExactly( { passReqToCallback: true, prop1: "prop1", prop2: "prop2-server", prop3: "prop3" }, Sinon.match.func ); expect(protocolService.getProtocolsNames().includes("local")).to.deep.equal(true); }) ); it( "should call metadata", PlatformTest.inject([ProtocolsService, InjectorService], async (protocolService: ProtocolsService, injector: InjectorService) => { // GIVEN stub(LocalProtocol.prototype.$onVerify).returns({id: 0}); const provider = injector.getProvider(LocalProtocol)!; const ctx = PlatformTest.createRequestContext(); // WHEN const result = protocolService.invoke(provider); const resultDone: any = await new Promise((resolve) => { Strategy.args[0][1](ctx.getRequest(), "test", (...args: any[]) => resolve(args)); }); // THEN expect(result.$onVerify).to.have.been.calledWithExactly(ctx.getRequest(), ctx); expect(resultDone).to.deep.equal([null, {id: 0}]); }) ); it( "should call metadata and catch error", PlatformTest.inject([ProtocolsService, InjectorService], async (protocolService: ProtocolsService, injector: InjectorService) => { // GIVEN const error = new Error("message"); stub(LocalProtocol.prototype.$onVerify).rejects(error); const provider = injector.getProvider(LocalProtocol)!; const ctx = PlatformTest.createRequestContext(); // WHEN const result = protocolService.invoke(provider); const resultDone: any = await new Promise((resolve) => { Strategy.args[0][1](ctx.getRequest(), "test", (...args: any[]) => resolve(args)); }); // THEN expect(result.$onVerify).to.have.been.calledWithExactly(ctx.getRequest(), ctx); expect(resultDone).to.deep.equal([error, false, {message: "message"}]); }) ); });
{ "content_hash": "452f0e189e1955883af042f0e1e212b4", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 134, "avg_line_length": 30.387096774193548, "alnum_prop": 0.6242038216560509, "repo_name": "Romakita/ts-express-decorators", "id": "7a4fe934fba03a9972f522ce8dce08b38441792a", "size": "3768", "binary": false, "copies": "1", "ref": "refs/heads/production", "path": "packages/security/passport/src/services/ProtocolsService.spec.ts", "mode": "33188", "license": "mit", "language": [ { "name": "EJS", "bytes": "24557" }, { "name": "HTML", "bytes": "3710" }, { "name": "JavaScript", "bytes": "33370" }, { "name": "Shell", "bytes": "376" }, { "name": "TypeScript", "bytes": "2723318" } ] }
package skinny.validator /** * Param definition. */ sealed trait ParamDefinition { val key: String val value: Any } /** * Key param definition. * * @param key key */ case class OnlyKeyParamDefinition(override val key: String) extends ParamDefinition { override lazy val value: Any = throw new IllegalStateException } /** * Key and value param definition. * * @param key key * @param value value */ case class KeyValueParamDefinition(override val key: String, override val value: Any) extends ParamDefinition
{ "content_hash": "42192d489fa7fe85e88c39217708524a", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 109, "avg_line_length": 20.73076923076923, "alnum_prop": 0.7142857142857143, "repo_name": "seratch/skinny-framework", "id": "a6afdfec517beb0af904ced0d8c47a7bafa4880a", "size": "539", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "validator/src/main/scala/skinny/validator/ParamDefinition.scala", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "19221" }, { "name": "CSS", "bytes": "622" }, { "name": "CoffeeScript", "bytes": "758" }, { "name": "FreeMarker", "bytes": "913" }, { "name": "HTML", "bytes": "24601" }, { "name": "Java", "bytes": "14613" }, { "name": "JavaScript", "bytes": "549638" }, { "name": "Scala", "bytes": "1475475" }, { "name": "Shell", "bytes": "37007" } ] }
namespace { class SetupUtilTestWithDir : public testing::Test { protected: virtual void SetUp() override { // Create a temp directory for testing. ASSERT_TRUE(test_dir_.CreateUniqueTempDir()); } virtual void TearDown() override { // Clean up test directory manually so we can fail if it leaks. ASSERT_TRUE(test_dir_.Delete()); } // The temporary directory used to contain the test operations. base::ScopedTempDir test_dir_; }; // The privilege tested in ScopeTokenPrivilege tests below. // Use SE_RESTORE_NAME as it is one of the many privileges that is available, // but not enabled by default on processes running at high integrity. static const wchar_t kTestedPrivilege[] = SE_RESTORE_NAME; // Returns true if the current process' token has privilege |privilege_name| // enabled. bool CurrentProcessHasPrivilege(const wchar_t* privilege_name) { HANDLE temp_handle; if (!::OpenProcessToken(::GetCurrentProcess(), TOKEN_QUERY, &temp_handle)) { ADD_FAILURE(); return false; } base::win::ScopedHandle token(temp_handle); // First get the size of the buffer needed for |privileges| below. DWORD size; EXPECT_FALSE(::GetTokenInformation(token.Get(), TokenPrivileges, NULL, 0, &size)); scoped_ptr<BYTE[]> privileges_bytes(new BYTE[size]); TOKEN_PRIVILEGES* privileges = reinterpret_cast<TOKEN_PRIVILEGES*>(privileges_bytes.get()); if (!::GetTokenInformation(token.Get(), TokenPrivileges, privileges, size, &size)) { ADD_FAILURE(); return false; } // There is no point getting a buffer to store more than |privilege_name|\0 as // anything longer will obviously not be equal to |privilege_name|. const DWORD desired_size = wcslen(privilege_name); const DWORD buffer_size = desired_size + 1; scoped_ptr<wchar_t[]> name_buffer(new wchar_t[buffer_size]); for (int i = privileges->PrivilegeCount - 1; i >= 0 ; --i) { LUID_AND_ATTRIBUTES& luid_and_att = privileges->Privileges[i]; DWORD size = buffer_size; ::LookupPrivilegeName(NULL, &luid_and_att.Luid, name_buffer.get(), &size); if (size == desired_size && wcscmp(name_buffer.get(), privilege_name) == 0) { return luid_and_att.Attributes == SE_PRIVILEGE_ENABLED; } } return false; } } // namespace // Test that we are parsing Chrome version correctly. TEST_F(SetupUtilTestWithDir, GetMaxVersionFromArchiveDirTest) { // Create a version dir base::FilePath chrome_dir = test_dir_.path().AppendASCII("1.0.0.0"); base::CreateDirectory(chrome_dir); ASSERT_TRUE(base::PathExists(chrome_dir)); scoped_ptr<Version> version( installer::GetMaxVersionFromArchiveDir(test_dir_.path())); ASSERT_EQ(version->GetString(), "1.0.0.0"); base::DeleteFile(chrome_dir, true); ASSERT_FALSE(base::PathExists(chrome_dir)); ASSERT_TRUE(installer::GetMaxVersionFromArchiveDir(test_dir_.path()) == NULL); chrome_dir = test_dir_.path().AppendASCII("ABC"); base::CreateDirectory(chrome_dir); ASSERT_TRUE(base::PathExists(chrome_dir)); ASSERT_TRUE(installer::GetMaxVersionFromArchiveDir(test_dir_.path()) == NULL); chrome_dir = test_dir_.path().AppendASCII("2.3.4.5"); base::CreateDirectory(chrome_dir); ASSERT_TRUE(base::PathExists(chrome_dir)); version.reset(installer::GetMaxVersionFromArchiveDir(test_dir_.path())); ASSERT_EQ(version->GetString(), "2.3.4.5"); // Create multiple version dirs, ensure that we select the greatest. chrome_dir = test_dir_.path().AppendASCII("9.9.9.9"); base::CreateDirectory(chrome_dir); ASSERT_TRUE(base::PathExists(chrome_dir)); chrome_dir = test_dir_.path().AppendASCII("1.1.1.1"); base::CreateDirectory(chrome_dir); ASSERT_TRUE(base::PathExists(chrome_dir)); version.reset(installer::GetMaxVersionFromArchiveDir(test_dir_.path())); ASSERT_EQ(version->GetString(), "9.9.9.9"); } TEST_F(SetupUtilTestWithDir, DeleteFileFromTempProcess) { base::FilePath test_file; base::CreateTemporaryFileInDir(test_dir_.path(), &test_file); ASSERT_TRUE(base::PathExists(test_file)); base::WriteFile(test_file, "foo", 3); EXPECT_TRUE(installer::DeleteFileFromTempProcess(test_file, 0)); base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(200)); EXPECT_FALSE(base::PathExists(test_file)); } // Note: This test is only valid when run at high integrity (i.e. it will fail // at medium integrity). TEST(SetupUtilTest, ScopedTokenPrivilegeBasic) { ASSERT_FALSE(CurrentProcessHasPrivilege(kTestedPrivilege)); { installer::ScopedTokenPrivilege test_scoped_privilege(kTestedPrivilege); ASSERT_TRUE(test_scoped_privilege.is_enabled()); ASSERT_TRUE(CurrentProcessHasPrivilege(kTestedPrivilege)); } ASSERT_FALSE(CurrentProcessHasPrivilege(kTestedPrivilege)); } // Note: This test is only valid when run at high integrity (i.e. it will fail // at medium integrity). TEST(SetupUtilTest, ScopedTokenPrivilegeAlreadyEnabled) { ASSERT_FALSE(CurrentProcessHasPrivilege(kTestedPrivilege)); { installer::ScopedTokenPrivilege test_scoped_privilege(kTestedPrivilege); ASSERT_TRUE(test_scoped_privilege.is_enabled()); ASSERT_TRUE(CurrentProcessHasPrivilege(kTestedPrivilege)); { installer::ScopedTokenPrivilege dup_scoped_privilege(kTestedPrivilege); ASSERT_TRUE(dup_scoped_privilege.is_enabled()); ASSERT_TRUE(CurrentProcessHasPrivilege(kTestedPrivilege)); } ASSERT_TRUE(CurrentProcessHasPrivilege(kTestedPrivilege)); } ASSERT_FALSE(CurrentProcessHasPrivilege(kTestedPrivilege)); } const char kAdjustProcessPriority[] = "adjust-process-priority"; PriorityClassChangeResult DoProcessPriorityAdjustment() { return installer::AdjustProcessPriority() ? PCCR_CHANGED : PCCR_UNCHANGED; } namespace { // A scoper that sets/resets the current process's priority class. class ScopedPriorityClass { public: // Applies |priority_class|, returning an instance if a change was made. // Otherwise, returns an empty scoped_ptr. static scoped_ptr<ScopedPriorityClass> Create(DWORD priority_class); ~ScopedPriorityClass(); private: explicit ScopedPriorityClass(DWORD original_priority_class); DWORD original_priority_class_; DISALLOW_COPY_AND_ASSIGN(ScopedPriorityClass); }; scoped_ptr<ScopedPriorityClass> ScopedPriorityClass::Create( DWORD priority_class) { HANDLE this_process = ::GetCurrentProcess(); DWORD original_priority_class = ::GetPriorityClass(this_process); EXPECT_NE(0U, original_priority_class); if (original_priority_class && original_priority_class != priority_class) { BOOL result = ::SetPriorityClass(this_process, priority_class); EXPECT_NE(FALSE, result); if (result) { return scoped_ptr<ScopedPriorityClass>( new ScopedPriorityClass(original_priority_class)); } } return scoped_ptr<ScopedPriorityClass>(); } ScopedPriorityClass::ScopedPriorityClass(DWORD original_priority_class) : original_priority_class_(original_priority_class) {} ScopedPriorityClass::~ScopedPriorityClass() { BOOL result = ::SetPriorityClass(::GetCurrentProcess(), original_priority_class_); EXPECT_NE(FALSE, result); } PriorityClassChangeResult RelaunchAndDoProcessPriorityAdjustment() { base::CommandLine cmd_line(*base::CommandLine::ForCurrentProcess()); cmd_line.AppendSwitch(kAdjustProcessPriority); base::Process process = base::LaunchProcess(cmd_line, base::LaunchOptions()); int exit_code = 0; if (!process.IsValid()) { ADD_FAILURE() << " to launch subprocess."; } else if (!process.WaitForExit(&exit_code)) { ADD_FAILURE() << " to wait for subprocess to exit."; } else { return static_cast<PriorityClassChangeResult>(exit_code); } return PCCR_UNKNOWN; } } // namespace // Launching a subprocess at normal priority class is a noop. TEST(SetupUtilTest, AdjustFromNormalPriority) { ASSERT_EQ(NORMAL_PRIORITY_CLASS, ::GetPriorityClass(::GetCurrentProcess())); EXPECT_EQ(PCCR_UNCHANGED, RelaunchAndDoProcessPriorityAdjustment()); } // Launching a subprocess below normal priority class drops it to bg mode for // sufficiently recent operating systems. TEST(SetupUtilTest, AdjustFromBelowNormalPriority) { scoped_ptr<ScopedPriorityClass> below_normal = ScopedPriorityClass::Create(BELOW_NORMAL_PRIORITY_CLASS); ASSERT_TRUE(below_normal); if (base::win::GetVersion() > base::win::VERSION_SERVER_2003) EXPECT_EQ(PCCR_CHANGED, RelaunchAndDoProcessPriorityAdjustment()); else EXPECT_EQ(PCCR_UNCHANGED, RelaunchAndDoProcessPriorityAdjustment()); } namespace { // A test fixture that configures an InstallationState and an InstallerState // with a product being updated. class FindArchiveToPatchTest : public SetupUtilTestWithDir { protected: class FakeInstallationState : public installer::InstallationState { }; class FakeProductState : public installer::ProductState { public: static FakeProductState* FromProductState(const ProductState* product) { return static_cast<FakeProductState*>(const_cast<ProductState*>(product)); } void set_version(const Version& version) { if (version.IsValid()) version_.reset(new Version(version)); else version_.reset(); } void set_uninstall_command(const base::CommandLine& uninstall_command) { uninstall_command_ = uninstall_command; } }; virtual void SetUp() override { SetupUtilTestWithDir::SetUp(); product_version_ = Version("30.0.1559.0"); max_version_ = Version("47.0.1559.0"); // Install the product according to the version. original_state_.reset(new FakeInstallationState()); InstallProduct(); // Prepare to update the product in the temp dir. installer_state_.reset(new installer::InstallerState( kSystemInstall_ ? installer::InstallerState::SYSTEM_LEVEL : installer::InstallerState::USER_LEVEL)); installer_state_->AddProductFromState( kProductType_, *original_state_->GetProductState(kSystemInstall_, kProductType_)); // Create archives in the two version dirs. ASSERT_TRUE( base::CreateDirectory(GetProductVersionArchivePath().DirName())); ASSERT_EQ(1, base::WriteFile(GetProductVersionArchivePath(), "a", 1)); ASSERT_TRUE( base::CreateDirectory(GetMaxVersionArchivePath().DirName())); ASSERT_EQ(1, base::WriteFile(GetMaxVersionArchivePath(), "b", 1)); } virtual void TearDown() override { original_state_.reset(); SetupUtilTestWithDir::TearDown(); } base::FilePath GetArchivePath(const Version& version) const { return test_dir_.path() .AppendASCII(version.GetString()) .Append(installer::kInstallerDir) .Append(installer::kChromeArchive); } base::FilePath GetMaxVersionArchivePath() const { return GetArchivePath(max_version_); } base::FilePath GetProductVersionArchivePath() const { return GetArchivePath(product_version_); } void InstallProduct() { FakeProductState* product = FakeProductState::FromProductState( original_state_->GetNonVersionedProductState(kSystemInstall_, kProductType_)); product->set_version(product_version_); base::CommandLine uninstall_command( test_dir_.path() .AppendASCII(product_version_.GetString()) .Append(installer::kInstallerDir) .Append(installer::kSetupExe)); uninstall_command.AppendSwitch(installer::switches::kUninstall); product->set_uninstall_command(uninstall_command); } void UninstallProduct() { FakeProductState::FromProductState( original_state_->GetNonVersionedProductState(kSystemInstall_, kProductType_)) ->set_version(Version()); } static const bool kSystemInstall_; static const BrowserDistribution::Type kProductType_; Version product_version_; Version max_version_; scoped_ptr<FakeInstallationState> original_state_; scoped_ptr<installer::InstallerState> installer_state_; }; const bool FindArchiveToPatchTest::kSystemInstall_ = false; const BrowserDistribution::Type FindArchiveToPatchTest::kProductType_ = BrowserDistribution::CHROME_BROWSER; } // namespace // Test that the path to the advertised product version is found. TEST_F(FindArchiveToPatchTest, ProductVersionFound) { base::FilePath patch_source(installer::FindArchiveToPatch( *original_state_, *installer_state_)); EXPECT_EQ(GetProductVersionArchivePath().value(), patch_source.value()); } // Test that the path to the max version is found if the advertised version is // missing. TEST_F(FindArchiveToPatchTest, MaxVersionFound) { // The patch file is absent. ASSERT_TRUE(base::DeleteFile(GetProductVersionArchivePath(), false)); base::FilePath patch_source(installer::FindArchiveToPatch( *original_state_, *installer_state_)); EXPECT_EQ(GetMaxVersionArchivePath().value(), patch_source.value()); // The product doesn't appear to be installed, so the max version is found. UninstallProduct(); patch_source = installer::FindArchiveToPatch( *original_state_, *installer_state_); EXPECT_EQ(GetMaxVersionArchivePath().value(), patch_source.value()); } // Test that an empty path is returned if no version is found. TEST_F(FindArchiveToPatchTest, NoVersionFound) { // The product doesn't appear to be installed and no archives are present. UninstallProduct(); ASSERT_TRUE(base::DeleteFile(GetProductVersionArchivePath(), false)); ASSERT_TRUE(base::DeleteFile(GetMaxVersionArchivePath(), false)); base::FilePath patch_source(installer::FindArchiveToPatch( *original_state_, *installer_state_)); EXPECT_EQ(base::FilePath::StringType(), patch_source.value()); } namespace { class MigrateMultiToSingleTest : public testing::Test { protected: virtual void SetUp() override { registry_override_manager_.OverrideRegistry(kRootKey); } static const bool kSystemLevel = false; static const HKEY kRootKey; static const wchar_t kVersionString[]; static const wchar_t kMultiChannel[]; registry_util::RegistryOverrideManager registry_override_manager_; }; const bool MigrateMultiToSingleTest::kSystemLevel; const HKEY MigrateMultiToSingleTest::kRootKey = kSystemLevel ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; const wchar_t MigrateMultiToSingleTest::kVersionString[] = L"30.0.1574.0"; const wchar_t MigrateMultiToSingleTest::kMultiChannel[] = L"2.0-dev-multi-chromeframe"; } // namespace // Test migrating Chrome Frame from multi to single. TEST_F(MigrateMultiToSingleTest, ChromeFrame) { installer::ProductState chrome_frame; installer::ProductState binaries; DWORD usagestats = 0; // Set up a config with dev-channel multi-install GCF. base::win::RegKey key; BrowserDistribution* dist = BrowserDistribution::GetSpecificDistribution( BrowserDistribution::CHROME_BINARIES); ASSERT_EQ(ERROR_SUCCESS, base::win::RegKey(kRootKey, dist->GetVersionKey().c_str(), KEY_SET_VALUE) .WriteValue(google_update::kRegVersionField, kVersionString)); ASSERT_EQ(ERROR_SUCCESS, base::win::RegKey(kRootKey, dist->GetStateKey().c_str(), KEY_SET_VALUE) .WriteValue(google_update::kRegApField, kMultiChannel)); ASSERT_EQ(ERROR_SUCCESS, base::win::RegKey(kRootKey, dist->GetStateKey().c_str(), KEY_SET_VALUE) .WriteValue(google_update::kRegUsageStatsField, 1U)); dist = BrowserDistribution::GetSpecificDistribution( BrowserDistribution::CHROME_FRAME); ASSERT_EQ(ERROR_SUCCESS, base::win::RegKey(kRootKey, dist->GetVersionKey().c_str(), KEY_SET_VALUE) .WriteValue(google_update::kRegVersionField, kVersionString)); ASSERT_EQ(ERROR_SUCCESS, base::win::RegKey(kRootKey, dist->GetStateKey().c_str(), KEY_SET_VALUE) .WriteValue(google_update::kRegApField, kMultiChannel)); // Do the registry migration. installer::InstallationState machine_state; machine_state.Initialize(); installer::MigrateGoogleUpdateStateMultiToSingle( kSystemLevel, BrowserDistribution::CHROME_FRAME, machine_state); // Confirm that usagestats were copied to CF and that its channel was // stripped. ASSERT_TRUE(chrome_frame.Initialize(kSystemLevel, BrowserDistribution::CHROME_FRAME)); EXPECT_TRUE(chrome_frame.GetUsageStats(&usagestats)); EXPECT_EQ(1U, usagestats); EXPECT_EQ(L"2.0-dev", chrome_frame.channel().value()); // Confirm that the binaries' channel no longer contains GCF. ASSERT_TRUE(binaries.Initialize(kSystemLevel, BrowserDistribution::CHROME_BINARIES)); EXPECT_EQ(L"2.0-dev-multi", binaries.channel().value()); } TEST(SetupUtilTest, ContainsUnsupportedSwitch) { EXPECT_FALSE(installer::ContainsUnsupportedSwitch( base::CommandLine::FromString(L"foo.exe"))); EXPECT_FALSE(installer::ContainsUnsupportedSwitch( base::CommandLine::FromString(L"foo.exe --multi-install --chrome"))); EXPECT_TRUE(installer::ContainsUnsupportedSwitch( base::CommandLine::FromString(L"foo.exe --chrome-frame"))); } TEST(SetupUtilTest, GetRegistrationDataCommandKey) { base::string16 app_guid = L"{AAAAAAAA-BBBB-1111-0123-456789ABCDEF}"; UpdatingAppRegistrationData reg_data(app_guid); base::string16 key = installer::GetRegistrationDataCommandKey(reg_data, L"test_name"); EXPECT_TRUE(EndsWith(key, app_guid + L"\\Commands\\test_name", true)); }
{ "content_hash": "a8880af17a71c121c3e52041045e35e7", "timestamp": "", "source": "github", "line_count": 474, "max_line_length": 80, "avg_line_length": 37.4746835443038, "alnum_prop": 0.7104092777120982, "repo_name": "krieger-od/nwjs_chromium.src", "id": "c07ec9859f7be7e6b48cb476a41b09d592778cb7", "size": "18955", "binary": false, "copies": "15", "ref": "refs/heads/master", "path": "chrome/installer/setup/setup_util_unittest.cc", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "AppleScript", "bytes": "6973" }, { "name": "Arduino", "bytes": "464" }, { "name": "Assembly", "bytes": "23945" }, { "name": "Batchfile", "bytes": "8451" }, { "name": "C", "bytes": "4123085" }, { "name": "C++", "bytes": "225911506" }, { "name": "CSS", "bytes": "875874" }, { "name": "Dart", "bytes": "74976" }, { "name": "Go", "bytes": "18155" }, { "name": "HTML", "bytes": "27190037" }, { "name": "Java", "bytes": "7645280" }, { "name": "JavaScript", "bytes": "18828195" }, { "name": "Makefile", "bytes": "96270" }, { "name": "Objective-C", "bytes": "1228317" }, { "name": "Objective-C++", "bytes": "7573158" }, { "name": "PHP", "bytes": "97817" }, { "name": "PLpgSQL", "bytes": "248854" }, { "name": "Perl", "bytes": "63937" }, { "name": "Protocol Buffer", "bytes": "418340" }, { "name": "Python", "bytes": "8032628" }, { "name": "Shell", "bytes": "464218" }, { "name": "Standard ML", "bytes": "4965" }, { "name": "XSLT", "bytes": "418" }, { "name": "nesC", "bytes": "18335" } ] }
End of preview.

No dataset card yet

Downloads last month
4