text
stringlengths 4
5.48M
| meta
stringlengths 14
6.54k
|
---|---|
package pe.hamp.eurekaapp.view;
import javax.swing.JInternalFrame;
//import pe.hamp.eurekaapp.domain.EmpleadoBean;
import pe.hamp.eurekaapp.util.Memoria;
/**
*
* @
*/
public class FormularioMDI extends javax.swing.JFrame {
public FormularioMDI() {
initComponents();
establecerTitulo();
this.setExtendedState(MAXIMIZED_BOTH);
}
private void establecerTitulo() {
//EmpleadoBean bean = (EmpleadoBean) Memoria.get("usuario");
String titulo = "EUREKA APP ";
//titulo += "[Usuario: " + bean.getUsuario() + "]";
this.setTitle(titulo);
}
/**
* This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
desktopPane = new javax.swing.JDesktopPane();
menuBar = new javax.swing.JMenuBar();
menuArchivo = new javax.swing.JMenu();
menuArchivoSalir = new javax.swing.JMenuItem();
menuProcesos = new javax.swing.JMenu();
menuProcesosCrearCuenta = new javax.swing.JMenuItem();
menuProcesosDeposito = new javax.swing.JMenuItem();
menuProcesosRetiro = new javax.swing.JMenuItem();
menuProcesosTransferencia = new javax.swing.JMenuItem();
menuProcesosCerrarCuenta = new javax.swing.JMenuItem();
menuTablas = new javax.swing.JMenu();
menuTablasCliente = new javax.swing.JMenuItem();
menuTablasEmpleado = new javax.swing.JMenuItem();
menuTablasSucursal = new javax.swing.JMenuItem();
menuConsultas = new javax.swing.JMenu();
menuReportes = new javax.swing.JMenu();
menuUtil = new javax.swing.JMenu();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("EUREKA");
menuArchivo.setMnemonic('f');
menuArchivo.setText("Archivo");
menuArchivoSalir.setMnemonic('x');
menuArchivoSalir.setText("Salir");
menuArchivoSalir.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
menuArchivoSalirActionPerformed(evt);
}
});
menuArchivo.add(menuArchivoSalir);
menuBar.add(menuArchivo);
menuProcesos.setText("Procesos");
menuProcesosCrearCuenta.setText("Crear cuenta");
menuProcesos.add(menuProcesosCrearCuenta);
menuProcesosDeposito.setText("Registrar depósito");
menuProcesosDeposito.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
menuProcesosDepositoActionPerformed(evt);
}
});
menuProcesos.add(menuProcesosDeposito);
menuProcesosRetiro.setText("Registrar retiro");
menuProcesos.add(menuProcesosRetiro);
menuProcesosTransferencia.setText("Registrar transferncia");
menuProcesos.add(menuProcesosTransferencia);
menuProcesosCerrarCuenta.setText("Cerrar cuenta");
menuProcesos.add(menuProcesosCerrarCuenta);
menuBar.add(menuProcesos);
menuTablas.setText("Tablas");
menuTablasCliente.setText("Clientes");
menuTablasCliente.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
menuTablasClienteActionPerformed(evt);
}
});
menuTablas.add(menuTablasCliente);
menuTablasEmpleado.setText("Empleados");
menuTablasEmpleado.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
menuTablasEmpleadoActionPerformed(evt);
}
});
menuTablas.add(menuTablasEmpleado);
menuTablasSucursal.setText("Sucursales");
menuTablas.add(menuTablasSucursal);
menuBar.add(menuTablas);
menuConsultas.setText("Consultas");
menuBar.add(menuConsultas);
menuReportes.setText("Reportes");
menuBar.add(menuReportes);
menuUtil.setText("Util");
menuBar.add(menuUtil);
setJMenuBar(menuBar);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(desktopPane, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(desktopPane, javax.swing.GroupLayout.DEFAULT_SIZE, 279, Short.MAX_VALUE)
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void menuArchivoSalirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuArchivoSalirActionPerformed
System.exit(0);
}//GEN-LAST:event_menuArchivoSalirActionPerformed
private void menuProcesosDepositoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuProcesosDepositoActionPerformed
cargarFormulario(DepositoView.class);
}//GEN-LAST:event_menuProcesosDepositoActionPerformed
private void menuTablasClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuTablasClienteActionPerformed
cargarFormulario(MantClientesView.class);
}//GEN-LAST:event_menuTablasClienteActionPerformed
private void menuTablasEmpleadoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuTablasEmpleadoActionPerformed
cargarFormulario(MantEmpleadoView.class);
}//GEN-LAST:event_menuTablasEmpleadoActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(FormularioMDI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(FormularioMDI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(FormularioMDI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(FormularioMDI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new FormularioMDI().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JDesktopPane desktopPane;
private javax.swing.JMenu menuArchivo;
private javax.swing.JMenuItem menuArchivoSalir;
private javax.swing.JMenuBar menuBar;
private javax.swing.JMenu menuConsultas;
private javax.swing.JMenu menuProcesos;
private javax.swing.JMenuItem menuProcesosCerrarCuenta;
private javax.swing.JMenuItem menuProcesosCrearCuenta;
private javax.swing.JMenuItem menuProcesosDeposito;
private javax.swing.JMenuItem menuProcesosRetiro;
private javax.swing.JMenuItem menuProcesosTransferencia;
private javax.swing.JMenu menuReportes;
private javax.swing.JMenu menuTablas;
private javax.swing.JMenuItem menuTablasCliente;
private javax.swing.JMenuItem menuTablasEmpleado;
private javax.swing.JMenuItem menuTablasSucursal;
private javax.swing.JMenu menuUtil;
// End of variables declaration//GEN-END:variables
private void cargarFormulario(Class<?> aClass) {
try {
// Variable
JInternalFrame view = null;
// Verificar si ya existe
for (JInternalFrame bean : desktopPane.getAllFrames()) {
if (aClass.isInstance(bean)) {
view = bean;
break;
}
}
// Si NO lo encuentra lo creamos
if (view == null) {
view = (JInternalFrame) Class.forName(aClass.getName()).newInstance();
desktopPane.add(view);
}
// Se debe activar el formulario
view.setVisible(true);
view.setSelected(true);
} catch (Exception e) {
}
}
}
| {'content_hash': '5ea4bcb9e03eb734809401dce8584ff2', 'timestamp': '', 'source': 'github', 'line_count': 233, 'max_line_length': 181, 'avg_line_length': 39.2961373390558, 'alnum_prop': 0.6926605504587156, 'repo_name': 'HFLORESR3/ModuloIPOO', 'id': 'f5065581eec078972421ef202e55346cd22352d9', 'size': '9157', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Sesion4/EurekaApp/src/pe/hamp/eurekaapp/view/FormularioMDI.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '120096'}]} |
<?php
namespace Pan100\MoodLogBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
class AdminController extends Controller
{
public function indexAction(Request $request) {
return $this->render('Pan100MoodLogBundle:Admin:index.html.twig');
}
} | {'content_hash': 'a3459189e581f1267c808551a772e784', 'timestamp': '', 'source': 'github', 'line_count': 14, 'max_line_length': 68, 'avg_line_length': 23.0, 'alnum_prop': 0.8105590062111802, 'repo_name': 'pan100/php-moodserver', 'id': '71c518f7d9a6771d63d11a31ab93132a5c7db06a', 'size': '322', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/Pan100/MoodLogBundle/Controller/AdminController.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '11093'}, {'name': 'JavaScript', 'bytes': '193788'}, {'name': 'PHP', 'bytes': '86299'}, {'name': 'Shell', 'bytes': '135'}]} |
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {'content_hash': 'fc8147b4ab3973f054b19d3bbb2c847f', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 39, 'avg_line_length': 10.307692307692308, 'alnum_prop': 0.6940298507462687, 'repo_name': 'mdoering/backbone', 'id': '4baec12ffd1bd5fcc71738073a87c14a998e52e5', 'size': '180', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'life/Plantae/Magnoliophyta/Magnoliopsida/Malpighiales/Chrysobalanaceae/Couepia/Couepia cidiana/README.md', 'mode': '33188', 'license': 'apache-2.0', 'language': []} |
/* Everything */
/* License information */
#define QT_PRODUCT_LICENSEE "Open Source"
#define QT_PRODUCT_LICENSE "OpenSource"
// Compiler sub-arch support
#define QT_COMPILER_SUPPORTS_SSE2 1
#define QT_COMPILER_SUPPORTS_SSE3 1
#define QT_COMPILER_SUPPORTS_SSSE3 1
#define QT_COMPILER_SUPPORTS_SSE4_1 1
#define QT_COMPILER_SUPPORTS_SSE4_2 1
#define QT_COMPILER_SUPPORTS_AVX 1
#define QT_COMPILER_SUPPORTS_AVX2 1
// Compile time features
#if defined(QT_LARGEFILE_SUPPORT) && defined(QT_NO_LARGEFILE_SUPPORT)
# undef QT_LARGEFILE_SUPPORT
#elif !defined(QT_LARGEFILE_SUPPORT)
# define QT_LARGEFILE_SUPPORT 64
#endif
#if defined(QT_NO_CUPS) && defined(QT_CUPS)
# undef QT_NO_CUPS
#elif !defined(QT_NO_CUPS)
# define QT_NO_CUPS
#endif
#if defined(QT_NO_EVDEV) && defined(QT_EVDEV)
# undef QT_NO_EVDEV
#elif !defined(QT_NO_EVDEV)
# define QT_NO_EVDEV
#endif
#if defined(QT_NO_EVENTFD) && defined(QT_EVENTFD)
# undef QT_NO_EVENTFD
#elif !defined(QT_NO_EVENTFD)
# define QT_NO_EVENTFD
#endif
#if defined(QT_NO_FONTCONFIG) && defined(QT_FONTCONFIG)
# undef QT_NO_FONTCONFIG
#elif !defined(QT_NO_FONTCONFIG)
# define QT_NO_FONTCONFIG
#endif
#if defined(QT_NO_GLIB) && defined(QT_GLIB)
# undef QT_NO_GLIB
#elif !defined(QT_NO_GLIB)
# define QT_NO_GLIB
#endif
#if defined(QT_NO_ICONV) && defined(QT_ICONV)
# undef QT_NO_ICONV
#elif !defined(QT_NO_ICONV)
# define QT_NO_ICONV
#endif
#if defined(QT_NO_IMAGEFORMAT_JPEG) && defined(QT_IMAGEFORMAT_JPEG)
# undef QT_NO_IMAGEFORMAT_JPEG
#elif !defined(QT_NO_IMAGEFORMAT_JPEG)
# define QT_NO_IMAGEFORMAT_JPEG
#endif
#if defined(QT_NO_INOTIFY) && defined(QT_INOTIFY)
# undef QT_NO_INOTIFY
#elif !defined(QT_NO_INOTIFY)
# define QT_NO_INOTIFY
#endif
#if defined(QT_NO_MTDEV) && defined(QT_MTDEV)
# undef QT_NO_MTDEV
#elif !defined(QT_NO_MTDEV)
# define QT_NO_MTDEV
#endif
#if defined(QT_NO_NIS) && defined(QT_NIS)
# undef QT_NO_NIS
#elif !defined(QT_NO_NIS)
# define QT_NO_NIS
#endif
#if defined(QT_NO_OPENVG) && defined(QT_OPENVG)
# undef QT_NO_OPENVG
#elif !defined(QT_NO_OPENVG)
# define QT_NO_OPENVG
#endif
#if defined(QT_NO_STYLE_GTK) && defined(QT_STYLE_GTK)
# undef QT_NO_STYLE_GTK
#elif !defined(QT_NO_STYLE_GTK)
# define QT_NO_STYLE_GTK
#endif
#if defined(QT_NO_STYLE_WINDOWSCE) && defined(QT_STYLE_WINDOWSCE)
# undef QT_NO_STYLE_WINDOWSCE
#elif !defined(QT_NO_STYLE_WINDOWSCE)
# define QT_NO_STYLE_WINDOWSCE
#endif
#if defined(QT_NO_STYLE_WINDOWSMOBILE) && defined(QT_STYLE_WINDOWSMOBILE)
# undef QT_NO_STYLE_WINDOWSMOBILE
#elif !defined(QT_NO_STYLE_WINDOWSMOBILE)
# define QT_NO_STYLE_WINDOWSMOBILE
#endif
#if defined(QT_OPENGL_DYNAMIC) && defined(QT_NO_OPENGL_DYNAMIC)
# undef QT_OPENGL_DYNAMIC
#elif !defined(QT_OPENGL_DYNAMIC)
# define QT_OPENGL_DYNAMIC
#endif
#if defined(QT_POINTER_SIZE) && defined(QT_NO_POINTER_SIZE)
# undef QT_POINTER_SIZE
#elif !defined(QT_POINTER_SIZE)
# define QT_POINTER_SIZE 4
#endif
#define QT_QPA_DEFAULT_PLATFORM_NAME "windows"
| {'content_hash': '365fb3b250d383add9f509cefe893542', 'timestamp': '', 'source': 'github', 'line_count': 120, 'max_line_length': 73, 'avg_line_length': 25.333333333333332, 'alnum_prop': 0.7082236842105263, 'repo_name': 'Yangff/mvuccu', 'id': '4763d76a7672e543b60be5aab02cfedeaa7112c2', 'size': '3040', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Qt/QtCore/qconfig.h', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Batchfile', 'bytes': '2368'}, {'name': 'C', 'bytes': '371898'}, {'name': 'C++', 'bytes': '4876092'}, {'name': 'JavaScript', 'bytes': '558878'}, {'name': 'Makefile', 'bytes': '1760'}, {'name': 'Objective-C', 'bytes': '921627'}, {'name': 'Python', 'bytes': '6124'}, {'name': 'QML', 'bytes': '27251'}, {'name': 'Shell', 'bytes': '1094'}]} |
import testExpression from '~/utils/testExpression';
export const expression = "return typeof Uint32Array !== 'undefined'";
export default () => testExpression(expression);
| {'content_hash': '921171f7500daf3ea35a07da805acdc7', 'timestamp': '', 'source': 'github', 'line_count': 4, 'max_line_length': 70, 'avg_line_length': 43.5, 'alnum_prop': 0.764367816091954, 'repo_name': 'Tokimon/es-feature-detection', 'id': '8080c78834979afc2183211053725a5ad6c99eb2', 'size': '174', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/builtins/Uint32Array.ts', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'JavaScript', 'bytes': '276'}, {'name': 'Shell', 'bytes': '2620'}, {'name': 'TypeScript', 'bytes': '41436'}]} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.UI;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Media;
namespace JacobC.Xiami.Controls
{
public class IconButton : Button
{
public IconButton()
{
DefaultStyleKey = typeof(IconButton);
}
/// <summary>
/// 获取或设置PointerOver时的前景色
/// </summary>
public Brush HoverForeground
{
get { return GetValue(HoverForegroundProperty) as Brush; }
set { SetValue(HoverForegroundProperty, value); }
}
/// <summary>
/// 标识<see cref="HoverForeground"/>依赖属性
/// </summary>
public static readonly DependencyProperty HoverForegroundProperty =
DependencyProperty.Register(nameof(HoverForeground), typeof(Brush),
typeof(IconButton), new PropertyMetadata(new SolidColorBrush(Colors.White)));
///// <summary>
///// 获取或设置Icon属性
///// </summary>
//public IconElement Icon
//{
// get { return GetValue(IconProperty) as IconElement; }
// set { SetValue(IconProperty, value); }
//}
//private static readonly IconElement _defaultIcon = default(IconElement);
///// <summary>
///// 标识<see cref="Icon"/>依赖属性
///// </summary>
//public static readonly DependencyProperty IconProperty =
// DependencyProperty.Register(nameof(Icon), typeof(IconElement),
// typeof(IconButton), new PropertyMetadata(default(IconElement)));
}
}
| {'content_hash': '4783ed5709120b7a6482cbda9732c558', 'timestamp': '', 'source': 'github', 'line_count': 53, 'max_line_length': 95, 'avg_line_length': 32.471698113207545, 'alnum_prop': 0.610110400929692, 'repo_name': 'cmpute/XiamiTing', 'id': 'b7acf6a2ea5a4ddc71bff5fbbaff5a5ade9ac986', 'size': '1781', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'XiamiTing/Controls/IconButton.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C#', 'bytes': '370768'}]} |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.appservice.models;
import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.appservice.fluent.models.RequestHistoryInner;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
/** The list of workflow request histories. */
@Fluent
public final class RequestHistoryListResult {
/*
* A list of workflow request histories.
*/
@JsonProperty(value = "value")
private List<RequestHistoryInner> value;
/*
* The URL to get the next set of results.
*/
@JsonProperty(value = "nextLink")
private String nextLink;
/**
* Get the value property: A list of workflow request histories.
*
* @return the value value.
*/
public List<RequestHistoryInner> value() {
return this.value;
}
/**
* Set the value property: A list of workflow request histories.
*
* @param value the value value to set.
* @return the RequestHistoryListResult object itself.
*/
public RequestHistoryListResult withValue(List<RequestHistoryInner> value) {
this.value = value;
return this;
}
/**
* Get the nextLink property: The URL to get the next set of results.
*
* @return the nextLink value.
*/
public String nextLink() {
return this.nextLink;
}
/**
* Set the nextLink property: The URL to get the next set of results.
*
* @param nextLink the nextLink value to set.
* @return the RequestHistoryListResult object itself.
*/
public RequestHistoryListResult withNextLink(String nextLink) {
this.nextLink = nextLink;
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (value() != null) {
value().forEach(e -> e.validate());
}
}
}
| {'content_hash': '1c0d89a64578ddcda183ca871936f530', 'timestamp': '', 'source': 'github', 'line_count': 77, 'max_line_length': 80, 'avg_line_length': 27.415584415584416, 'alnum_prop': 0.6480341070582663, 'repo_name': 'Azure/azure-sdk-for-java', 'id': 'b0c3ac9d0c239b85951306dc02a5c58b950ffab8', 'size': '2111', 'binary': False, 'copies': '1', 'ref': 'refs/heads/main', 'path': 'sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/RequestHistoryListResult.java', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Batchfile', 'bytes': '8762'}, {'name': 'Bicep', 'bytes': '15055'}, {'name': 'CSS', 'bytes': '7676'}, {'name': 'Dockerfile', 'bytes': '2028'}, {'name': 'Groovy', 'bytes': '3237482'}, {'name': 'HTML', 'bytes': '42090'}, {'name': 'Java', 'bytes': '432409546'}, {'name': 'JavaScript', 'bytes': '36557'}, {'name': 'Jupyter Notebook', 'bytes': '95868'}, {'name': 'PowerShell', 'bytes': '737517'}, {'name': 'Python', 'bytes': '240542'}, {'name': 'Scala', 'bytes': '1143898'}, {'name': 'Shell', 'bytes': '18488'}, {'name': 'XSLT', 'bytes': '755'}]} |
namespace scm {
namespace cu {
cuda_command_stream::cuda_command_stream(cuda_device& cudev)
: _stream(0)
{
cudaError cu_err = cudaSuccess;
cu_err = cudaStreamCreate(&_stream);
if (cudaSuccess != cu_err) {
std::ostringstream s;
s << "cuda_command_stream::cuda_command_stream() "
<< "error creating cuda stream (" << cudaGetErrorString(cu_err) << ").";
throw std::runtime_error(s.str());
}
}
cuda_command_stream::~cuda_command_stream()
{
cudaStreamDestroy(_stream);
}
const cudaStream_t
cuda_command_stream::stream() const
{
return _stream;
}
} // namespace cu
} // namespace scm
| {'content_hash': '35edfe8fc4e8b79ab740740d63dea7c5', 'timestamp': '', 'source': 'github', 'line_count': 29, 'max_line_length': 82, 'avg_line_length': 22.137931034482758, 'alnum_prop': 0.6339563862928349, 'repo_name': 'gandideluxe/schism', 'id': '659f1afa2f5681489b13a4d3161fa5ac12c4b57f', 'size': '1017', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'scm_cl_core/src/scm/cl_core/cuda/command_stream.cpp', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'C', 'bytes': '1260480'}, {'name': 'C++', 'bytes': '3528673'}, {'name': 'CMake', 'bytes': '135988'}, {'name': 'Cuda', 'bytes': '10780'}, {'name': 'GLSL', 'bytes': '27426'}]} |
using std::cout;
using std::endl;
// See http://en.cppreference.com/w/cpp/error for further info
// Exception handling works similar to the way it does in C# - the first
// applicable handler is selected.
int main(int argc, char *argv[])
{
try
{
throw std::runtime_error("I am an error.");
}
// You will get a compiler warning if you uncomment this "caught be earlier
// handler".
// catch (std::exception ex)
// {
// cout << "Caught a standard exception." << endl;
// }
catch (std::runtime_error ex)
{
cout << "Caught a runtime_error." << endl;
}
catch (std::exception ex)
{
cout << "Caught a standard exception." << endl;
}
return 0;
}
| {'content_hash': 'ce4cecfcac0f3e58ba3a4a3837badfb2', 'timestamp': '', 'source': 'github', 'line_count': 33, 'max_line_length': 79, 'avg_line_length': 21.696969696969695, 'alnum_prop': 0.6019553072625698, 'repo_name': 'PhilipDaniels/learn', 'id': '4971e7c5027673960e9d190683bdb6311816c8e1', 'size': '776', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'cpp/try_catch.cpp', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Batchfile', 'bytes': '6901'}, {'name': 'C#', 'bytes': '73608'}, {'name': 'C++', 'bytes': '127910'}, {'name': 'Makefile', 'bytes': '205'}, {'name': 'PowerShell', 'bytes': '19738'}, {'name': 'Rust', 'bytes': '122220'}, {'name': 'Shell', 'bytes': '384'}]} |
import { BufferLike } from './buffer_like';
import * as constants from './constants';
/**
* Converts array-like object to an array.
*
* @example
* jz.common.toArray(document.querySelectorAll("div"));
*/
export function toArray<T>(x: any): T[] {
return <T[]>Array.prototype.slice.call(x);
}
/**
* Converts Array, ArrayBuffer or String to an Uint8Array.
*
* @example
* var bytes = jz.common.toBytes('foo');
* var bytes = jz.common.toBytes([1, 2, 3]);
*/
export function toBytes(buffer: BufferLike): Uint8Array {
switch (Object.prototype.toString.call(buffer)) {
case '[object String]':
return stringToBytes(<string>buffer);
case '[object Array]':
case '[object ArrayBuffer]':
return new Uint8Array(<ArrayBuffer>buffer);
case '[object Uint8Array]':
return <Uint8Array>buffer;
case '[object Int8Array]':
case '[object Uint8ClampedArray]':
case '[object CanvasPixelArray]':
const b = <Uint8Array>buffer;
return new Uint8Array(b.buffer, b.byteOffset, b.byteLength);
default:
throw new Error('jz.utils.toBytes: not supported type.');
}
}
/**
* Read a file as selected type. This is a FileReader wrapper.
*/
export function readFileAs(type: 'ArrayBuffer', blob: Blob): Promise<ArrayBuffer>;
export function readFileAs(type: 'Text', blob: Blob, encoding?: string): Promise<string>;
export function readFileAs(type: 'DataURL', blob: Blob): Promise<string>;
export function readFileAs(type: 'ArrayBuffer' | 'Text' | 'DataURL', blob: Blob, encoding = 'UTF-8'): Promise<any> {
var executor: (resolve: Function, reject: Function) => void;
if (constants.ENV_IS_WORKER) {
executor = resolve => {
var fr = new FileReaderSync();
switch (type) {
case 'ArrayBuffer':
resolve(fr.readAsArrayBuffer(blob));
break;
case 'Text':
resolve(fr.readAsText(blob, encoding));
break;
case 'DataURL':
resolve(fr.readAsDataURL(blob));
break;
}
};
} else {
executor = (resolve, reject) => {
var fr = new FileReader();
fr.onload = () => resolve(fr.result);
fr.onerror = err => reject(err);
switch (type) {
case 'ArrayBuffer':
fr.readAsArrayBuffer(blob);
break;
case 'Text':
fr.readAsText(blob, encoding);
break;
case 'DataURL':
fr.readAsDataURL(blob);
break;
}
};
}
return new Promise(executor);
}
/**
* Read a file as a string.
*/
export const readFileAsText = (blob: Blob, encoding?: string) => readFileAs('Text', blob, encoding);
/**
* Read a file as an ArrayBuffer object.
*/
export const readFileAsArrayBuffer = (blob: Blob) => readFileAs('ArrayBuffer', blob);
/**
* Read a file as a data url string.
*/
export const readFileAsDataURL = (blob: Blob) => readFileAs('DataURL', blob);
/**
* Converts string to an Uint8Array. its encoding is utf8.
*/
export function stringToBytes(str: string) {
let n = str.length;
let idx = -1;
let byteLength = 32;
let bytes = new Uint8Array(byteLength);
let _bytes: Uint8Array;
for (let i = 0; i < n; ++i) {
let c = str.charCodeAt(i);
if (c <= 0x7f) {
bytes[++idx] = c;
} else if (c <= 0x7ff) {
bytes[++idx] = 0xc0 | (c >>> 6);
bytes[++idx] = 0x80 | (c & 0x3f);
} else if (c <= 0xffff) {
bytes[++idx] = 0xe0 | (c >>> 12);
bytes[++idx] = 0x80 | ((c >>> 6) & 0x3f);
bytes[++idx] = 0x80 | (c & 0x3f);
} else {
bytes[++idx] = 0xf0 | (c >>> 18);
bytes[++idx] = 0x80 | ((c >>> 12) & 0x3f);
bytes[++idx] = 0x80 | ((c >>> 6) & 0x3f);
bytes[++idx] = 0x80 | (c & 0x3f);
}
if (byteLength - idx <= 4) {
_bytes = bytes;
byteLength *= 2;
bytes = new Uint8Array(byteLength);
bytes.set(_bytes);
}
}
return bytes.subarray(0, ++idx);
}
/**
* Converts Uint8Array to a string.
*
* @example
* jz.common.bytesToString(bytes).then(str => {
* console.log(str);
* });
*
* jz.common.bytesToString(bytes, 'UTF-8').then(str => {
* console.log(str);
* });
*/
export function bytesToString(bytes: BufferLike, encoding = 'UTF-8') {
return readFileAsText(new Blob([toBytes(bytes)]), encoding);
}
/**
* Converts Uint8Array to a string. You can use it only a worker process.
*
* @example
* var str = jz.common.bytesToStringSync(bytes);
* var str = jz.common.bytesToStringSync(bytes, 'UTF-8');
*/
export function bytesToStringSync(bytes: BufferLike, encoding = 'UTF-8') {
if (!constants.ENV_IS_WORKER) throw new Error('bytesToStringSync is available in worker.');
return new FileReaderSync().readAsText(new Blob([toBytes(bytes)]), encoding);
}
/**
* Detects encoding of the buffer like object.
*
* @example
* const encoding = jz.common.detectEncoding(bytes);
* jz.common.detectEncoding(bytes).then(type => {
* console.log(type);
* });
*/
export function detectEncoding(bytes: BufferLike) {
let b = toBytes(bytes);
for (let i = 0, n = b.length; i < n; ++i) {
if (b[i] < 0x80) {
continue;
} else if ((b[i] & 0xe0) === 0xc0) {
if ((b[++i] & 0xc0) === 0x80) continue;
} else if ((b[i] & 0xf0) === 0xe0) {
if ((b[++i] & 0xc0) === 0x80 && (b[++i] & 0xc0) === 0x80) continue;
} else if ((b[i] & 0xf8) === 0xf0) {
if ((b[++i] & 0xc0) === 0x80 && (b[++i] & 0xc0) === 0x80 && (b[++i] & 0xc0) === 0x80) continue;
} else {
return 'Shift_JIS';
}
}
return 'UTF-8';
}
/**
* Loads buffers with Ajax(async).
*
* @example
* jz.common.load(['a.zip', 'b.zip'])
* .then(([a, b]) => {
* // arguments are Uint8Array
* });
* // or
* jz.common.load('a.zip', 'b.zip')
*/
export async function load(urls: string[]): Promise<Uint8Array[]>;
export async function load(...urls: string[]): Promise<Uint8Array[]>;
export async function load(args: any): Promise<Uint8Array[]> {
const urls = <string[]>(Array.isArray(args) ? args : toArray(arguments));
return await Promise.all(
urls.map(async url => {
const res = await fetch(url);
return new Uint8Array(await res.arrayBuffer());
}),
);
}
/**
* Concats bytes.
*
* @example
* let bytes = jz.common.concatBytes(bytes1, bytes2, bytes3);
* let bytes = jz.common.concatBytes([bytes1, bytes2, bytes3]);
*/
export function concatBytes(buffers: (Uint8Array | ArrayBuffer)[]): Uint8Array;
export function concatBytes(...buffers: (Uint8Array | ArrayBuffer)[]): Uint8Array;
export function concatBytes(_buffers: any): Uint8Array {
let size = 0;
let offset = 0;
let ret: Uint8Array;
let i: number;
let n: number;
let buffers = (Array.isArray(_buffers) ? _buffers : toArray(arguments)).map(toBytes);
for (i = 0, n = buffers.length; i < n; ++i) size += buffers[i].length;
ret = new Uint8Array(size);
for (i = 0; i < n; ++i) {
ret.set(buffers[i], offset);
offset += buffers[i].length;
}
return ret;
}
| {'content_hash': 'a8ef164f71cf3593c688aa2ea7a54e3d', 'timestamp': '', 'source': 'github', 'line_count': 238, 'max_line_length': 116, 'avg_line_length': 29.1218487394958, 'alnum_prop': 0.6002019910546819, 'repo_name': 'ukyo/jsziptools', 'id': 'bc86de4ac39d3682a10df3a806a75f710a2f8a8d', 'size': '6931', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/common/utils.ts', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'JavaScript', 'bytes': '18217'}, {'name': 'Shell', 'bytes': '185'}, {'name': 'TypeScript', 'bytes': '66545'}]} |
package imy.me.bluetooshsample;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.content.Intent;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import java.util.ArrayList;
import java.util.Set;
public class SelectConnectBluetoothDeviceActivity extends ActionBarActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_select_connect_bluetooth_device);
final BluetoothAdapter bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
//Bluetoothが使えるかどうか
if (bluetoothAdapter.equals(null) || !bluetoothAdapter.isEnabled()) {
return;
}
final ArrayList<String> bluetoothDeviceNames = new ArrayList<>();
final Set<BluetoothDevice> bluetoothDevices = bluetoothAdapter.getBondedDevices();
for (BluetoothDevice bluetoothDevice : bluetoothDevices) {
bluetoothDeviceNames.add(bluetoothDevice.getName());
}
ArrayAdapter<String> stringArrayAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, bluetoothDeviceNames);
ListView listView = (ListView) findViewById(R.id.bluetooth_list);
listView.setAdapter(stringArrayAdapter);
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
String deviceName = bluetoothDeviceNames.get(position);
Intent intent = new Intent(SelectConnectBluetoothDeviceActivity.this, MessageActivity.class);
Bundle bundle = new Bundle();
bundle.putInt(MessageActivity.RECEIVE_KEY_MODE, MessageActivity.MODE_CLIENT);
bundle.putString(MessageActivity.RECEIVE_KEY_SERVER_NAME, deviceName);
intent.putExtras(bundle);
startActivity(intent);
}
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_select_connect_bluetooth_device, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
| {'content_hash': '7810130c5c9341a72f65fc2fcdf22d5c', 'timestamp': '', 'source': 'github', 'line_count': 76, 'max_line_length': 140, 'avg_line_length': 39.55263157894737, 'alnum_prop': 0.6976047904191617, 'repo_name': 'Gazyu/BluetoothSample', 'id': '5f25bdb58b492bdc07650ba761b41e3824e05301', 'size': '3022', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'app/src/main/java/imy/me/bluetooshsample/SelectConnectBluetoothDeviceActivity.java', 'mode': '33188', 'license': 'bsd-2-clause', 'language': [{'name': 'Java', 'bytes': '14978'}]} |
It is a specific usage of the Agent to Agent dll which is an inter-agent communication channel.
# capability <string> of <agent interface> : agent interface capability
Returns the name and the state of a specific capability of a specific agent interface.
{% qna %}
Q: capability "quarantine" of agent interface "EDR" of client
A: quarantine:Off
{% endqna %}
# capability of <agent interface> : agent interface capability
Returns the name and the state of the capability supported by the agent interface. This is an example that uses plural:
{% qna %}
Q: capabilities of agent interface "EDR" of client
A: quarantine:Off
A: delete registry value
A: kill process
A: quarantine file
A: update registry value
{% endqna %}
The state is not returned by stateless remediation capabilities.
# client product of <agent interface> : string
Returns the client product name for a specific agent interface, for example:
{% qna %}
Q: client product of agent interface "EDR" of client
A: EDR
{% endqna %}
If that specific agent interface does not exist, the inspector returns "Singular expression refers to nonexistent object".
The plural returns client product names for all the agent interfaces:
{% qna %}
Q: client products of agent interfaces of client
A: EDR
A: DEV
{% endqna %}
| {'content_hash': 'e3b8cd083da5b4fbe5f37ffa5d1215f5', 'timestamp': '', 'source': 'github', 'line_count': 44, 'max_line_length': 122, 'avg_line_length': 29.681818181818183, 'alnum_prop': 0.7595712098009189, 'repo_name': 'bigfix/developer.bigfix.com', 'id': '5d70e1920094c4c657744079ad63b146092da8d3', 'size': '1331', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'site/pages/relevance/_reference/docs/agent-interface.md', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '24905'}, {'name': 'Dockerfile', 'bytes': '860'}, {'name': 'HTML', 'bytes': '37759'}, {'name': 'JavaScript', 'bytes': '454820'}, {'name': 'Less', 'bytes': '59351'}, {'name': 'Makefile', 'bytes': '9278'}, {'name': 'SCSS', 'bytes': '60117'}, {'name': 'Shell', 'bytes': '2859'}]} |
Rails.application.routes.draw do
mount Monita::Engine => "/monita"
end
| {'content_hash': '6b9624b44a83daeb622376506318b584', 'timestamp': '', 'source': 'github', 'line_count': 4, 'max_line_length': 35, 'avg_line_length': 18.5, 'alnum_prop': 0.7297297297297297, 'repo_name': 'pietervisser/monita', 'id': '945133ca17695d31da2a82484ade490af45189c4', 'size': '74', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'test/dummy/config/routes.rb', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'JavaScript', 'bytes': '1240'}, {'name': 'Ruby', 'bytes': '20558'}]} |
namespace EasyNetQ.Events
{
public class AckEvent
{
public MessageReceivedInfo ReceivedInfo { get; }
public MessageProperties Properties { get; }
public byte[] Body { get; }
public AckResult AckResult { get; }
public AckEvent(MessageReceivedInfo info, MessageProperties properties, byte[] body , AckResult ackResult)
{
ReceivedInfo = info;
Properties = properties;
Body = body;
AckResult = ackResult;
}
}
public enum AckResult
{
Ack,
Nack,
Exception
}
} | {'content_hash': '129c03469655b7ba45a3a17b915c8244', 'timestamp': '', 'source': 'github', 'line_count': 25, 'max_line_length': 114, 'avg_line_length': 24.32, 'alnum_prop': 0.5740131578947368, 'repo_name': 'ar7z1/EasyNetQ', 'id': '7fcb46878a2e0c54ed9fe7bdd4a2eb25d2edfc64', 'size': '610', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'Source/EasyNetQ/Events/AckEvent.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Batchfile', 'bytes': '947'}, {'name': 'C#', 'bytes': '1144386'}, {'name': 'JavaScript', 'bytes': '1022'}, {'name': 'PLpgSQL', 'bytes': '1830'}]} |
<?php
namespace Colibri\Console;
use Symfony\Component\Console\Application as SymfonyApplication;
use Symfony\Component\Console\Output\OutputInterface;
class Application extends SymfonyApplication
{
/** @var string App Logo */
private $logo = '';
/**
* @param string $logo
*
* @return $this
*/
public function setLogo(string $logo): self
{
$this->logo = $logo;
return $this;
}
/**
* @param array $commands
*
* @return $this
*/
public function addCommands(array $commands): self
{
parent::addCommands($commands);
return $this;
}
/**
* @return string
*/
public function getHelp()
{
return $this->logo . PHP_EOL . parent::getHelp();
}
/**
* @param \Throwable $exception
* @param OutputInterface $output
*/
public function renderError(\Throwable $exception, OutputInterface $output)
{
if (method_exists(get_parent_class($this), 'renderException')) {
$this->renderException($exception, $output);
} else {
$this->renderThrowable($exception, $output);
}
}
}
| {'content_hash': '3e73b834be18218d5c90af0752b40725', 'timestamp': '', 'source': 'github', 'line_count': 56, 'max_line_length': 79, 'avg_line_length': 21.232142857142858, 'alnum_prop': 0.5744322960470984, 'repo_name': 'PHPColibri/framework', 'id': 'e03fc53a898cbdd4c4023e1117686dfe13ed5654', 'size': '1189', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Console/Application.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Hack', 'bytes': '1686'}, {'name': 'PHP', 'bytes': '308868'}, {'name': 'Shell', 'bytes': '996'}]} |
package com.lrscp.FileBackupTool;
public class Debug {
public static final boolean DEBUG_MEMORY = false;
public static final boolean DEBUG_DIRECTORY_DETAIL_MANAGER = false;
}
| {'content_hash': '1537a18f0c3a3976e4adc9f5827cf666', 'timestamp': '', 'source': 'github', 'line_count': 9, 'max_line_length': 71, 'avg_line_length': 22.22222222222222, 'alnum_prop': 0.705, 'repo_name': 'lrscp/SimpleBackupTool', 'id': '15fe17553cc8e783f40c2f1b8d9cc1a7a6caee28', 'size': '200', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/com/lrscp/FileBackupTool/Debug.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '103802'}, {'name': 'Shell', 'bytes': '48'}]} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Change password</title>
<!-- css -->
<link href="style.css" type="text/css" rel="stylesheet">
</head>
<body>
<!-- header -->
<ul class="header">
<li><a href="home.html"><img src="images/logo.png" width="100" style="text-align:center;"></a></li>
</ul>
<!-- confirm -->
<div class="rcorners1" align="center">
<h1>Input New Password</h1><br><br>
<form>
<input type="password" class="signform" name="password" placeholder="New password"><br><br>
<input type="submit" class="btn-sign" name="Change" value="CHANGE"><br><br>
</form>
</div>
<!-- footer -->
<footer>
<div class="container"><p>Copyright © Prak-PW 2017</p></div>
</footer>
</body>
</html> | {'content_hash': '10af3117fec119ee882700c1cd2d5167', 'timestamp': '', 'source': 'github', 'line_count': 30, 'max_line_length': 102, 'avg_line_length': 26.0, 'alnum_prop': 0.5923076923076923, 'repo_name': 'realicejoanne/prak-pw', 'id': 'ed5800aacf25f9fe9d1b77467cfde89aa2f07d5a', 'size': '780', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'static/htmlcss/changepw.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '43306'}, {'name': 'HTML', 'bytes': '8634919'}, {'name': 'JavaScript', 'bytes': '100453'}, {'name': 'PHP', 'bytes': '1785254'}]} |
<?php
namespace Magento\CatalogUrlRewrite\Test\Unit\Observer;
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
class CategoryUrlPathAutogeneratorObserverTest extends \PHPUnit_Framework_TestCase
{
/** @var \Magento\CatalogUrlRewrite\Observer\CategoryUrlPathAutogeneratorObserver */
protected $categoryUrlPathAutogeneratorObserver;
/** @var \PHPUnit_Framework_MockObject_MockObject */
protected $categoryUrlPathGenerator;
/** @var \PHPUnit_Framework_MockObject_MockObject */
protected $childrenCategoriesProvider;
/** @var \PHPUnit_Framework_MockObject_MockObject */
protected $observer;
/** @var \PHPUnit_Framework_MockObject_MockObject */
protected $category;
/**
* @var \Magento\CatalogUrlRewrite\Service\V1\StoreViewService|\PHPUnit_Framework_MockObject_MockObject
*/
protected $storeViewService;
/**
* @var \Magento\Catalog\Model\ResourceModel\Category|\PHPUnit_Framework_MockObject_MockObject
*/
protected $categoryResource;
protected function setUp()
{
$this->observer = $this->getMock(
'Magento\Framework\Event\Observer',
['getEvent', 'getCategory'],
[],
'',
false
);
$this->categoryResource = $this->getMock('Magento\Catalog\Model\ResourceModel\Category', [], [], '', false);
$this->category = $this->getMock(
'Magento\Catalog\Model\Category',
['setUrlKey', 'setUrlPath', 'dataHasChangedFor', 'isObjectNew', 'getResource', 'getUrlKey', 'getStoreId'],
[],
'',
false
);
$this->category->expects($this->any())->method('getResource')->willReturn($this->categoryResource);
$this->observer->expects($this->any())->method('getEvent')->willReturnSelf();
$this->observer->expects($this->any())->method('getCategory')->willReturn($this->category);
$this->categoryUrlPathGenerator = $this->getMock(
'Magento\CatalogUrlRewrite\Model\CategoryUrlPathGenerator',
[],
[],
'',
false
);
$this->childrenCategoriesProvider = $this->getMock(
'Magento\CatalogUrlRewrite\Model\Category\ChildrenCategoriesProvider'
);
$this->storeViewService = $this->getMock(
'Magento\CatalogUrlRewrite\Service\V1\StoreViewService',
[],
[],
'',
false
);
$this->categoryUrlPathAutogeneratorObserver = (new ObjectManagerHelper($this))->getObject(
'Magento\CatalogUrlRewrite\Observer\CategoryUrlPathAutogeneratorObserver',
[
'categoryUrlPathGenerator' => $this->categoryUrlPathGenerator,
'childrenCategoriesProvider' => $this->childrenCategoriesProvider,
'storeViewService' => $this->storeViewService,
]
);
}
public function testSetCategoryUrlAndCategoryPath()
{
$this->category->expects($this->once())->method('getUrlKey')->willReturn('category');
$this->categoryUrlPathGenerator->expects($this->once())->method('getUrlKey')->willReturn('urk_key');
$this->category->expects($this->once())->method('setUrlKey')->with('urk_key')->willReturnSelf();
$this->categoryUrlPathGenerator->expects($this->once())->method('getUrlPath')->willReturn('url_path');
$this->category->expects($this->once())->method('setUrlPath')->with('url_path')->willReturnSelf();
$this->category->expects($this->once())->method('isObjectNew')->willReturn(true);
$this->categoryUrlPathAutogeneratorObserver->execute($this->observer);
}
public function testExecuteWithoutUrlKeyAndUrlPathUpdating()
{
$this->category->expects($this->once())->method('getUrlKey')->willReturn(false);
$this->category->expects($this->never())->method('setUrlKey');
$this->category->expects($this->never())->method('setUrlPath');
$this->categoryUrlPathAutogeneratorObserver->execute($this->observer);
}
public function testUrlKeyAndUrlPathUpdating()
{
$this->categoryUrlPathGenerator->expects($this->once())->method('getUrlKey')->with($this->category)
->willReturn('url_key');
$this->categoryUrlPathGenerator->expects($this->once())->method('getUrlPath')->with($this->category)
->willReturn('url_path');
$this->category->expects($this->once())->method('getUrlKey')->willReturn('not_formatted_url_key');
$this->category->expects($this->once())->method('setUrlKey')->with('url_key')->willReturnSelf();
$this->category->expects($this->once())->method('setUrlPath')->with('url_path')->willReturnSelf();
// break code execution
$this->category->expects($this->once())->method('isObjectNew')->willReturn(true);
$this->categoryUrlPathAutogeneratorObserver->execute($this->observer);
}
public function testUrlPathAttributeNoUpdatingIfCategoryIsNew()
{
$this->categoryUrlPathGenerator->expects($this->any())->method('getUrlKey')->willReturn('url_key');
$this->categoryUrlPathGenerator->expects($this->any())->method('getUrlPath')->willReturn('url_path');
$this->category->expects($this->any())->method('getUrlKey')->willReturn('not_formatted_url_key');
$this->category->expects($this->any())->method('setUrlKey')->willReturnSelf();
$this->category->expects($this->any())->method('setUrlPath')->willReturnSelf();
$this->category->expects($this->once())->method('isObjectNew')->willReturn(true);
$this->categoryResource->expects($this->never())->method('saveAttribute');
$this->categoryUrlPathAutogeneratorObserver->execute($this->observer);
}
public function testUrlPathAttributeUpdating()
{
$this->categoryUrlPathGenerator->expects($this->any())->method('getUrlKey')->willReturn('url_key');
$this->categoryUrlPathGenerator->expects($this->any())->method('getUrlPath')->willReturn('url_path');
$this->category->expects($this->any())->method('getUrlKey')->willReturn('not_formatted_url_key');
$this->category->expects($this->any())->method('setUrlKey')->willReturnSelf();
$this->category->expects($this->any())->method('setUrlPath')->willReturnSelf();
$this->category->expects($this->once())->method('isObjectNew')->willReturn(false);
$this->categoryResource->expects($this->once())->method('saveAttribute')->with($this->category, 'url_path');
// break code execution
$this->category->expects($this->once())->method('dataHasChangedFor')->with('url_path')->willReturn(false);
$this->categoryUrlPathAutogeneratorObserver->execute($this->observer);
}
public function testChildrenUrlPathAttributeNoUpdatingIfParentUrlPathIsNotChanged()
{
$this->categoryUrlPathGenerator->expects($this->any())->method('getUrlKey')->willReturn('url_key');
$this->categoryUrlPathGenerator->expects($this->any())->method('getUrlPath')->willReturn('url_path');
$this->categoryResource->expects($this->once())->method('saveAttribute')->with($this->category, 'url_path');
$this->category->expects($this->any())->method('getUrlKey')->willReturn('not_formatted_url_key');
$this->category->expects($this->any())->method('setUrlKey')->willReturnSelf();
$this->category->expects($this->any())->method('setUrlPath')->willReturnSelf();
$this->category->expects($this->once())->method('isObjectNew')->willReturn(false);
// break code execution
$this->category->expects($this->once())->method('dataHasChangedFor')->with('url_path')->willReturn(false);
$this->categoryUrlPathAutogeneratorObserver->execute($this->observer);
}
public function testChildrenUrlPathAttributeUpdatingForSpecificStore()
{
$this->categoryUrlPathGenerator->expects($this->any())->method('getUrlKey')->willReturn('generated_url_key');
$this->categoryUrlPathGenerator->expects($this->any())->method('getUrlPath')->willReturn('generated_url_path');
$this->category->expects($this->any())->method('getUrlKey')->willReturn('not_formatted_url_key');
$this->category->expects($this->any())->method('setUrlKey')->willReturnSelf();
$this->category->expects($this->any())->method('setUrlPath')->willReturnSelf();
$this->category->expects($this->any())->method('isObjectNew')->willReturn(false);
$this->category->expects($this->any())->method('dataHasChangedFor')->willReturn(true);
// only for specific store
$this->category->expects($this->atLeastOnce())->method('getStoreId')->willReturn(1);
$childCategoryResource = $this->getMockBuilder('Magento\Catalog\Model\ResourceModel\Category')
->disableOriginalConstructor()->getMock();
$childCategory = $this->getMockBuilder('Magento\Catalog\Model\Category')
->setMethods([
'getUrlPath',
'setUrlPath',
'getResource',
'getStore',
'getStoreId',
'setStoreId'
])
->disableOriginalConstructor()->getMock();
$childCategory->expects($this->any())->method('getResource')->willReturn($childCategoryResource);
$childCategory->expects($this->once())->method('setStoreId')->with(1);
$this->childrenCategoriesProvider->expects($this->once())->method('getChildren')->willReturn([$childCategory]);
$childCategory->expects($this->once())->method('setUrlPath')->with('generated_url_path')->willReturnSelf();
$childCategoryResource->expects($this->once())->method('saveAttribute')->with($childCategory, 'url_path');
$this->categoryUrlPathAutogeneratorObserver->execute($this->observer);
}
}
| {'content_hash': 'e54812adb79d66e005239ba7c68dc125', 'timestamp': '', 'source': 'github', 'line_count': 203, 'max_line_length': 119, 'avg_line_length': 48.935960591133004, 'alnum_prop': 0.646366015703644, 'repo_name': 'tarikgwa/test', 'id': 'e400fe924c68639c0cd3d9c35fc904b56852bccd', 'size': '10032', 'binary': False, 'copies': '4', 'ref': 'refs/heads/master', 'path': 'html/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/CategoryUrlPathAutogeneratorObserverTest.php', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'ApacheConf', 'bytes': '26588'}, {'name': 'CSS', 'bytes': '4874492'}, {'name': 'HTML', 'bytes': '8635167'}, {'name': 'JavaScript', 'bytes': '6810903'}, {'name': 'PHP', 'bytes': '55645559'}, {'name': 'Perl', 'bytes': '7938'}, {'name': 'Shell', 'bytes': '4505'}, {'name': 'XSLT', 'bytes': '19889'}]} |
require 'rails_helper'
RSpec.describe StarReadingImporter do
describe '#import_row' do
context 'reading file' do
let(:file) { File.open("#{Rails.root}/spec/fixtures/fake_star_reading.csv") }
let(:transformer) { StarReadingCsvTransformer.new }
let(:csv) { transformer.transform(file) }
let(:reading_importer) {
Importer.new(current_file_importer: described_class.new)
}
context 'with good data' do
context 'existing student' do
let!(:student) { FactoryGirl.create(:student_we_want_to_update) }
it 'creates a new student assessment' do
expect { reading_importer.start_import(csv) }.to change { StudentAssessment.count }.by 1
end
it 'creates a new STAR Reading assessment' do
reading_importer.start_import(csv)
student_assessment = StudentAssessment.last
expect(student_assessment.family).to eq "STAR"
expect(student_assessment.subject).to eq "Reading"
end
it 'sets instructional reading level correctly' do
reading_importer.start_import(csv)
expect(StudentAssessment.last.instructional_reading_level).to eq 5.0
end
it 'sets date taken correctly' do
reading_importer.start_import(csv)
expect(StudentAssessment.last.date_taken).to eq Date.new(2015, 1, 21)
end
it 'does not create a new student' do
expect { reading_importer.start_import(csv) }.to change(Student, :count).by 0
end
end
context 'student does not exist' do
it 'does not create a new student assessment' do
expect { reading_importer.start_import(csv) }.to change { StudentAssessment.count }.by 0
end
it 'does not create a new student' do
expect { reading_importer.start_import(csv) }.to change(Student, :count).by 0
end
end
end
context 'with bad data' do
let(:file) { File.open("#{Rails.root}/spec/fixtures/bad_star_reading_data.csv") }
let(:transformer) { StarReadingCsvTransformer.new }
let(:csv) { transformer.transform(file) }
let(:reading_importer) { StarReadingImporter.new }
it 'raises an error' do
expect { reading_importer.start_import(csv) }.to raise_error NoMethodError
end
end
end
end
end
| {'content_hash': '9f5b55336d2293a16de0e9bcf39d49fb', 'timestamp': '', 'source': 'github', 'line_count': 60, 'max_line_length': 100, 'avg_line_length': 40.36666666666667, 'alnum_prop': 0.6238645747316267, 'repo_name': 'codeforamerica/somerville-teacher-tool', 'id': '6010b5f400c4a55799427b68d563896c5b9d6468', 'size': '2422', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'spec/importers/star_reading_importer_spec.rb', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '20653'}, {'name': 'HTML', 'bytes': '44884'}, {'name': 'JavaScript', 'bytes': '141571'}, {'name': 'Ruby', 'bytes': '297999'}, {'name': 'Shell', 'bytes': '22203'}]} |
@implementation TestXYTheme
+(NSString *)defaultName
{
return kCPDarkGradientTheme;
}
-(void)applyThemeToAxis:(CPXYAxis *)axis usingMajorLineStyle:(CPLineStyle *)majorLineStyle
minorLineStyle:(CPLineStyle *)minorLineStyle majorGridLineStyle:majorGridLineStyle textStyle:(CPTextStyle *)textStyle
{
axis.labelingPolicy = CPAxisLabelingPolicyFixedInterval;
axis.majorIntervalLength = CPDecimalFromDouble(20.0);
axis.orthogonalCoordinateDecimal = CPDecimalFromDouble(0.0);
axis.tickDirection = CPSignNone;
axis.minorTicksPerInterval = 3;
axis.majorTickLineStyle = majorLineStyle;
axis.minorTickLineStyle = minorLineStyle;
axis.axisLineStyle = majorLineStyle;
axis.majorTickLength = 5.0f;
axis.minorTickLength = 3.0f;
axis.labelTextStyle = textStyle;
axis.titleTextStyle = textStyle;
//axis.labelFormatter = numberFormatter ;
axis.majorGridLineStyle = majorGridLineStyle ;
axis.labelingPolicy = CPAxisLabelingPolicyAutomatic ;
}
-(void)applyThemeToBackground:(CPXYGraph *)graph
{
CPColor *endColor = [CPColor colorWithGenericGray:0.1f];
CPGradient *graphGradient = [CPGradient gradientWithBeginningColor:endColor endingColor:endColor];
graphGradient = [graphGradient addColorStop:[CPColor colorWithGenericGray:0.2f] atPosition:0.3f];
graphGradient = [graphGradient addColorStop:[CPColor colorWithGenericGray:0.3f] atPosition:0.5f];
graphGradient = [graphGradient addColorStop:[CPColor colorWithGenericGray:0.2f] atPosition:0.6f];
graphGradient.angle = 90.0f;
graph.fill = [CPFill fillWithGradient:graphGradient];
}
-(void)applyThemeToPlotArea:(CPPlotAreaFrame *)plotAreaFrame
{
CPGradient *gradient = [CPGradient gradientWithBeginningColor:[CPColor colorWithGenericGray:0.1f] endingColor:[CPColor colorWithGenericGray:0.3f]];
gradient.angle = 90.0f;
plotAreaFrame.fill = [CPFill fillWithGradient:gradient];
plotAreaFrame.paddingLeft = 50 ;
plotAreaFrame.paddingTop = 10 ;
plotAreaFrame.paddingRight = 20 ;
plotAreaFrame.paddingBottom = 30 ;
}
-(void)applyThemeToAxisSet:(CPXYAxisSet *)axisSet {
CPMutableLineStyle *majorLineStyle = [CPMutableLineStyle lineStyle];
majorLineStyle.lineCap = kCGLineCapSquare;
majorLineStyle.lineColor = [CPColor grayColor];
majorLineStyle.lineWidth = 2.0f;
CPMutableLineStyle *minorLineStyle = [CPMutableLineStyle lineStyle];
minorLineStyle.lineCap = kCGLineCapSquare;
minorLineStyle.lineColor = [CPColor grayColor];
minorLineStyle.lineWidth = 1.0f;
CPMutableLineStyle *majorGridLineStyle = [CPMutableLineStyle lineStyle];
majorGridLineStyle.lineWidth = 0.1f;
majorGridLineStyle.lineColor = [CPColor lightGrayColor];
CPMutableLineStyle *minorGridLineStyle = [CPMutableLineStyle lineStyle];
minorGridLineStyle.lineWidth = 0.25f;
minorGridLineStyle.lineColor = [CPColor blueColor];
CPMutableTextStyle *whiteTextStyle = [[[CPMutableTextStyle alloc] init] autorelease];
whiteTextStyle.color = [CPColor whiteColor];
whiteTextStyle.fontSize = 14.0f;
[self applyThemeToAxis:axisSet.xAxis usingMajorLineStyle:majorLineStyle minorLineStyle:minorLineStyle majorGridLineStyle:majorGridLineStyle textStyle:whiteTextStyle];
[self applyThemeToAxis:axisSet.yAxis usingMajorLineStyle:majorLineStyle minorLineStyle:minorLineStyle majorGridLineStyle:majorGridLineStyle textStyle:whiteTextStyle];
}
@end
| {'content_hash': 'f195681fad5a593d90b28cc0b575f39a', 'timestamp': '', 'source': 'github', 'line_count': 92, 'max_line_length': 170, 'avg_line_length': 36.97826086956522, 'alnum_prop': 0.7874779541446209, 'repo_name': 'celery01/celery01-drawing-plot', 'id': 'd47dd062eb325b3112c0e25fed1b7e2657e76b1e', 'size': '3569', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'examples/CPTestApp-iPhone-SpeedTest/Classes/TestXYTheme.m', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'AppleScript', 'bytes': '19207'}, {'name': 'C', 'bytes': '31148'}, {'name': 'C++', 'bytes': '14355'}, {'name': 'DTrace', 'bytes': '686'}, {'name': 'HTML', 'bytes': '912'}, {'name': 'Mathematica', 'bytes': '4410'}, {'name': 'Objective-C', 'bytes': '6178757'}, {'name': 'Objective-C++', 'bytes': '964'}, {'name': 'Python', 'bytes': '8474'}, {'name': 'Shell', 'bytes': '43285'}]} |
import spawnAsync from '@expo/spawn-async';
import path from 'path';
export async function runReactNativeCodegenAsync(
reactNativeRoot: string,
versionedReactNativeRoot: string
): Promise<void> {
const codegenCommand = path.join(reactNativeRoot, 'scripts', 'generate-specs.sh');
const jsSourceDir = path.join(reactNativeRoot, 'Libraries');
const outputDir = path.join(
versionedReactNativeRoot,
'React',
'FBReactNativeSpec',
'FBReactNativeSpec'
);
await spawnAsync(codegenCommand, [], {
cwd: reactNativeRoot,
env: {
...process.env,
SRCS_DIR: jsSourceDir,
CODEGEN_MODULES_OUTPUT_DIR: outputDir,
CODEGEN_MODULES_LIBRARY_NAME: 'FBReactNativeSpec',
},
});
}
| {'content_hash': '9ef6cc834a7731687f7111257110abce', 'timestamp': '', 'source': 'github', 'line_count': 25, 'max_line_length': 84, 'avg_line_length': 28.92, 'alnum_prop': 0.7026279391424619, 'repo_name': 'exponentjs/exponent', 'id': 'e6252d4835760d1ecff5458ccc712e0aad8d2871', 'size': '723', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'tools/src/versioning/ios/versionReactNative.ts', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'Assembly', 'bytes': '96902'}, {'name': 'Batchfile', 'bytes': '382'}, {'name': 'C', 'bytes': '896724'}, {'name': 'C++', 'bytes': '867983'}, {'name': 'CSS', 'bytes': '6732'}, {'name': 'HTML', 'bytes': '152590'}, {'name': 'IDL', 'bytes': '897'}, {'name': 'Java', 'bytes': '4588748'}, {'name': 'JavaScript', 'bytes': '9343259'}, {'name': 'Makefile', 'bytes': '8790'}, {'name': 'Objective-C', 'bytes': '10675806'}, {'name': 'Objective-C++', 'bytes': '364286'}, {'name': 'Perl', 'bytes': '5860'}, {'name': 'Prolog', 'bytes': '287'}, {'name': 'Python', 'bytes': '97564'}, {'name': 'Ruby', 'bytes': '45432'}, {'name': 'Shell', 'bytes': '6501'}]} |
namespace PatientManagement.Reservation.Models.TokenAuth
{
public class AuthenticateResultModel
{
public string AccessToken { get; set; }
public string EncryptedAccessToken { get; set; }
public int ExpireInSeconds { get; set; }
public long UserId { get; set; }
}
}
| {'content_hash': 'a9063ea41c0e3a6dc6a9ee142ece0f96', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 57, 'avg_line_length': 24.076923076923077, 'alnum_prop': 0.6549520766773163, 'repo_name': 'Magik3a/PatientManagement_Admin', 'id': '7cffb780b07d32e677612a16e231a967328c145c', 'size': '315', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'PatientManagement.Reservation/PatientManagement.Reservation.Web.Core/Models/TokenAuth/AuthenticateResultModel.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Batchfile', 'bytes': '1143'}, {'name': 'C#', 'bytes': '1630015'}, {'name': 'CSS', 'bytes': '3093746'}, {'name': 'CoffeeScript', 'bytes': '103432'}, {'name': 'Dockerfile', 'bytes': '400'}, {'name': 'HTML', 'bytes': '1276856'}, {'name': 'JavaScript', 'bytes': '14922709'}, {'name': 'Makefile', 'bytes': '1369'}, {'name': 'PHP', 'bytes': '1738'}, {'name': 'PowerShell', 'bytes': '4761'}, {'name': 'Shell', 'bytes': '3020'}, {'name': 'TypeScript', 'bytes': '407622'}]} |
from django.contrib import admin
from .models import Location, Deployment, Sensor, Reading, Token, UserAgent
class LocationAdmin(admin.ModelAdmin):
list_display = ('id', 'name', 'enabled', 'created', 'modified',)
list_filter = ('enabled',)
class DeploymentAdmin(admin.ModelAdmin):
list_display = ('id', 'name', 'location', 'enabled', 'created', 'modified',)
list_filter = ('enabled', 'location')
class SensorAdmin(admin.ModelAdmin):
list_display = ('id', 'name', 'serial_number', 'deployment', 'enabled', 'created', 'modified',)
list_filter = ('enabled', 'deployment',)
class ReadingAdmin(admin.ModelAdmin):
list_display = ('id', 'sensor', 'deployment', 'temperature', 'user_agent', 'created', 'modified',)
list_filter = ('sensor', 'deployment',)
class TokenAdmin(admin.ModelAdmin):
list_display = ('id', 'name', 'api_key', 'api_secret', 'enabled', 'created', 'modified',)
list_filter = ('enabled',)
class UserAgentAdmin(admin.ModelAdmin):
list_display = ('id', 'user_agent_string',)
admin.site.register(Location, LocationAdmin)
admin.site.register(Deployment, DeploymentAdmin)
admin.site.register(Sensor, SensorAdmin)
admin.site.register(Reading, ReadingAdmin)
admin.site.register(Token, TokenAdmin)
admin.site.register(UserAgent, UserAgentAdmin)
| {'content_hash': '63d068997654100876f4a85df110b7d7', 'timestamp': '', 'source': 'github', 'line_count': 39, 'max_line_length': 102, 'avg_line_length': 33.48717948717949, 'alnum_prop': 0.6975497702909648, 'repo_name': 'kblum/sensor-hub', 'id': '045b522d7734f80cab7d22645076df6aa0a1c1b1', 'size': '1306', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'hub/sensorhub/admin.py', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Python', 'bytes': '26160'}]} |
> A NativeScript Plugin for Android apps.
---
**This plugin is deprecated.** Feel free to use the [Image Plugin](https://github.com/Akylas/nativescript-image) for efficiently displaying images on Android and iOS in your NativeScript app. If you already have an app that use the Fresco Plugin, read the [migrate-to-image doc](https://github.com/NativeScript/nativescript-fresco/blob/master/MIGRATE-TO-IMAGE.md) for initial guidance.
---
<!-- TOC depthFrom:2 depthTo:3 -->
- [NativeScript Fresco](#nativescript-fresco)
- [What is `nativescript-fresco`?](#what-is-nativescript-fresco)
- [How to use `nativescript-fresco`?](#how-to-use-nativescript-fresco)
- [In vanila NativeScript](#in-vanila-nativescript)
- [From npm](#from-npm)
- [From local repo?](#from-local-repo)
- [In NativeScript + Angular 2](#in-nativescript--angular-2)
- [Examples](#examples)
- [Migrating from 3.x.x to 4.x.x](#migrating-from-3xx-to-4xx)
- [Features](#features)
- [Native Fresco library typings](#native-fresco-library-typings)
- [Basic attributes](#basic-attributes)
- [Advanced *optional* attributes](#advanced-optional-attributes)
- [Events](#events)
- [Event arguments](#event-arguments)
- [Cache](#cache)
- ['Refresh' the 'imageUri'](#refresh-the-imageuri)
- [Clear everything from the cache](#clear-everything-from-the-cache)
- [Evict all images with a specific URI from the cache](#evict-all-images-with-a-specific-uri-from-the-cache)
- [Manually shut down the native Fresco library](#manually-shut-down-the-native-fresco-library)
- [Sample Screenshots](#sample-screenshots)
- [Contribute](#contribute)
- [Get Help](#get-help)
<!-- /TOC -->
## What is `nativescript-fresco`?
`nativescript-fresco` is a NativeScript plugin that exposes the Fresco library used for efficiently displaying images on Android. More information about what Fresco is and how it works is available on its official website [here](https://code.facebook.com/posts/366199913563917/introducing-fresco-a-new-image-library-for-android/).
The `nativescript-fresco` plugin enables NativeScript developers to use the `FrescoDrawee` class which is extends the traditional Android ImageView component and adds the smart Fresco image management algorithms. The plugin exposes the drawee as a NativeScript view so you basically put it in the XML definition of your page and provide the URI to the image you would like to use.
## How to use `nativescript-fresco`?
### In vanila NativeScript
#### From npm
1. Go to the root folder of your {N} application where you would like to install the plugin and type `tns plugin add nativescript-fresco`.
4. Initialize `nativescript-fresco` in the `launch` event of your {N} application by using the following code:
#### From local repo?
1. Clone the repository and go to the root directory on your computer.
2. Use `tsc` to transpile the `.ts` sources: `tsc -p`.
3. Go to the root folder of your {N} application where you would like to install the plugin and type `tns plugin add <path-to-fresco-repo-dir>`.
4. Initialize `nativescript-fresco` in the `launch` event of your {N} application by using the following code:
JavaScript:
```javascript
var application = require("application");
var fresco = require("nativescript-fresco");
if (application.android) {
application.on("launch", function () {
fresco.initialize();
});
}
```
TypeScript:
```typescript
import application = require("application");
import fresco = require("nativescript-fresco");
if (application.android) {
application.on("launch", () => {
fresco.initialize();
});
}
```
> When working with "downsampling" you will need to pass a configuration to the `initialize` function:
```javascript
fresco.initialize({ isDownsampleEnabled: true });
```
Use `fresco` in the XML definition of the page as follows:
```xml
<Page
xmlns="http://www.nativescript.org/tns.xsd"
xmlns:nativescript-fresco="nativescript-fresco">
<nativescript-fresco:FrescoDrawee width="250" height="250"
imageUri="<uri-to-a-photo-from-the-web-or-a-local-resource>"/>
</Page>
```
### In NativeScript + Angular 2
1. Import the `TNSFrescoModule` from `nativescript-fresco/angular` and add it to the `imports` of your initial `@NgModule`, like shown [here](https://github.com/NativeScript/nativescript-fresco/blob/master/demo-angular/app/app.module.ts).
2. As described above make sure to initialize the `nativescript-fresco` plugin in the `launch` event of your {N} application.
## Examples
You can refer the [demo-angular](https://github.com/NativeScript/nativescript-fresco/tree/master/demo-angular) folder of the repo for runnable {N} project that demonstrates the nativescript-fresco plugin with all of its features in action.
## Migrating from 3.x.x to 4.x.x
- If you are using the `AnimatedImage` class you can continue to cast to this type just note that it is now an interface rather than a class
- If you are using the `IAnimatedImage` interface simply change all of your references to be `AnimatedImage`
- If you are using the `IImageInfo` interface simply change all of your references to be `ImageInfo`
- If you are using the `IError` interface simply change all of your references to be `FrescoError`
## Features
### Native Fresco library typings
If you find yourself in the need to access directly the native library of the nativescript-fresco plugin you can import the android.d.ts from the plugin in your `references.d.ts`:
```/// <reference path="./node_modules/nativescript-fresco/android.d.ts" />```
As documented by the Fresco library setting the **height and width** are **mandatory**, more details on this topic could be found [here](http://frescolib.org/docs/using-drawees-xml.html#height-and-width-mandatory). So the first this you should do when declaring the FrescoDrawee is set its *width* and *height* attributes or set only one of them and set the FrescoDrawee's **aspectRatio**. The width and height of the FrescoDrawee in your {N} application supports percentages which makes it possible to declare for example *width="50%"* and *aspectRatio="1.33"* achieving exactly 50% width with dynamically calculated height based on the aspect ration of the loaded image from the *imageUri*.
### Basic attributes
- **imageUri**
String value used for the image URI. You can use this property to set the image to be loaded from remote location (http, https), from the resources and local files of your {N} application.
```xml
<nativescript-fresco:FrescoDrawee imageUri="https://docs.nativescript.org/angular/img/cli-getting-started/angular/chapter0/NativeScript_logo.png"/>
```
- **placeholderImageUri**
String value used for the placeholder image URI. You can use this property to set a placeholder image loaded from the local and resources files of your {N} application.
**Note: Currently there are limitations on how many different Images can be set to as 'placeholderImage' before OutOfMemoryError is thrown. For best results its recommended to use a single image for all ```placeholderImageUri``` of your FrescoDrawee instances.*
```xml
<nativescript-fresco:FrescoDrawee placeholderImageUri="~/placeholder.jpg"/>
```
- **failureImageUri**
String value used for the failure image URI. You can use this property to set a failure image loaded from the local and resources files of your {N} application that will be shown if the loading of the imageUri is not successful.
```xml
<nativescript-fresco:FrescoDrawee failureImageUri="~/failure.jpg"/>
```
### Advanced *optional* attributes
There are a couple of *optional* attributes that could be set on the FrescoDrawee instance to achieve advanced behaviors:
- **backgroundUri**
String value used for the background image URI. Using this property has similar effect as the placeholderImageUri but the image is stretched to the size of the FrescoDrawee.
**Note: Currently there are limitations on how many different Images can be set to as 'background' before OutOfMemoryError is thrown. For best results its recommended to use a single image for all ```backgroundUri``` of your FrescoDrawee instances.*
```xml
<nativescript-fresco:FrescoDrawee backgroundUri="~/image.jpg"/>
```
- **actualImageScaleType**
String value used by FrescoDrawee image scale type. This property can be set to:
'*center*' - Performs no scaling.
'*centerCrop*' - Scales the child so that both dimensions will be greater than or equal to the corresponding dimension of the parent.
'*centerInside*' - Scales the child so that it fits entirely inside the parent.
'*fitCenter*' - Scales the child so that it fits entirely inside the parent.
'*fitStart*' - Scales the child so that it fits entirely inside the parent.
'*fitEnd*' - Scales the child so that it fits entirely inside the parent.
'*fitXY*' - Scales width and height independently, so that the child matches the parent exactly.
'*focusCrop*' - Scales the child so that both dimensions will be greater than or equal to the corresponding dimension of the parent.
```xml
<nativescript-fresco:FrescoDrawee actualImageScaleType="centerInside"/>
```
- **fadeDuration**
Number value used for the fade-in duration. This value is in milliseconds.
```xml
<nativescript-fresco:FrescoDrawee fadeDuration="3000"/>
```
- **blurRadius**
Number value greater than zero, used as input for the blur function. Larger value means slower processing. For example a value of `10` means that each pixel in the image will be blurred using all adjacent pixels up to a distance of 10.
```xml
<nativescript-fresco:FrescoDrawee blurRadius="25"/>
```
- **blurDownSampling**
Number value greater than zero, used to scale the image before applying the blur function. Larger value means faster processing. For example a value of `2` means that the image will be scaled by a factor of two before applying blur.
```xml
<nativescript-fresco:FrescoDrawee blurDownSampling="2"/>
```
- **aspectRatio**
Number value used as the aspect ratio of the image. This property is useful when you are working with different aspect ratio images and want to have a fixed Width or Height. The ratio of an image is calculated by dividing its width by its height.
*Note: In some layout scenarios it is necessary to set the ```verticalAlignment``` of the FrescoDrawee to 'top' or 'bottom' in order to "anchor" the drawee and achieve dynamic sizing.*
```xml
<nativescript-fresco:FrescoDrawee aspectRatio="1.33" verticalAlignment="top"/>
```
- **decodeWidth** (downsampling) - make sure to enable downsample (**isDownsampleEnabled**) in the initialize function of the plugin otherwise this property is disregarded.
Number value used as the downsampled width of the fresco drawable.
```xml
<nativescript-fresco:FrescoDrawee decodeWidth="100"/>
```
- **decodeHeight** (downsampling) - make sure to enable downsample (**isDownsampleEnabled**) in the initialize function of the plugin otherwise this property is disregarded.
Number value used as the downsampled width of the fresco drawable.
```xml
<nativescript-fresco:FrescoDrawee decodeHeight="100"/>
```
- **progressiveRenderingEnabled**
Boolean value used for enabling or disabling the streaming of progressive JPEG images. This property is set to 'false' by default. Setting this property to 'true' while loading JPEG images not encoded in progressive format will lead to a standard loading of those images.
```xml
<nativescript-fresco:FrescoDrawee progressiveRenderingEnabled="true"/>
```
- **showProgressBar**
Boolean value used for showing or hiding the progress bar.
```xml
<nativescript-fresco:FrescoDrawee showProgressBar="true"/>
```
- **progressBarColor**
String value used for setting the color of the progress bar. You can set it to hex values ("*#FF0000*") and/or predefined colors ("*green*").
```xml
<nativescript-fresco:FrescoDrawee progressBarColor="blue"/>
```
- **roundAsCircle**
Boolean value used for determining if the image will be rounded as a circle. Its default value is false. If set to true the image will be rounder to a circle.
```xml
<nativescript-fresco:FrescoDrawee roundAsCircle="true"/>
```
- **roundedCornerRadius**
Number value used as radius for rounding the image's corners.
```xml
<nativescript-fresco:FrescoDrawee roundedCornerRadius="50"/>
```
- **roundBottomRight**
Boolean value used for determining if the image's bottom right corner will be rounded. The *roundedCornerRadius* is used as the rounding radius.
```xml
<nativescript-fresco:FrescoDrawee roundBottomRight="true"/>
```
- **roundBottomLeft**
Boolean value used for determining if the image's bottom left corner will be rounded. The *roundedCornerRadius* is used as the rounding radius.
```xml
<nativescript-fresco:FrescoDrawee roundBottomLeft="true"/>
```
- **roundTopLeft**
Boolean value used for determining if the image's top left corner will be rounded. The *roundedCornerRadius* is used as the rounding radius.
```xml
<nativescript-fresco:FrescoDrawee roundTopLeft="true"/>
```
- **roundTopRight**
Boolean value used for determining if the image's top right corner should be rounded. The *roundedCornerRadius* is used as the rounding radius.
```xml
<nativescript-fresco:FrescoDrawee roundTopRight="true"/>
```
- **autoPlayAnimations**
Boolean value used for enabling the automatic playing of animated images. Note that rounding of such images is not supported and will be ignored.
```xml
<nativescript-fresco:FrescoDrawee autoPlayAnimations="true"/>
```
- **tapToRetryEnabled**
Boolean value used for enabling/disabling a tap to retry action for the download of the FrescoDrawee image.
```xml
<nativescript-fresco:FrescoDrawee tapToRetryEnabled="true"/>
```
### Events
- **finalImageSet** - arguments *FinalEventData*
This event is fired after the final image has been set. When working with animated images you could use this event to start the animation by calling the *FinalEventData.animatable.start()* function.
```xml
<nativescript-fresco:FrescoDrawee finalImageSet="onFinalImageSet"/>
```
JavaScript:
```javascript
function onFinalImageSet(args) {
var frescoEventData = args;
var drawee = frescoEventData.object;
}
exports.onFinalImageSet = onFinalImageSet;
```
TypeScript:
```typescript
import {FrescoDrawee, FinalEventData } from "nativescript-fresco";
export function onFinalImageSet(args: FinalEventData) {
var drawee = args.object as FrescoDrawee;
}
```
- **failure** - arguments *FailureEventData*
This event is fired after the fetch of the final image failed.
```xml
<nativescript-fresco:FrescoDrawee failure="onFailure"/>
```
JavaScript:
```javascript
function onFailure(args) {
var drawee = args.object;
}
exports.onFailure = onFailure;
```
TypeScript:
```typescript
import {FrescoDrawee, FailureEventData } from "nativescript-fresco";
export function onFailure(args: FailureEventData) {
var drawee = args.object as FrescoDrawee;
}
```
- **intermediateImageSet** - arguments *IntermediateEventData*
This event is fired after any intermediate image has been set.
```xml
<nativescript-fresco:FrescoDrawee intermediateImageSet="onIntermediateImageSet"/>
```
JavaScript:
```javascript
function onIntermediateImageSet(args) {
var drawee = args.object;
}
exports.onIntermediateImageSet = onIntermediateImageSet;
```
TypeScript:
```typescript
import {FrescoDrawee, IntermediateEventData } from "nativescript-fresco";
export function onIntermediateImageSet(args: IntermediateEventData) {
var drawee = args.object as FrescoDrawee;
}
```
- **intermediateImageFailed** - arguments *FailureEventData*
This event is fired after the fetch of the intermediate image failed.
```xml
<nativescript-fresco:FrescoDrawee intermediateImageFailed="onIntermediateImageFailed"/>
```
JavaScript:
```javascript
function intermediateImageFailed(args) {
var drawee = args.object;
}
exports.intermediateImageFailed = intermediateImageFailed;
```
TypeScript:
```typescript
import {FrescoDrawee, FailureEventData } from "nativescript-fresco";
export function intermediateImageFailed(args: FailureEventData) {
var drawee = args.object as FrescoDrawee;
}
```
- **submit** - arguments *EventData*
This event is fired before the image request is submitted.
```xml
<nativescript-fresco:FrescoDrawee submit="onSubmit"/>
```
JavaScript:
```javascript
function onSubmit(args) {
var drawee = args.object;
}
exports.onSubmit = onSubmit;
```
TypeScript:
```typescript
import {FrescoDrawee, EventData } from "nativescript-fresco";
export function onSubmit(args: EventData) {
var drawee = args.object as FrescoDrawee;
}
```
- **release** - arguments *EventData*
This event is fired after the controller released the fetched image.
```xml
<nativescript-fresco:FrescoDrawee release="onRelease"/>
```
JavaScript:
```javascript
function onRelease(args) {
var drawee = args.object;
}
exports.onRelease = onRelease;
```
TypeScript:
```typescript
import {FrescoDrawee, EventData } from "nativescript-fresco";
export function onRelease(args: EventData) {
var drawee = args.object as FrescoDrawee;
}
```
#### Event arguments
All events exposed by 'nativescript-fresco' provide additional information to their handlers that is needed to properly handle them. Here's a brief description of the event arguments coming with each of the events:
- **FinalEventData**
Instances of this class are provided to the handlers of the *finalImageSet*.
```typescript
import {FrescoDrawee, FinalEventData, ImageInfo, AnimatedImage } from "nativescript-fresco";
export function onFinalImageSet(args: FinalEventData) {
var info: ImageInfo = args.imageInfo;
var animatable: AnimatedImage = args.animatable;
var quality: number = info.getQualityInfo().getQuality();
var isFullQuality: boolean = info.getQualityInfo().isOfFullQuality();
var isOfGoodEnoughQuality: boolean = info.getQualityInfo().isOfGoodEnoughQuality();
}
```
- **FailureEventData**
Instances of this class are provided to the handlers of the *failure* and *intermediateImageFailed*.
```typescript
import {FrescoDrawee, FailureEventData, FrescoError } from "nativescript-fresco";
export function onFailure(args: FailureEventData) {
var error: FrescoError = args.error;
var message: string = error.getMessage();
var type: string = error.getErrorType();
var fullError: string = error.toString();
}
```
- **IntermediateEventData**
Instances of this class are provided to the handlers of the *intermediateImageSet*.
```typescript
import {FrescoDrawee, IntermediateEventData, ImageInfo } from "nativescript-fresco";
export function onIntermediateImageSet(args: IntermediateEventData) {
var info: ImageInfo = args.imageInfo;
var quality: number = info.getQualityInfo().getQuality();
var isFullQuality: boolean = info.getQualityInfo().isOfFullQuality();
var isOfGoodEnoughQuality: boolean = info.getQualityInfo().isOfGoodEnoughQuality();}
```
- **EventData**
Instances of this class are provided to the handlers of the *release* and *submit*.
```typescript
import {FrescoDrawee, EventData } from "nativescript-fresco";
export function onSubmit(args: EventData) {
var drawee = args.object as FrescoDrawee;
}
```
### Cache
The nativescript-fresco {N} plugin has built-in cache mechanism which handles managing the images in the memory. There are two types of cache mechanisms `memory` and `disk`, you can manually manage both of them with the following functionality.
#### 'Refresh' the 'imageUri'
Not so rarely you may have a scenario where the actual image on your remote service from the `imageUri` of the `FrescoDrawee` has changed but the {N} app already has an image in its internal cache. In such scenario you can easily 'refresh' the `imageUri` by calling the `updateImageUri()`:
```
// 'drawee' is the instance the 'FrescoDrawee' in the project.
drawee.updateImageUri();
```
#### Clear everything from the cache
Managing the caches in nativescript-fresco is done via the `ImagePipeline`. In order to get the reference of the ImagePipeline simply call the `getImagePipeline()` function:
```
var frescoModel = require("nativescript-fresco");
var imagePipeLine = frescoModel.getImagePipeline();
```
- Clear both the memory and disk caches
```
imagePipeLine.clearCaches();
```
- Clear the memory cache
```
imagePipeLine.clearMemoryCaches();
```
- Clear the disk cache
```
imagePipeLine.clearDiskCaches();
```
#### Evict all images with a specific URI from the cache
If clearing the entire cache is not what you desired, you can clear only the images linked with a specific URI (`imageUri`). Evicting is done again via the ImagePipeline:
```
var frescoModel = require("nativescript-fresco");
var imagePipeLine = frescoModel.getImagePipeline();
```
- Evict URI from both the memory and disk caches
```
imagePipeLine.evictFromCache("<uri-to-a-photo-from-the-web>");
```
- Evict URI from the memory cache
```
imagePipeLine.evictFromMemoryCache("<uri-to-a-photo-from-the-web>");
```
- Evict URI from the disk cache
```
imagePipeLine.evictFromDiskCache("<uri-to-a-photo-from-the-web>");
```
#### Manually shut down the native Fresco library
In very very rare occasions the native Android Fresco library may experience strange memory leak issues, in such scenarios as a last resort you may want to "shut down" the library forcing all of the managed memory to possibly be released. You can do that by calling the `shutDown` function exposed by the nativescript-fresco module, one good application lifecycle event to call it inside may be in the `exit` event of the application:
```javascript
import * as app from "application";
import * as frescoModule from "nativescript-fresco";
if (app.android) {
app.on(app.exitEvent, (args) => {
frescoModule.shutDown();
});
}
```
## Sample Screenshots
All of the images are sample images for showcasing purposes.
Sample 1 - Placeholder image | Sample 2 - Transition (fade-in animation)
-------- | ---------
 | 
Sample 3 - Image shown successfully from imageUri | Sample 4 - 'Failure' image shown
-------- | ---------
 | 
## Contribute
We love PRs! Check out the [contributing guidelines](CONTRIBUTING.md). If you want to contribute, but you are not sure where to start - look for [issues labeled `help wanted`](https://github.com/NativeScript/nativescript-fresco/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22).
## Get Help
Please, use [github issues](https://github.com/NativeScript/nativescript-fresco/issues) strictly for [reporting bugs](CONTRIBUTING.md#reporting-bugs) or [requesting features](CONTRIBUTING.md#requesting-new-features). For general questions and support, check out [Stack Overflow](https://stackoverflow.com/questions/tagged/nativescript) or ask our experts in [NativeScript community Slack channel](http://developer.telerik.com/wp-login.php?action=slack-invitation).

| {'content_hash': '77169f46247b436ad00ce052fc45f417', 'timestamp': '', 'source': 'github', 'line_count': 650, 'max_line_length': 692, 'avg_line_length': 35.92, 'alnum_prop': 0.7533407572383074, 'repo_name': 'NativeScript/nativescript-fresco', 'id': '658765f64adcc9e01d5984828741a7c9801b4ba6', 'size': '23371', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'README.md', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '57'}, {'name': 'HTML', 'bytes': '517'}, {'name': 'Shell', 'bytes': '1350'}, {'name': 'TypeScript', 'bytes': '44110'}]} |
CFLAGS += -Wall -W -pipe -O2 -std=gnu99
all: clean native
release: native windows
$(STRIP_NATIVE) *.bin
$(STRIP_WINDOWS) *.exe
mv *.bin ../bin
mv *.exe ../bin
cp -a *.pl ../bin
clean:
rm -f ../bin/*
rm -f *.bin *.exe
##
## native
##
CC ?= gcc
CC_NATIVE = $(CC)
STRIP_NATIVE = strip
CFLAGS_NATIVE = $(CFLAGS)
LDFLAGS_NATIVE = $(LDFLAGS)
native:
${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o cap2hccapx.bin cap2hccapx.c
${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o cleanup-rules.bin cleanup-rules.c
${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o combinator.bin combinator.c
${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o combinator3.bin combinator3.c
${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o combipow.bin combipow.c
${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o ct3_to_ntlm.bin ct3_to_ntlm.c
${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o cutb.bin cutb.c
${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o expander.bin expander.c
${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o gate.bin gate.c
${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o generate-rules.bin generate-rules.c
${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o hcstatgen.bin hcstatgen.c
${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o hcstat2gen.bin hcstat2gen.c
${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o keyspace.bin keyspace.c
${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o len.bin len.c
${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o mli2.bin mli2.c
${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o morph.bin morph.c
${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o permute.bin permute.c
${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o permute_exist.bin permute_exist.c
${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o prepare.bin prepare.c
${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o req-include.bin req-include.c
${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o req-exclude.bin req-exclude.c
${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o rli.bin rli.c
${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o rli2.bin rli2.c
${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o rules_optimize.bin rules_optimize.c cpu_rules.c
${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o splitlen.bin splitlen.c
${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o strip-bsr.bin strip-bsr.c
${CC_NATIVE} ${CFLAGS_NATIVE} ${LDFLAGS_NATIVE} -o strip-bsn.bin strip-bsn.c
##
## WINDOWS
##
CC_WINDOWS = x86_64-w64-mingw32-gcc
STRIP_WINDOWS = x86_64-w64-mingw32-strip
CFLAGS_WINDOWS = $(CFLAGS) -D_WINDOWS
GLOB_WINDOWS = /usr/x86_64-w64-mingw32/lib/CRT_glob.o
windows:
${CC_WINDOWS} ${CFLAGS_WINDOWS} -o cap2hccapx.exe cap2hccapx.c
${CC_WINDOWS} ${CFLAGS_WINDOWS} -o cleanup-rules.exe cleanup-rules.c
${CC_WINDOWS} ${CFLAGS_WINDOWS} -o combinator.exe combinator.c
${CC_WINDOWS} ${CFLAGS_WINDOWS} -o combinator3.exe combinator3.c
${CC_WINDOWS} ${CFLAGS_WINDOWS} -o combipow.exe combipow.c
${CC_WINDOWS} ${CFLAGS_WINDOWS} -o ct3_to_ntlm.exe ct3_to_ntlm.c
${CC_WINDOWS} ${CFLAGS_WINDOWS} -o cutb.exe cutb.c
${CC_WINDOWS} ${CFLAGS_WINDOWS} -o expander.exe expander.c
${CC_WINDOWS} ${CFLAGS_WINDOWS} -o gate.exe gate.c
${CC_WINDOWS} ${CFLAGS_WINDOWS} -o generate-rules.exe generate-rules.c
${CC_WINDOWS} ${CFLAGS_WINDOWS} -o hcstatgen.exe hcstatgen.c
${CC_WINDOWS} ${CFLAGS_WINDOWS} -o hcstat2gen.exe hcstat2gen.c
${CC_WINDOWS} ${CFLAGS_WINDOWS} -o keyspace.exe keyspace.c
${CC_WINDOWS} ${CFLAGS_WINDOWS} -o len.exe len.c
${CC_WINDOWS} ${CFLAGS_WINDOWS} -o mli2.exe mli2.c
${CC_WINDOWS} ${CFLAGS_WINDOWS} -o morph.exe morph.c
${CC_WINDOWS} ${CFLAGS_WINDOWS} -o permute.exe permute.c
${CC_WINDOWS} ${CFLAGS_WINDOWS} -o permute_exist.exe permute_exist.c
${CC_WINDOWS} ${CFLAGS_WINDOWS} -o prepare.exe prepare.c
${CC_WINDOWS} ${CFLAGS_WINDOWS} -o req-include.exe req-include.c
${CC_WINDOWS} ${CFLAGS_WINDOWS} -o req-exclude.exe req-exclude.c
${CC_WINDOWS} ${CFLAGS_WINDOWS} -o rli.exe rli.c ${GLOB_WINDOWS}
${CC_WINDOWS} ${CFLAGS_WINDOWS} -o rli2.exe rli2.c
${CC_WINDOWS} ${CFLAGS_WINDOWS} -o rules_optimize.exe rules_optimize.c cpu_rules.c
${CC_WINDOWS} ${CFLAGS_WINDOWS} -o splitlen.exe splitlen.c
${CC_WINDOWS} ${CFLAGS_WINDOWS} -o strip-bsr.exe strip-bsr.c
${CC_WINDOWS} ${CFLAGS_WINDOWS} -o strip-bsn.exe strip-bsn.c
| {'content_hash': '01bc639b51d49bd3d074a5d11ee0df08', 'timestamp': '', 'source': 'github', 'line_count': 91, 'max_line_length': 99, 'avg_line_length': 47.7032967032967, 'alnum_prop': 0.6931582584657913, 'repo_name': 'philsmd/hashcat-utils', 'id': '8a42c47627c73d845ae07546e042f51f7b391735', 'size': '4361', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/Makefile', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C', 'bytes': '194371'}, {'name': 'Makefile', 'bytes': '4361'}, {'name': 'Perl', 'bytes': '7826'}]} |
<html lang="en">
<head>
<title>Classes - GNU Compiler Collection (GCC) Internals</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
<meta name="generator" content="makeinfo 4.11">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="C-and-C_002b_002b-Trees.html#C-and-C_002b_002b-Trees" title="C and C++ Trees">
<link rel="prev" href="Namespaces.html#Namespaces" title="Namespaces">
<link rel="next" href="Functions-for-C_002b_002b.html#Functions-for-C_002b_002b" title="Functions for C++">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<!--
Copyright (C) 1988-2014 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
Invariant Sections being ``Funding Free Software'', the Front-Cover
Texts being (a) (see below), and with the Back-Cover Texts being (b)
(see below). A copy of the license is included in the section entitled
``GNU Free Documentation License''.
(a) The FSF's Front-Cover Text is:
A GNU Manual
(b) The FSF's Back-Cover Text is:
You have freedom to copy and modify this GNU Manual, like GNU
software. Copies published by the Free Software Foundation raise
funds for GNU development.-->
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
--></style>
</head>
<body>
<div class="node">
<p>
<a name="Classes"></a>
Next: <a rel="next" accesskey="n" href="Functions-for-C_002b_002b.html#Functions-for-C_002b_002b">Functions for C++</a>,
Previous: <a rel="previous" accesskey="p" href="Namespaces.html#Namespaces">Namespaces</a>,
Up: <a rel="up" accesskey="u" href="C-and-C_002b_002b-Trees.html#C-and-C_002b_002b-Trees">C and C++ Trees</a>
<hr>
</div>
<h4 class="subsection">10.10.3 Classes</h4>
<p><a name="index-class_002c-scope-2023"></a><a name="index-RECORD_005fTYPE-2024"></a><a name="index-UNION_005fTYPE-2025"></a><a name="index-CLASSTYPE_005fDECLARED_005fCLASS-2026"></a><a name="index-TYPE_005fBINFO-2027"></a><a name="index-BINFO_005fTYPE-2028"></a><a name="index-TYPE_005fFIELDS-2029"></a><a name="index-TYPE_005fVFIELD-2030"></a><a name="index-TYPE_005fMETHODS-2031"></a>
Besides namespaces, the other high-level scoping construct in C++ is the
class. (Throughout this manual the term <dfn>class</dfn> is used to mean the
types referred to in the ANSI/ISO C++ Standard as classes; these include
types defined with the <code>class</code>, <code>struct</code>, and <code>union</code>
keywords.)
<p>A class type is represented by either a <code>RECORD_TYPE</code> or a
<code>UNION_TYPE</code>. A class declared with the <code>union</code> tag is
represented by a <code>UNION_TYPE</code>, while classes declared with either
the <code>struct</code> or the <code>class</code> tag are represented by
<code>RECORD_TYPE</code>s. You can use the <code>CLASSTYPE_DECLARED_CLASS</code>
macro to discern whether or not a particular type is a <code>class</code> as
opposed to a <code>struct</code>. This macro will be true only for classes
declared with the <code>class</code> tag.
<p>Almost all non-function members are available on the <code>TYPE_FIELDS</code>
list. Given one member, the next can be found by following the
<code>TREE_CHAIN</code>. You should not depend in any way on the order in
which fields appear on this list. All nodes on this list will be
‘<samp><span class="samp">DECL</span></samp>’ nodes. A <code>FIELD_DECL</code> is used to represent a non-static
data member, a <code>VAR_DECL</code> is used to represent a static data
member, and a <code>TYPE_DECL</code> is used to represent a type. Note that
the <code>CONST_DECL</code> for an enumeration constant will appear on this
list, if the enumeration type was declared in the class. (Of course,
the <code>TYPE_DECL</code> for the enumeration type will appear here as well.)
There are no entries for base classes on this list. In particular,
there is no <code>FIELD_DECL</code> for the “base-class portion” of an
object.
<p>The <code>TYPE_VFIELD</code> is a compiler-generated field used to point to
virtual function tables. It may or may not appear on the
<code>TYPE_FIELDS</code> list. However, back ends should handle the
<code>TYPE_VFIELD</code> just like all the entries on the <code>TYPE_FIELDS</code>
list.
<p>The function members are available on the <code>TYPE_METHODS</code> list.
Again, subsequent members are found by following the <code>TREE_CHAIN</code>
field. If a function is overloaded, each of the overloaded functions
appears; no <code>OVERLOAD</code> nodes appear on the <code>TYPE_METHODS</code>
list. Implicitly declared functions (including default constructors,
copy constructors, assignment operators, and destructors) will appear on
this list as well.
<p>Every class has an associated <dfn>binfo</dfn>, which can be obtained with
<code>TYPE_BINFO</code>. Binfos are used to represent base-classes. The
binfo given by <code>TYPE_BINFO</code> is the degenerate case, whereby every
class is considered to be its own base-class. The base binfos for a
particular binfo are held in a vector, whose length is obtained with
<code>BINFO_N_BASE_BINFOS</code>. The base binfos themselves are obtained
with <code>BINFO_BASE_BINFO</code> and <code>BINFO_BASE_ITERATE</code>. To add a
new binfo, use <code>BINFO_BASE_APPEND</code>. The vector of base binfos can
be obtained with <code>BINFO_BASE_BINFOS</code>, but normally you do not need
to use that. The class type associated with a binfo is given by
<code>BINFO_TYPE</code>. It is not always the case that <code>BINFO_TYPE
(TYPE_BINFO (x))</code>, because of typedefs and qualified types. Neither is
it the case that <code>TYPE_BINFO (BINFO_TYPE (y))</code> is the same binfo as
<code>y</code>. The reason is that if <code>y</code> is a binfo representing a
base-class <code>B</code> of a derived class <code>D</code>, then <code>BINFO_TYPE
(y)</code> will be <code>B</code>, and <code>TYPE_BINFO (BINFO_TYPE (y))</code> will be
<code>B</code> as its own base-class, rather than as a base-class of <code>D</code>.
<p>The access to a base type can be found with <code>BINFO_BASE_ACCESS</code>.
This will produce <code>access_public_node</code>, <code>access_private_node</code>
or <code>access_protected_node</code>. If bases are always public,
<code>BINFO_BASE_ACCESSES</code> may be <code>NULL</code>.
<p><code>BINFO_VIRTUAL_P</code> is used to specify whether the binfo is inherited
virtually or not. The other flags, <code>BINFO_MARKED_P</code> and
<code>BINFO_FLAG_1</code> to <code>BINFO_FLAG_6</code> can be used for language
specific use.
<p>The following macros can be used on a tree node representing a class-type.
<dl>
<dt><code>LOCAL_CLASS_P</code><a name="index-LOCAL_005fCLASS_005fP-2032"></a><dd>This predicate holds if the class is local class <em>i.e.</em> declared
inside a function body.
<br><dt><code>TYPE_POLYMORPHIC_P</code><a name="index-TYPE_005fPOLYMORPHIC_005fP-2033"></a><dd>This predicate holds if the class has at least one virtual function
(declared or inherited).
<br><dt><code>TYPE_HAS_DEFAULT_CONSTRUCTOR</code><a name="index-TYPE_005fHAS_005fDEFAULT_005fCONSTRUCTOR-2034"></a><dd>This predicate holds whenever its argument represents a class-type with
default constructor.
<br><dt><code>CLASSTYPE_HAS_MUTABLE</code><a name="index-CLASSTYPE_005fHAS_005fMUTABLE-2035"></a><dt><code>TYPE_HAS_MUTABLE_P</code><a name="index-TYPE_005fHAS_005fMUTABLE_005fP-2036"></a><dd>These predicates hold for a class-type having a mutable data member.
<br><dt><code>CLASSTYPE_NON_POD_P</code><a name="index-CLASSTYPE_005fNON_005fPOD_005fP-2037"></a><dd>This predicate holds only for class-types that are not PODs.
<br><dt><code>TYPE_HAS_NEW_OPERATOR</code><a name="index-TYPE_005fHAS_005fNEW_005fOPERATOR-2038"></a><dd>This predicate holds for a class-type that defines
<code>operator new</code>.
<br><dt><code>TYPE_HAS_ARRAY_NEW_OPERATOR</code><a name="index-TYPE_005fHAS_005fARRAY_005fNEW_005fOPERATOR-2039"></a><dd>This predicate holds for a class-type for which
<code>operator new[]</code> is defined.
<br><dt><code>TYPE_OVERLOADS_CALL_EXPR</code><a name="index-TYPE_005fOVERLOADS_005fCALL_005fEXPR-2040"></a><dd>This predicate holds for class-type for which the function call
<code>operator()</code> is overloaded.
<br><dt><code>TYPE_OVERLOADS_ARRAY_REF</code><a name="index-TYPE_005fOVERLOADS_005fARRAY_005fREF-2041"></a><dd>This predicate holds for a class-type that overloads
<code>operator[]</code>
<br><dt><code>TYPE_OVERLOADS_ARROW</code><a name="index-TYPE_005fOVERLOADS_005fARROW-2042"></a><dd>This predicate holds for a class-type for which <code>operator-></code> is
overloaded.
</dl>
</body></html>
| {'content_hash': 'b95fe87e5d7aea3010f7abc7999517be', 'timestamp': '', 'source': 'github', 'line_count': 163, 'max_line_length': 388, 'avg_line_length': 58.20858895705521, 'alnum_prop': 0.7356661045531198, 'repo_name': 'trfiladelfo/tdk', 'id': 'd71db9e332c05a2a765f12dd093054f84e901c7e', 'size': '9488', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'gcc-arm-none-eabi/share/doc/gcc-arm-none-eabi/html/gccint/Classes.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Assembly', 'bytes': '614531'}, {'name': 'Batchfile', 'bytes': '101839'}, {'name': 'C', 'bytes': '12540389'}, {'name': 'C++', 'bytes': '13332391'}, {'name': 'CSS', 'bytes': '140569'}, {'name': 'HTML', 'bytes': '23954553'}, {'name': 'Logos', 'bytes': '8877'}, {'name': 'Makefile', 'bytes': '129672'}, {'name': 'Perl', 'bytes': '9844'}, {'name': 'Python', 'bytes': '180880'}, {'name': 'Scheme', 'bytes': '3970'}, {'name': 'Shell', 'bytes': '10777'}, {'name': 'Tcl', 'bytes': '128365'}, {'name': 'XC', 'bytes': '8384'}, {'name': 'XS', 'bytes': '8334'}, {'name': 'XSLT', 'bytes': '221100'}]} |
package com.fasterxml.jackson.failing;
import java.math.BigDecimal;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.databind.*;
public class RecursiveIgnoreProperties1755Test extends BaseMapTest
{
// for [databind#1755]
static class JackBase1755 {
public String id;
}
static class JackExt extends JackBase1755 {
public BigDecimal quantity;
public String ignoreMe;
@JsonIgnoreProperties({"ignoreMe"})
public List<JackExt> linked;
public List<KeyValue> metadata;
}
static class KeyValue {
public String key;
public String value;
}
// for [databind#1755]
private final ObjectMapper MAPPER = newJsonMapper();
public void testRecursiveIgnore1755() throws Exception
{
final String JSON = a2q("{\n"
+"'id': '1',\n"
+"'quantity': 5,\n"
+"'ignoreMe': 'yzx',\n"
+"'metadata': [\n"
+" {\n"
+" 'key': 'position',\n"
+" 'value': '2'\n"
+" }\n"
+" ],\n"
+"'linked': [\n"
+" {\n"
+" 'id': '1',\n"
+" 'quantity': 5,\n"
+" 'ignoreMe': 'yzx',\n"
+" 'metadata': [\n"
+" {\n"
+" 'key': 'position',\n"
+" 'value': '2'\n"
+" }\n"
+" ]\n"
+" }\n"
+" ]\n"
+"}");
JackExt value = MAPPER.readValue(JSON, JackExt.class);
assertNotNull(value);
}
}
| {'content_hash': 'd7bfc871d5ddededb24f9b3cfb14baef', 'timestamp': '', 'source': 'github', 'line_count': 65, 'max_line_length': 66, 'avg_line_length': 28.26153846153846, 'alnum_prop': 0.43331518780620576, 'repo_name': 'FasterXML/jackson-databind', 'id': '9af1d5fd558048f8f395bfd126ff6481a44a7c9e', 'size': '1837', 'binary': False, 'copies': '1', 'ref': 'refs/heads/2.15', 'path': 'src/test/java/com/fasterxml/jackson/failing/RecursiveIgnoreProperties1755Test.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '7940640'}, {'name': 'Logos', 'bytes': '173041'}, {'name': 'Shell', 'bytes': '264'}]} |
FROM richarvey/nginx-php-fpm:stable
LABEL Description="Contains basic setup for NGINX-PHP-FPM setup" Vendor="Exclusive Home Production" Version="1.0"
COPY ./default.dev.vhost.conf /etc/nginx/sites-available/default.conf | {'content_hash': '626348e3b4266e7bfad8fe020066d8c1', 'timestamp': '', 'source': 'github', 'line_count': 5, 'max_line_length': 113, 'avg_line_length': 44.2, 'alnum_prop': 0.8009049773755657, 'repo_name': 'bravepickle/docktor-project-base-php', 'id': '2bf9cd4bfdab8770df96d5c1d56b7a05dc5b425c', 'size': '221', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'etc/docker/nginx-php/Dockerfile', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'HTML', 'bytes': '3171'}, {'name': 'PHP', 'bytes': '158'}, {'name': 'Puppet', 'bytes': '10825'}, {'name': 'Ruby', 'bytes': '3271'}, {'name': 'Shell', 'bytes': '2734'}]} |
<?php
namespace common\components;
use \CAuthItem;
/**
* CDbAuthManager represents an authorization manager that stores authorization information in database.
*
* The database connection is specified by {@link connectionID}. And the database schema
* should be as described in "framework/web/auth/*.sql". You may change the names of
* the three tables used to store the authorization data by setting {@link itemTable},
* {@link itemChildTable} and {@link assignmentTable}.
*
* @property array $authItems The authorization items of the specific type.
*
* @author Vadim Buchinsky <[email protected]>
* @since 0.1
*/
class CDbAuthManager extends \CDbAuthManager {
/*
* @inheritdoc
*/
public $connectionID='db';
/**
* @inheritdoc
*/
public $itemTable='{{rbac_item}}';
/*
* @inheritdoc
*/
public $itemChildTable='{{rbac_item_child}}';
/**
* @inheritdoc
*/
public $assignmentTable='{{rbac_assignment}}';
/**
* @inheritdoc
*/
public $defaultRoles=array('guest');
/**
* @var int ID of view.
*/
protected $_view;
/**
* @var int ID of entity.
*/
protected $_entity;
/**
* @param int $id of view
* @return \common\components\CDbAuthManager
*/
public function setView($id){
$this->_view = $id;
return $this;
}
/**
* @param int $id of entity
* @return \common\components\CDbAuthManager
*/
public function setEntity($id){
$this->_entity = $id;
return $this;
}
/**
* @inheritdoc
*/
public function init()
{
parent::init();
/*
* @TODO: Замерить на Entity компонент
*/
$sql = 'show tables like "jim_rbac_item"';
$return = $this->db->createCommand($sql)->queryAll();
if (empty($return)){
$this->deployRbacItem();
$this->deployRbacItemChild();
$this->deployRbacAssignment();
$this->_view = 1;
$this->_entity = 1;
$this->createAuthItem('backend.access',0);
$this->createAuthItem('backend.index',0);
$this->createAuthItem('supervisor',2);
$this->addItemChild('supervisor','backend.access');
$this->addItemChild('supervisor','backend.index');
}
}
/**
* @inheritdoc
*/
public function createAuthItem($name,$type,$description='',$bizRule=null,$data=null)
{
$this->db->createCommand()
->insert($this->itemTable, array(
'name'=>$name,
'view_id' => $this->_view,
'entity_id' => $this->_entity,
'type'=>$type,
'description'=>$description,
'bizrule'=>$bizRule,
'data'=>serialize($data)
));
return new CAuthItem($this,$name,$type,$description,$bizRule,$data);
}
private function deployRbacItem()
{
$this->db->createCommand()->createTable(
'{{rbac_item}}',
array(
'name' => 'varchar(64) NOT NULL',
'view_id' => 'int(11) NOT NULL',
'entity_id' => 'int(11) NOT NULL',
'type' => 'int(11) NOT NULL COMMENT \'0 - OPERATION; 1 - TASK; 2 - ROLE;\'',
'description' => 'text DEFAULT NULL',
'bizrule' => 'text DEFAULT NULL',
'data' => 'text DEFAULT NULL',
),
'ENGINE = INNODB CHARACTER SET utf8 COLLATE utf8_general_ci;'
);
$this->db->createCommand()->addPrimaryKey('PK','{{rbac_item}}','name');
$this->db->createCommand()->createIndex('IDX_{{rbac_item}}_type','{{entity}}','type');
$this->db->createCommand()->addForeignKey("FK_{{rbac_item}}_view_id", '{{rbac_item}}', 'view_id', '{{view}}', 'view_id', 'NO ACTION', 'NO ACTION');
$this->db->createCommand()->addForeignKey("FK_{{rbac_item}}_entity_id", '{{rbac_item}}', 'entity_id', '{{entity}}', 'entity_id', 'NO ACTION', 'NO ACTION');
}
private function deployRbacItemChild()
{
$this->db->createCommand()->createTable(
'{{rbac_item_child}}',
array(
'parent' => 'varchar(64) NOT NULL',
'child' => 'varchar(64) NOT NULL',
),
'ENGINE = INNODB CHARACTER SET utf8 COLLATE utf8_general_ci;'
);
$this->db->createCommand()->addPrimaryKey('PK','{{rbac_item_child}}','parent, child');
$this->db->createCommand()->createIndex('IDX_{{rbac_item_child}}_child','{{rbac_item_child}}','child');
$this->db->createCommand()->addForeignKey("FK_{{rbac_item_child}}_parent", '{{rbac_item_child}}', 'parent', '{{rbac_item}}', 'name', 'CASCADE', 'CASCADE');
$this->db->createCommand()->addForeignKey("FK_{{rbac_item_child}}_child", '{{rbac_item_child}}', 'child', '{{rbac_item}}', 'name', 'CASCADE', 'CASCADE');
}
private function deployRbacAssignment()
{
$this->db->createCommand()->createTable(
'{{rbac_assignment}}',
array(
'itemname' => 'varchar(64) NOT NULL',
'userid' => 'int(11) NOT NULL',
'bizrule' => 'text DEFAULT NULL',
'data' => 'text DEFAULT NULL',
),
'ENGINE = INNODB CHARACTER SET utf8 COLLATE utf8_general_ci;'
);
$this->db->createCommand()->addPrimaryKey('PK','{{rbac_assignment}}','itemname, userid');
$this->db->createCommand()->createIndex('IDX_{{rbac_assignment}}_itemname','{{rbac_assignment}}','itemname');
$this->db->createCommand()->createIndex('IDX_{{rbac_assignment}}_userid','{{rbac_assignment}}','userid');
$this->db->createCommand()->addForeignKey("FK_{{rbac_assignment}}_itemname", '{{rbac_assignment}}', 'itemname', '{{rbac_item}}', 'name', 'CASCADE', 'CASCADE');
}
} | {'content_hash': '0e6859d2445e45485e6dcc9f26749449', 'timestamp': '', 'source': 'github', 'line_count': 182, 'max_line_length': 167, 'avg_line_length': 32.79120879120879, 'alnum_prop': 0.5410522788203753, 'repo_name': 'phpjim/cmf-old', 'id': '6ff6f6a35f8efe4d24ff3dd7e35cffdb23888af4', 'size': '6191', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'core/common/components/CDbAuthManager.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '185347'}, {'name': 'JavaScript', 'bytes': '366930'}, {'name': 'PHP', 'bytes': '123001'}, {'name': 'Shell', 'bytes': '380'}]} |
package o;
import java.io.IOException;
import java.net.Socket;
import java.net.URI;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLException;
import javax.net.ssl.SSLSocketFactory;
public final class ﭤ extends ᒍ
{
private final ﯧ ˏ;
public ﭤ(URI paramURI, ﯧ paramﯧ)
{
super(paramURI);
if (paramURI.getScheme().equals("wss"))
try
{
SSLContext localSSLContext = SSLContext.getInstance("TLS");
localSSLContext.init(null, null, null);
Socket localSocket = localSSLContext.getSocketFactory().createSocket();
if (this.ˋ != null)
throw new IllegalStateException("socket has already been set");
this.ˋ = localSocket;
}
catch (IOException localIOException)
{
throw new SSLException(localIOException);
}
catch (NoSuchAlgorithmException localNoSuchAlgorithmException)
{
throw new SSLException(localNoSuchAlgorithmException);
}
catch (KeyManagementException localKeyManagementException)
{
throw new SSLException(localKeyManagementException);
}
this.ˏ = paramﯧ;
}
public final void ˊ(int paramInt, String paramString, boolean paramBoolean)
{
this.ˏ.ˊ(paramInt, paramString, paramBoolean);
}
public final void ˊ(Exception paramException)
{
this.ˏ.ˊ(paramException);
}
public final void ˊ(String paramString)
{
this.ˏ.ˋ(paramString);
}
}
/* Location: /Users/vikas/Documents/Mhacks_Real_app/classes-dex2jar.jar
* Qualified Name: o.Ô≠§
* JD-Core Version: 0.6.2
*/ | {'content_hash': 'd772b6802c9d17d19855ee902d23a51c', 'timestamp': '', 'source': 'github', 'line_count': 63, 'max_line_length': 81, 'avg_line_length': 26.523809523809526, 'alnum_prop': 0.687013764213046, 'repo_name': 'mmmsplay10/QuizUpWinner', 'id': '6359856e2a24b9d3b4d2d77ded4970ae239714b5', 'size': '1702', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'quizup/o/Ô≠§.java', 'mode': '33261', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '6075'}, {'name': 'Java', 'bytes': '23608889'}, {'name': 'JavaScript', 'bytes': '6345'}, {'name': 'Python', 'bytes': '933916'}]} |
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="./../../helpwin.css">
<title>MATLAB File Help: prtClassBagging/run</title>
</head>
<body>
<!--Single-page help-->
<table border="0" cellspacing="0" width="100%">
<tr class="subheader">
<td class="headertitle">MATLAB File Help: prtClassBagging/run</td>
</tr>
</table>
<div class="title">prtClassBagging/run</div>
<div class="helptext"><pre><!--helptext --> <span class="helptopic">run</span> Run a prtAction object on a prtDataSet object.
dsOut = OBJ.run(ds) runs the prtAction object using
the prtDataSet DataSet. OUTPUT will be a prtDataSet object.
Help for <span class="helptopic">prtClassBagging/run</span> is inherited from superclass <a href="./../prtAction.html">prtAction</a></pre></div><!--after help -->
<!--Method-->
<div class="sectiontitle">Method Details</div>
<table class="class-details">
<tr>
<td class="class-detail-label">Defining Class</td>
<td>prtAction</td>
</tr>
<tr>
<td class="class-detail-label">Access</td>
<td>public</td>
</tr>
<tr>
<td class="class-detail-label">Sealed</td>
<td>false</td>
</tr>
<tr>
<td class="class-detail-label">Static</td>
<td>false</td>
</tr>
</table>
</body>
</html> | {'content_hash': '51c4a384dae312606e03c28d760f3e92', 'timestamp': '', 'source': 'github', 'line_count': 45, 'max_line_length': 162, 'avg_line_length': 34.51111111111111, 'alnum_prop': 0.5492594977462975, 'repo_name': 'covartech/PRT', 'id': '5f7fd6b966ce03a066d3590191e91c79634b65af', 'size': '1553', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'doc/functionReference/prtClassBagging/run.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C', 'bytes': '55270'}, {'name': 'C++', 'bytes': '66966'}, {'name': 'HTML', 'bytes': '7962'}, {'name': 'M', 'bytes': '9170'}, {'name': 'MATLAB', 'bytes': '2421942'}, {'name': 'Makefile', 'bytes': '1462'}, {'name': 'Mathematica', 'bytes': '2580'}, {'name': 'Objective-C', 'bytes': '255'}, {'name': 'Python', 'bytes': '2334'}, {'name': 'Shell', 'bytes': '1092'}]} |
import scrapy
from locations.items import GeojsonPointItem
class SweetgreenSpider(scrapy.Spider):
name = "sweetgreen"
allowed_domains = ["www.sweetgreen.com"]
start_urls = (
'http://www.sweetgreen.com/locations/',
)
def parse(self, response):
location_hrefs = response.xpath('//a[contains(@class, "location")]')
for location_href in location_hrefs:
yield GeojsonPointItem(
name=location_href.xpath('@title').extract_first(),
addr_full=location_href.xpath('@data-street').extract_first(),
phone=location_href.xpath('@data-phone').extract_first(),
ref=location_href.xpath('@id').extract_first(),
lon=float(location_href.xpath('@data-longitude').extract_first()),
lat=float(location_href.xpath('@data-latitude').extract_first()),
)
| {'content_hash': '5c97c7728ae4998977cead6290a3e6dc', 'timestamp': '', 'source': 'github', 'line_count': 23, 'max_line_length': 82, 'avg_line_length': 39.0, 'alnum_prop': 0.6098104793756968, 'repo_name': 'iandees/all-the-places', 'id': '2500285230f1865277790421e24b9e337a326014', 'size': '921', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'locations/spiders/sweetgreen.py', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'HTML', 'bytes': '2134'}, {'name': 'Python', 'bytes': '116132'}, {'name': 'Shell', 'bytes': '4477'}]} |
from oslo_log import log as logging
import pecan
from pecan import hooks
from pecan import rest
from wsme import types as wtypes
import wsmeext.pecan as wsme_pecan
from mistral.api.controllers import resource
from mistral.api.controllers.v2 import types
from mistral.api.controllers.v2 import validation
from mistral.api.hooks import content_type as ct_hook
from mistral.db.v2 import api as db_api
from mistral.services import workflows
from mistral.utils import rest_utils
from mistral.workbook import parser as spec_parser
LOG = logging.getLogger(__name__)
SCOPE_TYPES = wtypes.Enum(str, 'private', 'public')
class Workflow(resource.Resource):
"""Workflow resource."""
id = wtypes.text
name = wtypes.text
input = wtypes.text
definition = wtypes.text
"Workflow definition in Mistral v2 DSL"
tags = [wtypes.text]
scope = SCOPE_TYPES
"'private' or 'public'"
created_at = wtypes.text
updated_at = wtypes.text
@classmethod
def sample(cls):
return cls(id='123e4567-e89b-12d3-a456-426655440000',
name='flow',
input='param1, param2',
definition='HERE GOES'
'WORKFLOW DEFINITION IN MISTRAL DSL v2',
tags=['large', 'expensive'],
scope='private',
created_at='1970-01-01T00:00:00.000000',
updated_at='1970-01-01T00:00:00.000000')
@classmethod
def from_dict(cls, d):
e = cls()
input_list = []
for key, val in d.items():
if hasattr(e, key):
setattr(e, key, val)
if 'spec' in d:
input = d.get('spec', {}).get('input', [])
for param in input:
if isinstance(param, dict):
for k, v in param.items():
input_list.append("%s=%s" % (k, v))
else:
input_list.append(param)
setattr(e, 'input', ", ".join(input_list) if input_list else '')
return e
class Workflows(resource.ResourceList):
"""A collection of workflows."""
workflows = [Workflow]
def __init__(self, **kwargs):
self._type = 'workflows'
super(Workflows, self).__init__(**kwargs)
@classmethod
def sample(cls):
workflows_sample = cls()
workflows_sample.workflows = [Workflow.sample()]
workflows_sample.next = "http://localhost:8989/v2/workflows?" \
"sort_keys=id,name&" \
"sort_dirs=asc,desc&limit=10&" \
"marker=123e4567-e89b-12d3-a456-426655440000"
return workflows_sample
class WorkflowsController(rest.RestController, hooks.HookController):
# TODO(nmakhotkin): Have a discussion with pecan/WSME folks in order
# to have requests and response of different content types. Then
# delete ContentTypeHook.
__hooks__ = [ct_hook.ContentTypeHook("application/json", ['POST', 'PUT'])]
validate = validation.SpecValidationController(
spec_parser.get_workflow_list_spec_from_yaml)
@rest_utils.wrap_wsme_controller_exception
@wsme_pecan.wsexpose(Workflow, wtypes.text)
def get(self, name):
"""Return the named workflow."""
LOG.info("Fetch workflow [name=%s]" % name)
db_model = db_api.get_workflow_definition(name)
return Workflow.from_dict(db_model.to_dict())
@rest_utils.wrap_pecan_controller_exception
@pecan.expose(content_type="text/plain")
def put(self):
"""Update one or more workflows.
NOTE: The text is allowed to have definitions
of multiple workflows. In this case they all will be updated.
"""
definition = pecan.request.text
LOG.info("Update workflow(s) [definition=%s]" % definition)
db_wfs = workflows.update_workflows(definition)
models_dicts = [db_wf.to_dict() for db_wf in db_wfs]
workflow_list = [Workflow.from_dict(wf) for wf in models_dicts]
return Workflows(workflows=workflow_list).to_string()
@rest_utils.wrap_pecan_controller_exception
@pecan.expose(content_type="text/plain")
def post(self):
"""Create a new workflow.
NOTE: The text is allowed to have definitions
of multiple workflows. In this case they all will be created.
"""
definition = pecan.request.text
pecan.response.status = 201
LOG.info("Create workflow(s) [definition=%s]" % definition)
db_wfs = workflows.create_workflows(definition)
models_dicts = [db_wf.to_dict() for db_wf in db_wfs]
workflow_list = [Workflow.from_dict(wf) for wf in models_dicts]
return Workflows(workflows=workflow_list).to_string()
@rest_utils.wrap_pecan_controller_exception
@wsme_pecan.wsexpose(None, wtypes.text, status_code=204)
def delete(self, name):
"""Delete the named workflow."""
LOG.info("Delete workflow [name=%s]" % name)
db_api.delete_workflow_definition(name)
@rest_utils.wrap_pecan_controller_exception
@wsme_pecan.wsexpose(Workflows, types.uuid, int, types.uniquelist,
types.list, types.uniquelist)
def get_all(self, marker=None, limit=None, sort_keys='created_at',
sort_dirs='asc', fields=''):
"""Return a list of workflows.
:param marker: Optional. Pagination marker for large data sets.
:param limit: Optional. Maximum number of resources to return in a
single result. Default value is None for backward
compatability.
:param sort_keys: Optional. Columns to sort results by.
Default: created_at.
:param sort_dirs: Optional. Directions to sort corresponding to
sort_keys, "asc" or "desc" can be choosed.
Default: asc.
:param fields: Optional. A specified list of fields of the resource to
be returned. 'id' will be included automatically in
fields if it's provided, since it will be used when
constructing 'next' link.
Where project_id is the same as the requester or
project_id is different but the scope is public.
"""
LOG.info("Fetch workflows. marker=%s, limit=%s, sort_keys=%s, "
"sort_dirs=%s, fields=%s", marker, limit, sort_keys,
sort_dirs, fields)
if fields and 'id' not in fields:
fields.insert(0, 'id')
rest_utils.validate_query_params(limit, sort_keys, sort_dirs)
rest_utils.validate_fields(fields, Workflow.get_fields())
marker_obj = None
if marker:
marker_obj = db_api.get_workflow_definition_by_id(marker)
db_workflows = db_api.get_workflow_definitions(
limit=limit,
marker=marker_obj,
sort_keys=sort_keys,
sort_dirs=sort_dirs,
fields=fields
)
workflows_list = []
for data in db_workflows:
workflow_dict = (dict(zip(fields, data)) if fields else
data.to_dict())
workflows_list.append(Workflow.from_dict(workflow_dict))
return Workflows.convert_with_links(
workflows_list,
limit,
pecan.request.host_url,
sort_keys=','.join(sort_keys),
sort_dirs=','.join(sort_dirs),
fields=','.join(fields) if fields else ''
)
| {'content_hash': '0b747a9d43d7c5e31ecddd79100cf117', 'timestamp': '', 'source': 'github', 'line_count': 222, 'max_line_length': 78, 'avg_line_length': 34.409909909909906, 'alnum_prop': 0.5944495352794869, 'repo_name': 'dennybaa/mistral', 'id': '25565c081fc3d17e39243bd8403ab93d06159995', 'size': '8330', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'mistral/api/controllers/v2/workflow.py', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Mako', 'bytes': '951'}, {'name': 'Python', 'bytes': '1037769'}, {'name': 'Shell', 'bytes': '18657'}]} |
require 'openssl'
require 'base64'
require 'digest/md5'
class EscController < Ramaze::Controller
private
# Get instance info
def get_env(fail_on_error = true)
@my_env = Environment[:name => @env]
respond("Environment '#{@env}' does not exist.", 404) if @my_env.nil? and fail_on_error
@env_id = @my_env[:id] unless @my_env.nil?
@default_id = Environment[:name => "default"][:id]
end
def get_app(fail_on_error = true)
@my_app = App[:name => @app]
respond("Application '#{@app}' does not exist.", 404) if @my_app.nil? and fail_on_error
@app_id = @my_app[:id] unless @my_app.nil?
end
def get_key(fail_on_error = true)
@my_key = Key[:name => @key, :app_id => @app_id]
respond("There is no key '#{@key}' for Application '#{@app}' in Environment '#{@env}'.", 404) if @my_key.nil? and fail_on_error
@keyId = @my_key[:id] unless @my_key.nil?
end
# Create a keypair
def create_crypto_keys
if @env == "default"
respond("Default environment doesn't have encryption", 401)
end
key = OpenSSL::PKey::RSA.generate(512)
private_key = key.to_pem
public_key = key.public_key.to_pem
@my_env.update(:private_key => private_key, :public_key => public_key)
response.status = 201
response.headers["Content-Type"] = "text/plain"
return public_key + "\n" + private_key
end
def check_auth(id = nil, realm = "")
return id if id == "nobody"
response['WWW-Authenticate'] = "Basic realm=\"ESCAPE Server - #{realm}\""
if auth = request.env['HTTP_AUTHORIZATION']
(user, pass) = Base64.decode64(auth.split(" ")[1]).split(':')
id = user if id.nil?
owner = Owner[:name => user]
if owner && (owner.password == Digest::MD5.hexdigest(pass)) && (id == user)
return user
end
end
respond 'Unauthorized', 401
end
def get_env_auth
check_auth nil, "Environment #{@env}"
end
def check_env_auth
check_auth @my_env.owner.name, "Environment #{@env}"
end
def check_user_auth
check_auth @name, "User #{@name}"
end
end
# Here go your requires for subclasses of Controller:
%w[main environments crypt owner user auth search].each { |f| require_relative f }
| {'content_hash': 'bf7a22216733d3a862cfaa336ff45549', 'timestamp': '', 'source': 'github', 'line_count': 78, 'max_line_length': 131, 'avg_line_length': 28.358974358974358, 'alnum_prop': 0.6234177215189873, 'repo_name': 'cv/escape-server-config', 'id': 'f8690febd991001c52b6b7d32e6013e0342d03b1', 'size': '2259', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'app/controller/init.rb', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'JavaScript', 'bytes': '338543'}, {'name': 'Ruby', 'bytes': '80828'}]} |
var absurd = require('absurd')();
var through2 = require('through2');
var gutil = require('gulp-util');
var PluginError = gutil.PluginError;
var path = require('path');
var fs = require("fs");
var marked = require('marked');
var absurdVersion = require(__dirname + '/../node_modules/absurd/package.json').version;
var sizes = {
absurd: Math.ceil(fs.statSync(__dirname + '/../node_modules/absurd/client-side/build/absurd.js').size / 1024),
absurdMin: Math.ceil(fs.statSync(__dirname + '/../node_modules/absurd/client-side/build/absurd.min.js').size / 1024),
organic: Math.ceil(fs.statSync(__dirname + '/../node_modules/absurd/client-side/build/absurd.organic.js').size / 1024),
organicMin: Math.ceil(fs.statSync(__dirname + '/../node_modules/absurd/client-side/build/absurd.organic.min.js').size / 1024)
};
marked.setOptions({
renderer: new marked.Renderer(),
gfm: true,
tables: true,
breaks: false,
pedantic: false,
sanitize: false,
smartLists: true,
smartypants: false
});
module.exports = function () {
var getSiteMap = function(sitemap, path) {
var process = function(items) {
var html = '<ul>';
for(var i=0; i<items.length; i++) {
var active = items[i].path == path ? ' class="active"' : '';
html += '<li><a href="' + items[i].path + '"' + active + '>' + items[i].name + '</a></li>';
if(items[i].childs) {
html += '<li>' + process(items[i].childs) + '</li>';
}
}
return html + '</ul>';
}
return process(sitemap);
}
var getPageTitle = function(sitemap, path) {
var allItems = [];
var process = function(items) {
for(var i=0; i<items.length; i++) {
allItems.push(items[i]);
if(items[i].childs) {
process(items[i].childs);
}
}
}
process(sitemap);
for(var i=0; i<allItems.length; i++) {
if(allItems[i].path == path) return allItems[i].name + ' / AbsurdJS - JavaScript library with superpowers';
}
return 'AbsurdJS - JavaScript library with superpowers';
}
var getGuide = function(sitemap, path) {
var allItems = [];
var result = {
previousPath: '',
previousName: '',
nextPath: '',
nextName: ''
};
var process = function(items) {
for(var i=0; i<items.length; i++) {
allItems.push(items[i]);
if(items[i].childs) {
process(items[i].childs);
}
}
}
process(sitemap);
for(var i=0; i<allItems.length; i++) {
if(allItems[i].path == path) {
if(i > 0) {
result.previousName = '<i class="fa fa-arrow-circle-o-left"></i> ' + allItems[i-1].name;
result.previousPath = allItems[i-1].path;
}
if(i < allItems.length-1) {
result.nextName = allItems[i+1].name + ' <i class="fa fa-arrow-circle-o-right"></i>';
result.nextPath = allItems[i+1].path;
}
}
}
return result;
}
var applyCodeTags = function(html) {
html = html.replace(/\<example\>/g, '<div class="example">');
html = html.replace(/\<example class="rows"\>/g, '<div class="example example-rows">');
html = html.replace(/\<\/example\>/g, '</div>');
html = html.replace(/\<js\>\n/g, '<div class="col">\n<small>JavaScript:</small>\n<pre><code class="language-javascript">');
html = html.replace(/\<str text="(.+)"\>\n/g, '<div class="col">\n<small>$1:</small>\n<pre><code class="language-javascript">');
html = html.replace(/\<css\>\n/g, '<div class="col">\n<small>CSS:</small>\n<pre><code class="language-css">');
html = html.replace(/\<html\>\n/g, '<div class="col">\n<small>HTML:</small>\n<pre><code class="language-markup">');
html = html.replace(/\n\<\/(js|css|html|str)\>/g, '</code></pre></div>');
return html;
}
var layoutHTML = fs.readFileSync(__dirname + "/../layout.html").toString('utf8');
var socialHTML = fs.readFileSync(__dirname + "/../social.html").toString('utf8');
function transform (file, enc, next) {
var self = this;
if(file.isNull()) {
this.push(file); // pass along
return next();
}
if(file.isStream()) {
this.emit('error', new PluginError('page', 'Streaming not supported'));
return next();
}
var sitemap = JSON.parse(fs.readFileSync(__dirname + '/../pages/structure.json'));
var root = __dirname + "/../";
var fileRoot = path.dirname(file.path);
var markdownFile = path.resolve(file.path).replace(path.resolve(root), '');
var htmlFile = path.basename(file.path).replace(".md", ".html");
var fileURL = fileRoot.replace(path.resolve(root), '').replace(/\\/g, '/');
var contentHTML = marked(fs.readFileSync(file.path).toString('utf8'));
contentHTML = contentHTML.replace(/<code>/g, '<code class="language-javascript">');
contentHTML = applyCodeTags(contentHTML);
var partials = {
version: absurdVersion,
sitemap: getSiteMap(sitemap, fileURL),
pageTitle: getPageTitle(sitemap, fileURL),
guide: getGuide(sitemap, fileURL),
minify: false,
url: fileURL,
markdownFile: markdownFile,
sizes: sizes
}
var sHTML = socialHTML.replace(/\<url\>/g, partials.url);
absurd.flush().morph("html").add(layoutHTML).compile(function(err, html) {
html = html.replace('<content>', contentHTML);
html = html.replace('<social>', sHTML);
html = html.replace('<sitemap>', partials.sitemap);
html = html.replace('<version>', partials.version);
for(var key in sizes) {
html = html.replace('<size-' + key + '>', sizes[key]);
}
fs.writeFileSync(fileRoot + '/' + htmlFile, html, {encoding: 'utf8'});
}, partials);
next();
}
return through2.obj(transform);
}; | {'content_hash': '0fb61f105374b6d32c2fb14027084ad3', 'timestamp': '', 'source': 'github', 'line_count': 159, 'max_line_length': 136, 'avg_line_length': 40.119496855345915, 'alnum_prop': 0.535036839630036, 'repo_name': 'krasimir/absurdjs.com', 'id': '716deab74f4c79fe67f3274327a2726f63885c7d', 'size': '6379', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'tasks/page.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'ApacheConf', 'bytes': '390'}, {'name': 'CSS', 'bytes': '108922'}, {'name': 'HTML', 'bytes': '530910'}, {'name': 'JavaScript', 'bytes': '410056'}, {'name': 'PHP', 'bytes': '5443'}, {'name': 'Shell', 'bytes': '55'}]} |
import {Action, AmpStoryStoreService} from '../amp-story-store-service';
import {ProgressBar} from '../progress-bar';
import {Services} from '../../../../src/services';
import {SystemLayer} from '../amp-story-system-layer';
import {registerServiceBuilder} from '../../../../src/service';
const NOOP = () => {};
describes.fakeWin('amp-story system layer', {amp: true}, env => {
let win;
let storeService;
let systemLayer;
let progressBarStub;
let progressBarRoot;
beforeEach(() => {
win = env.win;
storeService = new AmpStoryStoreService(win);
registerServiceBuilder(win, 'story-store', () => storeService);
progressBarRoot = win.document.createElement('div');
progressBarStub = {
build: sandbox.stub().returns(progressBarRoot),
getRoot: sandbox.stub().returns(progressBarRoot),
updateProgress: sandbox.spy(),
};
sandbox.stub(ProgressBar, 'create').returns(progressBarStub);
sandbox.stub(Services, 'vsyncFor').returns({
mutate: fn => fn(),
});
systemLayer = new SystemLayer(win);
});
it('should build UI', () => {
const initializeListeners =
sandbox.stub(systemLayer, 'initializeListeners_').callsFake(NOOP);
const root = systemLayer.build();
expect(root).to.not.be.null;
expect(initializeListeners).to.have.been.called;
});
// TODO(alanorozco, #12476): Make this test work with sinon 4.0.
it.skip('should attach event handlers', () => {
const rootMock = {addEventListener: sandbox.spy()};
sandbox.stub(systemLayer, 'root_').callsFake(rootMock);
sandbox.stub(systemLayer, 'win_').callsFake(rootMock);
systemLayer.initializeListeners_();
expect(rootMock.addEventListener).to.have.been.calledWith('click');
});
it('should set an attribute to toggle the UI when an ad is shown', () => {
systemLayer.build();
storeService.dispatch(Action.TOGGLE_AD, true);
expect(systemLayer.getShadowRoot()).to.have.attribute('ad-showing');
});
it('should show that sound off on a page when muted', () => {
systemLayer.build();
storeService.dispatch(Action.TOGGLE_PAGE_HAS_AUDIO, true);
storeService.dispatch(Action.TOGGLE_MUTED, true);
expect(systemLayer.getShadowRoot()).to.have.attribute('muted');
});
it('should show that this page has no sound when unmuted', () => {
systemLayer.build();
storeService.dispatch(Action.TOGGLE_PAGE_HAS_AUDIO, false);
storeService.dispatch(Action.TOGGLE_MUTED, false);
expect(systemLayer.getShadowRoot()).to.not.have.attribute('muted');
expect(systemLayer.getShadowRoot()).to.not.have.attribute(
'i-amphtml-story-audio-state');
});
it('should show that the sound is on when unmuted', () => {
systemLayer.build();
storeService.dispatch(Action.TOGGLE_PAGE_HAS_AUDIO, true);
storeService.dispatch(Action.TOGGLE_MUTED, false);
expect(systemLayer.getShadowRoot()).to.not.have.attribute('muted');
expect(systemLayer.getShadowRoot()).to.have.attribute(
'i-amphtml-story-audio-state');
});
});
| {'content_hash': 'c00af219d37332672a63d4d2f3b30c43', 'timestamp': '', 'source': 'github', 'line_count': 96, 'max_line_length': 76, 'avg_line_length': 31.84375, 'alnum_prop': 0.677134445534838, 'repo_name': 'chaveznvg/amphtml', 'id': 'fe9b38fa40d46b762b763440ebf87adafac38b35', 'size': '3684', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'extensions/amp-story/1.0/test/test-amp-story-system-layer.js', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '344135'}, {'name': 'Go', 'bytes': '7459'}, {'name': 'HTML', 'bytes': '1410137'}, {'name': 'Java', 'bytes': '37155'}, {'name': 'JavaScript', 'bytes': '12335249'}, {'name': 'Python', 'bytes': '72953'}, {'name': 'Shell', 'bytes': '14948'}, {'name': 'Yacc', 'bytes': '22627'}]} |
You can use the [editor on GitHub](https://github.com/aediscoverer/smstick/edit/master/README.md) to maintain and preview the content for your website in Markdown files.
Whenever you commit to this repository, GitHub Pages will run [Jekyll](https://jekyllrb.com/) to rebuild the pages in your site, from the content in your Markdown files.
### Markdown
Markdown is a lightweight and easy-to-use syntax for styling your writing. It includes conventions for
```markdown
Syntax highlighted code block
# Header 1
## Header 2
### Header 3
- Bulleted
- List
1. Numbered
2. List
**Bold** and _Italic_ and `Code` text
[Link](url) and 
```
For more details see [GitHub Flavored Markdown](https://guides.github.com/features/mastering-markdown/).
### Jekyll Themes
Your Pages site will use the layout and styles from the Jekyll theme you have selected in your [repository settings](https://github.com/aediscoverer/smstick/settings). The name of this theme is saved in the Jekyll `_config.yml` configuration file.
### Support or Contact
Having trouble with Pages? Check out our [documentation](https://help.github.com/categories/github-pages-basics/) or [contact support](https://github.com/contact) and we’ll help you sort it out.
| {'content_hash': '143431461cadf8aae4d1b8b3c27e1da4', 'timestamp': '', 'source': 'github', 'line_count': 35, 'max_line_length': 247, 'avg_line_length': 35.628571428571426, 'alnum_prop': 0.7586206896551724, 'repo_name': 'aediscoverer/smstick', 'id': '5c0e5caf516d605594afa3ad68b0de9c53269db8', 'size': '1277', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'README.md', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '3556'}, {'name': 'JavaScript', 'bytes': '450'}, {'name': 'PHP', 'bytes': '133508'}]} |
"use strict";
exports.__esModule = true;
exports.default = void 0;
var _repositoryId = require("gatsby-telemetry/lib/repository-id");
var _babelPluginRemoveGraphqlQueries = require("babel-plugin-remove-graphql-queries");
const sampleSite = (experimentName, percentage) => {
const bucketNumber = (0, _babelPluginRemoveGraphqlQueries.murmurhash)(experimentName + `` + JSON.stringify((0, _repositoryId.getRepositoryId)().repositoryId)) % 100;
return bucketNumber < percentage;
};
var _default = sampleSite;
exports.default = _default;
//# sourceMappingURL=sample-site-for-experiment.js.map | {'content_hash': '02b3e68b0ca14697faa7f00a87910c07', 'timestamp': '', 'source': 'github', 'line_count': 17, 'max_line_length': 167, 'avg_line_length': 35.0, 'alnum_prop': 0.7596638655462185, 'repo_name': 'BigBoss424/portfolio', 'id': '387771d8f8f8de6570514c944d3f56fadf5a0063', 'size': '595', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'v8/development/node_modules/gatsby/dist/utils/sample-site-for-experiment.js', 'mode': '33188', 'license': 'apache-2.0', 'language': []} |
// <copyright file="Svd.cs" company="Math.NET">
// Math.NET Numerics, part of the Math.NET Project
// http://numerics.mathdotnet.com
// http://github.com/mathnet/mathnet-numerics
// http://mathnetnumerics.codeplex.com
//
// Copyright (c) 2009-2013 Math.NET
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
// restriction, including without limitation the rights to use,
// copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
// </copyright>
using System;
using System.Linq;
using MathNet.Numerics.LinearAlgebra.Factorization;
using MathNet.Numerics.Properties;
namespace MathNet.Numerics.LinearAlgebra.Double.Factorization
{
/// <summary>
/// <para>A class which encapsulates the functionality of the singular value decomposition (SVD).</para>
/// <para>Suppose M is an m-by-n matrix whose entries are real numbers.
/// Then there exists a factorization of the form M = UΣVT where:
/// - U is an m-by-m unitary matrix;
/// - Σ is m-by-n diagonal matrix with nonnegative real numbers on the diagonal;
/// - VT denotes transpose of V, an n-by-n unitary matrix;
/// Such a factorization is called a singular-value decomposition of M. A common convention is to order the diagonal
/// entries Σ(i,i) in descending order. In this case, the diagonal matrix Σ is uniquely determined
/// by M (though the matrices U and V are not). The diagonal entries of Σ are known as the singular values of M.</para>
/// </summary>
/// <remarks>
/// The computation of the singular value decomposition is done at construction time.
/// </remarks>
internal abstract class Svd : Svd<double>
{
protected Svd(Vector<double> s, Matrix<double> u, Matrix<double> vt, bool vectorsComputed)
: base(s, u, vt, vectorsComputed)
{
}
/// <summary>
/// Gets the effective numerical matrix rank.
/// </summary>
/// <value>The number of non-negligible singular values.</value>
public override int Rank
{
get
{
return S.Count(t => !Math.Abs(t).AlmostEqual(0.0));
}
}
/// <summary>
/// Gets the two norm of the <see cref="Matrix{T}"/>.
/// </summary>
/// <returns>The 2-norm of the <see cref="Matrix{T}"/>.</returns>
public override double L2Norm
{
get
{
return Math.Abs(S[0]);
}
}
/// <summary>
/// Gets the condition number <b>max(S) / min(S)</b>
/// </summary>
/// <returns>The condition number.</returns>
public override double ConditionNumber
{
get
{
var tmp = Math.Min(U.RowCount, VT.ColumnCount) - 1;
return Math.Abs(S[0]) / Math.Abs(S[tmp]);
}
}
/// <summary>
/// Gets the determinant of the square matrix for which the SVD was computed.
/// </summary>
public override double Determinant
{
get
{
if (U.RowCount != VT.ColumnCount)
{
throw new ArgumentException(Resources.ArgumentMatrixSquare);
}
var det = 1.0;
foreach (var value in S)
{
det *= value;
if (Math.Abs(value).AlmostEqual(0.0))
{
return 0;
}
}
return Math.Abs(det);
}
}
}
}
| {'content_hash': 'b71539ee7a06d14e9fb37633c2ae47e0', 'timestamp': '', 'source': 'github', 'line_count': 122, 'max_line_length': 123, 'avg_line_length': 36.97540983606557, 'alnum_prop': 0.5972068277543782, 'repo_name': 'cqwang/mathnet-numerics', 'id': '2162250227c007da03c64a1db090695591c7718d', 'size': '4518', 'binary': False, 'copies': '4', 'ref': 'refs/heads/master', 'path': 'src/Numerics/LinearAlgebra/Double/Factorization/Svd.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Batchfile', 'bytes': '243'}, {'name': 'C', 'bytes': '15262'}, {'name': 'C#', 'bytes': '11142897'}, {'name': 'C++', 'bytes': '105346'}, {'name': 'F#', 'bytes': '274382'}, {'name': 'PowerShell', 'bytes': '85'}, {'name': 'Shell', 'bytes': '3152'}]} |
'use strict';
const Path = require('path');
const File = require('./file');
/**
* Normalize a path so it's a valid bucket name
* @param p
* @returns {string}
*/
function normalizePath(p) {
const path = p.replace(/\//g, '-').toLowerCase();
return (path[0] === '-') ? path.replace('-', '') : path;
}
/**
* Gets bucket path name and directory
* @param p
* @returns {{name: *, path: (*|console.dir|string|string|string)}}
*/
function generateBucketInfo(p) {
const parsed = Path.parse(p);
return {
name: parsed.name,
path: p
};
}
/**
* Handles cleanup on app exit
*/
function exitHandler(log, tmpDir, code) {
if (tmpDir) {
log.info(`Cleaning up temp directory: ${tmpDir}`);
File.cleanupDir(tmpDir);
}
process.exit(code);
}
module.exports = {
normalizePath,
generateBucketInfo,
exitHandler
};
| {'content_hash': 'cbd42b2530caaa205e166175ec6fb800', 'timestamp': '', 'source': 'github', 'line_count': 46, 'max_line_length': 67, 'avg_line_length': 18.304347826086957, 'alnum_prop': 0.6187648456057007, 'repo_name': 'davepgreene/s3-server', 'id': 'c88eff260c88a3fc818f62e004db84c3097aad5b', 'size': '842', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'lib/utils.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'JavaScript', 'bytes': '9228'}]} |
// -----------------------------------------------------------------------
// <copyright file="SugarCrmApiRestful.cs" company="SugarDesk WPF MVVM Studio">
// Copyright (c) SugarDesk WPF MVVM Studio. All rights reserved.
// </copyright>
// -----------------------------------------------------------------------
namespace SugarDesk.Restful.Helpers
{
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using Models;
using Newtonsoft.Json.Linq;
using System.Net;
using System;
using SugarRestSharp;
/// <summary>
/// This class represents SugarCrmApiRestful class.
/// </summary>
public static class SugarCrmApiRestful
{
/// <summary>
/// This GetAll request.
/// </summary>
/// <param name="restRequest">SugarCRM Rest request parameters.</param>
/// <returns>The task response object.</returns>
public static Task<RestResponse> GetAll(RestRequest restRequest)
{
return Task.Run(() =>
{
var response = new RestResponse();
var request = new SugarRestRequest();
request.RequestType = RequestType.BulkRead;
request.ModuleName = restRequest.ModelInfo.ModelName;
request.Url = restRequest.Account.Url;
request.Username = restRequest.Account.Username;
request.Password = restRequest.Account.Password;
bool selectedFieldsOnly = false;
var properties = new List<ModelProperty>();
if (restRequest.SelectFields)
{
if (restRequest.SelectedFields != null && restRequest.SelectedFields.Count > 0)
{
properties = restRequest.SelectedFields.Select(x => x.Property).ToList();
if (properties.Count > 0)
{
request.Options.SelectFields = properties.Select(x => x.JsonName).ToList();
selectedFieldsOnly = true;
}
}
}
// If zero (0) default value is used
if (restRequest.MaxResult > 0)
{
request.Options.MaxResult = restRequest.MaxResult;
}
var client = new SugarRestClient();
SugarRestResponse sugarRestResponse = client.Execute(request);
response.Data = new DataTable();
if (sugarRestResponse != null)
{
var selectedProperties = new List<string>();
if (selectedFieldsOnly)
{
selectedProperties = properties.Select(x => x.Name).ToList();
}
if (!string.IsNullOrEmpty(sugarRestResponse.JData))
{
response.Data = sugarRestResponse.JData.ToDynamicObjects(
restRequest.ModelInfo.Type, selectedProperties, selectedFieldsOnly);
}
response.JsonRawRequest = JToken.Parse(
sugarRestResponse.JsonRawRequest).ToString(Newtonsoft.Json.Formatting.Indented);
response.JsonRawResponse = JToken.Parse(
sugarRestResponse.JsonRawResponse).ToString(Newtonsoft.Json.Formatting.Indented);
}
return response;
});
}
/// <summary>
/// This GetByPage request.
/// </summary>
/// <param name="restRequest">SugarCRM Rest request parameters.</param>
/// <returns>The task response object.</returns>
public static Task<RestResponse> GetByPage(RestRequest restRequest)
{
return Task.Run(() =>
{
var response = new RestResponse();
var request = new SugarRestRequest();
request.RequestType = RequestType.PagedRead;
request.ModuleName = restRequest.ModelInfo.ModelName;
request.Url = restRequest.Account.Url;
request.Username = restRequest.Account.Username;
request.Password = restRequest.Account.Password;
bool selectedFieldsOnly = false;
var properties = new List<ModelProperty>();
if (restRequest.SelectFields)
{
if (restRequest.SelectedFields != null && restRequest.SelectedFields.Count > 0)
{
properties = restRequest.SelectedFields.Select(x => x.Property).ToList();
if (properties.Count > 0)
{
request.Options.SelectFields = properties.Select(x => x.JsonName).ToList();
selectedFieldsOnly = true;
}
}
}
request.Options.CurrentPage = restRequest.CurrentPage;
// If zero (0) default value is used
if (restRequest.MaxResult > 0)
{
request.Options.NumberPerPage = restRequest.MaxResult;
}
var client = new SugarRestClient();
SugarRestResponse sugarRestResponse = client.Execute(request);
response.Data = new DataTable();
if (sugarRestResponse != null)
{
var selectedProperties = new List<string>();
if (selectedFieldsOnly)
{
selectedProperties = properties.Select(x => x.Name).ToList();
}
if (!string.IsNullOrEmpty(sugarRestResponse.JData))
{
response.Data = sugarRestResponse.JData.ToDynamicObjects(restRequest.ModelInfo.Type, selectedProperties, selectedFieldsOnly);
}
response.JsonRawRequest = JToken.Parse(sugarRestResponse.JsonRawRequest).ToString(Newtonsoft.Json.Formatting.Indented);
response.JsonRawResponse = JToken.Parse(sugarRestResponse.JsonRawResponse).ToString(Newtonsoft.Json.Formatting.Indented);
}
return response;
});
}
/// <summary>
/// This GetById request.
/// </summary>
/// <param name="restRequest">SugarCRM Rest request parameters.</param>
/// <returns>The task response object.</returns>
public static Task<RestResponse> GetById(RestRequest restRequest)
{
return Task.Run(() =>
{
var response = new RestResponse();
var request = new SugarRestRequest();
request.RequestType = RequestType.ReadById;
request.ModuleName = restRequest.ModelInfo.ModelName;
request.Url = restRequest.Account.Url;
request.Username = restRequest.Account.Username;
request.Password = restRequest.Account.Password;
request.Parameter = restRequest.Id;
bool selectedFieldsOnly = false;
var properties = new List<ModelProperty>();
if (restRequest.SelectFields)
{
if (restRequest.SelectedFields != null && restRequest.SelectedFields.Count > 0)
{
properties = restRequest.SelectedFields.Select(x => x.Property).ToList();
if (properties.Count > 0)
{
request.Options.SelectFields = properties.Select(x => x.JsonName).ToList();
selectedFieldsOnly = true;
}
}
}
var client = new SugarRestClient();
SugarRestResponse sugarRestResponse = client.Execute(request);
response.Data = new DataTable();
if (sugarRestResponse != null)
{
var selectedProperties = new List<string>();
if (selectedFieldsOnly)
{
selectedProperties = properties.Select(x => x.Name).ToList();
}
if (!string.IsNullOrEmpty(sugarRestResponse.JData))
{
response.Data = sugarRestResponse.JData.ToDynamicObject(restRequest.ModelInfo.Type, selectedProperties, selectedFieldsOnly);
}
response.JsonRawRequest = JToken.Parse(sugarRestResponse.JsonRawRequest).ToString(Newtonsoft.Json.Formatting.Indented);
response.JsonRawResponse = JToken.Parse(sugarRestResponse.JsonRawResponse).ToString(Newtonsoft.Json.Formatting.Indented);
}
return response;
});
}
/// <summary>
/// This Create request.
/// </summary>
/// <param name="restRequest">SugarCRM Rest request parameters.</param>
/// <returns>The task response object.</returns>
public static Task<RestResponse> Create(RestRequest restRequest)
{
return Task.Run(() =>
{
var response = new RestResponse();
var request = new SugarRestRequest();
request.RequestType = RequestType.Create;
request.ModuleName = restRequest.ModelInfo.ModelName;
request.Url = restRequest.Account.Url;
request.Username = restRequest.Account.Username;
request.Password = restRequest.Account.Password;
var client = new SugarRestClient();
List<string> selectedFields;
List<object> dataList = restRequest.Data.ToObjects(restRequest.ModelInfo, out selectedFields);
request.Options.SelectFields = selectedFields;
if (dataList == null)
{
return response;
}
SugarRestResponse sugarRestResponse = new SugarRestResponse();
if (dataList.Count == 1)
{
request.Parameter = dataList;
sugarRestResponse = client.Execute(request);
response.Id = (string)sugarRestResponse.Data;
}
else
{
request.Parameter = dataList;
sugarRestResponse = client.Execute(request);
}
try
{
response.JsonRawRequest = JToken.Parse(sugarRestResponse.JsonRawRequest).ToString(Newtonsoft.Json.Formatting.Indented);
}
catch (Exception exception)
{
response.Failure = true;
response.JsonRawRequest = exception.Message;
}
if (sugarRestResponse.StatusCode == HttpStatusCode.OK)
{
try
{
response.JsonRawResponse = JToken.Parse(sugarRestResponse.JsonRawResponse).ToString(Newtonsoft.Json.Formatting.Indented);
}
catch (Exception exception)
{
response.Failure = true;
response.JsonRawResponse = exception.Message;
}
}
else
{
response.Failure = true;
if (sugarRestResponse.Error != null)
{
response.JsonRawResponse = sugarRestResponse.Error.Message;
}
else
{
response.JsonRawResponse = "An error occurs processing request!";
}
}
return response;
});
}
/// <summary>
/// This Update request.
/// </summary>
/// <param name="restRequest">SugarCRM Rest request parameters.</param>
/// <returns>The task response object.</returns>
public static Task<RestResponse> Update(RestRequest restRequest)
{
return Task.Run(() =>
{
var response = new RestResponse();
var request = new SugarRestRequest();
request.RequestType = RequestType.Update;
request.ModuleName = restRequest.ModelInfo.ModelName;
request.Url = restRequest.Account.Url;
request.Username = restRequest.Account.Username;
request.Password = restRequest.Account.Password;
var client = new SugarRestClient();
List<string> selectedFields;
List<object> dataList = restRequest.Data.ToObjects(restRequest.ModelInfo, out selectedFields);
request.Options.SelectFields = selectedFields;
if (dataList == null)
{
return response;
}
SugarRestResponse sugarRestResponse = new SugarRestResponse();
if (dataList.Count == 1)
{
request.Parameter = dataList;
sugarRestResponse = client.Execute(request);
response.Id = (string)sugarRestResponse.Data;
}
else
{
request.Parameter = dataList;
sugarRestResponse = client.Execute(request);
}
response.JsonRawRequest = JToken.Parse(sugarRestResponse.JsonRawRequest).ToString(Newtonsoft.Json.Formatting.Indented);
response.JsonRawResponse = JToken.Parse(sugarRestResponse.JsonRawResponse).ToString(Newtonsoft.Json.Formatting.Indented);
return response;
});
}
/// <summary>
/// This Delete request.
/// </summary>
/// <param name="restRequest">SugarCRM Rest request parameters.</param>
/// <returns>The task response object.</returns>
public static Task<RestResponse> Delete(RestRequest restRequest)
{
return Task.Run(() =>
{
var response = new RestResponse();
var request = new SugarRestRequest();
request.RequestType = RequestType.Delete;
request.ModuleName = restRequest.ModelInfo.ModelName;
request.Url = restRequest.Account.Url;
request.Username = restRequest.Account.Username;
request.Password = restRequest.Account.Password;
request.Parameter = restRequest.Id;
var client = new SugarRestClient();
SugarRestResponse sugarRestResponse = client.Execute(request);
response.Id = (string)sugarRestResponse.Data;
response.JsonRawRequest = JToken.Parse(sugarRestResponse.JsonRawRequest).ToString(Newtonsoft.Json.Formatting.Indented);
response.JsonRawResponse = JToken.Parse(sugarRestResponse.JsonRawResponse).ToString(Newtonsoft.Json.Formatting.Indented);
return response;
});
}
}
}
| {'content_hash': 'db5f625891bf61bfe24625102a297399', 'timestamp': '', 'source': 'github', 'line_count': 385, 'max_line_length': 149, 'avg_line_length': 40.85454545454545, 'alnum_prop': 0.5138915379235807, 'repo_name': 'mattkol/SugarDesk', 'id': 'e9e8bb5f004a36b9aeaa29ea802ef17dca8106cd', 'size': '15731', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'SugarDeskSolution/SugarDesk.Restful/Helpers/SugarCrmApiRestful.cs', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'C#', 'bytes': '247260'}]} |
Rails.application.routes.draw do
get '/things' => 'things#index', as: :things
mount Subscribem::Engine => "/"
end
| {'content_hash': 'd5f80c613c8ce3dc452e7fd9e1ccc10d', 'timestamp': '', 'source': 'github', 'line_count': 6, 'max_line_length': 46, 'avg_line_length': 20.0, 'alnum_prop': 0.6666666666666666, 'repo_name': 'gjack/subscribem', 'id': 'f25116531fd2a1dacbfccc4722b7398078c5f109', 'size': '120', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'spec/dummy/config/routes.rb', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '2140'}, {'name': 'HTML', 'bytes': '6629'}, {'name': 'JavaScript', 'bytes': '2074'}, {'name': 'Ruby', 'bytes': '50483'}]} |
from colorstr import color_str
# ESL包要先安装
try:
import ESL
except ImportError as err:
if "No module named" in str(err):
print(color_str("this script base on ESL, I will install it first, please wait a moment...", "purple"))
import os
result = os.system("yum -y install python-devel")
result += os.system("yum -y install epel-release")
result += os.system("yum -y install python-setuptools")
result += os.system("yum -y install python-pip")
result += os.system("pip install --upgrade pip")
result += os.system("pip install --upgrade setuptools")
result += os.system("yum install gcc")
result += os.system("yum install gcc-c++")
result += os.system("yum install swig -y")
result += os.system("pip install python-esl")
if 0 != result:
print(color_str("sorry, there have some problems on auto-install ESL, please install it manually", "red"))
import sys
sys.exit(result)
else:
import ESL
print(color_str("auto-install ESL successful", "green"))
else:
print(err)
except Exception as err:
print(err)
class ESLEvent:
__recv_event_interval = 1000
def __init__(self, ip, port, password, reconnect_time = 4, \
standard_event = "CHANNEL_CREATE CHANNEL_ANSWER CHANNEL_PROGRESS CHANNEL_PROGRESS_MEDIA CHANNEL_HANGUP CHANNEL_HANGUP_COMPLETE RECORD_START RECORD_STOP",\
constom_event = "sippout::hangup sippin::hangup ras::hangup"):
self.__ip = ip
self.__port = int(port)
self.__password = password
self.__reconnect_time = int(reconnect_time)
self.__standard_event = standard_event
self.__constom_event = constom_event
self.__subscribe_event = " ".join([standard_event, ("CUSTOM " + constom_event) if constom_event else ""])
try:
self.__esl = ESL.ESLconnection(self.__ip, self.__port, self.__password)
except Exception as err:
self.__esl = None
raise Exception(err)
if not self.__esl.connected():
raise Exception("Connect error")
def __enter__(self):
return self
def __exit__(self, exc_type, exc_value, exc_tb):
if exc_tb:
return False
else:
self.__del__()
def __del__(self):
self.__esl.disconnect()
def esl(self):
return self.__esl
def channel_event(self, event):
#print(event.serialize())
pass
def __process(self, timeout):
self.__esl.events('json', self.__subscribe_event)
import datetime
start = datetime.datetime.now()
seconds = int(timeout)
end = start + datetime.timedelta(seconds=seconds)
while True:
delta = (end - datetime.datetime.now()).seconds
if 0 < delta <= seconds:
event = self.__esl.recvEventTimed(self.__recv_event_interval)
if event:
if self.channel_event(event) == "end":
return True
elif not self.__esl.connected():
return True
else:
break
return False
def run(self, timeout=10):
#print("connecting freeswitch... ip:%s prot:%s pwd:%s" % (self.__ip, self.__port, self.__password))
res = True
if self.__esl.connected():
#print("conneted...conn:%s, socket:%s info:%s" % (self.__esl.connected(), self.__esl.socketDescriptor(), self.__esl.getInfo()))
if not self.__process(timeout):
res = False
else:
print("ERR :conntect freeswitch failed. %s:%d@%s" % (self.__ip, self.__port, self.__password))
res = False
# 断开freeswtich的连接
self.__esl.disconnect()
return res
def is_connected(self):
return self.__esl.connected() if self.__esl else False
def disconnect(self):
return self.__esl.disconnect() if self.__esl else None
if __name__ == '__main__':
from optparse import OptionParser
parser = OptionParser()
parser.add_option('-s', '--host', dest='host', help='FreeSWITCH server IP address')
parser.add_option('-p', '--port', dest='port', default=8021, help='FreeSWITCH server event socket port')
parser.add_option('-a', '--password', dest='password', default='ClueCon', help='ESL password')
parser.add_option('-t', '--timeout', dest='timeout', default=60, help='timeout')
(options, args) = parser.parse_args()
class MyEvent(ESLEvent):
def channel_event(self, event):
event_name = event.getHeader("Event-Name")
event_sub_name = event.getHeader("Event-Subclass")
if event_name in ['CHANNEL_CREATE']:
uuid = event.getHeader("unique-id")
session_id = event.getHeader("variable_session_id")
call_dir = event.getHeader("Caller-Direction")
sip_call_id = event.getHeader("variable_sip_call_id")
print("FREESWIRCH calling... uuid:%s session_id:%s direction:%s call-id:%s" % (uuid, session_id, call_dir, sip_call_id))
pass
event = MyEvent(options.host, options.port, options.password)
event.run(options.timeout)
| {'content_hash': '2fc87a98cd376a3b7864341a5c3f7bc1', 'timestamp': '', 'source': 'github', 'line_count': 145, 'max_line_length': 157, 'avg_line_length': 31.63448275862069, 'alnum_prop': 0.6701547852626989, 'repo_name': 'sudaning/PytLab-Neko', 'id': '3460c7dc031077493dc1c5db578639568643da22', 'size': '4656', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'neko/esl.py', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Python', 'bytes': '24462'}]} |
package com.android.settings.cyanogenmod;
import android.database.ContentObserver;
import android.os.Bundle;
import android.os.Handler;
import android.preference.CheckBoxPreference;
import android.preference.Preference;
import android.preference.Preference.OnPreferenceChangeListener;
import android.preference.PreferenceScreen;
import android.preference.SwitchPreference;
import android.provider.Settings;
import com.android.internal.view.RotationPolicy;
import com.android.settings.R;
import com.android.settings.SettingsPreferenceFragment;
public class DisplayRotation extends SettingsPreferenceFragment {
private static final String TAG = "DisplayRotation";
private static final String KEY_ACCELEROMETER = "accelerometer";
private static final String ROTATION_0_PREF = "display_rotation_0";
private static final String ROTATION_90_PREF = "display_rotation_90";
private static final String ROTATION_180_PREF = "display_rotation_180";
private static final String ROTATION_270_PREF = "display_rotation_270";
private SwitchPreference mAccelerometer;
private CheckBoxPreference mRotation0Pref;
private CheckBoxPreference mRotation90Pref;
private CheckBoxPreference mRotation180Pref;
private CheckBoxPreference mRotation270Pref;
public static final int ROTATION_0_MODE = 1;
public static final int ROTATION_90_MODE = 2;
public static final int ROTATION_180_MODE = 4;
public static final int ROTATION_270_MODE = 8;
private ContentObserver mAccelerometerRotationObserver = new ContentObserver(new Handler()) {
@Override
public void onChange(boolean selfChange) {
updateAccelerometerRotationSwitch();
}
};
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.display_rotation);
PreferenceScreen prefSet = getPreferenceScreen();
mAccelerometer = (SwitchPreference) findPreference(KEY_ACCELEROMETER);
mAccelerometer.setPersistent(false);
mRotation0Pref = (CheckBoxPreference) prefSet.findPreference(ROTATION_0_PREF);
mRotation90Pref = (CheckBoxPreference) prefSet.findPreference(ROTATION_90_PREF);
mRotation180Pref = (CheckBoxPreference) prefSet.findPreference(ROTATION_180_PREF);
mRotation270Pref = (CheckBoxPreference) prefSet.findPreference(ROTATION_270_PREF);
int mode = Settings.System.getInt(getContentResolver(),
Settings.System.ACCELEROMETER_ROTATION_ANGLES,
ROTATION_0_MODE | ROTATION_90_MODE | ROTATION_270_MODE);
mRotation0Pref.setChecked((mode & ROTATION_0_MODE) != 0);
mRotation90Pref.setChecked((mode & ROTATION_90_MODE) != 0);
mRotation180Pref.setChecked((mode & ROTATION_180_MODE) != 0);
mRotation270Pref.setChecked((mode & ROTATION_270_MODE) != 0);
boolean hasRotationLock = false;
// getResources().getBoolean(
// com.android.internal.R.bool.config_hasRotationLockSwitch);
if (hasRotationLock) {
// Disable accelerometer switch, but leave others enabled
mAccelerometer.setEnabled(false);
mRotation0Pref.setDependency(null);
mRotation90Pref.setDependency(null);
mRotation180Pref.setDependency(null);
mRotation270Pref.setDependency(null);
}
}
@Override
public void onResume() {
super.onResume();
updateState();
getContentResolver().registerContentObserver(
Settings.System.getUriFor(Settings.System.ACCELEROMETER_ROTATION), true,
mAccelerometerRotationObserver);
}
@Override
public void onPause() {
super.onPause();
getContentResolver().unregisterContentObserver(mAccelerometerRotationObserver);
}
private void updateState() {
updateAccelerometerRotationSwitch();
}
private void updateAccelerometerRotationSwitch() {
mAccelerometer.setChecked(!RotationPolicy.isRotationLocked(getActivity()));
}
private int getRotationBitmask() {
int mode = 0;
if (mRotation0Pref.isChecked()) {
mode |= ROTATION_0_MODE;
}
if (mRotation90Pref.isChecked()) {
mode |= ROTATION_90_MODE;
}
if (mRotation180Pref.isChecked()) {
mode |= ROTATION_180_MODE;
}
if (mRotation270Pref.isChecked()) {
mode |= ROTATION_270_MODE;
}
return mode;
}
@Override
public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen,
Preference preference) {
if (preference == mAccelerometer) {
RotationPolicy.setRotationLockForAccessibility(getActivity(),
!mAccelerometer.isChecked());
} else if (preference == mRotation0Pref ||
preference == mRotation90Pref ||
preference == mRotation180Pref ||
preference == mRotation270Pref) {
int mode = getRotationBitmask();
if (mode == 0) {
mode |= ROTATION_0_MODE;
mRotation0Pref.setChecked(true);
}
Settings.System.putInt(getActivity().getContentResolver(),
Settings.System.ACCELEROMETER_ROTATION_ANGLES, mode);
return true;
}
return super.onPreferenceTreeClick(preferenceScreen, preference);
}
}
| {'content_hash': '63babdca710a203b5d864fdeda117148', 'timestamp': '', 'source': 'github', 'line_count': 147, 'max_line_length': 97, 'avg_line_length': 37.40816326530612, 'alnum_prop': 0.6783051463902527, 'repo_name': 'manuelmagix/android_packages_apps_Settings', 'id': '45e8e239ee4cc293a33bdd5459992fc77b16459c', 'size': '6110', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/com/android/settings/cyanogenmod/DisplayRotation.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '6041065'}, {'name': 'Makefile', 'bytes': '3909'}]} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="author" content="Open Knowledge">
<meta name="description" content="The Global Open Data Index assesses the state of open government data around the world.
">
<meta name="keywords" content="Open Government, Open Data, Government Transparency, Open Knowledge
">
<meta property="og:type" content="website"/>
<meta property="og:title" content="Open Data Index - Open Knowledge"/>
<meta property="og:site_name" content="Open Data Index"/>
<meta property="og:description"
content="The Global Open Data Index assesses the state of open government data around the world."/>
<meta property="og:image" content="/static/images/favicon.ico"/>
<title>Tunisia / Procurement tenders (2014) | Global Open Data Index by Open Knowledge</title>
<base href="/">
<!--[if lt IE 9]>
<script src="/static/vendor/html5shiv.min.js"></script>
<![endif]-->
<link rel="stylesheet" href="/static/css/site.css">
<link rel="icon" href="/static/images/favicon.ico">
<script>
var siteUrl = '';
</script>
</head>
<body class="na">
<div class="fixed-ok-panel">
<div id="ok-panel" class="closed">
<iframe src="http://assets.okfn.org/themes/okfn/okf-panel.html" scrolling="no"></iframe>
</div>
<a class="ok-ribbon"><img src="http://okfnlabs.org/ok-panel/assets/images/ok-ribbon.png" alt="Open Knowledge"></a>
</div>
<header id="header">
<nav class="navbar navbar-default" role="navigation">
<div class="container">
<div>
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
data-target="#navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<div class="logo">
<a href="/">
<img src="/static/images/logo2.png">
<span>Global<br/>Open Data Index</span>
</a>
</div>
</div>
<div class="collapse navbar-collapse" id="navbar-collapse">
<ul class="nav navbar-nav" style="margin-right: 132px;">
<li>
<a href="/place/" title="About the Open Data Index project">
Places
</a>
</li>
<li>
<a href="/dataset/" title="About the Open Data Index project">
Datasets
</a>
</li>
<li>
<a href="/download/" title="Download Open Data Index data">
Download
</a>
</li>
<li>
<a href="/insights/" title="Insights">
Insights
</a>
</li>
<li>
<a href="/methodology/"
title="The methodology behind the Open Data Index">
Methodology
</a>
</li>
<li>
<a href="/about/" title="About the Open Data Index project">
About
</a>
</li>
<li>
<a href="/press/"
title="Press information for the Open Data Index">
Press
</a>
</li>
</ul>
</div>
</div>
</div>
</nav>
</header>
<div class="container">
<div class="content">
<div class="row">
<div class="col-md-12">
<ol class="breadcrumb">
<li>
<a href="/">Home</a>
</li>
<li class="active">Tunisia / Procurement tenders (2014)</li>
</ol>
<header class="page-header">
<h1>Tunisia / Procurement tenders (2014)</h1>
</header>
<h3>Sorry</h3>
<p>
There is no data available for Tunisia / Procurement tenders (2014) in the Index.
</p>
</div>
</div>
</div>
</div>
<footer id="footer">
<div class="container">
<div class="row">
<div class="footer-main col-md-8">
<div class="footer-attribution">
<p>
<a href="http://opendefinition.org/ossd/" title="Open Online Software Service">
<img src="http://assets.okfn.org/images/ok_buttons/os_80x15_orange_grey.png" alt=""
border=""/>
</a>
<a href="http://opendefinition.org/okd/" title="Open Online Software Service">
<img src="http://assets.okfn.org/images/ok_buttons/od_80x15_blue.png" alt="" border=""/>
</a>
<a href="http://opendefinition.org/okd/" title="Open Content">
<img src="http://assets.okfn.org/images/ok_buttons/oc_80x15_blue.png" alt="" border=""/>
</a>
–
<a href="http://creativecommons.org/licenses/by/3.0/"
title="Content Licensed under a CC Attribution"></a>
<a href="http://opendatacommons.org/licenses/pddl/1.0"
title="Data License (Public Domain)">Data License (Public
Domain)</a>
</p>
</div>
<div class="footer-meta">
<p>
This service is run by <a href="https://okfn.org/" title="Open Knowledge">Open Knowledge</a>
</p> <a class="naked" href="http://okfn.org/" title="Open Knowledge"><img
src="http://assets.okfn.org/p/okfn/img/okfn-logo-landscape-black-s.png" alt="" height="28"></a>
</div>
</div>
<div class="footer-links col-md-2">
<li><a href="http://okfn.org/" title="Open Knowledge">Open Knowledge</a></li>
<li><a href="http://okfn.org/opendata/" title="What is Open Data?">What is
Open Data?</a></li>
<li><a href="http://census.okfn.org/" title="Run your own Index">Run your
own Index</a></li>
<li><a href="https://github.com/okfn/opendataindex" title="The source code for Open Data Index">Source Code</a></li>
</div>
<div class="footer-links col-md-2">
<li><a href="/" title="Open Data Index home">Home</a></li>
<li><a href="/download/" title="Download data">Download</a></li>
<li><a href="/methodology/"
title="The methodology behind the Open Data Index">Methodology</a></li>
<li><a href="/faq/" title=" Open Data Index FAQ">FAQ</a></li>
<li><a href="/about/" title="About the Open Data Index">About</a></li>
<li><a href="/about/" title="Contact us">Contact</a></li>
<li><a href="/press/" title="Press">Press</a></li>
</div>
</div>
</div>
</footer>
<script data-main="/static/scripts/site" src="/static/scripts/require.js"></script>
</body>
</html> | {'content_hash': '1671dd9746e55b8fa1235ac335b86280', 'timestamp': '', 'source': 'github', 'line_count': 180, 'max_line_length': 132, 'avg_line_length': 45.3, 'alnum_prop': 0.45830267353446164, 'repo_name': 'okfn/opendataindex-2015', 'id': '2b9f9e488c3ecb8b54f1a1d3b8ec2b78e1569808', 'size': '8154', 'binary': False, 'copies': '1', 'ref': 'refs/heads/gh-pages', 'path': 'place/tunisia/procurement/2014/index.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '277465'}, {'name': 'HTML', 'bytes': '169425658'}, {'name': 'JavaScript', 'bytes': '37060'}]} |
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _core = require('./core');
var _core2 = _interopRequireDefault(_core);
var _TailSpin = require('./TailSpin');
var _TailSpin2 = _interopRequireDefault(_TailSpin);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
exports.default = function (ComposedComponent) {
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var _ref$LoadingIndicator = _ref.LoadingIndicator,
LoadingIndicator = _ref$LoadingIndicator === undefined ? _TailSpin2.default : _ref$LoadingIndicator,
rest = _objectWithoutProperties(_ref, ['LoadingIndicator']);
return (0, _core2.default)(ComposedComponent, _extends({}, rest, { LoadingIndicator: LoadingIndicator }));
}; | {'content_hash': '4bddb7234a720dfe3c54be1b25d7b419', 'timestamp': '', 'source': 'github', 'line_count': 29, 'max_line_length': 257, 'avg_line_length': 44.93103448275862, 'alnum_prop': 0.6861089792785878, 'repo_name': 'save-password/save-password.github.io', 'id': '4e8085ddc618243a50a80de5c48696608e282d85', 'size': '1303', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'node_modules/hoc-react-loader/build/index.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '14281'}, {'name': 'HTML', 'bytes': '10627'}, {'name': 'JavaScript', 'bytes': '77636'}]} |
package product.model;
public class ProductVO {
private String pcode; // varchar2(10) constraint products_pk primary key,
private String pname; // varchar2(30),
private String price; // number(8),
private String quant; // number(5),
private String pdesc; // varchar2(200)
public String getPcode() {
return pcode;
}
public void setPcode(String pcode) {
this.pcode = pcode;
}
public String getPname() {
return pname;
}
public void setPname(String pname) {
this.pname = pname;
}
public String getPrice() {
return price;
}
public void setPrice(String price) {
this.price = price;
}
public String getQuant() {
return quant;
}
public void setQuant(String quant) {
this.quant = quant;
}
public String getPdesc() {
return pdesc;
}
public void setPdesc(String pdesc) {
this.pdesc = pdesc;
}
@Override
public String toString() {
return "ProductVO [pcode=" + pcode + ", pname=" + pname + ", price="
+ price + ", quant=" + quant + ", pdesc=" + pdesc + "]";
}
}
| {'content_hash': 'c1a3ca6acbb7b6fee1c7c7eba149bf7f', 'timestamp': '', 'source': 'github', 'line_count': 44, 'max_line_length': 75, 'avg_line_length': 22.90909090909091, 'alnum_prop': 0.6617063492063492, 'repo_name': 'aircha/eGovFWStudy', 'id': 'a2ab063f5ddcf456c6bc32c73e73ae67880deab7', 'size': '1008', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'product/src/main/java/product/model/ProductVO.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '1262'}, {'name': 'Java', 'bytes': '66785'}]} |
<?xml version="1.0" encoding="utf-8"?>
<Application xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Name="fabric:/MailboxService" xmlns="http://schemas.microsoft.com/2011/01/fabric">
<Parameters>
<Parameter Name="Mailbox_InstanceCount" Value="1" />
</Parameters>
</Application> | {'content_hash': 'e5a86810fc4988da970f23cfeced11fd', 'timestamp': '', 'source': 'github', 'line_count': 6, 'max_line_length': 194, 'avg_line_length': 56.166666666666664, 'alnum_prop': 0.7210682492581603, 'repo_name': 'odaibert/Service-Fabric-Self-Scale-Service', 'id': 'c645c1340cab04a0a072394e8417930b3d5560ad', 'size': '339', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'MailboxService/MailboxService/MailboxService/ApplicationParameters/Local.1Node.xml', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C#', 'bytes': '83585'}, {'name': 'PowerShell', 'bytes': '18978'}]} |
package com.intel.analytics.bigdl.nn
import com.intel.analytics.bigdl.nn.abstractnn.DataFormat
import com.intel.analytics.bigdl.tensor.Tensor
import com.intel.analytics.bigdl.utils.BigDLSpecHelper
class SpatialSeperableConvolutionSpec extends BigDLSpecHelper {
"SpatialSeperableConvolution NHWC and NCHW" should "have same output" in {
val depthWeightNHWC = Tensor[Float](2, 2, 3, 1).rand()
val depthWeightNCHW = depthWeightNHWC.transpose(1, 4).transpose(2, 4).transpose(2, 3)
.contiguous()
val pointWeightNHWC = Tensor[Float](1, 1, 3, 6).rand()
val pointWeightNCHW = pointWeightNHWC.transpose(1, 4).transpose(2, 4).transpose(2, 3)
.contiguous()
val convNHWC = SpatialSeperableConvolution[Float](3, 6, 1, 2, 2, dataFormat = DataFormat.NHWC,
initDepthWeight = depthWeightNHWC, initPointWeight = pointWeightNHWC)
val convNCHW = SpatialSeperableConvolution[Float](3, 6, 1, 2, 2, dataFormat = DataFormat.NCHW,
initDepthWeight = depthWeightNCHW, initPointWeight = pointWeightNCHW)
val inputNHWC = Tensor[Float](2, 24, 24, 3).rand()
val inputNCHW = inputNHWC.transpose(2, 4).transpose(3, 4).contiguous()
val outputNHWC = convNHWC.forward(inputNHWC)
val outputNCHW = convNCHW.forward(inputNCHW)
val convert = outputNHWC.transpose(2, 4).transpose(3, 4).contiguous()
convert.almostEqual(outputNCHW, 1e-5) should be(true)
val gradOutputNHWC = Tensor[Float](2, 23, 23, 6).rand()
val gradOutputNCHW = gradOutputNHWC.transpose(2, 4).transpose(3, 4).contiguous()
val gradInputNHWC = convNHWC.backward(inputNHWC, gradOutputNHWC)
val gradInputNCHW = convNCHW.backward(inputNCHW, gradOutputNCHW)
val convertGradInput = gradInputNHWC.transpose(2, 4).transpose(3, 4).contiguous()
convertGradInput.almostEqual(gradInputNCHW, 1e-5) should be(true)
convNHWC.parameters()._2.zip(convNCHW.parameters()._2).map { case(p1, p2) =>
if (p1.nDimension() == 4) {
val convert = p2.transpose(1, 4).transpose(1, 3).transpose(2, 3)
p1.almostEqual(convert, 1e-3) should be(true)
} else {
p1.almostEqual(p2, 1e-3) should be(true)
}
}
}
"SpatialSeperableConvolution NHWC and NCHW" should "have same output when depth mul is 2" in {
val depthWeightNHWC = Tensor[Float](2, 2, 3, 2).rand()
val depthWeightNCHW = depthWeightNHWC.transpose(1, 4).transpose(2, 4).transpose(2, 3)
.contiguous()
val pointWeightNHWC = Tensor[Float](1, 1, 6, 6).rand()
val pointWeightNCHW = pointWeightNHWC.transpose(1, 4).transpose(2, 4).transpose(2, 3)
.contiguous()
val convNHWC = SpatialSeperableConvolution[Float](3, 6, 2, 2, 2, dataFormat = DataFormat.NHWC,
initDepthWeight = depthWeightNHWC, initPointWeight = pointWeightNHWC)
val convNCHW = SpatialSeperableConvolution[Float](3, 6, 2, 2, 2, dataFormat = DataFormat.NCHW,
initDepthWeight = depthWeightNCHW, initPointWeight = pointWeightNCHW)
val inputNHWC = Tensor[Float](2, 24, 24, 3).rand()
val inputNCHW = inputNHWC.transpose(2, 4).transpose(3, 4).contiguous()
val outputNHWC = convNHWC.forward(inputNHWC)
val outputNCHW = convNCHW.forward(inputNCHW)
val convert = outputNHWC.transpose(2, 4).transpose(3, 4).contiguous()
convert.almostEqual(outputNCHW, 1e-5) should be(true)
val gradOutputNHWC = Tensor[Float](2, 23, 23, 6).rand()
val gradOutputNCHW = gradOutputNHWC.transpose(2, 4).transpose(3, 4).contiguous()
val gradInputNHWC = convNHWC.backward(inputNHWC, gradOutputNHWC)
val gradInputNCHW = convNCHW.backward(inputNCHW, gradOutputNCHW)
val convertGradInput = gradInputNHWC.transpose(2, 4).transpose(3, 4).contiguous()
convertGradInput.almostEqual(gradInputNCHW, 1e-5) should be(true)
convNHWC.parameters()._2.zip(convNCHW.parameters()._2).map { case(p1, p2) =>
if (p1.nDimension() == 4) {
val convert = p2.transpose(1, 4).transpose(1, 3).transpose(2, 3)
p1.almostEqual(convert, 1e-3) should be(true)
} else {
p1.almostEqual(p2, 1e-3) should be(true)
}
}
}
"SpatialSeperableConvolution" should "be able to serialized" in {
val conv = SpatialSeperableConvolution[Float](3, 6, 2, 2, 2)
val file = createTmpFile()
conv.saveModule(file.getAbsolutePath, overWrite = true)
val conv2 = Module.loadModule[Float](file.getAbsolutePath)
}
}
| {'content_hash': '7a4f7ff7f1c2be5699c455efeaaa4141', 'timestamp': '', 'source': 'github', 'line_count': 83, 'max_line_length': 98, 'avg_line_length': 52.493975903614455, 'alnum_prop': 0.7080560018361258, 'repo_name': 'luchy0120/BigDL', 'id': 'a899fd0aba9a5d87c9b85bead83c68371ff45ed6', 'size': '4958', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'spark/dl/src/test/scala/com/intel/analytics/bigdl/nn/SpatialSeperableConvolutionSpec.scala', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '6829'}, {'name': 'Lua', 'bytes': '1904'}, {'name': 'Python', 'bytes': '715214'}, {'name': 'RobotFramework', 'bytes': '18873'}, {'name': 'Scala', 'bytes': '6254650'}, {'name': 'Shell', 'bytes': '55259'}]} |
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
Sp. pl. 1:491. 1753
#### Original name
null
### Remarks
null | {'content_hash': 'babf569fcdde2beaa4ab1fe6f24d1835', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 39, 'avg_line_length': 11.461538461538462, 'alnum_prop': 0.6778523489932886, 'repo_name': 'mdoering/backbone', 'id': 'dc5f6393cec7b547146a13a3f490587ecf99de0d', 'size': '187', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'life/Plantae/Magnoliophyta/Magnoliopsida/Rosales/Rosaceae/Rosa/Rosa canina/README.md', 'mode': '33188', 'license': 'apache-2.0', 'language': []} |
<?php
declare(strict_types=1);
namespace Sonata\PageBundle\Model;
/**
* SnapshotPageProxyInterface.
*
* @author Fabien D. <[email protected]>
*/
interface SnapshotPageProxyInterface extends PageInterface, \Serializable
{
}
| {'content_hash': '43d8ffcd5be47b1cf95b92646d2d3102', 'timestamp': '', 'source': 'github', 'line_count': 16, 'max_line_length': 73, 'avg_line_length': 14.5, 'alnum_prop': 0.7456896551724138, 'repo_name': 'sonata-project/SonataPageBundle', 'id': '07c6d6e72752f8290b8d1021e55e5559220c0772', 'size': '479', 'binary': False, 'copies': '2', 'ref': 'refs/heads/3.x', 'path': 'src/Model/SnapshotPageProxyInterface.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '18862'}, {'name': 'JavaScript', 'bytes': '109021'}, {'name': 'Makefile', 'bytes': '2652'}, {'name': 'PHP', 'bytes': '821181'}, {'name': 'SCSS', 'bytes': '18198'}, {'name': 'Twig', 'bytes': '55787'}]} |
package jsprit.core.util;
public interface Locations {
public abstract Coordinate getCoord(String id);
}
| {'content_hash': '175c8a51999038207ff7ac6b1c5f7344', 'timestamp': '', 'source': 'github', 'line_count': 11, 'max_line_length': 48, 'avg_line_length': 10.272727272727273, 'alnum_prop': 0.7522123893805309, 'repo_name': 'skagrawal10/jsprit-web', 'id': '739fb82488ea3e3d278942c32368d555fd673992', 'size': '991', 'binary': False, 'copies': '4', 'ref': 'refs/heads/master', 'path': 'jsprit-core/src/main/java/jsprit/core/util/Locations.java', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '463339'}, {'name': 'Groff', 'bytes': '965'}, {'name': 'HTML', 'bytes': '4767685'}, {'name': 'Java', 'bytes': '1160911'}, {'name': 'JavaScript', 'bytes': '5098092'}, {'name': 'PHP', 'bytes': '85898'}, {'name': 'Python', 'bytes': '42582'}]} |
JSONEditor.defaults.themes.bootstrap2 = JSONEditor.AbstractTheme.extend({
getRangeInput: function(min, max, step) {
// TODO: use bootstrap slider
return this._super(min, max, step);
},
getGridContainer: function() {
var el = document.createElement('div');
el.className = 'container-fluid';
return el;
},
getGridRow: function() {
var el = document.createElement('div');
el.className = 'row-fluid';
return el;
},
getFormInputLabel: function(text) {
var el = this._super(text);
el.style.display = 'inline-block';
el.style.fontWeight = 'bold';
return el;
},
setGridColumnSize: function(el,size) {
el.className = 'span'+size;
},
getSelectInput: function(options) {
var input = this._super(options);
input.style.width = 'auto';
input.style.maxWidth = '98%';
return input;
},
getFormInputField: function(type) {
var el = this._super(type);
el.style.width = '98%';
return el;
},
afterInputReady: function(input) {
if(input.controlgroup) return;
input.controlgroup = this.closest(input,'.control-group');
input.controls = this.closest(input,'.controls');
if(this.closest(input,'.compact')) {
input.controlgroup.className = input.controlgroup.className.replace(/control-group/g,'').replace(/[ ]{2,}/g,' ');
input.controls.className = input.controlgroup.className.replace(/controls/g,'').replace(/[ ]{2,}/g,' ');
input.style.marginBottom = 0;
}
if (this.queuedInputErrorText) {
var text = this.queuedInputErrorText;
delete this.queuedInputErrorText;
this.addInputError(input,text);
}
// TODO: use bootstrap slider
},
getIndentedPanel: function() {
var el = document.createElement('div');
el.className = 'well well-small';
return el;
},
getFormInputDescription: function(text) {
var el = document.createElement('p');
el.className = 'help-inline';
el.textContent = text;
return el;
},
getFormControl: function(label, input, description) {
var ret = document.createElement('div');
ret.className = 'control-group';
var controls = document.createElement('div');
controls.className = 'controls';
if(label && input.getAttribute('type') === 'checkbox') {
ret.appendChild(controls);
label.className += ' checkbox';
label.appendChild(input);
controls.appendChild(label);
controls.style.height = '30px';
}
else {
if(label) {
label.className += ' control-label';
ret.appendChild(label);
}
controls.appendChild(input);
ret.appendChild(controls);
}
if(description) controls.appendChild(description);
return ret;
},
getHeaderButtonHolder: function() {
var el = this.getButtonHolder();
el.style.marginLeft = '10px';
return el;
},
getButtonHolder: function() {
var el = document.createElement('div');
el.className = 'btn-group';
return el;
},
getButton: function(text, icon, title) {
var el = this._super(text, icon, title);
el.className += ' btn btn-default';
return el;
},
getTable: function() {
var el = document.createElement('table');
el.className = 'table table-bordered';
el.style.width = 'auto';
el.style.maxWidth = 'none';
return el;
},
addInputError: function(input,text) {
if(!input.controlgroup) {
this.queuedInputErrorText = text;
return;
}
if(!input.controlgroup || !input.controls) return;
input.controlgroup.className += ' error';
if(!input.errmsg) {
input.errmsg = document.createElement('p');
input.errmsg.className = 'help-block errormsg';
input.controls.appendChild(input.errmsg);
}
else {
input.errmsg.style.display = '';
}
input.errmsg.textContent = text;
},
removeInputError: function(input) {
if(!input.controlgroup) {
delete this.queuedInputErrorText;
}
if(!input.errmsg) return;
input.errmsg.style.display = 'none';
input.controlgroup.className = input.controlgroup.className.replace(/\s?error/g,'');
},
getTabHolder: function() {
var el = document.createElement('div');
el.className = 'tabbable tabs-left';
el.innerHTML = "<ul class='nav nav-tabs span2' style='margin-right: 0;'></ul><div class='tab-content span10' style='overflow:visible;'></div>";
return el;
},
getTab: function(text) {
var el = document.createElement('li');
var a = document.createElement('a');
a.setAttribute('href','#');
a.appendChild(text);
el.appendChild(a);
return el;
},
getTabContentHolder: function(tab_holder) {
return tab_holder.children[1];
},
getTabContent: function() {
var el = document.createElement('div');
el.className = 'tab-pane active';
return el;
},
markTabActive: function(tab) {
tab.className += ' active';
},
markTabInactive: function(tab) {
tab.className = tab.className.replace(/\s?active/g,'');
},
addTab: function(holder, tab) {
holder.children[0].appendChild(tab);
},
getProgressBar: function() {
var container = document.createElement('div');
container.className = 'progress';
var bar = document.createElement('div');
bar.className = 'bar';
bar.style.width = '0%';
container.appendChild(bar);
return container;
},
updateProgressBar: function(progressBar, progress) {
if (!progressBar) return;
progressBar.firstChild.style.width = progress + "%";
},
updateProgressBarUnknown: function(progressBar) {
if (!progressBar) return;
progressBar.className = 'progress progress-striped active';
progressBar.firstChild.style.width = '100%';
}
});
| {'content_hash': 'cab9a9a1895416a703bc7825c74aa080', 'timestamp': '', 'source': 'github', 'line_count': 192, 'max_line_length': 147, 'avg_line_length': 29.8125, 'alnum_prop': 0.6409853249475891, 'repo_name': 'abloomston/json-editor', 'id': 'a470e6d6c94c956b04e1240ba69ae9ab3f0021b5', 'size': '5724', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/themes/bootstrap2.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'HTML', 'bytes': '68962'}, {'name': 'JavaScript', 'bytes': '423344'}]} |
<div class="content">
<div class="dashboard-metrics">
<div class="dashboard-metric">
<img src="images/person.png" /><br/>
<p class="dashboard-metric-value">{{ numberOfPlayers }}</p>
<p>active players</p>
</div>
<div class="dashboard-metric">
<img src="images/trophy.png" /><br/>
<p class="dashboard-metric-value">{{ numberAchieved }}</p>
<p>found treasures</p>
</div>
</div>
<div>
<h2>Top Players</h2>
<p>Out of {{ numPlaying }} players with at least one award, here are people who have found more than one treasure.</p>
<ol>
<li ng-repeat="p in topPlayers | orderBy:'-achievements.length'">
<span class="badge">{{ p.achievements.length }}</span>
{{ p.name }}
</li>
</ol>
</div>
<div>
<h2>Faculty Activity</h2>
<ol>
<li ng-repeat="a in achievementsGranted | orderBy:['-n','name']">
<span class="badge">{{ a.n }}</span>
{{ a.name }}
</li>
</ol>
</div>
<div class="footer">
<img src="images/rcbmi_tag.png" />
</div>
</div> | {'content_hash': '9469bcd8c5f57a7c8508ddb0ed240030', 'timestamp': '', 'source': 'github', 'line_count': 36, 'max_line_length': 120, 'avg_line_length': 27.97222222222222, 'alnum_prop': 0.5958291956305859, 'repo_name': 'bmamlin/treasurehunt', 'id': '28d31f6cbf84ca4b37414fe7ee83dbcacfc6d178', 'size': '1007', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'admin/views/main.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '9476'}, {'name': 'Dockerfile', 'bytes': '274'}, {'name': 'HTML', 'bytes': '30495'}, {'name': 'JavaScript', 'bytes': '163217'}, {'name': 'Shell', 'bytes': '119'}]} |
package io.khe.kenthackenough;
/**
* Simple class to hold config options for the rest of the application
*/
public class Config{
// the url of the api
public static final String API_URL = "http://api.khe.pdilyard.com/v1.0";
// client id, only used in authentication
public static final String API_CLIENT= "isaacpark";
}
| {'content_hash': 'b1249e55d7bde1aa0a6e170c05e89134', 'timestamp': '', 'source': 'github', 'line_count': 12, 'max_line_length': 76, 'avg_line_length': 28.333333333333332, 'alnum_prop': 0.7029411764705882, 'repo_name': 'unscodst/kenthackenough-android', 'id': 'a0abf5944cb4adce14d8ddeee8cae49a2d8e34bb', 'size': '340', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'app/src/main/java/io/khe/kenthackenough/Config.java', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Java', 'bytes': '257773'}]} |
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | {'content_hash': 'b320dab2b310e251665337d9815135cc', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 31, 'avg_line_length': 9.692307692307692, 'alnum_prop': 0.7063492063492064, 'repo_name': 'mdoering/backbone', 'id': '500fa5ea935d79738d29c8bf930e2d0c2b8c49cd', 'size': '195', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'life/Plantae/Magnoliophyta/Magnoliopsida/Saxifragales/Crassulaceae/Echeveria/Echeveria elegans/Echeveria elegans kesselringiana/README.md', 'mode': '33188', 'license': 'apache-2.0', 'language': []} |
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------------------------------------------------------------
using Microsoft.Azure.Commands.Common.Authentication;
using Microsoft.Azure.Commands.Common.Authentication.Models;
using Microsoft.Azure.Internal.Subscriptions.Models;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using System;
using System.Collections.Generic;
namespace Microsoft.Azure.Commands.ResourceManager.Common
{
internal static class ModelExtensions
{
internal static AzureSubscription ToAzureSubscription(this Subscription other, AzureContext context)
{
var subscription = new AzureSubscription();
subscription.Account = context.Account != null ? context.Account.Id : null;
subscription.Environment = context.Environment != null ? context.Environment.Name : EnvironmentName.AzureCloud;
subscription.Id = new Guid(other.SubscriptionId);
subscription.Name = other.DisplayName;
subscription.State = other.State.ToString();
subscription.SetProperty(AzureSubscription.Property.Tenants,
context.Tenant.Id.ToString());
return subscription;
}
public static List<AzureTenant> MergeTenants(
this AzureAccount account,
IEnumerable<TenantIdDescription> tenants,
IAccessToken token)
{
List<AzureTenant> result = null;
if (tenants != null)
{
var existingTenants = new List<AzureTenant>();
account.SetProperty(AzureAccount.Property.Tenants, null);
tenants.ForEach((t) =>
{
existingTenants.Add(new AzureTenant { Id = new Guid(t.TenantId), Domain = token.GetDomain() });
account.SetOrAppendProperty(AzureAccount.Property.Tenants, t.TenantId);
});
result = existingTenants;
}
return result;
}
}
}
| {'content_hash': '6f39842c0ccb725626d3c9165a88813c', 'timestamp': '', 'source': 'github', 'line_count': 61, 'max_line_length': 123, 'avg_line_length': 43.68852459016394, 'alnum_prop': 0.623639774859287, 'repo_name': 'krkhan/azure-powershell', 'id': '93b2372e69905099e78994e89babc792e87305c4', 'size': '2667', 'binary': False, 'copies': '1', 'ref': 'refs/heads/dev', 'path': 'src/ResourceManager/Profile/Commands.Profile/Models/ModelExtensions.cs', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '16509'}, {'name': 'C#', 'bytes': '38709434'}, {'name': 'HTML', 'bytes': '209'}, {'name': 'JavaScript', 'bytes': '4979'}, {'name': 'PHP', 'bytes': '41'}, {'name': 'PowerShell', 'bytes': '3828428'}, {'name': 'Ruby', 'bytes': '265'}, {'name': 'Shell', 'bytes': '50'}, {'name': 'XSLT', 'bytes': '6114'}]} |
/*
* Copied from https://github.com/alphagov/govuk_frontend_toolkit/blob/master/javascripts/govuk/modules.js
* also see https://github.com/alphagov/govuk_frontend_toolkit/blob/master/docs/javascript.md
*/
(function (global) {
'use strict'
var $ = global.jQuery
var GOVUK = global.GOVUK || {}
GOVUK.Modules = GOVUK.Modules || {}
GOVUK.modules = {
find: function (container) {
container = container || $('body')
var modules
var moduleSelector = '[data-module]'
modules = container.find(moduleSelector)
// Container could be a module too
if (container.is(moduleSelector)) {
modules = modules.add(container)
}
return modules
},
start: function (container) {
var modules = this.find(container)
for (var i = 0, l = modules.length; i < l; i++) {
var module
var element = $(modules[i])
var type = camelCaseAndCapitalise(element.data('module'))
var started = element.data('module-started')
if (typeof GOVUK.Modules[type] === 'function' && !started) {
module = new GOVUK.Modules[type]()
module.start(element)
element.data('module-started', true)
}
}
// eg selectable-table to SelectableTable
function camelCaseAndCapitalise (string) {
return capitaliseFirstLetter(camelCase(string))
}
// http://stackoverflow.com/questions/6660977/convert-hyphens-to-camel-case-camelcase
function camelCase (string) {
return string.replace(/-([a-z])/g, function (g) {
return g.charAt(1).toUpperCase()
})
}
// http://stackoverflow.com/questions/1026069/capitalize-the-first-letter-of-string-in-javascript
function capitaliseFirstLetter (string) {
return string.charAt(0).toUpperCase() + string.slice(1)
}
}
}
global.GOVUK = GOVUK
})(window);
| {'content_hash': '4ac5987997c2e1db3432a29dc8acce62', 'timestamp': '', 'source': 'github', 'line_count': 65, 'max_line_length': 106, 'avg_line_length': 29.353846153846153, 'alnum_prop': 0.6247379454926625, 'repo_name': 'DFEAGILEDEVOPS/gender-pay-gap', 'id': '4fd64299463fee8b3042bce3348f3efa17bbd2c8', 'size': '1908', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Beta/GenderPayGap.WebUI/Scripts/GOVUK/modules.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Batchfile', 'bytes': '947'}, {'name': 'C#', 'bytes': '4414608'}, {'name': 'CSS', 'bytes': '447292'}, {'name': 'HTML', 'bytes': '650101'}, {'name': 'JavaScript', 'bytes': '252420'}]} |
package com.microsoft.azure.management.network.v2019_06_01;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Application gateway BackendHealth pool.
*/
public class ApplicationGatewayBackendHealthPool {
/**
* Reference of an ApplicationGatewayBackendAddressPool resource.
*/
@JsonProperty(value = "backendAddressPool")
private ApplicationGatewayBackendAddressPool backendAddressPool;
/**
* List of ApplicationGatewayBackendHealthHttpSettings resources.
*/
@JsonProperty(value = "backendHttpSettingsCollection")
private List<ApplicationGatewayBackendHealthHttpSettings> backendHttpSettingsCollection;
/**
* Get reference of an ApplicationGatewayBackendAddressPool resource.
*
* @return the backendAddressPool value
*/
public ApplicationGatewayBackendAddressPool backendAddressPool() {
return this.backendAddressPool;
}
/**
* Set reference of an ApplicationGatewayBackendAddressPool resource.
*
* @param backendAddressPool the backendAddressPool value to set
* @return the ApplicationGatewayBackendHealthPool object itself.
*/
public ApplicationGatewayBackendHealthPool withBackendAddressPool(ApplicationGatewayBackendAddressPool backendAddressPool) {
this.backendAddressPool = backendAddressPool;
return this;
}
/**
* Get list of ApplicationGatewayBackendHealthHttpSettings resources.
*
* @return the backendHttpSettingsCollection value
*/
public List<ApplicationGatewayBackendHealthHttpSettings> backendHttpSettingsCollection() {
return this.backendHttpSettingsCollection;
}
/**
* Set list of ApplicationGatewayBackendHealthHttpSettings resources.
*
* @param backendHttpSettingsCollection the backendHttpSettingsCollection value to set
* @return the ApplicationGatewayBackendHealthPool object itself.
*/
public ApplicationGatewayBackendHealthPool withBackendHttpSettingsCollection(List<ApplicationGatewayBackendHealthHttpSettings> backendHttpSettingsCollection) {
this.backendHttpSettingsCollection = backendHttpSettingsCollection;
return this;
}
}
| {'content_hash': '35ec616d1ce581fbb6e999de1e3838ff', 'timestamp': '', 'source': 'github', 'line_count': 64, 'max_line_length': 163, 'avg_line_length': 34.765625, 'alnum_prop': 0.7608988764044944, 'repo_name': 'selvasingh/azure-sdk-for-java', 'id': '970433916abd1ecf77d5f944e085d9e779fe2446', 'size': '2455', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'sdk/network/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/network/v2019_06_01/ApplicationGatewayBackendHealthPool.java', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Java', 'bytes': '29891970'}, {'name': 'JavaScript', 'bytes': '6198'}, {'name': 'PowerShell', 'bytes': '160'}, {'name': 'Shell', 'bytes': '609'}]} |
echo
echo compressing modules ...
# get the source directory ( here )
PART_HERE=${PWD}
echo compressing from : ${PART_HERE}
# get a time-date string for a part of the compressed name, yyyy.mm.dd.hh.mm.ss
DATE_PART=$(date +'%Y.%m.%d.%H.%M.%S')
echo compressing date : ${DATE_PART}
# get the destination for the archive
PART_DEST=$PART_HERE/../
echo compressing dest : $PART_DEST
# get the name of the current directory
PART_BASE=${PWD##*/}
echo compressing base : $PART_BASE
# add them all up
PART_PATH=$(printf '%s%s.%s.%s.tar.gz' ${PART_DEST} ${PART_BASE} ${DATE_PART} $(whoami))
echo compressing path : $PART_PATH
# skip the .git
PART_SKIP=$(printf "%s%s" "--" "exclude-vcs")
echo compressing skip : $PART_SKIP
# get the options for the tar
PART_FLAG='-zcf'
# tell tar to do a decent job of it all
export GZIP=-9
WHOLE_CMD=$(printf "tar %s %s %s %s %s" ${PART_FLAG} ${PART_PATH} ${PART_BASE} ${PART_SKIP})
echo compressing with : $WHOLE_CMD
# move up a directory and execute the command
cd ..
$WHOLE_CMD
echo | {'content_hash': '7b0f609579169da66f6e2c11def78649', 'timestamp': '', 'source': 'github', 'line_count': 48, 'max_line_length': 92, 'avg_line_length': 21.416666666666668, 'alnum_prop': 0.6741245136186771, 'repo_name': 'gaccettola/mortis', 'id': '8d4c70b9ce303e13243bcff78ea6d15a92b7d066', 'size': '1237', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': '_compress.sh', 'mode': '33261', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '66937'}, {'name': 'HTML', 'bytes': '77968'}, {'name': 'JavaScript', 'bytes': '576996'}, {'name': 'PLpgSQL', 'bytes': '353'}, {'name': 'SQLPL', 'bytes': '1904'}, {'name': 'Shell', 'bytes': '22750'}, {'name': 'TypeScript', 'bytes': '436406'}]} |
#include "../../generic/akin/yuv.hpp"
#include "../category.hpp"
#include "../../YCgCo/category.hpp"
namespace color
{
namespace akin
{
template
<
typename tag_name , typename ::color::constant::yuv::reference_enum yuv_reference_number
>
struct yuv< ::color::category::YCgCo< tag_name >, yuv_reference_number >
{
public:
typedef ::color::category::yuv< tag_name, yuv_reference_number > akin_type;
};
}
}
#endif
| {'content_hash': 'ba6978f75f969fc97ddfdf545505eee1', 'timestamp': '', 'source': 'github', 'line_count': 25, 'max_line_length': 101, 'avg_line_length': 20.52, 'alnum_prop': 0.5633528265107213, 'repo_name': 'dmilos/color', 'id': 'e6388255f84cba2263feff89f342eb92d5806470', 'size': '573', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/color/yuv/akin/YCgCo.hpp', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '202084'}, {'name': 'C++', 'bytes': '5689078'}, {'name': 'CMake', 'bytes': '3786'}, {'name': 'Python', 'bytes': '11674'}, {'name': 'Shell', 'bytes': '153373'}]} |
require 'test_helper'
require 'rack/test'
require 'server'
class IntegrationTest < Test::Unit::TestCase
include Rack::Test::Methods
def app
WebHookServer
end
def test_needs_app_id_and_app_token
post '/hook'
assert_equal 'Missing app_id or app_token', last_response.body
end
def test_should_parse_push_from_github
# auth Podio client
stub_request(:post, 'https://api.podio.com/oauth/token').
with(:body => {'app_id' => '42', 'app_token' => 'APP_TOKEN', 'client_id' => true, 'client_secret' => true, 'grant_type'=>'app'}).
to_return(:body => "access_token=lala")
# set bug #60097 to Fixed
stub_request(:get, "https://api.podio.com/app/42/item/60097").to_return(:status => 404)
stub_request(:get, 'https://api.podio.com/item/60097').to_return(:status => 200)
stub_request(:post, "https://api.podio.com/comment/item/60097").to_return(:status => 200)
stub_request(:put, "https://api.podio.com/item/60097/value").with(:body => /Fixed/).to_return(:status => 200)
# only comment on #60095
stub_request(:get, "https://api.podio.com/app/42/item/60095").to_return(:status => 404)
stub_request(:get, 'https://api.podio.com/item/60095').to_return(:status => 200)
stub_request(:post, "https://api.podio.com/comment/item/60095").to_return(:status => 200)
post '/hook?app_id=42&app_token=APP_TOKEN', :payload => fixture_file('sample_payload.json')
assert last_response.ok?
end
def test_should_parse_push_from_github_not_on_master
post '/hook?app_id=42&app_token=APP_TOKEN', :payload => fixture_file('branch_payload.json')
assert last_response.ok?
end
end
| {'content_hash': '57098292f3d5509afc8eedfdeba2d484', 'timestamp': '', 'source': 'github', 'line_count': 44, 'max_line_length': 135, 'avg_line_length': 37.52272727272727, 'alnum_prop': 0.6632344033918837, 'repo_name': 'theflow/podio-github', 'id': 'f6a529a982827d24ee1bb90b6f303dd31d7e7960', 'size': '1651', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'test/integration_test.rb', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Ruby', 'bytes': '9838'}]} |
package co.cask.cdap.data2.transaction.queue.coprocessor.hbase10;
import co.cask.cdap.common.queue.QueueName;
import co.cask.cdap.data2.transaction.coprocessor.DefaultTransactionStateCacheSupplier;
import co.cask.cdap.data2.transaction.queue.ConsumerEntryState;
import co.cask.cdap.data2.transaction.queue.QueueEntryRow;
import co.cask.cdap.data2.transaction.queue.hbase.HBaseQueueAdmin;
import co.cask.cdap.data2.transaction.queue.hbase.SaltedHBaseQueueStrategy;
import co.cask.cdap.data2.transaction.queue.hbase.coprocessor.CConfigurationReader;
import co.cask.cdap.data2.transaction.queue.hbase.coprocessor.ConsumerConfigCache;
import co.cask.cdap.data2.transaction.queue.hbase.coprocessor.ConsumerInstance;
import co.cask.cdap.data2.transaction.queue.hbase.coprocessor.QueueConsumerConfig;
import co.cask.cdap.data2.util.TableId;
import co.cask.cdap.data2.util.hbase.HTable10NameConverter;
import co.cask.tephra.coprocessor.TransactionStateCache;
import co.cask.tephra.persist.TransactionVisibilityState;
import com.google.common.base.Supplier;
import com.google.common.io.InputSupplier;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.Cell;
import org.apache.hadoop.hbase.CoprocessorEnvironment;
import org.apache.hadoop.hbase.HTableDescriptor;
import org.apache.hadoop.hbase.KeyValue;
import org.apache.hadoop.hbase.TableName;
import org.apache.hadoop.hbase.client.HTableInterface;
import org.apache.hadoop.hbase.coprocessor.BaseRegionObserver;
import org.apache.hadoop.hbase.coprocessor.ObserverContext;
import org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment;
import org.apache.hadoop.hbase.regionserver.InternalScanner;
import org.apache.hadoop.hbase.regionserver.ScanType;
import org.apache.hadoop.hbase.regionserver.Store;
import org.apache.hadoop.hbase.regionserver.compactions.CompactionRequest;
import org.apache.hadoop.hbase.util.Bytes;
import java.io.IOException;
import java.util.Iterator;
import java.util.List;
/**
* RegionObserver for queue table. This class should only have JSE and HBase classes dependencies only.
* It can also has dependencies on CDAP classes provided that all the transitive dependencies stay within
* the mentioned scope.
*
* This region observer does queue eviction during flush time and compact time by using queue consumer state
* information to determine if a queue entry row can be omitted during flush/compact.
*/
public final class HBaseQueueRegionObserver extends BaseRegionObserver {
private static final Log LOG = LogFactory.getLog(HBaseQueueRegionObserver.class);
private TableName configTableName;
private CConfigurationReader cConfReader;
TransactionStateCache txStateCache;
private Supplier<TransactionVisibilityState> txSnapshotSupplier;
private ConsumerConfigCache configCache;
private int prefixBytes;
private String namespaceId;
private String appName;
private String flowName;
@Override
public void start(CoprocessorEnvironment env) {
if (env instanceof RegionCoprocessorEnvironment) {
HTableDescriptor tableDesc = ((RegionCoprocessorEnvironment) env).getRegion().getTableDesc();
String hTableName = tableDesc.getNameAsString();
String prefixBytes = tableDesc.getValue(HBaseQueueAdmin.PROPERTY_PREFIX_BYTES);
try {
// Default to SALT_BYTES for the older salted queue implementation.
this.prefixBytes = prefixBytes == null ? SaltedHBaseQueueStrategy.SALT_BYTES : Integer.parseInt(prefixBytes);
} catch (NumberFormatException e) {
// Shouldn't happen for table created by cdap.
LOG.error("Unable to parse value of '" + HBaseQueueAdmin.PROPERTY_PREFIX_BYTES + "' property. " +
"Default to " + SaltedHBaseQueueStrategy.SALT_BYTES, e);
this.prefixBytes = SaltedHBaseQueueStrategy.SALT_BYTES;
}
HTable10NameConverter nameConverter = new HTable10NameConverter();
namespaceId = nameConverter.from(tableDesc).getNamespace().getId();
appName = HBaseQueueAdmin.getApplicationName(hTableName);
flowName = HBaseQueueAdmin.getFlowName(hTableName);
Configuration conf = env.getConfiguration();
String hbaseNamespacePrefix = nameConverter.getNamespacePrefix(tableDesc);
TableId queueConfigTableId = HBaseQueueAdmin.getConfigTableId(namespaceId);
final String sysConfigTablePrefix = nameConverter.getSysConfigTablePrefix(tableDesc);
txStateCache = new DefaultTransactionStateCacheSupplier(sysConfigTablePrefix, conf).get();
txSnapshotSupplier = new Supplier<TransactionVisibilityState>() {
@Override
public TransactionVisibilityState get() {
return txStateCache.getLatestState();
}
};
configTableName = nameConverter.toTableName(hbaseNamespacePrefix, queueConfigTableId);
cConfReader = new CConfigurationReader(conf, sysConfigTablePrefix);
configCache = createConfigCache(env);
}
}
@Override
public InternalScanner preFlush(ObserverContext<RegionCoprocessorEnvironment> e,
Store store, InternalScanner scanner) throws IOException {
if (!e.getEnvironment().getRegion().isAvailable()) {
return scanner;
}
LOG.info("preFlush, creates EvictionInternalScanner");
return new EvictionInternalScanner("flush", e.getEnvironment(), scanner);
}
@Override
public InternalScanner preCompact(ObserverContext<RegionCoprocessorEnvironment> e, Store store,
InternalScanner scanner, ScanType type,
CompactionRequest request) throws IOException {
if (!e.getEnvironment().getRegion().isAvailable()) {
return scanner;
}
LOG.info("preCompact, creates EvictionInternalScanner");
return new EvictionInternalScanner("compaction", e.getEnvironment(), scanner);
}
// needed for queue unit-test
@SuppressWarnings("unused")
private void updateCache() throws IOException {
ConsumerConfigCache configCache = this.configCache;
if (configCache != null) {
configCache.updateCache();
}
}
private ConsumerConfigCache getConfigCache(CoprocessorEnvironment env) {
if (!configCache.isAlive()) {
configCache = createConfigCache(env);
}
return configCache;
}
private ConsumerConfigCache createConfigCache(final CoprocessorEnvironment env) {
return ConsumerConfigCache.getInstance(configTableName, cConfReader,
txSnapshotSupplier, new InputSupplier<HTableInterface>() {
@Override
public HTableInterface getInput() throws IOException {
return env.getTable(configTableName);
}
});
}
// need for queue unit-test
private TransactionStateCache getTxStateCache() {
return txStateCache;
}
/**
* An {@link InternalScanner} that will skip queue entries that are safe to be evicted.
*/
private final class EvictionInternalScanner implements InternalScanner {
private final String triggeringAction;
private final RegionCoprocessorEnvironment env;
private final InternalScanner scanner;
// This is just for object reused to reduce objects creation.
private final ConsumerInstance consumerInstance;
private byte[] currentQueue;
private byte[] currentQueueRowPrefix;
private QueueConsumerConfig consumerConfig;
private long totalRows = 0;
private long rowsEvicted = 0;
// couldn't be evicted due to incomplete view of row
private long skippedIncomplete = 0;
private EvictionInternalScanner(String action, RegionCoprocessorEnvironment env, InternalScanner scanner) {
this.triggeringAction = action;
this.env = env;
this.scanner = scanner;
this.consumerInstance = new ConsumerInstance(0, 0);
}
@Override
public boolean next(List<Cell> results) throws IOException {
return next(results, -1);
}
@Override
public boolean next(List<Cell> results, int limit) throws IOException {
boolean hasNext = scanner.next(results, limit);
while (!results.isEmpty()) {
totalRows++;
// Check if it is eligible for eviction.
Cell cell = results.get(0);
// If current queue is unknown or the row is not a queue entry of current queue,
// it either because it scans into next queue entry or simply current queue is not known.
// Hence needs to find the currentQueue
if (currentQueue == null || !QueueEntryRow.isQueueEntry(currentQueueRowPrefix, prefixBytes, cell.getRowArray(),
cell.getRowOffset(), cell.getRowLength())) {
// If not eligible, it either because it scans into next queue entry or simply current queue is not known.
currentQueue = null;
}
// This row is a queue entry. If currentQueue is null, meaning it's a new queue encountered during scan.
if (currentQueue == null) {
QueueName queueName = QueueEntryRow.getQueueName(namespaceId, appName, flowName, prefixBytes,
cell.getRowArray(), cell.getRowOffset(),
cell.getRowLength());
currentQueue = queueName.toBytes();
currentQueueRowPrefix = QueueEntryRow.getQueueRowPrefix(queueName);
consumerConfig = getConfigCache(env).getConsumerConfig(currentQueue);
}
if (consumerConfig == null) {
// no config is present yet, so cannot evict
return hasNext;
}
if (canEvict(consumerConfig, results)) {
rowsEvicted++;
results.clear();
hasNext = scanner.next(results, limit);
} else {
break;
}
}
return hasNext;
}
@Override
public void close() throws IOException {
LOG.info("Region " + env.getRegion().getRegionNameAsString() + " " + triggeringAction +
", rows evicted: " + rowsEvicted + " / " + totalRows + ", skipped incomplete: " + skippedIncomplete);
scanner.close();
}
/**
* Determines the given queue entry row can be evicted.
* @param result All KeyValues of a queue entry row.
* @return true if it can be evicted, false otherwise.
*/
private boolean canEvict(QueueConsumerConfig consumerConfig, List<Cell> result) {
// If no consumer group, this queue is dead, should be ok to evict.
if (consumerConfig.getNumGroups() == 0) {
return true;
}
// If unknown consumer config (due to error), keep the queue.
if (consumerConfig.getNumGroups() < 0) {
return false;
}
// TODO (terence): Right now we can only evict if we see all the data columns.
// It's because it's possible that in some previous flush, only the data columns are flush,
// then consumer writes the state columns. In the next flush, it'll only see the state columns and those
// should not be evicted otherwise the entry might get reprocessed, depending on the consumer start row state.
// This logic is not perfect as if flush happens after enqueue and before dequeue, that entry may never get
// evicted (depends on when the next compaction happens, whether the queue configuration has been change or not).
// There are two data columns, "d" and "m".
// If the size == 2, it should not be evicted as well,
// as state columns (dequeue) always happen after data columns (enqueue).
if (result.size() <= 2) {
skippedIncomplete++;
return false;
}
// "d" and "m" columns always comes before the state columns, prefixed with "s".
Iterator<Cell> iterator = result.iterator();
Cell cell = iterator.next();
if (!QueueEntryRow.isDataColumn(cell.getQualifierArray(), cell.getQualifierOffset())) {
skippedIncomplete++;
return false;
}
cell = iterator.next();
if (!QueueEntryRow.isMetaColumn(cell.getQualifierArray(), cell.getQualifierOffset())) {
skippedIncomplete++;
return false;
}
// Need to determine if this row can be evicted iff all consumer groups have committed process this row.
int consumedGroups = 0;
// Inspect each state column
while (iterator.hasNext()) {
cell = iterator.next();
if (!QueueEntryRow.isStateColumn(cell.getQualifierArray(), cell.getQualifierOffset())) {
continue;
}
// If any consumer has a state != PROCESSED, it should not be evicted
if (!isProcessed(cell, consumerInstance)) {
break;
}
// If it is PROCESSED, check if this row is smaller than the consumer instance startRow.
// Essentially a loose check of committed PROCESSED.
byte[] startRow = consumerConfig.getStartRow(consumerInstance);
if (startRow != null && compareRowKey(cell, startRow) < 0) {
consumedGroups++;
}
}
// It can be evicted if from the state columns, it's been processed by all consumer groups
// Otherwise, this row has to be less than smallest among all current consumers.
// The second condition is for handling consumer being removed after it consumed some entries.
// However, the second condition alone is not good enough as it's possible that in hash partitioning,
// only one consumer is keep consuming when the other consumer never proceed.
return consumedGroups == consumerConfig.getNumGroups()
|| compareRowKey(result.get(0), consumerConfig.getSmallestStartRow()) < 0;
}
private int compareRowKey(Cell cell, byte[] row) {
return Bytes.compareTo(cell.getRowArray(), cell.getRowOffset() + prefixBytes,
cell.getRowLength() - prefixBytes, row, 0, row.length);
}
/**
* Returns {@code true} if the given {@link KeyValue} has a {@link ConsumerEntryState#PROCESSED} state and
* also put the consumer information into the given {@link ConsumerInstance}.
* Otherwise, returns {@code false} and the {@link ConsumerInstance} is left untouched.
*/
private boolean isProcessed(Cell cell, ConsumerInstance consumerInstance) {
int stateIdx = cell.getValueOffset() + cell.getValueLength() - 1;
boolean processed = cell.getValueArray()[stateIdx] == ConsumerEntryState.PROCESSED.getState();
if (processed) {
// Column is "s<groupId>"
long groupId = Bytes.toLong(cell.getQualifierArray(), cell.getQualifierOffset() + 1);
// Value is "<writePointer><instanceId><state>"
int instanceId = Bytes.toInt(cell.getValueArray(), cell.getValueOffset() + Bytes.SIZEOF_LONG);
consumerInstance.setGroupInstance(groupId, instanceId);
}
return processed;
}
}
}
| {'content_hash': 'c637607b5892eed938232c5cde344d04', 'timestamp': '', 'source': 'github', 'line_count': 337, 'max_line_length': 119, 'avg_line_length': 44.3353115727003, 'alnum_prop': 0.700823238069741, 'repo_name': 'hsaputra/cdap', 'id': '678e10be578fad46c68bf6cb9814cc3cc1c63505', 'size': '15543', 'binary': False, 'copies': '3', 'ref': 'refs/heads/develop', 'path': 'cdap-hbase-compat-1.0/src/main/java/co/cask/cdap/data2/transaction/queue/coprocessor/hbase10/HBaseQueueRegionObserver.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '13173'}, {'name': 'CSS', 'bytes': '213685'}, {'name': 'HTML', 'bytes': '443313'}, {'name': 'Java', 'bytes': '16053871'}, {'name': 'JavaScript', 'bytes': '1125968'}, {'name': 'Python', 'bytes': '90731'}, {'name': 'Scala', 'bytes': '30287'}, {'name': 'Shell', 'bytes': '177776'}]} |
import {Component} from 'angular2/core';
import { TeamsProvider } from '../teams/services/teams.provider';
import {Team} from '../team/team';
import {Match} from '../match-day/match';
import {TeamPipe} from '../team/pipes/team.pipe';
@Component({
selector: 'new-team',
templateUrl: './app/match-day/match-day.component.html',
styleUrls: ['./app/match-day/match-day.component.css'],
providers: [TeamsProvider],
pipes: [TeamPipe]
})
export class MatchDayComponent {
days: number[];
day: number;
teams: Team[];
homeTeam: Team;
guestTeam: Team;
matches: Match[];
match: Match;
constructor(private provider: TeamsProvider) {
this.days = [];
for(let i = 1; i <= 30; i++) {
this.days.push(i);
}
this.teams = provider.getTeams();
this.match = new Match();
this.match.home = this.teams[0].id;
this.match.guest = this.teams[1].id;
this.matches = [];
}
onChange(day) { this.day = day; }
saveMatch() {
this.matches.push(this.match)
var homeTeam = this.provider.findById(parseInt(this.match.home));
var guestTeam = this.provider.findById(parseInt(this.match.guest));
this.teams = _.without(this.teams, homeTeam);
this.teams = _.without(this.teams, guestTeam);
this.match = new Match();
}
getTeamLogo(id) {
return this.provider.getTeamLogo(id);
}
getTeamName(id) {
var team = this.provider.findById(parseInt(id));
return team.name;
}
checkTeam(team, id) {
if(!team) return false;
return team.id !== id;
}
}
| {'content_hash': '78de689926cc65998cec21fa0f945a25', 'timestamp': '', 'source': 'github', 'line_count': 61, 'max_line_length': 71, 'avg_line_length': 25.065573770491802, 'alnum_prop': 0.6435578809679529, 'repo_name': 'ytatarynovich/team', 'id': 'fcfecc24e83a96f4818dc21696b62d3d49b4ce73', 'size': '1529', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/app/match-day/match-day.component.ts', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '446675'}, {'name': 'HTML', 'bytes': '9004'}, {'name': 'JavaScript', 'bytes': '65365'}, {'name': 'TypeScript', 'bytes': '22275'}]} |
package com.knowledge.timeline;
import java.sql.ResultSet;
import java.sql.SQLException;
import org.springframework.jdbc.core.RowMapper;
import com.knowledge.arc.KnowledgeDao;
public class TimelineAssetDao extends KnowledgeDao<TimelineAsset> {
@Override
public int create(TimelineAsset t) {
StringBuffer buffer = new StringBuffer("INSERT INTO knowledge_timeline_asset (id, media, credit, caption) VALUES (?, ?, ?, ?)");
Object[] args = {t.getId(), t.getMedia(), t.getCredit(), t.getCaption()};
return jdbcTemplate.update(buffer.toString(), args);
}
public TimelineAsset readOne(String id) {
StringBuffer buffer = new StringBuffer("SELECT id, media, credit, caption FROM knowledge_timeline_asset WHERE id=?");
Object[] args = {id};
return jdbcTemplate.queryForObject(buffer.toString(), new TimelineAssetRowMapper(), args);
}
@Override
public int deleteEntity(TimelineAsset t) {
// TODO Auto-generated method stub
return 0;
}
@Override
public int updateEntity(TimelineAsset t) {
// TODO Auto-generated method stub
return 0;
}
@Override
public TimelineAsset readEntityById(Object id) {
// TODO Auto-generated method stub
return null;
}
}
class TimelineAssetRowMapper implements RowMapper<TimelineAsset> {
@Override
public TimelineAsset mapRow(ResultSet rs, int rowNum) throws SQLException {
TimelineAsset asset = new TimelineAsset();
asset = new TimelineAsset();
asset.setCaption(rs.getString("caption"));
asset.setCredit(rs.getString("credit"));
asset.setId(rs.getString("id"));
asset.setMedia(rs.getString("media"));
return asset;
}
}
| {'content_hash': '9d7496f9fadc50e5c90473e088a3777e', 'timestamp': '', 'source': 'github', 'line_count': 60, 'max_line_length': 130, 'avg_line_length': 26.883333333333333, 'alnum_prop': 0.7365158090514569, 'repo_name': 'LiSheep/knowledge', 'id': '0dec333add251a722dcf2cd2771c591009ca435f', 'size': '1613', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/main/java/com/knowledge/timeline/TimelineAssetDao.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '76850'}, {'name': 'CoffeeScript', 'bytes': '99174'}, {'name': 'Java', 'bytes': '110489'}, {'name': 'JavaScript', 'bytes': '406936'}]} |
<?php
/**
* Zend_Search_Lucene base exception
*/
// require_once 'Zend/Search/Lucene/Exception.php';
/**
* @category Zend
* @package Zend_Search_Lucene
* @subpackage Search
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*
* Special exception type, which may be used to intercept wrong user input
*/
class Zend_Search_Lucene_Search_QueryParserException extends Zend_Search_Lucene_Exception
{}
| {'content_hash': '0a1735b8bd284a31caced27d01cae4cc', 'timestamp': '', 'source': 'github', 'line_count': 22, 'max_line_length': 89, 'avg_line_length': 24.045454545454547, 'alnum_prop': 0.7107750472589792, 'repo_name': 'PatidarWeb/pimcore', 'id': '228447d4ad9e71594ed0ac18b813600be45c0f14', 'size': '1312', 'binary': False, 'copies': '12', 'ref': 'refs/heads/master', 'path': 'pimcore/lib/Zend/Search/Lucene/Search/QueryParserException.php', 'mode': '33188', 'license': 'bsd-3-clause', 'language': []} |
/**
* @Title: Mybatis.java
* @Package com.zhidian.utils
* @Description: TODO(用一句话描述该文件做什么)
* @author dongneng
* @date 2017-3-18 下午9:14:26
* @version V1.0
*/
package com.zhidian.utils;
import java.io.IOException;
import java.io.InputStream;
import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
/**
* @ClassName: Mybatis
* @Description: TODO(这里用一句话描述这个类的作用)
* @author dongneng
* @date 2017-3-18 下午9:14:26
*
*/
public class Mybatis {
public final static String PATH = "classpath:mybatis.xml";
private static SqlSessionFactory sqlSessionFactory;
public static SqlSessionFactory getSqlSessionFactory() {
if (sqlSessionFactory == null) {
InputStream inputStream = null;
try {
inputStream = Resources.getResourceAsStream(PATH);
} catch (IOException e) {
e.printStackTrace();
return null;
}
sqlSessionFactory = new SqlSessionFactoryBuilder()
.build(inputStream);
}
return sqlSessionFactory;
}
}
| {'content_hash': 'bbd26c04595cffa5929de71d2c9e8d51', 'timestamp': '', 'source': 'github', 'line_count': 46, 'max_line_length': 59, 'avg_line_length': 22.76086956521739, 'alnum_prop': 0.7277936962750716, 'repo_name': 'Dorllen/eso', 'id': 'f7a289235297b3271151195ff1ace109ca80a834', 'size': '1107', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/main/java/com/zhidian/utils/Mybatis.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '5006'}, {'name': 'HTML', 'bytes': '524'}, {'name': 'Java', 'bytes': '18565'}, {'name': 'Shell', 'bytes': '7058'}]} |
package org.elasticsearch.search.aggregations.bucket.histogram;
import org.elasticsearch.common.ParseField;
import org.elasticsearch.common.xcontent.ObjectParser;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.search.aggregations.ParsedMultiBucketAggregation;
import java.io.IOException;
import java.time.Instant;
import java.time.ZoneOffset;
import java.util.List;
public class ParsedAutoDateHistogram extends ParsedMultiBucketAggregation<ParsedAutoDateHistogram.ParsedBucket> implements Histogram {
@Override
public String getType() {
return AutoDateHistogramAggregationBuilder.NAME;
}
private String interval;
public String getInterval() {
return interval;
}
public void setInterval(String interval) {
this.interval = interval;
}
@Override
public List<? extends Histogram.Bucket> getBuckets() {
return buckets;
}
private static final ObjectParser<ParsedAutoDateHistogram, Void> PARSER =
new ObjectParser<>(ParsedAutoDateHistogram.class.getSimpleName(), true, ParsedAutoDateHistogram::new);
static {
declareMultiBucketAggregationFields(PARSER,
parser -> ParsedBucket.fromXContent(parser, false),
parser -> ParsedBucket.fromXContent(parser, true));
PARSER.declareString((parsed, value) -> parsed.interval = value,
new ParseField("interval"));
}
public static ParsedAutoDateHistogram fromXContent(XContentParser parser, String name) throws IOException {
ParsedAutoDateHistogram aggregation = PARSER.parse(parser, null);
aggregation.setName(name);
return aggregation;
}
@Override
protected XContentBuilder doXContentBody(XContentBuilder builder, Params params) throws IOException {
builder = super.doXContentBody(builder, params);
builder.field("interval", getInterval());
return builder;
}
public static class ParsedBucket extends ParsedMultiBucketAggregation.ParsedBucket implements Histogram.Bucket {
private Long key;
@Override
public Object getKey() {
if (key != null) {
return Instant.ofEpochMilli(key).atZone(ZoneOffset.UTC);
}
return null;
}
@Override
public String getKeyAsString() {
String keyAsString = super.getKeyAsString();
if (keyAsString != null) {
return keyAsString;
}
if (key != null) {
return Long.toString(key);
}
return null;
}
@Override
protected XContentBuilder keyToXContent(XContentBuilder builder) throws IOException {
return builder.field(CommonFields.KEY.getPreferredName(), key);
}
static ParsedBucket fromXContent(XContentParser parser, boolean keyed) throws IOException {
return parseXContent(parser, keyed, ParsedBucket::new, (p, bucket) -> bucket.key = p.longValue());
}
}
}
| {'content_hash': '4d72bd8baf6d6929cfc33e809b1be71b', 'timestamp': '', 'source': 'github', 'line_count': 95, 'max_line_length': 134, 'avg_line_length': 32.97894736842105, 'alnum_prop': 0.6766677306096394, 'repo_name': 'robin13/elasticsearch', 'id': 'f049097dac463fb2fd43ff4cc41cbf05d599a391', 'size': '3486', 'binary': False, 'copies': '5', 'ref': 'refs/heads/master', 'path': 'server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/ParsedAutoDateHistogram.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'ANTLR', 'bytes': '11082'}, {'name': 'Batchfile', 'bytes': '14049'}, {'name': 'Emacs Lisp', 'bytes': '3341'}, {'name': 'FreeMarker', 'bytes': '45'}, {'name': 'Groovy', 'bytes': '315863'}, {'name': 'HTML', 'bytes': '3399'}, {'name': 'Java', 'bytes': '40107206'}, {'name': 'Perl', 'bytes': '7271'}, {'name': 'Python', 'bytes': '54437'}, {'name': 'Shell', 'bytes': '108937'}]} |
define(function(gRequire, exports, module) {
function getXhr() {
try {
return new XMLHttpRequest();
} catch(e) {
return new ActiveXObject("Microsoft.XMLHTTP");
}
}
function xhr(method, url, callback) {
var xhr = getXhr();
xhr.addEventListener('readystatechange', function(state) {
if(xhr.readyState === 4 && ( !/^[54]/.test(xhr.status) )) {
callback(xhr.response, xhr.status);
}
});
xhr.open(method.toUpperCase(), url, true);
xhr.send(null);
return xhr;
}
function merge(dest, source) {
for(var key in source) {
dest[key] = source[key];
}
return dest;
}
var define = undefined, requirejs = undefined, require = undefined;
var BootLoader = exports.BootLoader = (function BootLoader(fs, API, require) {
/*jslint strict: false, plusplus: false, sub: true */
/*global window, navigator, document, importScripts, jQuery, setTimeout, opera */
var apiToPassIn = API; // the api to pass in to modules
var requireConfig = require = merge({
baseFolder: 'boot'
}, require || {});
require.baseFolder = require.baseFolder || '';
var requirejs, define;
(function () {
//Change this version number for each release.
var version = "1.0.7",
commentRegExp = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,
cjsRequireRegExp = /require\(\s*["']([^'"\s]+)["']\s*\)/g,
currDirRegExp = /^\.\//,
jsSuffixRegExp = /\.js$/,
ostring = Object.prototype.toString,
ap = Array.prototype,
aps = ap.slice,
apsp = ap.splice,
isBrowser = !!(typeof window !== "undefined" && navigator && document),
isWebWorker = !isBrowser && typeof importScripts !== "undefined",
//PS3 indicates loaded and complete, but need to wait for complete
//specifically. Sequence is "loading", "loaded", execution,
// then "complete". The UA check is unfortunate, but not sure how
//to feature test w/o causing perf issues.
readyRegExp = isBrowser && navigator.platform === 'PLAYSTATION 3' ?
/^complete$/ : /^(complete|loaded)$/,
defContextName = "_",
//Oh the tragedy, detecting opera. See the usage of isOpera for reason.
isOpera = typeof opera !== "undefined" && opera.toString() === "[object Opera]",
empty = {},
contexts = {},
globalDefQueue = [],
interactiveScript = null,
checkLoadedDepth = 0,
useInteractive = false,
reservedDependencies = {
require: true,
module: true,
exports: true,
API: true,
FS: true
},
req, cfg = {}, currentlyAddingScript, s, head, baseElement, scripts, script,
src, subPath, mainScript, dataMain, globalI, ctx, jQueryCheck, checkLoadedTimeoutId;
function isFunction(it) {
return ostring.call(it) === "[object Function]";
}
function isArray(it) {
return ostring.call(it) === "[object Array]";
}
/**
* Simple function to mix in properties from source into target,
* but only if target does not already have a property of the same name.
* This is not robust in IE for transferring methods that match
* Object.prototype names, but the uses of mixin here seem unlikely to
* trigger a problem related to that.
*/
function mixin(target, source, force) {
for (var prop in source) {
if (!(prop in empty) && (!(prop in target) || force)) {
target[prop] = source[prop];
}
}
return req;
}
/**
* Constructs an error with a pointer to an URL with more information.
* @param {String} id the error ID that maps to an ID on a web page.
* @param {String} message human readable error.
* @param {Error} [err] the original error, if there is one.
*
* @returns {Error}
*/
function makeError(id, msg, err) {
var e = new Error(msg + '\nhttp://requirejs.org/docs/errors.html#' + id);
if (err) {
e.originalError = err;
}
return e;
}
/**
* Used to set up package paths from a packagePaths or packages config object.
* @param {Object} pkgs the object to store the new package config
* @param {Array} currentPackages an array of packages to configure
* @param {String} [dir] a prefix dir to use.
*/
function configurePackageDir(pkgs, currentPackages, dir) {
var i, location, pkgObj;
for (i = 0; (pkgObj = currentPackages[i]); i++) {
pkgObj = typeof pkgObj === "string" ? { name: pkgObj } : pkgObj;
location = pkgObj.location;
//Add dir to the path, but avoid paths that start with a slash
//or have a colon (indicates a protocol)
if (dir && (!location || (location.indexOf("/") !== 0 && location.indexOf(":") === -1))) {
location = dir + "/" + (location || pkgObj.name);
}
//Create a brand new object on pkgs, since currentPackages can
//be passed in again, and config.pkgs is the internal transformed
//state for all package configs.
pkgs[pkgObj.name] = {
name: pkgObj.name,
location: location || pkgObj.name,
//Remove leading dot in main, so main paths are normalized,
//and remove any trailing .js, since different package
//envs have different conventions: some use a module name,
//some use a file name.
main: (pkgObj.main || "main")
.replace(currDirRegExp, '')
.replace(jsSuffixRegExp, '')
};
}
}
/**
* jQuery 1.4.3-1.5.x use a readyWait/ready() pairing to hold DOM
* ready callbacks, but jQuery 1.6 supports a holdReady() API instead.
* At some point remove the readyWait/ready() support and just stick
* with using holdReady.
*/
function jQueryHoldReady($, shouldHold) {
if ($.holdReady) {
$.holdReady(shouldHold);
} else if (shouldHold) {
$.readyWait += 1;
} else {
$.ready(true);
}
}
if (typeof define !== "undefined") {
//If a define is already in play via another AMD loader,
//do not overwrite.
return;
}
if (typeof requirejs !== "undefined") {
if (isFunction(requirejs)) {
//Do not overwrite and existing requirejs instance.
return;
} else {
cfg = requirejs;
requirejs = undefined;
}
}
//Allow for a require config object
if (typeof require !== "undefined" && !isFunction(require)) {
//assume it is a config object.
cfg = require;
require = undefined;
}
/**
* Creates a new context for use in require and define calls.
* Handle most of the heavy lifting. Do not want to use an object
* with prototype here to avoid using "this" in require, in case it
* needs to be used in more super secure envs that do not want this.
* Also there should not be that many contexts in the page. Usually just
* one for the default context, but could be extra for multiversion cases
* or if a package needs a special context for a dependency that conflicts
* with the standard context.
*/
function newContext(contextName) {
var context, resume,
config = {
waitSeconds: 7,
baseUrl: "./",
paths: {},
pkgs: {},
catchError: {}
},
defQueue = [],
specified = {
"require": true,
"exports": true,
"module": true
},
urlMap = {},
defined = {},
loaded = {},
waiting = {},
waitAry = [],
urlFetched = {},
managerCounter = 0,
managerCallbacks = {},
plugins = {},
//Used to indicate which modules in a build scenario
//need to be full executed.
needFullExec = {},
fullExec = {},
resumeDepth = 0;
/**
* Trims the . and .. from an array of path segments.
* It will keep a leading path segment if a .. will become
* the first path segment, to help with module name lookups,
* which act like paths, but can be remapped. But the end result,
* all paths that use this function should look normalized.
* NOTE: this method MODIFIES the input array.
* @param {Array} ary the array of path segments.
*/
function trimDots(ary) {
var i, part;
for (i = 0; (part = ary[i]); i++) {
if (part === ".") {
ary.splice(i, 1);
i -= 1;
} else if (part === "..") {
if (i === 1 && (ary[2] === '..' || ary[0] === '..')) {
//End of the line. Keep at least one non-dot
//path segment at the front so it can be mapped
//correctly to disk. Otherwise, there is likely
//no path mapping for a path starting with '..'.
//This can still fail, but catches the most reasonable
//uses of ..
break;
} else if (i > 0) {
ary.splice(i - 1, 2);
i -= 2;
}
}
}
}
/**
* Given a relative module name, like ./something, normalize it to
* a real name that can be mapped to a path.
* @param {String} name the relative name
* @param {String} baseName a real name that the name arg is relative
* to.
* @returns {String} normalized name
*/
function normalize(name, baseName) {
var pkgName, pkgConfig;
//Adjust any relative paths.
if (name && name.charAt(0) === ".") {
//If have a base name, try to normalize against it,
//otherwise, assume it is a top-level require that will
//be relative to baseUrl in the end.
if (baseName) {
if (config.pkgs[baseName]) {
//If the baseName is a package name, then just treat it as one
//name to concat the name with.
baseName = [baseName];
} else {
//Convert baseName to array, and lop off the last part,
//so that . matches that "directory" and not name of the baseName's
//module. For instance, baseName of "one/two/three", maps to
//"one/two/three.js", but we want the directory, "one/two" for
//this normalization.
baseName = baseName.split("/");
baseName = baseName.slice(0, baseName.length - 1);
}
name = baseName.concat(name.split("/"));
trimDots(name);
//Some use of packages may use a . path to reference the
//"main" module name, so normalize for that.
pkgConfig = config.pkgs[(pkgName = name[0])];
name = name.join("/");
if (pkgConfig && name === pkgName + '/' + pkgConfig.main) {
name = pkgName;
}
} else if (name.indexOf("./") === 0) {
// No baseName, so this is ID is resolved relative
// to baseUrl, pull off the leading dot.
name = name.substring(2);
}
}
return name;
}
/**
* Creates a module mapping that includes plugin prefix, module
* name, and path. If parentModuleMap is provided it will
* also normalize the name via require.normalize()
*
* @param {String} name the module name
* @param {String} [parentModuleMap] parent module map
* for the module name, used to resolve relative names.
*
* @returns {Object}
*/
function makeModuleMap(name, parentModuleMap) {
var index = name ? name.indexOf("!") : -1,
prefix = null,
parentName = parentModuleMap ? parentModuleMap.name : null,
originalName = name,
normalizedName, url, pluginModule;
if (index !== -1) {
prefix = name.substring(0, index);
name = name.substring(index + 1, name.length);
}
if (prefix) {
prefix = normalize(prefix, parentName);
}
//Account for relative paths if there is a base name.
if (name) {
if (prefix) {
pluginModule = defined[prefix];
if (pluginModule && pluginModule.normalize) {
//Plugin is loaded, use its normalize method.
normalizedName = pluginModule.normalize(name, function (name) {
return normalize(name, parentName);
});
} else {
normalizedName = normalize(name, parentName);
}
} else {
//A regular module.
normalizedName = normalize(name, parentName);
url = urlMap[normalizedName];
if (!url) {
//Calculate url for the module, if it has a name.
//Use name here since nameToUrl also calls normalize,
//and for relative names that are outside the baseUrl
//this causes havoc. Was thinking of just removing
//parentModuleMap to avoid extra normalization, but
//normalize() still does a dot removal because of
//issue #142, so just pass in name here and redo
//the normalization. Paths outside baseUrl are just
//messy to support.
url = context.nameToUrl(name, null, parentModuleMap);
//Store the URL mapping for later.
urlMap[normalizedName] = url;
}
}
}
return {
prefix: prefix,
name: normalizedName,
parentMap: parentModuleMap,
url: url,
originalName: originalName,
fullName: prefix ? prefix + "!" + (normalizedName || '') : normalizedName
};
}
/**
* Determine if priority loading is done. If so clear the priorityWait
*/
function isPriorityDone() {
var priorityDone = true,
priorityWait = config.priorityWait,
priorityName, i;
if (priorityWait) {
for (i = 0; (priorityName = priorityWait[i]); i++) {
if (!loaded[priorityName]) {
priorityDone = false;
break;
}
}
if (priorityDone) {
delete config.priorityWait;
}
}
return priorityDone;
}
function makeContextModuleFunc(func, relModuleMap, enableBuildCallback) {
return function () {
//A version of a require function that passes a moduleName
//value for items that may need to
//look up paths relative to the moduleName
var args = aps.call(arguments, 0), lastArg;
if (enableBuildCallback &&
isFunction((lastArg = args[args.length - 1]))) {
lastArg.__requireJsBuild = true;
}
args.push(relModuleMap);
return func.apply(null, args);
};
}
/**
* Helper function that creates a require function object to give to
* modules that ask for it as a dependency. It needs to be specific
* per module because of the implication of path mappings that may
* need to be relative to the module name.
*/
function makeRequire(relModuleMap, enableBuildCallback, altRequire) {
var modRequire = makeContextModuleFunc(altRequire || context.require, relModuleMap, enableBuildCallback);
mixin(modRequire, {
nameToUrl: makeContextModuleFunc(context.nameToUrl, relModuleMap),
toUrl: makeContextModuleFunc(context.toUrl, relModuleMap),
defined: makeContextModuleFunc(context.requireDefined, relModuleMap),
specified: makeContextModuleFunc(context.requireSpecified, relModuleMap),
isBrowser: req.isBrowser
});
return modRequire;
}
/*
* Queues a dependency for checking after the loader is out of a
* "paused" state, for example while a script file is being loaded
* in the browser, where it may have many modules defined in it.
*/
function queueDependency(manager) {
context.paused.push(manager);
}
function execManager(manager) {
var i, ret, err, errFile, errModuleTree,
cb = manager.callback,
map = manager.map,
fullName = map.fullName,
args = manager.deps,
listeners = manager.listeners,
cjsModule;
//Call the callback to define the module, if necessary.
if (cb && isFunction(cb)) {
if (config.catchError.define) {
try {
ret = req.execCb(fullName, manager.callback, args, defined[fullName]);
} catch (e) {
err = e;
}
} else {
ret = req.execCb(fullName, manager.callback, args, defined[fullName]);
}
if (fullName) {
//If setting exports via "module" is in play,
//favor that over return value and exports. After that,
//favor a non-undefined return value over exports use.
cjsModule = manager.cjsModule;
if (cjsModule &&
cjsModule.exports !== undefined &&
//Make sure it is not already the exports value
cjsModule.exports !== defined[fullName]) {
ret = defined[fullName] = manager.cjsModule.exports;
} else if (ret === undefined && manager.usingExports) {
//exports already set the defined value.
ret = defined[fullName];
} else {
//Use the return value from the function.
defined[fullName] = ret;
//If this module needed full execution in a build
//environment, mark that now.
if (needFullExec[fullName]) {
fullExec[fullName] = true;
}
}
}
} else if (fullName) {
//May just be an object definition for the module. Only
//worry about defining if have a module name.
ret = defined[fullName] = cb;
//If this module needed full execution in a build
//environment, mark that now.
if (needFullExec[fullName]) {
fullExec[fullName] = true;
}
}
//Clean up waiting. Do this before error calls, and before
//calling back listeners, so that bookkeeping is correct
//in the event of an error and error is reported in correct order,
//since the listeners will likely have errors if the
//onError function does not throw.
if (waiting[manager.id]) {
delete waiting[manager.id];
manager.isDone = true;
context.waitCount -= 1;
if (context.waitCount === 0) {
//Clear the wait array used for cycles.
waitAry = [];
}
}
//Do not need to track manager callback now that it is defined.
delete managerCallbacks[fullName];
//Allow instrumentation like the optimizer to know the order
//of modules executed and their dependencies.
if (req.onResourceLoad && !manager.placeholder) {
req.onResourceLoad(context, map, manager.depArray);
}
if (err) {
errFile = (fullName ? makeModuleMap(fullName).url : '') ||
err.fileName || err.sourceURL;
errModuleTree = err.moduleTree;
err = makeError('defineerror', 'Error evaluating ' +
'module "' + fullName + '" at location "' +
errFile + '":\n' +
err + '\nfileName:' + errFile +
'\nlineNumber: ' + (err.lineNumber || err.line), err);
err.moduleName = fullName;
err.moduleTree = errModuleTree;
return req.onError(err);
}
//Let listeners know of this manager's value.
for (i = 0; (cb = listeners[i]); i++) {
cb(ret);
}
return undefined;
}
/**
* Helper that creates a callack function that is called when a dependency
* is ready, and sets the i-th dependency for the manager as the
* value passed to the callback generated by this function.
*/
function makeArgCallback(manager, i) {
return function (value) {
//Only do the work if it has not been done
//already for a dependency. Cycle breaking
//logic in forceExec could mean this function
//is called more than once for a given dependency.
if (!manager.depDone[i]) {
manager.depDone[i] = true;
manager.deps[i] = value;
manager.depCount -= 1;
if (!manager.depCount) {
//All done, execute!
execManager(manager);
}
}
};
}
function callPlugin(pluginName, depManager) {
var map = depManager.map,
fullName = map.fullName,
name = map.name,
plugin = plugins[pluginName] ||
(plugins[pluginName] = defined[pluginName]),
load;
//No need to continue if the manager is already
//in the process of loading.
if (depManager.loading) {
return;
}
depManager.loading = true;
load = function (ret) {
depManager.callback = function () {
return ret;
};
execManager(depManager);
loaded[depManager.id] = true;
//The loading of this plugin
//might have placed other things
//in the paused queue. In particular,
//a loader plugin that depends on
//a different plugin loaded resource.
resume();
};
//Allow plugins to load other code without having to know the
//context or how to "complete" the load.
load.fromText = function (moduleName, text) {
/*jslint evil: true */
var hasInteractive = useInteractive;
//Indicate a the module is in process of loading.
loaded[moduleName] = false;
context.scriptCount += 1;
//Indicate this is not a "real" module, so do not track it
//for builds, it does not map to a real file.
context.fake[moduleName] = true;
//Turn off interactive script matching for IE for any define
//calls in the text, then turn it back on at the end.
if (hasInteractive) {
useInteractive = false;
}
req.exec(text);
if (hasInteractive) {
useInteractive = true;
}
//Support anonymous modules.
context.completeLoad(moduleName);
};
//No need to continue if the plugin value has already been
//defined by a build.
if (fullName in defined) {
load(defined[fullName]);
} else {
//Use parentName here since the plugin's name is not reliable,
//could be some weird string with no path that actually wants to
//reference the parentName's path.
plugin.load(name, makeRequire(map.parentMap, true, function (deps, cb) {
var moduleDeps = [],
i, dep, depMap;
//Convert deps to full names and hold on to them
//for reference later, when figuring out if they
//are blocked by a circular dependency.
for (i = 0; (dep = deps[i]); i++) {
depMap = makeModuleMap(dep, map.parentMap);
deps[i] = depMap.fullName;
if (!depMap.prefix) {
moduleDeps.push(deps[i]);
}
}
depManager.moduleDeps = (depManager.moduleDeps || []).concat(moduleDeps);
return context.require(deps, cb);
}), load, config);
}
}
/**
* Adds the manager to the waiting queue. Only fully
* resolved items should be in the waiting queue.
*/
function addWait(manager) {
if (!waiting[manager.id]) {
waiting[manager.id] = manager;
waitAry.push(manager);
context.waitCount += 1;
}
}
/**
* Function added to every manager object. Created out here
* to avoid new function creation for each manager instance.
*/
function managerAdd(cb) {
this.listeners.push(cb);
}
function getManager(map, shouldQueue) {
var fullName = map.fullName,
prefix = map.prefix,
plugin = prefix ? plugins[prefix] ||
(plugins[prefix] = defined[prefix]) : null,
manager, created, pluginManager, prefixMap;
if (fullName) {
manager = managerCallbacks[fullName];
}
if (!manager) {
created = true;
manager = {
//ID is just the full name, but if it is a plugin resource
//for a plugin that has not been loaded,
//then add an ID counter to it.
id: (prefix && !plugin ?
(managerCounter++) + '__p@:' : '') +
(fullName || '__r@' + (managerCounter++)),
map: map,
depCount: 0,
depDone: [],
depCallbacks: [],
deps: [],
listeners: [],
add: managerAdd
};
specified[manager.id] = true;
//Only track the manager/reuse it if this is a non-plugin
//resource. Also only track plugin resources once
//the plugin has been loaded, and so the fullName is the
//true normalized value.
if (fullName && (!prefix || plugins[prefix])) {
managerCallbacks[fullName] = manager;
}
}
//If there is a plugin needed, but it is not loaded,
//first load the plugin, then continue on.
if (prefix && !plugin) {
prefixMap = makeModuleMap(prefix);
//Clear out defined and urlFetched if the plugin was previously
//loaded/defined, but not as full module (as in a build
//situation). However, only do this work if the plugin is in
//defined but does not have a module export value.
if (prefix in defined && !defined[prefix]) {
delete defined[prefix];
delete urlFetched[prefixMap.url];
}
pluginManager = getManager(prefixMap, true);
pluginManager.add(function (plugin) {
//Create a new manager for the normalized
//resource ID and have it call this manager when
//done.
var newMap = makeModuleMap(map.originalName, map.parentMap),
normalizedManager = getManager(newMap, true);
//Indicate this manager is a placeholder for the real,
//normalized thing. Important for when trying to map
//modules and dependencies, for instance, in a build.
manager.placeholder = true;
normalizedManager.add(function (resource) {
manager.callback = function () {
return resource;
};
execManager(manager);
});
});
} else if (created && shouldQueue) {
//Indicate the resource is not loaded yet if it is to be
//queued.
loaded[manager.id] = false;
queueDependency(manager);
addWait(manager);
}
return manager;
}
function main(inName, depArray, callback, relModuleMap) {
var moduleMap = makeModuleMap(inName, relModuleMap),
name = moduleMap.name,
fullName = moduleMap.fullName,
manager = getManager(moduleMap),
id = manager.id,
deps = manager.deps,
i, depArg, depName, depPrefix, cjsMod;
if (fullName) {
//If module already defined for context, or already loaded,
//then leave. Also leave if jQuery is registering but it does
//not match the desired version number in the config.
if (fullName in defined || loaded[id] === true ||
(fullName === "jquery" && config.jQuery &&
config.jQuery !== callback().fn.jquery)) {
return;
}
//Set specified/loaded here for modules that are also loaded
//as part of a layer, where onScriptLoad is not fired
//for those cases. Do this after the inline define and
//dependency tracing is done.
specified[id] = true;
loaded[id] = true;
//If module is jQuery set up delaying its dom ready listeners.
if (fullName === "jquery" && callback) {
jQueryCheck(callback());
}
}
//Attach real depArray and callback to the manager. Do this
//only if the module has not been defined already, so do this after
//the fullName checks above. IE can call main() more than once
//for a module.
manager.depArray = depArray;
manager.callback = callback;
//Add the dependencies to the deps field, and register for callbacks
//on the dependencies.
for (i = 0; i < depArray.length; i++) {
depArg = depArray[i];
//There could be cases like in IE, where a trailing comma will
//introduce a null dependency, so only treat a real dependency
//value as a dependency.
if (depArg) {
//Split the dependency name into plugin and name parts
depArg = makeModuleMap(depArg, (name ? moduleMap : relModuleMap));
depName = depArg.fullName;
depPrefix = depArg.prefix;
//Fix the name in depArray to be just the name, since
//that is how it will be called back later.
depArray[i] = depName;
if(depName === "API") {
deps[i] = apiToPassIn;
} else if(depName === "FS") {
deps[i] = fs;
} else if (depName === "require") { //Fast path CommonJS standard dependencies.
deps[i] = makeRequire(moduleMap);
} else if (depName === "exports") {
//CommonJS module spec 1.1
deps[i] = defined[fullName] = {};
manager.usingExports = true;
} else if (depName === "module") {
//CommonJS module spec 1.1
manager.cjsModule = cjsMod = deps[i] = {
id: name,
uri: name ? context.nameToUrl(name, null, relModuleMap) : undefined,
exports: defined[fullName]
};
} else if (depName in defined && !(depName in waiting) &&
(!(fullName in needFullExec) ||
(fullName in needFullExec && fullExec[depName]))) {
//Module already defined, and not in a build situation
//where the module is a something that needs full
//execution and this dependency has not been fully
//executed. See r.js's requirePatch.js for more info
//on fullExec.
deps[i] = defined[depName];
} else {
//Mark this dependency as needing full exec if
//the current module needs full exec.
if (fullName in needFullExec) {
needFullExec[depName] = true;
//Reset state so fully executed code will get
//picked up correctly.
delete defined[depName];
urlFetched[depArg.url] = false;
}
//Either a resource that is not loaded yet, or a plugin
//resource for either a plugin that has not
//loaded yet.
manager.depCount += 1;
manager.depCallbacks[i] = makeArgCallback(manager, i);
getManager(depArg, true).add(manager.depCallbacks[i]);
}
}
}
//Do not bother tracking the manager if it is all done.
if (!manager.depCount) {
//All done, execute!
execManager(manager);
} else {
addWait(manager);
}
}
/**
* Convenience method to call main for a define call that was put on
* hold in the defQueue.
*/
function callDefMain(args) {
main.apply(null, args);
}
/**
* jQuery 1.4.3+ supports ways to hold off calling
* calling jQuery ready callbacks until all scripts are loaded. Be sure
* to track it if the capability exists.. Also, since jQuery 1.4.3 does
* not register as a module, need to do some global inference checking.
* Even if it does register as a module, not guaranteed to be the precise
* name of the global. If a jQuery is tracked for this context, then go
* ahead and register it as a module too, if not already in process.
*/
jQueryCheck = function (jqCandidate) {
if (!context.jQuery) {
var $ = jqCandidate || (typeof jQuery !== "undefined" ? jQuery : null);
if ($) {
//If a specific version of jQuery is wanted, make sure to only
//use this jQuery if it matches.
if (config.jQuery && $.fn.jquery !== config.jQuery) {
return;
}
if ("holdReady" in $ || "readyWait" in $) {
context.jQuery = $;
//Manually create a "jquery" module entry if not one already
//or in process. Note this could trigger an attempt at
//a second jQuery registration, but does no harm since
//the first one wins, and it is the same value anyway.
callDefMain(["jquery", [], function () {
return jQuery;
}]);
//Ask jQuery to hold DOM ready callbacks.
if (context.scriptCount) {
jQueryHoldReady($, true);
context.jQueryIncremented = true;
}
}
}
}
};
function findCycle(manager, traced) {
var fullName = manager.map.fullName,
depArray = manager.depArray,
fullyLoaded = true,
i, depName, depManager, result;
if (manager.isDone || !fullName || !loaded[fullName]) {
return result;
}
//Found the cycle.
if (traced[fullName]) {
return manager;
}
traced[fullName] = true;
//Trace through the dependencies.
if (depArray) {
for (i = 0; i < depArray.length; i++) {
//Some array members may be null, like if a trailing comma
//IE, so do the explicit [i] access and check if it has a value.
depName = depArray[i];
if (!loaded[depName] && !reservedDependencies[depName]) {
fullyLoaded = false;
break;
}
depManager = waiting[depName];
if (depManager && !depManager.isDone && loaded[depName]) {
result = findCycle(depManager, traced);
if (result) {
break;
}
}
}
if (!fullyLoaded) {
//Discard the cycle that was found, since it cannot
//be forced yet. Also clear this module from traced.
result = undefined;
delete traced[fullName];
}
}
return result;
}
function forceExec(manager, traced) {
var fullName = manager.map.fullName,
depArray = manager.depArray,
i, depName, depManager, prefix, prefixManager, value;
if (manager.isDone || !fullName || !loaded[fullName]) {
return undefined;
}
if (fullName) {
if (traced[fullName]) {
return defined[fullName];
}
traced[fullName] = true;
}
//Trace through the dependencies.
if (depArray) {
for (i = 0; i < depArray.length; i++) {
//Some array members may be null, like if a trailing comma
//IE, so do the explicit [i] access and check if it has a value.
depName = depArray[i];
if (depName) {
//First, make sure if it is a plugin resource that the
//plugin is not blocked.
prefix = makeModuleMap(depName).prefix;
if (prefix && (prefixManager = waiting[prefix])) {
forceExec(prefixManager, traced);
}
depManager = waiting[depName];
if (depManager && !depManager.isDone && loaded[depName]) {
value = forceExec(depManager, traced);
manager.depCallbacks[i](value);
}
}
}
}
return defined[fullName];
}
/**
* Checks if all modules for a context are loaded, and if so, evaluates the
* new ones in right dependency order.
*
* @private
*/
function checkLoaded() {
var waitInterval = config.waitSeconds * 1000,
//It is possible to disable the wait interval by using waitSeconds of 0.
expired = waitInterval && (context.startTime + waitInterval) < new Date().getTime(),
noLoads = "", hasLoadedProp = false, stillLoading = false,
cycleDeps = [],
i, prop, err, manager, cycleManager, moduleDeps;
//If there are items still in the paused queue processing wait.
//This is particularly important in the sync case where each paused
//item is processed right away but there may be more waiting.
if (context.pausedCount > 0) {
return undefined;
}
//Determine if priority loading is done. If so clear the priority. If
//not, then do not check
if (config.priorityWait) {
if (isPriorityDone()) {
//Call resume, since it could have
//some waiting dependencies to trace.
resume();
} else {
return undefined;
}
}
//See if anything is still in flight.
for (prop in loaded) {
if (!(prop in empty)) {
hasLoadedProp = true;
if (!loaded[prop]) {
if (expired) {
noLoads += prop + " ";
} else {
stillLoading = true;
if (prop.indexOf('!') === -1) {
//No reason to keep looking for unfinished
//loading. If the only stillLoading is a
//plugin resource though, keep going,
//because it may be that a plugin resource
//is waiting on a non-plugin cycle.
cycleDeps = [];
break;
} else {
moduleDeps = managerCallbacks[prop] && managerCallbacks[prop].moduleDeps;
if (moduleDeps) {
cycleDeps.push.apply(cycleDeps, moduleDeps);
}
}
}
}
}
}
//Check for exit conditions.
if (!hasLoadedProp && !context.waitCount) {
//If the loaded object had no items, then the rest of
//the work below does not need to be done.
return undefined;
}
if (expired && noLoads) {
//If wait time expired, throw error of unloaded modules.
err = makeError("timeout", "Load timeout for modules: " + noLoads);
err.requireType = "timeout";
err.requireModules = noLoads;
err.contextName = context.contextName;
return req.onError(err);
}
//If still loading but a plugin is waiting on a regular module cycle
//break the cycle.
if (stillLoading && cycleDeps.length) {
for (i = 0; (manager = waiting[cycleDeps[i]]); i++) {
if ((cycleManager = findCycle(manager, {}))) {
forceExec(cycleManager, {});
break;
}
}
}
//If still waiting on loads, and the waiting load is something
//other than a plugin resource, or there are still outstanding
//scripts, then just try back later.
if (!expired && (stillLoading || context.scriptCount)) {
//Something is still waiting to load. Wait for it, but only
//if a timeout is not already in effect.
if ((isBrowser || isWebWorker) && !checkLoadedTimeoutId) {
checkLoadedTimeoutId = setTimeout(function () {
checkLoadedTimeoutId = 0;
checkLoaded();
}, 50);
}
return undefined;
}
//If still have items in the waiting cue, but all modules have
//been loaded, then it means there are some circular dependencies
//that need to be broken.
//However, as a waiting thing is fired, then it can add items to
//the waiting cue, and those items should not be fired yet, so
//make sure to redo the checkLoaded call after breaking a single
//cycle, if nothing else loaded then this logic will pick it up
//again.
if (context.waitCount) {
//Cycle through the waitAry, and call items in sequence.
for (i = 0; (manager = waitAry[i]); i++) {
forceExec(manager, {});
}
//If anything got placed in the paused queue, run it down.
if (context.paused.length) {
resume();
}
//Only allow this recursion to a certain depth. Only
//triggered by errors in calling a module in which its
//modules waiting on it cannot finish loading, or some circular
//dependencies that then may add more dependencies.
//The value of 5 is a bit arbitrary. Hopefully just one extra
//pass, or two for the case of circular dependencies generating
//more work that gets resolved in the sync node case.
if (checkLoadedDepth < 5) {
checkLoadedDepth += 1;
checkLoaded();
}
}
checkLoadedDepth = 0;
//Check for DOM ready, and nothing is waiting across contexts.
req.checkReadyState();
return undefined;
}
/**
* Resumes tracing of dependencies and then checks if everything is loaded.
*/
resume = function () {
var manager, map, url, i, p, args, fullName;
//Any defined modules in the global queue, intake them now.
context.takeGlobalQueue();
resumeDepth += 1;
if (context.scriptCount <= 0) {
//Synchronous envs will push the number below zero with the
//decrement above, be sure to set it back to zero for good measure.
//require() calls that also do not end up loading scripts could
//push the number negative too.
context.scriptCount = 0;
}
//Make sure any remaining defQueue items get properly processed.
while (defQueue.length) {
args = defQueue.shift();
if (args[0] === null) {
return req.onError(makeError('mismatch', 'Mismatched anonymous define() module: ' + args[args.length - 1]));
} else {
callDefMain(args);
}
}
//Skip the resume of paused dependencies
//if current context is in priority wait.
if (!config.priorityWait || isPriorityDone()) {
while (context.paused.length) {
p = context.paused;
context.pausedCount += p.length;
//Reset paused list
context.paused = [];
for (i = 0; (manager = p[i]); i++) {
map = manager.map;
url = map.url;
fullName = map.fullName;
//If the manager is for a plugin managed resource,
//ask the plugin to load it now.
if (map.prefix) {
callPlugin(map.prefix, manager);
} else {
//Regular dependency.
if (!urlFetched[url] && !loaded[fullName]) {
req.load(context, fullName, url);
//Mark the URL as fetched, but only if it is
//not an empty: URL, used by the optimizer.
//In that case we need to be sure to call
//load() for each module that is mapped to
//empty: so that dependencies are satisfied
//correctly.
if (url.indexOf('empty:') !== 0) {
urlFetched[url] = true;
}
}
}
}
//Move the start time for timeout forward.
context.startTime = (new Date()).getTime();
context.pausedCount -= p.length;
}
}
//Only check if loaded when resume depth is 1. It is likely that
//it is only greater than 1 in sync environments where a factory
//function also then calls the callback-style require. In those
//cases, the checkLoaded should not occur until the resume
//depth is back at the top level.
if (resumeDepth === 1) {
checkLoaded();
}
resumeDepth -= 1;
return undefined;
};
//Define the context object. Many of these fields are on here
//just to make debugging easier.
context = {
contextName: contextName,
config: config,
defQueue: defQueue,
waiting: waiting,
waitCount: 0,
specified: specified,
loaded: loaded,
urlMap: urlMap,
urlFetched: urlFetched,
scriptCount: 0,
defined: defined,
paused: [],
pausedCount: 0,
plugins: plugins,
needFullExec: needFullExec,
fake: {},
fullExec: fullExec,
managerCallbacks: managerCallbacks,
makeModuleMap: makeModuleMap,
normalize: normalize,
/**
* Set a configuration for the context.
* @param {Object} cfg config object to integrate.
*/
configure: function (cfg) {
var paths, prop, packages, pkgs, packagePaths, requireWait;
//Make sure the baseUrl ends in a slash.
if (cfg.baseUrl) {
if (cfg.baseUrl.charAt(cfg.baseUrl.length - 1) !== "/") {
cfg.baseUrl += "/";
}
}
//Save off the paths and packages since they require special processing,
//they are additive.
paths = config.paths;
packages = config.packages;
pkgs = config.pkgs;
//Mix in the config values, favoring the new values over
//existing ones in context.config.
mixin(config, cfg, true);
//Adjust paths if necessary.
if (cfg.paths) {
for (prop in cfg.paths) {
if (!(prop in empty)) {
paths[prop] = cfg.paths[prop];
}
}
config.paths = paths;
}
packagePaths = cfg.packagePaths;
if (packagePaths || cfg.packages) {
//Convert packagePaths into a packages config.
if (packagePaths) {
for (prop in packagePaths) {
if (!(prop in empty)) {
configurePackageDir(pkgs, packagePaths[prop], prop);
}
}
}
//Adjust packages if necessary.
if (cfg.packages) {
configurePackageDir(pkgs, cfg.packages);
}
//Done with modifications, assing packages back to context config
config.pkgs = pkgs;
}
//If priority loading is in effect, trigger the loads now
if (cfg.priority) {
//Hold on to requireWait value, and reset it after done
requireWait = context.requireWait;
//Allow tracing some require calls to allow the fetching
//of the priority config.
context.requireWait = false;
//But first, call resume to register any defined modules that may
//be in a data-main built file before the priority config
//call.
resume();
context.require(cfg.priority);
//Trigger a resume right away, for the case when
//the script with the priority load is done as part
//of a data-main call. In that case the normal resume
//call will not happen because the scriptCount will be
//at 1, since the script for data-main is being processed.
resume();
//Restore previous state.
context.requireWait = requireWait;
config.priorityWait = cfg.priority;
}
//If a deps array or a config callback is specified, then call
//require with those args. This is useful when require is defined as a
//config object before require.js is loaded.
if (cfg.deps || cfg.callback) {
context.require(cfg.deps || [], cfg.callback);
}
},
requireDefined: function (moduleName, relModuleMap) {
return makeModuleMap(moduleName, relModuleMap).fullName in defined;
},
requireSpecified: function (moduleName, relModuleMap) {
return makeModuleMap(moduleName, relModuleMap).fullName in specified;
},
require: function (deps, callback, relModuleMap) {
var moduleName, fullName, moduleMap;
if (typeof deps === "string") {
if (isFunction(callback)) {
//Invalid call
return req.onError(makeError("requireargs", "Invalid require call"));
}
//Just return the module wanted. In this scenario, the
//second arg (if passed) is just the relModuleMap.
moduleName = deps;
relModuleMap = callback;
//Normalize module name, if it contains . or ..
moduleMap = makeModuleMap(moduleName, relModuleMap);
fullName = moduleMap.fullName;
if(fullName === "FS") {
return fs;
} else if(fullName === "API") {
return apiToPassIn;
}
//Synchronous access to one module. If require.get is
//available (as in the Node adapter), prefer that.
//In this case deps is the moduleName and callback is
//the relModuleMap
if (req.get) {
return req.get(context, deps, callback);
}
if (!(fullName in defined)) {
return req.onError(makeError("notloaded", "Module name '" +
moduleMap.fullName +
"' has not been loaded yet for context: " +
contextName));
}
return defined[fullName];
}
//Call main but only if there are dependencies or
//a callback to call.
if (deps && deps.length || callback) {
main(null, deps, callback, relModuleMap);
}
//If the require call does not trigger anything new to load,
//then resume the dependency processing.
if (!context.requireWait) {
while (!context.scriptCount && context.paused.length) {
resume();
}
}
return context.require;
},
/**
* Internal method to transfer globalQueue items to this context's
* defQueue.
*/
takeGlobalQueue: function () {
//Push all the globalDefQueue items into the context's defQueue
if (globalDefQueue.length) {
//Array splice in the values since the context code has a
//local var ref to defQueue, so cannot just reassign the one
//on context.
apsp.apply(context.defQueue,
[context.defQueue.length - 1, 0].concat(globalDefQueue));
globalDefQueue = [];
}
},
/**
* Internal method used by environment adapters to complete a load event.
* A load event could be a script load or just a load pass from a synchronous
* load call.
* @param {String} moduleName the name of the module to potentially complete.
*/
completeLoad: function (moduleName) {
var args;
context.takeGlobalQueue();
while (defQueue.length) {
args = defQueue.shift();
if (args[0] === null) {
args[0] = moduleName;
break;
} else if (args[0] === moduleName) {
//Found matching define call for this script!
break;
} else {
//Some other named define call, most likely the result
//of a build layer that included many define calls.
callDefMain(args);
args = null;
}
}
if (args) {
callDefMain(args);
} else {
//A script that does not call define(), so just simulate
//the call for it. Special exception for jQuery dynamic load.
callDefMain([moduleName, [],
moduleName === "jquery" && typeof jQuery !== "undefined" ?
function () {
return jQuery;
} : null]);
}
//Doing this scriptCount decrement branching because sync envs
//need to decrement after resume, otherwise it looks like
//loading is complete after the first dependency is fetched.
//For browsers, it works fine to decrement after, but it means
//the checkLoaded setTimeout 50 ms cost is taken. To avoid
//that cost, decrement beforehand.
if (req.isAsync) {
context.scriptCount -= 1;
}
resume();
if (!req.isAsync) {
context.scriptCount -= 1;
}
},
/**
* Converts a module name + .extension into an URL path.
* *Requires* the use of a module name. It does not support using
* plain URLs like nameToUrl.
*/
toUrl: function (moduleNamePlusExt, relModuleMap) {
var index = moduleNamePlusExt.lastIndexOf("."),
ext = null;
if (index !== -1) {
ext = moduleNamePlusExt.substring(index, moduleNamePlusExt.length);
moduleNamePlusExt = moduleNamePlusExt.substring(0, index);
}
return context.nameToUrl(moduleNamePlusExt, ext, relModuleMap);
},
/**
* Converts a module name to a file path. Supports cases where
* moduleName may actually be just an URL.
*/
nameToUrl: function (moduleName, ext, relModuleMap) {
var paths, pkgs, pkg, pkgPath, syms, i, parentModule, url,
config = context.config;
//Normalize module name if have a base relative module name to work from.
moduleName = normalize(moduleName, relModuleMap && relModuleMap.fullName);
//If a colon is in the URL, it indicates a protocol is used and it is just
//an URL to a file, or if it starts with a slash or ends with .js, it is just a plain file.
//The slash is important for protocol-less URLs as well as full paths.
if (req.jsExtRegExp.test(moduleName)) {
//Just a plain path, not module name lookup, so just return it.
//Add extension if it is included. This is a bit wonky, only non-.js things pass
//an extension, this method probably needs to be reworked.
url = moduleName + (ext ? ext : "");
} else {
//A module that needs to be converted to a path.
paths = config.paths;
pkgs = config.pkgs;
syms = moduleName.split("/");
//For each module name segment, see if there is a path
//registered for it. Start with most specific name
//and work up from it.
for (i = syms.length; i > 0; i--) {
parentModule = syms.slice(0, i).join("/");
if (paths[parentModule]) {
syms.splice(0, i, paths[parentModule]);
break;
} else if ((pkg = pkgs[parentModule])) {
//If module name is just the package name, then looking
//for the main module.
if (moduleName === pkg.name) {
pkgPath = pkg.location + '/' + pkg.main;
} else {
pkgPath = pkg.location;
}
syms.splice(0, i, pkgPath);
break;
}
}
//Join the path parts together, then figure out if baseUrl is needed.
url = syms.join("/") + (ext || ".js");
url = (url.charAt(0) === '/' || url.match(/^\w+:/) ? "" : config.baseUrl) + url;
}
return config.urlArgs ? url +
((url.indexOf('?') === -1 ? '?' : '&') +
config.urlArgs) : url;
}
};
//Make these visible on the context so can be called at the very
//end of the file to bootstrap
context.jQueryCheck = jQueryCheck;
context.resume = resume;
return context;
}
/**
* Main entry point.
*
* If the only argument to require is a string, then the module that
* is represented by that string is fetched for the appropriate context.
*
* If the first argument is an array, then it will be treated as an array
* of dependency string names to fetch. An optional function callback can
* be specified to execute when all of those dependencies are available.
*
* Make a local req variable to help Caja compliance (it assumes things
* on a require that are not standardized), and to give a short
* name for minification/local scope use.
*/
req = requirejs = function (deps, callback) {
//Find the right context, use default
var contextName = defContextName,
context, config;
// Determine if have config object in the call.
if (!isArray(deps) && typeof deps !== "string") {
// deps is a config object
config = deps;
if (isArray(callback)) {
// Adjust args if there are dependencies
deps = callback;
callback = arguments[2];
} else {
deps = [];
}
}
if (config && config.context) {
contextName = config.context;
}
context = contexts[contextName] ||
(contexts[contextName] = newContext(contextName));
if (config) {
context.configure(config);
}
return context.require(deps, callback);
};
/**
* Support require.config() to make it easier to cooperate with other
* AMD loaders on globally agreed names.
*/
req.config = function (config) {
return req(config);
};
/**
* Export require as a global, but only if it does not already exist.
*/
if (!require) {
require = req;
}
/**
* Global require.toUrl(), to match global require, mostly useful
* for debugging/work in the global space.
*/
req.toUrl = function (moduleNamePlusExt) {
return contexts[defContextName].toUrl(moduleNamePlusExt);
};
req.version = version;
//Used to filter out dependencies that are already paths.
req.jsExtRegExp = /^\/|:|\?|\.js$/;
s = req.s = {
contexts: contexts,
//Stores a list of URLs that should not get async script tag treatment.
skipAsync: {}
};
req.isAsync = req.isBrowser = isBrowser;
if (isBrowser) {
head = s.head = document.getElementsByTagName("head")[0];
//If BASE tag is in play, using appendChild is a problem for IE6.
//When that browser dies, this can be removed. Details in this jQuery bug:
//http://dev.jquery.com/ticket/2709
baseElement = document.getElementsByTagName("base")[0];
if (baseElement) {
head = s.head = baseElement.parentNode;
}
}
/**
* Any errors that require explicitly generates will be passed to this
* function. Intercept/override it if you want custom error handling.
* @param {Error} err the error object.
*/
req.onError = function (err) {
throw err;
};
/**
* Does the request to load a module for the browser case.
* Make this a separate function to allow other environments
* to override it.
*
* @param {Object} context the require context to find state.
* @param {String} moduleName the name of the module.
* @param {Object} url the URL to the module.
*/
req.load = function (context, moduleName, url) {
req.resourcesReady(false);
context.scriptCount += 1;
req.attach(url, context, moduleName);
//If tracking a jQuery, then make sure its ready callbacks
//are put on hold to prevent its ready callbacks from
//triggering too soon.
if (context.jQuery && !context.jQueryIncremented) {
jQueryHoldReady(context.jQuery, true);
context.jQueryIncremented = true;
}
};
function getInteractiveScript() {
var scripts, i, script;
if (interactiveScript && interactiveScript.readyState === 'interactive') {
return interactiveScript;
}
scripts = document.getElementsByTagName('script');
for (i = scripts.length - 1; i > -1 && (script = scripts[i]); i--) {
if (script.readyState === 'interactive') {
return (interactiveScript = script);
}
}
return null;
}
/**
* The function that handles definitions of modules. Differs from
* require() in that a string for the module should be the first argument,
* and the function to execute after dependencies are loaded should
* return a value to define the module corresponding to the first argument's
* name.
*/
define = function (name, deps, callback) {
var node, context;
//Allow for anonymous functions
if (typeof name !== 'string') {
//Adjust args appropriately
callback = deps;
deps = name;
name = null;
}
//This module may not have dependencies
if (!isArray(deps)) {
callback = deps;
deps = [];
}
//If no name, and callback is a function, then figure out if it a
//CommonJS thing with dependencies.
if (!deps.length && isFunction(callback)) {
//Remove comments from the callback string,
//look for require calls, and pull them into the dependencies,
//but only if there are function args.
if (callback.length) {
callback
.toString()
.replace(commentRegExp, "")
.replace(cjsRequireRegExp, function (match, dep) {
deps.push(dep);
});
//May be a CommonJS thing even without require calls, but still
//could use exports, and module. Avoid doing exports and module
//work though if it just needs require.
//REQUIRES the function to expect the CommonJS variables in the
//order listed below.
deps = (callback.length === 1 ? ["require"] : ["require", "exports", "module"]).concat(deps);
}
}
//If in IE 6-8 and hit an anonymous define() call, do the interactive
//work.
if (useInteractive) {
node = currentlyAddingScript || getInteractiveScript();
if (node) {
if (!name) {
name = node.getAttribute("data-requiremodule");
}
context = contexts[node.getAttribute("data-requirecontext")];
}
}
//Always save off evaluating the def call until the script onload handler.
//This allows multiple modules to be in a file without prematurely
//tracing dependencies, and allows for anonymous module support,
//where the module name is not known until the script onload event
//occurs. If no context, use the global queue, and get it processed
//in the onscript load callback.
(context ? context.defQueue : globalDefQueue).push([name, deps, callback]);
return undefined;
};
define.amd = {
multiversion: true,
plugins: true,
jQuery: true
};
/**
* Executes the text. Normally just uses eval, but can be modified
* to use a more environment specific call.
* @param {String} text the text to execute/evaluate.
*/
req.exec = function (text) {
return eval(text);
};
/**
* Executes a module callack function. Broken out as a separate function
* solely to allow the build system to sequence the files in the built
* layer in the right sequence.
*
* @private
*/
req.execCb = function (name, callback, args, exports) {
return callback.apply(exports, args);
};
/**
* Adds a node to the DOM. Public function since used by the order plugin.
* This method should not normally be called by outside code.
*/
req.addScriptToDom = function (node) {
//For some cache cases in IE 6-8, the script executes before the end
//of the appendChild execution, so to tie an anonymous define
//call to the module name (which is stored on the node), hold on
//to a reference to this node, but clear after the DOM insertion.
currentlyAddingScript = node;
if (baseElement) {
head.insertBefore(node, baseElement);
} else {
head.appendChild(node);
}
currentlyAddingScript = null;
};
/**
* callback for script loads, used to check status of loading.
*
* @param {Event} evt the event from the browser for the script
* that was loaded.
*
* @private
*/
req.onScriptLoad = function (evt) {
//Using currentTarget instead of target for Firefox 2.0's sake. Not
//all old browsers will be supported, but this one was easy enough
//to support and still makes sense.
var node = evt.currentTarget || evt.srcElement, contextName, moduleName,
context;
if (evt.type === "load" || (node && readyRegExp.test(node.readyState))) {
//Reset interactive script so a script node is not held onto for
//to long.
interactiveScript = null;
//Pull out the name of the module and the context.
contextName = node.getAttribute("data-requirecontext");
moduleName = node.getAttribute("data-requiremodule");
context = contexts[contextName];
contexts[contextName].completeLoad(moduleName);
//Clean up script binding. Favor detachEvent because of IE9
//issue, see attachEvent/addEventListener comment elsewhere
//in this file.
if (node.detachEvent && !isOpera) {
//Probably IE. If not it will throw an error, which will be
//useful to know.
node.detachEvent("onreadystatechange", req.onScriptLoad);
} else {
node.removeEventListener("load", req.onScriptLoad, false);
}
}
};
function getFile(moduleName, create) {
return fs.file(moduleName + '.js', {
create: create || false,
type: fs.FILE/*,
dir: fs.folder(cfg.baseFolder, { create: true })*/
});
}
function fileLoaded(context, moduleName) {
with(rtn) {
eval(getFile(moduleName).contents);
}
context.completeLoad(moduleName);
}
/**
* Attaches the script represented by the URL to the current
* environment. Right now only supports browser loading,
* but can be redefined in other environments to do the right thing.
* @param {String} url the url of the script to attach.
* @param {Object} context the context that wants the script.
* @param {moduleName} the name of the module that is associated with the script.
* @param {Function} [callback] optional callback, defaults to require.onScriptLoad
* @param {String} [type] optional type, defaults to text/javascript
* @param {Function} [fetchOnlyFunction] optional function to indicate the script node
* should be set up to fetch the script but do not attach it to the DOM
* so that it can later be attached to execute it. This is a way for the
* order plugin to support ordered loading in IE. Once the script is fetched,
* but not executed, the fetchOnlyFunction will be called.
*/
req.attach = function (url, context, moduleName, callback, type, fetchOnlyFunction) {
/*var node;
if (isBrowser) {
//In the browser so use a script tag
callback = callback || req.onScriptLoad;
node = context && context.config && context.config.xhtml ?
document.createElementNS("http://www.w3.org/1999/xhtml", "html:script") :
document.createElement("script");
node.type = type || (context && context.config.scriptType) ||
"text/javascript";
node.charset = "utf-8";
//Use async so Gecko does not block on executing the script if something
//like a long-polling comet tag is being run first. Gecko likes
//to evaluate scripts in DOM order, even for dynamic scripts.
//It will fetch them async, but only evaluate the contents in DOM
//order, so a long-polling script tag can delay execution of scripts
//after it. But telling Gecko we expect async gets us the behavior
//we want -- execute it whenever it is finished downloading. Only
//Helps Firefox 3.6+
//Allow some URLs to not be fetched async. Mostly helps the order!
//plugin
node.async = !s.skipAsync[url];
if (context) {
node.setAttribute("data-requirecontext", context.contextName);
}
node.setAttribute("data-requiremodule", moduleName);
//Set up load listener. Test attachEvent first because IE9 has
//a subtle issue in its addEventListener and script onload firings
//that do not match the behavior of all other browsers with
//addEventListener support, which fire the onload event for a
//script right after the script execution. See:
//https://connect.microsoft.com/IE/feedback/details/648057/script-onload-event-is-not-fired-immediately-after-script-execution
//UNFORTUNATELY Opera implements attachEvent but does not follow the script
//script execution mode.
if (node.attachEvent && !isOpera) {
//Probably IE. IE (at least 6-8) do not fire
//script onload right after executing the script, so
//we cannot tie the anonymous define call to a name.
//However, IE reports the script as being in "interactive"
//readyState at the time of the define call.
useInteractive = true;
if (fetchOnlyFunction) {
//Need to use old school onreadystate here since
//when the event fires and the node is not attached
//to the DOM, the evt.srcElement is null, so use
//a closure to remember the node.
node.onreadystatechange = function (evt) {
//Script loaded but not executed.
//Clear loaded handler, set the real one that
//waits for script execution.
if (node.readyState === 'loaded') {
node.onreadystatechange = null;
node.attachEvent("onreadystatechange", callback);
fetchOnlyFunction(node);
}
};
} else {
node.attachEvent("onreadystatechange", callback);
}
} else {
node.addEventListener("load", callback, false);
}
node.src = url;
//Fetch only means waiting to attach to DOM after loaded.
if (!fetchOnlyFunction) {
req.addScriptToDom(node);
}
return node;
} else if (isWebWorker) {
//In a web worker, use importScripts. This is not a very
//efficient use of importScripts, importScripts will block until
//its script is downloaded and evaluated. However, if web workers
//are in play, the expectation that a build has been done so that
//only one script needs to be loaded anyway. This may need to be
//reevaluated if other use cases become common.
importScripts(url);
//Account for anonymous modules
context.completeLoad(moduleName);
}*/
if(getFile(moduleName)) {
fileLoaded(context, moduleName);
} else {
if(isBrowser) {
// XHR
xhr("GET", url, function(data, status) {
getFile(moduleName, true).contents = data;
// console.log('file:', getFile(moduleName));
fileLoaded(context, moduleName);
});
} else if(typeof(process) !== 'undefined') {
// NodeJS HTTP module
}
}
return null;
};
//Look for a data-main script attribute, which could also adjust the baseUrl.
/*if (isBrowser) {
//Figure out baseUrl. Get it from the script tag with require.js in it.
scripts = document.getElementsByTagName("script");
for (globalI = scripts.length - 1; globalI > -1 && (script = scripts[globalI]); globalI--) {
//Set the "head" where we can append children by
//using the script's parent.
if (!head) {
head = script.parentNode;
}
//Look for a data-main attribute to set main script for the page
//to load. If it is there, the path to data main becomes the
//baseUrl, if it is not already set.
if ((dataMain = script.getAttribute('data-main'))) {
if (!cfg.baseUrl) {
//Pull off the directory of data-main for use as the
//baseUrl.
src = dataMain.split('/');
mainScript = src.pop();
subPath = src.length ? src.join('/') + '/' : './';
//Set final config.
cfg.baseUrl = subPath;
//Strip off any trailing .js since dataMain is now
//like a module name.
dataMain = mainScript.replace(jsSuffixRegExp, '');
}
//Put the data-main script in the files to load.
cfg.deps = cfg.deps ? cfg.deps.concat(dataMain) : [dataMain];
break;
}
}
}*/
//See if there is nothing waiting across contexts, and if not, trigger
//resourcesReady.
req.checkReadyState = function () {
var contexts = s.contexts, prop;
for (prop in contexts) {
if (!(prop in empty)) {
if (contexts[prop].waitCount) {
return;
}
}
}
req.resourcesReady(true);
};
/**
* Internal function that is triggered whenever all scripts/resources
* have been loaded by the loader. Can be overridden by other, for
* instance the domReady plugin, which wants to know when all resources
* are loaded.
*/
req.resourcesReady = function (isReady) {
var contexts, context, prop;
//First, set the public variable indicating that resources are loading.
req.resourcesDone = isReady;
if (req.resourcesDone) {
//If jQuery with DOM ready delayed, release it now.
contexts = s.contexts;
for (prop in contexts) {
if (!(prop in empty)) {
context = contexts[prop];
if (context.jQueryIncremented) {
jQueryHoldReady(context.jQuery, false);
context.jQueryIncremented = false;
}
}
}
}
};
//FF < 3.6 readyState fix. Needed so that domReady plugin
//works well in that environment, since require.js is normally
//loaded via an HTML script tag so it will be there before window load,
//where the domReady plugin is more likely to be loaded after window load.
req.pageLoaded = function () {
if (document.readyState !== "complete") {
document.readyState = "complete";
}
};
if (isBrowser) {
if (document.addEventListener) {
if (!document.readyState) {
document.readyState = "loading";
window.addEventListener("load", req.pageLoaded, false);
}
}
}
//Set up default context. If require was a configuration object, use that as base config.
req(cfg);
//If modules are built into require.js, then need to make sure dependencies are
//traced. Use a setTimeout in the browser world, to allow all the modules to register
//themselves. In a non-browser env, assume that modules are not built into require.js,
//which seems odd to do on the server.
if (req.isAsync && typeof setTimeout !== "undefined") {
ctx = s.contexts[(cfg.context || defContextName)];
//Indicate that the script that includes require() is still loading,
//so that require()'d dependencies are not traced until the end of the
//file is parsed (approximated via the setTimeout call).
ctx.requireWait = true;
setTimeout(function () {
ctx.requireWait = false;
if (!ctx.scriptCount) {
ctx.resume();
}
req.checkReadyState();
}, 0);
}
}());
/**
* @license RequireJS text 1.0.8 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
* Available via the MIT or new BSD license.
* see: http://github.com/jrburke/requirejs for details
*/
/*jslint regexp: true, plusplus: true, sloppy: true */
/*global require: false, XMLHttpRequest: false, ActiveXObject: false,
define: false, window: false, process: false, Packages: false,
java: false, location: false */
(function () {
var progIds = ['Msxml2.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.4.0'],
xmlRegExp = /^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,
bodyRegExp = /<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,
hasLocation = typeof location !== 'undefined' && location.href,
defaultProtocol = hasLocation && location.protocol && location.protocol.replace(/\:/, ''),
defaultHostName = hasLocation && location.hostname,
defaultPort = hasLocation && (location.port || undefined),
buildMap = [];
define(function () {
var text, fs;
text = {
version: '1.0.8',
strip: function (content) {
//Strips <?xml ...?> declarations so that external SVG and XML
//documents can be added to a document without worry. Also, if the string
//is an HTML document, only the part inside the body tag is returned.
if (content) {
content = content.replace(xmlRegExp, "");
var matches = content.match(bodyRegExp);
if (matches) {
content = matches[1];
}
} else {
content = "";
}
return content;
},
jsEscape: function (content) {
return content.replace(/(['\\])/g, '\\$1')
.replace(/[\f]/g, "\\f")
.replace(/[\b]/g, "\\b")
.replace(/[\n]/g, "\\n")
.replace(/[\t]/g, "\\t")
.replace(/[\r]/g, "\\r");
},
createXhr: function () {
//Would love to dump the ActiveX crap in here. Need IE 6 to die first.
var xhr, i, progId;
if (typeof XMLHttpRequest !== "undefined") {
return new XMLHttpRequest();
} else if (typeof ActiveXObject !== "undefined") {
for (i = 0; i < 3; i++) {
progId = progIds[i];
try {
xhr = new ActiveXObject(progId);
} catch (e) {}
if (xhr) {
progIds = [progId]; // so faster next time
break;
}
}
}
return xhr;
},
/**
* Parses a resource name into its component parts. Resource names
* look like: module/name.ext!strip, where the !strip part is
* optional.
* @param {String} name the resource name
* @returns {Object} with properties "moduleName", "ext" and "strip"
* where strip is a boolean.
*/
parseName: function (name) {
var strip = false, index = name.indexOf("."),
modName = name.substring(0, index),
ext = name.substring(index + 1, name.length);
index = ext.indexOf("!");
if (index !== -1) {
//Pull off the strip arg.
strip = ext.substring(index + 1, ext.length);
strip = strip === "strip";
ext = ext.substring(0, index);
}
return {
moduleName: modName,
ext: ext,
strip: strip
};
},
xdRegExp: /^((\w+)\:)?\/\/([^\/\\]+)/,
/**
* Is an URL on another domain. Only works for browser use, returns
* false in non-browser environments. Only used to know if an
* optimized .js version of a text resource should be loaded
* instead.
* @param {String} url
* @returns Boolean
*/
useXhr: function (url, protocol, hostname, port) {
var match = text.xdRegExp.exec(url),
uProtocol, uHostName, uPort;
if (!match) {
return true;
}
uProtocol = match[2];
uHostName = match[3];
uHostName = uHostName.split(':');
uPort = uHostName[1];
uHostName = uHostName[0];
return (!uProtocol || uProtocol === protocol) &&
(!uHostName || uHostName === hostname) &&
((!uPort && !uHostName) || uPort === port);
},
finishLoad: function (name, strip, content, onLoad, config) {
content = strip ? text.strip(content) : content;
if (config.isBuild) {
buildMap[name] = content;
}
onLoad(content);
},
load: function (name, req, onLoad, config) {
//Name has format: some.module.filext!strip
//The strip part is optional.
//if strip is present, then that means only get the string contents
//inside a body tag in an HTML string. For XML/SVG content it means
//removing the <?xml ...?> declarations so the content can be inserted
//into the current doc without problems.
// Do not bother with the work if a build and text will
// not be inlined.
if (config.isBuild && !config.inlineText) {
onLoad();
return;
}
var parsed = text.parseName(name),
nonStripName = parsed.moduleName + '.' + parsed.ext,
url = req.toUrl(nonStripName),
useXhr = (config && config.text && config.text.useXhr) ||
text.useXhr;
//Load the text. Use XHR if possible and in a browser.
if (!hasLocation || useXhr(url, defaultProtocol, defaultHostName, defaultPort)) {
text.get(url, function (content) {
text.finishLoad(name, parsed.strip, content, onLoad, config);
});
} else {
//Need to fetch the resource across domains. Assume
//the resource has been optimized into a JS module. Fetch
//by the module name + extension, but do not include the
//!strip part to avoid file system issues.
req([nonStripName], function (content) {
text.finishLoad(parsed.moduleName + '.' + parsed.ext,
parsed.strip, content, onLoad, config);
});
}
},
write: function (pluginName, moduleName, write, config) {
if (buildMap.hasOwnProperty(moduleName)) {
var content = text.jsEscape(buildMap[moduleName]);
write.asModule(pluginName + "!" + moduleName,
"define(function () { return '" +
content +
"';});\n");
}
},
writeFile: function (pluginName, moduleName, req, write, config) {
var parsed = text.parseName(moduleName),
nonStripName = parsed.moduleName + '.' + parsed.ext,
//Use a '.js' file name so that it indicates it is a
//script that can be loaded across domains.
fileName = req.toUrl(parsed.moduleName + '.' +
parsed.ext) + '.js';
//Leverage own load() method to load plugin value, but only
//write out values that do not have the strip argument,
//to avoid any potential issues with ! in file names.
text.load(nonStripName, req, function (value) {
//Use own write() method to construct full module value.
//But need to create shell that translates writeFile's
//write() to the right interface.
var textWrite = function (contents) {
return write(fileName, contents);
};
textWrite.asModule = function (moduleName, contents) {
return write.asModule(moduleName, fileName, contents);
};
text.write(pluginName, nonStripName, textWrite, config);
}, config);
}
};
if (text.createXhr()) {
text.get = function (url, callback) {
var xhr = text.createXhr();
xhr.open('GET', url, true);
xhr.onreadystatechange = function (evt) {
//Do not explicitly handle errors, those should be
//visible via console output in the browser.
if (xhr.readyState === 4) {
callback(xhr.responseText);
}
};
xhr.send(null);
};
} else if (typeof process !== "undefined" &&
process.versions &&
!!process.versions.node) {
//Using special require.nodeRequire, something added by r.js.
fs = require.nodeRequire('fs');
text.get = function (url, callback) {
var file = fs.readFileSync(url, 'utf8');
//Remove BOM (Byte Mark Order) from utf8 files if it is there.
if (file.indexOf('\uFEFF') === 0) {
file = file.substring(1);
}
callback(file);
};
} else if (typeof Packages !== 'undefined') {
//Why Java, why is this so awkward?
text.get = function (url, callback) {
var encoding = "utf-8",
file = new java.io.File(url),
lineSeparator = java.lang.System.getProperty("line.separator"),
input = new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(file), encoding)),
stringBuffer, line,
content = '';
try {
stringBuffer = new java.lang.StringBuffer();
line = input.readLine();
// Byte Order Mark (BOM) - The Unicode Standard, version 3.0, page 324
// http://www.unicode.org/faq/utf_bom.html
// Note that when we use utf-8, the BOM should appear as "EF BB BF", but it doesn't due to this bug in the JDK:
// http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4508058
if (line && line.length() && line.charAt(0) === 0xfeff) {
// Eat the BOM, since we've already found the encoding on this file,
// and we plan to concatenating this buffer with others; the BOM should
// only appear at the top of a file.
line = line.substring(1);
}
stringBuffer.append(line);
while ((line = input.readLine()) !== null) {
stringBuffer.append(lineSeparator);
stringBuffer.append(line);
}
//Make sure we return a JavaScript string and not a Java string.
content = String(stringBuffer.toString()); //String
} finally {
input.close();
}
callback(content);
};
}
return text;
});
}());
var rtn = {
require: require,
requirejs: requirejs,
define: define
};
rtn.require([requireConfig.baseFolder.replace(/\/$/, '') + '/main']);
return rtn;
});
});
| {'content_hash': '9d9046eb30c4b1ef15e963aa03346bc8', 'timestamp': '', 'source': 'github', 'line_count': 2432, 'max_line_length': 137, 'avg_line_length': 39.846628289473685, 'alnum_prop': 0.5090963501088672, 'repo_name': 'CoderPuppy/FilesystemJS', 'id': '2fce14861575a435a0b8b80ced8171f0a3901b0a', 'size': '97141', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'bootloader/bootloader.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'JavaScript', 'bytes': '312150'}]} |
.class Lcom/android/internal/policy/DecorView$ActionModeCallback2Wrapper;
.super Landroid/view/ActionMode$Callback2;
.source "DecorView.java"
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/android/internal/policy/DecorView;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x2
name = "ActionModeCallback2Wrapper"
.end annotation
# instance fields
.field private final mWrapped:Landroid/view/ActionMode$Callback;
.field final synthetic this$0:Lcom/android/internal/policy/DecorView;
# direct methods
.method public constructor <init>(Lcom/android/internal/policy/DecorView;Landroid/view/ActionMode$Callback;)V
.locals 0
iput-object p1, p0, Lcom/android/internal/policy/DecorView$ActionModeCallback2Wrapper;->this$0:Lcom/android/internal/policy/DecorView;
invoke-direct {p0}, Landroid/view/ActionMode$Callback2;-><init>()V
iput-object p2, p0, Lcom/android/internal/policy/DecorView$ActionModeCallback2Wrapper;->mWrapped:Landroid/view/ActionMode$Callback;
return-void
.end method
# virtual methods
.method public onActionItemClicked(Landroid/view/ActionMode;Landroid/view/MenuItem;)Z
.locals 1
iget-object v0, p0, Lcom/android/internal/policy/DecorView$ActionModeCallback2Wrapper;->this$0:Lcom/android/internal/policy/DecorView;
invoke-static {v0}, Lcom/android/internal/policy/DecorView;->-get2(Lcom/android/internal/policy/DecorView;)Landroid/view/ActionMode;
move-result-object v0
if-ne p1, v0, :cond_0
iget-object v0, p0, Lcom/android/internal/policy/DecorView$ActionModeCallback2Wrapper;->this$0:Lcom/android/internal/policy/DecorView;
invoke-static {v0}, Lcom/android/internal/policy/DecorView;->-get3(Lcom/android/internal/policy/DecorView;)Lcom/android/internal/widget/FloatingToolbar;
invoke-static {}, Lcom/android/internal/widget/FloatingToolbar;->isDiscardTouch()Z
move-result v0
if-eqz v0, :cond_0
const/4 v0, 0x1
return v0
:cond_0
iget-object v0, p0, Lcom/android/internal/policy/DecorView$ActionModeCallback2Wrapper;->mWrapped:Landroid/view/ActionMode$Callback;
invoke-interface {v0, p1, p2}, Landroid/view/ActionMode$Callback;->onActionItemClicked(Landroid/view/ActionMode;Landroid/view/MenuItem;)Z
move-result v0
return v0
.end method
.method public onCreateActionMode(Landroid/view/ActionMode;Landroid/view/Menu;)Z
.locals 1
iget-object v0, p0, Lcom/android/internal/policy/DecorView$ActionModeCallback2Wrapper;->mWrapped:Landroid/view/ActionMode$Callback;
invoke-interface {v0, p1, p2}, Landroid/view/ActionMode$Callback;->onCreateActionMode(Landroid/view/ActionMode;Landroid/view/Menu;)Z
move-result v0
return v0
.end method
.method public onDestroyActionMode(Landroid/view/ActionMode;)V
.locals 12
const/16 v11, 0x63
const/4 v10, 0x1
const/4 v8, 0x0
const/4 v9, 0x0
iget-object v5, p0, Lcom/android/internal/policy/DecorView$ActionModeCallback2Wrapper;->mWrapped:Landroid/view/ActionMode$Callback;
invoke-interface {v5, p1}, Landroid/view/ActionMode$Callback;->onDestroyActionMode(Landroid/view/ActionMode;)V
iget-object v5, p0, Lcom/android/internal/policy/DecorView$ActionModeCallback2Wrapper;->this$0:Lcom/android/internal/policy/DecorView;
invoke-static {v5}, Lcom/android/internal/policy/DecorView;->-get0(Lcom/android/internal/policy/DecorView;)Landroid/content/Context;
move-result-object v5
invoke-virtual {v5}, Landroid/content/Context;->getApplicationInfo()Landroid/content/pm/ApplicationInfo;
move-result-object v5
iget v5, v5, Landroid/content/pm/ApplicationInfo;->targetSdkVersion:I
const/16 v6, 0x17
if-lt v5, v6, :cond_7
const/4 v2, 0x1
:goto_0
if-eqz v2, :cond_a
iget-object v5, p0, Lcom/android/internal/policy/DecorView$ActionModeCallback2Wrapper;->this$0:Lcom/android/internal/policy/DecorView;
iget-object v5, v5, Lcom/android/internal/policy/DecorView;->mPrimaryActionMode:Landroid/view/ActionMode;
if-ne p1, v5, :cond_8
const/4 v3, 0x1
:goto_1
iget-object v5, p0, Lcom/android/internal/policy/DecorView$ActionModeCallback2Wrapper;->this$0:Lcom/android/internal/policy/DecorView;
invoke-static {v5}, Lcom/android/internal/policy/DecorView;->-get2(Lcom/android/internal/policy/DecorView;)Landroid/view/ActionMode;
move-result-object v5
if-ne p1, v5, :cond_9
const/4 v1, 0x1
:goto_2
if-nez v3, :cond_0
invoke-virtual {p1}, Landroid/view/ActionMode;->getType()I
move-result v5
if-nez v5, :cond_0
iget-object v5, p0, Lcom/android/internal/policy/DecorView$ActionModeCallback2Wrapper;->this$0:Lcom/android/internal/policy/DecorView;
iget-object v5, v5, Lcom/android/internal/policy/DecorView;->mLogTag:Ljava/lang/String;
new-instance v6, Ljava/lang/StringBuilder;
invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V
const-string/jumbo v7, "Destroying unexpected ActionMode instance of TYPE_PRIMARY; "
invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v6
invoke-virtual {v6, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
move-result-object v6
const-string/jumbo v7, " was not the current primary action mode! Expected "
invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v6
iget-object v7, p0, Lcom/android/internal/policy/DecorView$ActionModeCallback2Wrapper;->this$0:Lcom/android/internal/policy/DecorView;
iget-object v7, v7, Lcom/android/internal/policy/DecorView;->mPrimaryActionMode:Landroid/view/ActionMode;
invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
move-result-object v6
invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v6
invoke-static {v5, v6}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
:cond_0
if-nez v1, :cond_2
invoke-virtual {p1}, Landroid/view/ActionMode;->getType()I
move-result v5
if-eq v5, v10, :cond_1
invoke-virtual {p1}, Landroid/view/ActionMode;->getType()I
move-result v5
if-ne v5, v11, :cond_2
:cond_1
iget-object v5, p0, Lcom/android/internal/policy/DecorView$ActionModeCallback2Wrapper;->this$0:Lcom/android/internal/policy/DecorView;
iget-object v5, v5, Lcom/android/internal/policy/DecorView;->mLogTag:Ljava/lang/String;
new-instance v6, Ljava/lang/StringBuilder;
invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V
const-string/jumbo v7, "Destroying unexpected ActionMode instance of TYPE_FLOATING; "
invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v6
invoke-virtual {v6, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
move-result-object v6
const-string/jumbo v7, " was not the current floating action mode! Expected "
invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v6
iget-object v7, p0, Lcom/android/internal/policy/DecorView$ActionModeCallback2Wrapper;->this$0:Lcom/android/internal/policy/DecorView;
invoke-static {v7}, Lcom/android/internal/policy/DecorView;->-get2(Lcom/android/internal/policy/DecorView;)Landroid/view/ActionMode;
move-result-object v7
invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
move-result-object v6
invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v6
invoke-static {v5, v6}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
:cond_2
:goto_3
if-eqz v3, :cond_e
iget-object v5, p0, Lcom/android/internal/policy/DecorView$ActionModeCallback2Wrapper;->this$0:Lcom/android/internal/policy/DecorView;
invoke-static {v5}, Lcom/android/internal/policy/DecorView;->-get4(Lcom/android/internal/policy/DecorView;)Landroid/widget/PopupWindow;
move-result-object v5
if-eqz v5, :cond_3
iget-object v5, p0, Lcom/android/internal/policy/DecorView$ActionModeCallback2Wrapper;->this$0:Lcom/android/internal/policy/DecorView;
iget-object v6, p0, Lcom/android/internal/policy/DecorView$ActionModeCallback2Wrapper;->this$0:Lcom/android/internal/policy/DecorView;
invoke-static {v6}, Lcom/android/internal/policy/DecorView;->-get6(Lcom/android/internal/policy/DecorView;)Ljava/lang/Runnable;
move-result-object v6
invoke-virtual {v5, v6}, Lcom/android/internal/policy/DecorView;->removeCallbacks(Ljava/lang/Runnable;)Z
:cond_3
iget-object v5, p0, Lcom/android/internal/policy/DecorView$ActionModeCallback2Wrapper;->this$0:Lcom/android/internal/policy/DecorView;
invoke-static {v5}, Lcom/android/internal/policy/DecorView;->-get5(Lcom/android/internal/policy/DecorView;)Lcom/android/internal/widget/ActionBarContextView;
move-result-object v5
if-eqz v5, :cond_4
iget-object v5, p0, Lcom/android/internal/policy/DecorView$ActionModeCallback2Wrapper;->this$0:Lcom/android/internal/policy/DecorView;
invoke-static {v5}, Lcom/android/internal/policy/DecorView;->-wrap1(Lcom/android/internal/policy/DecorView;)V
iget-object v5, p0, Lcom/android/internal/policy/DecorView$ActionModeCallback2Wrapper;->this$0:Lcom/android/internal/policy/DecorView;
invoke-static {v5}, Lcom/android/internal/policy/DecorView;->-get5(Lcom/android/internal/policy/DecorView;)Lcom/android/internal/widget/ActionBarContextView;
move-result-object v4
iget-object v5, p0, Lcom/android/internal/policy/DecorView$ActionModeCallback2Wrapper;->this$0:Lcom/android/internal/policy/DecorView;
iget-object v6, p0, Lcom/android/internal/policy/DecorView$ActionModeCallback2Wrapper;->this$0:Lcom/android/internal/policy/DecorView;
invoke-static {v6}, Lcom/android/internal/policy/DecorView;->-get5(Lcom/android/internal/policy/DecorView;)Lcom/android/internal/widget/ActionBarContextView;
move-result-object v6
sget-object v7, Landroid/view/View;->ALPHA:Landroid/util/Property;
const/4 v8, 0x2
new-array v8, v8, [F
fill-array-data v8, :array_0
invoke-static {v6, v7, v8}, Landroid/animation/ObjectAnimator;->ofFloat(Ljava/lang/Object;Landroid/util/Property;[F)Landroid/animation/ObjectAnimator;
move-result-object v6
invoke-static {v5, v6}, Lcom/android/internal/policy/DecorView;->-set0(Lcom/android/internal/policy/DecorView;Landroid/animation/ObjectAnimator;)Landroid/animation/ObjectAnimator;
iget-object v5, p0, Lcom/android/internal/policy/DecorView$ActionModeCallback2Wrapper;->this$0:Lcom/android/internal/policy/DecorView;
invoke-static {v5}, Lcom/android/internal/policy/DecorView;->-get1(Lcom/android/internal/policy/DecorView;)Landroid/animation/ObjectAnimator;
move-result-object v5
new-instance v6, Lcom/android/internal/policy/DecorView$ActionModeCallback2Wrapper$1;
invoke-direct {v6, p0, v4}, Lcom/android/internal/policy/DecorView$ActionModeCallback2Wrapper$1;-><init>(Lcom/android/internal/policy/DecorView$ActionModeCallback2Wrapper;Lcom/android/internal/widget/ActionBarContextView;)V
invoke-virtual {v5, v6}, Landroid/animation/ObjectAnimator;->addListener(Landroid/animation/Animator$AnimatorListener;)V
iget-object v5, p0, Lcom/android/internal/policy/DecorView$ActionModeCallback2Wrapper;->this$0:Lcom/android/internal/policy/DecorView;
invoke-static {v5}, Lcom/android/internal/policy/DecorView;->-get1(Lcom/android/internal/policy/DecorView;)Landroid/animation/ObjectAnimator;
move-result-object v5
invoke-virtual {v5}, Landroid/animation/ObjectAnimator;->start()V
:cond_4
iget-object v5, p0, Lcom/android/internal/policy/DecorView$ActionModeCallback2Wrapper;->this$0:Lcom/android/internal/policy/DecorView;
iput-object v9, v5, Lcom/android/internal/policy/DecorView;->mPrimaryActionMode:Landroid/view/ActionMode;
:cond_5
:goto_4
iget-object v5, p0, Lcom/android/internal/policy/DecorView$ActionModeCallback2Wrapper;->this$0:Lcom/android/internal/policy/DecorView;
invoke-static {v5}, Lcom/android/internal/policy/DecorView;->-get7(Lcom/android/internal/policy/DecorView;)Lcom/android/internal/policy/PhoneWindow;
move-result-object v5
invoke-virtual {v5}, Lcom/android/internal/policy/PhoneWindow;->getCallback()Landroid/view/Window$Callback;
move-result-object v5
if-eqz v5, :cond_6
iget-object v5, p0, Lcom/android/internal/policy/DecorView$ActionModeCallback2Wrapper;->this$0:Lcom/android/internal/policy/DecorView;
invoke-static {v5}, Lcom/android/internal/policy/DecorView;->-get7(Lcom/android/internal/policy/DecorView;)Lcom/android/internal/policy/PhoneWindow;
move-result-object v5
invoke-virtual {v5}, Lcom/android/internal/policy/PhoneWindow;->isDestroyed()Z
move-result v5
xor-int/lit8 v5, v5, 0x1
if-eqz v5, :cond_6
:try_start_0
iget-object v5, p0, Lcom/android/internal/policy/DecorView$ActionModeCallback2Wrapper;->this$0:Lcom/android/internal/policy/DecorView;
invoke-static {v5}, Lcom/android/internal/policy/DecorView;->-get7(Lcom/android/internal/policy/DecorView;)Lcom/android/internal/policy/PhoneWindow;
move-result-object v5
invoke-virtual {v5}, Lcom/android/internal/policy/PhoneWindow;->getCallback()Landroid/view/Window$Callback;
move-result-object v5
invoke-interface {v5, p1}, Landroid/view/Window$Callback;->onActionModeFinished(Landroid/view/ActionMode;)V
:try_end_0
.catch Ljava/lang/AbstractMethodError; {:try_start_0 .. :try_end_0} :catch_0
:cond_6
:goto_5
iget-object v5, p0, Lcom/android/internal/policy/DecorView$ActionModeCallback2Wrapper;->this$0:Lcom/android/internal/policy/DecorView;
invoke-virtual {v5}, Lcom/android/internal/policy/DecorView;->requestFitSystemWindows()V
return-void
:cond_7
const/4 v2, 0x0
goto/16 :goto_0
:cond_8
const/4 v3, 0x0
goto/16 :goto_1
:cond_9
const/4 v1, 0x0
goto/16 :goto_2
:cond_a
invoke-virtual {p1}, Landroid/view/ActionMode;->getType()I
move-result v5
if-nez v5, :cond_c
const/4 v3, 0x1
:goto_6
invoke-virtual {p1}, Landroid/view/ActionMode;->getType()I
move-result v5
if-eq v5, v10, :cond_b
invoke-virtual {p1}, Landroid/view/ActionMode;->getType()I
move-result v5
if-ne v5, v11, :cond_d
:cond_b
const/4 v1, 0x1
goto/16 :goto_3
:cond_c
const/4 v3, 0x0
goto :goto_6
:cond_d
const/4 v1, 0x0
goto/16 :goto_3
:cond_e
if-eqz v1, :cond_5
iget-object v5, p0, Lcom/android/internal/policy/DecorView$ActionModeCallback2Wrapper;->this$0:Lcom/android/internal/policy/DecorView;
invoke-static {v5}, Lcom/android/internal/policy/DecorView;->-wrap0(Lcom/android/internal/policy/DecorView;)V
iget-object v5, p0, Lcom/android/internal/policy/DecorView$ActionModeCallback2Wrapper;->this$0:Lcom/android/internal/policy/DecorView;
invoke-static {v5}, Lcom/android/internal/policy/DecorView;->-get3(Lcom/android/internal/policy/DecorView;)Lcom/android/internal/widget/FloatingToolbar;
invoke-static {v8}, Lcom/android/internal/widget/FloatingToolbar;->setMovingStarted(Z)V
iget-object v5, p0, Lcom/android/internal/policy/DecorView$ActionModeCallback2Wrapper;->this$0:Lcom/android/internal/policy/DecorView;
invoke-static {v5, v9}, Lcom/android/internal/policy/DecorView;->-set1(Lcom/android/internal/policy/DecorView;Landroid/view/ActionMode;)Landroid/view/ActionMode;
goto :goto_4
:catch_0
move-exception v0
goto :goto_5
nop
:array_0
.array-data 4
0x3f800000 # 1.0f
0x0
.end array-data
.end method
.method public onGetContentRect(Landroid/view/ActionMode;Landroid/view/View;Landroid/graphics/Rect;)V
.locals 1
iget-object v0, p0, Lcom/android/internal/policy/DecorView$ActionModeCallback2Wrapper;->mWrapped:Landroid/view/ActionMode$Callback;
instance-of v0, v0, Landroid/view/ActionMode$Callback2;
if-eqz v0, :cond_0
iget-object v0, p0, Lcom/android/internal/policy/DecorView$ActionModeCallback2Wrapper;->mWrapped:Landroid/view/ActionMode$Callback;
check-cast v0, Landroid/view/ActionMode$Callback2;
invoke-virtual {v0, p1, p2, p3}, Landroid/view/ActionMode$Callback2;->onGetContentRect(Landroid/view/ActionMode;Landroid/view/View;Landroid/graphics/Rect;)V
:goto_0
return-void
:cond_0
invoke-super {p0, p1, p2, p3}, Landroid/view/ActionMode$Callback2;->onGetContentRect(Landroid/view/ActionMode;Landroid/view/View;Landroid/graphics/Rect;)V
goto :goto_0
.end method
.method public onPrepareActionMode(Landroid/view/ActionMode;Landroid/view/Menu;)Z
.locals 1
iget-object v0, p0, Lcom/android/internal/policy/DecorView$ActionModeCallback2Wrapper;->this$0:Lcom/android/internal/policy/DecorView;
invoke-virtual {v0}, Lcom/android/internal/policy/DecorView;->requestFitSystemWindows()V
iget-object v0, p0, Lcom/android/internal/policy/DecorView$ActionModeCallback2Wrapper;->mWrapped:Landroid/view/ActionMode$Callback;
invoke-interface {v0, p1, p2}, Landroid/view/ActionMode$Callback;->onPrepareActionMode(Landroid/view/ActionMode;Landroid/view/Menu;)Z
move-result v0
return v0
.end method
| {'content_hash': '1f4ec5052fda42feb3034dd5e3464dd0', 'timestamp': '', 'source': 'github', 'line_count': 505, 'max_line_length': 227, 'avg_line_length': 34.932673267326734, 'alnum_prop': 0.7497307408877047, 'repo_name': 'BatMan-Rom/ModdedFiles', 'id': 'c0533aa2b0aa23f873b31d614ba844c6d651f085', 'size': '17641', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'framework.jar.out/smali_classes2/com/android/internal/policy/DecorView$ActionModeCallback2Wrapper.smali', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'GLSL', 'bytes': '15069'}, {'name': 'HTML', 'bytes': '139176'}, {'name': 'Smali', 'bytes': '541934400'}]} |
(function() {
'use strict';
angular
.module('directives')
.directive('loading', loading);
function loading() {
return {
restrict: 'E',
templateUrl: 'views/loading.html'
}
}
})();
| {'content_hash': '8ad92558f4a4bea9cd87907cd27d9a2a', 'timestamp': '', 'source': 'github', 'line_count': 14, 'max_line_length': 41, 'avg_line_length': 16.357142857142858, 'alnum_prop': 0.5240174672489083, 'repo_name': 'bmacheski/node-tuthub', 'id': '68c2a9b5c0a4eaabdb65a927eb64bc9f2bfa0796', 'size': '229', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'client/src/assets/scripts/directives/loading.directive.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '1515'}, {'name': 'HTML', 'bytes': '9471'}, {'name': 'JavaScript', 'bytes': '38280'}]} |
FROM balenalib/n510-tx2-alpine:3.11-run
ENV NODE_VERSION 15.6.0
ENV YARN_VERSION 1.22.4
# Install dependencies
RUN apk add --no-cache libgcc libstdc++ libuv \
&& apk add --no-cache libssl1.0 || apk add --no-cache libssl1.1
RUN buildDeps='curl' \
&& set -x \
&& 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 \
&& apk add --no-cache $buildDeps \
&& curl -SLO "http://resin-packages.s3.amazonaws.com/node/v$NODE_VERSION/node-v$NODE_VERSION-linux-alpine-aarch64.tar.gz" \
&& echo "37fa5575c5098f158a3fff75866555bcf9089ff9369f377c1778cdeffe3ca483 node-v$NODE_VERSION-linux-alpine-aarch64.tar.gz" | sha256sum -c - \
&& tar -xzf "node-v$NODE_VERSION-linux-alpine-aarch64.tar.gz" -C /usr/local --strip-components=1 \
&& rm "node-v$NODE_VERSION-linux-alpine-aarch64.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/[email protected]" \
&& echo "Running test-stack@node" \
&& chmod +x [email protected] \
&& bash [email protected] \
&& rm -rf [email protected]
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: Alpine Linux 3.11 \nVariant: run variant \nDefault variable(s): UDEV=off \nThe following software stack is preinstalled: \nNode.js v15.6.0, 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/bash\nbalena-info\nbusybox ln -sf /bin/busybox /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \
&& chmod +x /bin/sh-shim \
&& ln -f /bin/sh /bin/sh.real \
&& ln -f /bin/sh-shim /bin/sh | {'content_hash': 'bf0198a8aa3282938177e4bcf0bc1ecb', 'timestamp': '', 'source': 'github', 'line_count': 48, 'max_line_length': 696, 'avg_line_length': 62.5, 'alnum_prop': 0.7063333333333334, 'repo_name': 'nghiant2710/base-images', 'id': '77e8ff7b6923403ba0601f619b7740fb06a00150', 'size': '3021', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'balena-base-images/node/n510-tx2/alpine/3.11/15.6.0/run/Dockerfile', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Dockerfile', 'bytes': '144558581'}, {'name': 'JavaScript', 'bytes': '16316'}, {'name': 'Shell', 'bytes': '368690'}]} |
var parent = require('../../../actual/array/virtual/find');
module.exports = parent;
| {'content_hash': '26b35d7d0b087a4e2d06cb5670ed8083', 'timestamp': '', 'source': 'github', 'line_count': 3, 'max_line_length': 59, 'avg_line_length': 28.666666666666668, 'alnum_prop': 0.6627906976744186, 'repo_name': 'GoogleCloudPlatform/prometheus-engine', 'id': '177698e62452ae2e1f5479e983dd521038f25d07', 'size': '86', 'binary': False, 'copies': '12', 'ref': 'refs/heads/main', 'path': 'third_party/prometheus_ui/base/web/ui/node_modules/core-js-pure/features/array/virtual/find.js', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Dockerfile', 'bytes': '4035'}, {'name': 'Go', 'bytes': '574177'}, {'name': 'Makefile', 'bytes': '5189'}, {'name': 'Shell', 'bytes': '11915'}]} |
package com.chauthai.swipereveallayoutdemo;
import android.content.Context;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
import android.widget.Toast;
import com.chauthai.swipereveallayout.SwipeRevealLayout;
import com.chauthai.swipereveallayout.ViewBinderHelper;
import java.util.List;
/**
* Created by Chau Thai on 4/12/16.
*/
public class GridAdapter extends ArrayAdapter<String> {
private final LayoutInflater mInflater;
private final ViewBinderHelper binderHelper;
public GridAdapter(Context context, List<String> objects) {
super(context, R.layout.row_list, objects);
mInflater = LayoutInflater.from(context);
binderHelper = new ViewBinderHelper();
// uncomment if you want to open only one row at a time
// binderHelper.setOpenOnlyOne(true);
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder;
if (convertView == null) {
convertView = mInflater.inflate(R.layout.grid_item, parent, false);
holder = new ViewHolder();
holder.swipeLayout = (SwipeRevealLayout) convertView.findViewById(R.id.swipe_layout);
holder.frontView = convertView.findViewById(R.id.front_layout);
holder.deleteView = convertView.findViewById(R.id.delete_layout);
holder.textView = (TextView) convertView.findViewById(R.id.text);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
final String item = getItem(position);
if (item != null) {
binderHelper.bind(holder.swipeLayout, item);
holder.textView.setText(item);
holder.deleteView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
remove(item);
}
});
holder.frontView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String displayText = "" + item + " clicked";
Toast.makeText(getContext(), displayText, Toast.LENGTH_SHORT).show();
Log.d("GridAdapter", displayText);
}
});
}
return convertView;
}
/**
* Only if you need to restore open/close state when the orientation is changed.
* Call this method in {@link android.app.Activity#onSaveInstanceState(Bundle)}
*/
public void saveStates(Bundle outState) {
binderHelper.saveStates(outState);
}
/**
* Only if you need to restore open/close state when the orientation is changed.
* Call this method in {@link android.app.Activity#onRestoreInstanceState(Bundle)}
*/
public void restoreStates(Bundle inState) {
binderHelper.restoreStates(inState);
}
private class ViewHolder {
SwipeRevealLayout swipeLayout;
View frontView;
View deleteView;
TextView textView;
}
}
| {'content_hash': 'c6ddfb00ab6925b5ba86cdf0ea882fab', 'timestamp': '', 'source': 'github', 'line_count': 98, 'max_line_length': 97, 'avg_line_length': 33.357142857142854, 'alnum_prop': 0.6423982869379015, 'repo_name': 'chthai64/SwipeRevealLayout', 'id': '3a40eed88747b4ae2759084ef45fe14c430f5eaf', 'size': '3269', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'demo/src/main/java/com/chauthai/swipereveallayoutdemo/GridAdapter.java', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Java', 'bytes': '47285'}]} |
.. _pages-theory:
======
Theory
======
Introduction to Trees
~~~~~~~~~~~~~~~~~~~~~
If you're unfamiliar with trees as an abstract data type, you might want to `review the concepts involved. <http://en.wikipedia.org/wiki/Tree_(data_structure)>`_
As a web developer, though, you probably already have a good understanding of trees as filesystem directories or paths. Wagtail pages can create the same structure, as each page in the tree has its own URL path, like so::
/
people/
nien-nunb/
laura-roslin/
events/
captain-picard-day/
winter-wrap-up/
The Wagtail admin interface uses the tree to organize content for editing, letting you navigate up and down levels in the tree through its Explorer menu. This method of organization is a good place to start in thinking about your own Wagtail models.
Nodes and Leaves
----------------
It might be handy to think of the ``Page``-derived models you want to create as being one of two node types: parents and leaves. Wagtail isn't prescriptive in this approach, but it's a good place to start if you're not experienced in structuring your own content types.
Nodes
`````
Parent nodes on the Wagtail tree probably want to organize and display a browse-able index of their descendants. A blog, for instance, needs a way to show a list of individual posts.
A Parent node could provide its own function returning its descendant objects.
.. code-block:: python
class EventPageIndex(Page):
# ...
def events(self):
# Get list of live event pages that are descendants of this page
events = EventPage.objects.live().descendant_of(self)
# Filter events list to get ones that are either
# running now or start in the future
events = events.filter(date_from__gte=date.today())
# Order by date
events = events.order_by('date_from')
return events
This example makes sure to limit the returned objects to pieces of content which make sense, specifically ones which have been published through Wagtail's admin interface (``live()``) and are children of this node (``descendant_of(self)``). By setting a ``subpage_types`` class property in your model, you can specify which models are allowed to be set as children, and by setting a ``parent_page_types`` class property, you can specify which models are allowed to be parents of this page model. Wagtail will allow any ``Page``-derived model by default. Regardless, it's smart for a parent model to provide an index filtered to make sense.
Leaves
``````
Leaves are the pieces of content itself, a page which is consumable, and might just consist of a bunch of properties. A blog page leaf might have some body text and an image. A person page leaf might have a photo, a name, and an address.
It might be helpful for a leaf to provide a way to back up along the tree to a parent, such as in the case of breadcrumbs navigation. The tree might also be deep enough that a leaf's parent won't be included in general site navigation.
The model for the leaf could provide a function that traverses the tree in the opposite direction and returns an appropriate ancestor:
.. code-block:: python
class EventPage(Page):
# ...
def event_index(self):
# Find closest ancestor which is an event index
return self.get_ancestors().type(EventIndexPage).last()
If defined, ``subpage_types`` and ``parent_page_types`` will also limit the parent models allowed to contain a leaf. If not, Wagtail will allow any combination of parents and leafs to be associated in the Wagtail tree. Like with index pages, it's a good idea to make sure that the index is actually of the expected model to contain the leaf.
Other Relationships
```````````````````
Your ``Page``-derived models might have other interrelationships which extend the basic Wagtail tree or depart from it entirely. You could provide functions to navigate between siblings, such as a "Next Post" link on a blog page (``post->post->post``). It might make sense for subtrees to interrelate, such as in a discussion forum (``forum->post->replies``) Skipping across the hierarchy might make sense, too, as all objects of a certain model class might interrelate regardless of their ancestors (``events = EventPage.objects.all``). It's largely up to the models to define their interrelations, the possibilities are really endless.
.. _anatomy_of_a_wagtail_request:
Anatomy of a Wagtail Request
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
For going beyond the basics of model definition and interrelation, it might help to know how Wagtail handles requests and constructs responses. In short, it goes something like:
#. Django gets a request and routes through Wagtail's URL dispatcher definitions
#. Wagtail checks the hostname of the request to determine which ``Site`` record will handle this request.
#. Starting from the root page of that site, Wagtail traverses the page tree, calling the ``route()`` method and letting each page model decide whether it will handle the request itself or pass it on to a child page.
#. The page responsible for handling the request returns a ``RouteResult`` object from ``route()``, which identifies the page along with any additional ``args``/``kwargs`` to be passed to ``serve()``.
#. Wagtail calls ``serve()``, which constructs a context using ``get_context()``
#. ``serve()`` finds a template to pass it to using ``get_template()``
#. A response object is returned by ``serve()`` and Django responds to the requester.
You can apply custom behaviour to this process by overriding ``Page`` class methods such as ``route()`` and ``serve()`` in your own models. For examples, see :ref:`model_recipes`.
.. _scheduled_publishing:
Scheduled Publishing
~~~~~~~~~~~~~~~~~~~~
Page publishing can be scheduled through the *Go live date/time* feature in the *Settings* tab of the *Edit* page. This allows you to set set up initial page publishing or a page update in advance.
In order for pages to be published at the scheduled time you should set up the :ref:`publish_scheduled_pages` management command.
The basic workflow is as follows:
* Scheduling a revision for a page that is not currently live means that page will go live when the scheduled time comes.
* Scheduling a revision for a page that is already live means that revision will be published when the time comes.
* If page has a scheduled revision and you set another revision to publish immediately, the scheduled revision will be unscheduled.
The *Revisions* view for a given page will show which revision is scheduled and when it is scheduled for. A scheduled revision in the list will also provide an *Unschedule* button to cancel it.
| {'content_hash': 'dad7d2fbdafd9c92b9ef5c7db5dc6969', 'timestamp': '', 'source': 'github', 'line_count': 119, 'max_line_length': 639, 'avg_line_length': 57.411764705882355, 'alnum_prop': 0.7261416861826698, 'repo_name': 'mikedingjan/wagtail', 'id': 'bd6716057d10bc5ac463267ec354770a3715f767', 'size': '6832', 'binary': False, 'copies': '6', 'ref': 'refs/heads/master', 'path': 'docs/reference/pages/theory.rst', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'CSS', 'bytes': '183841'}, {'name': 'Dockerfile', 'bytes': '703'}, {'name': 'HTML', 'bytes': '373400'}, {'name': 'JavaScript', 'bytes': '266257'}, {'name': 'Makefile', 'bytes': '992'}, {'name': 'Python', 'bytes': '3607707'}, {'name': 'Shell', 'bytes': '8289'}]} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Login Page - Photon Admin Panel Theme</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
<link rel="shortcut icon" href="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/css/css_compiled/js/bootstrap/js/plugins/favicon.ico" />
<link rel="apple-touch-icon" href="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/css/css_compiled/js/bootstrap/js/plugins/iosicon.png" />
<!-- DEVELOPMENT LESS -->
<!-- <link rel="stylesheet/less" href="css/photon.less" media="all" />
<link rel="stylesheet/less" href="css/photon-responsive.less" media="all" />
--> <!-- PRODUCTION CSS -->
<link rel="stylesheet" href="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/css/css_compiled/js/bootstrap/js/plugins/css/css_compiled/photon-min.css?v1.1" media="all" />
<link rel="stylesheet" href="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/css/css_compiled/js/bootstrap/js/plugins/css/css_compiled/photon-min-part2.css?v1.1" media="all" />
<link rel="stylesheet" href="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/css/css_compiled/js/bootstrap/js/plugins/css/css_compiled/photon-responsive-min.css?v1.1" media="all" />
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="css/css_compiled/ie-only-min.css?v1.1" />
<![endif]-->
<!--[if lt IE 9]>
<link rel="stylesheet" type="text/css" href="css/css_compiled/ie8-only-min.css?v1.1" />
<script type="text/javascript" src="js/plugins/excanvas.js"></script>
<script type="text/javascript" src="js/plugins/html5shiv.js"></script>
<script type="text/javascript" src="js/plugins/respond.min.js"></script>
<script type="text/javascript" src="js/plugins/fixFontIcons.js"></script>
<![endif]-->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.0/jquery-ui.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/css/css_compiled/js/bootstrap/js/plugins/js/bootstrap/bootstrap.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/css/css_compiled/js/bootstrap/js/plugins/js/plugins/modernizr.custom.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/css/css_compiled/js/bootstrap/js/plugins/js/plugins/jquery.pnotify.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/css/css_compiled/js/bootstrap/js/plugins/js/plugins/less-1.3.1.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/css/css_compiled/js/bootstrap/js/plugins/js/plugins/xbreadcrumbs.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/css/css_compiled/js/bootstrap/js/plugins/js/plugins/jquery.maskedinput-1.3.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/css/css_compiled/js/bootstrap/js/plugins/js/plugins/jquery.autotab-1.1b.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/css/css_compiled/js/bootstrap/js/plugins/js/plugins/charCount.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/css/css_compiled/js/bootstrap/js/plugins/js/plugins/jquery.textareaCounter.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/css/css_compiled/js/bootstrap/js/plugins/js/plugins/elrte.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/css/css_compiled/js/bootstrap/js/plugins/js/plugins/elrte.en.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/css/css_compiled/js/bootstrap/js/plugins/js/plugins/select2.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/css/css_compiled/js/bootstrap/js/plugins/js/plugins/jquery-picklist.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/css/css_compiled/js/bootstrap/js/plugins/js/plugins/jquery.validate.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/css/css_compiled/js/bootstrap/js/plugins/js/plugins/additional-methods.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/css/css_compiled/js/bootstrap/js/plugins/js/plugins/jquery.form.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/css/css_compiled/js/bootstrap/js/plugins/js/plugins/jquery.metadata.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/css/css_compiled/js/bootstrap/js/plugins/js/plugins/jquery.mockjax.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/css/css_compiled/js/bootstrap/js/plugins/js/plugins/jquery.uniform.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/css/css_compiled/js/bootstrap/js/plugins/js/plugins/jquery.tagsinput.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/css/css_compiled/js/bootstrap/js/plugins/js/plugins/jquery.rating.pack.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/css/css_compiled/js/bootstrap/js/plugins/js/plugins/farbtastic.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/css/css_compiled/js/bootstrap/js/plugins/js/plugins/jquery.timeentry.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/css/css_compiled/js/bootstrap/js/plugins/js/plugins/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/css/css_compiled/js/bootstrap/js/plugins/js/plugins/jquery.jstree.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/css/css_compiled/js/bootstrap/js/plugins/js/plugins/dataTables.bootstrap.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/css/css_compiled/js/bootstrap/js/plugins/js/plugins/jquery.mousewheel.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/css/css_compiled/js/bootstrap/js/plugins/js/plugins/jquery.mCustomScrollbar.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/css/css_compiled/js/bootstrap/js/plugins/js/plugins/jquery.flot.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/css/css_compiled/js/bootstrap/js/plugins/js/plugins/jquery.flot.stack.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/css/css_compiled/js/bootstrap/js/plugins/js/plugins/jquery.flot.pie.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/css/css_compiled/js/bootstrap/js/plugins/js/plugins/jquery.flot.resize.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/css/css_compiled/js/bootstrap/js/plugins/js/plugins/raphael.2.1.0.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/css/css_compiled/js/bootstrap/js/plugins/js/plugins/justgage.1.0.1.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/css/css_compiled/js/bootstrap/js/plugins/js/plugins/jquery.qrcode.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/css/css_compiled/js/bootstrap/js/plugins/js/plugins/jquery.clock.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/css/css_compiled/js/bootstrap/js/plugins/js/plugins/jquery.countdown.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/css/css_compiled/js/bootstrap/js/plugins/js/plugins/jquery.jqtweet.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/css/css_compiled/js/bootstrap/js/plugins/js/plugins/jquery.cookie.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/css/css_compiled/js/bootstrap/js/plugins/js/plugins/bootstrap-fileupload.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/css/css_compiled/js/bootstrap/js/plugins/js/plugins/prettify/prettify.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/css/css_compiled/js/bootstrap/js/plugins/js/plugins/bootstrapSwitch.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/css/css_compiled/js/bootstrap/js/plugins/js/plugins/mfupload.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/css/css_compiled/js/bootstrap/js/plugins/js/common.js"></script>
</head>
<body class="body-login">
<div class="nav-fixed-topright" style="visibility: hidden">
<ul class="nav nav-user-menu">
<li class="user-sub-menu-container">
<a href="javascript:;">
<i class="user-icon"></i><span class="nav-user-selection">Theme Options</span><i class="icon-menu-arrow"></i>
</a>
<ul class="nav user-sub-menu">
<li class="light">
<a href="javascript:;">
<i class='icon-photon stop'></i>Light Version
</a>
</li>
<li class="dark">
<a href="javascript:;">
<i class='icon-photon stop'></i>Dark Version
</a>
</li>
</ul>
</li>
<li>
<a href="javascript:;">
<i class="icon-photon mail"></i>
</a>
</li>
<li>
<a href="javascript:;">
<i class="icon-photon comment_alt2_stroke"></i>
<div class="notification-count">12</div>
</a>
</li>
</ul>
</div>
<script>
$(function(){
setTimeout(function(){
$('.nav-fixed-topright').removeAttr('style');
}, 300);
$(window).scroll(function(){
if($('.breadcrumb-container').length){
var scrollState = $(window).scrollTop();
if (scrollState > 0) $('.nav-fixed-topright').addClass('nav-released');
else $('.nav-fixed-topright').removeClass('nav-released')
}
});
$('.user-sub-menu-container').on('click', function(){
$(this).toggleClass('active-user-menu');
});
$('.user-sub-menu .light').on('click', function(){
if ($('body').is('.light-version')) return;
$('body').addClass('light-version');
setTimeout(function() {
$.cookie('themeColor', 'light', {
expires: 7,
path: '/'
});
}, 500);
});
$('.user-sub-menu .dark').on('click', function(){
if ($('body').is('.light-version')) {
$('body').removeClass('light-version');
$.cookie('themeColor', 'dark', {
expires: 7,
path: '/'
});
}
});
});
</script>
<div class="container-login">
<div class="form-centering-wrapper">
<div class="form-window-login">
<div class="form-window-login-logo">
<div class="login-logo">
<img src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/css/css_compiled/js/bootstrap/js/plugins/images/photon/[email protected]" alt="Photon UI"/>
</div>
<h2 class="login-title">Welcome to Photon UI!</h2>
<div class="login-member">Not a Member? <a href="justgage.1.0.1.min.js.html#">Sign Up »</a>
<a href="justgage.1.0.1.min.js.html#" class="btn btn-facebook"><i class="icon-fb"></i>Login with Facebook<i class="icon-fb-arrow"></i></a>
</div>
<div class="login-or">Or</div>
<div class="login-input-area">
<form method="POST" action="dashboard.php">
<span class="help-block">Login With Your Photon Account</span>
<input type="text" name="email" placeholder="Email">
<input type="password" name="password" placeholder="Password">
<button type="submit" class="btn btn-large btn-success btn-login">Login</button>
</form>
<a href="justgage.1.0.1.min.js.html#" class="forgot-pass">Forgot Your Password?</a>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-1936460-27']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</body>
</html>
| {'content_hash': 'ad8febe201cefbe21bdd95579a1c3b45', 'timestamp': '', 'source': 'github', 'line_count': 196, 'max_line_length': 239, 'avg_line_length': 85.25, 'alnum_prop': 0.6878927524088815, 'repo_name': 'user-tony/photon-rails', 'id': 'f972fad59ec5c8a3b54d2d57b12a1366ae125232', 'size': '16709', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'lib/assets/css/css_compiled/@{photonImagePath}plugins/elrte/js/plugins/css/css_compiled/js/bootstrap/js/plugins/justgage.1.0.1.min.js.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'HTML', 'bytes': '291750913'}, {'name': 'JavaScript', 'bytes': '59305'}, {'name': 'Ruby', 'bytes': '203'}, {'name': 'Shell', 'bytes': '99'}]} |
'use strict';
const bookshelf = require('../database');
const path = require('path');
const tableName = path.basename(__filename, path.extname(__filename));
module.exports = bookshelf.Model.extend({
tableName,
idAttribute: 'id',
hasTimestamps: ['created_at', 'updated_at'],
songs() {
const Song = require('./song');
return this.belongsToMany(Song, 'song_tag');
}
});
| {'content_hash': '18e9d67dca5024cb7933af04a4622357', 'timestamp': '', 'source': 'github', 'line_count': 16, 'max_line_length': 70, 'avg_line_length': 24.25, 'alnum_prop': 0.6597938144329897, 'repo_name': 'jthoms1/cloudmix', 'id': 'f84bf54bb1f2a61f4c0708dd4e7fe028f98a6df0', 'size': '388', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'models/tag.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '1222'}, {'name': 'JavaScript', 'bytes': '910257'}, {'name': 'Shell', 'bytes': '4088'}]} |
#if NET46 // .NET Core 1.1 does not support GC.TryStartNoGCRegion, .NET Core 2.0 fails with exception on my box
using System;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Attributes.Exporters;
using System.Runtime;
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Toolchains.CsProj;
using BenchmarkDotNet.Jobs;
using BenchmarkDotNet.Environments;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using BenchmarkDotNet.Engines;
namespace StateOfTheDotNetPerformance
{
[Config(typeof(AllocationsConfig))]
[RPlotExporter] // uncomment to get nice charts!
[CsvMeasurementsExporter] // uncomment to get nice charts!
public class SmallAllocations
{
const long MaxNoGcRegion = (64 * 1024L * 1024L); // http://mattwarren.org/2016/08/16/Preventing-dotNET-Garbage-Collections-with-the-TryStartNoGCRegion-API/
[Params(8,
16,
32,
64,
128,
256,
512,
1024)]
public int SizeInBytes { get; set; }
[IterationSetup]
public void IterationSetup()
{
// the goal of this benchmark is to measure how fast allocation is, so we tell GC to rest for a while
// to have clean results, without GC side-effects
try
{
GC.TryStartNoGCRegion(MaxNoGcRegion, disallowFullBlockingGC: true);
}
catch // for some F... reason it fails for the first time, but works for the 2nd...
{
GC.TryStartNoGCRegion(MaxNoGcRegion, disallowFullBlockingGC: true);
}
}
[IterationCleanup]
public void IterationCleanup()
{
if (GCSettings.LatencyMode == GCLatencyMode.NoGCRegion)
GC.EndNoGCRegion();
}
[Benchmark(Description = "new", Baseline = true)]
public void Allocate() => DeadCodeEliminationHelper.KeepAliveWithoutBoxing(new byte[SizeInBytes]);
[Benchmark(Description = "stackalloc")]
public unsafe void AllocateWithStackalloc()
{
var array = stackalloc byte[SizeInBytes];
Blackhole(array);
}
// [Benchmark(Description = "Marshal")] it blows up the whole system!
public void AllocateWithMarshal()
{
var arrayPointer = Marshal.AllocHGlobal(SizeInBytes);
DeadCodeEliminationHelper.KeepAliveWithoutBoxing(arrayPointer);
// I am NOT freeing the memory on Purpose
// why? because otherwise every other benchmark run will get the same block of memory
// that was returned for the warmup run, and it would show that Marshall is 100x faster than new
// Marshal.FreeHGlobal(arrayPointer);
}
[MethodImpl(MethodImplOptions.NoInlining)] // no-inlining prevents from dead code elimination
private unsafe void Blackhole(byte* input) { }
}
public class AllocationsConfig : ManualConfig
{
public AllocationsConfig()
{
var gcSettings = new GcMode()
{
Force = true, // tell BenchmarkDotNet to force GC collections after every iteration
Server = true // we want to have the biggest Largest No GC Region possible
};
Jit jit = Jit.RyuJit; // we want to run for x64 only, again to have the biggest Largest No GC Region possible
Add(Job.Default
.With(CsProjNet46Toolchain.Instance)
.With(gcSettings.UnfreezeCopy())
.With(jit)
.WithId(".NET 4.6"));
// .NET Core 1.1 does not support GC.TryStartNoGCRegion method so we don't try it
// .NET Core 2.0 fails when trying to call GC.TryStartNoGCRegion
}
}
}
#endif | {'content_hash': '08cb77f1b4b4c955a8fd0fc148612900', 'timestamp': '', 'source': 'github', 'line_count': 104, 'max_line_length': 163, 'avg_line_length': 37.02884615384615, 'alnum_prop': 0.6255518047260452, 'repo_name': 'adamsitnik/StateOfTheDotNetPerformance', 'id': '3489f2f44fdcdc3689c1a3f4473f119f391f2a67', 'size': '3853', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Memory/SmallAllocations.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C#', 'bytes': '20650'}]} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../openssl_sys/constant.PKCS7_NOCRL.html">
</head>
<body>
<p>Redirecting to <a href="../../openssl_sys/constant.PKCS7_NOCRL.html">../../openssl_sys/constant.PKCS7_NOCRL.html</a>...</p>
<script>location.replace("../../openssl_sys/constant.PKCS7_NOCRL.html" + location.search + location.hash);</script>
</body>
</html> | {'content_hash': '63c61d47b99cffb7368883adf4723c36', 'timestamp': '', 'source': 'github', 'line_count': 10, 'max_line_length': 130, 'avg_line_length': 41.3, 'alnum_prop': 0.6634382566585957, 'repo_name': 'malept/guardhaus', 'id': 'e16e0dd8f246292b992930757ecc7f9420308a54', 'size': '413', 'binary': False, 'copies': '1', 'ref': 'refs/heads/gh-pages', 'path': 'main/openssl_sys/pkcs7/constant.PKCS7_NOCRL.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Rust', 'bytes': '73575'}, {'name': 'Shell', 'bytes': '1968'}]} |
package org.jetbrains.plugins.gradle.codeInsight;
import com.intellij.ProjectTopics;
import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.externalSystem.model.DataNode;
import com.intellij.openapi.externalSystem.model.project.ProjectData;
import com.intellij.openapi.externalSystem.service.project.ExternalProjectRefreshCallback;
import com.intellij.openapi.externalSystem.service.project.manage.ProjectDataManager;
import com.intellij.openapi.externalSystem.util.DisposeAwareProjectChange;
import com.intellij.openapi.externalSystem.util.ExternalSystemApiUtil;
import com.intellij.openapi.externalSystem.util.ExternalSystemConstants;
import com.intellij.openapi.externalSystem.util.ExternalSystemUtil;
import com.intellij.openapi.externalSystem.service.execution.ProgressExecutionMode;
import com.intellij.openapi.fileEditor.FileEditor;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleUtilCore;
import com.intellij.openapi.progress.ProcessCanceledException;
import com.intellij.openapi.project.IndexNotReadyException;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.roots.ModuleRootAdapter;
import com.intellij.openapi.roots.ModuleRootEvent;
import com.intellij.openapi.roots.ex.ProjectRootManagerEx;
import com.intellij.openapi.util.Key;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.LocalFileSystem;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.ui.EditorNotificationPanel;
import com.intellij.ui.EditorNotifications;
import org.gradle.util.GUtil;
import org.gradle.wrapper.WrapperConfiguration;
import org.gradle.wrapper.WrapperExecutor;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.plugins.gradle.settings.DistributionType;
import org.jetbrains.plugins.gradle.settings.GradleProjectSettings;
import org.jetbrains.plugins.gradle.settings.GradleSettings;
import org.jetbrains.plugins.gradle.util.GradleBundle;
import org.jetbrains.plugins.gradle.util.GradleConstants;
import org.jetbrains.plugins.gradle.util.GradleUtil;
import java.io.File;
import java.net.URI;
import java.util.Collections;
import java.util.Properties;
import java.util.regex.Pattern;
/**
* @author Vladislav.Soroka
* @since 9/13/13
*/
public class UseDistributionWithSourcesNotificationProvider extends EditorNotifications.Provider<EditorNotificationPanel> {
public static final Pattern GRADLE_SRC_DISTIBUTION_PATTERN;
private static final Logger LOG = Logger.getInstance("#" + UseDistributionWithSourcesNotificationProvider.class.getName());
private static final Key<EditorNotificationPanel> KEY = Key.create("gradle.notifications.use.distribution.with.sources");
private static final String ALL_ZIP_DISTRIBUTION_URI_SUFFIX = "-all.zip";
private final Project myProject;
static {
GRADLE_SRC_DISTIBUTION_PATTERN = Pattern.compile("http\\\\?://services\\.gradle\\.org.*" + ALL_ZIP_DISTRIBUTION_URI_SUFFIX);
}
public UseDistributionWithSourcesNotificationProvider(Project project, final EditorNotifications notifications) {
myProject = project;
project.getMessageBus().connect(project).subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootAdapter() {
@Override
public void rootsChanged(ModuleRootEvent event) {
notifications.updateAllNotifications();
}
});
}
@Override
public Key<EditorNotificationPanel> getKey() {
return KEY;
}
@Override
public EditorNotificationPanel createNotificationPanel(VirtualFile file, FileEditor fileEditor) {
try {
if (GradleConstants.DEFAULT_SCRIPT_NAME.equals(file.getName()) ||
GradleConstants.SETTINGS_FILE_NAME.equals(file.getName())) {
final Module module = ModuleUtilCore.findModuleForFile(file, myProject);
if (module == null) return null;
final String rootProjectPath = getRootProjectPath(module);
if (rootProjectPath == null) return null;
final GradleProjectSettings settings = GradleSettings.getInstance(module.getProject()).getLinkedProjectSettings(rootProjectPath);
if (settings == null || settings.getDistributionType() != DistributionType.DEFAULT_WRAPPED) return null;
if (settings.isDisableWrapperSourceDistributionNotification()) return null;
if (isWrapperDistributionWithSourcesUsed(rootProjectPath)) return null;
final EditorNotificationPanel panel = new EditorNotificationPanel();
panel.setText(GradleBundle.message("gradle.notifications.use.distribution.with.sources"));
panel.createActionLabel(GradleBundle.message("gradle.notifications.hide.tip"), new Runnable() {
@Override
public void run() {
settings.setDisableWrapperSourceDistributionNotification(true);
EditorNotifications.getInstance(module.getProject()).updateAllNotifications();
}
});
panel.createActionLabel(GradleBundle.message("gradle.notifications.apply.suggestion"), new Runnable() {
@Override
public void run() {
updateDefaultWrapperConfiguration(rootProjectPath);
EditorNotifications.getInstance(module.getProject()).updateAllNotifications();
final ProjectDataManager projectDataManager = ServiceManager.getService(ProjectDataManager.class);
ExternalSystemUtil.refreshProject(
module.getProject(), GradleConstants.SYSTEM_ID, settings.getExternalProjectPath(),
new ExternalProjectRefreshCallback() {
@Override
public void onSuccess(@Nullable final DataNode<ProjectData> externalProject) {
if (externalProject == null) {
return;
}
ExternalSystemApiUtil.executeProjectChangeAction(true, new DisposeAwareProjectChange(module.getProject()) {
@Override
public void execute() {
ProjectRootManagerEx.getInstanceEx(module.getProject()).mergeRootsChangesDuring(new Runnable() {
@Override
public void run() {
projectDataManager.importData(externalProject.getKey(), Collections.singleton(externalProject), module.getProject(), true);
}
});
}
});
}
@Override
public void onFailure(@NotNull String errorMessage, @Nullable String errorDetails) {
}
}, true, ProgressExecutionMode.START_IN_FOREGROUND_ASYNC);
}
});
return panel;
}
}
catch (ProcessCanceledException ignored) {
}
catch (IndexNotReadyException ignored) {
}
return null;
}
private static void updateDefaultWrapperConfiguration(@NotNull String linkedProjectPath) {
try {
final File wrapperPropertiesFile = GradleUtil.findDefaultWrapperPropertiesFile(linkedProjectPath);
if (wrapperPropertiesFile == null) return;
final WrapperConfiguration wrapperConfiguration = GradleUtil.getWrapperConfiguration(linkedProjectPath);
if (wrapperConfiguration == null) return;
String currentDistributionUri = wrapperConfiguration.getDistribution().toString();
if (StringUtil.endsWith(currentDistributionUri, ALL_ZIP_DISTRIBUTION_URI_SUFFIX)) return;
final String distributionUri =
currentDistributionUri.substring(0, currentDistributionUri.lastIndexOf('-')) + ALL_ZIP_DISTRIBUTION_URI_SUFFIX;
wrapperConfiguration.setDistribution(new URI(distributionUri));
Properties wrapperProperties = new Properties();
wrapperProperties.setProperty(WrapperExecutor.DISTRIBUTION_URL_PROPERTY, wrapperConfiguration.getDistribution().toString());
wrapperProperties.setProperty(WrapperExecutor.DISTRIBUTION_BASE_PROPERTY, wrapperConfiguration.getDistributionBase());
wrapperProperties.setProperty(WrapperExecutor.DISTRIBUTION_PATH_PROPERTY, wrapperConfiguration.getDistributionPath());
wrapperProperties.setProperty(WrapperExecutor.ZIP_STORE_BASE_PROPERTY, wrapperConfiguration.getZipBase());
wrapperProperties.setProperty(WrapperExecutor.ZIP_STORE_PATH_PROPERTY, wrapperConfiguration.getZipPath());
GUtil.saveProperties(wrapperProperties, new File(wrapperPropertiesFile.getPath()));
LocalFileSystem.getInstance().refreshIoFiles(Collections.singletonList(wrapperPropertiesFile));
}
catch (Exception e) {
LOG.error(e);
}
}
private static boolean isWrapperDistributionWithSourcesUsed(String linkedProjectPath) {
WrapperConfiguration wrapperConfiguration = GradleUtil.getWrapperConfiguration(linkedProjectPath);
// currently only wrapped distribution takes into account
if (wrapperConfiguration == null) return true;
String distributionUri = wrapperConfiguration.getDistribution().toString();
return GRADLE_SRC_DISTIBUTION_PATTERN.matcher(distributionUri).matches();
}
@Nullable
private static String getRootProjectPath(@NotNull Module module) {
String externalSystemId = module.getOptionValue(ExternalSystemConstants.EXTERNAL_SYSTEM_ID_KEY);
if (externalSystemId == null || !GradleConstants.SYSTEM_ID.toString().equals(externalSystemId)) {
return null;
}
String path = module.getOptionValue(ExternalSystemConstants.ROOT_PROJECT_PATH_KEY);
return StringUtil.isEmpty(path) ? null : path;
}
}
| {'content_hash': '3770ee375268b983686aa7023625128e', 'timestamp': '', 'source': 'github', 'line_count': 192, 'max_line_length': 149, 'avg_line_length': 49.786458333333336, 'alnum_prop': 0.7488230986504865, 'repo_name': 'IllusionRom-deprecated/android_platform_tools_idea', 'id': '592b668a6ff8098a4537812f9ded65bb96dd56d7', 'size': '10159', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'plugins/gradle/src/org/jetbrains/plugins/gradle/codeInsight/UseDistributionWithSourcesNotificationProvider.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'C', 'bytes': '177802'}, {'name': 'C#', 'bytes': '390'}, {'name': 'C++', 'bytes': '78894'}, {'name': 'CSS', 'bytes': '102018'}, {'name': 'Erlang', 'bytes': '10'}, {'name': 'Groovy', 'bytes': '1906667'}, {'name': 'J', 'bytes': '5050'}, {'name': 'Java', 'bytes': '128322265'}, {'name': 'JavaScript', 'bytes': '123045'}, {'name': 'Objective-C', 'bytes': '22558'}, {'name': 'Perl', 'bytes': '6549'}, {'name': 'Python', 'bytes': '17760420'}, {'name': 'Ruby', 'bytes': '1213'}, {'name': 'Shell', 'bytes': '76554'}, {'name': 'TeX', 'bytes': '60798'}, {'name': 'XSLT', 'bytes': '113531'}]} |
// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.theoryinpractice.testng.inspection;
import com.intellij.codeInsight.AnnotationUtil;
import com.intellij.codeInsight.ExceptionUtil;
import com.intellij.codeInspection.AbstractBaseJavaLocalInspectionTool;
import com.intellij.codeInspection.ProblemsHolder;
import com.intellij.psi.*;
import com.intellij.psi.util.InheritanceUtil;
import com.theoryinpractice.testng.TestngBundle;
import org.jetbrains.annotations.NotNull;
import java.util.List;
/**
* @author Bas Leijdekkers
*/
public class ExpectedExceptionNeverThrownTestNGInspection extends AbstractBaseJavaLocalInspectionTool {
@NotNull
@Override
public PsiElementVisitor buildVisitor(@NotNull ProblemsHolder holder, boolean isOnTheFly) {
return new ExpectedExceptionNeverThrownVisitor(holder);
}
private static class ExpectedExceptionNeverThrownVisitor extends JavaElementVisitor {
private final ProblemsHolder myProblemsHolder;
ExpectedExceptionNeverThrownVisitor(ProblemsHolder problemsHolder) {
myProblemsHolder = problemsHolder;
}
@Override
public void visitMethod(PsiMethod method) {
super.visitMethod(method);
final PsiAnnotation annotation = AnnotationUtil.findAnnotation(method, "org.testng.annotations.Test");
if (annotation == null) {
return;
}
final PsiAnnotationMemberValue value = annotation.findDeclaredAttributeValue("expectedExceptions");
if (!(value instanceof PsiClassObjectAccessExpression)) {
return;
}
final PsiCodeBlock body = method.getBody();
if (body == null) {
return;
}
final PsiClassObjectAccessExpression classObjectAccessExpression = (PsiClassObjectAccessExpression)value;
final PsiTypeElement operand = classObjectAccessExpression.getOperand();
final PsiType type = operand.getType();
if (!(type instanceof PsiClassType)) {
return;
}
final PsiClassType classType = (PsiClassType)type;
final PsiClass aClass = classType.resolve();
if (InheritanceUtil.isInheritor(aClass, CommonClassNames.JAVA_LANG_RUNTIME_EXCEPTION)) {
return;
}
final List<PsiClassType> exceptionsThrown = ExceptionUtil.getThrownExceptions(body);
for (PsiClassType psiClassType : exceptionsThrown) {
if (psiClassType.isAssignableFrom(classType)) {
return;
}
}
myProblemsHolder.registerProblem(operand, TestngBundle.message("inspection.testng.expected.exception.never.thrown.problem", method.getName()));
}
}
}
| {'content_hash': '8e44a9bb2060344992e6b43953c909a9', 'timestamp': '', 'source': 'github', 'line_count': 69, 'max_line_length': 149, 'avg_line_length': 38.72463768115942, 'alnum_prop': 0.749251497005988, 'repo_name': 'zdary/intellij-community', 'id': 'd21819b19914735e800b2e8d5a33f28d9d7f4afa', 'size': '2672', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'plugins/testng/src/com/theoryinpractice/testng/inspection/ExpectedExceptionNeverThrownTestNGInspection.java', 'mode': '33188', 'license': 'apache-2.0', 'language': []} |
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>AdminLTE 2 | Read Mail</title>
<!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<!-- Bootstrap 3.3.5 -->
<link rel="stylesheet" href="../../bootstrap/css/bootstrap.min.css">
<!-- Font Awesome -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
<!-- Ionicons -->
<link rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
<!-- fullCalendar 2.2.5-->
<link rel="stylesheet" href="../../plugins/fullcalendar/fullcalendar.min.css">
<link rel="stylesheet" href="../../plugins/fullcalendar/fullcalendar.print.css" media="print">
<!-- Theme style -->
<link rel="stylesheet" href="../../dist/css/AdminLTE.min.css">
<!-- AdminLTE Skins. Choose a skin from the css/skins
folder instead of downloading all of them to reduce the load. -->
<link rel="stylesheet" href="../../dist/css/skins/_all-skins.min.css">
<!-- iCheck -->
<link rel="stylesheet" href="../../plugins/iCheck/flat/blue.css">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body class="skin-blue sidebar-mini">
<div class="wrapper">
<header class="main-header">
<!-- Logo -->
<a href="../../index2.html" class="logo">
<!-- mini logo for sidebar mini 50x50 pixels -->
<span class="logo-mini"><b>A</b>LT</span>
<!-- logo for regular state and mobile devices -->
<span class="logo-lg"><b>Admin</b>LTE</span>
</a>
<!-- Header Navbar: style can be found in header.less -->
<nav class="navbar navbar-static-top" role="navigation">
<!-- Sidebar toggle button-->
<a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<div class="navbar-custom-menu">
<ul class="nav navbar-nav">
<!-- Messages: style can be found in dropdown.less-->
<li class="dropdown messages-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-envelope-o"></i>
<span class="label label-success">4</span>
</a>
<ul class="dropdown-menu">
<li class="header">You have 4 messages</li>
<li>
<!-- inner menu: contains the actual data -->
<ul class="menu">
<li><!-- start message -->
<a href="#">
<div class="pull-left">
<img src="../../dist/img/user2-160x160.jpg" class="img-circle" alt="User Image">
</div>
<h4>
Support Team
<small><i class="fa fa-clock-o"></i> 5 mins</small>
</h4>
<p>Why not buy a new awesome theme?</p>
</a>
</li><!-- end message -->
</ul>
</li>
<li class="footer"><a href="#">See All Messages</a></li>
</ul>
</li>
<!-- Notifications: style can be found in dropdown.less -->
<li class="dropdown notifications-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-bell-o"></i>
<span class="label label-warning">10</span>
</a>
<ul class="dropdown-menu">
<li class="header">You have 10 notifications</li>
<li>
<!-- inner menu: contains the actual data -->
<ul class="menu">
<li>
<a href="#">
<i class="fa fa-users text-aqua"></i> 5 new members joined today
</a>
</li>
</ul>
</li>
<li class="footer"><a href="#">View all</a></li>
</ul>
</li>
<!-- Tasks: style can be found in dropdown.less -->
<li class="dropdown tasks-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-flag-o"></i>
<span class="label label-danger">9</span>
</a>
<ul class="dropdown-menu">
<li class="header">You have 9 tasks</li>
<li>
<!-- inner menu: contains the actual data -->
<ul class="menu">
<li><!-- Task item -->
<a href="#">
<h3>
Design some buttons
<small class="pull-right">20%</small>
</h3>
<div class="progress xs">
<div class="progress-bar progress-bar-aqua" style="width: 20%" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100">
<span class="sr-only">20% Complete</span>
</div>
</div>
</a>
</li><!-- end task item -->
</ul>
</li>
<li class="footer">
<a href="#">View all tasks</a>
</li>
</ul>
</li>
<!-- User Account: style can be found in dropdown.less -->
<li class="dropdown user user-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<img src="../../dist/img/user2-160x160.jpg" class="user-image" alt="User Image">
<span class="hidden-xs">Alexander Pierce</span>
</a>
<ul class="dropdown-menu">
<!-- User image -->
<li class="user-header">
<img src="../../dist/img/user2-160x160.jpg" class="img-circle" alt="User Image">
<p>
Alexander Pierce - Web Developer
<small>Member since Nov. 2012</small>
</p>
</li>
<!-- Menu Body -->
<li class="user-body">
<div class="col-xs-4 text-center">
<a href="#">Followers</a>
</div>
<div class="col-xs-4 text-center">
<a href="#">Sales</a>
</div>
<div class="col-xs-4 text-center">
<a href="#">Friends</a>
</div>
</li>
<!-- Menu Footer-->
<li class="user-footer">
<div class="pull-left">
<a href="#" class="btn btn-default btn-flat">Profile</a>
</div>
<div class="pull-right">
<a href="#" class="btn btn-default btn-flat">Sign out</a>
</div>
</li>
</ul>
</li>
<!-- Control Sidebar Toggle Button -->
<li>
<a href="#" data-toggle="control-sidebar"><i class="fa fa-gears"></i></a>
</li>
</ul>
</div>
</nav>
</header>
<!-- Left side column. contains the logo and sidebar -->
<aside class="main-sidebar">
<!-- sidebar: style can be found in sidebar.less -->
<section class="sidebar">
<!-- Sidebar user panel -->
<div class="user-panel">
<div class="pull-left image">
<img src="../../dist/img/user2-160x160.jpg" class="img-circle" alt="User Image">
</div>
<div class="pull-left info">
<p>Alexander Pierce</p>
<a href="#"><i class="fa fa-circle text-success"></i> Online</a>
</div>
</div>
<!-- search form -->
<form action="#" method="get" class="sidebar-form">
<div class="input-group">
<input type="text" name="q" class="form-control" placeholder="Search...">
<span class="input-group-btn">
<button type="submit" name="search" id="search-btn" class="btn btn-flat"><i class="fa fa-search"></i></button>
</span>
</div>
</form>
<!-- /.search form -->
<!-- sidebar menu: : style can be found in sidebar.less -->
<ul class="sidebar-menu">
<li class="header">MAIN NAVIGATION</li>
<li class="treeview">
<a href="#">
<i class="fa fa-dashboard"></i> <span>Dashboard</span> <i class="fa fa-angle-left pull-right"></i>
</a>
<ul class="treeview-menu">
<li><a href="../../index.html"><i class="fa fa-circle-o"></i> Dashboard v1</a></li>
<li><a href="../../index2.html"><i class="fa fa-circle-o"></i> Dashboard v2</a></li>
</ul>
</li>
<li class="treeview">
<a href="#">
<i class="fa fa-files-o"></i>
<span>Layout Options</span>
<span class="label label-primary pull-right">4</span>
</a>
<ul class="treeview-menu">
<li><a href="../layout/top-nav.html"><i class="fa fa-circle-o"></i> Top Navigation</a></li>
<li><a href="../layout/boxed.html"><i class="fa fa-circle-o"></i> Boxed</a></li>
<li><a href="../layout/fixed.html"><i class="fa fa-circle-o"></i> Fixed</a></li>
<li><a href="../layout/collapsed-sidebar.html"><i class="fa fa-circle-o"></i> Collapsed Sidebar</a></li>
</ul>
</li>
<li>
<a href="../widgets.html">
<i class="fa fa-th"></i> <span>Widgets</span> <small class="label pull-right bg-green">new</small>
</a>
</li>
<li class="treeview">
<a href="#">
<i class="fa fa-pie-chart"></i>
<span>Charts</span>
<i class="fa fa-angle-left pull-right"></i>
</a>
<ul class="treeview-menu">
<li><a href="../charts/chartjs.html"><i class="fa fa-circle-o"></i> ChartJS</a></li>
<li><a href="../charts/morris.html"><i class="fa fa-circle-o"></i> Morris</a></li>
<li><a href="../charts/flot.html"><i class="fa fa-circle-o"></i> Flot</a></li>
<li><a href="../charts/inline.html"><i class="fa fa-circle-o"></i> Inline charts</a></li>
</ul>
</li>
<li class="treeview">
<a href="#">
<i class="fa fa-laptop"></i>
<span>UI Elements</span>
<i class="fa fa-angle-left pull-right"></i>
</a>
<ul class="treeview-menu">
<li><a href="../UI/general.html"><i class="fa fa-circle-o"></i> General</a></li>
<li><a href="../UI/icons.html"><i class="fa fa-circle-o"></i> Icons</a></li>
<li><a href="../UI/buttons.html"><i class="fa fa-circle-o"></i> Buttons</a></li>
<li><a href="../UI/sliders.html"><i class="fa fa-circle-o"></i> Sliders</a></li>
<li><a href="../UI/timeline.html"><i class="fa fa-circle-o"></i> Timeline</a></li>
<li><a href="../UI/modals.html"><i class="fa fa-circle-o"></i> Modals</a></li>
</ul>
</li>
<li class="treeview">
<a href="#">
<i class="fa fa-edit"></i> <span>Forms</span>
<i class="fa fa-angle-left pull-right"></i>
</a>
<ul class="treeview-menu">
<li><a href="../forms/general.html"><i class="fa fa-circle-o"></i> General Elements</a></li>
<li><a href="../forms/advanced.html"><i class="fa fa-circle-o"></i> Advanced Elements</a></li>
<li><a href="../forms/editors.html"><i class="fa fa-circle-o"></i> Editors</a></li>
</ul>
</li>
<li class="treeview">
<a href="#">
<i class="fa fa-table"></i> <span>Tables</span>
<i class="fa fa-angle-left pull-right"></i>
</a>
<ul class="treeview-menu">
<li><a href="../tables/simple.html"><i class="fa fa-circle-o"></i> Simple tables</a></li>
<li><a href="../tables/data.html"><i class="fa fa-circle-o"></i> Data tables</a></li>
</ul>
</li>
<li>
<a href="../calendar.html">
<i class="fa fa-calendar"></i> <span>Calendar</span>
<small class="label pull-right bg-red">3</small>
</a>
</li>
<li class="treeview active">
<a href="mailbox.html">
<i class="fa fa-envelope"></i> <span>Mailbox</span>
<i class="fa fa-angle-left pull-right"></i>
</a>
<ul class="treeview-menu">
<li><a href="mailbox.html">Inbox <span class="label label-primary pull-right">13</span></a></li>
<li><a href="compose.html">Compose</a></li>
<li class="active"><a href="read-mail.html">Read</a></li>
</ul>
</li>
<li class="treeview">
<a href="#">
<i class="fa fa-folder"></i> <span>Examples</span>
<i class="fa fa-angle-left pull-right"></i>
</a>
<ul class="treeview-menu">
<li><a href="../examples/invoice.html"><i class="fa fa-circle-o"></i> Invoice</a></li>
<li><a href="../examples/login.html"><i class="fa fa-circle-o"></i> Login</a></li>
<li><a href="../examples/register.html"><i class="fa fa-circle-o"></i> Register</a></li>
<li><a href="../examples/lockscreen.html"><i class="fa fa-circle-o"></i> Lockscreen</a></li>
<li><a href="../examples/404.html"><i class="fa fa-circle-o"></i> 404 Error</a></li>
<li><a href="../examples/500.html"><i class="fa fa-circle-o"></i> 500 Error</a></li>
<li><a href="../examples/blank.html"><i class="fa fa-circle-o"></i> Blank Page</a></li>
</ul>
</li>
<li class="treeview">
<a href="#">
<i class="fa fa-share"></i> <span>Multilevel</span>
<i class="fa fa-angle-left pull-right"></i>
</a>
<ul class="treeview-menu">
<li><a href="#"><i class="fa fa-circle-o"></i> Level One</a></li>
<li>
<a href="#"><i class="fa fa-circle-o"></i> Level One <i class="fa fa-angle-left pull-right"></i></a>
<ul class="treeview-menu">
<li><a href="#"><i class="fa fa-circle-o"></i> Level Two</a></li>
<li>
<a href="#"><i class="fa fa-circle-o"></i> Level Two <i class="fa fa-angle-left pull-right"></i></a>
<ul class="treeview-menu">
<li><a href="#"><i class="fa fa-circle-o"></i> Level Three</a></li>
<li><a href="#"><i class="fa fa-circle-o"></i> Level Three</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#"><i class="fa fa-circle-o"></i> Level One</a></li>
</ul>
</li>
<li><a href="../../documentation/index.html"><i class="fa fa-book"></i> <span>Documentation</span></a></li>
<li class="header">LABELS</li>
<li><a href="#"><i class="fa fa-circle-o text-red"></i> <span>Important</span></a></li>
<li><a href="#"><i class="fa fa-circle-o text-yellow"></i> <span>Warning</span></a></li>
<li><a href="#"><i class="fa fa-circle-o text-aqua"></i> <span>Information</span></a></li>
</ul>
</section>
<!-- /.sidebar -->
</aside>
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
Read Mail
</h1>
<ol class="breadcrumb">
<li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
<li class="active">Mailbox</li>
</ol>
</section>
<!-- Main content -->
<section class="content">
<div class="row">
<div class="col-md-3">
<a href="compose.html" class="btn btn-primary btn-block margin-bottom">Compose</a>
<div class="box box-solid">
<div class="box-header with-border">
<h3 class="box-title">Folders</h3>
<div class="box-tools">
<button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
</div>
</div>
<div class="box-body no-padding">
<ul class="nav nav-pills nav-stacked">
<li><a href="mailbox.html"><i class="fa fa-inbox"></i> Inbox <span class="label label-primary pull-right">12</span></a></li>
<li><a href="#"><i class="fa fa-envelope-o"></i> Sent</a></li>
<li><a href="#"><i class="fa fa-file-text-o"></i> Drafts</a></li>
<li><a href="#"><i class="fa fa-filter"></i> Junk <span class="label label-warning pull-right">65</span></a></li>
<li><a href="#"><i class="fa fa-trash-o"></i> Trash</a></li>
</ul>
</div><!-- /.box-body -->
</div><!-- /. box -->
<div class="box box-solid">
<div class="box-header with-border">
<h3 class="box-title">Labels</h3>
<div class="box-tools">
<button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
</div>
</div>
<div class="box-body no-padding">
<ul class="nav nav-pills nav-stacked">
<li><a href="#"><i class="fa fa-circle-o text-red"></i> Important</a></li>
<li><a href="#"><i class="fa fa-circle-o text-yellow"></i> Promotions</a></li>
<li><a href="#"><i class="fa fa-circle-o text-light-blue"></i> Social</a></li>
</ul>
</div><!-- /.box-body -->
</div><!-- /.box -->
</div><!-- /.col -->
<div class="col-md-9">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">Read Mail</h3>
<div class="box-tools pull-right">
<a href="#" class="btn btn-box-tool" data-toggle="tooltip" title="Previous"><i class="fa fa-chevron-left"></i></a>
<a href="#" class="btn btn-box-tool" data-toggle="tooltip" title="Next"><i class="fa fa-chevron-right"></i></a>
</div>
</div><!-- /.box-header -->
<div class="box-body no-padding">
<div class="mailbox-read-info">
<h3>Message Subject Is Placed Here</h3>
<h5>From: [email protected] <span class="mailbox-read-time pull-right">15 Feb. 2015 11:03 PM</span></h5>
</div><!-- /.mailbox-read-info -->
<div class="mailbox-controls with-border text-center">
<div class="btn-group">
<button class="btn btn-default btn-sm" data-toggle="tooltip" title="Delete"><i class="fa fa-trash-o"></i></button>
<button class="btn btn-default btn-sm" data-toggle="tooltip" title="Reply"><i class="fa fa-reply"></i></button>
<button class="btn btn-default btn-sm" data-toggle="tooltip" title="Forward"><i class="fa fa-share"></i></button>
</div><!-- /.btn-group -->
<button class="btn btn-default btn-sm" data-toggle="tooltip" title="Print"><i class="fa fa-print"></i></button>
</div><!-- /.mailbox-controls -->
<div class="mailbox-read-message">
<p>Hello John,</p>
<p>Keffiyeh blog actually fashion axe vegan, irony biodiesel. Cold-pressed hoodie chillwave put a bird on it aesthetic, bitters brunch meggings vegan iPhone. Dreamcatcher vegan scenester mlkshk. Ethical master cleanse Bushwick, occupy Thundercats banjo cliche ennui farm-to-table mlkshk fanny pack gluten-free. Marfa butcher vegan quinoa, bicycle rights disrupt tofu scenester chillwave 3 wolf moon asymmetrical taxidermy pour-over. Quinoa tote bag fashion axe, Godard disrupt migas church-key tofu blog locavore. Thundercats cronut polaroid Neutra tousled, meh food truck selfies narwhal American Apparel.</p>
<p>Raw denim McSweeney's bicycle rights, iPhone trust fund quinoa Neutra VHS kale chips vegan PBR&B literally Thundercats +1. Forage tilde four dollar toast, banjo health goth paleo butcher. Four dollar toast Brooklyn pour-over American Apparel sustainable, lumbersexual listicle gluten-free health goth umami hoodie. Synth Echo Park bicycle rights DIY farm-to-table, retro kogi sriracha dreamcatcher PBR&B flannel hashtag irony Wes Anderson. Lumbersexual Williamsburg Helvetica next level. Cold-pressed slow-carb pop-up normcore Thundercats Portland, cardigan literally meditation lumbersexual crucifix. Wayfarers raw denim paleo Bushwick, keytar Helvetica scenester keffiyeh 8-bit irony mumblecore whatever viral Truffaut.</p>
<p>Post-ironic shabby chic VHS, Marfa keytar flannel lomo try-hard keffiyeh cray. Actually fap fanny pack yr artisan trust fund. High Life dreamcatcher church-key gentrify. Tumblr stumptown four dollar toast vinyl, cold-pressed try-hard blog authentic keffiyeh Helvetica lo-fi tilde Intelligentsia. Lomo locavore salvia bespoke, twee fixie paleo cliche brunch Schlitz blog McSweeney's messenger bag swag slow-carb. Odd Future photo booth pork belly, you probably haven't heard of them actually tofu ennui keffiyeh lo-fi Truffaut health goth. Narwhal sustainable retro disrupt.</p>
<p>Skateboard artisan letterpress before they sold out High Life messenger bag. Bitters chambray leggings listicle, drinking vinegar chillwave synth. Fanny pack hoodie American Apparel twee. American Apparel PBR listicle, salvia aesthetic occupy sustainable Neutra kogi. Organic synth Tumblr viral plaid, shabby chic single-origin coffee Etsy 3 wolf moon slow-carb Schlitz roof party tousled squid vinyl. Readymade next level literally trust fund. Distillery master cleanse migas, Vice sriracha flannel chambray chia cronut.</p>
<p>Thanks,<br>Jane</p>
</div><!-- /.mailbox-read-message -->
</div><!-- /.box-body -->
<div class="box-footer">
<ul class="mailbox-attachments clearfix">
<li>
<span class="mailbox-attachment-icon"><i class="fa fa-file-pdf-o"></i></span>
<div class="mailbox-attachment-info">
<a href="#" class="mailbox-attachment-name"><i class="fa fa-paperclip"></i> Sep2014-report.pdf</a>
<span class="mailbox-attachment-size">
1,245 KB
<a href="#" class="btn btn-default btn-xs pull-right"><i class="fa fa-cloud-download"></i></a>
</span>
</div>
</li>
<li>
<span class="mailbox-attachment-icon"><i class="fa fa-file-word-o"></i></span>
<div class="mailbox-attachment-info">
<a href="#" class="mailbox-attachment-name"><i class="fa fa-paperclip"></i> App Description.docx</a>
<span class="mailbox-attachment-size">
1,245 KB
<a href="#" class="btn btn-default btn-xs pull-right"><i class="fa fa-cloud-download"></i></a>
</span>
</div>
</li>
<li>
<span class="mailbox-attachment-icon has-img"><img src="../../dist/img/photo1.png" alt="Attachment"></span>
<div class="mailbox-attachment-info">
<a href="#" class="mailbox-attachment-name"><i class="fa fa-camera"></i> photo1.png</a>
<span class="mailbox-attachment-size">
2.67 MB
<a href="#" class="btn btn-default btn-xs pull-right"><i class="fa fa-cloud-download"></i></a>
</span>
</div>
</li>
<li>
<span class="mailbox-attachment-icon has-img"><img src="../../dist/img/photo2.png" alt="Attachment"></span>
<div class="mailbox-attachment-info">
<a href="#" class="mailbox-attachment-name"><i class="fa fa-camera"></i> photo2.png</a>
<span class="mailbox-attachment-size">
1.9 MB
<a href="#" class="btn btn-default btn-xs pull-right"><i class="fa fa-cloud-download"></i></a>
</span>
</div>
</li>
</ul>
</div><!-- /.box-footer -->
<div class="box-footer">
<div class="pull-right">
<button class="btn btn-default"><i class="fa fa-reply"></i> Reply</button>
<button class="btn btn-default"><i class="fa fa-share"></i> Forward</button>
</div>
<button class="btn btn-default"><i class="fa fa-trash-o"></i> Delete</button>
<button class="btn btn-default"><i class="fa fa-print"></i> Print</button>
</div><!-- /.box-footer -->
</div><!-- /. box -->
</div><!-- /.col -->
</div><!-- /.row -->
</section><!-- /.content -->
</div><!-- /.content-wrapper -->
<footer class="main-footer">
<div class="pull-right hidden-xs">
<b>Version</b> 2.2.1
</div>
<strong>Copyright © 2014-2015 <a href="http://almsaeedstudio.com">Almsaeed Studio</a>.</strong> All rights reserved.
</footer>
<!-- Control Sidebar -->
<aside class="control-sidebar control-sidebar-dark">
<!-- Create the tabs -->
<ul class="nav nav-tabs nav-justified control-sidebar-tabs">
<li><a href="#control-sidebar-home-tab" data-toggle="tab"><i class="fa fa-home"></i></a></li>
<li><a href="#control-sidebar-settings-tab" data-toggle="tab"><i class="fa fa-gears"></i></a></li>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<!-- Home tab content -->
<div class="tab-pane" id="control-sidebar-home-tab">
<h3 class="control-sidebar-heading">Recent Activity</h3>
<ul class="control-sidebar-menu">
<li>
<a href="javascript::;">
<i class="menu-icon fa fa-birthday-cake bg-red"></i>
<div class="menu-info">
<h4 class="control-sidebar-subheading">Langdon's Birthday</h4>
<p>Will be 23 on April 24th</p>
</div>
</a>
</li>
<li>
<a href="javascript::;">
<i class="menu-icon fa fa-user bg-yellow"></i>
<div class="menu-info">
<h4 class="control-sidebar-subheading">Frodo Updated His Profile</h4>
<p>New phone +1(800)555-1234</p>
</div>
</a>
</li>
<li>
<a href="javascript::;">
<i class="menu-icon fa fa-envelope-o bg-light-blue"></i>
<div class="menu-info">
<h4 class="control-sidebar-subheading">Nora Joined Mailing List</h4>
<p>[email protected]</p>
</div>
</a>
</li>
<li>
<a href="javascript::;">
<i class="menu-icon fa fa-file-code-o bg-green"></i>
<div class="menu-info">
<h4 class="control-sidebar-subheading">Cron Job 254 Executed</h4>
<p>Execution time 5 seconds</p>
</div>
</a>
</li>
</ul><!-- /.control-sidebar-menu -->
<h3 class="control-sidebar-heading">Tasks Progress</h3>
<ul class="control-sidebar-menu">
<li>
<a href="javascript::;">
<h4 class="control-sidebar-subheading">
Custom Template Design
<span class="label label-danger pull-right">70%</span>
</h4>
<div class="progress progress-xxs">
<div class="progress-bar progress-bar-danger" style="width: 70%"></div>
</div>
</a>
</li>
<li>
<a href="javascript::;">
<h4 class="control-sidebar-subheading">
Update Resume
<span class="label label-success pull-right">95%</span>
</h4>
<div class="progress progress-xxs">
<div class="progress-bar progress-bar-success" style="width: 95%"></div>
</div>
</a>
</li>
<li>
<a href="javascript::;">
<h4 class="control-sidebar-subheading">
Laravel Integration
<span class="label label-warning pull-right">50%</span>
</h4>
<div class="progress progress-xxs">
<div class="progress-bar progress-bar-warning" style="width: 50%"></div>
</div>
</a>
</li>
<li>
<a href="javascript::;">
<h4 class="control-sidebar-subheading">
Back End Framework
<span class="label label-primary pull-right">68%</span>
</h4>
<div class="progress progress-xxs">
<div class="progress-bar progress-bar-primary" style="width: 68%"></div>
</div>
</a>
</li>
</ul><!-- /.control-sidebar-menu -->
</div><!-- /.tab-pane -->
<!-- Stats tab content -->
<div class="tab-pane" id="control-sidebar-stats-tab">Stats Tab Content</div><!-- /.tab-pane -->
<!-- Settings tab content -->
<div class="tab-pane" id="control-sidebar-settings-tab">
<form method="post">
<h3 class="control-sidebar-heading">General Settings</h3>
<div class="form-group">
<label class="control-sidebar-subheading">
Report panel usage
<input type="checkbox" class="pull-right" checked>
</label>
<p>
Some information about this general settings option
</p>
</div><!-- /.form-group -->
<div class="form-group">
<label class="control-sidebar-subheading">
Allow mail redirect
<input type="checkbox" class="pull-right" checked>
</label>
<p>
Other sets of options are available
</p>
</div><!-- /.form-group -->
<div class="form-group">
<label class="control-sidebar-subheading">
Expose author name in posts
<input type="checkbox" class="pull-right" checked>
</label>
<p>
Allow the user to show his name in blog posts
</p>
</div><!-- /.form-group -->
<h3 class="control-sidebar-heading">Chat Settings</h3>
<div class="form-group">
<label class="control-sidebar-subheading">
Show me as online
<input type="checkbox" class="pull-right" checked>
</label>
</div><!-- /.form-group -->
<div class="form-group">
<label class="control-sidebar-subheading">
Turn off notifications
<input type="checkbox" class="pull-right">
</label>
</div><!-- /.form-group -->
<div class="form-group">
<label class="control-sidebar-subheading">
Delete chat history
<a href="javascript::;" class="text-red pull-right"><i class="fa fa-trash-o"></i></a>
</label>
</div><!-- /.form-group -->
</form>
</div><!-- /.tab-pane -->
</div>
</aside><!-- /.control-sidebar -->
<!-- Add the sidebar's background. This div must be placed
immediately after the control sidebar -->
<div class="control-sidebar-bg"></div>
</div><!-- ./wrapper -->
<!-- jQuery 2.1.4 -->
<script src="../../plugins/jQuery/jQuery-2.1.4.min.js"></script>
<!-- Bootstrap 3.3.5 -->
<script src="../../bootstrap/js/bootstrap.min.js"></script>
<!-- Slimscroll -->
<script src="../../plugins/slimScroll/jquery.slimscroll.min.js"></script>
<!-- FastClick -->
<script src="../../plugins/fastclick/fastclick.min.js"></script>
<!-- AdminLTE App -->
<script src="../../dist/js/app.min.js"></script>
<!-- AdminLTE for demo purposes -->
<script src="../../dist/js/demo.js"></script>
</body>
</html>
| {'content_hash': '5213899e416f456d1ffe3a4b71a9309a', 'timestamp': '', 'source': 'github', 'line_count': 672, 'max_line_length': 756, 'avg_line_length': 52.830357142857146, 'alnum_prop': 0.4734381161624697, 'repo_name': 'prasad-1210/AdminLTE', 'id': 'f43889b87746c51032e6ac772a2da633e64d9c22', 'size': '35502', 'binary': False, 'copies': '4', 'ref': 'refs/heads/master', 'path': 'pages/mailbox/read-mail.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '599418'}, {'name': 'HTML', 'bytes': '3138024'}, {'name': 'JavaScript', 'bytes': '2871658'}, {'name': 'PHP', 'bytes': '1684'}]} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>User agent detail - Mozilla/5.0 (Linux; Android 4.0.4; PMID70DC Build/IMM76D) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.123 Mobile Safari/537.22 OPR/14.0.1025.52315</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">
<link href="../circle.css" rel="stylesheet">
</head>
<body>
<div class="container">
<div class="section">
<h1 class="header center orange-text">User agent detail</h1>
<div class="row center">
<h5 class="header light">
Mozilla/5.0 (Linux; Android 4.0.4; PMID70DC Build/IMM76D) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.123 Mobile Safari/537.22 OPR/14.0.1025.52315
</h5>
</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 colspan="2"></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>Parse time</th><th>Actions</th></tr><tr><th colspan="14" class="green lighten-3">Test suite</th></tr><tr><td>UAParser<br /><small>v0.5.0.2</small><br /><small>vendor/thadafinser/uap-core/tests/test_device.yaml</small></td><td> </td><td><i class="material-icons">close</i></td><td> </td><td style="border-left: 1px solid #555">Polaroid</td><td>PMID70DC</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 style="border-left: 1px solid #555"></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-cfed3005-df48-4fa8-bf03-4f6ef8988f59">Detail</a>
<!-- Modal Structure -->
<div id="modal-cfed3005-df48-4fa8-bf03-4f6ef8988f59" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>UAParser result detail</h4>
<p><pre><code class="php">Array
(
[user_agent_string] => Mozilla/5.0 (Linux; Android 4.0.4; PMID70DC Build/IMM76D) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.123 Mobile Safari/537.22 OPR/14.0.1025.52315
[family] => PMID70DC
[brand] => Polaroid
[model] => PMID70DC
)
</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><th colspan="14" class="green lighten-3">Providers</th></tr><tr><td>BrowscapFull<br /><small>6014</small><br /></td><td>Opera Mobile 14.0</td><td>Blink </td><td>Android 4.0</td><td style="border-left: 1px solid #555"></td><td></td><td>Mobile Phone</td><td>yes</td><td>yes</td><td style="border-left: 1px solid #555"></td><td></td><td></td><td>0.13201</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-47a9cd06-e213-4882-bc34-db6aed664223">Detail</a>
<!-- Modal Structure -->
<div id="modal-47a9cd06-e213-4882-bc34-db6aed664223" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>BrowscapFull result detail</h4>
<p><pre><code class="php">stdClass Object
(
[browser_name_regex] => /^mozilla\/5\.0 \(.*linux.*android.4\.0.*\) applewebkit\/.* \(khtml.* like gecko\).*chrome\/.*safari\/.* opr\/14\..*$/
[browser_name_pattern] => mozilla/5.0 (*linux*android?4.0*) applewebkit/* (khtml* like gecko)*chrome/*safari/* opr/14.*
[parent] => Opera Mobile 14.0 for Android
[comment] => Opera Mobile 14.0 for Android
[browser] => Opera Mobile
[browser_type] => Browser
[browser_bits] => 32
[browser_maker] => Opera Software ASA
[browser_modus] => unknown
[version] => 14.0
[majorver] => 14
[minorver] => 0
[platform] => Android
[platform_version] => 4.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] =>
[isfake] =>
[isanonymized] =>
[ismodified] =>
[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>BrowscapLite<br /><small>6014</small><br /></td><td>Chrome </td><td><i class="material-icons">close</i></td><td>Android </td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>Mobile Phone</td><td>yes</td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0.012</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-42bb56ba-b834-47c5-bea0-c0270e9ab371">Detail</a>
<!-- Modal Structure -->
<div id="modal-42bb56ba-b834-47c5-bea0-c0270e9ab371" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>BrowscapLite result detail</h4>
<p><pre><code class="php">stdClass Object
(
[browser_name_regex] => /^mozilla\/5\.0 \(.*linux.*android.*\) applewebkit\/.* \(khtml.* like gecko\) chrome\/.*safari\/.*$/
[browser_name_pattern] => mozilla/5.0 (*linux*android*) applewebkit/* (khtml* like gecko) chrome/*safari/*
[parent] => Chrome Generic for Android
[comment] => Chrome Generic
[browser] => Chrome
[browser_type] => unknown
[browser_bits] => 0
[browser_maker] => unknown
[browser_modus] => unknown
[version] => 0.0
[majorver] => 0
[minorver] => 0
[platform] => Android
[platform_version] => unknown
[platform_description] => unknown
[platform_bits] => 0
[platform_maker] => unknown
[alpha] => false
[beta] => false
[win16] => false
[win32] => false
[win64] => false
[frames] => false
[iframes] => false
[tables] => false
[cookies] => false
[backgroundsounds] => false
[javascript] => false
[vbscript] => false
[javaapplets] => false
[activexcontrols] => false
[ismobiledevice] => 1
[istablet] =>
[issyndicationreader] => false
[crawler] => false
[isfake] => false
[isanonymized] => false
[ismodified] => false
[cssversion] => 0
[aolversion] => 0
[device_name] => unknown
[device_maker] => unknown
[device_type] => Mobile Phone
[device_pointing_method] => unknown
[device_code_name] => unknown
[device_brand_name] => unknown
[renderingengine_name] => unknown
[renderingengine_version] => unknown
[renderingengine_description] => unknown
[renderingengine_maker] => unknown
)
</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>BrowscapPhp<br /><small>6014</small><br /></td><td>Opera Mobile 14.0</td><td><i class="material-icons">close</i></td><td>Android </td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>Mobile Phone</td><td>yes</td><td>yes</td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.053</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-ad0041a2-b0f4-43f6-a70d-cad1443caa68">Detail</a>
<!-- Modal Structure -->
<div id="modal-ad0041a2-b0f4-43f6-a70d-cad1443caa68" 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.*\) applewebkit\/.* \(khtml.* like gecko\).*chrome\/.*safari\/.* opr\/14\..*$/
[browser_name_pattern] => mozilla/5.0 (*linux*android*) applewebkit/* (khtml* like gecko)*chrome/*safari/* opr/14.*
[parent] => Opera Mobile 14.0 for Android
[comment] => Opera Mobile 14.0 for Android
[browser] => Opera Mobile
[browser_type] => unknown
[browser_bits] => 0
[browser_maker] => Opera Software ASA
[browser_modus] => unknown
[version] => 14.0
[majorver] => 14
[minorver] => 0
[platform] => Android
[platform_version] => unknown
[platform_description] => unknown
[platform_bits] => 0
[platform_maker] => unknown
[alpha] => false
[beta] => false
[win16] => false
[win32] => false
[win64] => false
[frames] => false
[iframes] => false
[tables] => false
[cookies] => false
[backgroundsounds] => false
[javascript] => false
[vbscript] => false
[javaapplets] => false
[activexcontrols] => false
[ismobiledevice] => 1
[istablet] =>
[issyndicationreader] => false
[crawler] =>
[isfake] => false
[isanonymized] => false
[ismodified] => false
[cssversion] => 0
[aolversion] => 0
[device_name] => unknown
[device_maker] => unknown
[device_type] => Mobile Phone
[device_pointing_method] => touchscreen
[device_code_name] => unknown
[device_brand_name] => unknown
[renderingengine_name] => unknown
[renderingengine_version] => unknown
[renderingengine_description] => unknown
[renderingengine_maker] => unknown
)
</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.1</small><br /></td><td>Opera Next 14.0.1025.52315</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><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 style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-15fbc1f0-2615-4d42-b5d9-a30dd647b050">Detail</a>
<!-- Modal Structure -->
<div id="modal-15fbc1f0-2615-4d42-b5d9-a30dd647b050" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>DonatjUAParser result detail</h4>
<p><pre><code class="php">Array
(
[platform] => Android
[browser] => Opera Next
[version] => 14.0.1025.52315
)
</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>JenssegersAgent<br /><small>v2.3.3</small><br /></td><td>Opera 14.0.1025.52315</td><td><i class="material-icons">close</i></td><td>AndroidOS 4.0.4</td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>yes</td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.002</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-b85a2b91-6a55-4436-a82c-1ea0d46e2e51">Detail</a>
<!-- Modal Structure -->
<div id="modal-b85a2b91-6a55-4436-a82c-1ea0d46e2e51" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>JenssegersAgent result detail</h4>
<p><pre><code class="php">Array
(
[browserName] => Opera
[browserVersion] => 14.0.1025.52315
[osName] => AndroidOS
[osVersion] => 4.0.4
[deviceModel] => WebKit
[isMobile] => 1
[isRobot] =>
[botName] =>
)
</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>NeutrinoApiCom<br /><small></small><br /></td><td>Opera Mobile 14.0.1025.52315</td><td><i class="material-icons">close</i></td><td>Android 4.0.4</td><td style="border-left: 1px solid #555"></td><td>PMID70DC</td><td>mobile-browser</td><td>yes</td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.29902</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-8c2a7a4e-3fbf-4df2-8d61-5e730422f67b">Detail</a>
<!-- Modal Structure -->
<div id="modal-8c2a7a4e-3fbf-4df2-8d61-5e730422f67b" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>NeutrinoApiCom result detail</h4>
<p><pre><code class="php">stdClass Object
(
[mobile_screen_height] => 480
[is_mobile] => 1
[type] => mobile-browser
[mobile_brand] => Generic
[mobile_model] => PMID70DC
[version] => 14.0.1025.52315
[is_android] => 1
[browser_name] => Opera Mobile
[operating_system_family] => Android
[operating_system_version] => 4.0.4
[is_ios] =>
[producer] => Opera Software ASA.
[operating_system] => Android 4.0.x Ice Cream Sandwich
[mobile_screen_width] => 320
[mobile_browser] => Android Webkit
)
</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.6.1</small><br /></td><td>Opera Mobile 14.0</td><td>Presto </td><td>Android 4.0</td><td style="border-left: 1px solid #555">Polaroid</td><td>PMID70DC</td><td>tablet</td><td>yes</td><td></td><td style="border-left: 1px solid #555"></td><td></td><td></td><td>0.003</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-4a941d34-a8d3-4914-9724-346f60ad7046">Detail</a>
<!-- Modal Structure -->
<div id="modal-4a941d34-a8d3-4914-9724-346f60ad7046" 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] => Opera Mobile
[short_name] => OM
[version] => 14.0
[engine] => Presto
)
[operatingSystem] => Array
(
[name] => Android
[short_name] => AND
[version] => 4.0
[platform] =>
)
[device] => Array
(
[brand] => PL
[brandName] => Polaroid
[model] => PMID70DC
[device] => 2
[deviceName] => tablet
)
[bot] =>
[extra] => Array
(
[isBot] =>
[isBrowser] => 1
[isFeedReader] =>
[isMobileApp] =>
[isPIM] =>
[isLibrary] =>
[isMediaPlayer] =>
[isCamera] =>
[isCarBrowser] =>
[isConsole] =>
[isFeaturePhone] =>
[isPhablet] =>
[isPortableMediaPlayer] =>
[isSmartDisplay] =>
[isSmartphone] =>
[isTablet] => 1
[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.1</small><br /></td><td>Opera 14.0.1025.52315</td><td><i class="material-icons">close</i></td><td>Android 4.0.4</td><td style="border-left: 1px solid #555"><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 style="border-left: 1px solid #555"></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0.001</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-ec1cd248-02b0-457e-8a9d-35bb99af008c">Detail</a>
<!-- Modal Structure -->
<div id="modal-ec1cd248-02b0-457e-8a9d-35bb99af008c" 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] => Mozilla/5.0 (Linux; Android 4.0.4; PMID70DC Build/IMM76D) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.123 Mobile Safari/537.22 OPR/14.0.1025.52315
)
[name:Sinergi\BrowserDetector\Browser:private] => Opera
[version:Sinergi\BrowserDetector\Browser:private] => 14.0.1025.52315
[isRobot:Sinergi\BrowserDetector\Browser:private] =>
[isChromeFrame:Sinergi\BrowserDetector\Browser:private] =>
[isFacebookWebView:Sinergi\BrowserDetector\Browser:private] =>
[isCompatibilityMode:Sinergi\BrowserDetector\Browser:private] =>
)
[operatingSystem] => Sinergi\BrowserDetector\Os Object
(
[name:Sinergi\BrowserDetector\Os:private] => Android
[version:Sinergi\BrowserDetector\Os:private] => 4.0.4
[isMobile:Sinergi\BrowserDetector\Os:private] => 1
[userAgent:Sinergi\BrowserDetector\Os:private] => Sinergi\BrowserDetector\UserAgent Object
(
[userAgentString:Sinergi\BrowserDetector\UserAgent:private] => Mozilla/5.0 (Linux; Android 4.0.4; PMID70DC Build/IMM76D) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.123 Mobile Safari/537.22 OPR/14.0.1025.52315
)
)
[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] => Mozilla/5.0 (Linux; Android 4.0.4; PMID70DC Build/IMM76D) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.123 Mobile Safari/537.22 OPR/14.0.1025.52315
)
)
)
</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><br /></td><td>Opera Mobile 14.0.1025</td><td><i class="material-icons">close</i></td><td>Android 4.0.4</td><td style="border-left: 1px solid #555">Polaroid</td><td>PMID70DC</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 style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-3160e405-8a8f-46dd-8f47-5115f06462d2">Detail</a>
<!-- Modal Structure -->
<div id="modal-3160e405-8a8f-46dd-8f47-5115f06462d2" 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] => 14
[minor] => 0
[patch] => 1025
[family] => Opera Mobile
)
[os] => UAParser\Result\OperatingSystem Object
(
[major] => 4
[minor] => 0
[patch] => 4
[patchMinor] =>
[family] => Android
)
[device] => UAParser\Result\Device Object
(
[brand] => Polaroid
[model] => PMID70DC
[family] => PMID70DC
)
[originalUserAgent] => Mozilla/5.0 (Linux; Android 4.0.4; PMID70DC Build/IMM76D) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.123 Mobile Safari/537.22 OPR/14.0.1025.52315
)
</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>UserAgentApiCom<br /><small></small><br /></td><td>Opera 14.0.1025.52315</td><td>WebKit 537.22</td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>Mobile</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.16801</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-afeb05fb-26b9-4509-b8ac-0c604a9e97d6">Detail</a>
<!-- Modal Structure -->
<div id="modal-afeb05fb-26b9-4509-b8ac-0c604a9e97d6" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>UserAgentApiCom result detail</h4>
<p><pre><code class="php">stdClass Object
(
[platform_name] => Android
[platform_version] => 4.0.4
[platform_type] => Mobile
[browser_name] => Opera
[browser_version] => 14.0.1025.52315
[engine_name] => WebKit
[engine_version] => 537.22
)
</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>UserAgentStringCom<br /><small></small><br /></td><td>Android Webkit Browser </td><td><i class="material-icons">close</i></td><td>Android 4.0.4</td><td style="border-left: 1px solid #555"><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 style="border-left: 1px solid #555"></td><td></td><td></td><td>0.077</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-08a9ddfb-838f-48d7-9ede-1d132306b2ee">Detail</a>
<!-- Modal Structure -->
<div id="modal-08a9ddfb-838f-48d7-9ede-1d132306b2ee" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>UserAgentStringCom result detail</h4>
<p><pre><code class="php">stdClass Object
(
[agent_type] => Browser
[agent_name] => Android Webkit Browser
[agent_version] => --
[os_type] => Android
[os_name] => Android
[os_versionName] =>
[os_versionNumber] => 4.0.4
[os_producer] =>
[os_producerURL] =>
[linux_distibution] => Null
[agent_language] =>
[agent_languageTag] =>
)
</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>WhatIsMyBrowserCom<br /><small></small><br /></td><td>Opera 14.0.1025.52315</td><td>WebKit 537.22</td><td>Android 4.0.4</td><td style="border-left: 1px solid #555"></td><td></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 style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0.24801</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-5fc1ff22-a74d-481b-9ad1-fcfde73ded9c">Detail</a>
<!-- Modal Structure -->
<div id="modal-5fc1ff22-a74d-481b-9ad1-fcfde73ded9c" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>WhatIsMyBrowserCom result detail</h4>
<p><pre><code class="php">stdClass Object
(
[operating_system_name] => Android
[simple_sub_description_string] =>
[simple_browser_string] => Opera 14 on Android (Ice Cream Sandwich)
[browser_version] => 14
[extra_info] => Array
(
)
[operating_platform] =>
[extra_info_table] => stdClass Object
(
[System Build] => IMM76D
)
[layout_engine_name] => WebKit
[detected_addons] => Array
(
)
[operating_system_flavour_code] =>
[hardware_architecture] =>
[operating_system_flavour] =>
[operating_system_frameworks] => Array
(
)
[browser_name_code] => opera
[operating_system_version] => Ice Cream Sandwich
[simple_operating_platform_string] =>
[is_abusive] =>
[layout_engine_version] => 537.22
[browser_capabilities] => Array
(
)
[operating_platform_vendor_name] =>
[operating_system] => Android (Ice Cream Sandwich)
[operating_system_version_full] => 4.0.4
[operating_platform_code] =>
[browser_name] => Opera
[operating_system_name_code] => android
[user_agent] => Mozilla/5.0 (Linux; Android 4.0.4; PMID70DC Build/IMM76D) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.123 Mobile Safari/537.22 OPR/14.0.1025.52315
[browser_version_full] => 14.0.1025.52315
[browser] => Opera 14
)
</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>v2.0.18</small><br /></td><td>Opera 14.0</td><td>Webkit 537.22</td><td>Android 4.0.4</td><td style="border-left: 1px solid #555">Polaroid</td><td>PMID 70dc</td><td>tablet</td><td>yes</td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.002</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-083a336f-5d73-4505-84f3-c5fc9bb78652">Detail</a>
<!-- Modal Structure -->
<div id="modal-083a336f-5d73-4505-84f3-c5fc9bb78652" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>WhichBrowser result detail</h4>
<p><pre><code class="php">Array
(
[browser] => Array
(
[name] => Opera
[family] => Array
(
[name] => Chrome
[version] => 25
)
[version] => 14.0
[type] => browser
)
[engine] => Array
(
[name] => Webkit
[version] => 537.22
)
[os] => Array
(
[name] => Android
[version] => 4.0.4
)
[device] => Array
(
[type] => tablet
[manufacturer] => Polaroid
[model] => PMID 70dc
)
)
</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><br /></td><td>Opera 14.0.1025.52315</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><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 style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-f00e7198-0e22-49fe-bad0-dbb3a9cde9b9">Detail</a>
<!-- Modal Structure -->
<div id="modal-f00e7198-0e22-49fe-bad0-dbb3a9cde9b9" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>Woothee result detail</h4>
<p><pre><code class="php">Array
(
[name] => Opera
[vendor] => Opera
[version] => 14.0.1025.52315
[category] => smartphone
[os] => Android
[os_version] => 4.0.4
)
</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.7.1.0</small><br /></td><td>Opera 14.0.1025.52315</td><td><i class="material-icons">close</i></td><td>Android 4.0.4</td><td style="border-left: 1px solid #555"></td><td></td><td>Smartphone</td><td>yes</td><td>yes</td><td style="border-left: 1px solid #555"></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0.017</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-a2bedf8c-4a95-42a7-96c5-aaf233b2ac50">Detail</a>
<!-- Modal Structure -->
<div id="modal-a2bedf8c-4a95-42a7-96c5-aaf233b2ac50" 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] => false
[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] => 4.0.4
[advertised_browser] => Opera
[advertised_browser_version] => 14.0.1025.52315
[complete_device_name] => Generic Android 4.0
[device_name] => Generic Android 4.0
[form_factor] => Smartphone
[is_phone] => true
[is_app_webview] => false
)
[all] => Array
(
[brand_name] => Generic
[model_name] => Android 4.0
[unique] => true
[ununiqueness_handler] =>
[is_wireless_device] => true
[device_claims_web_support] => true
[has_qwerty_keyboard] => true
[can_skip_aligned_link_row] => true
[uaprof] =>
[uaprof2] =>
[uaprof3] =>
[nokia_series] => 0
[nokia_edition] => 0
[device_os] => Android
[mobile_browser] => Android Webkit
[mobile_browser_version] =>
[device_os_version] => 4.0
[pointing_method] => touchscreen
[release_date] => 2011_october
[marketing_name] =>
[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] => 320
[resolution_height] => 480
[columns] => 60
[max_image_width] => 320
[max_image_height] => 480
[rows] => 40
[physical_screen_width] => 34
[physical_screen_height] => 50
[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] => false
[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] => rtsp
[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] => true
[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
)
)
</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>Zsxsoft<br /><small>1.3</small><br /></td><td>Opera 14.0.1025.52315</td><td><i class="material-icons">close</i></td><td>Android 4.0.4</td><td style="border-left: 1px solid #555"></td><td></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 style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-5d43e024-b46c-44f6-8914-529b05569bc2">Detail</a>
<!-- Modal Structure -->
<div id="modal-5d43e024-b46c-44f6-8914-529b05569bc2" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>Zsxsoft result detail</h4>
<p><pre><code class="php">Array
(
[browser] => Array
(
[link] => http://www.opera.com/
[title] => Opera 14.0.1025.52315
[name] => Opera
[version] => 14.0.1025.52315
[code] => opera-1
[image] => img/16/browser/opera-1.png
)
[os] => Array
(
[link] => http://www.android.com/
[name] => Android
[version] => 4.0.4
[code] => android
[x64] =>
[title] => Android 4.0.4
[type] => os
[dir] => os
[image] => img/16/os/android.png
)
[device] => Array
(
[link] =>
[title] =>
[model] =>
[brand] =>
[code] => null
[dir] => device
[type] => device
[image] => img/16/device/null.png
)
[platform] => Array
(
[link] => http://www.android.com/
[name] => Android
[version] => 4.0.4
[code] => android
[x64] =>
[title] => Android 4.0.4
[type] => os
[dir] => os
[image] => img/16/os/android.png
)
)
</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-05-10 08:02:04</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.2.0/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': 'ff4fc46a3e0cb11d67d50e00bd372a38', 'timestamp': '', 'source': 'github', 'line_count': 1378, 'max_line_length': 964, 'avg_line_length': 41.17053701015965, 'alnum_prop': 0.547071369397, 'repo_name': 'ThaDafinser/UserAgentParserComparison', 'id': '62fec63493ac0bd90d540a61a439aad8304fc78f', 'size': '56734', 'binary': False, 'copies': '1', 'ref': 'refs/heads/gh-pages', 'path': 'v5/user-agent-detail/89/90/89900c35-9f3e-43b5-b552-211ca3d18226.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'HTML', 'bytes': '2060859160'}]} |
from django import template
from django.template.defaultfilters import stringfilter
from django.utils.html import format_html, mark_safe
from django.forms import DateField, DateTimeField, ModelChoiceField, ModelMultipleChoiceField
from django.db import models
import json
register = template.Library()
@register.filter(name="getattr")
def template_getattr(obj, attr_name):
return getattr(obj, attr_name)
@register.filter(name="getitem")
def template_getitem(obj, item_name):
return obj[item_name]
@register.filter(name="title_space")
@stringfilter
def title_space(string):
return string.replace("_", " ").title()
@register.filter(name="get_django_field")
def template_get_django_field(obj, field):
val = getattr(obj, field)
if field in obj.get_many_to_many_fields():
return val.all()
return val
@register.simple_tag(name="angular_model")
def angular_model(model, angular_model_name, extra_params={}):
""" Returns javascript that preprocesses obj before attaching it to window
where angular controller can grab it """
ret = "<script>\n"
if model is None:
ret += "window.%s = {};\n" % (angular_model_name)
else:
# cast foreign key and m2m fields to be strings
json_ret = model.to_json()
model_dict = json.loads(json_ret)
fk_fields = model.get_foreign_key_fields()
m2m_fields = model.get_many_to_many_fields()
for field, val in model_dict["fields"].items():
if field in fk_fields:
model_dict["fields"][field] = str(val)
if field in m2m_fields:
model_dict["fields"][field] = map(str, val)
ret += "window.%s = %s;\n" % (angular_model_name, json.dumps(model_dict, sort_keys=True))
# adds converter for datetime fields
for field in model.READABLE_ATTRS(type_filter=models.DateField):
# DateTimeFields are instances of DateFields
ret += ("window.%s.fields.%s = new Date(window.%s.fields.%s);\n" %
(angular_model_name, field, angular_model_name, field))
# date_fields = model.WRITEABLE_ATTRS(type_filter=models.DateField, type_exclude=models.DateTimeField)
# date_fields = json.dumps(date_fields)
# ret += "window.%s.date_fields = %s" % (angular_model_name, date_fields)
ret += "</script>\n"
return mark_safe(ret)
@register.simple_tag(name="angular_input_field")
def angular_input_field(form_field, angular_model_name, extra_params={}):
try:
form_field_value = form_field.value
form_field.value = lambda: None
attrs = {"ng-model": "%s.fields.%s" % (angular_model_name, form_field.name),
"class": "form-control"}
if form_field.field.required:
attrs["required"] = "true"
# if isinstance(form_field.field, DateTimeField):
# separator = extra_params.pop("silica_datetime_separator", "")
# widget1 = _get_datepicker(form_field, attrs, extra_params)
# attrs["type"] = "time"
# attrs.update(extra_params)
# widget2 = form_field.as_widget(attrs=attrs)
# return format_html(widget1 + separator + widget2)
# if isinstance(form_field.field, DateField):
# return format_html(_get_datepicker(form_field, attrs, extra_params))
# if isinstance(form_field.field, ModelChoiceField):
# pass
# #return format_html(_get_datepicker(form_field, attrs, extra_params))
# if isinstance(form_field.field, ModelMultipleChoiceField):
# pass
# #return format_html(_get_datepicker(form_field, attrs, extra_params))
attrs.update(extra_params)
return format_html(form_field.as_widget(attrs=attrs))
finally:
form_field.value = form_field_value
def _get_datepicker(form_field, attrs, extra_params):
attrs = dict(attrs)
calendar_button = extra_params.pop("silica_calendar_button", True)
# This enables the in-browser datepicker on chrome but nowhere else
# attrs["type"] = "date"
attrs["placeholder"] = "yyyy-mm-dd"
attrs["uib-datepicker-popup"] = ""
attrs["datepicker-options"] = "dateOptions"
attrs["is-open"] = "_calendar_widgets[%s]" % id(form_field)
attrs["ng-click"] = "_calendar_widgets[%s]=true" % id(form_field)
# attrs["class"] += " datepicker"
attrs.update(extra_params)
ret = form_field.as_widget(attrs=attrs)
if calendar_button:
ret = """<div class="input-group">""" + ret
ret += """<span class="input-group-btn"><button type="button" class="btn btn-default" ng-click="_calendar_widgets[%s]=true">
<i class="glyphicon glyphicon-calendar"></i></button></span>""" % id(form_field)
ret += "</div>"
return ret
| {'content_hash': '8c3a52ddb8457077a48806f2978ae244', 'timestamp': '', 'source': 'github', 'line_count': 110, 'max_line_length': 132, 'avg_line_length': 43.64545454545455, 'alnum_prop': 0.6369506352843157, 'repo_name': 'zagaran/silica', 'id': '8dc682ebd0b7de650b09762d3566172962feb1fb', 'size': '4801', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'silica/django_app/templatetags/silica.py', 'mode': '33261', 'license': 'mit', 'language': [{'name': 'HTML', 'bytes': '1888'}, {'name': 'Python', 'bytes': '20259'}]} |
package nl.knaw.huygens.timbuctoo.search.description;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import nl.knaw.huygens.timbuctoo.model.Change;
import nl.knaw.huygens.timbuctoo.model.Datable;
import nl.knaw.huygens.timbuctoo.model.Gender;
import nl.knaw.huygens.timbuctoo.model.LocationNames;
import nl.knaw.huygens.timbuctoo.model.PersonNames;
import nl.knaw.huygens.timbuctoo.model.TempName;
import nl.knaw.huygens.timbuctoo.search.SearchDescription;
import nl.knaw.huygens.timbuctoo.search.description.facet.FacetDescriptionFactory;
import nl.knaw.huygens.timbuctoo.search.description.fulltext.FullTextSearchDescription;
import nl.knaw.huygens.timbuctoo.search.description.property.PropertyDescriptorFactory;
import nl.knaw.huygens.timbuctoo.search.description.sort.SortDescription;
import nl.knaw.huygens.timbuctoo.search.description.sort.SortFieldDescription;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import static nl.knaw.huygens.timbuctoo.search.description.Property.localProperty;
import static nl.knaw.huygens.timbuctoo.search.description.fulltext.FullTextSearchDescription.createLocalFullTextSearchDescriptionWithBackupProperty;
import static nl.knaw.huygens.timbuctoo.search.description.fulltext.FullTextSearchDescription.createLocalSimpleFullTextSearchDescription;
import static nl.knaw.huygens.timbuctoo.search.description.sort.BuildableSortFieldDescription.newSortFieldDescription;
public class WwPersonSearchDescription extends AbstractSearchDescription {
private final List<String> sortableFields;
private final List<String> fullTextSearchFields;
private final PropertyDescriptor displayNameDescriptor;
private final PropertyDescriptor idDescriptor;
private final List<FacetDescription> facetDescriptions;
private final Map<String, PropertyDescriptor> dataPropertyDescriptors;
private final List<FullTextSearchDescription> fullTextSearchDescriptions;
private List<SortFieldDescription> sortFieldDescriptions;
public WwPersonSearchDescription(PropertyDescriptorFactory propertyDescriptorFactory,
FacetDescriptionFactory facetDescriptionFactory) {
sortableFields = Lists.newArrayList(
"dynamic_k_modified",
"dynamic_k_birthDate",
"dynamic_sort_name",
"dynamic_k_deathDate");
fullTextSearchFields = Lists.newArrayList(
"dynamic_t_tempspouse",
"dynamic_t_notes",
"dynamic_t_name");
displayNameDescriptor = propertyDescriptorFactory.getComposite(
propertyDescriptorFactory.getLocal("wwperson_names", PersonNames.class),
propertyDescriptorFactory.getLocal("wwperson_tempName", TempName.class));
idDescriptor = propertyDescriptorFactory
.getLocal(SearchDescription.ID_DB_PROP, String.class);
facetDescriptions = createFacetDescriptions(facetDescriptionFactory);
dataPropertyDescriptors = createDataPropertyDescriptions(propertyDescriptorFactory);
fullTextSearchDescriptions = createFullTextSearchDescriptions();
sortFieldDescriptions = createSortFieldDescriptions();
}
protected ArrayList<SortFieldDescription> createSortFieldDescriptions() {
return Lists.newArrayList(
newSortFieldDescription()
.withName("dynamic_k_modified")
.withDefaultValue(0L)
.withProperty(localProperty()
.withName("modified_sort"))
.build(),
newSortFieldDescription()
.withName("dynamic_k_birthDate")
.withDefaultValue(0)
.withProperty(localProperty()
.withName("wwperson_birthDate_sort"))
.build(),
newSortFieldDescription()
.withName("dynamic_sort_name")
.withDefaultValue("")
.withProperty(localProperty()
.withName("wwperson_names_sort"))
.build(),
newSortFieldDescription()
.withName("dynamic_k_deathDate")
.withDefaultValue(0)
.withProperty(localProperty()
.withName("wwperson_deathDate_sort"))
.build());
}
private ArrayList<FullTextSearchDescription> createFullTextSearchDescriptions() {
return Lists.newArrayList(
createLocalSimpleFullTextSearchDescription("dynamic_t_tempspouse", "wwperson_tempSpouse"),
createLocalSimpleFullTextSearchDescription("dynamic_t_notes", "wwperson_notes"),
createLocalFullTextSearchDescriptionWithBackupProperty("dynamic_t_name", "wwperson_names", "wwperson_tempName")
);
}
private List<FacetDescription> createFacetDescriptions(FacetDescriptionFactory facetDescriptionFactory) {
return Lists.newArrayList(
facetDescriptionFactory.createListFacetDescription("dynamic_s_gender", Gender.class, "wwperson_gender"),
facetDescriptionFactory
.createListFacetDescription("dynamic_s_deathplace", LocationNames.class, "names", "hasDeathPlace"),
facetDescriptionFactory
.createListFacetDescription("dynamic_s_birthplace", LocationNames.class, "names", "hasBirthPlace"),
facetDescriptionFactory.createListFacetDescription(
"dynamic_s_relatedLocations",
LocationNames.class,
"names", // names, because the same name is shared between VRE's, so wwlocation_names does not exist
"hasBirthPlace", "hasDeathPlace", "hasResidenceLocation"),
facetDescriptionFactory.createDatableRangeFacetDescription("dynamic_i_deathDate", "wwperson_deathDate"),
facetDescriptionFactory.createListFacetDescription("dynamic_s_children", String.class, "wwperson_children"),
facetDescriptionFactory.createKeywordDescription("dynamic_s_religion", "hasReligion", "ww"),
facetDescriptionFactory.createListFacetDescription("dynamic_s_residence", LocationNames.class, "names",
"hasResidenceLocation"),
facetDescriptionFactory.createDerivedListFacetDescription(
"dynamic_s_language", "hasWorkLanguage", String.class, "wwlanguage_name", "isCreatedBy"),
facetDescriptionFactory.createKeywordDescription("dynamic_s_marital_status", "hasMaritalStatus", "ww"),
facetDescriptionFactory
.createListFacetDescription("dynamic_s_collective", String.class, "wwcollective_name", "isMemberOf"),
facetDescriptionFactory.createKeywordDescription("dynamic_s_education", "hasEducation", "ww"),
facetDescriptionFactory.createKeywordDescription("dynamic_s_social_class", "hasSocialClass", "ww"),
facetDescriptionFactory.createKeywordDescription("dynamic_s_financials", "hasFinancialSituation", "ww"),
facetDescriptionFactory.createDatableRangeFacetDescription("dynamic_i_birthDate", "wwperson_birthDate"),
facetDescriptionFactory.createKeywordDescription("dynamic_s_profession", "hasProfession", "ww"),
facetDescriptionFactory.createChangeRangeFacetDescription("dynamic_i_modified", "modified"),
facetDescriptionFactory.createMultiValueListFacetDescription("dynamic_s_types", "wwperson_types"));
}
private Map<String, PropertyDescriptor> createDataPropertyDescriptions(
PropertyDescriptorFactory propertyDescriptorFactory) {
Map<String, PropertyDescriptor> dataPropertyDescriptors = Maps.newHashMap();
dataPropertyDescriptors.put("birthDate", propertyDescriptorFactory.getLocal("wwperson_birthDate", Datable.class));
dataPropertyDescriptors.put("deathDate", propertyDescriptorFactory.getLocal("wwperson_deathDate", Datable.class));
dataPropertyDescriptors.put("gender", propertyDescriptorFactory.getLocal("wwperson_gender", Gender.class));
dataPropertyDescriptors.put("modified_date", propertyDescriptorFactory.getLocal("modified", Change.class));
dataPropertyDescriptors.put("residenceLocation", propertyDescriptorFactory.getDerived(
"hasResidenceLocation",
"names",
"wwrelation_accepted",
LocationNames.class));
dataPropertyDescriptors.put("name", propertyDescriptorFactory.getComposite(
propertyDescriptorFactory.getLocal("wwperson_names", PersonNames.class),
propertyDescriptorFactory.getLocal("wwperson_tempName", TempName.class)));
dataPropertyDescriptors
.put("_id", propertyDescriptorFactory.getLocal("tim_id", String.class));
return dataPropertyDescriptors;
}
@Override
protected List<FacetDescription> getFacetDescriptions() {
return facetDescriptions;
}
@Override
protected Map<String, PropertyDescriptor> getDataPropertyDescriptors() {
return dataPropertyDescriptors;
}
@Override
protected PropertyDescriptor getDisplayNameDescriptor() {
return displayNameDescriptor;
}
@Override
protected PropertyDescriptor getIdDescriptor() {
return idDescriptor;
}
@Override
public String getType() {
return "wwperson";
}
@Override
public List<FullTextSearchDescription> getFullTextSearchDescriptions() {
return fullTextSearchDescriptions;
}
@Override
public List<String> getSortableFields() {
return sortableFields;
}
@Override
public List<String> getFullTextSearchFields() {
return fullTextSearchFields;
}
@Override
protected SortDescription getSortDescription() {
return new SortDescription(sortFieldDescriptions);
}
}
| {'content_hash': '2841802f3f245979117c52110ed075d9', 'timestamp': '', 'source': 'github', 'line_count': 195, 'max_line_length': 149, 'avg_line_length': 46.794871794871796, 'alnum_prop': 0.7722739726027398, 'repo_name': 'EMResearch/EMB', 'id': '16ee274304b6f52818bedbac560cc8a433beb747', 'size': '9125', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'jdk_11_maven/cs/graphql/timbuctoo/timbuctoo-instancev4/src/main/java/nl/knaw/huygens/timbuctoo/search/description/WwPersonSearchDescription.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Awk', 'bytes': '17751'}, {'name': 'C#', 'bytes': '314780'}, {'name': 'CSS', 'bytes': '155749'}, {'name': 'Dockerfile', 'bytes': '6278'}, {'name': 'EJS', 'bytes': '13193'}, {'name': 'HTML', 'bytes': '1980397'}, {'name': 'Java', 'bytes': '13878146'}, {'name': 'JavaScript', 'bytes': '4551141'}, {'name': 'Kotlin', 'bytes': '62153'}, {'name': 'Less', 'bytes': '29035'}, {'name': 'Lex', 'bytes': '1418'}, {'name': 'Perl', 'bytes': '82062'}, {'name': 'Procfile', 'bytes': '26'}, {'name': 'Pug', 'bytes': '3626'}, {'name': 'Python', 'bytes': '129221'}, {'name': 'Ruby', 'bytes': '683'}, {'name': 'Shell', 'bytes': '51395'}, {'name': 'Smarty', 'bytes': '2380'}, {'name': 'Starlark', 'bytes': '23296'}, {'name': 'TSQL', 'bytes': '4320'}, {'name': 'Thrift', 'bytes': '1245'}, {'name': 'TypeScript', 'bytes': '701370'}, {'name': 'XSLT', 'bytes': '18724'}]} |
New landing page design for [Eversnap](http://geteversnap.com).
## Quick start
## Features
## Documentation
| {'content_hash': '37a1af87888f2fb64b7b589966385d34', 'timestamp': '', 'source': 'github', 'line_count': 8, 'max_line_length': 63, 'avg_line_length': 14.0, 'alnum_prop': 0.7142857142857143, 'repo_name': 'hguochen/eversnap_pro', 'id': '19097183f91bbfd5ba5da49fd95dd103df8290ca', 'size': '137', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'README.md', 'mode': '33261', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '23478'}, {'name': 'HTML', 'bytes': '56675'}, {'name': 'JavaScript', 'bytes': '734'}]} |
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {'content_hash': '3a1473c74144aa95677b2079f3d19d50', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 39, 'avg_line_length': 10.23076923076923, 'alnum_prop': 0.6917293233082706, 'repo_name': 'mdoering/backbone', 'id': '39e50adcdbae32b5b687d64d2338559aa29145dc', 'size': '205', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'life/Plantae/Magnoliophyta/Magnoliopsida/Fabales/Fabaceae/Hedysarum/Hedysarum polybotrys/ Syn. Hedysarum semenovii alaschanicum/README.md', 'mode': '33188', 'license': 'apache-2.0', 'language': []} |
import numpy as np
from astropy import coordinates as coords
from astroquery.sdss import SDSS
import os
from itertools import cycle
import sys
sys.path.append(f'{os.environ["HOME"]}/Projects/planckClusters/catalogs')
from load_catalogs import load_PSZcatalog
data = load_PSZcatalog(unconf=True)
# check to see if we are continuing
try:
with open('imagesGot.txt', 'r') as f:
done = int(f.readline())
except FileNotFoundError:
done = -np.inf
for i, (ra, dec, name) in enumerate(zip(data['RA'], data['Dec'],
data['Name'])):
# make string comparisons work
name = name.replace(' ', '_')
# here's the little bit for persistance (see below)
if i <= done:
continue
print(name)
if not os.path.isdir(name):
os.mkdir(name)
pos = coords.SkyCoord(ra, dec, frame='icrs', unit='deg')
print('fetching images....')
imgs = SDSS.get_images(pos, radius="20'", band='ugriz', data_release=12)
if imgs:
print('writing %s' % name, end='')
counter = 0
for HDU, band in zip(imgs, cycle('ugriz')):
print('.', end='')
if os.path.isfile(f'./{name}/{name}_sdss_{band}_{counter}.fits'):
HDU.writeto(f'./{name}/{name}_sdss_{band}_{counter + 1}.fits',
clobber=True)
if band == 'z':
counter += 1
else:
HDU.writeto(f'./{name}/{name}_sdss_{band}_{counter}.fits',
clobber=True)
# add a little thing to keep track how many we have done. Poor man's
# persistance
with open('imagesGot.txt', 'w') as f:
f.writelines(f'{i}')
print('')
| {'content_hash': '9350fe982eee16febd9a4742f4c60e1b', 'timestamp': '', 'source': 'github', 'line_count': 56, 'max_line_length': 78, 'avg_line_length': 31.053571428571427, 'alnum_prop': 0.5560667050028753, 'repo_name': 'boada/planckClusters', 'id': '2dc7dbdb635324c35c39e95d7deec5d59ba1f7eb', 'size': '1739', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'scripts/getImagesSDSS.py', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Batchfile', 'bytes': '689'}, {'name': 'C', 'bytes': '51857'}, {'name': 'Fortran', 'bytes': '742804'}, {'name': 'HTML', 'bytes': '1171'}, {'name': 'Jupyter Notebook', 'bytes': '1680335'}, {'name': 'MATLAB', 'bytes': '6751'}, {'name': 'Makefile', 'bytes': '2716'}, {'name': 'Python', 'bytes': '1479095'}, {'name': 'Shell', 'bytes': '28980'}, {'name': 'TeX', 'bytes': '120584'}]} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=constant.ENOTSUP.html">
</head>
<body>
<p>Redirecting to <a href="constant.ENOTSUP.html">constant.ENOTSUP.html</a>...</p>
<script>location.replace("constant.ENOTSUP.html" + location.search + location.hash);</script>
</body>
</html> | {'content_hash': '1814a188e14d7462507b3c082d144d95', 'timestamp': '', 'source': 'github', 'line_count': 10, 'max_line_length': 97, 'avg_line_length': 32.5, 'alnum_prop': 0.683076923076923, 'repo_name': 'nitro-devs/nitro-game-engine', 'id': '1c5cd382eb7d1a4df20ae857cf428e9b1c585a2c', 'size': '325', 'binary': False, 'copies': '8', 'ref': 'refs/heads/master', 'path': 'docs/libc/ENOTSUP.v.html', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CMake', 'bytes': '1032'}, {'name': 'Rust', 'bytes': '59380'}]} |
<?php
namespace AppBundle\Entity;
use Doctrine\ORM\EntityRepository;
/**
* TournamentRepository
*
* This class was generated by the Doctrine ORM. Add your own custom
* repository methods below.
*/
class TournamentRepository extends EntityRepository
{
}
| {'content_hash': '33b1460a9646ce8d8f4a67c927dfda67', 'timestamp': '', 'source': 'github', 'line_count': 15, 'max_line_length': 68, 'avg_line_length': 17.4, 'alnum_prop': 0.7662835249042146, 'repo_name': 'anazarenko/tfootball', 'id': 'e5aa7d4260caf3749afbae954d4671ce902f297b', 'size': '261', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/AppBundle/Entity/TournamentRepository.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'ApacheConf', 'bytes': '3547'}, {'name': 'CSS', 'bytes': '250873'}, {'name': 'HTML', 'bytes': '171477'}, {'name': 'JavaScript', 'bytes': '325092'}, {'name': 'PHP', 'bytes': '267651'}]} |
"use strict";
function viewGraph(y, z) {
var x = new XMLHttpRequest();
var d = document.getElementById(z);
x.onreadystatechange = function() {
if (x.readyState == 4 && x.status == 200) {
d.innerHTML = x.responseText;
}
else {
try {
if (x.status == 404)
throw new Error(y);
if (x.status == 500)
throw new Error("Internal Server");
else
return;
}
catch(e) {
d.innerHTML = "<p class=\'errormessage\'>" +
e.name + " " + e.message + "<\/p>";
}
}
}
x.open("GET", y, true);
x.send();
}
document.getElementById("gstn0").addEventListener("click",
function() {
viewGraph("images\/guitar\/gst_n0.xml", "view_00");
}, false);
document.getElementById("q4tn0").addEventListener("click",
function() {
viewGraph("images\/bass\/q4t_n0.xml", "view_00");
}, false);
document.getElementById("q5tn0").addEventListener("click",
function() {
viewGraph("images\/cello\/q5t_n0.xml", "view_00");
}, false);
document.getElementById("menu_00").addEventListener("click",
function() {
var nwDt = new Date();
document.getElementById("serial").textContent = nwDt.getTime();
}, false);
| {'content_hash': '3e987fcbd3c198f2160405dfb4ecfc90', 'timestamp': '', 'source': 'github', 'line_count': 46, 'max_line_length': 67, 'avg_line_length': 26.52173913043478, 'alnum_prop': 0.5811475409836065, 'repo_name': 'reidiiius/alchemyalamode', 'id': 'b6b2818f88824c361d973c00ea31fd15ca7eadde', 'size': '1221', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'svg/scripts/causata.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '6822'}, {'name': 'HTML', 'bytes': '35839'}, {'name': 'JavaScript', 'bytes': '28873'}]} |
import {coerceBooleanProperty} from '@angular/cdk/coercion';
import {AbstractConstructor, Constructor} from './constructor';
/** @docs-private */
export interface CanDisableRipple {
/** Whether ripples are disabled. */
disableRipple: boolean;
}
type CanDisableRippleCtor = Constructor<CanDisableRipple> & AbstractConstructor<CanDisableRipple>;
/** Mixin to augment a directive with a `disableRipple` property. */
export function mixinDisableRipple<T extends AbstractConstructor<{}>>(base: T):
CanDisableRippleCtor & T;
export function mixinDisableRipple<T extends Constructor<{}>>(base: T): CanDisableRippleCtor & T {
return class extends base {
private _disableRipple: boolean = false;
/** Whether the ripple effect is disabled or not. */
get disableRipple() { return this._disableRipple; }
set disableRipple(value: any) { this._disableRipple = coerceBooleanProperty(value); }
constructor(...args: any[]) { super(...args); }
};
}
| {'content_hash': '7a479eb6275708c8607e6a847456655e', 'timestamp': '', 'source': 'github', 'line_count': 27, 'max_line_length': 98, 'avg_line_length': 35.851851851851855, 'alnum_prop': 0.7324380165289256, 'repo_name': 'josephperrott/material2', 'id': '4e50ce76a2f795f7150812341912f001af955417', 'size': '1169', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/material/core/common-behaviors/disable-ripple.ts', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '421974'}, {'name': 'HTML', 'bytes': '491311'}, {'name': 'JavaScript', 'bytes': '57209'}, {'name': 'Python', 'bytes': '194844'}, {'name': 'Shell', 'bytes': '20002'}, {'name': 'TypeScript', 'bytes': '5771129'}]} |
<?xml version="1.0" encoding="utf-8"?><resources>
<string name="activity_resolver_use_always">"Siempre"</string>
<string name="activity_resolver_use_once">"Solo una vez"</string>
<string name="candidates_style">"candidatos"</string>
<string name="capital_off">"NO"</string>
<string name="capital_on">"SÍ"</string>
<string name="chooseActivity">"Seleccionar una acción"</string>
<string name="date_picker_decrement_day_button">"Reducir días"</string>
<string name="date_picker_decrement_month_button">"Reducir mes"</string>
<string name="date_picker_decrement_year_button">"Reducir año"</string>
<string name="date_picker_dialog_title">"Establecer fecha"</string>
<string name="date_picker_increment_day_button">"Aumentar días"</string>
<string name="date_picker_increment_month_button">"Aumentar mes"</string>
<string name="date_picker_increment_year_button">"Aumentar año"</string>
<string name="date_time_done">"Listo"</string>
<string name="date_time_set">"Establecer"</string>
<string name="loading">"Cargando..."</string>
<string name="noApplications">"Ninguna aplicación puede realizar esta acción."</string>
<string name="number_picker_decrement_button">"Reducir"</string>
<string name="number_picker_increment_button">"Aumentar"</string>
<string name="number_picker_increment_scroll_action">"Desliza el dedo hacia arriba para aumentar y hacia abajo para disminuir."</string>
<string name="number_picker_increment_scroll_mode">"Mantén pulsado %s."</string>
<string name="ringtone_default">"Tono predeterminado"</string>
<string name="ringtone_picker_title">"Tonos"</string>
<string name="ringtone_silent">"Silencio"</string>
<string name="time_picker_decrement_hour_button">"Reducir horas"</string>
<string name="time_picker_decrement_minute_button">"Reducir minutos"</string>
<string name="time_picker_decrement_set_am_button">"Establecer a.m."</string>
<string name="time_picker_dialog_title">"Establecer hora"</string>
<string name="time_picker_increment_hour_button">"Aumentar horas"</string>
<string name="time_picker_increment_minute_button">"Aumentar minutos"</string>
<string name="time_picker_increment_set_pm_button">"Establecer p.m."</string>
<string name="whichApplication">"Completar acción utilizando"</string>
</resources>
| {'content_hash': '9d11f42c27fce833a5c45f3a8d7b5772', 'timestamp': '', 'source': 'github', 'line_count': 34, 'max_line_length': 140, 'avg_line_length': 69.79411764705883, 'alnum_prop': 0.7176569742941424, 'repo_name': 'mercadolibre/HoloEverywhere', 'id': 'aca9f3ffbb0b6bf1feced8f3841f1ee58c18a4ba', 'size': '2383', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'library/res/values-es/strings.xml', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Groovy', 'bytes': '2007'}, {'name': 'Java', 'bytes': '1558776'}, {'name': 'Shell', 'bytes': '617'}]} |
cask 'propresenter' do
version '6.3.9_b16229'
sha256 '3b9976af8fb89e66bd523411254e6b78785ead3100f3c859d7c3baeaef94e1ef'
url "https://www.renewedvision.com/downloads/ProPresenter#{version.major}_#{version}.dmg"
appcast "https://www.renewedvision.com/update/ProPresenter#{version.major}.php"
name 'ProPresenter'
homepage 'https://www.renewedvision.com/propresenter.php'
depends_on macos: '>= :sierra'
app "ProPresenter #{version.major}.app"
zap trash: [
'~/Library/Application Support/RenewedVision/ProPresenter6',
'~/Library/Caches/KSCrashReports/ProPresenter 6',
'~/Library/Caches/Sessions/ProPresenter 6',
'~/Library/Caches/com.renewedvision.ProPresenter6',
'~/Library/Preferences/com.renewedvision.ProPresenter6.plist',
'/Library/Application Support/RenewedVision',
'/Library/Caches/com.renewedvision.ProPresenter6',
'/Users/Shared/Renewed Vision Media',
],
rmdir: [
'~/Library/Application Support/RenewedVision',
'~/Library/Caches/KSCrashReports',
'~/Library/Caches/Sessions',
]
end
| {'content_hash': 'c3f38e00e20c639b507d23238e968921', 'timestamp': '', 'source': 'github', 'line_count': 29, 'max_line_length': 91, 'avg_line_length': 41.55172413793103, 'alnum_prop': 0.6481327800829876, 'repo_name': 'hanxue/caskroom', 'id': 'bc0b1c1a5444a5517bb31d98f6a7621823410f33', 'size': '1205', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Casks/propresenter.rb', 'mode': '33188', 'license': 'bsd-2-clause', 'language': [{'name': 'Dockerfile', 'bytes': '778'}, {'name': 'HCL', 'bytes': '1658'}, {'name': 'Python', 'bytes': '3252'}, {'name': 'Ruby', 'bytes': '2246194'}, {'name': 'Shell', 'bytes': '37619'}]} |
/* React Starter Kit | MIT License | http://www.reactstarterkit.com/ */
@import '../variables.css';
.tableLabel {
font-size: 1em;
}
.textCenter {
text-align: center;
}
.completedTable {
height: 300px;
overflow: auto;
}
.first {
width: 50%;
}
.second {
width: 30%;
}
.third {
width: 20%;
}
.missingCourse {
text-align: center;
color: red;
font-size: 15pt;
} | {'content_hash': '4b786e2df09ce9207dc89227a8669cb7', 'timestamp': '', 'source': 'github', 'line_count': 27, 'max_line_length': 71, 'avg_line_length': 13.481481481481481, 'alnum_prop': 0.6483516483516484, 'repo_name': 'JosephArcher/KappaKappaKapping', 'id': '5f929fa5166f7845f0590c682c2d488e359b66bc', 'size': '364', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/components/TransferCoursesTable/TransferCourseTable.css', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '18532'}, {'name': 'HTML', 'bytes': '8789'}, {'name': 'JavaScript', 'bytes': '164307'}]} |
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global.eg = global.eg || {}, global.eg.Component = factory());
}(this, (function () { 'use strict';
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
function __values(o) {
var s = typeof Symbol === "function" && Symbol.iterator,
m = s && o[s],
i = 0;
if (m) return m.call(o);
if (o && typeof o.length === "number") return {
next: function () {
if (o && i >= o.length) o = void 0;
return {
value: o && o[i++],
done: !o
};
}
};
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
}
/*
* Copyright (c) 2015 NAVER Corp.
* egjs projects are licensed under the MIT license
*/
function isUndefined(value) {
return typeof value === "undefined";
}
/**
* A class used to manage events in a component
* @ko 컴포넌트의 이벤트을 관리할 수 있게 하는 클래스
* @alias eg.Component
*/
var Component =
/*#__PURE__*/
function () {
/**
* @support {"ie": "7+", "ch" : "latest", "ff" : "latest", "sf" : "latest", "edge" : "latest", "ios" : "7+", "an" : "2.1+ (except 3.x)"}
*/
function Component() {
/**
* @deprecated
* @private
*/
this.options = {};
this._eventHandler = {};
}
/**
* Triggers a custom event.
* @ko 커스텀 이벤트를 발생시킨다
* @param {string} eventName The name of the custom event to be triggered <ko>발생할 커스텀 이벤트의 이름</ko>
* @param {object} customEvent Event data to be sent when triggering a custom event <ko>커스텀 이벤트가 발생할 때 전달할 데이터</ko>
* @param {any[]} restParam Additional parameters when triggering a custom event <ko>커스텀 이벤트가 발생할 때 필요시 추가적으로 전달할 데이터</ko>
* @return Indicates whether the event has occurred. If the stop() method is called by a custom event handler, it will return false and prevent the event from occurring. <a href="https://github.com/naver/egjs-component/wiki/How-to-make-Component-event-design%3F">Ref</a> <ko>이벤트 발생 여부. 커스텀 이벤트 핸들러에서 stop() 메서드를 호출하면 'false'를 반환하고 이벤트 발생을 중단한다. <a href="https://github.com/naver/egjs-component/wiki/How-to-make-Component-event-design%3F">참고</a></ko>
* @example
* ```
* class Some extends eg.Component {
* some(){
* if(this.trigger("beforeHi")){ // When event call to stop return false.
* this.trigger("hi");// fire hi event.
* }
* }
* }
*
* const some = new Some();
* some.on("beforeHi", (e) => {
* if(condition){
* e.stop(); // When event call to stop, `hi` event not call.
* }
* });
* some.on("hi", (e) => {
* // `currentTarget` is component instance.
* console.log(some === e.currentTarget); // true
* });
* // If you want to more know event design. You can see article.
* // https://github.com/naver/egjs-component/wiki/How-to-make-Component-event-design%3F
* ```
*/
var __proto = Component.prototype;
__proto.trigger = function (eventName, customEvent) {
var _this = this;
var restParam = [];
for (var _i = 2; _i < arguments.length; _i++) {
restParam[_i - 2] = arguments[_i];
}
var handlerList = this._eventHandler[eventName] || [];
var hasHandlerList = handlerList.length > 0;
if (!hasHandlerList) {
return true;
}
if (!customEvent) {
customEvent = {};
} // If detach method call in handler in first time then handler list calls.
handlerList = handlerList.concat();
var isCanceled = false; // This should be done like this to pass previous tests
customEvent.eventType = eventName;
customEvent.stop = function () {
isCanceled = true;
};
customEvent.currentTarget = this;
var arg = [customEvent];
if (restParam.length >= 1) {
arg = arg.concat(restParam);
}
handlerList.forEach(function (handler) {
handler.apply(_this, arg);
});
return !isCanceled;
};
/**
* Executed event just one time.
* @ko 이벤트가 한번만 실행된다.
* @param {string} eventName The name of the event to be attached <ko>등록할 이벤트의 이름</ko>
* @param {function} handlerToAttach The handler function of the event to be attached <ko>등록할 이벤트의 핸들러 함수</ko>
* @return An instance of a component itself<ko>컴포넌트 자신의 인스턴스</ko>
* @example
* ```
* class Some extends eg.Component {
* hi() {
* alert("hi");
* }
* thing() {
* this.once("hi", this.hi);
* }
*
* var some = new Some();
* some.thing();
* some.trigger("hi");
* // fire alert("hi");
* some.trigger("hi");
* // Nothing happens
* ```
*/
__proto.once = function (eventName, handlerToAttach) {
var _this = this;
if (typeof eventName === "object" && isUndefined(handlerToAttach)) {
var eventHash = eventName;
for (var key in eventHash) {
this.once(key, eventHash[key]);
}
return this;
} else if (typeof eventName === "string" && typeof handlerToAttach === "function") {
var listener_1 = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
handlerToAttach.apply(_this, args);
_this.off(eventName, listener_1);
};
this.on(eventName, listener_1);
}
return this;
};
/**
* Checks whether an event has been attached to a component.
* @ko 컴포넌트에 이벤트가 등록됐는지 확인한다.
* @param {string} eventName The name of the event to be attached <ko>등록 여부를 확인할 이벤트의 이름</ko>
* @return {boolean} Indicates whether the event is attached. <ko>이벤트 등록 여부</ko>
* @example
* ```
* class Some extends eg.Component {
* some() {
* this.hasOn("hi");// check hi event.
* }
* }
* ```
*/
__proto.hasOn = function (eventName) {
return !!this._eventHandler[eventName];
};
/**
* Attaches an event to a component.
* @ko 컴포넌트에 이벤트를 등록한다.
* @param {string} eventName The name of the event to be attached <ko>등록할 이벤트의 이름</ko>
* @param {function} handlerToAttach The handler function of the event to be attached <ko>등록할 이벤트의 핸들러 함수</ko>
* @return An instance of a component itself<ko>컴포넌트 자신의 인스턴스</ko>
* @example
* ```
* class Some extends eg.Component {
* hi() {
* console.log("hi");
* }
* some() {
* this.on("hi",this.hi); //attach event
* }
* }
* ```
*/
__proto.on = function (eventName, handlerToAttach) {
if (typeof eventName === "object" && isUndefined(handlerToAttach)) {
var eventHash = eventName;
for (var name in eventHash) {
this.on(name, eventHash[name]);
}
return this;
} else if (typeof eventName === "string" && typeof handlerToAttach === "function") {
var handlerList = this._eventHandler[eventName];
if (isUndefined(handlerList)) {
this._eventHandler[eventName] = [];
handlerList = this._eventHandler[eventName];
}
handlerList.push(handlerToAttach);
}
return this;
};
/**
* Detaches an event from the component.
* @ko 컴포넌트에 등록된 이벤트를 해제한다
* @param {string} eventName The name of the event to be detached <ko>해제할 이벤트의 이름</ko>
* @param {function} handlerToDetach The handler function of the event to be detached <ko>해제할 이벤트의 핸들러 함수</ko>
* @return An instance of a component itself <ko>컴포넌트 자신의 인스턴스</ko>
* @example
* ```
* class Some extends eg.Component {
* hi() {
* console.log("hi");
* }
* some() {
* this.off("hi",this.hi); //detach event
* }
* }
* ```
*/
__proto.off = function (eventName, handlerToDetach) {
var e_1, _a; // Detach all event handlers.
if (isUndefined(eventName)) {
this._eventHandler = {};
return this;
} // Detach all handlers for eventname or detach event handlers by object.
if (isUndefined(handlerToDetach)) {
if (typeof eventName === "string") {
delete this._eventHandler[eventName];
return this;
} else {
var eventHash = eventName;
for (var name in eventHash) {
this.off(name, eventHash[name]);
}
return this;
}
} // Detach single event handler
var handlerList = this._eventHandler[eventName];
if (handlerList) {
var idx = 0;
try {
for (var handlerList_1 = __values(handlerList), handlerList_1_1 = handlerList_1.next(); !handlerList_1_1.done; handlerList_1_1 = handlerList_1.next()) {
var handlerFunction = handlerList_1_1.value;
if (handlerFunction === handlerToDetach) {
handlerList.splice(idx, 1);
break;
}
idx++;
}
} catch (e_1_1) {
e_1 = {
error: e_1_1
};
} finally {
try {
if (handlerList_1_1 && !handlerList_1_1.done && (_a = handlerList_1.return)) _a.call(handlerList_1);
} finally {
if (e_1) throw e_1.error;
}
}
}
return this;
};
/**
* Version info string
* @ko 버전정보 문자열
* @name VERSION
* @static
* @example
* eg.Component.VERSION; // ex) 2.0.0
* @memberof eg.Component
*/
Component.VERSION = "2.2.1";
return Component;
}();
return Component;
})));
//# sourceMappingURL=component.js.map
| {'content_hash': '7313afeec22a9badccd44b6caf224dce', 'timestamp': '', 'source': 'github', 'line_count': 356, 'max_line_length': 455, 'avg_line_length': 31.665730337078653, 'alnum_prop': 0.5235518495520269, 'repo_name': 'cdnjs/cdnjs', 'id': '0f19e8d491675b7304889d37d2d696f88c5fc088', 'size': '12048', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'ajax/libs/egjs-component/2.2.1/component.js', 'mode': '33188', 'license': 'mit', 'language': []} |
"""
Test vv.diff module
"""
__author__ = 'Dan Gunter <[email protected]>'
import logging
import random
import unittest
from matgendb.tests.common import MockQueryEngine
from matgendb.vv.diff import Differ, Delta
#
db_config = {
'host': 'localhost',
'port': 27017,
'database': 'test',
'aliases_config': {
'aliases': {},
'defaults': {}
}
}
def recname(num):
return 'item-{:d}'.format(num)
def create_record(num):
return {
'name': recname(num),
'color': random.choice(("red", "orange", "green", "indigo", "taupe", "mauve")),
'same': 'yawn',
'idlist': list(range(num)),
'zero': 0,
'energy': random.random() * 5 - 2.5,
}
#
class MyTestCase(unittest.TestCase):
NUM_RECORDS = 10
@classmethod
def setUpClass(cls):
mg = logging.getLogger("mg")
mg.setLevel(logging.ERROR)
mg.addHandler(logging.StreamHandler())
def setUp(self):
self.collections, self.engines = ['diff1', 'diff2'], []
self.colors = [[None, None] for i in range(self.NUM_RECORDS)]
self.energies = [[None, None] for i in range(self.NUM_RECORDS)]
for c in self.collections:
# Create mock query engine.
self.engines.append(MockQueryEngine(collection=c, **db_config))
for ei, engine in enumerate(self.engines):
engine.collection.remove({})
for i in range(self.NUM_RECORDS):
rec = create_record(i)
engine.collection.insert(rec)
# save some vars for easy double-checking
self.colors[i][ei] = rec['color']
self.energies[i][ei] = rec['energy']
def test_key_same(self):
"""Keys only and all keys are the same.
"""
# Perform diff.
df = Differ(key='name')
d = df.diff(*self.engines)
# Check results.
self.assertEqual(len(d[Differ.NEW]), 0)
self.assertEqual(len(d[Differ.MISSING]), 0)
def test_key_different(self):
"""Keys only and keys are different.
"""
# Add one different record to each collection.
self.engines[0].collection.insert(create_record(self.NUM_RECORDS + 1))
self.engines[1].collection.insert(create_record(self.NUM_RECORDS + 2))
# Perform diff.
df = Differ(key='name')
d = df.diff(*self.engines)
# Check results.
self.assertEqual(len(d[Differ.MISSING]), 1)
self.assertEqual(d[Differ.MISSING][0]['name'], recname(self.NUM_RECORDS + 1))
self.assertEqual(len(d[Differ.NEW]), 1)
self.assertEqual(d[Differ.NEW][0]['name'], recname(self.NUM_RECORDS + 2))
def test_eqprops_same(self):
"""Keys and props, all are the same.
"""
# Perform diff.
df = Differ(key='name', props=['same'])
d = df.diff(*self.engines)
# Check results.
self.assertEqual(len(d[Differ.CHANGED]), 0)
def test_eqprops_different(self):
"""Keys and props, some props out of range.
"""
# Perform diff.
df = Differ(key='name', props=['color'])
d = df.diff(*self.engines)
# Calculate expected results.
changed = sum((int(c[0] != c[1]) for c in self.colors))
# Check results.
self.assertEqual(len(d[Differ.CHANGED]), changed)
def test_numprops_same(self):
"""Keys and props, all are the same.
"""
# Perform diff.
df = Differ(key='name', deltas={"zero": Delta("+-0.001")})
d = df.diff(*self.engines)
# Check results.
self.assertEqual(len(d[Differ.CHANGED]), 0)
def test_numprops_different(self):
"""Keys and props, some props different.
"""
# Perform diff.
delta = 0.5
df = Differ(key='name', deltas={"energy": Delta("+-{:f}".format(delta))})
d = df.diff(*self.engines)
# Calculate expected results.
is_different = lambda a, b: abs(a - b) > delta
changed = sum((int(is_different(e[0], e[1])) for e in self.energies))
# Check results.
self.assertEqual(len(d[Differ.CHANGED]), changed)
def test_numprops_different_sign(self):
"""Keys and props, some props different.
"""
# Perform diff.
df = Differ(key='name', deltas={"energy": Delta("+-")})
d = df.diff(*self.engines)
# Calculate expected results.
is_different = lambda a, b: a < 0 < b or b < 0 < a
changed = sum((int(is_different(e[0], e[1])) for e in self.energies))
# Check results.
self.assertEqual(len(d[Differ.CHANGED]), changed)
def test_numprops_different_pct(self):
"""Keys and props, some props different, check pct change.
"""
# Perform diff.
minus, plus = 10, 20
df = Differ(key='name', deltas={"energy": Delta("+{}-{}=%".format(plus, minus))})
d = df.diff(*self.engines)
# Calculate expected results.
def is_different(a, b):
pct = 100.0 * (b - a) / a
return pct <= -minus or pct >= plus
changed = sum((int(is_different(e[0], e[1])) for e in self.energies))
# Check results.
if len(d[Differ.CHANGED]) != changed:
result = d[Differ.CHANGED]
msg = "Values:\n"
for i, e in enumerate(self.energies):
if not is_different(*e):
continue
msg += "{:d}) {:f} {:f}\n".format(i, e[0], e[1])
msg += "Result:\n"
for i, r in enumerate(result):
msg += "{:d}) {} {}\n".format(i, r["old"], r["new"])
self.assertEqual(len(d[Differ.CHANGED]), changed, msg=msg)
# repeat this test a few more times
test_numprops_different_pct1 = test_numprops_different_pct
test_numprops_different_pct2 = test_numprops_different_pct
test_numprops_different_pct3 = test_numprops_different_pct
def test_delta(self):
"""Delta class parsing.
"""
self.failUnlessRaises(ValueError, Delta, "foo")
def test_delta_sign(self):
"""Delta class sign.
"""
d = Delta("+-")
self.assertEquals(d.cmp(0, 1), False)
self.assertEquals(d.cmp(-1, 0), False)
self.assertEquals(d.cmp(-1, 1), True)
def test_delta_val(self):
"""Delta class value, same absolute.
"""
d = Delta("+-3")
self.assertEquals(d.cmp(0, 1), False)
self.assertEquals(d.cmp(1, 4), False)
self.assertEquals(d.cmp(1, 5), True)
def test_delta_val(self):
"""Delta class value, different absolute.
"""
d = Delta("+2.5-1.5")
self.assertEquals(d.cmp(0, 1), False)
self.assertEquals(d.cmp(1, 3), False)
self.assertEquals(d.cmp(3, 1), True)
def test_delta_val(self):
"""Delta class value, same absolute equality.
"""
d = Delta("+-3.0=")
self.assertEquals(d.cmp(0, 1), False)
self.assertEquals(d.cmp(1, 4), True)
self.assertEquals(d.cmp(4, 1), True)
def test_delta_val(self):
"""Delta class value, same percentage.
"""
d = Delta("+-25%")
self.assertEquals(d.cmp(0, 1), False)
self.assertEquals(d.cmp(8, 4), True)
self.assertEquals(d.cmp(8, 6), False)
def test_delta_val(self):
"""Delta class value, same percentage equality.
"""
d = Delta("+-25=%")
self.assertEquals(d.cmp(0, 1), False)
self.assertEquals(d.cmp(8, 4), True)
self.assertEquals(d.cmp(8, 6), True)
def test_delta_val(self):
"""Delta class value, different percentage equality.
"""
d = Delta("+50-25=%")
self.assertEquals(d.cmp(0, 1), False)
self.assertEquals(d.cmp(8, 4), True)
self.assertEquals(d.cmp(8, 6), True)
self.assertEquals(d.cmp(6, 8), False)
self.assertEquals(d.cmp(6, 9), True)
def test_delta_plus(self):
"""Delta class value 'plus only'.
"""
d = Delta("+50")
self.assertEquals(d.cmp(0, 50), False)
self.assertEquals(d.cmp(0, 51), True)
self.assertEquals(d.cmp(10, 5), False)
d = Delta("+50=")
self.assertEquals(d.cmp(0, 50), True)
d = Delta("+50%")
self.assertEquals(d.cmp(10, 25), True)
self.assertEquals(d.cmp(25, 10), False)
def test_delta_minus(self):
"""Delta class value 'minus only'.
"""
d = Delta("-50")
self.assertEquals(d.cmp(0, 50), False)
self.assertEquals(d.cmp(51, 0), True)
self.assertEquals(d.cmp(5, 10), False)
d = Delta("-50=")
self.assertEquals(d.cmp(50, 0), True)
d = Delta("-50%")
self.assertEquals(d.cmp(25, 10), True)
self.assertEquals(d.cmp(10, 25), False)
if __name__ == '__main__':
unittest.main()
| {'content_hash': 'cc542f69be35da3360631395a469a3d4', 'timestamp': '', 'source': 'github', 'line_count': 269, 'max_line_length': 89, 'avg_line_length': 33.185873605947954, 'alnum_prop': 0.5505769015346701, 'repo_name': 'migueldiascosta/pymatgen-db', 'id': 'cb3aee2f3ce25739d73c50478afcd926c8bae853', 'size': '8927', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'matgendb/vv/tests/test_diff.py', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'ActionScript', 'bytes': '31964'}, {'name': 'CSS', 'bytes': '212547'}, {'name': 'HTML', 'bytes': '2280625'}, {'name': 'JavaScript', 'bytes': '1312249'}, {'name': 'PHP', 'bytes': '9068'}, {'name': 'Python', 'bytes': '344019'}, {'name': 'Shell', 'bytes': '419'}]} |
module Poster
module FeedsHelper
end
end
| {'content_hash': 'a682d1ccf77087373f1902a10d71273e', 'timestamp': '', 'source': 'github', 'line_count': 4, 'max_line_length': 20, 'avg_line_length': 11.25, 'alnum_prop': 0.7777777777777778, 'repo_name': 'pratikganvir/Poster', 'id': '60ddc61cec1afd16da153334705bc489d17cad53', 'size': '45', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'app/helpers/poster/feeds_helper.rb', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '2264'}, {'name': 'JavaScript', 'bytes': '85059'}, {'name': 'Ruby', 'bytes': '21608'}]} |
class BaseClass##Mock : public nacl_io::BaseClass { \
public: \
BaseClass##Mock(); \
virtual ~BaseClass##Mock();
#define END_INTERFACE(BaseClass, PPInterface) \
};
#define METHOD0(Class, ReturnType, MethodName) \
MOCK_METHOD0(MethodName, ReturnType());
#define METHOD1(Class, ReturnType, MethodName, Type0) \
MOCK_METHOD1(MethodName, ReturnType(Type0));
#define METHOD2(Class, ReturnType, MethodName, Type0, Type1) \
MOCK_METHOD2(MethodName, ReturnType(Type0, Type1));
#define METHOD3(Class, ReturnType, MethodName, Type0, Type1, Type2) \
MOCK_METHOD3(MethodName, ReturnType(Type0, Type1, Type2));
#define METHOD4(Class, ReturnType, MethodName, Type0, Type1, Type2, Type3) \
MOCK_METHOD4(MethodName, ReturnType(Type0, Type1, Type2, Type3));
#define METHOD5(Class, ReturnType, MethodName, Type0, Type1, Type2, Type3, \
Type4) \
MOCK_METHOD5(MethodName, ReturnType(Type0, Type1, Type2, Type3, Type4));
#include "nacl_io/pepper/all_interfaces.h"
class PepperInterfaceMock : public nacl_io::PepperInterface {
public:
explicit PepperInterfaceMock(PP_Instance instance);
~PepperInterfaceMock();
virtual PP_Instance GetInstance();
// Interface getters.
#include "nacl_io/pepper/undef_macros.h"
#include "nacl_io/pepper/define_empty_macros.h"
#undef BEGIN_INTERFACE
#define BEGIN_INTERFACE(BaseClass, PPInterface, InterfaceString) \
virtual BaseClass##Mock* Get##BaseClass();
#include "nacl_io/pepper/all_interfaces.h"
private:
PP_Instance instance_;
// Interface pointers.
#include "nacl_io/pepper/undef_macros.h"
#include "nacl_io/pepper/define_empty_macros.h"
#undef BEGIN_INTERFACE
#define BEGIN_INTERFACE(BaseClass, PPInterface, InterfaceString) \
BaseClass##Mock* BaseClass##interface_;
#include "nacl_io/pepper/all_interfaces.h"
};
#endif // TESTS_NACL_IO_TEST_PEPPER_INTERFACE_MOCK_H_
| {'content_hash': '4e44cebe88964c4d383053b94b15a246', 'timestamp': '', 'source': 'github', 'line_count': 51, 'max_line_length': 76, 'avg_line_length': 36.80392156862745, 'alnum_prop': 0.7314864144912093, 'repo_name': 'nwjs/chromium.src', 'id': '2dd0d0525b0dad43971d4b2a0d49432ebcaa8e18', 'size': '2335', 'binary': False, 'copies': '6', 'ref': 'refs/heads/nw70', 'path': 'native_client_sdk/src/tests/nacl_io_test/pepper_interface_mock.h', 'mode': '33188', 'license': 'bsd-3-clause', 'language': []} |
var GENEMAP = GENEMAP || {};
//Produce layout for gene annotations
//GENEMAP.GeneClusterer is used to cluster genes if necessary
//Labella is used to generate layout of nodes
GENEMAP.GeneAnnotationLayout = function (userConfig) {
var defaultConfig = {
longestChromosome: 100,
layout: {
width: 10, //not used
height: 100,
x: 0, //not used
y: 0, //not used
},
autoLabels : true,
manualLabels : true,
annotationMarkerSize: 5,
annotationLabelSize: 5,
doCluster : true,
nClusters: 6,
nGenesToDisplay: 1000,
maxAnnotationLayers: 3,
displayedFontSize: 13,
scale: 1,
};
var config = _.merge({}, defaultConfig, userConfig);
var buildYScale = function () {
return d3.scale.linear()
.range([0, config.layout.height])
.domain([0, config.longestChromosome]);
};
var shouldRecluster = function(nodes) {
if (!config.doCluster) { return false;}
var layers = nodes.map(function (d) { return d.getLayerIndex(); } );
var maxLayer = Math.max.apply(null, layers);
return ( maxLayer > config.maxAnnotationLayers );
}
var calculatePossibleRows = function(scale, availableWidth, labelLength, minDisplayedFontSize ){
var fontCoordRatio = 4.0;
//Try 2 rows:
var spaceForLabel = availableWidth / 3;
var setFontSize =spaceForLabel / labelLength * fontCoordRatio;
var possible = setFontSize * scale > minDisplayedFontSize;
if (possible){
return 2;
}
//Otherwise, try 1 row
var layerGap = availableWidth * ( 0.1 + 0.1 / scale )
spaceForLabel = availableWidth -layerGap;
setFontSize = spaceForLabel / labelLength * fontCoordRatio;
possible = setFontSize * scale > minDisplayedFontSize;
if ( possible){
return 1;
}
return 0;
}
var compute1RowLayout = function(scale, availableWidth, labelLength,
maxDisplayedFontSize, availableHeight){
var fontCoordRatio = 3.5;
par = {};
par.scale = scale;
par.availableHeight = availableHeight;
par.lineSpacing = 1;
par.layerGap = availableWidth * ( 0.1 + 0.1 / scale )
par.spaceForLabel = availableWidth - par.layerGap;
par.setFontSize = Math.min(
par.spaceForLabel / labelLength * fontCoordRatio ,
maxDisplayedFontSize / config.scale
) ;
//par.nodeSpacing = Math.max( 2, par.setFontSize );
par.nodeSpacing = par.setFontSize ;
par.nLabels = 0.4 * availableHeight / (par.nodeSpacing + par.lineSpacing);
par.density = 1.0;
return par;
};
var compute2RowLayout = function(scale, availableWidth, labelLength,
maxDisplayedFontSize, availableHeight){
var fontCoordRatio = 3.5;
var par = {};
par.scale = scale;
par.availableHeight = availableHeight;
par.lineSpacing = 1;
par.setFontSize = Math.min(
availableWidth / 3 / labelLength * fontCoordRatio,
maxDisplayedFontSize / config.scale ) ;
//par.nodeSpacing = Math.max(2, par.setFontSize);
par.nodeSpacing = par.setFontSize ;
par.spaceForLabel = 1.3 * labelLength * par.setFontSize / fontCoordRatio;
par.layerGap = Math.min(5*par.setFontSize, availableWidth / 3);
par.density = 0.9;
par.nLabels = 0.6 * availableHeight / (par.nodeSpacing + par.lineSpacing);
return par;
};
var generateNodes = function(force, y, par, nodeSource){
nodeSource.forEach( function(gene){
gene.displayed = true
gene.fontSize = par.setFontSize;
});
var nodes = nodeSource.map(function (d) {
return new labella.Node(y(d.midpoint), par.setFontSize, d);
} );
try {
force.nodes(nodes).compute();
} catch (e){
if ( e instanceof RangeError){
return null;
}
throw e;
}
return nodes;
}
//Use labella to generate layout nodes for each gene
//or cluster of genes
var generateChromosomeLayout = function(chromosome){
allGenes = chromosome.annotations.allGenes.filter( function(gene){
return (gene.globalIndex < config.nGenesToDisplay);
});
//How much space do we have?
var availableWidth = config.layout.width;
//For short chromosomes, allow labels to use up to 20% past the end of the chromosome
var availableHeight = config.layout.height * ( Math.min(
1,
0.2 + chromosome.length / config.longestChromosome
) ) ;
//The longest label determines when we can start displaying them without overlaps
var labelLength = allGenes.reduce( function(cur, gene){
return Math.max(cur, gene.label.length)
}, 0);
var minDisplayedFontSize = 1.1 * config.displayedFontSize;
var maxDisplayedFontSize = 0.9 * config.displayedFontSize;
//How many rows of labels do we show?
var nrows = calculatePossibleRows(config.scale, availableWidth, labelLength, minDisplayedFontSize);
var par;
if ( nrows ==2 ){
par = compute2RowLayout(config.scale, availableWidth,labelLength,maxDisplayedFontSize, availableHeight);
}
else if ( nrows == 1) {
par = compute1RowLayout(config.scale, availableWidth,labelLength,maxDisplayedFontSize, availableHeight);
}
else if ( nrows == 0 ){
par = compute1RowLayout(config.scale, availableWidth,labelLength,maxDisplayedFontSize, availableHeight);
par.nLabels = 0;
}
var y = buildYScale();
forceConfig = {
nodeSpacing: par.nodeSpacing,
lineSpacing: par.lineSpacing,
algorithm: 'overlap',
minPos: 0,
maxPos: par.availableHeight,
density: par.density,
};
var force = new labella.Force( forceConfig );
//Decide which labels to display
//Start with no labels displayed
allGenes.forEach( function(gene){ gene.displayed = false}) ;
//Include all genes set to visible
var nodeSet = config.manualLabels
? new Set(allGenes.filter( function(gene){ return gene.visible}))
: new Set();
//Automatically show some additional labels
if ( config.autoLabels){
allGenes.slice(0, par.nLabels)
.filter( function(gene){return !gene.hidden;})
.forEach( function(gene){ nodeSet.add(gene)});
}
var nodeSource = Array.from(nodeSet);
var nodes = generateNodes(force, y, par, nodeSource);
//If the layout algorithm fails (stack limit exceeded),
//try again using the 'simple' algorithm.
if ( !nodes){
force.options( { algorithm: 'simple'});
nodes = generateNodes( force, y, par, nodeSource);
}
//How many layers did we end up with?
var maxLayer;
if ( nodes){
var layers = nodes.map(function (d) { return d.getLayerIndex(); } );
maxLayer = Math.max.apply(null, layers);
}
//If the algorithm sill fails or there are too many layers,
//we need to reduce the number of nodes by clustering
if (!nodes || maxLayer > 3 ) {
log.trace( 'Too many lables to display - clustering instead')
var geneClusterer = GENEMAP.GeneClusterer()
.nClusters(Math.max(par.nLabels,1));
try {
var clusterSource = geneClusterer.createClustersFromGenes(nodeSource);
}
catch(e){
log.info(nodeSource);
clusterSource = [];
}
nodes = generateNodes(force, y, par, clusterSource)
}
//Compute paths
renderConfig = {
direction: 'right',
layerGap: par.layerGap,
nodeHeight: par.spaceForLabel,
};
var renderer = new labella.Renderer(renderConfig);
renderer.layout(nodes);
nodes.forEach( function(node){
node.data.path = renderer.generatePath(node);
});
if ( false && chromosome.number == "2B") {
log.info( nodes );
}
return nodes;
}
//Produce list of clusters (which could be single genes)
//for a given chromosome
var generateChromosomeClusters = function(chromosome){
var geneClusterer = GENEMAP.GeneClusterer();
//Run clustering algorithm so we can use the clusters later when drawing
var genes = chromosome.annotations.genes;
var geneClusters = geneClusterer.createClustersFromGenes(genes);
return geneClusters;
}
my = {};
my.layoutChromosome = function(chromosome){
chromosome.layout.annotationNodes = (
generateChromosomeLayout(chromosome) || chromosome.layout.annotationNodes);
}
my.computeChromosomeClusters = function(chromosome){
chromosome.layout.annotationClusters = generateChromosomeClusters(chromosome);
chromosome.layout.annotationDisplayClusters = chromosome.layout.annotationClusters.slice();
};
my.expandAllChromosomeClusters = function(chromosome) {
chromosome.layout.annotationDisplayClusters = chromosome.annotations.genes;
};
my.collapseAllChromosomeClusters = function(chromosome) {
chromosome.layout.annotationDisplayClusters = chromosome.layout.annotationClusters.slice();
};
my.expandAChromosomeCluster= function( chromosome, cluster) {
chromosome.layout.annotationDisplayClusters = chromosome.layout.annotationClusters.slice();
//add each gene as it's own cluster
cluster.genesList.forEach( function(gene){
chromosome.layout.annotationDisplayClusters.push(gene) ;
} );
//delete the original cluster
var clusterIndex = chromosome.layout.annotationDisplayClusters.indexOf(cluster);
chromosome.layout.annotationDisplayClusters.splice(clusterIndex, 1);
};
my.computeNormalisedGeneScores = function ( chromosomes ){
var allVisible = chromosomes.reduce( function( total, cur){
return total.concat(cur.annotations.genes.filter( function(gene){
return gene.displayed;
}));
},[]);
var allScored = allVisible.every( function(gene){
return gene.score;
})
if ( allScored ){
var maxScore = allVisible.reduce( function(max, cur){
return Math.max(max , cur.score);
}, 0);
var minScore = allVisible.reduce( function(min, cur){
return Math.min(min , cur.score);
}, 0);
allVisible.forEach( function(gene){
gene.normedScore = 0.5 * (gene.score - minScore) / (maxScore - minScore) + 0.5;
}
);
}
else{
allVisible.forEach( function(gene){
gene.normedScore = null;
});
}
}
return my;
}
| {'content_hash': '8344658d33ff9c478eaf16e5a30ed104', 'timestamp': '', 'source': 'github', 'line_count': 349, 'max_line_length': 110, 'avg_line_length': 29.415472779369626, 'alnum_prop': 0.6614065848431716, 'repo_name': 'AjitPS/KnetMiner', 'id': 'a46ccfeb9ff53337e4ae1084990103291a41f624', 'size': '10266', 'binary': False, 'copies': '5', 'ref': 'refs/heads/master', 'path': 'client-base/src/main/webapp/html/GeneMap/src/js/gene_annotation_layout.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Batchfile', 'bytes': '38'}, {'name': 'CSS', 'bytes': '79017'}, {'name': 'Dockerfile', 'bytes': '1498'}, {'name': 'HTML', 'bytes': '102168'}, {'name': 'Java', 'bytes': '230879'}, {'name': 'JavaScript', 'bytes': '1442026'}, {'name': 'Shell', 'bytes': '30037'}]} |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.