code stringlengths 4 1.01M | language stringclasses 2 values |
|---|---|
#
# Copyright (c) Microsoft Corporation.
#
# 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.
#
configuration Sample_PSModule
{
param
(
#Target nodes to apply the configuration
[string[]]$NodeName = 'localhost',
#The name of the module
[Parameter(Mandatory)]
[string]$Name,
#The required version of the module
[string]$RequiredVersion,
#Repository name
[string]$Repository,
#Whether you trust the repository
[string]$InstallationPolicy
)
Import-DscResource -Module PackageManagementProviderResource
Node $NodeName
{
#Install a package from the Powershell gallery
PSModule MyPSModule
{
Ensure = "present"
Name = $Name
RequiredVersion = "0.2.16.3"
Repository = "PSGallery"
InstallationPolicy="trusted"
}
}
}
#Compile it
Sample_PSModule -Name "xjea"
#Run it
Start-DscConfiguration -path .\Sample_PSModule -wait -Verbose -force
| Java |
/*
The MIT License (MIT)
Copyright (c) 2014 Manni Wood
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.
*/
package com.manniwood.cl4pg.v1.test.types;
import com.manniwood.cl4pg.v1.datasourceadapters.DataSourceAdapter;
import com.manniwood.cl4pg.v1.PgSession;
import com.manniwood.cl4pg.v1.datasourceadapters.PgSimpleDataSourceAdapter;
import com.manniwood.cl4pg.v1.commands.DDL;
import com.manniwood.cl4pg.v1.commands.Insert;
import com.manniwood.cl4pg.v1.commands.Select;
import com.manniwood.cl4pg.v1.resultsethandlers.GuessScalarListHandler;
import org.testng.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/**
* Please note that these tests must be run serially, and not all at once.
* Although they depend as little as possible on state in the database, it is
* very convenient to have them all use the same db session; so they are all run
* one after the other so that they don't all trip over each other.
*
* @author mwood
*
*/
public class IntegerSmallIntTest {
private PgSession pgSession;
private DataSourceAdapter adapter;
@BeforeClass
public void init() {
adapter = PgSimpleDataSourceAdapter.buildFromDefaultConfFile();
pgSession = adapter.getSession();
pgSession.run(DDL.config().sql("create temporary table test(col smallint)").done());
pgSession.commit();
}
@AfterClass
public void tearDown() {
pgSession.close();
adapter.close();
}
/**
* Truncate the users table before each test.
*/
@BeforeMethod
public void truncateTable() {
pgSession.run(DDL.config().sql("truncate table test").done());
pgSession.commit();
}
@Test(priority = 1)
public void testValue() {
Integer expected = 3;
pgSession.run(Insert.usingVariadicArgs()
.sql("insert into test (col) values (#{java.lang.Integer})")
.args(expected)
.done());
pgSession.commit();
GuessScalarListHandler<Integer> handler = new GuessScalarListHandler<Integer>();
pgSession.run(Select.<Integer> usingVariadicArgs()
.sql("select col from test limit 1")
.resultSetHandler(handler)
.done());
pgSession.rollback();
Integer actual = handler.getList().get(0);
Assert.assertEquals(actual, expected, "scalars must match");
}
@Test(priority = 2)
public void testNull() {
Integer expected = null;
pgSession.run(Insert.usingVariadicArgs()
.sql("insert into test (col) values (#{java.lang.Integer})")
.args(expected)
.done());
pgSession.commit();
GuessScalarListHandler<Integer> handler = new GuessScalarListHandler<Integer>();
pgSession.run(Select.<Integer> usingVariadicArgs()
.sql("select col from test limit 1")
.resultSetHandler(handler)
.done());
pgSession.rollback();
Integer actual = handler.getList().get(0);
Assert.assertEquals(actual, expected, "scalars must match");
}
@Test(priority = 3)
public void testSpecialValue1() {
Integer expected = 32767;
pgSession.run(Insert.usingVariadicArgs()
.sql("insert into test (col) values (#{java.lang.Integer})")
.args(expected)
.done());
pgSession.commit();
GuessScalarListHandler<Integer> handler = new GuessScalarListHandler<Integer>();
pgSession.run(Select.<Integer> usingVariadicArgs()
.sql("select col from test limit 1")
.resultSetHandler(handler)
.done());
pgSession.rollback();
Integer actual = handler.getList().get(0);
Assert.assertEquals(actual, expected, "scalars must match");
}
@Test(priority = 4)
public void testSpecialValu21() {
Integer expected = -32768;
pgSession.run(Insert.usingVariadicArgs()
.sql("insert into test (col) values (#{java.lang.Integer})")
.args(expected)
.done());
pgSession.commit();
GuessScalarListHandler<Integer> handler = new GuessScalarListHandler<Integer>();
pgSession.run(Select.<Integer> usingVariadicArgs()
.sql("select col from test limit 1")
.resultSetHandler(handler)
.done());
pgSession.rollback();
Integer actual = handler.getList().get(0);
Assert.assertEquals(actual, expected, "scalars must match");
}
}
| Java |
package com.fqc.jdk8;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
public class test06 {
public static void main(String[] args) {
int[] arr = {1, 2, 3, 4, 5};
ArrayList<Integer> list = Arrays.stream(arr).collect(ArrayList::new, ArrayList::add, ArrayList::addAll);
Set<Integer> set = list.stream().collect(Collectors.toSet());
System.out.println(set.contains(33));
ArrayList<User> users = new ArrayList<>();
for (int i = 0; i < 10; i++) {
users.add(new User("name:" + i));
}
Map<String, User> map = users.stream().collect(Collectors.toMap(u -> u.username, u -> u));
map.forEach((s, user) -> System.out.println(user.username));
}
}
class User {
String username;
public User(String username) {
this.username = username;
}
}
| Java |
// Deprecated: use github.com/multiformats/go-multiaddr-fmt instead.
package mafmt
import (
nmafmt "github.com/multiformats/go-multiaddr-fmt"
)
// Deprecated: use github.com/multiformats/go-multiaddr-fmt instead.
var IP = nmafmt.IP
// Deprecated: use github.com/multiformats/go-multiaddr-fmt instead.
var TCP = nmafmt.TCP
// Deprecated: use github.com/multiformats/go-multiaddr-fmt instead.
var UDP = nmafmt.UDP
// Deprecated: use github.com/multiformats/go-multiaddr-fmt instead.
var UTP = nmafmt.UTP
// Deprecated: use github.com/multiformats/go-multiaddr-fmt instead.
var QUIC = nmafmt.QUIC
// Deprecated: use github.com/multiformats/go-multiaddr-fmt instead.
var Unreliable = nmafmt.Unreliable
// Deprecated: use github.com/multiformats/go-multiaddr-fmt instead.
var Reliable = nmafmt.Reliable
// Deprecated: use github.com/multiformats/go-multiaddr-fmt instead.
var IPFS = nmafmt.IPFS
// Deprecated: use github.com/multiformats/go-multiaddr-fmt instead.
var And = nmafmt.And
// Deprecated: use github.com/multiformats/go-multiaddr-fmt instead.
var Or = nmafmt.Or
// Deprecated: use github.com/multiformats/go-multiaddr-fmt instead.
type Pattern = nmafmt.Pattern
// Deprecated: use github.com/multiformats/go-multiaddr-fmt instead.
type Base = nmafmt.Base
| Java |
# gofmt package
An [Atom](http://atom.io) package for running `gofmt` on your buffer.
Hit Ctrl-Alt-G to run it on the current file,
or use command `gofmt:gofmt`,
or remap to whatever keybinding you like.
TODO:
* Error highlighting
* Flexible configuration
## Licensing and Copyright
Copyright 2014 Christopher Swenson.
Licensed under the MIT License (see [LICENSE.md](LICENSE.md)).
| Java |
USE [ANTERO]
GO
/****** Object: View [dw].[v_koski_lukio_opiskelijat_netto] Script Date: 1.2.2021 14:00:39 ******/
DROP VIEW IF EXISTS [dw].[v_koski_lukio_opiskelijat_netto]
GO
/****** Object: View [dw].[v_koski_lukio_opiskelijat_netto] Script Date: 1.2.2021 14:00:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dw].[v_koski_lukio_opiskelijat_netto] AS
SELECT
-- AIKAMUUTTUJAT
[Tilastovuosi]
,[Tilastokuukausi] = d14.kuukausi_fi
,[pv_kk] = DAY(EOMONTH(d14.paivays))
-- LUKUMÄÄRÄMUUTTUJAT
,opiskelijat_netto = opiskelijat
-- HENKILÖMUUTTUJAT
,[Sukupuoli] = d1.sukupuoli_fi
,[Äidinkieli] = d2.kieliryhma1_fi
,[Ikä] =
CASE
WHEN d3.ika_avain < 15 THEN 'alle 15 vuotta'
WHEN d3.ika_avain > 70 THEN 'yli 70 vuotta'
ELSE d3.ika_fi END
,[Ikäryhmä] = d3.ikaryhma3_fi
,[Kansalaisuus] = CASE WHEN d22.maatjavaltiot2_koodi = '246' THEN d22.maatjavaltiot2_fi WHEN d22.maatjavaltiot2_koodi != '-1' THEN 'Muu' ELSE 'Tieto puuttuu' END
,[Kansalaisuus (maanosa)] = d22.maanosa0_fi
-- KOULUTUSMUUTTUJAT
,[Suorituskieli] = d23.kieli_fi
,[Majoitus] = d15.majoitus_nimi_fi
,oppimaara AS Oppimäärä
,tavoitetutkinto AS Tavoitetutkinto
,koulutus AS Koulutus
-- ORGANISAATIOMUUTTUJAT
,[Oppilaitos] = d5.organisaatio_fi
,[Koulutuksen järjestäjä] = d11.organisaatio_fi
,[Toimipiste] = d21.organisaatio_fi
,[Oppilaitoksen kunta] = d10.kunta_fi
,[Oppilaitoksen maakunta] = d10.maakunta_fi
,d10.seutukunta_fi AS [Oppilaitoksen seutukunta]
,d10.kuntaryhma_fi AS [Oppilaitoksen kuntaryhmä]
,d10.kielisuhde_fi AS [Oppilaitoksen kunnan kielisuhde]
,[Oppilaitoksen AVI] = d10.avi_fi
,[Oppilaitoksen ELY] = d10.ely_fi
,[Oppilaitoksen opetuskieli] = d5.oppilaitoksenopetuskieli_fi
,[Oppilaitostyyppi] = d5.oppilaitostyyppi_fi
,[Koul. järj. kunta] = d12.kunta_fi
,[Koul. järj. maakunta] = d12.maakunta_fi
,[Koul. järj. ELY] = d12.ely_fi
,[Koul. järj. AVI] = d12.avi_fi
,d11.koulutuksen_jarjestajan_yritysmuoto AS [Koul. järj. omistajatyyppi]
,d12.seutukunta_fi AS [Koul. järj. seutukunta]
,d12.kuntaryhma_fi AS [Koul. järj. kuntaryhmä]
,d12.kielisuhde_fi AS [Koul. jarj. kunnan kielisuhde]
-- KOODIT
,[Koodit Koulutuksen järjestäjä] = d11.organisaatio_koodi
,[Koodit Oppilaitos] = d5.organisaatio_koodi
,d12.kunta_koodi AS [Koodi Koul. järj. kunta]
,d12.seutukunta_koodi AS [Koodi Koul. järj. seutukunta]
,d10.kunta_koodi AS [Koodi Oppilaitoksen kunta]
,d10.seutukunta_koodi AS [Koodi Oppilaitoksen seutukunta]
-- JÄRJESTYSMUUTTUJAT
,jarj_ika =
CASE
WHEN d3.ika_avain = -1 THEN 99
WHEN d3.ika_avain < 15 THEN 1
WHEN d3.ika_avain > 70 THEN 71
ELSE d3.jarjestys_ika END
,d14.kuukausi AS jarj_tilastokuukausi
,d1.jarjestys_sukupuoli_koodi AS jarj_sukupuoli
,d3.jarjestys_ikaryhma3 AS jarj_ikaryhma
,d2.jarjestys_kieliryhma1 AS jarj_aidinkieli
,CASE d22.maatjavaltiot2_fi WHEN 'Suomi' THEN 1 ELSE 2 END AS jarj_kansalaisuus
,jarj_koulutus
,jarj_oppimaara
,jarj_tavoitetutkinto
,d12.jarjestys_maakunta_koodi AS jarj_koul_jarj_maakunta
,d12.jarjestys_avi_koodi AS jarj_koul_jarj_avi
,d12.jarjestys_ely_koodi AS jarj_koul_jarj_ely
,d10.jarjestys_maakunta_koodi AS jarj_oppilaitoksen_maakunta
,d10.jarjestys_ely_koodi AS jarj_oppilaitoksen_ely
,d10.jarjestys_avi_koodi AS jarj_oppilaitoksen_avi
,d5.jarjestys_oppilaitoksenopetuskieli_koodi AS jarj_oppilaitoksen_opetuskieli
,d5.jarjestys_oppilaitostyyppi_koodi AS jarj_oppilaitostyyppi
,d15.jarjestys_majoitus_koodi as jarj_majoitus
FROM dw.f_koski_lukio_opiskelijat_netto f
LEFT JOIN dw.d_sukupuoli d1 ON d1.id= f.d_sukupuoli_id
LEFT JOIN dw.d_kieli d2 ON d2.id = f.d_kieli_aidinkieli_id
LEFT JOIN dw.d_ika d3 ON d3.id = f.d_ika_id
LEFT JOIN dw.d_organisaatioluokitus d5 ON d5.id = f.d_organisaatioluokitus_oppilaitos_id
LEFT JOIN dw.d_alueluokitus d10 ON d10.kunta_koodi = d5.kunta_koodi
LEFT JOIN dw.d_organisaatioluokitus d11 ON d11.id = f.d_organisaatioluokitus_jarj_id
LEFT JOIN dw.d_alueluokitus d12 ON d12.kunta_koodi = d11.kunta_koodi
LEFT JOIN dw.d_kalenteri d14 ON d14.id = f.d_kalenteri_id
LEFT JOIN dw.d_majoitus d15 ON d15.id = f.d_majoitus_id
LEFT JOIN dw.d_organisaatioluokitus d21 ON d21.id = f.d_organisaatioluokitus_toimipiste_id
LEFT JOIN dw.d_maatjavaltiot2 d22 ON d22.id = f.d_maatjavaltiot2_kansalaisuus_id
LEFT JOIN dw.d_kieli d23 ON d23.id = f.d_kieli_suorituskieli_id
GO
USE ANTERO | Java |
var chalk = require('chalk');
var safeStringify = require('fast-safe-stringify')
function handleErrorObject(key, value) {
if (value instanceof Error) {
return Object.getOwnPropertyNames(value).reduce(function(error, key) {
error[key] = value[key]
return error
}, {})
}
return value
}
function stringify(o) { return safeStringify(o, handleErrorObject, ' '); }
function debug() {
if (!process.env.WINSTON_CLOUDWATCH_DEBUG) return;
var args = [].slice.call(arguments);
var lastParam = args.pop();
var color = chalk.red;
if (lastParam !== true) {
args.push(lastParam);
color = chalk.green;
}
args[0] = color(args[0]);
args.unshift(chalk.blue('DEBUG:'));
console.log.apply(console, args);
}
module.exports = {
stringify: stringify,
debug: debug
};
| Java |
#pragma once
#include "toolscollector.h"
#include "widgetsettings.h"
#include "toolbase.h"
namespace Engine {
namespace Tools {
struct GuiEditor : public Tool<GuiEditor> {
SERIALIZABLEUNIT(GuiEditor);
GuiEditor(ImRoot &root);
virtual Threading::Task<bool> init() override;
virtual void render() override;
virtual void renderMenu() override;
virtual void update() override;
std::string_view key() const override;
private:
void renderSelection(Widgets::WidgetBase *hoveredWidget = nullptr);
void renderHierarchy(Widgets::WidgetBase **hoveredWidget = nullptr);
bool drawWidget(Widgets::WidgetBase *w, Widgets::WidgetBase **hoveredWidget = nullptr);
private:
Widgets::WidgetManager *mWidgetManager = nullptr;
WidgetSettings *mSelected = nullptr;
std::list<WidgetSettings> mSettings;
bool mMouseDown = false;
bool mDragging = false;
bool mDraggingLeft = false, mDraggingTop = false, mDraggingRight = false, mDraggingBottom = false;
};
}
}
RegisterType(Engine::Tools::GuiEditor); | Java |
<?php if (isset($consumers) && is_array($consumers)){ ?>
<?php $this->load->helper('security'); ?>
<tbody>
<?php foreach($consumers as $consumer){ ?>
<tr>
<td>
<a data-toggle="modal" data-target="#dynamicModal" href="<?php echo site_url("consumers/edit/$consumer->id");?>"><span class="glyphicon glyphicon-pencil"></span></a>
</td>
<td>
<?php echo $consumer->id; ?>
</td>
<td>
<?php echo xss_clean($consumer->name); ?>
</td>
</tr>
<?php } ?>
</tbody>
<tfoot>
<tr class="pagination-tr">
<td colspan="3" class="pagination-tr">
<div class="text-center">
<?php echo $this->pagination->create_links(); ?>
</div>
</td>
</tr>
</tfoot>
<?php }?>
| Java |
package rholang.parsing.delimc.Absyn; // Java Package generated by the BNF Converter.
public class TType2 extends TType {
public final Type type_1, type_2;
public TType2(Type p1, Type p2) { type_1 = p1; type_2 = p2; }
public <R,A> R accept(rholang.parsing.delimc.Absyn.TType.Visitor<R,A> v, A arg) { return v.visit(this, arg); }
public boolean equals(Object o) {
if (this == o) return true;
if (o instanceof rholang.parsing.delimc.Absyn.TType2) {
rholang.parsing.delimc.Absyn.TType2 x = (rholang.parsing.delimc.Absyn.TType2)o;
return this.type_1.equals(x.type_1) && this.type_2.equals(x.type_2);
}
return false;
}
public int hashCode() {
return 37*(this.type_1.hashCode())+this.type_2.hashCode();
}
}
| Java |
require 'rubygems'
require 'test/unit'
require 'shoulda'
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'sinatra'
require 'sinatra/path'
class Test::Unit::TestCase
end
| Java |
"use strict"
const createTileGridConverter = require(`./createTileGridConverter`)
const colorDepth = require(`./colorDepth`)
module.exports = ({palette, images}) => {
const converter = createTileGridConverter({
tileWidth: 7,
tileHeight: 9,
columns: 19,
tileCount: 95,
raw32bitData: colorDepth.convert8to32({palette, raw8bitData: images}),
})
return {
convertToPng: converter.convertToPng
}
} | Java |
import * as EventLogger from './'
const log = new EventLogger()
log.info('Basic information')
log.information('Basic information')
log.warning('Watch out!')
log.warn('Watch out!')
log.error('Something went wrong.')
log.auditFailure('Audit Failure')
log.auditSuccess('Audit Success')
// Configurations
new EventLogger('FooApplication')
new EventLogger({
source: 'FooApplication',
logPath: '/var/usr/local/log',
eventLog: 'APPLICATION'
})
| Java |
# cactuscon2015
Badge design for CactusCon 2015
| Java |
# Be sure to restart your server when you modify this file.
Rails.application.config.session_store :cookie_store, key: '_imdbc_session'
| Java |
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Class: HTML::Sanitizer</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="classHeader">
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Class</strong></td>
<td class="class-name-in-header">HTML::Sanitizer</td>
</tr>
<tr class="top-aligned-row">
<td><strong>In:</strong></td>
<td>
<a href="../../files/usr/lib/ruby/gems/1_8/gems/actionpack-3_0_0_beta4/lib/action_controller/vendor/html-scanner/html/sanitizer_rb.html">
/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.0.beta4/lib/action_controller/vendor/html-scanner/html/sanitizer.rb
</a>
<br />
</td>
</tr>
<tr class="top-aligned-row">
<td><strong>Parent:</strong></td>
<td>
<a href="../Object.html">
Object
</a>
</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
</div>
<div id="method-list">
<h3 class="section-bar">Methods</h3>
<div class="name-list">
<a href="#M000941">process_node</a>
<a href="#M000938">sanitize</a>
<a href="#M000939">sanitizeable?</a>
<a href="#M000940">tokenize</a>
</div>
</div>
</div>
<!-- if includes -->
<div id="section">
<!-- if method_list -->
<div id="methods">
<h3 class="section-bar">Public Instance methods</h3>
<div id="method-M000938" class="method-detail">
<a name="M000938"></a>
<div class="method-heading">
<a href="#M000938" class="method-signature">
<span class="method-name">sanitize</span><span class="method-args">(text, options = {})</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000938-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000938-source">
<pre>
<span class="ruby-comment cmt"># File /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.0.beta4/lib/action_controller/vendor/html-scanner/html/sanitizer.rb, line 6</span>
6: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sanitize</span>(<span class="ruby-identifier">text</span>, <span class="ruby-identifier">options</span> = {})
7: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">text</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">sanitizeable?</span>(<span class="ruby-identifier">text</span>)
8: <span class="ruby-identifier">tokenize</span>(<span class="ruby-identifier">text</span>, <span class="ruby-identifier">options</span>).<span class="ruby-identifier">join</span>
9: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div id="method-M000939" class="method-detail">
<a name="M000939"></a>
<div class="method-heading">
<a href="#M000939" class="method-signature">
<span class="method-name">sanitizeable?</span><span class="method-args">(text)</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000939-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000939-source">
<pre>
<span class="ruby-comment cmt"># File /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.0.beta4/lib/action_controller/vendor/html-scanner/html/sanitizer.rb, line 11</span>
11: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sanitizeable?</span>(<span class="ruby-identifier">text</span>)
12: <span class="ruby-operator">!</span>(<span class="ruby-identifier">text</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">text</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-operator">||</span> <span class="ruby-operator">!</span><span class="ruby-identifier">text</span>.<span class="ruby-identifier">index</span>(<span class="ruby-value str">"<"</span>))
13: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<h3 class="section-bar">Protected Instance methods</h3>
<div id="method-M000941" class="method-detail">
<a name="M000941"></a>
<div class="method-heading">
<a href="#M000941" class="method-signature">
<span class="method-name">process_node</span><span class="method-args">(node, result, options)</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000941-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000941-source">
<pre>
<span class="ruby-comment cmt"># File /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.0.beta4/lib/action_controller/vendor/html-scanner/html/sanitizer.rb, line 26</span>
26: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">process_node</span>(<span class="ruby-identifier">node</span>, <span class="ruby-identifier">result</span>, <span class="ruby-identifier">options</span>)
27: <span class="ruby-identifier">result</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">node</span>.<span class="ruby-identifier">to_s</span>
28: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div id="method-M000940" class="method-detail">
<a name="M000940"></a>
<div class="method-heading">
<a href="#M000940" class="method-signature">
<span class="method-name">tokenize</span><span class="method-args">(text, options)</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000940-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000940-source">
<pre>
<span class="ruby-comment cmt"># File /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.0.beta4/lib/action_controller/vendor/html-scanner/html/sanitizer.rb, line 16</span>
16: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">tokenize</span>(<span class="ruby-identifier">text</span>, <span class="ruby-identifier">options</span>)
17: <span class="ruby-identifier">tokenizer</span> = <span class="ruby-constant">HTML</span><span class="ruby-operator">::</span><span class="ruby-constant">Tokenizer</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">text</span>)
18: <span class="ruby-identifier">result</span> = []
19: <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">token</span> = <span class="ruby-identifier">tokenizer</span>.<span class="ruby-identifier">next</span>
20: <span class="ruby-identifier">node</span> = <span class="ruby-constant">Node</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-keyword kw">nil</span>, <span class="ruby-value">0</span>, <span class="ruby-value">0</span>, <span class="ruby-identifier">token</span>, <span class="ruby-keyword kw">false</span>)
21: <span class="ruby-identifier">process_node</span> <span class="ruby-identifier">node</span>, <span class="ruby-identifier">result</span>, <span class="ruby-identifier">options</span>
22: <span class="ruby-keyword kw">end</span>
23: <span class="ruby-identifier">result</span>
24: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
</div>
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
</html> | Java |
# -*- coding: utf-8 -*-
"""urls.py: messages extends"""
from django.conf.urls import url
from messages_extends.views import message_mark_all_read, message_mark_read
urlpatterns = [
url(r'^mark_read/(?P<message_id>\d+)/$', message_mark_read, name='message_mark_read'),
url(r'^mark_read/all/$', message_mark_all_read, name='message_mark_all_read'),
]
| Java |
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
$(document).ready(function(){
var oldAction = $('#comment-form').attr("action");
hljs.initHighlightingOnLoad();
$('#coolness div').hover(function(){
$('#coolness .second').fadeOut(500);
}, function(){
$('#coolness .second').fadeIn(1000).stop(false, true);
});
$(".reply a").click(function() {
var add = this.className;
var action = oldAction + '/' + add;
$("#comment-form").attr("action", action);
console.log($('#comment-form').attr("action"));
});
});
| Java |
#include "Sound.h"
#include <Windows.h>
#include "DigitalGraffiti.h"
Sound::Sound(void)
{
// Find music and sound files
std::string exeDir = DigitalGraffiti::getExeDirectory();
DigitalGraffiti::getFileList(exeDir + "\\sound\\instructions\\*", instructionsMusicList);
DigitalGraffiti::getFileList(exeDir + "\\sound\\cleanup\\*", cleanupMusicList);
DigitalGraffiti::getFileList(exeDir + "\\sound\\splat\\*", splatSoundList);
instructionsCounter = 0;
cleanupCounter = 0;
splatCounter = 0;
numInstructions= instructionsMusicList.size();
numCleanup = cleanupMusicList.size();
numSplat = splatSoundList.size();
if(DigitalGraffiti::DEBUG)
{
printf("Sound directory is: %s\n", exeDir.c_str());
printf("\tnumInstructions = %u\n", numInstructions);
printf("\tnumCleanup = %u\n", numCleanup);
printf("\tnumSplat = %u\n", numSplat);
}
}
void Sound::playInstructionsMusic(void)
{
if(numInstructions > 0)
{
if(DigitalGraffiti::DEBUG)
{
printf("Play %s\n", instructionsMusicList[instructionsCounter].c_str());
}
PlaySound(TEXT(instructionsMusicList[instructionsCounter].c_str()), NULL, SND_FILENAME | SND_ASYNC| SND_NOWAIT);
instructionsCounter = (instructionsCounter + 1) % numInstructions;
}
}
void Sound::playCleanupMusic(void)
{
if(numCleanup > 0)
{
if(DigitalGraffiti::DEBUG)
{
printf("Play %s\n", cleanupMusicList[cleanupCounter].c_str());
}
PlaySound(TEXT(cleanupMusicList[cleanupCounter].c_str()), NULL, SND_FILENAME | SND_ASYNC| SND_NOWAIT);
cleanupCounter = (cleanupCounter + 1) % numCleanup;
}
}
void Sound::playSplatSound(void)
{
if(numSplat > 0)
{
if(DigitalGraffiti::DEBUG)
{
printf("Play %s\n", splatSoundList[splatCounter].c_str());
}
PlaySound(TEXT(splatSoundList[splatCounter].c_str()), NULL, SND_FILENAME | SND_ASYNC| SND_NOWAIT);
splatCounter = (splatCounter + 1) % numSplat;
}
} | Java |
using System.Collections.ObjectModel;
using AppStudio.Common;
using AppStudio.Common.Navigation;
using Windows.UI.Xaml;
namespace WindowsAppStudio.Navigation
{
public abstract class NavigationNode : ObservableBase
{
private bool _isSelected;
public string Title { get; set; }
public string Label { get; set; }
public abstract bool IsContainer { get; }
public bool IsSelected
{
get
{
return _isSelected;
}
set
{
SetProperty(ref _isSelected, value);
}
}
public abstract void Selected();
}
public class ItemNavigationNode : NavigationNode, INavigable
{
public override bool IsContainer
{
get
{
return false;
}
}
public NavigationInfo NavigationInfo { get; set; }
public override void Selected()
{
NavigationService.NavigateTo(this);
}
}
public class GroupNavigationNode : NavigationNode
{
private Visibility _visibility;
public GroupNavigationNode()
{
Nodes = new ObservableCollection<NavigationNode>();
}
public override bool IsContainer
{
get
{
return true;
}
}
public ObservableCollection<NavigationNode> Nodes { get; set; }
public Visibility Visibility
{
get { return _visibility; }
set { SetProperty(ref _visibility, value); }
}
public override void Selected()
{
if (Visibility == Visibility.Collapsed)
{
Visibility = Visibility.Visible;
}
else
{
Visibility = Visibility.Collapsed;
}
}
}
}
| Java |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>canon-bdds: Not compatible 👼</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.10.0 / canon-bdds - 8.5.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
canon-bdds
<small>
8.5.0
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2021-12-07 06:33:16 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2021-12-07 06:33:16 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-threads base
base-unix base
conf-findutils 1 Virtual package relying on findutils
coq 8.10.0 Formal proof management system
num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.07.1 The OCaml compiler (virtual package)
ocaml-base-compiler 4.07.1 Official release 4.07.1
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.1 A library manager for OCaml
# opam file:
opam-version: "2.0"
maintainer: "matej.kosik@inria.fr"
homepage: "https://github.com/coq-contribs/canon-bdds"
license: "Proprietary"
build: [make "-j%{jobs}%"]
install: [make "install"]
remove: ["rm" "-R" "%{lib}%/coq/user-contrib/CanonBDDs"]
depends: [
"ocaml"
"coq" {>= "8.5" & < "8.6~"}
]
tags: [
"keyword:BDT"
"keyword:finite sets"
"keyword:model checking"
"keyword:binary decision diagrams"
"category:Computer Science/Decision Procedures and Certified Algorithms/Decision procedures"
"category:Miscellaneous/Extracted Programs/Decision procedures"
]
authors: [ "Emmanuel Ledinot <>" ]
bug-reports: "https://github.com/coq-contribs/canon-bdds/issues"
dev-repo: "git+https://github.com/coq-contribs/canon-bdds.git"
synopsis: "Canonicity of Binary Decision Dags"
description: """
A proof of unicity and canonicity of Binary Decision Trees and
Binary Decision Dags. This contrib contains also a development on finite sets."""
flags: light-uninstall
url {
src: "https://github.com/coq-contribs/canon-bdds/archive/v8.5.0.tar.gz"
checksum: "md5=1e2bdec36357609a6a0498d59a2e68ba"
}
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install 🏜️</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-canon-bdds.8.5.0 coq.8.10.0</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.10.0).
The following dependencies couldn't be met:
- coq-canon-bdds -> coq < 8.6~ -> ocaml < 4.06.0
base of this switch (use `--unlock-base' to force)
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-canon-bdds.8.5.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
| Java |
# AndSpecification(*T*) Constructor
Additional header content
Initializes a new instance of the <a href="T_iTin_Export_ComponentModel_Patterns_AndSpecification_1">AndSpecification(T)</a> class
**Namespace:** <a href="N_iTin_Export_ComponentModel_Patterns">iTin.Export.ComponentModel.Patterns</a><br />**Assembly:** iTin.Export.Core (in iTin.Export.Core.dll) Version: 2.0.0.0 (2.0.0.0)
## Syntax
**C#**<br />
``` C#
public AndSpecification(
ISpecification<T> left,
ISpecification<T> right
)
```
**VB**<br />
``` VB
Public Sub New (
left As ISpecification(Of T),
right As ISpecification(Of T)
)
```
#### Parameters
<dl><dt>left</dt><dd>Type: <a href="T_iTin_Export_ComponentModel_Patterns_ISpecification_1">iTin.Export.ComponentModel.Patterns.ISpecification</a>(<a href="T_iTin_Export_ComponentModel_Patterns_AndSpecification_1">*T*</a>)<br />\[Missing <param name="left"/> documentation for "M:iTin.Export.ComponentModel.Patterns.AndSpecification`1.#ctor(iTin.Export.ComponentModel.Patterns.ISpecification{`0},iTin.Export.ComponentModel.Patterns.ISpecification{`0})"\]</dd><dt>right</dt><dd>Type: <a href="T_iTin_Export_ComponentModel_Patterns_ISpecification_1">iTin.Export.ComponentModel.Patterns.ISpecification</a>(<a href="T_iTin_Export_ComponentModel_Patterns_AndSpecification_1">*T*</a>)<br />\[Missing <param name="right"/> documentation for "M:iTin.Export.ComponentModel.Patterns.AndSpecification`1.#ctor(iTin.Export.ComponentModel.Patterns.ISpecification{`0},iTin.Export.ComponentModel.Patterns.ISpecification{`0})"\]</dd></dl>
## Remarks
\[Missing <remarks> documentation for "M:iTin.Export.ComponentModel.Patterns.AndSpecification`1.#ctor(iTin.Export.ComponentModel.Patterns.ISpecification{`0},iTin.Export.ComponentModel.Patterns.ISpecification{`0})"\]
## See Also
#### Reference
<a href="T_iTin_Export_ComponentModel_Patterns_AndSpecification_1">AndSpecification(T) Class</a><br /><a href="N_iTin_Export_ComponentModel_Patterns">iTin.Export.ComponentModel.Patterns Namespace</a><br /> | Java |
// This file auto generated by plugin for ida pro. Generated code only for x64. Please, dont change manually
#pragma once
#include <common/common.h>
#include <CRecallRequest.hpp>
START_ATF_NAMESPACE
namespace Info
{
using CRecallRequestctor_CRecallRequest2_ptr = void (WINAPIV*)(struct CRecallRequest*, uint16_t);
using CRecallRequestctor_CRecallRequest2_clbk = void (WINAPIV*)(struct CRecallRequest*, uint16_t, CRecallRequestctor_CRecallRequest2_ptr);
using CRecallRequestClear4_ptr = void (WINAPIV*)(struct CRecallRequest*);
using CRecallRequestClear4_clbk = void (WINAPIV*)(struct CRecallRequest*, CRecallRequestClear4_ptr);
using CRecallRequestClose6_ptr = void (WINAPIV*)(struct CRecallRequest*, bool);
using CRecallRequestClose6_clbk = void (WINAPIV*)(struct CRecallRequest*, bool, CRecallRequestClose6_ptr);
using CRecallRequestGetID8_ptr = uint16_t (WINAPIV*)(struct CRecallRequest*);
using CRecallRequestGetID8_clbk = uint16_t (WINAPIV*)(struct CRecallRequest*, CRecallRequestGetID8_ptr);
using CRecallRequestGetOwner10_ptr = struct CPlayer* (WINAPIV*)(struct CRecallRequest*);
using CRecallRequestGetOwner10_clbk = struct CPlayer* (WINAPIV*)(struct CRecallRequest*, CRecallRequestGetOwner10_ptr);
using CRecallRequestIsBattleModeUse12_ptr = bool (WINAPIV*)(struct CRecallRequest*);
using CRecallRequestIsBattleModeUse12_clbk = bool (WINAPIV*)(struct CRecallRequest*, CRecallRequestIsBattleModeUse12_ptr);
using CRecallRequestIsClose14_ptr = bool (WINAPIV*)(struct CRecallRequest*);
using CRecallRequestIsClose14_clbk = bool (WINAPIV*)(struct CRecallRequest*, CRecallRequestIsClose14_ptr);
using CRecallRequestIsRecallAfterStoneState16_ptr = bool (WINAPIV*)(struct CRecallRequest*);
using CRecallRequestIsRecallAfterStoneState16_clbk = bool (WINAPIV*)(struct CRecallRequest*, CRecallRequestIsRecallAfterStoneState16_ptr);
using CRecallRequestIsRecallParty18_ptr = bool (WINAPIV*)(struct CRecallRequest*);
using CRecallRequestIsRecallParty18_clbk = bool (WINAPIV*)(struct CRecallRequest*, CRecallRequestIsRecallParty18_ptr);
using CRecallRequestIsTimeOut20_ptr = bool (WINAPIV*)(struct CRecallRequest*);
using CRecallRequestIsTimeOut20_clbk = bool (WINAPIV*)(struct CRecallRequest*, CRecallRequestIsTimeOut20_ptr);
using CRecallRequestIsWait22_ptr = bool (WINAPIV*)(struct CRecallRequest*);
using CRecallRequestIsWait22_clbk = bool (WINAPIV*)(struct CRecallRequest*, CRecallRequestIsWait22_ptr);
using CRecallRequestRecall24_ptr = char (WINAPIV*)(struct CRecallRequest*, struct CPlayer*, bool);
using CRecallRequestRecall24_clbk = char (WINAPIV*)(struct CRecallRequest*, struct CPlayer*, bool, CRecallRequestRecall24_ptr);
using CRecallRequestRegist26_ptr = char (WINAPIV*)(struct CRecallRequest*, struct CPlayer*, struct CCharacter*, bool, bool, bool);
using CRecallRequestRegist26_clbk = char (WINAPIV*)(struct CRecallRequest*, struct CPlayer*, struct CCharacter*, bool, bool, bool, CRecallRequestRegist26_ptr);
using CRecallRequestdtor_CRecallRequest30_ptr = void (WINAPIV*)(struct CRecallRequest*);
using CRecallRequestdtor_CRecallRequest30_clbk = void (WINAPIV*)(struct CRecallRequest*, CRecallRequestdtor_CRecallRequest30_ptr);
}; // end namespace Info
END_ATF_NAMESPACE
| Java |
class DiscountTechnicalTypesController < ApplicationController
before_action :set_discount_technical_type, only: [:show, :edit, :update, :destroy]
# GET /discount_technical_types
# GET /discount_technical_types.json
def index
@discount_technical_types = DiscountTechnicalType.all
end
# GET /discount_technical_types/1
# GET /discount_technical_types/1.json
def show
end
# GET /discount_technical_types/new
def new
@discount_technical_type = DiscountTechnicalType.new
end
# GET /discount_technical_types/1/edit
def edit
end
# POST /discount_technical_types
# POST /discount_technical_types.json
def create
@discount_technical_type = DiscountTechnicalType.new(discount_technical_type_params)
respond_to do |format|
if @discount_technical_type.save
format.html { redirect_to @discount_technical_type, notice: 'Discount technical type was successfully created.' }
format.json { render :show, status: :created, location: @discount_technical_type }
else
format.html { render :new }
format.json { render json: @discount_technical_type.errors, status: :unprocessable_entity }
end
end
end
# PATCH/PUT /discount_technical_types/1
# PATCH/PUT /discount_technical_types/1.json
def update
respond_to do |format|
if @discount_technical_type.update(discount_technical_type_params)
format.html { redirect_to @discount_technical_type, notice: 'Discount technical type was successfully updated.' }
format.json { render :show, status: :ok, location: @discount_technical_type }
else
format.html { render :edit }
format.json { render json: @discount_technical_type.errors, status: :unprocessable_entity }
end
end
end
# DELETE /discount_technical_types/1
# DELETE /discount_technical_types/1.json
def destroy
@discount_technical_type.destroy
respond_to do |format|
format.html { redirect_to discount_technical_types_url, notice: 'Discount technical type was successfully destroyed.' }
format.json { head :no_content }
end
end
private
# Use callbacks to share common setup or constraints between actions.
def set_discount_technical_type
@discount_technical_type = DiscountTechnicalType.find(params[:id])
end
# Never trust parameters from the scary internet, only allow the white list through.
def discount_technical_type_params
params.require(:discount_technical_type).permit(:value)
end
end
| Java |
using System.Net.Sockets;
namespace VidereLib.EventArgs
{
/// <summary>
/// EventArgs for the OnClientConnected event.
/// </summary>
public class OnClientConnectedEventArgs : System.EventArgs
{
/// <summary>
/// The connected client.
/// </summary>
public TcpClient Client { private set; get; }
/// <summary>
/// Constructor.
/// </summary>
/// <param name="client">The connected client.</param>
public OnClientConnectedEventArgs( TcpClient client )
{
this.Client = client;
}
}
}
| Java |
require 'rubygems'
require 'net/dns'
module Reedland
module Command
class Host
def self.run(address)
regular = Net::DNS::Resolver.start address.join(" ")
mx = Net::DNS::Resolver.new.search(address.join(" "), Net::DNS::MX)
return "#{regular}\n#{mx}"
end
end
end
end | Java |
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1" charset="UTF-8">
<title>onSupportNavigateUp</title>
</head><body><link href="../../../images/logo-icon.svg" rel="icon" type="image/svg"><script>var pathToRoot = "../../../";</script>
<script type="text/javascript" src="../../../scripts/sourceset_dependencies.js" async></script><link href="../../../styles/style.css" rel="Stylesheet"><link href="../../../styles/jetbrains-mono.css" rel="Stylesheet"><link href="../../../styles/main.css" rel="Stylesheet"><link href="../../../styles/prism.css" rel="Stylesheet"><link href="../../../styles/logo-styles.css" rel="Stylesheet"><script type="text/javascript" src="../../../scripts/clipboard.js" async></script><script type="text/javascript" src="../../../scripts/navigation-loader.js" async></script><script type="text/javascript" src="../../../scripts/platform-content-handler.js" async></script><script type="text/javascript" src="../../../scripts/main.js" defer></script><script type="text/javascript" src="../../../scripts/prism.js" async></script><script>const storage = localStorage.getItem("dokka-dark-mode")
const savedDarkMode = storage ? JSON.parse(storage) : false
if(savedDarkMode === true){
document.getElementsByTagName("html")[0].classList.add("theme-dark")
}</script>
<div class="navigation-wrapper" id="navigation-wrapper">
<div id="leftToggler"><span class="icon-toggler"></span></div>
<div class="library-name"><a href="../../../index.html"><span>stripe-android</span></a></div>
<div></div>
<div class="pull-right d-flex"><button id="theme-toggle-button"><span id="theme-toggle"></span></button>
<div id="searchBar"></div>
</div>
</div>
<div id="container">
<div id="leftColumn">
<div id="sideMenu"></div>
</div>
<div id="main">
<div class="main-content" id="content" pageids="payments-core::com.stripe.android.view/PaymentMethodsActivity/onSupportNavigateUp/#/PointingToDeclaration//-1622557690">
<div class="breadcrumbs"><a href="../../index.html">payments-core</a>/<a href="../index.html">com.stripe.android.view</a>/<a href="index.html">PaymentMethodsActivity</a>/<a href="on-support-navigate-up.html">onSupportNavigateUp</a></div>
<div class="cover ">
<h1 class="cover"><span>on</span><wbr><span>Support</span><wbr><span>Navigate</span><wbr><span><span>Up</span></span></h1>
</div>
<div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-depenent-content" data-active="" data-togglable=":payments-core:dokkaHtmlPartial/release"><div class="symbol monospace"><span class="token keyword">open </span><span class="token keyword">override </span><span class="token keyword">fun </span><a href="on-support-navigate-up.html"><span class="token function">onSupportNavigateUp</span></a><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html">Boolean</a><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div></div></div>
</div>
<div class="footer"><span class="go-to-top-icon"><a href="#content" id="go-to-top-link"></a></span><span>© 2022 Copyright</span><span class="pull-right"><span>Generated by </span><a href="https://github.com/Kotlin/dokka"><span>dokka</span><span class="padded-icon"></span></a></span></div>
</div>
</div>
</body></html>
| Java |
# Set up gems listed in the Gemfile.
# See: http://gembundler.com/bundler_setup.html
# http://stackoverflow.com/questions/7243486/why-do-you-need-require-bundler-setup
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
# Require gems we care about
require 'rubygems'
require 'uri'
require 'pathname'
require 'pg'
require 'active_record'
require 'logger'
require 'sinatra'
require "sinatra/reloader" if development?
require 'erb'
require 'bcrypt'
# Some helper constants for path-centric logic
APP_ROOT = Pathname.new(File.expand_path('../../', __FILE__))
APP_NAME = APP_ROOT.basename.to_s
configure do
# By default, Sinatra assumes that the root is the file that calls the configure block.
# Since this is not the case for us, we set it manually.
set :root, APP_ROOT.to_path
# See: http://www.sinatrarb.com/faq.html#sessions
enable :sessions
set :session_secret, ENV['SESSION_SECRET'] || 'this is a secret shhhhhhhhh'
# Set the views to
set :views, File.join(Sinatra::Application.root, "app", "views")
end
# Set up the controllers and helpers
Dir[APP_ROOT.join('app', 'controllers', '*.rb')].each { |file| require file }
Dir[APP_ROOT.join('app', 'helpers', '*.rb')].each { |file| require file }
# Set up the database and models
require APP_ROOT.join('config', 'database')
| Java |
#!/bin/bash
STEP=$1
TEST=$2
case "$STEP" in
install)
echo "Installing..."
if [ -d vendor ]; then
chmod 777 -R vendor
rm -r vendor
fi
COMPOSER=dev.json composer install
;;
script)
echo "Run tests...";
if [ ! -d vendor ]; then
echo "Application not installed. Tests stopped. Exit with code 1"
exit 1
fi
case "$TEST" in
unit)
echo "Run phpunit --verbose --testsuite=unit...";
php vendor/bin/phpunit --verbose --testsuite=unit
;;
phpcs)
echo "Run phpcs --encoding=utf-8 --extensions=php --standard=psr2 Okvpn/ -p...";
php vendor/bin/phpcs --encoding=utf-8 --standard=psr2 -p src
;;
esac
;;
esac
| Java |
(function(Object) {
Object.Model.Background = Object.Model.PresentationObject.extend({
"initialize" : function() {
Object.Model.PresentationObject.prototype.initialize.call(this);
}
},{
"type" : "Background",
"attributes" : _.defaults({
"skybox" : {
"type" : "res-texture",
"name" : "skybox",
"_default" : ""
},
"name" : {
"type" : "string",
"_default" : "new Background",
"name" : "name"
}
}, Object.Model.PresentationObject.attributes)
});
}(sp.module("object"))); | Java |
<div class="mini-graph clearfix">
<div class="nav"><nav><a class="breadcrumb" href="/">Offices</a> > <span>{{office}}</span></nav></div>
<h3>NYC Campaign Contributions: {{office}}</h3>
<hr>
<ul>
<li ng-click="byTotal($event)" class="chart-option active-option">Total Funds</li>
<li ng-click="byContributions($event)" class="chart-option">Contributions</li>
<li ng-click="byMatch($event)" class="chart-option">Matching Funds</li>
<li ng-click="byContributors($event)" class="chart-option">Number of Contributors</li>
</ul>
<hr>
<ul class="selected-candidates">
<li ng-repeat="candidate in selectedCandidates" id="{{candidate.id}}" class="candidate-button-selected" ng-class="addActive(candidate.id)" ng-click="removeActive($event, candidate.id, $index)">
{{candidate.name}}
</li>
</ul>
<hr>
<ul class="candidate-list">
<li ng-repeat="candidate in candidates" id="can_{{candidate.id}}" class="candidate-button" ng-click="toggleSelected($event, $index)">
{{candidate.name}}
</li>
</ul>
<div class="candidates graph-wrapper">
<svg d3="" d3-data="selectedCandidates" d3-renderer="barGraphRenderer" class="candidate-bar-graph"></svg>
</div>
<!--<hr>-->
<!--<div class="candidate-info-box" style="display: none;">-->
<!--<p class="candidate-name">{{name}}</p>-->
<!--<p class="total-contributors">{{count_contributors}} Contributors</p><a href="{{detail_link}}" title="{{name}} Details">Details</a>-->
<!--<table class="funds">-->
<!--<tr class="match-amount">-->
<!--<td>Matching Funds:</td>-->
<!--<td>{{candidate_match | currency}}</td>-->
<!--</tr>-->
<!--<tr class="contribution-amount">-->
<!--<td>Contributions Funds:</td>-->
<!--<td>{{candidate_contributions | currency}}</td>-->
<!--</tr>-->
<!--<tr class="total-amount">-->
<!--<td>Total Funds:</td>-->
<!--<td>{{candidate_total | currency}}</td>-->
<!--</tr>-->
<!--</table>-->
<!--</div>-->
<div id="candidate_info" class="candidate-info tooltip">
{{candidate_name}}<br>
{{candidate_value}}
</div>
</div> | Java |
<?php
namespace HsBundle;
use HsBundle\DependencyInjection\Compiler\ReportsCompilerPass;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class HsBundle extends Bundle
{
public function build(ContainerBuilder $container)
{
parent::build($container);
$container->addCompilerPass(new ReportsCompilerPass());
}
}
| Java |
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<link href="../style/campfire.css" rel="stylesheet">
<link href="../style/bootstrap/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="chart" id="wall"></div>
</body>
<script src="../script/campfire-wall.js" charset="utf-8"></script>
</html>
| Java |
import './Modal.scss'
import pugTpl from './Modal.pug'
import mixin from '../../mixin'
import alert from '@vue2do/component/module/Modal/alert'
import confirm from '@vue2do/component/module/Modal/confirm'
export default {
name: 'PageCompModal',
template: pugTpl(),
mixins: [mixin],
data() {
return {
testName: 'test'
}
},
methods: {
simple() {
this.$refs.simple.show()
},
alert() {
alert({
message: '这是一个警告弹窗',
theme: this.typeTheme,
ui: this.typeUI
})
},
confirm() {
confirm({
message: '这是一个确认弹窗',
title: '测试确认弹出',
theme: 'danger',
ui: 'bootstrap'
})
},
showFullPop() {
this.$refs.fullPop.show()
},
hideFullPop() {
this.$refs.fullPop.hide()
},
showPureModal() {
this.$refs.pureModal.show()
},
hidePureModal() {
this.$refs.pureModal.hide()
}
}
}
| Java |
package com.igonics.transformers.simple;
import java.io.PrintStream;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.DefaultParser;
import org.apache.commons.cli.HelpFormatter;
import org.apache.commons.cli.Options;
import org.apache.commons.cli.ParseException;
import org.relique.jdbc.csv.CsvDriver;
import com.igonics.transformers.simple.helpers.CSVDirWalker;
import com.igonics.transformers.simple.helpers.CSVLogger;
/**
* @author gggordon <https://github.com/gggordon>
* @version 1.0.0
* @description Transforms sub-directories of similar CSV files into one database file
* @created 1.11.2015
*
* */
public class JavaCSVTransform {
/**
* @param baseDir Base Directory to Check for CSV Files
* @param dbFile Database File Name or Path
* @param subDirectoryDepth Recursive Depth to check for CSV Files. -1 will recurse indefinitely
* @param keepTemporaryFile Keep Temporary Buffer File or Delete
* */
public void createCSVDatabase(String baseDir, String dbFile,int subDirectoryDepth,boolean keepTemporaryFile){
final String BASE_DIR =baseDir==null? System.getProperty("user.dir") + "\\dataFiles" : baseDir;
final String DB_FILE = dbFile==null?"DB-" + System.currentTimeMillis() + ".csv":dbFile;
long startTime = System.currentTimeMillis();
CSVLogger.info("Base Dir : " + BASE_DIR);
try {
CSVDirWalker dirWalker = new CSVDirWalker(BASE_DIR, subDirectoryDepth);
//Process Directories
dirWalker.start();
CSVLogger.debug("Column Names : " + dirWalker.getHeader());
CSVLogger.info("Temporary Buffer File Complete. Starting Database Queries");
// Writing to database
// Load the driver.
Class.forName("org.relique.jdbc.csv.CsvDriver");
// Create a connection. The first command line parameter is the directory containing the .csv files.
Connection conn = DriverManager.getConnection("jdbc:relique:csv:"
+ System.getProperty("user.dir"));
// Create a Statement object to execute the query with.
Statement stmt = conn.createStatement();
ResultSet results = stmt.executeQuery("SELECT * FROM "
+ dirWalker.getTempBufferPath().replaceAll(".csv", ""));
CSVLogger.info("Retrieved Records From Temporary File");
// Dump out the results to a CSV file with the same format
// using CsvJdbc helper function
CSVLogger.info("Writing Records to database file");
long databaseSaveStartTime = System.currentTimeMillis();
//Create redirect stream to database file
PrintStream printStream = new PrintStream(DB_FILE);
//print column headings
printStream.print(dirWalker.getHeader()+System.lineSeparator());
CsvDriver.writeToCsv(results, printStream, false);
CSVLogger.info("Time taken to save records to database (ms): "+(System.currentTimeMillis() - databaseSaveStartTime));
//delete temporary file
if(!keepTemporaryFile){
CSVLogger.info("Removing Temporary File");
dirWalker.removeTemporaryFile();
}
//Output Program Execution Completed
CSVLogger.info("Total execution time (ms) : "
+ (System.currentTimeMillis() - startTime)
+ " | Approx Size (bytes) : "
+ dirWalker.getTotalBytesRead());
} catch (Exception ioe) {
CSVLogger.error(ioe.getMessage(), ioe);
}
}
// TODO: Modularize Concepts
public static void main(String args[]) {
//Parse Command Line Options
Options opts = new Options();
HelpFormatter formatter = new HelpFormatter();
opts.addOption("d", "dir", false, "Base Directory of CSV files. Default : Current Directory");
opts.addOption("db", "database", false, "Database File Name. Default DB-{timestamp}.csv");
opts.addOption("depth", "depth", false, "Recursive Depth. Set -1 to recurse indefintely. Default : -1");
opts.addOption("keepTemp",false,"Keeps Temporary file. Default : false");
opts.addOption("h", "help", false, "Display Help");
try {
CommandLine cmd = new DefaultParser().parse(opts,args);
if(cmd.hasOption("h") || cmd.hasOption("help")){
formatter.printHelp( "javacsvtransform", opts );
return;
}
//Create CSV Database With Command Line Options or Defaults
new JavaCSVTransform().createCSVDatabase(cmd.getOptionValue("d"), cmd.getOptionValue("db"),Integer.parseInt(cmd.getOptionValue("depth", "-1")), cmd.hasOption("keepTemp"));
} catch (ParseException e) {
formatter.printHelp( "javacsvtransform", opts );
}
}
}
| Java |
require 'test_helper'
module ContentControl
class UploadsHelperTest < ActionView::TestCase
end
end
| Java |
/*
* JDIVisitor
* Copyright (C) 2014 Adrian Herrera
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package org.jdivisitor.debugger.launcher;
import java.net.InetSocketAddress;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang3.Validate;
import com.sun.jdi.Bootstrap;
import com.sun.jdi.VirtualMachine;
import com.sun.jdi.connect.AttachingConnector;
import com.sun.jdi.connect.Connector;
/**
* Attach (via a socket) to a listening virtual machine in debug mode.
*
* @author Adrian Herrera
*
*/
public class RemoteVMConnector extends VMConnector {
/**
* Socket connection details.
*/
private final InetSocketAddress socketAddress;
/**
* Constructor.
*
* @param hostname Name of the host to connect to
* @param port Port number the virtual machine is listening on
*/
public RemoteVMConnector(String hostname, int port) {
this(new InetSocketAddress(hostname, port));
}
/**
* Constructor.
*
* @param sockAddr Socket address structure to connect to.
*/
public RemoteVMConnector(InetSocketAddress sockAddr) {
socketAddress = Validate.notNull(sockAddr);
}
@Override
public VirtualMachine connect() throws Exception {
List<AttachingConnector> connectors = Bootstrap.virtualMachineManager()
.attachingConnectors();
AttachingConnector connector = findConnector(
"com.sun.jdi.SocketAttach", connectors);
Map<String, Connector.Argument> arguments = connectorArguments(connector);
VirtualMachine vm = connector.attach(arguments);
// TODO - redirect stdout and stderr?
return vm;
}
/**
* Set the socket-attaching connector's arguments.
*
* @param connector A socket-attaching connector
* @return The socket-attaching connector's arguments
*/
private Map<String, Connector.Argument> connectorArguments(
AttachingConnector connector) {
Map<String, Connector.Argument> arguments = connector
.defaultArguments();
arguments.get("hostname").setValue(socketAddress.getHostName());
arguments.get("port").setValue(
Integer.toString(socketAddress.getPort()));
return arguments;
}
}
| Java |
# The MIT License (MIT)
#
# Copyright (c) 2016 Frederic Guillot
#
# 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.
from cliff import app
from cliff import commandmanager
from pbr import version as app_version
import sys
from kanboard_cli.commands import application
from kanboard_cli.commands import project
from kanboard_cli.commands import task
from kanboard_cli import client
class KanboardShell(app.App):
def __init__(self):
super(KanboardShell, self).__init__(
description='Kanboard Command Line Client',
version=app_version.VersionInfo('kanboard_cli').version_string(),
command_manager=commandmanager.CommandManager('kanboard.cli'),
deferred_help=True)
self.client = None
self.is_super_user = True
def build_option_parser(self, description, version, argparse_kwargs=None):
parser = super(KanboardShell, self).build_option_parser(
description, version, argparse_kwargs=argparse_kwargs)
parser.add_argument(
'--url',
metavar='<api url>',
help='Kanboard API URL',
)
parser.add_argument(
'--username',
metavar='<api username>',
help='API username',
)
parser.add_argument(
'--password',
metavar='<api password>',
help='API password/token',
)
parser.add_argument(
'--auth-header',
metavar='<authentication header>',
help='API authentication header',
)
return parser
def initialize_app(self, argv):
client_manager = client.ClientManager(self.options)
self.client = client_manager.get_client()
self.is_super_user = client_manager.is_super_user()
self.command_manager.add_command('app version', application.ShowVersion)
self.command_manager.add_command('app timezone', application.ShowTimezone)
self.command_manager.add_command('project show', project.ShowProject)
self.command_manager.add_command('project list', project.ListProjects)
self.command_manager.add_command('task create', task.CreateTask)
self.command_manager.add_command('task list', task.ListTasks)
def main(argv=sys.argv[1:]):
return KanboardShell().run(argv)
if __name__ == '__main__':
sys.exit(main(sys.argv[1:]))
| Java |
<div>
<h1 class="page-header">项目详情</h1>
<form class="form-horizontal" name="project" role="form">
<div class="form-group">
<label for="projectName" class="col-sm-2 control-label">选择项目</label>
<div class="col-sm-5">
<select class="form-control" ng-model="projectName" name="projectName" id="projectName">
<option ng-repeat="project in projects | filter: filterKey">{{project.name}}</option>
</select>
</div>
<div class="col-sm-3">
<input type="text" class="form-control" name="filterKey" ng-model="filterKey" id="filterKey" placeholder="项目过滤关键词">
</div>
</div>
<div class="form-group">
<label for="id" class="col-sm-2 control-label">项目编号</label>
<div class="col-sm-5">
<input type="text" class="form-control" name="id" ng-model="tmpProject.id" id="id">
</div>
</div>
<div class="form-group">
<label for="description" class="col-sm-2 control-label">项目概要</label>
<div class="col-sm-8">
<textarea class="form-control" name="description" rows="5" cols="100" id="description" ng-model="tmpProject.description"></textarea>
</div>
</div>
<div class="form-group">
<label for="parent" class="col-sm-2 control-label">隶属父项目</label>
<div class="col-sm-5">
<select class="form-control" ng-disabled="parentReadonly" ng-model="tmpProject.parent" name="parent" id="parent">
<option value="">无</option>
<option ng-repeat="project in parentProjects">{{project.name}}</option>
</select>
</div>
<div class="col-sm-3" ng-show="parentReadonly">
<button class="btn btn-default btn-block" ng-click="editParent()">修改父项目</button>
</div>
<div class="col-sm-3" ng-hide="parentReadonly">
<input type="text" class="form-control" name="filterParentKey" ng-model="filterParentKey" id="filterParentKey" placeholder="项目过滤关键词">
</div>
</div>
<div class="form-group">
<label for="children" class="col-sm-2 control-label">包含子项目</label>
<div class="col-sm-5">
<textarea class="form-control" readonly name="children" rows="5" cols="100" id="children">{{tmpProject.children.join('\n')}}</textarea>
</div>
<div class="col-sm-3">
<!-- 用于打开模式对话框 -->
<button type="button" class="btn btn-default btn-block" data-toggle="modal" data-target="#projectList">
修改子项目
<span class="caret"></span>
</button>
</div>
</div>
<!-- 选择子项目模式对话框 -->
<div class="modal fade" id="projectList" tabindex="-1" role="dialog" aria-labelledby="projectListLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" ng-click="cancelSelection()" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
<div class="col-sm-6 col-sm-offset-2 text-center" id="projectListLabel">
<h4><strong>项目列表</strong></h4>
</div>
<div class="col-sm-3">
<input type="text" class="form-control" ng-model="childrenFilterKey" placeholder="项目过滤关键词">
</div>
<div><br></div>
</div>
<div class="modal-body">
<div class="col-sm-4" ng-repeat="project in projectsRaw | filter: childrenFilterKey">
<label><input type="checkbox" ng-model="childrenProject[project.name]"> {{project.name}}</label>
</div>
</div>
<div class="modal-footer">
<div class="col-sm-2 col-sm-offset-8">
<button type="button" class="btn btn-success btn-block" data-dismiss="modal" ng-click="selectChildren()">确 定</button>
</div>
<div class="col-sm-2">
<button type="button" class="btn btn-primary btn-block" data-dismiss="modal" ng-click="cancelSelection()">取 消</button>
</div>
</div>
</div>
</div>
</div>
<!-- 子项目模式对话框结束 -->
<!--
<div class="form-group">
<label class="col-sm-2 control-label">项目合同</label>
<div class="col-sm-9">
<div class="panel panel-default">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>序号</th>
<th>合同名称</th>
<th>原件存放位置</th>
<th>编辑</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="contract in currentProject().contract">
<td>{{$index}}</td>
<td>{{tmpProject.contract.name}}</td>
<td>{{tmpProject.contract.store}}</td>
<td>
<span ng-click="modify($event)" class="glyphicon glyphicon-pencil"></span>
<span ng-click="confirm($event)" class="glyphicon glyphicon-ok"></span>
<span ng-click="remove($event)" class="glyphicon glyphicon-remove"></span>
</td>
</tr>
<tr>
<td> --</td>
<td></td>
<td></td>
<td>
<span ng-click="modify($event)" class="glyphicon glyphicon-pencil"></span>
<span ng-click="confirm($event)" class="glyphicon glyphicon-ok"></span>
<span ng-click="remove($event)" class="glyphicon glyphicon-remove"></span>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">项目文件</label>
<div class="col-sm-9">
<div class="panel panel-default">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>序号</th>
<th>文件名称</th>
<th>原件存放位置</th>
<th>编辑</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="file in currentProject().file">
<td>{{$index}}</td>
<td>{{tmpProject.file.name}}</td>
<td>{{tmpProject.file.store}}</td>
<td>
<span ng-click="modify($event)" class="glyphicon glyphicon-pencil"></span>
<span ng-click="confirm($event)" class="glyphicon glyphicon-ok"></span>
<span ng-click="remove($event)" class="glyphicon glyphicon-remove"></span>
</td>
</tr>
<tr>
<td> --</td>
<td></td>
<td></td>
<td>
<span ng-click="modify($event)" class="glyphicon glyphicon-pencil"></span>
<span ng-click="confirm($event)" class="glyphicon glyphicon-ok"></span>
<span ng-click="remove($event)" class="glyphicon glyphicon-remove"></span>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
-->
</form>
<div class="col-sm-12">
<div class="col-sm-3 col-sm-offset-3">
<button type="button" class="btn btn-success btn-block" data-dismiss="modal" ng-click="confirmModify()">确认修改</button>
</div>
<div class="col-sm-3">
<button type="button" class="btn btn-primary btn-block" data-dismiss="modal" ng-click="cancelModify()">取消修改</button>
</div>
</div>
<div class="col-md-8 col-md-offset-2" ng-show="message">
<div ng-class="msgClass" class="alert text-center" role="alert">
<strong >{{message}}</strong>
</div>
</div>
<div><br></div>
</div> | Java |
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace cShART
{
public class ARTFlystick : ARTObject
{
private bool visible;
private int numberOfButtons;
private int numberOfControllers;
private int buttonStates;
private float[] controllerStates;
public static ARTFlystick Empty()
{
return new ARTFlystick(-1, false, 0, 0, 0, new float[0], ARTPoint.Empty(), ARTMatrix.Empty());
}
public ARTFlystick(int id, bool visible, int numberOfButtons, int buttonStates, int numberOfControllers, float[] controllerStates, ARTPoint position, ARTMatrix matrix) : base(id, position, matrix)
{
this.visible = visible;
this.numberOfButtons = numberOfButtons;
this.numberOfControllers = numberOfControllers;
this.buttonStates = buttonStates;
this.controllerStates = controllerStates;
}
public bool isVisible()
{
return this.visible;
}
public int getNumberOfButtons()
{
return this.numberOfButtons;
}
public int getNumberOfControllers()
{
return this.numberOfControllers;
}
public int getButtonStates()
{
return this.buttonStates;
}
/// <summary>
/// This Method translates the button states integer into actual english for better handling.
/// (aka tells you which button is currently pushed.) Useful for debugging.
/// </summary>
/// <returns>Returns a string containing names of pushed buttons</returns>
public String getPushedButtonsByName()
{
//Byte binBStates = Convert.ToByte(buttonStates);
// BitArray BA = new BitArray(binBStates);
//int[] StatesArray = new int[]{buttonStates};
//Array.Reverse(StatesArray);
BitArray binBStates = new BitArray(new int[]{buttonStates});
String output = "";
//byte[] binBStates = BitConverter.GetBytes(buttonStates);
if (binBStates[3])
{
output = output + "LeftButton";
}
if (binBStates[2])
{
if (!output.Equals(""))
{
output = output + "/";
}
output = output + "MiddleButton";
}
if (binBStates[1])
{
if (!output.Equals(""))
{
output = output + "/";
}
output = output + "RightButton";
}
if (binBStates[0])
{
if (!output.Equals(""))
{
output = output + "/";
}
output = output + "Trigger";
}
if (output == "")
{
output = "NothingPressed";
}
return output + " Byte: " + binBStates.ToString();
}
/// <summary>
/// This method is for further button handling of the flystick. You will receive a bit array which represents the currently pushed buttons.
/// Array value and corresponding buttons are:
/// [0] = Trigger
/// [1] = Right button
/// [2] = Middle button
/// [3] = Left button
/// </summary>
/// <returns>Returns a bit array represting currently pushed buttons</returns>
public BitArray GetStateArrayOfButtons()
{
return new BitArray(new int[]{buttonStates});
}
public float[] GetStickXYPos()
{
return this.controllerStates;
}
override protected String nameToString()
{
return "ARTFlystick";
}
protected String controllerStatesToString()
{
String res = "";
for (int i = 0; i < this.controllerStates.Length; i++)
{
res = res + this.controllerStates[i];
if (i + 1 < this.controllerStates.Length)
{
res = res + ", ";
}
}
return res;
}
override protected String extensionsToString()
{
return "isVisible: " + isVisible() + Environment.NewLine + "numberOfButtons: " + getNumberOfButtons() + ", buttonStates: " + getButtonStates() + Environment.NewLine + "numberOfControllers: " + getNumberOfControllers() + ", controllerStates: " + controllerStatesToString() + Environment.NewLine;
}
}
}
| Java |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>PruneCluster - Realworld 50k</title>
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, target-densitydpi=device-dpi" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.0.0-beta.2.rc.2/leaflet.css"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.0.0-beta.2.rc.2/leaflet.js"></script>
<script src="../dist/PruneCluster.js"></script>
<link rel="stylesheet" href="examples.css"/>
</head>
<body>
<div id="map"></div>
<script>
var map = L.map("map", {
attributionControl: false,
zoomControl: false
}).setView(new L.LatLng(59.911111, 10.752778), 15);
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
detectRetina: true,
maxNativeZoom: 17
}).addTo(map);
var leafletView = new PruneClusterForLeaflet();
var size = 1000;
var markers = [];
for (var i = 0; i < size; ++i) {
var marker = new PruneCluster.Marker(59.91111 + (Math.random() - 0.5) * Math.random() * 0.00001 * size, 10.752778 + (Math.random() - 0.5) * Math.random() * 0.00002 * size);
markers.push(marker);
leafletView.RegisterMarker(marker);
}
window.setInterval(function () {
for (i = 0; i < size / 2; ++i) {
var coef = i < size / 8 ? 10 : 1;
var ll = markers[i].position;
ll.lat += (Math.random() - 0.5) * 0.00001 * coef;
ll.lng += (Math.random() - 0.5) * 0.00002 * coef;
}
leafletView.ProcessView();
}, 500);
map.addLayer(leafletView);
</script>
</body>
</html>
| Java |
using System;
using System.Text.RegularExpressions;
namespace _07_Hideout
{
class Hideout
{
static void Main()
{
string input = Console.ReadLine();
while (true)
{
string[] parameters = Console.ReadLine().Split();
string key = Regex.Escape(parameters[0]);
string pattern = @"(" + key + "{" + parameters[1] + ",})";
Regex r = new Regex(pattern);
Match match = r.Match(input);
if (match.Success)
{
Console.WriteLine("Hideout found at index {0} and it is with size {1}!", match.Index, match.Groups[0].Length);
break;
}
}
}
}
}
| Java |
using System.ComponentModel.DataAnnotations;
namespace JezekT.AspNetCore.IdentityServer4.WebApp.Models.AccountSettingsViewModels
{
public class ConfirmEmailViewModel
{
[Display(Name = "Email", ResourceType = typeof(Resources.Models.AccountSettingsViewModels.ConfirmEmailViewModel))]
public string Email { get; set; }
}
}
| Java |
require "rails_helper"
describe "announcements/_public_announcement" do
it "renders nothing when announcements are not visible" do
allow(view).to receive(:announcement_visible?).and_return(false)
render
expect(rendered).to eq ""
end
it "renders the announcement when announcements are visible" do
announcement = create :announcement, body: "Test"
allow(view).to receive(:announcement_visible?).and_return(true)
render
expect(rendered).to match /Test/
expect(rendered).to match /#{announcement.to_cookie_key}/
expect(rendered).to match /hideAnnouncement/
end
end
| Java |
var a;function SongView(){ListView.call(this);this.name="SongView";this.allDataLoaded=this.songsLoaded=false;this.sortVariable="bezeichnung"}Temp.prototype=ListView.prototype;SongView.prototype=new Temp;songView=new SongView;a=SongView.prototype;
a.getData=function(d){if(d){var c=[];allSongs!=null&&$.each(churchcore_sortData(allSongs,"bezeichnung"),function(b,e){$.each(e.arrangement,function(f,g){f=[];f.song_id=e.id;f.arrangement_id=g.id;f.id=e.id+"_"+g.id;c.push(f)})})}else{c={};allSongs!=null&&$.each(allSongs,function(b,e){$.each(e.arrangement,function(f,g){f=[];f.song_id=e.id;f.arrangement_id=g.id;f.id=e.id+"_"+g.id;c[f.id]=f})})}return c};
a.renderFilter=function(){if(masterData.settings.filterSongcategory==""||masterData.settings.filterSongcategory==null)delete masterData.settings.filterSongcategory;else this.filter.filterSongcategory=masterData.settings.filterSongcategory;var d=[],c=new CC_Form;c.setHelp("ChurchService-Filter");c.addHtml('<div id="filterKategorien"></div>');c.addSelect({data:this.sortMasterData(masterData.songcategory),label:"Song-Kategorien",selected:this.filter.filterSongcategory,freeoption:true,cssid:"filterSongcategory",
type:"medium",func:function(b){return masterData.auth.viewsongcategory!=null&&masterData.auth.viewsongcategory[b.id]}});c.addCheckbox({cssid:"searchStandard",label:"Nur Standard-Arrangement"});d.push(c.render(true));d.push('<div id="cdb_filtercover"></div>');$("#cdb_filter").html(d.join(""));$.each(this.filter,function(b,e){$("#"+b).val(e)});filter=this.filter;this.implantStandardFilterCallbacks(this,"cdb_filter");this.renderCalendar()};
a.groupingFunction=function(d){if(this.filter.searchStandard==null){var c="";c=c+"<b>"+allSongs[d.song_id].bezeichnung+"</b>";if(allSongs[d.song_id].author!="")c=c+" <small>"+allSongs[d.song_id].author+"</small>";return c=c+' <a href="#" class="edit-song" data-id="'+d.song_id+'">'+form_renderImage({src:"options.png",width:16})+"</a>"}else return null};
a.checkFilter=function(d){if(d==null)return false;var c=allSongs[d.song_id],b=c.arrangement[d.arrangement_id];if(songView.filter!=null){var e=songView.filter;if(e.searchEntry!=null&&c.bezeichnung.toLowerCase().indexOf(e.searchEntry.toLowerCase())==-1&&e.searchEntry!=d.arrangement_id)return false;if(e.filterSongcategory!=null&&c.songcategory_id!=e.filterSongcategory)return false;if(!churchcore_inArray(c.songcategory_id,masterData.auth.viewsongcategory))return false;if(e.searchStandard&&b.default_yn==
0)return false}return true};a.renderTooltip=function(d,c){var b=d.parents("div.entrydetail").attr("data-song-id"),e=d.parent().attr("data-id"),f=d.attr("tooltip");return this.renderTooltipForFiles(d,c,allSongs[b].arrangement[e].files[f],masterData.auth.editsong)};a.tooltipCallback=function(d,c){var b=c.parents("div.entrydetail").attr("data-song-id"),e=c.parent().attr("data-id");return this.tooltipCallbackForFiles(d,c,allSongs[b].arrangement,e)};
a.renderFiles=function(d,c){var b=this;b.clearTooltip(true);masterData.auth.editsong?b.renderFilelist("",d,c,function(e){delete d[c].files[e];b.renderFiles(d,c)}):b.renderFilelist("",d,c);$("div.filelist[data-id="+c+"] span[tooltip],a[tooltip]").hover(function(){drin=true;this_object.prepareTooltip($(this),null,$(this).attr("data-tooltiptype"))},function(){drin=false;window.setTimeout(function(){drin||this_object.clearTooltip()},100)})};
a.renderEntryDetail=function(d){var c=this,b=d.indexOf("_"),e=allSongs[d.substr(0,b)],f=e.arrangement[d.substr(b+1,99)];b=[];b.push('<div class="entrydetail" id="entrydetail_'+d+'" data-song-id="'+e.id+'" data-arrangement-id="'+f.id+'">');b.push('<div class="well">');b.push('<b style="font-size:140%">'+e.bezeichnung+" - "+f.bezeichnung+"</b>");e.autor!=""&&b.push("<br/><small>Autor: "+e.author+"</small>");e.copyright!=""&&b.push("<br/><small>Copyright: "+e.copyright+"</small>");e.ccli!=""&&b.push("<br/><small>CCLI: "+
e.ccli+"</small>");b.push("</div>");b.push('<div class="row-fluid">');b.push('<div class="span6">');b.push("<legend>Informationen ");masterData.auth.editsong&&b.push('<a href="#" class="edit">'+c.renderImage("options",20)+"</a>");b.push("</legend>");b.push("<p>Tonart: "+f.tonality);b.push(" BPM: "+f.bpm);b.push(" Takt: "+f.beat);b.push("<p>Länge: "+f.length_min+":"+f.length_sec);b.push("<p>Bemerkung:<br/><p><small> "+f.note.replace(/\n/g,"<br/>")+"</small>");b.push("</div>");
b.push('<div class="span6">');b.push("<legend>Dateien</legend>");b.push('<div class="we_ll">');b.push('<div class="filelist" data-id="'+f.id+'"></div>');masterData.auth.editsong&&b.push('<p><div id="upload_button_'+f.id+'">Nochmal bitte...</div>');b.push("</div>");b.push("</div>");b.push("</div>");if(masterData.auth.editsong){b.push("<hr/><p>");b.push(form_renderButton({label:"Weiteres Arrangement hinzufügen",htmlclass:"add",type:"small"})+" ");if(f.default_yn==0){b.push(form_renderButton({label:"Zum Standard machen",
htmlclass:"makestandard",type:"small"})+" ");b.push(form_renderButton({label:"Arrangement entfernen",htmlclass:"delete",type:"small"})+" ")}}b.push("</div>");$("tr[id="+d+"]").after('<tr id="detail'+d+'"><td colspan="7" id="detailTD'+d+'">'+b.join("")+"</td></tr>");c.renderFiles(allSongs[e.id].arrangement,f.id);masterData.auth.editsong&&new qq.FileUploader({element:document.getElementById("upload_button_"+f.id),action:"?q=churchservice/uploadfile",params:{domain_type:"song_arrangement",
domain_id:f.id},multiple:true,debug:true,onSubmit:function(){},onComplete:function(g,i,h){if(h.success){if(f.files==null)f.files={};f.files[h.id]={bezeichnung:h.bezeichnung,filename:h.filename,id:h.id,domain_type:"song_arrangement",domain_id:f.id};c.renderFiles(allSongs[e.id].arrangement,f.id)}else alert("Sorry, Fehler beim Hochladen aufgetreten! Datei zu gross oder Dateiname schon vergeben?")}});$("td[id=detailTD"+d+"] a.edit").click(function(){c.editArrangement(e.id,f.id);return false});$("td[id=detailTD"+
d+"] input.add").click(function(){c.addArrangement(e.id);return false});$("td[id=detailTD"+d+"] input.delete").click(function(){c.deleteArrangement(e.id,f.id);return false});$("td[id=detailTD"+d+"] input.makestandard").click(function(){c.makeAsStandardArrangement(e.id,f.id);return false})};a.loadSongData=function(){if(!this.songsLoaded&&this.allDataLoaded){var d=this.showDialog("Lade Songs","Lade Songs...",300,300);cs_loadSongs(function(){this_object.songsLoaded=true;d.dialog("close");this_object.renderList()})}};
a.renderMenu=function(){this_object=this;menu=new CC_Menu("Menü");masterData.auth.editsong&&menu.addEntry("Neuen Song anlegen","anewentry","star");menu.renderDiv("cdb_menu",churchcore_handyformat())?$("#cdb_menu a").click(function(){if($(this).attr("id")=="anewentry")this_object.renderAddEntry();else $(this).attr("id")=="ahelp"&&churchcore_openNewWindow("http://intern.churchtools.de/?q=help&doc=ChurchService");return false}):$("#cdb_menu").hide()};
a.editSong=function(d){var c=this,b=new CC_Form("Infos des Songs",allSongs[d]);b.addInput({label:"Bezeichnung",cssid:"bezeichnung",required:true,disabled:!masterData.auth.editsong});b.addSelect({label:"Song-Kategorie",cssid:"songcategory_id",data:masterData.songcategory,disabled:!masterData.auth.editsong});b.addInput({label:"Autor",cssid:"author",disabled:!masterData.auth.editsong});b.addInput({label:"Copyright",cssid:"copyright",disabled:!masterData.auth.editsong});b.addInput({label:"CCLI-Nummer",
cssid:"ccli",disabled:!masterData.auth.editsong});var e=form_showDialog("Song editieren",b.render(false,"horizontal"),500,500);masterData.auth.editsong&&e.dialog("addbutton","Speichern",function(){obj=b.getAllValsAsObject();if(obj!=null){obj.func="editSong";obj.id=d;churchInterface.jsendWrite(obj,function(){c.songsLoaded=false;c.loadSongData()});$(this).dialog("close")}});e.dialog("addbutton","Abbrechen",function(){$(this).dialog("close")})};
a.renderAddEntry=function(){var d=this,c=new CC_Form("Bitte Infos des neuen Songs angeben");c.addInput({label:"Bezeichnung",cssid:"bezeichnung",required:true});c.addSelect({label:"Song-Kategorie",cssid:"songcategory_id",required:true,data:masterData.songcategory,selected:masterData.settings.filterSongcategory});c.addInput({label:"Autor",cssid:"author"});c.addInput({label:"Copyright",cssid:"copyright"});c.addInput({label:"CCLI-Nummer",cssid:"ccli"});c.addInput({label:"Tonart",type:"small",cssid:"tonality"});
c.addInput({label:"BPM",type:"small",cssid:"bpm"});c.addInput({label:"Takt",type:"small",cssid:"beat"});form_showDialog("Neuen Song anlegen",c.render(false,"horizontal"),500,500,{Erstellen:function(){var b=c.getAllValsAsObject();if(b!=null){b.func="addNewSong";churchInterface.jsendWrite(b,function(){d.songsLoaded=false;d.filter.searchEntry=b.bezeichnung;if(d.filter.filterSongcategory!=b.songcategory_id){delete d.filter.filterSongcategory;delete masterData.settings.filterSongcategory}d.renderFilter();
d.loadSongData()});$(this).dialog("close")}},Abbrechen:function(){$(this).dialog("close")}})};function processFieldInput(d,c){var b=d.parents("td").attr("data-oldval");d.parents("td").removeAttr("data-oldval");if(c){newval=d.val();d.parents("td").html(newval)}else d.parents("td").html(b)}a=SongView.prototype;a.addFurtherListCallbacks=function(){var d=this;$("#cdb_content a.edit-song").click(function(){d.editSong($(this).attr("data-id"));return false})};
a.editArrangement=function(d,c){var b=this,e=new CC_Form("Bitte Arrangement anpassen",allSongs[d].arrangement[c]);e.addInput({label:"Bezeichnung",cssid:"bezeichnung",required:true});e.addInput({label:"Tonart",cssid:"tonality"});e.addInput({label:"BPM",cssid:"bpm"});e.addInput({label:"Takt",cssid:"beat"});e.addInput({label:"Länge Minuten:Sekunden",type:"mini",cssid:"length_min",controlgroup_start:true});e.addHtml(" : ");e.addInput({controlgroup_end:true,type:"mini",cssid:"length_sec"});e.addTextarea({label:"Bemerkungen",
rows:3,cssid:"note"});form_showDialog("Arrangement editieren",e.render(false,"horizontal"),500,500,{Absenden:function(){obj=e.getAllValsAsObject();if(obj!=null){obj.func="editArrangement";obj.id=c;churchInterface.jsendWrite(obj,function(){b.songsLoaded=false;b.loadSongData()});$(this).dialog("close")}},Abbrechen:function(){$(this).dialog("close")}})};
a.deleteArrangement=function(d,c){var b=this,e=allSongs[d].arrangement[c];if(e.files!=null){alert("Bitte zuerst die Dateien entfernen!");return null}if(confirm("Wirklich Arrangement "+e.bezeichnung+" entfernen?")){e={};e.func="delArrangement";e.song_id=d;e.id=c;churchInterface.jsendWrite(e,function(){b.songsLoaded=false;b.loadSongData()})}};
a.makeAsStandardArrangement=function(d,c){var b=this,e={};e.func="makeAsStandardArrangement";e.id=c;e.song_id=d;churchInterface.jsendWrite(e,function(){b.songsLoaded=false;b.loadSongData()})};a.addArrangement=function(d){var c=this,b={};b.func="addArrangement";b.song_id=d;b.bezeichnung="Neues Arrangement";churchInterface.jsendWrite(b,function(e,f){c.songsLoaded=false;c.open=true;c.filter.searchEntry=f;c.renderFilter();c.loadSongData()})};a.getCountCols=function(){return 6};
a.getListHeader=function(){this.loadSongData();var d=[];songView.listViewTableHeight=masterData.settings.listViewTableHeight==0?null:665;this.filter.searchStandard!=null&&d.push("<th>Nr.");d.push("<th>Bezeichnung<th>Tonart<th>BPM<th>Takt<th>Tags");return d.join("")};
a.renderListEntry=function(d){var c=[],b=allSongs[d.song_id],e=b.arrangement[d.arrangement_id];if(this.filter.searchStandard==null){c.push('<td><a href="#" id="detail'+d.id+'">'+e.bezeichnung+"</a>");e.default_yn==1&&c.push(" *")}else{c.push('<td><a href="#" id="detail'+d.id+'">'+b.bezeichnung+"</a>");masterData.auth.editsong!=null&&c.push(' <a href="#" class="edit-song" data-id="'+d.song_id+'">'+form_renderImage({src:"options.png",width:16})+"</a>")}c.push("<td>"+e.tonality);c.push("<td>"+
e.bpm);c.push("<td>"+e.beat);c.push("<td>");return c.join("")};a.messageReceiver=function(d,c){if(d=="allDataLoaded"){this.allDataLoaded=true;this==churchInterface.getCurrentView()&&this.loadSongData()}this==churchInterface.getCurrentView()&&d=="allDataLoaded"&&this.renderList();if(d=="filterChanged")if(c[0]=="filterSongcategory"){masterData.settings.filterSongcategory=$("#filterSongcategory").val();churchInterface.jsonWrite({func:"saveSetting",sub:"filterSongcategory",val:masterData.settings.filterSongcategory})}};
a.addSecondMenu=function(){return""};
| Java |
"use strict";
var i = 180; //3分固定
function count(){
if(i <= 0){
document.getElementById("output").innerHTML = "完成!";
}else{
document.getElementById("output").innerHTML = i + "s";
}
i -= 1;
}
window.onload = function(){
setInterval("count()", 1000);
}; | Java |
class IE
@private
def ie_config
@client = Selenium::WebDriver::Remote::Http::Default.new
@client.read_timeout = 120
@caps = Selenium::WebDriver::Remote::Capabilities.ie('ie.ensureCleanSession' => true,
:javascript_enabled => true,
:http_client => @client,
:native_events => false,
:acceptSslCerts => true)
end
@private
def set_ie_config(driver)
driver.manage.timeouts.implicit_wait = 90
driver.manage.timeouts.page_load = 120
if ENV['RESOLUTION'].nil?
driver.manage.window.size = Selenium::WebDriver::Dimension.new(1366,768)
elsif ENV['RESOLUTION'].downcase == "max"
driver.manage.window.maximize
else
res = ENV['RESOLUTION'].split('x')
driver.manage.window.size = Selenium::WebDriver::Dimension.new(res.first.to_i, res.last.to_i)
end
end
def launch_driver_ie
self.ie_config
driver = Selenium::WebDriver.for(:ie,
:desired_capabilities => @caps,
:http_client => @client)
self.set_ie_config(driver)
return driver
end
def launch_watir_ie
self.ie_config
browser = Watir::Browser.new(:ie,
:desired_capabilities => @caps,
:http_client => @client)
self.set_ie_config(browser.driver)
return browser
end
end | Java |
#include <fstream>
#include <iostream>
#include <vector>
int main(int argc, char **argv) {
std::vector<std::string> args(argv, argv + argc);
std::ofstream tty;
tty.open("/dev/tty");
if (args.size() <= 1 || (args.size() & 2) == 1) {
std::cerr << "usage: maplabel [devlocal remote]... remotedir\n";
return 1;
}
std::string curdir = args[args.size() - 1];
for (size_t i = 1; i + 1 < args.size(); i += 2) {
if (curdir.find(args[i + 1]) == 0) {
if ((curdir.size() > args[i + 1].size() &&
curdir[args[i + 1].size()] == '/') ||
curdir.size() == args[i + 1].size()) {
tty << "\033];" << args[i] + curdir.substr(args[i + 1].size())
<< "\007\n";
return 0;
}
}
}
tty << "\033];" << curdir << "\007\n";
return 0;
}
| Java |
package com.catsprogrammer.catsfourthv;
/**
* Created by C on 2016-09-14.
*/
public class MatrixCalculator {
public static float[] getRotationMatrixFromOrientation(float[] o) {
float[] xM = new float[9];
float[] yM = new float[9];
float[] zM = new float[9];
float sinX = (float) Math.sin(o[1]);
float cosX = (float) Math.cos(o[1]);
float sinY = (float) Math.sin(o[2]);
float cosY = (float) Math.cos(o[2]);
float sinZ = (float) Math.sin(o[0]);
float cosZ = (float) Math.cos(o[0]);
// rotation about x-axis (pitch)
xM[0] = 1.0f;
xM[1] = 0.0f;
xM[2] = 0.0f;
xM[3] = 0.0f;
xM[4] = cosX;
xM[5] = sinX;
xM[6] = 0.0f;
xM[7] = -sinX;
xM[8] = cosX;
// rotation about y-axis (roll)
yM[0] = cosY;
yM[1] = 0.0f;
yM[2] = sinY;
yM[3] = 0.0f;
yM[4] = 1.0f;
yM[5] = 0.0f;
yM[6] = -sinY;
yM[7] = 0.0f;
yM[8] = cosY;
// rotation about z-axis (azimuth)
zM[0] = cosZ;
zM[1] = sinZ;
zM[2] = 0.0f;
zM[3] = -sinZ;
zM[4] = cosZ;
zM[5] = 0.0f;
zM[6] = 0.0f;
zM[7] = 0.0f;
zM[8] = 1.0f;
// rotation order is y, x, z (roll, pitch, azimuth)
float[] resultMatrix = matrixMultiplication(xM, yM);
resultMatrix = matrixMultiplication(zM, resultMatrix); //????????????????왜?????????????
return resultMatrix;
}
public static float[] matrixMultiplication(float[] A, float[] B) {
float[] result = new float[9];
result[0] = A[0] * B[0] + A[1] * B[3] + A[2] * B[6];
result[1] = A[0] * B[1] + A[1] * B[4] + A[2] * B[7];
result[2] = A[0] * B[2] + A[1] * B[5] + A[2] * B[8];
result[3] = A[3] * B[0] + A[4] * B[3] + A[5] * B[6];
result[4] = A[3] * B[1] + A[4] * B[4] + A[5] * B[7];
result[5] = A[3] * B[2] + A[4] * B[5] + A[5] * B[8];
result[6] = A[6] * B[0] + A[7] * B[3] + A[8] * B[6];
result[7] = A[6] * B[1] + A[7] * B[4] + A[8] * B[7];
result[8] = A[6] * B[2] + A[7] * B[5] + A[8] * B[8];
return result;
}
}
| Java |
default_app_config = "gallery.apps.GalleryConfig"
| Java |
import { browser, by, element } from 'protractor';
export class Angular2Page {
navigateTo() {
return browser.get('/');
}
getParagraphText() {
return element(by.css('app-root h1')).getText();
}
}
| Java |
<!-- START LEFT SIDEBAR NAV-->
<?php
$role = "";
switch($this->session->userdata('ROLE_ID')){
case 1:
$role = "Administrator";
break;
case 2:
$role = "Adopting Parent";
break;
case 3:
$role = "Biological Parent/Guardian";
break;
}
?>
<aside id="left-sidebar-nav">
<ul id="slide-out" class="side-nav fixed leftside-navigation">
<li class="user-details cyan darken-2">
<div class="row">
<div class="col col s4 m4 l4">
<img src="<?=base_url();?>assets/images/profile.png" alt="" class="circle responsive-img valign profile-image">
</div>
<div class="col col s8 m8 l8">
<a class="btn-flat dropdown-button waves-effect waves-light white-text profile-btn" href="#" data-activates="profile-dropdown"><?=$this->session->userdata('NAME');?></a>
<p class="user-roal"><?=$role;?></p>
</div>
</div>
</li>
<li class="bold"><a href="<?=base_url();?>front/adopting_parent" class="waves-effect waves-cyan"><i class="mdi-action-dashboard"></i> Dashboard</a>
</li>
<li class="bold"><a href="<?=base_url();?>front/personal_details" class="waves-effect waves-cyan"><i class="mdi-content-content-paste"></i> Personal Details</a>
</li>
<li class="bold"><a href="<?=base_url();?>front/search_child" class="waves-effect waves-cyan"><i class="mdi-action-search"></i> Search Child</a>
</li>
<li class="no-padding">
<ul class="collapsible collapsible-accordion">
<li class="bold"><a class="collapsible-header waves-effect waves-cyan"><i class="mdi-communication-chat"></i> Meetings</a>
<div class="collapsible-body">
<ul>
<li><a href="<?=base_url();?>front/search_child">Setup a Meeting</a>
</li>
<li><a href="<?=base_url();?>front/past_meetings">Past Meetings</a>
</li>
</ul>
</div>
</li>
<li class="bold"><a class="collapsible-header waves-effect waves-cyan"><i class="mdi-editor-vertical-align-bottom"></i> Adoption</a>
<div class="collapsible-body">
<ul>
<li><a href="<?=base_url();?>front/adoption">Create Request</a>
</li>
<li><a href="<?=base_url();?>front/past_adoptions">Past Requests</a>
</li>
</ul>
</div>
</li>
</ul>
</li>
</ul>
</aside>
<!-- END LEFT SIDEBAR NAV--> | Java |
package es.sandbox.ui.messages.argument;
import es.sandbox.ui.messages.resolver.MessageResolver;
import es.sandbox.ui.messages.resolver.Resolvable;
import java.util.ArrayList;
import java.util.List;
class LinkArgument implements Link, Resolvable {
private static final String LINK_FORMAT = "<a href=\"%s\" title=\"%s\" class=\"%s\">%s</a>";
private static final String LINK_FORMAT_WITHOUT_CSS_CLASS = "<a href=\"%s\" title=\"%s\">%s</a>";
private String url;
private Text text;
private String cssClass;
public LinkArgument(String url) {
url(url);
}
private void assertThatUrlIsValid(String url) {
if (url == null) {
throw new NullPointerException("Link url can't be null");
}
if (url.trim().isEmpty()) {
throw new IllegalArgumentException("Link url can't be empty");
}
}
@Override
public LinkArgument url(String url) {
assertThatUrlIsValid(url);
this.url = url;
return this;
}
@Override
public LinkArgument title(Text text) {
this.text = text;
return this;
}
@Override
public LinkArgument title(String code, Object... arguments) {
this.text = new TextArgument(code, arguments);
return this;
}
@Override
public LinkArgument cssClass(String cssClass) {
this.cssClass = trimToNull(cssClass);
return this;
}
private static final String trimToNull(final String theString) {
if (theString == null) {
return null;
}
final String trimmed = theString.trim();
return trimmed.isEmpty() ? null : trimmed;
}
@Override
public String resolve(MessageResolver messageResolver) {
MessageResolver.assertThatIsNotNull(messageResolver);
return String.format(linkFormat(), arguments(messageResolver));
}
private String linkFormat() {
return this.cssClass == null ? LINK_FORMAT_WITHOUT_CSS_CLASS : LINK_FORMAT;
}
private Object[] arguments(MessageResolver messageResolver) {
final List<Object> arguments = new ArrayList<Object>();
final String title = resolveTitle(messageResolver);
arguments.add(this.url);
arguments.add(title == null ? this.url : title);
if (this.cssClass != null) {
arguments.add(this.cssClass);
}
arguments.add(title == null ? this.url : title);
return arguments.toArray(new Object[0]);
}
private String resolveTitle(MessageResolver messageResolver) {
return trimToNull(this.text == null ? null : ((Resolvable) this.text).resolve(messageResolver));
}
@Override
public String toString() {
return String.format("link{%s, %s, %s}", this.url, this.text, this.cssClass);
}
}
| Java |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os, sys
import tempfile
from winsys._compat import unittest
import uuid
import win32file
from winsys.tests.test_fs import utils
from winsys import fs
class TestFS (unittest.TestCase):
filenames = ["%d" % i for i in range (5)]
def setUp (self):
utils.mktemp ()
for filename in self.filenames:
with open (os.path.join (utils.TEST_ROOT, filename), "w"):
pass
def tearDown (self):
utils.rmtemp ()
def test_glob (self):
import glob
pattern = os.path.join (utils.TEST_ROOT, "*")
self.assertEquals (list (fs.glob (pattern)), glob.glob (pattern))
def test_listdir (self):
import os
fs_version = list (fs.listdir (utils.TEST_ROOT))
os_version = os.listdir (utils.TEST_ROOT)
self.assertEquals (fs_version, os_version, "%s differs from %s" % (fs_version, os_version))
#
# All the other module-level functions are hand-offs
# to the corresponding Entry methods.
#
if __name__ == "__main__":
unittest.main ()
if sys.stdout.isatty (): raw_input ("Press enter...")
| Java |
/*
Copyright 2011 Google Inc.
Modifications Copyright (c) 2014 Simon Zimmermann
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.
*/
package blob
import (
"io"
)
// Fetcher is the minimal interface for retrieving a blob from storage.
// The full storage interface is blobserver.Storage.
type Fetcher interface {
// Fetch returns a blob. If the blob is not found then
// os.ErrNotExist should be returned for the error (not a wrapped
// error with a ErrNotExist inside)
//
// The caller should close blob.
Fetch(Ref) (blob io.ReadCloser, size uint32, err error)
}
| Java |
module HTMLValidationHelpers
def bad_html
'<html><title>the title<title></head><body><p>blah blah</body></html>'
end
def good_html
html_5_doctype + '<html><title>the title</title></head><body><p>a paragraph</p></body></html>'
end
def dtd
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'
end
def html_5_doctype
'<!DOCTYPE html>'
end
def warning_html
html_5_doctype + '<html><title proprietary="1">h</title></head><body><p>a para</p></body></html>'
end
end
| Java |
using System.Xml.Serialization;
namespace ImgLab
{
[XmlRoot("source")]
public sealed class Source
{
[XmlElement("database")]
public string Database
{
get;
set;
}
}
} | Java |
package fr.adrienbrault.idea.symfony2plugin.tests;
import fr.adrienbrault.idea.symfony2plugin.ServiceMap;
import fr.adrienbrault.idea.symfony2plugin.ServiceMapParser;
import org.junit.Test;
import org.junit.Assert;
import java.io.ByteArrayInputStream;
import java.util.Map;
/**
* @author Adrien Brault <adrien.brault@gmail.com>
*/
public class ServiceMapParserTest extends Assert {
@Test
public void testParse() throws Exception {
ServiceMapParser serviceMapParser = new ServiceMapParser();
String xmlString = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
"<container>" +
"<service id=\"adrienbrault\" class=\"AdrienBrault\\Awesome\"/>" +
"<service id=\"secret\" class=\"AdrienBrault\\Secret\" public=\"false\"/>" +
"</container>";
ServiceMap serviceMap = serviceMapParser.parse(new ByteArrayInputStream(xmlString.getBytes()));
assertTrue(serviceMap instanceof ServiceMap);
assertEquals("\\AdrienBrault\\Awesome", serviceMap.getMap().get("adrienbrault"));
assertEquals("\\AdrienBrault\\Awesome", serviceMap.getPublicMap().get("adrienbrault"));
assertEquals("\\AdrienBrault\\Secret", serviceMap.getMap().get("secret"));
assertNull(serviceMap.getPublicMap().get("secret"));
assertEquals("\\Symfony\\Component\\HttpFoundation\\Request", serviceMap.getMap().get("request"));
assertEquals("\\Symfony\\Component\\HttpFoundation\\Request", serviceMap.getPublicMap().get("request"));
assertEquals("\\Symfony\\Component\\DependencyInjection\\ContainerInterface", serviceMap.getMap().get("service_container"));
assertEquals("\\Symfony\\Component\\DependencyInjection\\ContainerInterface", serviceMap.getPublicMap().get("service_container"));
assertEquals("\\Symfony\\Component\\HttpKernel\\KernelInterface", serviceMap.getMap().get("kernel"));
assertEquals("\\Symfony\\Component\\HttpKernel\\KernelInterface", serviceMap.getPublicMap().get("kernel"));
}
}
| Java |
ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'
require 'minitest/reporters'
Minitest::Reporters.use!
class ActiveSupport::TestCase
# Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
fixtures :all
include ApplicationHelper
# Add more helper methods to be used by all tests here...
# Returns true, if user is logged in.
def is_logged_in?
!session[:user_id].nil?
end
# Logs in test user.
def log_in_as(user, options={})
password = options[:password] || 'password'
remember_me = options[:remember_me] || '1'
if integration_test?
post login_path, session: { email: user.email, password: password, remember_me: remember_me }
else
session[:user_id] = user.id
end
end
# Returns true, if integration test is used.
def integration_test?
# post_via_redirect is accessible only in integration test.
defined?(post_via_redirect)
end
end
| Java |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
int main () {
int n;
while(scanf("%d", &n) && n) {
bitset<32> bs,a,b;
bs = n;
int cont = 0;
for(int i = 0; i < 32; i++) {
if(bs.test(i)) {
if(cont%2) b.set(i);
else a.set(i);
cont++;
}
}
//int x = a;
printf("%u %u\n", a.to_ulong(), b.to_ulong());
}
return 0;
}
| Java |
#ifndef BARBERPOLE_H
#define BARBERPOLE_H
#include "iLampAnimation.h"
#include "Lamp.h"
class BarberPole : public iLampAnimation
{
public:
BarberPole(Lamp* lamp);
int itterate();
void reset();
protected:
int cur_led = 0;
int offset = 0;
uint8_t hue = 0;
uint8_t fps = 60;
private:
};
#endif // BarberPole_H
| Java |
describe Certificate do
it { is_expected.to have_property :id }
it { is_expected.to have_property :identifier }
it { is_expected.to have_property :image_key }
it { is_expected.to have_property :certificate_key }
it { is_expected.to have_property :created_at }
it { is_expected.to belong_to :delivery }
it { is_expected.to belong_to :student }
describe 'Creating a Certificate' do
before do
course = Course.create(title: 'Learn To Code 101', description: 'Introduction to programming')
delivery = course.deliveries.create(start_date: '2015-01-01')
student = delivery.students.create(full_name: 'Thomas Ochman', email: 'thomas@random.com')
@certificate = student.certificates.create(created_at: DateTime.now, delivery: delivery)
end
after { FileUtils.rm_rf Dir['pdf/test/**/*.pdf'] }
it 'adds an identifier after create' do
expect(@certificate.identifier.size).to eq 64
end
it 'has a Student name' do
expect(@certificate.student.full_name).to eq 'Thomas Ochman'
end
it 'has a Course name' do
expect(@certificate.delivery.course.title).to eq 'Learn To Code 101'
end
it 'has a Course delivery date' do
expect(@certificate.delivery.start_date.to_s).to eq '2015-01-01'
end
describe 'S3' do
before { CertificateGenerator.generate(@certificate) }
it 'can be fetched by #image_url' do
binding.pry
expect(@certificate.image_url).to eq 'https://certz.s3.amazonaws.com/pdf/test/thomas_ochman_2015-01-01.jpg'
end
it 'can be fetched by #certificate_url' do
expect(@certificate.certificate_url).to eq 'https://certz.s3.amazonaws.com/pdf/test/thomas_ochman_2015-01-01.pdf'
end
it 'returns #bitly_lookup' do
expect(@certificate.bitly_lookup).to eq "http://localhost:9292/verify/#{@certificate.identifier}"
end
it 'returns #stats' do
expect(@certificate.stats).to eq 0
end
end
end
end
| Java |
<?php
namespace OpenRailData\NetworkRail\Services\Stomp\Topics\Rtppm\Entities\Performance;
/**
* Class Performance
*
* @package OpenRailData\NetworkRail\Services\Stomp\Topics\Rtppm\Entities\Performance
*/
class Performance
{
/**
* @var int
*/
private $totalCount;
/**
* @var int
*/
private $onTimeCount;
/**
* @var int
*/
private $lateCount;
/**
* @var int
*/
private $cancelledOrVeryLateCount;
/**
* @var Ppm
*/
private $ppm;
/**
* @var RollingPpm
*/
private $rollingPpm;
public function __construct($data)
{
if (property_exists($data, "Total"))
$this->setTotalCount($data->Total);
if (property_exists($data, "OnTime"))
$this->setOnTimeCount($data->OnTime);
if (property_exists($data, "Late"))
$this->setLateCount($data->Late);
if (property_exists($data, "CancelVeryLate"))
$this->setCancelledOrVeryLateCount($data->CancelVeryLate);
if (property_exists($data, "PPM"))
$this->setPpm(new Ppm($data->PPM));
if (property_exists($data, "RollingPPM"))
$this->setRollingPpm(new RollingPpm($data->RollingPPM));
}
/**
* @return int
*/
public function getTotalCount()
{
return $this->totalCount;
}
/**
* @param int $totalCount
*
* @return $this;
*/
public function setTotalCount($totalCount)
{
$this->totalCount = (int)$totalCount;
return $this;
}
/**
* @return int
*/
public function getOnTimeCount()
{
return $this->onTimeCount;
}
/**
* @param int $onTimeCount
*
* @return $this;
*/
public function setOnTimeCount($onTimeCount)
{
$this->onTimeCount = (int)$onTimeCount;
return $this;
}
/**
* @return int
*/
public function getLateCount()
{
return $this->lateCount;
}
/**
* @param int $lateCount
*
* @return $this;
*/
public function setLateCount($lateCount)
{
$this->lateCount = (int)$lateCount;
return $this;
}
/**
* @return int
*/
public function getCancelledOrVeryLateCount()
{
return $this->cancelledOrVeryLateCount;
}
/**
* @param int $cancelledOrVeryLateCount
*
* @return $this;
*/
public function setCancelledOrVeryLateCount($cancelledOrVeryLateCount)
{
$this->cancelledOrVeryLateCount = (int)$cancelledOrVeryLateCount;
return $this;
}
/**
* @return Ppm
*/
public function getPpm()
{
return $this->ppm;
}
/**
* @param Ppm $ppm
*
* @return $this
*/
public function setPpm(Ppm $ppm)
{
$this->ppm = $ppm;
return $this;
}
/**
* @return RollingPpm
*/
public function getRollingPpm()
{
return $this->rollingPpm;
}
/**
* @param RollingPpm $rollingPpm
*
* @return $this
*/
public function setRollingPpm(RollingPpm $rollingPpm)
{
$this->rollingPpm = $rollingPpm;
return $this;
}
} | Java |
package gitnotify
import (
"errors"
"fmt"
"html/template"
"net/http"
"os"
"sort"
"github.com/gorilla/mux"
"github.com/markbates/goth"
"github.com/markbates/goth/gothic"
"github.com/markbates/goth/providers/github"
"github.com/markbates/goth/providers/gitlab"
"github.com/sairam/kinli"
)
// Authentication data/$provider/$user/$settingsFile
type Authentication struct {
Provider string `yaml:"provider"` // github/gitlab
Name string `yaml:"name"` // name of the person addressing to
Email string `yaml:"email"` // email that we will send to
UserName string `yaml:"username"` // username for identification
Token string `yaml:"token"` // used to query the provider
}
// UserInfo provides provider/username
func (userInfo *Authentication) UserInfo() string {
return fmt.Sprintf("%s/%s", userInfo.Provider, userInfo.UserName)
}
func (userInfo *Authentication) save() {
conf := new(Setting)
os.MkdirAll(userInfo.getConfigDir(), 0700)
conf.load(userInfo.getConfigFile())
conf.Auth = userInfo
conf.save(userInfo.getConfigFile())
}
func (userInfo *Authentication) getConfigDir() string {
if userInfo.Provider == "" {
return ""
}
return fmt.Sprintf("data/%s/%s", userInfo.Provider, userInfo.UserName)
}
func (userInfo *Authentication) getConfigFile() string {
if userInfo.Provider == "" {
return ""
}
return fmt.Sprintf("%s/%s", userInfo.getConfigDir(), config.SettingsFile)
}
func preInitAuth() {
// ProviderNames is the map of key/value providers configured
config.Providers = make(map[string]string)
var providers []goth.Provider
if provider := configureGithub(); provider != nil {
providers = append(providers, provider)
}
if provider := configureGitlab(); provider != nil {
providers = append(providers, provider)
}
goth.UseProviders(providers...)
}
func initAuth(p *mux.Router) {
p.HandleFunc("/{provider}/callback", authProviderCallbackHandler).Methods("GET")
p.HandleFunc("/{provider}", authProviderHandler).Methods("GET")
p.HandleFunc("/", authListHandler).Methods("GET")
}
func configureGithub() goth.Provider {
if config.GithubURLEndPoint != "" && config.GithubAPIEndPoint != "" {
if os.Getenv("GITHUB_KEY") == "" || os.Getenv("GITHUB_SECRET") == "" {
panic("Missing Configuration: Github Authentication is not set!")
}
github.AuthURL = config.GithubURLEndPoint + "login/oauth/authorize"
github.TokenURL = config.GithubURLEndPoint + "login/oauth/access_token"
github.ProfileURL = config.GithubAPIEndPoint + "user"
config.Providers[GithubProvider] = "Github"
// for github, add scope: "repo:status" to access private repositories
return github.New(os.Getenv("GITHUB_KEY"), os.Getenv("GITHUB_SECRET"), config.websiteURL()+"/auth/github/callback", "user:email")
}
return nil
}
func configureGitlab() goth.Provider {
if config.GitlabURLEndPoint != "" && config.GitlabAPIEndPoint != "" {
if os.Getenv("GITLAB_KEY") == "" || os.Getenv("GITLAB_SECRET") == "" {
panic("Missing Configuration: Github Authentication is not set!")
}
gitlab.AuthURL = config.GitlabURLEndPoint + "oauth/authorize"
gitlab.TokenURL = config.GitlabURLEndPoint + "oauth/token"
gitlab.ProfileURL = config.GitlabAPIEndPoint + "user"
config.Providers[GitlabProvider] = "Gitlab"
// gitlab does not have any scopes, you get full access to the user's account
return gitlab.New(os.Getenv("GITLAB_KEY"), os.Getenv("GITLAB_SECRET"), config.websiteURL()+"/auth/gitlab/callback")
}
return nil
}
func authListHandler(res http.ResponseWriter, req *http.Request) {
var keys []string
for k := range config.Providers {
keys = append(keys, k)
}
sort.Strings(keys)
providerIndex := &ProviderIndex{Providers: keys, ProvidersMap: config.Providers}
t, _ := template.New("foo").Parse(indexTemplate)
t.Execute(res, providerIndex)
}
func authProviderHandler(res http.ResponseWriter, req *http.Request) {
hc := &kinli.HttpContext{W: res, R: req}
if isAuthed(hc) {
text := "User is already logged in"
kinli.DisplayText(hc, res, text)
} else {
statCount("auth.start")
gothic.BeginAuthHandler(res, req)
}
}
func authProviderCallbackHandler(res http.ResponseWriter, req *http.Request) {
statCount("auth.complete")
user, err := gothic.CompleteUserAuth(res, req)
if err != nil {
fmt.Fprintln(res, err)
return
}
authType, _ := getProviderName(req)
auth := &Authentication{
Provider: authType,
UserName: user.NickName,
Name: user.Name,
Email: user.Email,
Token: user.AccessToken,
}
auth.save()
hc := &kinli.HttpContext{W: res, R: req}
loginTheUser(hc, auth, authType)
http.Redirect(res, req, kinli.HomePathAuthed, 302)
}
// ProviderIndex is used for setting up the providers
type ProviderIndex struct {
Providers []string
ProvidersMap map[string]string
}
// See gothic/gothic.go: GetProviderName function
// Overridden since we use mux
func getProviderName(req *http.Request) (string, error) {
vars := mux.Vars(req)
provider := vars["provider"]
if provider == "" {
return provider, errors.New("you must select a provider")
}
return provider, nil
}
var indexTemplate = `{{range $key,$value:=.Providers}}
<p><a href="/auth/{{$value}}">Log in with {{index $.ProvidersMap $value}}</a></p>
{{end}}`
| Java |
import numpy as np
import matplotlib.pylab as plt
from numba import cuda, uint8, int32, uint32, jit
from timeit import default_timer as timer
@cuda.jit('void(uint8[:], int32, int32[:], int32[:])')
def lbp_kernel(input, neighborhood, powers, h):
i = cuda.grid(1)
r = 0
if i < input.shape[0] - 2 * neighborhood:
i += neighborhood
for j in range(i - neighborhood, i):
if input[j] >= input[i]:
r += powers[j - i + neighborhood]
for j in range(i + 1, i + neighborhood + 1):
if input[j] >= input[i]:
r += powers[j - i + neighborhood - 1]
cuda.atomic.add(h, r, 1)
def extract_1dlbp_gpu(input, neighborhood, d_powers):
maxThread = 512
blockDim = maxThread
d_input = cuda.to_device(input)
hist = np.zeros(2 ** (2 * neighborhood), dtype='int32')
gridDim = (len(input) - 2 * neighborhood + blockDim) / blockDim
d_hist = cuda.to_device(hist)
lbp_kernel[gridDim, blockDim](d_input, neighborhood, d_powers, d_hist)
d_hist.to_host()
return hist
def extract_1dlbp_gpu_debug(input, neighborhood, powers, res):
maxThread = 512
blockDim = maxThread
gridDim = (len(input) - 2 * neighborhood + blockDim) / blockDim
for block in range(0, gridDim):
for thread in range(0, blockDim):
r = 0
i = blockDim * block + thread
if i < input.shape[0] - 2 * neighborhood:
i += neighborhood
for j in range(i - neighborhood, i):
if input[j] >= input[i]:
r += powers[j - i + neighborhood]
for j in range(i + 1, i + neighborhood + 1):
if input[j] >= input[i]:
r += powers[j - i + neighborhood - 1]
res[r] += 1
return res
@jit("int32[:](uint8[:], int64, int32[:], int32[:])", nopython=True)
def extract_1dlbp_cpu_jit(input, neighborhood, powers, res):
maxThread = 512
blockDim = maxThread
gridDim = (len(input) - 2 * neighborhood + blockDim) / blockDim
for block in range(0, gridDim):
for thread in range(0, blockDim):
r = 0
i = blockDim * block + thread
if i < input.shape[0] - 2 * neighborhood:
i += neighborhood
for j in range(i - neighborhood, i):
if input[j] >= input[i]:
r += powers[j - i + neighborhood]
for j in range(i + 1, i + neighborhood + 1):
if input[j] >= input[i]:
r += powers[j - i + neighborhood - 1]
res[r] += 1
return res
def extract_1dlbp_cpu(input, neighborhood, p):
"""
Extract the 1d lbp pattern on CPU
"""
res = np.zeros(1 << (2 * neighborhood))
for i in range(neighborhood, len(input) - neighborhood):
left = input[i - neighborhood : i]
right = input[i + 1 : i + neighborhood + 1]
both = np.r_[left, right]
res[np.sum(p [both >= input[i]])] += 1
return res
X = np.arange(3, 7)
X = 10 ** X
neighborhood = 4
cpu_times = np.zeros(X.shape[0])
cpu_times_simple = cpu_times.copy()
cpu_times_jit = cpu_times.copy()
gpu_times = np.zeros(X.shape[0])
p = 1 << np.array(range(0, 2 * neighborhood), dtype='int32')
d_powers = cuda.to_device(p)
for i, x in enumerate(X):
input = np.random.randint(0, 256, size = x).astype(np.uint8)
print "Length: {0}".format(x)
print "--------------"
start = timer()
h_cpu = extract_1dlbp_cpu(input, neighborhood, p)
cpu_times[i] = timer() - start
print "Finished on CPU: time: {0:3.5f}s".format(cpu_times[i])
res = np.zeros(1 << (2 * neighborhood), dtype='int32')
start = timer()
h_cpu_simple = extract_1dlbp_gpu_debug(input, neighborhood, p, res)
cpu_times_simple[i] = timer() - start
print "Finished on CPU (simple): time: {0:3.5f}s".format(cpu_times_simple[i])
res = np.zeros(1 << (2 * neighborhood), dtype='int32')
start = timer()
h_cpu_jit = extract_1dlbp_cpu_jit(input, neighborhood, p, res)
cpu_times_jit[i] = timer() - start
print "Finished on CPU (numba: jit): time: {0:3.5f}s".format(cpu_times_jit[i])
start = timer()
h_gpu = extract_1dlbp_gpu(input, neighborhood, d_powers)
gpu_times[i] = timer() - start
print "Finished on GPU: time: {0:3.5f}s".format(gpu_times[i])
print "All h_cpu == h_gpu: ", (h_cpu_jit == h_gpu).all() and (h_cpu_simple == h_cpu_jit).all() and (h_cpu == h_cpu_jit).all()
print ''
f = plt.figure(figsize=(10, 5))
plt.plot(X, cpu_times, label = "CPU")
plt.plot(X, cpu_times_simple, label = "CPU non-vectorized")
plt.plot(X, cpu_times_jit, label = "CPU jit")
plt.plot(X, gpu_times, label = "GPU")
plt.yscale('log')
plt.xscale('log')
plt.xlabel('input length')
plt.ylabel('time, sec')
plt.legend()
plt.show()
| Java |
package me.F_o_F_1092.WeatherVote.PluginManager.Spigot;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import me.F_o_F_1092.WeatherVote.Options;
import me.F_o_F_1092.WeatherVote.PluginManager.Command;
import me.F_o_F_1092.WeatherVote.PluginManager.CommandListener;
import me.F_o_F_1092.WeatherVote.PluginManager.HelpMessage;
public class HelpPageListener extends me.F_o_F_1092.WeatherVote.PluginManager.HelpPageListener {
public static void sendMessage(Player p, int page) {
List<HelpMessage> personalHelpMessages = getAllPersonalHelpMessages(p);
List<HelpMessage> personalHelpPageMessages = getHelpPageMessages(p, personalHelpMessages, page);
p.sendMessage("");
JSONMessageListener.send(p, getNavBar(personalHelpMessages, personalHelpPageMessages, page));
p.sendMessage("");
for (HelpMessage hm : personalHelpPageMessages) {
JSONMessageListener.send(p, hm.getJsonString());
}
p.sendMessage("");
if (getMaxPlayerPages(personalHelpMessages) != 1) {
p.sendMessage(Options.msg.get("helpTextGui.4").replace("[PAGE]", (page + 1) + ""));
}
JSONMessageListener.send(p, getNavBar(personalHelpMessages, personalHelpPageMessages, page));
p.sendMessage("");
}
public static void sendNormalMessage(CommandSender cs) {
cs.sendMessage(Options.msg.get("color.1") + "§m----------------§r " + pluginNametag + Options.msg.get("color.1") + "§m----------------");
cs.sendMessage("");
for (Command command : CommandListener.getAllCommands()) {
cs.sendMessage(command.getHelpMessage().getNormalString());
}
cs.sendMessage("");
cs.sendMessage(Options.msg.get("color.1") + "§m----------------§r " + pluginNametag + Options.msg.get("color.1") + "§m----------------");
}
private static List<HelpMessage> getHelpPageMessages(Player p, List<HelpMessage> personalHelpMessages, int page) {
List<HelpMessage> personalHelpPageMessages = new ArrayList<HelpMessage>();
for (int i = 0; i < maxHelpMessages; i++) {
if (personalHelpMessages.size() >= (page * maxHelpMessages + i + 1)) {
personalHelpPageMessages.add(personalHelpMessages.get(page * maxHelpMessages + i));
}
}
return personalHelpPageMessages;
}
public static int getMaxPlayerPages(Player p) {
return (int) java.lang.Math.ceil(((double)getAllPersonalHelpMessages(p).size() / (double)maxHelpMessages));
}
private static List<HelpMessage> getAllPersonalHelpMessages(Player p) {
List<HelpMessage> personalHelpMessages = new ArrayList<HelpMessage>();
for (Command command : CommandListener.getAllCommands()) {
if (command.getPermission()== null || p.hasPermission(command.getPermission())) {
personalHelpMessages.add(command.getHelpMessage());
}
}
return personalHelpMessages;
}
} | Java |
namespace _05_SlicingFile
{
using System;
using System.Collections.Generic;
using System.IO;
class StartUp
{
static void Main()
{
var sourceFile = @"D:\SoftUni\05-Csharp Advanced\08-EXERCISE STREAMS\Resources\sliceMe.mp4";
var destinationDirectory = @"D:\SoftUni\05-Csharp Advanced\08-EXERCISE STREAMS\HomeWorkResults\";
int parts = 5;
Slice(sourceFile, destinationDirectory, parts);
var files = new List<string>
{
"05-SlicingFile-Part-01.mp4",
"05-SlicingFile-Part-02.mp4",
"05-SlicingFile-Part-03.mp4",
"05-SlicingFile-Part-04.mp4",
"05-SlicingFile-Part-05.mp4",
};
Assemble(files, destinationDirectory);
}
static void Slice(string sourceFile, string destinationDirectory, int parts)
{
using (var reader = new FileStream(sourceFile, FileMode.Open))
{
long partSize = (long)Math.Ceiling((double)reader.Length / parts);
for (int i = 1; i <= parts; i++)
{
long currentPartSize = 0;
var fileName = $"{destinationDirectory}05-SlicingFile-Part-0{i}.mp4";
using (var writer = new FileStream(fileName, FileMode.Create))
{
var buffer = new byte[4096];
while (reader.Read(buffer, 0, buffer.Length) == 4096)
{
writer.Write(buffer, 0, buffer.Length);
currentPartSize += 4096;
if (currentPartSize >= partSize)
{
break;
}
}
}
}
}
}
static void Assemble(List<string> files, string destinationDirectory)
{
var assembledFilePath = $"{destinationDirectory}05-SlicingFile-Assembled.mp4";
using (var writer = new FileStream(assembledFilePath, FileMode.Create))
{
var buffer = new byte[4096];
for (int i = 0; i < files.Count; i++)
{
var filePath = $"{destinationDirectory}{files[i]}";
using (var reader = new FileStream(filePath, FileMode.Open))
{
while (reader.Read(buffer,0,buffer.Length) != 0)
{
writer.Write(buffer, 0, buffer.Length);
}
}
}
}
}
}
} | Java |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("BeastApplication")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("BeastApplication")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: ComVisible(false)] | Java |
#pragma once
#include "SYCL/detail/common.h"
namespace cl {
namespace sycl {
namespace detail {
using counter_t = unsigned int;
template <class T, counter_t start = 0>
class counter {
private:
static counter_t internal_count;
counter_t counter_id;
public:
counter() : counter_id(internal_count++) {}
counter(const counter& copy) : counter() {}
counter(counter&& move) noexcept : counter_id(move.counter_id) {}
counter& operator=(const counter& copy) {
counter_id = copy.counter_id;
return *this;
}
counter& operator=(counter&& move) noexcept {
return *this;
}
~counter() = default;
static counter_t get_total_count() {
return internal_count;
}
counter_t get_count_id() const {
return counter_id;
}
};
template <class T, counter_t start>
counter_t counter<T, start>::internal_count = start;
} // namespace detail
} // namespace sycl
} // namespace cl
| Java |
pub const MEMORY_REGIONS_MAX: usize = 8;
| Java |
<!-- INCLUDE ucp_header.html -->
<!-- IF not PROMPT -->
<!-- INCLUDE ucp_pm_message_header.html -->
<!-- ENDIF -->
<!-- IF PROMPT -->
<h2>{L_EXPORT_AS_CSV}</h2>
<form id="viewfolder" method="post" action="{S_PM_ACTION}">
<div class="panel">
<div class="inner"><span class="corners-top"><span></span></span>
<h3>{L_OPTIONS}</h3>
<fieldset>
<dl>
<dt><label for="delimiter">{L_DELIMITER}:</label></dt>
<dd><input class="inputbox" type="text" id="delimiter" name="delimiter" value="," /></dd>
</dl>
<dl>
<dt><label for="enclosure">{L_ENCLOSURE}:</label></dt>
<dd><input class="inputbox" type="text" id="enclosure" name="enclosure" value=""" /></dd>
</dl>
</fieldset>
<span class="corners-bottom"><span></span></span></div>
</div>
</form>
<!-- ELSE -->
<!-- IF NUM_REMOVED -->
<div class="notice">
<p>{RULE_REMOVED_MESSAGES}</p>
</div>
<!-- ENDIF -->
<!-- IF NUM_NOT_MOVED -->
<div class="notice">
<p>{NOT_MOVED_MESSAGES}<br />{RELEASE_MESSAGE_INFO}</p>
</div>
<!-- ENDIF -->
<!-- IF .messagerow -->
<ul class="topiclist">
<li class="header">
<dl>
<dt>{L_MESSAGE}</dt>
<dd class="mark">{L_MARK}</dd>
</dl>
</li>
</ul>
<ul class="topiclist cplist pmlist">
<!-- BEGIN messagerow -->
<li class="row<!-- IF messagerow.S_ROW_COUNT is odd --> bg1<!-- ELSE --> bg2<!-- ENDIF --><!-- IF messagerow.PM_CLASS --> {messagerow.PM_CLASS}<!-- ENDIF -->">
<dl class="icon" style="background-image: url({messagerow.FOLDER_IMG_SRC}); background-repeat: no-repeat;">
<dt<!-- IF messagerow.PM_ICON_URL and S_PM_ICONS --> style="background-image: url({messagerow.PM_ICON_URL}); background-repeat: no-repeat;"<!-- ENDIF -->>
<!-- IF messagerow.S_PM_DELETED -->
<a href="{messagerow.U_REMOVE_PM}" class="topictitle">{L_DELETE_MESSAGE}</a><br />
<span class="error">{L_MESSAGE_REMOVED_FROM_OUTBOX}</span>
<!-- ELSE -->
<a href="{messagerow.U_VIEW_PM}" class="topictitle">{messagerow.SUBJECT}</a>
<!-- ENDIF -->
<!-- IF messagerow.S_AUTHOR_DELETED -->
<br /><em class="small">{L_PM_FROM_REMOVED_AUTHOR}</em>
<!-- ENDIF -->
<!-- IF messagerow.S_PM_REPORTED --><a href="{messagerow.U_MCP_REPORT}">{REPORTED_IMG}</a><!-- ENDIF --> {messagerow.ATTACH_ICON_IMG}<br />
<!-- IF S_SHOW_RECIPIENTS -->{L_MESSAGE_TO} {messagerow.RECIPIENTS}<!-- ELSE -->{L_MESSAGE_BY_AUTHOR} {messagerow.MESSAGE_AUTHOR_FULL} » {messagerow.SENT_TIME}<!-- ENDIF -->
</dt>
<!-- IF S_SHOW_RECIPIENTS --><dd class="info"><span>{L_SENT_AT}: {messagerow.SENT_TIME}</span></dd><!-- ENDIF -->
<!-- IF S_UNREAD --><dd class="info"><!-- IF messagerow.FOLDER --><a href="{messagerow.U_FOLDER}">{messagerow.FOLDER}</a><!-- ELSE -->{L_UNKNOWN_FOLDER}<!-- ENDIF --></dd><!-- ENDIF -->
<dd class="mark"><input type="checkbox" name="marked_msg_id[]" value="{messagerow.MESSAGE_ID}" /></dd>
</dl>
</li>
<!-- END messagerow -->
</ul>
<!-- ELSE -->
<p><strong>
<!-- IF S_COMPOSE_PM_VIEW and S_NO_AUTH_SEND_MESSAGE -->
<!-- IF S_USER_NEW -->{L_USER_NEW_PERMISSION_DISALLOWED}<!-- ELSE -->{L_NO_AUTH_SEND_MESSAGE}<!-- ENDIF -->
<!-- ELSE -->
{L_NO_MESSAGES}
<!-- ENDIF -->
</strong></p>
<!-- ENDIF -->
<!-- IF FOLDER_CUR_MESSAGES neq 0 -->
<fieldset class="display-actions">
<a href="#" onclick="marklist('viewfolder', 'marked_msg', true); return false;">{L_MARK_ALL}</a> • <a href="#" onclick="marklist('viewfolder', 'marked_msg', false); return false;">{L_UNMARK_ALL}</a>
<select name="mark_option">{S_MARK_OPTIONS}{S_MOVE_MARKED_OPTIONS}</select> <input class="button2" type="submit" name="submit_mark" value="{L_GO}" />
</fieldset>
<hr />
<ul class="linklist">
<!-- IF TOTAL_MESSAGES or S_VIEW_MESSAGE -->
<li class="rightside pagination">
<!-- IF TOTAL_MESSAGES -->{TOTAL_MESSAGES}<!-- ENDIF -->
<!-- IF PAGE_NUMBER --><!-- IF PAGINATION --> • <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> • <span>{PAGINATION}</span><!-- ELSE --> • {PAGE_NUMBER}<!-- ENDIF --><!-- ENDIF -->
</li>
<!-- ENDIF -->
</ul>
<!-- ENDIF -->
<span class="corners-bottom"><span></span></span></div>
</div>
<!-- IF FOLDER_CUR_MESSAGES neq 0 -->
<fieldset class="display-options">
<!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}" class="left-box {S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF -->
<!-- IF NEXT_PAGE --><a href="{NEXT_PAGE}" class="right-box {S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF -->
<label>{L_DISPLAY}: {S_SELECT_SORT_DAYS}</label>
<label>{L_SORT_BY} {S_SELECT_SORT_KEY}</label>
<label>{S_SELECT_SORT_DIR} <input type="submit" name="sort" value="{L_GO}" class="button2" /></label>
<input type="hidden" name="cur_folder_id" value="{CUR_FOLDER_ID}" />
</fieldset>
<!-- ENDIF -->
<!-- INCLUDE ucp_pm_message_footer.html -->
<!-- ENDIF -->
<!-- INCLUDE ucp_footer.html --> | Java |
define(['omega/entity', 'omega/core'], function (e, o) {
'use strict';
var triggerKey = function (action, e) {
o.trigger(action, {
keyCode: e.keyCode,
shiftKey: e.shiftKey,
ctrlKey: e.ctrlKey,
altKey: e.altKey
});
};
window.onkeydown = function (e) {
triggerKey('KeyDown', e);
};
window.onkeyup = function (e) {
triggerKey('KeyUp', e);
};
// ---
return e.extend({
keyboard: {keys: {}},
init: function () {
o.bind('KeyDown', function (e) {
this.keyboard.keys[e.keyCode] = true;
this.trigger('KeyDown', e);
}, this);
o.bind('KeyUp', function (e) {
this.keyboard.keys[e.keyCode] = false;
this.trigger('KeyUp', e);
}, this);
},
isKeyDown: function (keyCode) {
return (this.keyboard.keys[keyCode]);
}
});
});
| Java |
package zeonClient.mods;
import java.util.Iterator;
import org.lwjgl.input.Keyboard;
import net.minecraft.client.entity.EntityOtherPlayerMP;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.network.play.client.CPacketPlayerDigging;
import net.minecraft.network.play.client.CPacketPlayerDigging.Action;
import net.minecraft.network.play.client.CPacketUseEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import zeonClient.main.Category;
public class KillAura extends Mod {
private int ticks = 0;
public KillAura() {
super("KillAura", "KillAura", Keyboard.KEY_R, Category.COMBAT);
}
public void onUpdate() {
if(this.isToggled()) {
ticks++;
if(ticks >= 20 - speed()) {
ticks = 0;
mc.player.rotationYaw +=0.2F;
for(Iterator<Entity> entities = mc.world.loadedEntityList.iterator(); entities.hasNext();) {
Object object = entities.next();
if(object instanceof EntityLivingBase) {
EntityLivingBase e = (EntityLivingBase) object;
if(e instanceof EntityPlayerSP) continue;
if(mc.player.getDistanceToEntity(e) <= 7F) {
if(e.isInvisible()) {
break;
}
if(e.isEntityAlive()) {
if(mc.player.getHeldItemMainhand() != null) {
mc.player.attackTargetEntityWithCurrentItem(e);
}
if(mc.player.isActiveItemStackBlocking()) {
mc.player.connection.sendPacket(new CPacketPlayerDigging(Action.RELEASE_USE_ITEM, new BlockPos(0, 0, 0), EnumFacing.UP));
}
mc.player.connection.sendPacket(new CPacketUseEntity(e));
mc.player.swingArm(EnumHand.MAIN_HAND);
break;
}
}
}
}
}
}
}
private int speed() {
return 18;
}
}
| Java |
package com.github.lunatrius.schematica.client.gui;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiSlot;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.resources.I18n;
import net.minecraft.item.ItemStack;
class GuiSchematicMaterialsSlot extends GuiSlot {
private final Minecraft minecraft = Minecraft.getMinecraft();
private final GuiSchematicMaterials guiSchematicMaterials;
protected int selectedIndex = -1;
private final String strUnknownBlock = I18n.format("schematica.gui.unknownblock");
public GuiSchematicMaterialsSlot(GuiSchematicMaterials par1) {
super(Minecraft.getMinecraft(), par1.width, par1.height, 16, par1.height - 34, 24);
this.guiSchematicMaterials = par1;
this.selectedIndex = -1;
}
@Override
protected int getSize() {
return this.guiSchematicMaterials.blockList.size();
}
@Override
protected void elementClicked(int index, boolean par2, int par3, int par4) {
this.selectedIndex = index;
}
@Override
protected boolean isSelected(int index) {
return index == this.selectedIndex;
}
@Override
protected void drawBackground() {
}
@Override
protected void drawContainerBackground(Tessellator tessellator) {
}
@Override
protected void drawSlot(int index, int x, int y, int par4, Tessellator tessellator, int par6, int par7) {
ItemStack itemStack = this.guiSchematicMaterials.blockList.get(index);
String itemName;
String amount = Integer.toString(itemStack.stackSize);
if (itemStack.getItem() != null) {
itemName = itemStack.getItem().getItemStackDisplayName(itemStack);
} else {
itemName = this.strUnknownBlock;
}
GuiHelper.drawItemStack(this.minecraft.renderEngine, this.minecraft.fontRenderer, x, y, itemStack);
this.guiSchematicMaterials.drawString(this.minecraft.fontRenderer, itemName, x + 24, y + 6, 0xFFFFFF);
this.guiSchematicMaterials.drawString(this.minecraft.fontRenderer, amount, x + 215 - this.minecraft.fontRenderer.getStringWidth(amount), y + 6, 0xFFFFFF);
}
}
| Java |
package li.cryx.minecraft.death;
import java.util.logging.Logger;
import li.cryx.minecraft.death.i18n.ITranslator;
import li.cryx.minecraft.death.persist.AbstractPersistManager;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.entity.Player;
public interface ISpiritHealer {
void addAltarLocation(Location loc);
Material getAltarBaseMaterial();
Material getAltarMaterial();
// FileConfiguration getConfig();
Logger getLogger();
AbstractPersistManager getPersist();
ITranslator getTranslator();
boolean isAltar(Location loc);
void restoreItems(Player player);
}
| Java |
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* A CodeIgniter library that wraps \Firebase\JWT\JWT methods.
*/
class Jwt {
function __construct()
{
// TODO: Is this the best way to do this? (Issue #4 at psignoret/aad-sso-codeigniter.)
require_once(APPPATH . 'libraries/JWT/JWT.php');
require_once(APPPATH . 'libraries/JWT/BeforeValidException.php');
require_once(APPPATH . 'libraries/JWT/ExpiredException.php');
require_once(APPPATH . 'libraries/JWT/SignatureInvalidException.php');
}
/**
* Wrapper function for JWT::decode.
*/
public function decode($jwt, $key, $allowed_algs = array())
{
return \Firebase\JWT\JWT::decode($jwt, $key, $allowed_algs);
}
}
| Java |
---
layout: post
title: 100 Plus
date: 2013-07-13 20:23
author: admin
comments: true
---
Hey, I just noticed that this is my 102nd entry here on Tidy Husband. I've written over 100 articles here - An anniversary of sorts and when you think about it, it only took me about a year. I've written 55,000 words here. That's a novel's length.
Meanwhile, in the USA...
The Dog and I have been busy: First up, we weeded the garden. Not the best job I know, but better than <a href="http://tidyhusband.com/i-a-door-you/">before</a> and there's lots of time to make another attempt. I took the shovel, dug everyting up and then took the rake and raked out all the weeds. Our weed puller was useless as the weeds were many, but not big to grab with the weed puller. Regardless, BW is in Argentina and I'm pulling weeds. Heh, if you'd have told me 3 years ago my condo living self would be living in the US pulling weeds with a dog by your side, I'd tell you were crazy.. never say never.
<a href="http://tidyhusband.com/images/2013/07/JIM_2148.jpg"><img class="alignnone size-full wp-image-1795" alt="JIM_2148" src="http://tidyhusband.com/images/2013/07/JIM_2148.jpg" width="2144" height="1424" /></a>
And if that wasn't enough outdoor activity we also did this;
<strong>Before: </strong>
<a href="http://tidyhusband.com/images/2013/07/JIM_2147.jpg"><img class="alignnone size-full wp-image-1797" alt="JIM_2147" src="http://tidyhusband.com/images/2013/07/JIM_2147.jpg" width="2144" height="1424" /></a>
<strong>After</strong>
<a href="http://tidyhusband.com/images/2013/07/JIM_2149.jpg"><img class="alignnone size-full wp-image-1796" alt="JIM_2149" src="http://tidyhusband.com/images/2013/07/JIM_2149.jpg" width="2144" height="1424" /></a>
Can you tell the difference?
That's right -<strong> I got rid of the dog!</strong> :)
Okay, Okay, the dog is still here and fine but we did cut that little tree/hedge/stump down to a more reasonable size. It was due for it's annual haircut. Now, by 'we' I mean I cut the tree down and thedog sat in the shade and directed.
Other news...
BW, I watered your plants today but I think it's going to rain on us later if the black clouds in the sky are any indicator.
I went to stain the deck chairs but two problems arose: One, we don't have enough stain left in the can we have and when I went to home depot they don't have any stain either they don't sell the stuff we have any more. So screw it, you can help me go to the home depot with me when you get back BW, and we can pick out a color for these things when you get back. I have to save some fun for you...
But, I did buy a tube of caulking and I'm going to make my very first attempt at this tomorrow. Pictures to follow.
Othewise, a trip to the grocery store (I love blueberry season) and a lap of the house with vacuum and a mop with a dog walk added in there for good measure and it's 8:30pm and here's post 102 wrapped up.
Until next time,
TH & co.
| Java |
$(window).on('load', function() {//main
const dom = {//define inputs
tswitch: $("#wave-switch input"),
aSlider: $("input#angle"),//angle slider
nSlider: $("input#refractive-index-ratio"),
};
let layout = {//define layout of pot
showlegend: false,
scene: {
aspectmode: "cube",
xaxis: {range: [-2, 2]},
yaxis: {range: [-2, 2]},
zaxis: {range: [-2, 2]},
camera: {
eye: {x: 0, y: 0, z: -2}//adjust camera starting view
}
},
};
//define constants
let size = 100;
let t = 0;
let isPlay = false;
let E_0 = 0.5;
let w_r = 2e9;
let c = 3e8; // Speed of light
let n1 = 1;
let k_1 = (n1*w_r)/c;
let k_2,theta_i,theta_t;
let x_data = numeric.linspace(2, 0, size);//x and y data is always the same and just change z
let x_data_t = math.add(-2,x_data);
let y_data = numeric.linspace(-2, 2, size);
//constants based of of inputs
let condition = $("input[name = wave-switch]:checked").val();
let angle_of_incidence = parseFloat($("input#angle").val());
let n2 = parseFloat($("input#refractive-index-ratio").val());
function snell(theta_i){//snells law
console.log(Math.sin(theta_i));
console.log((n1 / n2))
return Math.asin((n1 / n2) * Math.sin(theta_i));
};
function getData_wave_incident(){//produces data for the incident wave on the boundry
let z,z_square = [];
let k_x = Math.cos(theta_i)*k_1;
let k_y = Math.sin(theta_i)*k_1;
for (let v=0;v < y_data.length ;v++) {
let z_row = [];
for (let i = 0; i < x_data.length ; i++) {
z = E_0* Math.sin(k_x* x_data[i]+k_y*y_data[v]+w_r*t);
z_row.push(z);
}
z_square.push(z_row);
}
return z_square
}
function getData_wave_reflected(){//produces data for the reflected wave on the boundry
let z,z_square = [];
let k_x = Math.cos(-theta_i)*k_1;
let k_y = Math.sin(-theta_i)*k_1;
let E_0_r = reflect();
for (let v=0;v < y_data.length ;v++) {
let z_row = [];
for (let i = 0; i < x_data.length ; i++) {
z = E_0_r* Math.sin(k_x* x_data[i]+k_y*y_data[v]-w_r*t);
z_row.push(z);
}
z_square.push(z_row);
}
return z_square
}
function getData_wave_transmitted(){//produces data for the incident wave on the boundry
let z,z_square = [];
let E_0_t = transmit();
let k_y = Math.sin(theta_i)*k_1;
let k_x = Math.cos(theta_t)*k_2;
for (let v=0;v < y_data.length ;v++) {
let z_row = [];
for (let i = 0; i < x_data_t.length ; i++) {
z = E_0_t*Math.sin(k_x*x_data_t[i]+k_y*y_data[v]+w_r*t);
z_row.push(z);
}
z_square.push(z_row);//Not entirelly sure the physics is correct need to review
}
return z_square
}
function transmit(){//gives the new amplitude of the transmitted wave
let E_t0;
if (isNaN(theta_t) === true){//if snells law return not a number this means total internal refection is occurring hence no transmitted wave(no attenuation accounted for)
return 0
}
else {
E_t0 = E_0 * (2. * n1 * Math.cos(theta_i)) / (n1 * Math.cos(theta_i) + n2 * Math.cos(theta_t))
return E_t0
}
};
function reflect() {//gives the amplitude of the refected wave
if (n1 === n2) {//if both materials have same refractive index then there is no reflection
return 0
}
else {
let E_r0;
if (isNaN(theta_t) === true){
E_r0 = E_0;
}
else {
E_r0 = E_0 * (n1 * Math.cos(theta_i) - n2 * Math.cos(theta_t)) / (n1 * Math.cos(theta_i) + n2 * Math.cos(theta_t))
}
return E_r0
}
};
function plot_data() {//produces the traces of the plot
$("#angle-display").html($("input#angle").val().toString()+"°");//update display
$("#refractive-index-ratio-display").html($("input#refractive-index-ratio").val().toString());
condition = $("input[name = wave-switch]:checked").val();//update value of constants
angle_of_incidence = parseFloat($("input#angle").val());
n2 = parseFloat($("input#refractive-index-ratio").val());
k_2 = (n2*w_r)/c;
theta_i = Math.PI * (angle_of_incidence / 180);
theta_t = snell(theta_i);
if (isNaN(Math.asin(n2))=== true){//update value of citical angle
$("#critical_angle-display").html("No Total Internal Reflection possible");
}else{
$("#critical_angle-display").html(((180*Math.asin(n2))/Math.PI).toFixed(2).toString()+"°");
}
let data = [];
if (condition === "incident") {//creates trace dependent of the conditions of the system
let incident_wave = {
opacity: 1,
x: x_data,
y: y_data,
z: getData_wave_incident(),
type: 'surface',
name: "Incident"
};
data.push(incident_wave);
}
else if(condition === "reflected") {
let reflected_wave = {
opacity: 1,
x: x_data,
y: y_data,
z: getData_wave_reflected(),
type: 'surface',
name: "Reflected"
};
data.push(reflected_wave);
}
else{
let incident_plus_reflected_wave = {
opacity: 1,
x: x_data,
y: y_data,
z: math.add(getData_wave_incident(),getData_wave_reflected()),
type: 'surface',
name:"Reflected and Incident combined"
};
data.push(incident_plus_reflected_wave);
}
let transmitted_wave = {
opacity: 1,
x: x_data_t,
y: y_data,
z: getData_wave_transmitted(),
type: 'surface',
name:"Transmitted"
};
let opacity_1;//opacity gives qualitative representation of refractive index
let opacity_2;
if((1 < n2) && (n2 <= 15)){//decide opacity dependant on refractive index
opacity_1 = 0;
opacity_2 = n2/10
}
else if((0.1 <= n2) && (n2< 1)){
opacity_1 = 0.1/n2;
opacity_2 = 0;
}
else{
opacity_1 = 0;
opacity_2 = 0;
}
let material_1 =//dielectric one
{
opacity: opacity_1,
color: '#379F9F',
type: "mesh3d",
name: "material 1",
z: [-2, -2, 2, 2, -2, -2, 2, 2],
y: [-2, 2, 2, -2, -2, 2, 2, -2],
x: [2, 2, 2, 2, 0, 0, 0, 0],
i: [7, 0, 0, 0, 4, 4, 6, 6, 4, 0, 3, 2],
j: [3, 4, 1, 2, 5, 6, 5, 2, 0, 1, 6, 3],
k: [0, 7, 2, 3, 6, 7, 1, 1, 5, 5, 7, 6],
};
let material_2 =//dielectric two
{
opacity: opacity_2,
color: '#379F9F',
type: "mesh3d",
name: "material 2",
z: [-2, -2, 2, 2, -2, -2, 2, 2],
y: [-2, 2, 2, -2, -2, 2, 2, -2],
x: [0, 0, 0, 0, -2, -2, -2, -2],
i: [7, 0, 0, 0, 4, 4, 6, 6, 4, 0, 3, 2],
j: [3, 4, 1, 2, 5, 6, 5, 2, 0, 1, 6, 3],
k: [0, 7, 2, 3, 6, 7, 1, 1, 5, 5, 7, 6],
};
data.push(transmitted_wave,material_1,material_2);
if (data.length < 5) {//animate function requires data sets of the same length hence those unused in situation must be filled with empty traces
let extensionSize = data.length;
for (let i = 0; i < (5 - extensionSize); ++i){
data.push(
{
type: "scatter3d",
mode: "lines",
x: [0],
y: [0],
z: [0]
}
);
}
}
return data
}
function update_graph(){//update animation
Plotly.animate("graph",
{data: plot_data()},//updated data
{
fromcurrent: true,
transition: {duration: 0,},
frame: {duration: 0, redraw: false,},
mode: "afterall"
}
);
};
function play_loop(){//handles the play button
if(isPlay === true) {
t++;//keeps time ticking
Plotly.animate("graph",
{data: plot_data()},
{
fromcurrent: true,
transition: {duration: 0,},
frame: {duration: 0, redraw: false,},
mode: "afterall"
});
requestAnimationFrame(play_loop);//prepares next frame
}
return 0;
};
function initial() {
Plotly.purge("graph");
Plotly.newPlot('graph', plot_data(),layout);//create plot
dom.tswitch.on("change", update_graph);//change of input produces reaction
dom.aSlider.on("input", update_graph);
dom.nSlider.on("input", update_graph);
$('#playButton').on('click', function() {
document.getElementById("playButton").value = (isPlay) ? "Play" : "Stop";//change button label
isPlay = !isPlay;
w_t = 0;//reset time to 0
requestAnimationFrame(play_loop);
});
};
initial();
}); | Java |
// EX.1 - READ A TEXT FILE CHAR BY CHAR
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
FILE *bin; //declare a file pointer variable
FILE *numfile;
char s[20] = "1234";
int ch;
int i;
char line[50];
numfile = fopen("numbers.txt","r");
bin = fopen("numbers.txt","wb");
//open the file, text reading mode
if (numfile == NULL)
{ //test if everything was ok
printf("Cannot open file.\n");
exit(1);
} // Error checking
while(fgets(line,50,numfile) != NULL)
{
i = atoi(s);
fwrite(&i,sizeof(int),1,bin);
}
getchar();
fclose(bin);
fclose(numfile); //close the files
return 0;
} // end main()
| Java |
<html>
<head>
<title>主页</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<meta http-equiv="imagetoolbar" content="no"/>
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
<link rel="apple-touch-icon" href="data/apple-touch-icon.png" />
<link rel="apple-touch-startup-image" href="data/startup-iphone.png" media="screen and (max-device-width: 320px)"/>
<link href="resources/css/jquery-ui-themes.css" type="text/css" rel="stylesheet">
<link href="resources/css/axure_rp_page.css" type="text/css" rel="stylesheet">
<link href="主页_1_files/axurerp_pagespecificstyles.css" type="text/css" rel="stylesheet">
<!--[if IE 6]>
<link href="主页_1_files/axurerp_pagespecificstyles_ie6.css" type="text/css" rel="stylesheet">
<![endif]-->
<script src="data/sitemap.js"></script>
<script src="resources/scripts/jquery-1.7.1.min.js"></script>
<script src="resources/scripts/axutils.js"></script>
<script src="resources/scripts/jquery-ui-1.8.10.custom.min.js"></script>
<script src="resources/scripts/axurerp_beforepagescript.js"></script>
<script src="resources/scripts/messagecenter.js"></script>
<script src='主页_1_files/data.js'></script>
</head>
<body>
<div id="main_container">
<div id="u0" class="u0_container" >
<div id="u0_img" class="u0_normal detectCanvas"></div>
<div id="u1" class="u1" style="visibility:hidden;" >
<div id="u1_rtf"></div>
</div>
</div>
<div id="u2" class="u2_container" >
<div id="u2_img" class="u2_normal detectCanvas"></div>
<div id="u3" class="u3" style="visibility:hidden;" >
<div id="u3_rtf"></div>
</div>
</div>
<div id="u4" class="u4_container" >
<div id="u4_img" class="u4_normal detectCanvas"></div>
<div id="u5" class="u5" >
<div id="u5_rtf"><p style="text-align:center;"><span style="font-family:Heiti SC;font-size:13px;font-weight:normal;font-style:normal;text-decoration:none;color:#333333;">用户管理</span></p></div>
</div>
</div>
<div id="u6" class="u6_container" >
<div id="u6_img" class="u6_normal detectCanvas"></div>
<div id="u7" class="u7" style="visibility:hidden;" >
<div id="u7_rtf"></div>
</div>
</div>
<div id="u8" class="u8_container" >
<div id="u8_img" class="u8_normal detectCanvas"></div>
<div id="u9" class="u9" >
<div id="u9_rtf"><p style="text-align:center;"><span style="font-family:Arial;font-size:13px;font-weight:normal;font-style:normal;text-decoration:none;color:#333333;">enter text...</span></p></div>
</div>
</div><div id="u10" class="u10" >
<DIV id="u10_line" class="u10_line" ></DIV>
</div>
<div id="u11" class="u11_container" >
<div id="u11_img" class="u11_normal detectCanvas"></div>
<div id="u12" class="u12" style="visibility:hidden;" >
<div id="u12_rtf"></div>
</div>
</div>
<div id="u13" class="u13_container" >
<div id="u13_img" class="u13_normal detectCanvas"></div>
<div id="u14" class="u14" style="visibility:hidden;" >
<div id="u14_rtf"></div>
</div>
</div>
<DIV id="u15container" style="position:absolute; left:219px; top:84px; width:100px; height:13px; ; ; ;" >
<LABEL for="u15">
<div id="u16" class="u16" >
<div id="u16_rtf"><p style="text-align:left;"><span style="font-family:Heiti SC;font-size:13px;font-weight:normal;font-style:normal;text-decoration:none;color:#333333;">全选</span></p></div>
</div>
</LABEL>
<INPUT id="u15" style="position:absolute; left:-3px; top:-2px;" type="checkbox" value="checkbox" >
</DIV>
<div id="u17" class="u17_container" >
<div id="u17_img" class="u17_normal detectCanvas"></div>
<div id="u18" class="u18" >
<div id="u18_rtf"><p style="text-align:center;"><span style="font-family:Heiti SC;font-size:13px;font-weight:normal;font-style:normal;text-decoration:none;color:#333333;">用户名</span></p></div>
</div>
</div>
<div id="u19" class="u19_container" >
<div id="u19_img" class="u19_normal detectCanvas"></div>
<div id="u20" class="u20" >
<div id="u20_rtf"><p style="text-align:center;"><span style="font-family:Heiti SC;font-size:13px;font-weight:normal;font-style:normal;text-decoration:none;color:#333333;">注册时间</span></p></div>
</div>
</div>
<div id="u21" class="u21_container" >
<div id="u21_img" class="u21_normal detectCanvas"></div>
<div id="u22" class="u22" >
<div id="u22_rtf"><p style="text-align:center;"><span style="font-family:Heiti SC;font-size:13px;font-weight:normal;font-style:normal;text-decoration:none;color:#333333;">学员数量</span></p></div>
</div>
</div>
<div id="u23" class="u23_container" >
<div id="u23_img" class="u23_normal detectCanvas"></div>
<div id="u24" class="u24" >
<div id="u24_rtf"><p style="text-align:center;"><span style="font-family:Heiti SC;font-size:13px;font-weight:normal;font-style:normal;text-decoration:none;color:#333333;">学员管理</span></p></div>
</div>
</div>
<div id="u25" class="u25_container" >
<div id="u25_img" class="u25_normal detectCanvas"></div>
<div id="u26" class="u26" >
<div id="u26_rtf"><p style="text-align:center;"><span style="font-family:Heiti SC;font-size:13px;font-weight:normal;font-style:normal;text-decoration:none;color:#333333;">学员数量</span></p></div>
</div>
</div>
</div>
<div class="preload"><img src="主页_1_files/u0_normal.png" width="1" height="1"/><img src="主页_1_files/u2_normal.png" width="1" height="1"/><img src="主页_1_files/u4_normal.png" width="1" height="1"/><img src="主页_1_files/u6_normal.png" width="1" height="1"/><img src="主页_1_files/u10_line.png" width="1" height="1"/><img src="主页_1_files/u11_normal.png" width="1" height="1"/><img src="主页_1_files/u13_normal.png" width="1" height="1"/><img src="主页_1_files/u17_normal.png" width="1" height="1"/><img src="主页_1_files/u19_normal.png" width="1" height="1"/></div>
</body>
<script src="resources/scripts/axurerp_pagescript.js"></script>
<script src="主页_1_files/axurerp_pagespecificscript.js" charset="utf-8"></script> | Java |
/*****************************************************************
* syscall.c
* adapted from MIT xv6 by Zhiyi Huang, hzy@cs.otago.ac.nz
* University of Otago
*
********************************************************************/
#include "types.h"
#include "defs.h"
#include "param.h"
#include "memlayout.h"
#include "mmu.h"
#include "proc.h"
#include "arm.h"
#include "syscall.h"
// User code makes a system call with INT T_SYSCALL.
// System call number in %eax.
// Arguments on the stack, from the user call to the C
// library system call function. The saved user %esp points
// to a saved program counter, and then the first argument.
// Fetch the int at addr from the current process.
int
fetchint(uint addr, int *ip)
{
if(addr >= curr_proc->sz || addr+4 > curr_proc->sz)
return -1;
*ip = *(int*)(addr);
return 0;
}
// Fetch the nul-terminated string at addr from the current process.
// Doesn't actually copy the string - just sets *pp to point at it.
// Returns length of string, not including nul.
int
fetchstr(uint addr, char **pp)
{
char *s, *ep;
if(addr >= curr_proc->sz)
return -1;
*pp = (char*)addr;
ep = (char*)curr_proc->sz;
for(s = *pp; s < ep; s++)
if(*s == 0)
return s - *pp;
return -1;
}
// Fetch the nth 32-bit system call argument.
int
argint(int n, int *ip)
{
return fetchint(curr_proc->tf->sp + 4*n, ip);
}
// Fetch the nth word-sized system call argument as a pointer
// to a block of memory of size n bytes. Check that the pointer
// lies within the process address space.
int
argptr(int n, char **pp, int size)
{
int i;
if(argint(n, &i) < 0)
return -1;
if((uint)i >= curr_proc->sz || (uint)i+size > curr_proc->sz)
return -1;
*pp = (char*)i;
return 0;
}
// Fetch the nth word-sized system call argument as a string pointer.
// Check that the pointer is valid and the string is nul-terminated.
// (There is no shared writable memory, so the string can't change
// between this check and being used by the kernel.)
int
argstr(int n, char **pp)
{
int addr;
if(argint(n, &addr) < 0)
return -1;
return fetchstr(addr, pp);
}
extern int sys_chdir(void);
extern int sys_close(void);
extern int sys_dup(void);
extern int sys_exec(void);
extern int sys_exit(void);
extern int sys_fork(void);
extern int sys_fstat(void);
extern int sys_getpid(void);
extern int sys_kill(void);
extern int sys_link(void);
extern int sys_mkdir(void);
extern int sys_mknod(void);
extern int sys_open(void);
extern int sys_pipe(void);
extern int sys_read(void);
extern int sys_sbrk(void);
extern int sys_sleep(void);
extern int sys_unlink(void);
extern int sys_wait(void);
extern int sys_write(void);
extern int sys_uptime(void);
static int (*syscalls[])(void) = {
[SYS_fork] sys_fork,
[SYS_exit] sys_exit,
[SYS_wait] sys_wait,
[SYS_pipe] sys_pipe,
[SYS_read] sys_read,
[SYS_kill] sys_kill,
[SYS_exec] sys_exec,
[SYS_fstat] sys_fstat,
[SYS_chdir] sys_chdir,
[SYS_dup] sys_dup,
[SYS_getpid] sys_getpid,
[SYS_sbrk] sys_sbrk,
[SYS_sleep] sys_sleep,
[SYS_uptime] sys_uptime,
[SYS_open] sys_open,
[SYS_write] sys_write,
[SYS_mknod] sys_mknod,
[SYS_unlink] sys_unlink,
[SYS_link] sys_link,
[SYS_mkdir] sys_mkdir,
[SYS_close] sys_close,
};
void
syscall(void)
{
int num;
num = curr_proc->tf->r0;
if(num > 0 && num < NELEM(syscalls) && syscalls[num]) {
// cprintf("\n%d %s: sys call %d syscall address %x\n",
// curr_proc->pid, curr_proc->name, num, syscalls[num]);
if(num == SYS_exec) {
if(syscalls[num]() == -1) curr_proc->tf->r0 = -1;
} else curr_proc->tf->r0 = syscalls[num]();
} else {
cprintf("%d %s: unknown sys call %d\n",
curr_proc->pid, curr_proc->name, num);
curr_proc->tf->r0 = -1;
}
}
| Java |
// Package machinelearningservices implements the Azure ARM Machinelearningservices service API version 2019-06-01.
//
// These APIs allow end users to operate on Azure Machine Learning Workspace resources.
package machinelearningservices
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
import (
"github.com/Azure/go-autorest/autorest"
)
const (
// DefaultBaseURI is the default URI used for the service Machinelearningservices
DefaultBaseURI = "https://management.azure.com"
)
// BaseClient is the base client for Machinelearningservices.
type BaseClient struct {
autorest.Client
BaseURI string
SubscriptionID string
}
// New creates an instance of the BaseClient client.
func New(subscriptionID string) BaseClient {
return NewWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with
// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient {
return BaseClient{
Client: autorest.NewClientWithUserAgent(UserAgent()),
BaseURI: baseURI,
SubscriptionID: subscriptionID,
}
}
| Java |
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<base data-ice="baseUrl" href="../../../">
<title data-ice="title">CondaExecutable | API Document</title>
<link type="text/css" rel="stylesheet" href="css/style.css">
<link type="text/css" rel="stylesheet" href="css/prettify-tomorrow.css">
<script src="script/prettify/prettify.js"></script>
<script src="script/manual.js"></script>
</head>
<body class="layout-container" data-ice="rootContainer">
<header>
<a href="./">Home</a>
<a href="identifiers.html">Reference</a>
<a href="source.html">Source</a>
<a data-ice="repoURL" href="https://github.com/jsoma/mcpyver" class="repo-url-github">Repository</a>
<div class="search-box">
<span>
<img src="./image/search.png">
<span class="search-input-edge"></span><input class="search-input"><span class="search-input-edge"></span>
</span>
<ul class="search-result"></ul>
</div>
</header>
<nav class="navigation" data-ice="nav"><div>
<ul>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-clear">clear</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-exec">exec</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getConda">getConda</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getJupyter">getJupyter</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getJupyterList">getJupyterList</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getPipList">getPipList</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getPythonList">getPythonList</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getVirtualEnv">getVirtualEnv</a></span></span></li>
<li data-ice="doc"><div data-ice="dirPath" class="nav-dir-path">environments</div><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/environments/condaenv.js~CondaEnv.html">CondaEnv</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/environments/environment.js~Environment.html">Environment</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/environments/virtualenv.js~VirtualEnv.html">VirtualEnv</a></span></span></li>
<li data-ice="doc"><div data-ice="dirPath" class="nav-dir-path">executables</div><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/executables/conda.js~CondaExecutable.html">CondaExecutable</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html">Executable</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/executables/executable_collection.js~ExecutableCollection.html">ExecutableCollection</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/executables/jupyter.js~JupyterExecutable.html">JupyterExecutable</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/executables/pip.js~PipExecutable.html">PipExecutable</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/executables/python.js~PythonExecutable.html">PythonExecutable</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/executables/virtualenv.js~VirtualEnvExecutable.html">VirtualEnvExecutable</a></span></span></li>
</ul>
</div>
</nav>
<div class="content" data-ice="content"><div class="header-notice">
<div data-ice="importPath" class="import-path"><pre class="prettyprint"><code data-ice="importPathCode">import CondaExecutable from '<span><a href="file/src/executables/conda.js.html#lineNumber5">mcpyver/src/executables/conda.js</a></span>'</code></pre></div>
<span data-ice="access">public</span>
<span data-ice="kind">class</span>
<span data-ice="source">| <span><a href="file/src/executables/conda.js.html#lineNumber5">source</a></span></span>
</div>
<div class="self-detail detail">
<h1 data-ice="name">CondaExecutable</h1>
<div class="flat-list" data-ice="extendsChain"><h4>Extends:</h4><div><span><a href="class/src/executables/executable.js~Executable.html">Executable</a></span> → CondaExecutable</div></div>
</div>
<div data-ice="memberSummary"><h2>Member Summary</h2><table class="summary" data-ice="summary">
<thead><tr><td data-ice="title" colspan="3">Public Members</td></tr></thead>
<tbody>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/conda.js~CondaExecutable.html#instance-member-details">details</a></span></span><span data-ice="signature">: <span>*</span></span>
</p>
</div>
<div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/conda.js~CondaExecutable.html#instance-member-environments">environments</a></span></span><span data-ice="signature">: <span>*</span></span>
</p>
</div>
<div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/conda.js~CondaExecutable.html#instance-member-version">version</a></span></span><span data-ice="signature">: <span>*</span></span>
</p>
</div>
<div>
</div>
</td>
<td>
</td>
</tr>
</tbody>
</table>
</div>
<div data-ice="methodSummary"><h2>Method Summary</h2><table class="summary" data-ice="summary">
<thead><tr><td data-ice="title" colspan="3">Public Methods</td></tr></thead>
<tbody>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/conda.js~CondaExecutable.html#instance-method-cleanVersion">cleanVersion</a></span></span><span data-ice="signature">()</span>
</p>
</div>
<div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/conda.js~CondaExecutable.html#instance-method-getDetails">getDetails</a></span></span><span data-ice="signature">(): <span>*</span></span>
</p>
</div>
<div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/conda.js~CondaExecutable.html#instance-method-populateEnvironments">populateEnvironments</a></span></span><span data-ice="signature">(): <span>*</span></span>
</p>
</div>
<div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/conda.js~CondaExecutable.html#instance-method-setDetails">setDetails</a></span></span><span data-ice="signature">(): <span>*</span></span>
</p>
</div>
<div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/conda.js~CondaExecutable.html#instance-method-setEnvironments">setEnvironments</a></span></span><span data-ice="signature">(): <span>*</span></span>
</p>
</div>
<div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/conda.js~CondaExecutable.html#instance-method-setExtras">setExtras</a></span></span><span data-ice="signature">(): <span>*</span></span>
</p>
</div>
<div>
</div>
</td>
<td>
</td>
</tr>
</tbody>
</table>
</div>
<div class="inherited-summary" data-ice="inheritedSummary"><h2>Inherited Summary</h2><table class="summary" data-ice="summary">
<thead><tr><td data-ice="title" colspan="3"><span class="toggle closed"></span> From class <span><a href="class/src/executables/executable.js~Executable.html">Executable</a></span></td></tr></thead>
<tbody>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span data-ice="static">static</span>
<span class="kind" data-ice="kind">get</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html#static-get-searchPaths">searchPaths</a></span></span><span data-ice="signature">: <span><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span><span>[]</span></span></span>
</p>
</div>
<div>
<div data-ice="description"><p>Paths to manually search in for executables</p>
</div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span data-ice="static">static</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html#static-method-findAll">findAll</a></span></span><span data-ice="signature">(command: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span> | <span><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span><span>[]</span></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span><<span><a href="class/src/executables/executable_collection.js~ExecutableCollection.html">ExecutableCollection</a></span>></span>
</p>
</div>
<div>
<div data-ice="description"><p>Given a command name or list of commands, returns an ExecutableCollection
of all the executables with that name your computer might know about
Looks in the path as well as looking in common paths.</p>
</div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span data-ice="static">static</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html#static-method-findAllWithoutMerge">findAllWithoutMerge</a></span></span><span data-ice="signature">(command: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span><<span><a href="class/src/executables/executable_collection.js~ExecutableCollection.html">ExecutableCollection</a></span>></span>
</p>
</div>
<div>
<div data-ice="description"><p>Given a command name or list of commands, returns an ExecutableCollection
of all the executables with that name your computer might know about
Looks in the path as well as looking in common paths.</p>
</div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span data-ice="static">static</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html#static-method-findByPaths">findByPaths</a></span></span><span data-ice="signature">(command: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span><<span><a href="class/src/executables/executable_collection.js~ExecutableCollection.html">ExecutableCollection</a></span>></span>
</p>
</div>
<div>
<div data-ice="description"><p>Manually searches paths to find executables with a given name</p>
</div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span data-ice="static">static</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html#static-method-findByWhich">findByWhich</a></span></span><span data-ice="signature">(command: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span><<span><a href="class/src/executables/executable_collection.js~ExecutableCollection.html">ExecutableCollection</a></span>></span>
</p>
</div>
<div>
<div data-ice="description"><p>Uses which to find all of the paths for a given command</p>
</div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span data-ice="static">static</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html#static-method-findOne">findOne</a></span></span><span data-ice="signature">(command: <span>*</span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span><<span><a href="class/src/executables/executable.js~Executable.html">Executable</a></span>></span>
</p>
</div>
<div>
<div data-ice="description"><p>Given a command name, creates an Executable from the executable
file that would have been run had you typed the command in (e.g.</p>
</div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="kind" data-ice="kind">get</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html#instance-get-mergeField">mergeField</a></span></span><span data-ice="signature">: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></span>
</p>
</div>
<div>
<div data-ice="description"><p>When merging an ExecutableCollection, this is what you group
the executables by.</p>
</div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="kind" data-ice="kind">get</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html#instance-get-path">path</a></span></span><span data-ice="signature">: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></span>
</p>
</div>
<div>
<div data-ice="description"><p>When you're looking for a path, but don't necessarily care
if it's the symlinked one or the non-symlinked on?</p>
</div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="kind" data-ice="kind">get</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html#instance-get-realpath">realpath</a></span></span><span data-ice="signature">: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>: <span>*</span></span>
</p>
</div>
<div>
<div data-ice="description"><p>The path of the executable, or the target of a symlinked executable</p>
</div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="kind" data-ice="kind">set</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html#instance-set-realpath">realpath</a></span></span><span data-ice="signature">(the: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>): <span>*</span></span>
</p>
</div>
<div>
<div data-ice="description"><p>Set the realpath</p>
</div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html#instance-member-atime">atime</a></span></span><span data-ice="signature">: <span>*</span></span>
</p>
</div>
<div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html#instance-member-ctime">ctime</a></span></span><span data-ice="signature">: <span>*</span></span>
</p>
</div>
<div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html#instance-member-defaultCommands">defaultCommands</a></span></span><span data-ice="signature">: <span><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span><span>[]</span></span></span>
</p>
</div>
<div>
<div data-ice="description"><p>The commands for which this executable is first in line to run
e.g., running which returns it</p>
</div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html#instance-member-errors">errors</a></span></span><span data-ice="signature">: <span><span>*</span><span>[]</span></span></span>
</p>
</div>
<div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html#instance-member-isDefault">isDefault</a></span></span><span data-ice="signature">: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></span>
</p>
</div>
<div>
<div data-ice="description"><p>Is this executable the default for any commands?</p>
</div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html#instance-member-mtime">mtime</a></span></span><span data-ice="signature">: <span>*</span></span>
</p>
</div>
<div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html#instance-member-paths">paths</a></span></span><span data-ice="signature">: <span><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span><span>[]</span></span></span>
</p>
</div>
<div>
<div data-ice="description"><p>Any paths that you can find this executable at (symlinked or otherwise)</p>
</div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html#instance-member-rawVersion">rawVersion</a></span></span><span data-ice="signature">: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></span>
</p>
</div>
<div>
<div data-ice="description"><p>The raw output from stdout/stderr of --version</p>
</div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html#instance-member-version">version</a></span></span><span data-ice="signature">: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></span>
</p>
</div>
<div>
<div data-ice="description"><p>The version number of the program, typically cleaned up in
a subclass</p>
</div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html#instance-method-addCommand">addCommand</a></span></span><span data-ice="signature">(command: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>)</span>
</p>
</div>
<div>
<div data-ice="description"><p>Add a command that this executable is first in line for,
e.g.</p>
</div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html#instance-method-addError">addError</a></span></span><span data-ice="signature">(error: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error">Error</a></span>)</span>
</p>
</div>
<div>
<div data-ice="description"><p>Take any rescued error and attach it to the object, e.g.</p>
</div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html#instance-method-addPath">addPath</a></span></span><span data-ice="signature">(path: <span>*</span>)</span>
</p>
</div>
<div>
<div data-ice="description"><p>Adds a known path to this executable (e.g.</p>
</div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html#instance-method-cleanVersion">cleanVersion</a></span></span><span data-ice="signature">()</span>
</p>
</div>
<div>
<div data-ice="description"><p>Clean up the rawVersion, pulling out the actual version number</p>
</div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html#instance-method-populate">populate</a></span></span><span data-ice="signature">(): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span></span>
</p>
</div>
<div>
<div data-ice="description"><p>Fills in all of the details of the executable</p>
</div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html#instance-method-requestVersion">requestVersion</a></span></span><span data-ice="signature">(): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span><<span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>></span>
</p>
</div>
<div>
<div data-ice="description"><p>Gets the version of the executable by shelling out and
running --version</p>
</div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="abstract" data-ice="abstract">abstract</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html#instance-method-setExtras">setExtras</a></span></span><span data-ice="signature">(): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span></span>
</p>
</div>
<div>
<div data-ice="description"><p>Subclasses that need extra details (lists of packages, etc)
override this method</p>
</div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html#instance-method-setRawVersion">setRawVersion</a></span></span><span data-ice="signature">(version: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>)</span>
</p>
</div>
<div>
<div data-ice="description"><p>Given a version-y string, do slight cleanup and set the
executable's rawVersion. Typically comes from stdout/stderr.</p>
</div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html#instance-method-setStats">setStats</a></span></span><span data-ice="signature">(): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span></span>
</p>
</div>
<div>
<div data-ice="description"><p>Query for the executable file's creation/modification/access time
and save it to the object</p>
</div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html#instance-method-setVersion">setVersion</a></span></span><span data-ice="signature">(): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span></span>
</p>
</div>
<div>
<div data-ice="description"><p>Query for and set the rawVersion and version</p>
</div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html#instance-method-toJSON">toJSON</a></span></span><span data-ice="signature">(): <span>*</span></span>
</p>
</div>
<div>
<div data-ice="description"><p>Converts the executable's data to a JSON-friendly object
it's mostly so we can rename _realpath to realpath</p>
</div>
</div>
</td>
<td>
</td>
</tr>
</tbody>
</table>
</div>
<div data-ice="memberDetails"><h2 data-ice="title">Public Members</h2>
<div class="detail" data-ice="detail">
<h3 data-ice="anchor" id="instance-member-details">
<span class="access" data-ice="access">public</span>
<span data-ice="name">details</span><span data-ice="signature">: <span>*</span></span>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/executables/conda.js.html#lineNumber41">source</a></span></span>
</span>
</h3>
<div data-ice="properties">
</div>
</div>
<div class="detail" data-ice="detail">
<h3 data-ice="anchor" id="instance-member-environments">
<span class="access" data-ice="access">public</span>
<span data-ice="name">environments</span><span data-ice="signature">: <span>*</span></span>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/executables/conda.js.html#lineNumber16">source</a></span></span>
</span>
</h3>
<div data-ice="properties">
</div>
</div>
<div class="detail" data-ice="detail">
<h3 data-ice="anchor" id="instance-member-version">
<span class="access" data-ice="access">public</span>
<span data-ice="name">version</span><span data-ice="signature">: <span>*</span></span>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/executables/conda.js.html#lineNumber47">source</a></span></span>
</span>
</h3>
<div data-ice="description"><p>The version number of the program, typically cleaned up in
a subclass</p>
</div>
<div data-ice="override"><h4>Override:</h4><span><a href="class/src/executables/executable.js~Executable.html#instance-member-version">Executable#version</a></span></div>
<div data-ice="properties">
</div>
</div>
</div>
<div data-ice="methodDetails"><h2 data-ice="title">Public Methods</h2>
<div class="detail" data-ice="detail">
<h3 data-ice="anchor" id="instance-method-cleanVersion">
<span class="access" data-ice="access">public</span>
<span data-ice="name">cleanVersion</span><span data-ice="signature">()</span>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/executables/conda.js.html#lineNumber46">source</a></span></span>
</span>
</h3>
<div data-ice="description"><p>Clean up the rawVersion, pulling out the actual version number</p>
</div>
<div data-ice="override"><h4>Override:</h4><span><a href="class/src/executables/executable.js~Executable.html#instance-method-cleanVersion">Executable#cleanVersion</a></span></div>
<div data-ice="properties">
</div>
</div>
<div class="detail" data-ice="detail">
<h3 data-ice="anchor" id="instance-method-getDetails">
<span class="access" data-ice="access">public</span>
<span data-ice="name">getDetails</span><span data-ice="signature">(): <span>*</span></span>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/executables/conda.js.html#lineNumber26">source</a></span></span>
</span>
</h3>
<div data-ice="properties">
</div>
<div class="return-params" data-ice="returnParams">
<h4>Return:</h4>
<table>
<tbody>
<tr>
<td class="return-type" data-ice="returnType"><span>*</span></td>
</tr>
</tbody>
</table>
<div data-ice="returnProperties">
</div>
</div>
</div>
<div class="detail" data-ice="detail">
<h3 data-ice="anchor" id="instance-method-populateEnvironments">
<span class="access" data-ice="access">public</span>
<span data-ice="name">populateEnvironments</span><span data-ice="signature">(): <span>*</span></span>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/executables/conda.js.html#lineNumber21">source</a></span></span>
</span>
</h3>
<div data-ice="properties">
</div>
<div class="return-params" data-ice="returnParams">
<h4>Return:</h4>
<table>
<tbody>
<tr>
<td class="return-type" data-ice="returnType"><span>*</span></td>
</tr>
</tbody>
</table>
<div data-ice="returnProperties">
</div>
</div>
</div>
<div class="detail" data-ice="detail">
<h3 data-ice="anchor" id="instance-method-setDetails">
<span class="access" data-ice="access">public</span>
<span data-ice="name">setDetails</span><span data-ice="signature">(): <span>*</span></span>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/executables/conda.js.html#lineNumber38">source</a></span></span>
</span>
</h3>
<div data-ice="properties">
</div>
<div class="return-params" data-ice="returnParams">
<h4>Return:</h4>
<table>
<tbody>
<tr>
<td class="return-type" data-ice="returnType"><span>*</span></td>
</tr>
</tbody>
</table>
<div data-ice="returnProperties">
</div>
</div>
</div>
<div class="detail" data-ice="detail">
<h3 data-ice="anchor" id="instance-method-setEnvironments">
<span class="access" data-ice="access">public</span>
<span data-ice="name">setEnvironments</span><span data-ice="signature">(): <span>*</span></span>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/executables/conda.js.html#lineNumber14">source</a></span></span>
</span>
</h3>
<div data-ice="properties">
</div>
<div class="return-params" data-ice="returnParams">
<h4>Return:</h4>
<table>
<tbody>
<tr>
<td class="return-type" data-ice="returnType"><span>*</span></td>
</tr>
</tbody>
</table>
<div data-ice="returnProperties">
</div>
</div>
</div>
<div class="detail" data-ice="detail">
<h3 data-ice="anchor" id="instance-method-setExtras">
<span class="access" data-ice="access">public</span>
<span data-ice="name">setExtras</span><span data-ice="signature">(): <span>*</span></span>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/executables/conda.js.html#lineNumber7">source</a></span></span>
</span>
</h3>
<div data-ice="description"><p>Subclasses that need extra details (lists of packages, etc)
override this method</p>
</div>
<div data-ice="override"><h4>Override:</h4><span><a href="class/src/executables/executable.js~Executable.html#instance-method-setExtras">Executable#setExtras</a></span></div>
<div data-ice="properties">
</div>
<div class="return-params" data-ice="returnParams">
<h4>Return:</h4>
<table>
<tbody>
<tr>
<td class="return-type" data-ice="returnType"><span>*</span></td>
</tr>
</tbody>
</table>
<div data-ice="returnProperties">
</div>
</div>
</div>
</div>
</div>
<footer class="footer">
Generated by <a href="https://esdoc.org">ESDoc<span data-ice="esdocVersion">(0.5.2)</span><img src="./image/esdoc-logo-mini-black.png"></a>
</footer>
<script src="script/search_index.js"></script>
<script src="script/search.js"></script>
<script src="script/pretty-print.js"></script>
<script src="script/inherited-summary.js"></script>
<script src="script/test-summary.js"></script>
<script src="script/inner-link.js"></script>
<script src="script/patch-for-local.js"></script>
</body>
</html>
| Java |
<?php
namespace App\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
class AdminLoginController extends Controller
{
/*
|--------------------------------------------------------------------------
| Login Controller
|--------------------------------------------------------------------------
|
| This controller handles authenticating users for the application and
| redirecting them to your home screen. The controller uses a trait
| to conveniently provide its functionality to your applications.
|
*/
use AuthenticatesUsers;
/**
* Where to redirect users after login / registration.
*
* @var string
*/
protected $redirectTo = '/admin/home';
protected $username;
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('guest:web', ['except' => 'logout']);
}
/**
* 重写登录视图页面
* @author 晚黎
* @date 2016-09-05T23:06:16+0800
* @return [type] [description]
*/
public function showLoginForm()
{
return view('auth.admin-login');
}
/**
* 自定义认证驱动
* @author 晚黎
* @date 2016-09-05T23:53:07+0800
* @return [type] [description]
*/
public function username(){
return 'name';
}
protected function guard()
{
return auth()->guard('web');
}
}
| Java |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>XPEDYTOR</title>
<meta name="author" content="lajmahal"/>
<meta name="description" content="The Xpedytor App"/>
<meta name="keywords" content="xpedytor"/>
<link rel="stylesheet" href="../../js/lib/bootstrap/dist/css/bootstrap.min.css"/>
<link rel="stylesheet" href="../../js/lib/bootstrap/dist/css/bootstrap-theme.min.css"/>
<link rel="stylesheet" href="css/app.css"/>
</head>
<body>
<div class="container">
<div>
<!-- Header goes here -->
<xpd-common-header header-title="Xpedytor"/>
</div>
<div ui-view>
<!-- Main body goes here -->
<h2>
Main Menu
</h2>
<ul>
<li>New Order</li>
<li>View Orders</li>
<li>Settings</li>
</ul>
</div>
<div>
<xpd-common-footer/>
</div>
</div>
<script src="../../js/lib/requirejs/require.js" data-main="js/require-main"></script>
</body>
</html> | Java |
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class LogoutBox
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(LogoutBox))
Me.TableLayoutPanel1 = New System.Windows.Forms.TableLayoutPanel()
Me.OK_Button = New System.Windows.Forms.Button()
Me.Cancel_Button = New System.Windows.Forms.Button()
Me.lblLogout = New System.Windows.Forms.Label()
Me.Label1 = New System.Windows.Forms.Label()
Me.TableLayoutPanel1.SuspendLayout()
Me.SuspendLayout()
'
'TableLayoutPanel1
'
Me.TableLayoutPanel1.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.TableLayoutPanel1.ColumnCount = 2
Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50.0!))
Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50.0!))
Me.TableLayoutPanel1.Controls.Add(Me.OK_Button, 0, 0)
Me.TableLayoutPanel1.Controls.Add(Me.Cancel_Button, 1, 0)
Me.TableLayoutPanel1.Location = New System.Drawing.Point(115, 158)
Me.TableLayoutPanel1.Name = "TableLayoutPanel1"
Me.TableLayoutPanel1.RowCount = 1
Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50.0!))
Me.TableLayoutPanel1.Size = New System.Drawing.Size(221, 50)
Me.TableLayoutPanel1.TabIndex = 0
'
'OK_Button
'
Me.OK_Button.Anchor = System.Windows.Forms.AnchorStyles.None
Me.OK_Button.BackColor = System.Drawing.Color.White
Me.OK_Button.DialogResult = System.Windows.Forms.DialogResult.OK
Me.OK_Button.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.OK_Button.Font = New System.Drawing.Font("Arial", 11.0!)
Me.OK_Button.Location = New System.Drawing.Point(3, 3)
Me.OK_Button.Name = "OK_Button"
Me.OK_Button.Size = New System.Drawing.Size(104, 44)
Me.OK_Button.TabIndex = 0
Me.OK_Button.Text = "Log out"
Me.OK_Button.UseVisualStyleBackColor = False
'
'Cancel_Button
'
Me.Cancel_Button.Anchor = System.Windows.Forms.AnchorStyles.None
Me.Cancel_Button.BackColor = System.Drawing.Color.White
Me.Cancel_Button.DialogResult = System.Windows.Forms.DialogResult.Cancel
Me.Cancel_Button.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.Cancel_Button.Font = New System.Drawing.Font("Arial", 11.0!)
Me.Cancel_Button.Location = New System.Drawing.Point(113, 3)
Me.Cancel_Button.Name = "Cancel_Button"
Me.Cancel_Button.Size = New System.Drawing.Size(105, 44)
Me.Cancel_Button.TabIndex = 1
Me.Cancel_Button.Text = "Cancel"
Me.Cancel_Button.UseVisualStyleBackColor = False
'
'lblLogout
'
Me.lblLogout.AutoSize = True
Me.lblLogout.Font = New System.Drawing.Font("Arial", 18.0!)
Me.lblLogout.Location = New System.Drawing.Point(39, 36)
Me.lblLogout.Name = "lblLogout"
Me.lblLogout.Size = New System.Drawing.Size(373, 27)
Me.lblLogout.TabIndex = 1
Me.lblLogout.Text = "Are you sure you want to log out?"
'
'Label1
'
Me.Label1.AutoSize = True
Me.Label1.Font = New System.Drawing.Font("Arial", 11.0!)
Me.Label1.Location = New System.Drawing.Point(86, 103)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(278, 17)
Me.Label1.TabIndex = 2
Me.Label1.Text = "(You will be redirected to the login screen)"
'
'LogoutBox
'
Me.AcceptButton = Me.OK_Button
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None
Me.BackColor = System.Drawing.Color.Silver
Me.CancelButton = Me.Cancel_Button
Me.ClientSize = New System.Drawing.Size(450, 220)
Me.Controls.Add(Me.Label1)
Me.Controls.Add(Me.lblLogout)
Me.Controls.Add(Me.TableLayoutPanel1)
Me.Font = New System.Drawing.Font("Arial", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
Me.MaximizeBox = False
Me.MinimizeBox = False
Me.Name = "LogoutBox"
Me.ShowInTaskbar = False
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "Logout?"
Me.TableLayoutPanel1.ResumeLayout(False)
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents TableLayoutPanel1 As System.Windows.Forms.TableLayoutPanel
Friend WithEvents OK_Button As System.Windows.Forms.Button
Friend WithEvents Cancel_Button As System.Windows.Forms.Button
Friend WithEvents lblLogout As Label
Friend WithEvents Label1 As Label
End Class
| Java |
---
tags: post
title: The utility module antipattern
description:
Why naming a module or file utils is a bad idea and how to fix that problem.
date: 2020-05-20
published: true
featuredImage: "./www/posts/utils-antipattern/banner.jpg"
featuredImageAlt: Messy toolbox
thumbnailImage: "./thumbnail.jpg"
thumbnailImageAlt: Messy toolbox
---
# The Problem
Today, I want to talk about a problem that I think pervades a lot of codebases
that's relatively easy to fix. Chances are you've come across it in one form or
another. I'm talking about the catch-all, kitchen sink module that contains all
the reusable functions for a project. They are usually named `utils.py`,
`helpers.js`, or `common.rb` depending on the language.
While the intention of pulling commonly used logic into a helper/utility module
makes sense on paper, I will contend that having a `utils` module is generally a
bad idea.
## Growing without bounds
What I've personally observed is that the module starts off on the right track
with just a couple of functions. But given moderate amount of time and number of
engineers working on the codebase, you'll find that the `utils` module will
grows seemingly without bounds. It becomes a mish-mash of all sorts of one-off
functions. You start to get an uneasy feeling about adding any new functions to
the pile because you begin to lose sense and judgement of whether your new
function should even belong there. In its worst form, it may start to resemble
an software equivalent of an episode of hoarders.
I think the reason why the contents of these `utils` module grows out of bounds
is because of the name itself. `util` is just too loose of a name; it gives no
guidance about what should or should not belong in it.
We all know that naming is a difficult but vitally important aspect of
programming. It conveys our intentions to other programmers or our future
selves. If we look at utility modules from that lens, we can see that the naming
of `utils` does not really communicate _anything_ useful about what it should
contain.
Names should be narrow. It needs to give us programmers a sense of its domain
and communicate about things that it can and can't represent.
# Solutions
Fortunately, if you do happen to have this growing pile of `utils` module in
your project, we can apply some relatively easy and incrementally adoptable
fixes.
### Solution 1: Split the `utils` module up and give each submodule a good name.
If the problem is one of naming being too loose, the obvious solution is to come
up with a better names.
Chances are, if you have a large `utils` module, they can be separated into
logical groupings. For example, in a hypothetical web application codebase,
There may be a set of functions that deals with array manipulations, some that
handles structuring logging data, and some functions that handle input
validation. In this cases, the easy way out would be to just create sub-modules
within `util` with a name about its logical domain.
```js
// Before
import { flatten, getLogger, validateAddress } from "./utils.js";
// After
import { flatten } from "./utils/array.js";
import { getLogger } from "./utils/logging.js";
import { validateAddress } from "./utils/validation.js";
```
Seems simple and obvious enough, but I think just giving it a good name does
help everyone who works on the project implicitly understand what should or
shouldn't be in these sub-modules.
### Solution 2: Create a `unstable_temporary_utils` module.
As a supplement to solution 1, something that I've found helpful is to create a
`utils`-like module but a bit more verbosely named `unstable_temporary_utils`,
with the expectation that it is only a transient home for functions until we can
find a better module to place it in.
If I reflect on some of my own temptations to add a `utils` like catch-all
module, it happens when I'm exploring a new feature or domain and I just don't
know _where_ something belongs yet. Being able to come up with a good, narrow
name can very much be a chicken and egg problem of having to spend enough time
fleshing out code and fixed some corner case bugs for a new domain/feature.
Placing a strict policy of never have a kitchen sink modules and always needing
to properly name things may be setting ourselves up for failure. It may lead to
premature/wrong abstraction early on in the process. I've found that having a
given module designated as a "lost and found" of sorts can be a good mechanism
for the team to temporarily put logic and defer actually coming up with a good
name, as long as it's understood that we'll have to revisit and find a proper
home for it.
```js
// unstableTemporaryUtils.js
function parseAuthToken(request) {
// ...
}
```
Given a contrived example above of a `parseAuthToken` function, we can give it
some time to settle into the codebase and realize that `utils/auth.js` maybe a
more suitable module for it.
```js
// utils/auth.js
function parseAuthToken(request) {
// ...
}
```
## The unwieldy name is on purpose
I want to note that that long and awkward naming of `unstable_temporary_utils`
is very much intentional here. It lets us easily track its usage via `git grep`.
More importantly, it also subtly applies a certain sense of pressure and shame
whenever you import from `unstable_temporary_utils`. We want it to be a module
of a last resort, and give you a little bit of pause and thought on whether you
really want to put a new function in there.
Sometimes that pause may give you the opportunity to actually come up with a
good name. Or perhaps you realize that not creating an abstraction and living
with the duplication is perfectly ok.
## Prevent unchecked growth
If you do happen to adopt this approach, I also recommend adding a linting step
in CI that will fail the build if the `unstable_temporary_utils` module exceeds
a certain size. This will help us draws a line in the sand and prevent the
module from exceeding a certain size and avoid the same fate as an ever
expanding `utils` module.
# It's all about alignment
At the end of the day, programming is really just about communication to other
fellow humans. I really encourage you to look at how you name
function/modules/services and approach it from the lens of if your teammates or
future self can reasonably articulate if something should or shouldn't belong in
it.
And if you find that you've fallen into the `utils` module trap, you can fix it
but giving it better names/boundaries, which has the invaluable side-effect of
realigning your teammates on the purposes of certain module, which I've found to
be invaluable for the longevity of a project.
| Java |
# ETL
We are going to do the `Transform` step of an Extract-Transform-Load.
### ETL
Extract-Transform-Load (ETL) is a fancy way of saying, "We have some crufty, legacy data over in this system, and now we need it in this shiny new system over here, so
we're going to migrate this."
(Typically, this is followed by, "We're only going to need to run this
once." That's then typically followed by much forehead slapping and
moaning about how stupid we could possibly be.)
### The goal
We're going to extract some scrabble scores from a legacy system.
The old system stored a list of letters per score:
- 1 point: "A", "E", "I", "O", "U", "L", "N", "R", "S", "T",
- 2 points: "D", "G",
- 3 points: "B", "C", "M", "P",
- 4 points: "F", "H", "V", "W", "Y",
- 5 points: "K",
- 8 points: "J", "X",
- 10 points: "Q", "Z",
The shiny new scrabble system instead stores the score per letter, which
makes it much faster and easier to calculate the score for a word. It
also stores the letters in lower-case regardless of the case of the
input letters:
- "a" is worth 1 point.
- "b" is worth 3 points.
- "c" is worth 3 points.
- "d" is worth 2 points.
- Etc.
Your mission, should you choose to accept it, is to transform the legacy data
format to the shiny new format.
### Notes
A final note about scoring, Scrabble is played around the world in a
variety of languages, each with its own unique scoring table. For
example, an "E" is scored at 2 in the Māori-language version of the
game while being scored at 4 in the Hawaiian-language version.
## Rust Installation
Refer to the [exercism help page][help-page] for Rust installation and learning
resources.
## Writing the Code
Execute the tests with:
```bash
$ cargo test
```
All but the first test have been ignored. After you get the first test to
pass, remove the ignore flag (`#[ignore]`) from the next test and get the tests
to pass again. The test file is located in the `tests` directory. You can
also remove the ignore flag from all the tests to get them to run all at once
if you wish.
Make sure to read the [Crates and Modules](https://doc.rust-lang.org/stable/book/crates-and-modules.html) chapter if you
haven't already, it will help you with organizing your files.
## Feedback, Issues, Pull Requests
The [exercism/rust](https://github.com/exercism/rust) repository on GitHub is the home for all of the Rust exercises. If you have feedback about an exercise, or want to help implement new exercises, head over there and create an issue. Members of the [rust track team](https://github.com/orgs/exercism/teams/rust) are happy to help!
If you want to know more about Exercism, take a look at the [contribution guide](https://github.com/exercism/docs/blob/master/contributing-to-language-tracks/README.md).
[help-page]: http://exercism.io/languages/rust
[crates-and-modules]: http://doc.rust-lang.org/stable/book/crates-and-modules.html
## Source
The Jumpstart Lab team [http://jumpstartlab.com](http://jumpstartlab.com)
## Submitting Incomplete Solutions
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
| Java |
package pixlepix.auracascade.data;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
/**
* Created by localmacaccount on 5/31/15.
*/
public class Quest {
//TODO QUEST
public static int nextId;
public final ItemStack target;
public final ItemStack result;
public final int id;
public String string;
public Quest(String string, ItemStack target, ItemStack result) {
this.target = target;
this.result = result;
this.string = string;
this.id = nextId;
nextId++;
}
public boolean hasCompleted(EntityPlayer player) {
// QuestData questData = (QuestData) player.getExtendedProperties(QuestData.EXT_PROP_NAME);
// return questData.completedQuests.contains(this);
return false;
}
public void complete(EntityPlayer player) {
//QuestData questData = (QuestData) player.getExtendedProperties(QuestData.EXT_PROP_NAME);
// questData.completedQuests.add(this);
// AuraCascade.analytics.eventDesign("questComplete", id);
}
}
| Java |
<?php
/*
* This file is part of the Itkg\Core package.
*
* (c) Interakting - Business & Decision
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Itkg\Core\Cache\Adapter;
use Itkg\Core\Cache\AdapterInterface;
use Itkg\Core\CacheableInterface;
/**
* Class Persistent
*
* Store cache in specific adapter & keep in memory (with array storage)
*
* @package Itkg\Core\Cache\Adapter
*/
class Persistent extends Registry
{
/**
* @var \Itkg\Core\Cache\AdapterInterface
*/
protected $adapter;
/**
* @param AdapterInterface $adapter
*/
public function __construct(AdapterInterface $adapter)
{
$this->adapter = $adapter;
}
/**
* Get value from cache
*
* @param \Itkg\Core\CacheableInterface $item
*
* @return string
*/
public function get(CacheableInterface $item)
{
if (false !== $result = parent::get($item)) {
return $result;
}
return $this->adapter->get($item);
}
/**
* Set a value into the cache
*
* @param \Itkg\Core\CacheableInterface $item
*
* @return void
*/
public function set(CacheableInterface $item)
{
parent::set($item);
$this->adapter->set($item);
}
/**
* Remove a value from cache
*
* @param \Itkg\Core\CacheableInterface $item
* @return void
*/
public function remove(CacheableInterface $item)
{
parent::remove($item);
$this->adapter->remove($item);
}
/**
* Remove cache
*
* @return void
*/
public function removeAll()
{
parent::removeAll();
$this->adapter->removeAll();
}
/**
* @return AdapterInterface
*/
public function getAdapter()
{
return $this->adapter;
}
/**
* @param AdapterInterface $adapter
*
* @return $this
*/
public function setAdapter(AdapterInterface $adapter)
{
$this->adapter = $adapter;
return $this;
}
}
| Java |
// Copyright (c) 2011-2013 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "splashscreen.h"
#include "clientversion.h"
#include "util.h"
#include <QPainter>
#undef loop /* ugh, remove this when the #define loop is gone from util.h */
#include <QApplication>
SplashScreen::SplashScreen(const QPixmap &pixmap, Qt::WindowFlags f) :
QSplashScreen(pixmap, f)
{
// set reference point, paddings
//int paddingLeftCol2 = 230;
//int paddingTopCol2 = 376;
//int line1 = 0;
//int line2 = 13;
//int line3 = 26;
//int line4 = 26;
float fontFactor = 1.0;
// define text to place
QString titleText = QString(QApplication::applicationName()).replace(QString("-testnet"), QString(""), Qt::CaseSensitive); // cut of testnet, place it as single object further down
QString versionText = QString("Version %1 ").arg(QString::fromStdString(FormatFullVersion()));
QString copyrightText1 = QChar(0xA9)+QString(" 2009-%1 ").arg(COPYRIGHT_YEAR) + QString(tr("The Bitcoin developers"));
QString copyrightText2 = QChar(0xA9)+QString(" 2011-%1 ").arg(COPYRIGHT_YEAR) + QString(tr("The Litecoin developers"));
QString copyrightText3 = QChar(0xA9)+QString(" 2013-%1 ").arg(COPYRIGHT_YEAR) + QString(tr("The Quarkcoin developers"));
QString font = "Arial";
// load the bitmap for writing some text over it
QPixmap newPixmap;
if(GetBoolArg("-testnet")) {
newPixmap = QPixmap(":/images/splash_testnet");
}
else {
newPixmap = QPixmap(":/images/splash");
}
QPainter pixPaint(&newPixmap);
pixPaint.setPen(QColor(70,70,70));
pixPaint.setFont(QFont(font, 9*fontFactor));
// pixPaint.drawText(paddingLeftCol2,paddingTopCol2+line3,versionText);
// draw copyright stuff
pixPaint.setFont(QFont(font, 9*fontFactor));
// pixPaint.drawText(paddingLeftCol2,paddingTopCol2+line1,copyrightText1);
// pixPaint.drawText(paddingLeftCol2,paddingTopCol2+line2,copyrightText2);
// pixPaint.drawText(paddingLeftCol2,paddingTopCol2+line2+line2,copyrightText3);
pixPaint.end();
this->setPixmap(newPixmap);
}
| Java |
<?php
namespace Oro\Bundle\NoteBundle\Controller;
use FOS\RestBundle\Util\Codes;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Bundle\FrameworkBundle\Routing\Router;
use Symfony\Component\HttpFoundation\Response;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Oro\Bundle\SecurityBundle\Annotation\AclAncestor;
use Oro\Bundle\EntityBundle\Tools\EntityRoutingHelper;
use Oro\Bundle\NoteBundle\Entity\Note;
use Oro\Bundle\NoteBundle\Entity\Manager\NoteManager;
/**
* @Route("/notes")
*/
class NoteController extends Controller
{
/**
* @Route(
* "/view/widget/{entityClass}/{entityId}",
* name="oro_note_widget_notes"
* )
*
* @AclAncestor("oro_note_view")
* @Template("OroNoteBundle:Note:notes.html.twig")
*/
public function widgetAction($entityClass, $entityId)
{
$entity = $this->getEntityRoutingHelper()->getEntity($entityClass, $entityId);
return [
'entity' => $entity
];
}
/**
* @Route(
* "/view/{entityClass}/{entityId}",
* name="oro_note_notes"
* )
*
* @AclAncestor("oro_note_view")
*/
public function getAction($entityClass, $entityId)
{
$entityClass = $this->getEntityRoutingHelper()->resolveEntityClass($entityClass);
$sorting = strtoupper($this->getRequest()->get('sorting', 'DESC'));
$manager = $this->getNoteManager();
$result = $manager->getEntityViewModels(
$manager->getList($entityClass, $entityId, $sorting)
);
return new Response(json_encode($result), Codes::HTTP_OK);
}
/**
* @Route("/widget/info/{id}", name="oro_note_widget_info", requirements={"id"="\d+"})
* @Template
* @AclAncestor("oro_note_view")
*/
public function infoAction(Note $entity)
{
return array('entity' => $entity);
}
/**
* @Route("/create/{entityClass}/{entityId}", name="oro_note_create")
*
* @Template("OroNoteBundle:Note:update.html.twig")
* @AclAncestor("oro_note_create")
*/
public function createAction($entityClass, $entityId)
{
$entityRoutingHelper = $this->getEntityRoutingHelper();
$entity = $entityRoutingHelper->getEntity($entityClass, $entityId);
$entityClass = get_class($entity);
$noteEntity = new Note();
$noteEntity->setTarget($entity);
$formAction = $entityRoutingHelper->generateUrlByRequest(
'oro_note_create',
$this->getRequest(),
$entityRoutingHelper->getRouteParameters($entityClass, $entityId)
);
return $this->update($noteEntity, $formAction);
}
/**
* @Route("/update/{id}", name="oro_note_update", requirements={"id"="\d+"})
*
* @Template
* @AclAncestor("oro_note_update")
*/
public function updateAction(Note $entity)
{
$formAction = $this->get('router')->generate('oro_note_update', ['id' => $entity->getId()]);
return $this->update($entity, $formAction);
}
protected function update(Note $entity, $formAction)
{
$responseData = [
'entity' => $entity,
'saved' => false
];
if ($this->get('oro_note.form.handler.note')->process($entity)) {
$responseData['saved'] = true;
$responseData['model'] = $this->getNoteManager()->getEntityViewModel($entity);
}
$responseData['form'] = $this->get('oro_note.form.note')->createView();
$responseData['formAction'] = $formAction;
return $responseData;
}
/**
* @return NoteManager
*/
protected function getNoteManager()
{
return $this->get('oro_note.manager');
}
/**
* @return EntityRoutingHelper
*/
protected function getEntityRoutingHelper()
{
return $this->get('oro_entity.routing_helper');
}
}
| Java |
'use strict';
memoryApp.controller('AuthCtrl', function ($scope, $location, AuthService) {
$scope.register = function () {
var username = $scope.registerUsername;
var password = $scope.registerPassword;
if (username && password) {
AuthService.register(username, password).then(
function () {
$location.path('/dashboard');
},
function (error) {
$scope.registerError = error;
}
);
} else {
$scope.registerError = 'Username and password required';
}
};
$scope.login = function () {
var username = $scope.loginUsername;
var password = $scope.loginPassword;
if (username && password) {
AuthService.login(username, password).then(
function () {
$location.path('/dashboard');
},
function (error) {
$scope.loginError = error;
}
);
} else {
$scope.error = 'Username and password required';
}
};
}); | Java |
backbone.io-todos
=================
A very simple todos app demonstrating the backbone.io module and mongoDB middleware
| Java |
/**
* MIT License
*
* Copyright (c) 2017 zgqq
*
* 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.
*/
package mah.ui.util;
import mah.ui.key.KeystateManager;
import mah.ui.layout.Layout;
import mah.ui.pane.input.InputPane;
import mah.ui.pane.input.InputPaneProvider;
import mah.ui.window.WindowManager;
import org.jetbrains.annotations.Nullable;
/**
* Created by zgq on 2017-01-12 11:17
*/
public final class UiUtils {
private UiUtils(){}
public static void hideWindow() {
KeystateManager.getInstance().reset();
WindowManager.getInstance().getCurrentWindow().hide();
}
@Nullable
public static InputPane getInputPane() {
Layout currentLayout = WindowManager.getInstance().getCurrentWindow().getCurrentLayout();
if (currentLayout instanceof InputPaneProvider) {
InputPaneProvider layout = (InputPaneProvider) currentLayout;
return layout.getInputPane();
}
return null;
}
}
| Java |
<html>
<head>
<title>
Why we oppose the FTAA
</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<?php include "../../legacy-includes/Script.htmlf" ?>
</head>
<body bgcolor="#FFFFCC" text="000000" link="990000" vlink="660000" alink="003366" leftmargin="0" topmargin="0">
<table width="744" cellspacing="0" cellpadding="0" border="0">
<tr><td width="474"><a name="Top"></a><?php include "../../legacy-includes/TopLogo.htmlf" ?></td>
<td width="270"><?php include "../../legacy-includes/TopAd.htmlf" ?>
</td></tr></table>
<table width="744" cellspacing="0" cellpadding="0" border="0">
<tr><td width="18" bgcolor="FFCC66"></td>
<td width="108" bgcolor="FFCC66" valign=top><?php include "../../legacy-includes/LeftButtons.htmlf" ?></td>
<td width="18"></td>
<td width="480" valign="top">
<?php include "../../legacy-includes/BodyInsert.htmlf" ?>
<P><font face="Times New Roman, Times, serif" size="4">Preparing to protest in Miami</font><br>
<font face="Times New Roman, Times, serif" size="5"><b>Why we oppose the FTAA</b></font></P>
<p><font face="Arial, Helvetica, sans-serif" size="2">November 14, 2003 | Page 6 </font></P>
<P><font face="Times New Roman, Times, serif" size="3">THIRTY-FOUR countries with 800 million people--all under Uncle Sam's thumb. That's the essence of the proposed Free Trade Area of the Americas (FTAA), Washington's bid to extend the terms of the North American Free Trade Agreement (NAFTA) throughout North and South America--except for Cuba.</P>
<P>U.S. economic, political and military dominance in the Western Hemisphere isn't new, of course. But the FTAA would go much further in locking in the power of Wall Street U.S.-based transnational corporations. That's why the U.S. will host a meeting of trade ministers from the Americas in Miami November 16-21--inside an exclusive, heavily guarded hotel. They'll be answered in the streets by tens of thousands of protesters from the labor, global justice and antiwar movements, from the U.S. and across North and South America. Activists are planning a mass march on November 20, as well as civil disobedience and direct action. <I>Socialist Worker's </I>LEE SUSTAR looks at the origins and aims of the FTAA--and the growing movement that's emerged to oppose it.</P>
<p><font face="Arial, Helvetica, sans-serif" size="1">- - - - - - - - - - - - - - - -</font></p>
<font face="Times New Roman, Times, serif" size="3">
<P><b>Putting NAFTA "on steroids"</b></P>
<P>PRESIDENT JAMES Monroe laid it out in 1823. The U.S. would regard "any attempt on [Europe's] part to extend their system to any portion of this hemisphere as dangerous to our peace and safety." In other words, the countries of Latin America that had won their independence from Spain were in Washington's backyard--so Europeans had better keep out.</P>
<P>Now, almost 180 years to the day since Monroe drew a line in the Atlantic, the U.S. is trying to erect a new barrier around Latin America to hinder the Europeans economically--and Japan and China, too, for that matter. The World Trade Organization (WTO) this month ruled that U.S. tariffs recently imposed on steel products were a violation of trade rules.</P>
<P>Among the violations was the U.S. decision to exempt Canada and Mexico from tariffs under the NAFTA accord, even as trade barriers were increased with Europe and Asia. This shed light on the real nature of NAFTA and the proposed FTAA--a trade bloc to compete with the European Union (EU), which now has a bigger market than NAFTA, and is set to expand further.</P>
<P>From the beginning, the first President Bush envisioned NAFTA as a prelude to a hemisphere-wide trade deal that could counter the EU. His official justification for NAFTA was to create jobs in the U.S.</P>
<P>The jobs never materialized. In fact, a study on the seventh anniversary of the treaty estimated that the U.S. lost between 200,000 and 600,000 jobs as a result of NAFTA--many of them unionized manufacturing jobs.</P>
<P>In Mexico, meanwhile, real wages dropped to their lowest level since 1939. But that still isn't low enough for global capital. In recent years, Mexico has seen plant shutdowns of its own--with the factories moving across the Pacific to China and other East Asian countries where labor costs are lower still.</P>
<P>Yet there's far more to the FTAA than a race to the bottom in wages. The treaty would greatly expand the NAFTA trade bloc not only by eliminating tariffs and duties on trade, but also by dramatically strengthening the economic and political leverage of major corporations.</P>
<P>To that end, the FTAA includes NAFTA's notorious Chapter 11, which covers so-called "investor-state" relations. This measure gives transnational corporations the right to seek monetary damages for alleged violations of the treaty, with rulings made by unaccountable tribunals tied to the United Nations and the World Bank.</P>
<P>The fair-trade group Public Citizen argues that this gives "rights and privileges to foreign investors that go significantly beyond the rights available to U.S. citizens or businesses in U.S. domestic law." This formulation not only comes dangerously close to foreigner bashing, but it's simply wrong.</P>
<P>Public Citizen's own accounting of major Chapter 11 cases under NAFTA through the middle of last year showed that U.S. companies initiated 11 out of 15, with Canada filing the rest. If Mexican companies didn't seek action against the U.S., it's because smaller or weaker nations can rarely afford to challenge the dominant ones--especially when it's the world's biggest superpower.</P>
<P>For example, to conform to NAFTA, Mexico bowed to U.S. pressure to eliminate its corn tariffs and price supports for farmers, and eliminated subsidies for tortillas, a staple in Mexico. Lower-priced U.S. corn imports then entered the Mexican market--and 1 million Mexican farmers were thrown into poverty as a result. </P>
<P>If George W. Bush succeeds, the FTAA would repeat this pattern throughout the rest of the Americas. It would include many of the features that have proved most contentious in the WTO--like the General Agreement on Trade in Services, which would allow corporations to privatize services currently provided by governments, such as health care and education.</P>
<P>Intellectual property rights would grant hemisphere-wide patent rights as well--again, giving enormous leverage to U.S. businesses, such as pharmaceutical companies. U.S. media conglomerates also want to try to use the FTAA to eliminate barriers to trade in services.</P>
<P><b>The backlash in Latin America</b></P>
<P>YET THE bigger the push for free trade, the larger the backlash has been in Latin America. According to a recent Latinobarómetro opinion poll conducted in 17 Central and South American countries, just 16 percent of respondents said they were satisfied with the free market as an economic model.</P>
<P>Big majorities in virtually every country reject the idea that privatization has been beneficial to their societies. Little wonder. The World Bank reports that one-third of the population in 30 countries in Latin America and the Caribbean live in poverty. "Structural reforms have done little or nothing to reduce the income inequality that remains the region's biggest challenge," <I>Newsweek </I>magazine noted.</P>
<P>The world economic crisis has hit the region especially hard. Overall growth was just 0.4 percent in 2001, and the regional economy contracted 1.3 percent in 2002, with weak growth projected for 2003.</P>
<P>Latin America's huge debt to Western banks compounds the problem. Brazil's foreign debt is $285 billion, more than half the size of the country's gross domestic product (GDP). Argentina, hailed as a "star pupil" of free-market reforms by Bill Clinton, now has a debt of $87 billion--equal to 140 percent of its GDP.</P>
<P>Popular explosions over the failure of free-market economic policies in Argentina led to the ouster of a hated president--and three successors--in December 2001. Revolts from below have also driven two presidents out of office in Ecuador since 1997.</P>
<P>And in Bolivia last month, a mass uprising and general strike drove President Sánchez de Lozada from office over his efforts to export natural gas to the U.S. "Neoliberalism has robbed us blind," said Oscar Olivera, a union leader who played a key role in a successful protest against the privatization of water in the Bolivian town of Cochabamba three years earlier. In his first term as president, Sánchez de Lozada privatized everything except the air--all for the benefit of international capital and the Bolivian oligarchy."</P>
<P>Ironically, it was de Lozada's Bolivia that was chosen to chair the FTAA's working group on "civil society" to gather input from labor and social movement organizations.</P>
<P><b>The battle over subsidies for agriculture</b></P>
<P>THE REVOLT against neoliberalism has opened the door to political leaders who voice criticisms of the free market and U.S. attempts to impose such policies. These include Hugo Chávez in Venezuela, Néstor Kirchner in Argentina and, most importantly, Luis Inácio "Lula" da Silva in Brazil, who took office in January. Lula, though, has since broken with longstanding positions of his Workers Party to put a top bank executive in charge of the national bank, increase the retirement age and enter into FTAA negotiations with the U.S.</P>
<P>Brazil isn't simply bowing to U.S. pressure. As the economic powerhouse of South America, Brazil is home to important transnational corporations and is a major exporter of both agricultural products and industrial goods like steel and commercial jets. Brazilian capitalists have signaled that they're willing to go along with the FTAA--with a big "but."</P>
<P>They want Washington to agree to drop its agricultural subsidies that crowd out Brazilian exports from U.S. markets--and to reduce tariffs that limit Brazilian steel imports. In fact, it was disputes over agricultural subsidies paid by the U.S. and the EU that led to the collapse of the WTO summit in Cancún, Mexico, in September.</P>
<P>Brazil, India and China led a group of developing countries--calling themselves the "Group of 20 Plus"--in a walkout over the talks. "These countries have the clout to demand greater access to the markets of industrialized nations because together they account for more than half the world's population--and they also have substantial manufacturing centers of their own," the <I>New York Times </I>observed.</P>
<P>As Lula puts it, his aim is for Brazil to have "sovereign insertion into the globalized world"--strengthening its ties to the world market without giving up control over its own affairs. Washington has other ideas.</P>
<P>The U.S. is refusing to budge on agricultural subsidies, which threatens to derail negotiations for the FTAA. "Brazil, by far the largest economy in South America, has little to gain from a hemispheric deal unless the U.S. is willing to lower its huge farm subsidies and limit the use of antidumping rules meant to curb excess imports--both hot-button subjects in an election year," the <I>Wall Street Journal </I>pointed out. As a result, the <I>Journal </I>concludes, the FTAA summit in Miami could see a repeat of the WTO collapse in Cancún: "sunny beaches, protesters, tear gas--and another dashed trade deal."</P>
<P><b>The other arm of imperialism</b></P>
<P>THE BRAZILIAN government's resistance to the FTAA may be tactical, but the opposition at the grassroots is very different. At the 2003 World Social Forum in Porto Alegre, Brazil, opposition to the FTAA and the impending war on Iraq were seen as two aspects of the same struggle--opposition to U.S. imperialism. It's not difficult to see why.</P>
<P>Conquest, armed intervention and support for military dictators have always been used by the U.S. to further its agenda in Latin America--for example, the seizure of nearly half of Mexico's territory in a mid-19th century war. Fifty years later, the U.S. provoked a war with Spain to grab control of Cuba and Puerto Rico, and over the next half century, it intervened regularly in Central America and the Caribbean.</P>
<P>During the Cold War, the U.S. propped up dictatorships in Chile, Brazil and Argentina in the name of fighting "communism," with tens of thousands murdered--and intervened with a proxy army to bleed Nicaragua's revolution in the 1980s. The dictatorships unraveled under popular pressure in the late 1980s and early 1990s.</P>
<P>But the strong arm of the military was never absent from U.S. policy in Latin America. Colombia is now the third-largest recipient of U.S. military aid--which means Washington is bankrolling that repressive government's civil war.</P>
<P>The publication last year of the White House's National Security Strategy document--popularly known as the Bush Doctrine--makes the links between militarism and free-market policies even more explicit. It calls for a "new era of global economic growth through free markets and free trade"--and prominently mentions the FTAA.</P>
<P><b>Building real internationalism</b></P>
<P>IF THE social movements in Latin America see the FTAA as an expression of U.S. imperialism, views in North America are mixed. The 1999 protests at the WTO summit in Seattle were a milestone, not only because some 50,000 people protested and stood up to a police crackdown, but because U.S. unions broke with the Cold War past and allied themselves with social movements from around the world.</P>
<P>The September 11 attacks and the U.S. war on Afghanistan disoriented the global justice movement. For its part, labor has sometimes pursued protectionist strategies around trade issues--for example, lining up with the right wing in an unsuccessful effort to block permanent normal trade relations with China.</P>
<P>The United Steelworkers of America--which played a prominent role in Seattle and is expected to do so again in Miami--allied with steel bosses to seek higher steel tariffs, which only hurt steelworkers in countries like Brazil. The AFL-CIO, despite voicing some criticisms of the Iraq war drive, backed the U.S. invasion.</P>
<P>Nevertheless, the protests in Miami point to a revival of the global justice movement, including organized labor. The unions' participation alongside their counterparts from around Latin America shows the possibility of reviving international labor solidarity.</P>
<P>United for Peace and Justice, a national antiwar coalition, will also participate in protests against the FTAA, underscoring the link between economic and military imperialism. Thousands more global justice activists will protest as well. </P>
<P>The U.S. occupation in Iraq is unraveling, and Washington's free-trade agenda has run into trouble, too. We can build a movement that can challenge Washington's efforts to run the globe--and replace this unjust system with a world based on genuine democracy and meeting human needs.</P>
<?php include "../../legacy-includes/BottomNavLinks.htmlf" ?>
<td width="12"></td>
<td width="108" valign="top">
<?php include "../../legacy-includes/RightAdFolder.htmlf" ?>
</td>
</tr>
</table>
</body>
</html>
| Java |
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
|--------------------------------------------------------------------------
| Base Site URL
|--------------------------------------------------------------------------
|
| URL to your CodeIgniter root. Typically this will be your base URL,
| WITH a trailing slash:
|
| http://example.com/
|
| WARNING: You MUST set this value!
|
| If it is not set, then CodeIgniter will try guess the protocol and path
| your installation, but due to security concerns the hostname will be set
| to $_SERVER['SERVER_ADDR'] if available, or localhost otherwise.
| The auto-detection mechanism exists only for convenience during
| development and MUST NOT be used in production!
|
| If you need to allow multiple domains, remember that this file is still
| a PHP script and you can easily do that on your own.
|
*/
$config['base_url'] = 'http://localhost/sirumkit1';
/*
|--------------------------------------------------------------------------
| Index File
|--------------------------------------------------------------------------
|
| Typically this will be your index.php file, unless you've renamed it to
| something else. If you are using mod_rewrite to remove the page set this
| variable so that it is blank.
|
*/
$config['index_page'] = 'index.php';
/*
|--------------------------------------------------------------------------
| URI PROTOCOL
|--------------------------------------------------------------------------
|
| This item determines which server global should be used to retrieve the
| URI string. The default setting of 'REQUEST_URI' works for most servers.
| If your links do not seem to work, try one of the other delicious flavors:
|
| 'REQUEST_URI' Uses $_SERVER['REQUEST_URI']
| 'QUERY_STRING' Uses $_SERVER['QUERY_STRING']
| 'PATH_INFO' Uses $_SERVER['PATH_INFO']
|
| WARNING: If you set this to 'PATH_INFO', URIs will always be URL-decoded!
*/
$config['uri_protocol'] = 'REQUEST_URI';
/*
|--------------------------------------------------------------------------
| URL suffix
|--------------------------------------------------------------------------
|
| This option allows you to add a suffix to all URLs generated by CodeIgniter.
| For more information please see the user guide:
|
| https://codeigniter.com/user_guide/general/urls.html
*/
$config['url_suffix'] = '';
/*
|--------------------------------------------------------------------------
| Default Language
|--------------------------------------------------------------------------
|
| This determines which set of language files should be used. Make sure
| there is an available translation if you intend to use something other
| than english.
|
*/
$config['language'] = 'english';
/*
|--------------------------------------------------------------------------
| Default Character Set
|--------------------------------------------------------------------------
|
| This determines which character set is used by default in various methods
| that require a character set to be provided.
|
| See http://php.net/htmlspecialchars for a list of supported charsets.
|
*/
$config['charset'] = 'UTF-8';
/*
|--------------------------------------------------------------------------
| Enable/Disable System Hooks
|--------------------------------------------------------------------------
|
| If you would like to use the 'hooks' feature you must enable it by
| setting this variable to TRUE (boolean). See the user guide for details.
|
*/
$config['enable_hooks'] = FALSE;
/*
|--------------------------------------------------------------------------
| Class Extension Prefix
|--------------------------------------------------------------------------
|
| This item allows you to set the filename/classname prefix when extending
| native libraries. For more information please see the user guide:
|
| https://codeigniter.com/user_guide/general/core_classes.html
| https://codeigniter.com/user_guide/general/creating_libraries.html
|
*/
$config['subclass_prefix'] = 'MY_';
/*
|--------------------------------------------------------------------------
| Composer auto-loading
|--------------------------------------------------------------------------
|
| Enabling this setting will tell CodeIgniter to look for a Composer
| package auto-loader script in application/vendor/autoload.php.
|
| $config['composer_autoload'] = TRUE;
|
| Or if you have your vendor/ directory located somewhere else, you
| can opt to set a specific path as well:
|
| $config['composer_autoload'] = '/path/to/vendor/autoload.php';
|
| For more information about Composer, please visit http://getcomposer.org/
|
| Note: This will NOT disable or override the CodeIgniter-specific
| autoloading (application/config/autoload.php)
*/
$config['composer_autoload'] = FALSE;
/*
|--------------------------------------------------------------------------
| Allowed URL Characters
|--------------------------------------------------------------------------
|
| This lets you specify which characters are permitted within your URLs.
| When someone tries to submit a URL with disallowed characters they will
| get a warning message.
|
| As a security measure you are STRONGLY encouraged to restrict URLs to
| as few characters as possible. By default only these are allowed: a-z 0-9~%.:_-
|
| Leave blank to allow all characters -- but only if you are insane.
|
| The configured value is actually a regular expression character group
| and it will be executed as: ! preg_match('/^[<permitted_uri_chars>]+$/i
|
| DO NOT CHANGE THIS UNLESS YOU FULLY UNDERSTAND THE REPERCUSSIONS!!
|
*/
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';
/*
|--------------------------------------------------------------------------
| Enable Query Strings
|--------------------------------------------------------------------------
|
| By default CodeIgniter uses search-engine friendly segment based URLs:
| example.com/who/what/where/
|
| By default CodeIgniter enables access to the $_GET array. If for some
| reason you would like to disable it, set 'allow_get_array' to FALSE.
|
| You can optionally enable standard query string based URLs:
| example.com?who=me&what=something&where=here
|
| Options are: TRUE or FALSE (boolean)
|
| The other items let you set the query string 'words' that will
| invoke your controllers and its functions:
| example.com/index.php?c=controller&m=function
|
| Please note that some of the helpers won't work as expected when
| this feature is enabled, since CodeIgniter is designed primarily to
| use segment based URLs.
|
*/
$config['allow_get_array'] = TRUE;
$config['enable_query_strings'] = FALSE;
$config['controller_trigger'] = 'c';
$config['function_trigger'] = 'm';
$config['directory_trigger'] = 'd';
/*
|--------------------------------------------------------------------------
| Error Logging Threshold
|--------------------------------------------------------------------------
|
| You can enable error logging by setting a threshold over zero. The
| threshold determines what gets logged. Threshold options are:
|
| 0 = Disables logging, Error logging TURNED OFF
| 1 = Error Messages (including PHP errors)
| 2 = Debug Messages
| 3 = Informational Messages
| 4 = All Messages
|
| You can also pass an array with threshold levels to show individual error types
|
| array(2) = Debug Messages, without Error Messages
|
| For a live site you'll usually only enable Errors (1) to be logged otherwise
| your log files will fill up very fast.
|
*/
$config['log_threshold'] = 0;
/*
|--------------------------------------------------------------------------
| Error Logging Directory Path
|--------------------------------------------------------------------------
|
| Leave this BLANK unless you would like to set something other than the default
| application/logs/ directory. Use a full server path with trailing slash.
|
*/
$config['log_path'] = '';
/*
|--------------------------------------------------------------------------
| Log File Extension
|--------------------------------------------------------------------------
|
| The default filename extension for log files. The default 'php' allows for
| protecting the log files via basic scripting, when they are to be stored
| under a publicly accessible directory.
|
| Note: Leaving it blank will default to 'php'.
|
*/
$config['log_file_extension'] = '';
/*
|--------------------------------------------------------------------------
| Log File Permissions
|--------------------------------------------------------------------------
|
| The file system permissions to be applied on newly created log files.
|
| IMPORTANT: This MUST be an integer (no quotes) and you MUST use octal
| integer notation (i.e. 0700, 0644, etc.)
*/
$config['log_file_permissions'] = 0644;
/*
|--------------------------------------------------------------------------
| Date Format for Logs
|--------------------------------------------------------------------------
|
| Each item that is logged has an associated date. You can use PHP date
| codes to set your own date formatting
|
*/
$config['log_date_format'] = 'Y-m-d H:i:s';
/*
|--------------------------------------------------------------------------
| Error Views Directory Path
|--------------------------------------------------------------------------
|
| Leave this BLANK unless you would like to set something other than the default
| application/views/errors/ directory. Use a full server path with trailing slash.
|
*/
$config['error_views_path'] = '';
/*
|--------------------------------------------------------------------------
| Cache Directory Path
|--------------------------------------------------------------------------
|
| Leave this BLANK unless you would like to set something other than the default
| application/cache/ directory. Use a full server path with trailing slash.
|
*/
$config['cache_path'] = '';
/*
|--------------------------------------------------------------------------
| Cache Include Query String
|--------------------------------------------------------------------------
|
| Whether to take the URL query string into consideration when generating
| output cache files. Valid options are:
|
| FALSE = Disabled
| TRUE = Enabled, take all query parameters into account.
| Please be aware that this may result in numerous cache
| files generated for the same page over and over again.
| array('q') = Enabled, but only take into account the specified list
| of query parameters.
|
*/
$config['cache_query_string'] = FALSE;
/*
|--------------------------------------------------------------------------
| Encryption Key
|--------------------------------------------------------------------------
|
| If you use the Encryption class, you must set an encryption key.
| See the user guide for more info.
|
| https://codeigniter.com/user_guide/libraries/encryption.html
|
*/
$config['encryption_key'] = '';
/*
|--------------------------------------------------------------------------
| Session Variables
|--------------------------------------------------------------------------
|
| 'sess_driver'
|
| The storage driver to use: files, database, redis, memcached
|
| 'sess_cookie_name'
|
| The session cookie name, must contain only [0-9a-z_-] characters
|
| 'sess_expiration'
|
| The number of SECONDS you want the session to last.
| Setting to 0 (zero) means expire when the browser is closed.
|
| 'sess_save_path'
|
| The location to save sessions to, driver dependent.
|
| For the 'files' driver, it's a path to a writable directory.
| WARNING: Only absolute paths are supported!
|
| For the 'database' driver, it's a table name.
| Please read up the manual for the format with other session drivers.
|
| IMPORTANT: You are REQUIRED to set a valid save path!
|
| 'sess_match_ip'
|
| Whether to match the user's IP address when reading the session data.
|
| WARNING: If you're using the database driver, don't forget to update
| your session table's PRIMARY KEY when changing this setting.
|
| 'sess_time_to_update'
|
| How many seconds between CI regenerating the session ID.
|
| 'sess_regenerate_destroy'
|
| Whether to destroy session data associated with the old session ID
| when auto-regenerating the session ID. When set to FALSE, the data
| will be later deleted by the garbage collector.
|
| Other session cookie settings are shared with the rest of the application,
| except for 'cookie_prefix' and 'cookie_httponly', which are ignored here.
|
*/
$config['sess_driver'] = 'files';
$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 7200;
$config['sess_save_path'] = NULL;
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE;
/*
|--------------------------------------------------------------------------
| Cookie Related Variables
|--------------------------------------------------------------------------
|
| 'cookie_prefix' = Set a cookie name prefix if you need to avoid collisions
| 'cookie_domain' = Set to .your-domain.com for site-wide cookies
| 'cookie_path' = Typically will be a forward slash
| 'cookie_secure' = Cookie will only be set if a secure HTTPS connection exists.
| 'cookie_httponly' = Cookie will only be accessible via HTTP(S) (no javascript)
|
| Note: These settings (with the exception of 'cookie_prefix' and
| 'cookie_httponly') will also affect sessions.
|
*/
$config['cookie_prefix'] = '';
$config['cookie_domain'] = '';
$config['cookie_path'] = '/';
$config['cookie_secure'] = FALSE;
$config['cookie_httponly'] = FALSE;
/*
|--------------------------------------------------------------------------
| Standardize newlines
|--------------------------------------------------------------------------
|
| Determines whether to standardize newline characters in input data,
| meaning to replace \r\n, \r, \n occurrences with the PHP_EOL value.
|
| This is particularly useful for portability between UNIX-based OSes,
| (usually \n) and Windows (\r\n).
|
*/
$config['standardize_newlines'] = FALSE;
/*
|--------------------------------------------------------------------------
| Global XSS Filtering
|--------------------------------------------------------------------------
|
| Determines whether the XSS filter is always active when GET, POST or
| COOKIE data is encountered
|
| WARNING: This feature is DEPRECATED and currently available only
| for backwards compatibility purposes!
|
*/
$config['global_xss_filtering'] = FALSE;
/*
|--------------------------------------------------------------------------
| Cross Site Request Forgery
|--------------------------------------------------------------------------
| Enables a CSRF cookie token to be set. When set to TRUE, token will be
| checked on a submitted form. If you are accepting user data, it is strongly
| recommended CSRF protection be enabled.
|
| 'csrf_token_name' = The token name
| 'csrf_cookie_name' = The cookie name
| 'csrf_expire' = The number in seconds the token should expire.
| 'csrf_regenerate' = Regenerate token on every submission
| 'csrf_exclude_uris' = Array of URIs which ignore CSRF checks
*/
$config['csrf_protection'] = FALSE;
$config['csrf_token_name'] = 'csrf_test_name';
$config['csrf_cookie_name'] = 'csrf_cookie_name';
$config['csrf_expire'] = 7200;
$config['csrf_regenerate'] = TRUE;
$config['csrf_exclude_uris'] = array();
/*
|--------------------------------------------------------------------------
| Output Compression
|--------------------------------------------------------------------------
|
| Enables Gzip output compression for faster page loads. When enabled,
| the output class will test whether your server supports Gzip.
| Even if it does, however, not all browsers support compression
| so enable only if you are reasonably sure your visitors can handle it.
|
| Only used if zlib.output_compression is turned off in your php.ini.
| Please do not use it together with httpd-level output compression.
|
| VERY IMPORTANT: If you are getting a blank page when compression is enabled it
| means you are prematurely outputting something to your browser. It could
| even be a line of whitespace at the end of one of your scripts. For
| compression to work, nothing can be sent before the output buffer is called
| by the output class. Do not 'echo' any values with compression enabled.
|
*/
$config['compress_output'] = FALSE;
/*
|--------------------------------------------------------------------------
| Master Time Reference
|--------------------------------------------------------------------------
|
| Options are 'local' or any PHP supported timezone. This preference tells
| the system whether to use your server's local time as the master 'now'
| reference, or convert it to the configured one timezone. See the 'date
| helper' page of the user guide for information regarding date handling.
|
*/
$config['time_reference'] = 'local';
/*
|--------------------------------------------------------------------------
| Rewrite PHP Short Tags
|--------------------------------------------------------------------------
|
| If your PHP installation does not have short tag support enabled CI
| can rewrite the tags on-the-fly, enabling you to utilize that syntax
| in your view files. Options are TRUE or FALSE (boolean)
|
| Note: You need to have eval() enabled for this to work.
|
*/
$config['rewrite_short_tags'] = FALSE;
/*
|--------------------------------------------------------------------------
| Reverse Proxy IPs
|--------------------------------------------------------------------------
|
| If your server is behind a reverse proxy, you must whitelist the proxy
| IP addresses from which CodeIgniter should trust headers such as
| HTTP_X_FORWARDED_FOR and HTTP_CLIENT_IP in order to properly identify
| the visitor's IP address.
|
| You can use both an array or a comma-separated list of proxy addresses,
| as well as specifying whole subnets. Here are a few examples:
|
| Comma-separated: '10.0.1.200,192.168.5.0/24'
| Array: array('10.0.1.200', '192.168.5.0/24')
*/
$config['proxy_ips'] = '';
| Java |
<html>
<head>
<title>User agent detail - Mozilla/5.0 (Linux; U; Android 4.2.1; en-us; Q600 Build/JOP40D) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.3/css/materialize.min.css">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
</head>
<body>
<div class="container">
<div class="section">
<h1 class="header center orange-text">User agent detail</h1>
<div class="row center">
<h5 class="header light">
Mozilla/5.0 (Linux; U; Android 4.2.1; en-us; Q600 Build/JOP40D) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30
</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">Source result (test suite)</th></tr><tr><td>ua-parser/uap-core<br /><small>vendor/thadafinser/uap-core/tests/test_device.yaml</small></td><td> </td><td> </td><td> </td><td style="border-left: 1px solid #555">Xolo</td><td>Q600</td><td></td><td></td><td></td><td style="border-left: 1px solid #555"></td><td></td><td></td><td></td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-test">Detail</a>
<!-- Modal Structure -->
<div id="modal-test" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>Testsuite result detail</h4>
<p><pre><code class="php">Array
(
[user_agent_string] => Mozilla/5.0 (Linux; U; Android 4.2.1; en-us; Q600 Build/JOP40D) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30
[family] => Xolo Q600
[brand] => Xolo
[model] => Q600
)
</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>BrowscapPhp<br /><small>6012</small></td><td>Android 4.0</td><td>WebKit </td><td>Android 4.2</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.08</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-215ac98d-ccf8-4615-916e-5a819d6a59c9">Detail</a>
<!-- Modal Structure -->
<div id="modal-215ac98d-ccf8-4615-916e-5a819d6a59c9" 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.4\.2.* build\/.*\).*applewebkit\/.*\(.*khtml,.*like gecko.*\).*version\/4\.0.*safari.*$/
[browser_name_pattern] => mozilla/5.0 (*linux*android?4.2* build/*)*applewebkit/*(*khtml,*like gecko*)*version/4.0*safari*
[parent] => Android Browser 4.0
[comment] => Android Browser 4.0
[browser] => Android
[browser_type] => Browser
[browser_bits] => 32
[browser_maker] => Google Inc
[browser_modus] => unknown
[version] => 4.0
[majorver] => 4
[minorver] => 0
[platform] => Android
[platform_version] => 4.2
[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] => 1
[activexcontrols] =>
[ismobiledevice] => 1
[istablet] =>
[issyndicationreader] =>
[crawler] =>
[cssversion] => 3
[aolversion] => 0
[device_name] => general Mobile Phone
[device_maker] => unknown
[device_type] => Mobile Phone
[device_pointing_method] => touchscreen
[device_code_name] => general Mobile Phone
[device_brand_name] => unknown
[renderingengine_name] => WebKit
[renderingengine_version] => unknown
[renderingengine_description] => For Google Chrome, iOS (including both mobile Safari, WebViews within third-party apps, and web clips), Safari, Arora, Midori, OmniWeb, Shiira, iCab since version 4, Web, SRWare Iron, Rekonq, and in Maxthon 3.
[renderingengine_maker] => Apple Inc
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>DonatjUAParser<br /><small>v0.5.0</small></td><td>Android Browser 4.0</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-f1436016-fdf1-4aea-b4be-1d7c99ab0661">Detail</a>
<!-- Modal Structure -->
<div id="modal-f1436016-fdf1-4aea-b4be-1d7c99ab0661" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>DonatjUAParser result detail</h4>
<p><pre><code class="php">Array
(
[platform] => Android
[browser] => Android Browser
[version] => 4.0
)
</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></td><td>Android Webkit 4.0</td><td><i class="material-icons">close</i></td><td>Android 4.2.1</td><td style="border-left: 1px solid #555">Xolo</td><td>Q600</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.26303</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-9b0fa449-ec1b-40c8-8b1c-9486eb3b9cbc">Detail</a>
<!-- Modal Structure -->
<div id="modal-9b0fa449-ec1b-40c8-8b1c-9486eb3b9cbc" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>NeutrinoApiCom result detail</h4>
<p><pre><code class="php">stdClass Object
(
[mobile_screen_height] => 854
[is_mobile] => 1
[type] => mobile-browser
[mobile_brand] => Xolo
[mobile_model] => Q600
[version] => 4.0
[is_android] => 1
[browser_name] => Android Webkit
[operating_system_family] => Android
[operating_system_version] => 4.2.1
[is_ios] =>
[producer] => Google Inc.
[operating_system] => Android 4.2 Jelly Bean
[mobile_screen_width] => 480
[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.5.2</small></td><td>Android Browser </td><td>WebKit </td><td>Android 4.2</td><td style="border-left: 1px solid #555">Xolo</td><td>Q600</td><td>smartphone</td><td>yes</td><td></td><td style="border-left: 1px solid #555"></td><td></td><td></td><td>0.005</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-21638055-738d-46ba-a1b1-f5114bc26475">Detail</a>
<!-- Modal Structure -->
<div id="modal-21638055-738d-46ba-a1b1-f5114bc26475" 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] => Android Browser
[short_name] => AN
[version] =>
[engine] => WebKit
)
[operatingSystem] => Array
(
[name] => Android
[short_name] => AND
[version] => 4.2
[platform] =>
)
[device] => Array
(
[brand] => XO
[brandName] => Xolo
[model] => Q600
[device] => 1
[deviceName] => smartphone
)
[bot] =>
[extra] => Array
(
[isBot] =>
[isBrowser] => 1
[isFeedReader] =>
[isMobileApp] =>
[isPIM] =>
[isLibrary] =>
[isMediaPlayer] =>
[isCamera] =>
[isCarBrowser] =>
[isConsole] =>
[isFeaturePhone] =>
[isPhablet] =>
[isPortableMediaPlayer] =>
[isSmartDisplay] =>
[isSmartphone] => 1
[isTablet] =>
[isTV] =>
[isDesktop] =>
[isMobile] => 1
[isTouchEnabled] =>
)
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>SinergiBrowserDetector<br /><small>6.0.0</small></td><td>Navigator 4.0</td><td><i class="material-icons">close</i></td><td>Android 4.2.1</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-5415e7f2-ef7b-434c-abe0-b71ba9f6707c">Detail</a>
<!-- Modal Structure -->
<div id="modal-5415e7f2-ef7b-434c-abe0-b71ba9f6707c" 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; U; Android 4.2.1; en-us; Q600 Build/JOP40D) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30
)
[name:Sinergi\BrowserDetector\Browser:private] => Navigator
[version:Sinergi\BrowserDetector\Browser:private] => 4.0
[isRobot:Sinergi\BrowserDetector\Browser:private] =>
[isChromeFrame:Sinergi\BrowserDetector\Browser:private] =>
)
[operatingSystem] => Sinergi\BrowserDetector\Os Object
(
[name:Sinergi\BrowserDetector\Os:private] => Android
[version:Sinergi\BrowserDetector\Os:private] => 4.2.1
[isMobile:Sinergi\BrowserDetector\Os:private] => 1
[userAgent:Sinergi\BrowserDetector\Os:private] => Sinergi\BrowserDetector\UserAgent Object
(
[userAgentString:Sinergi\BrowserDetector\UserAgent:private] => Mozilla/5.0 (Linux; U; Android 4.2.1; en-us; Q600 Build/JOP40D) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30
)
)
[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; U; Android 4.2.1; en-us; Q600 Build/JOP40D) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30
)
)
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>UAParser<br /><small>v3.4.5</small></td><td>Android 4.2.1</td><td><i class="material-icons">close</i></td><td>Android 4.2.1</td><td style="border-left: 1px solid #555">Xolo</td><td>Q600</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.003</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-346c1a98-5fd3-454f-b6c8-350f2f505d8b">Detail</a>
<!-- Modal Structure -->
<div id="modal-346c1a98-5fd3-454f-b6c8-350f2f505d8b" 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] => 4
[minor] => 2
[patch] => 1
[family] => Android
)
[os] => UAParser\Result\OperatingSystem Object
(
[major] => 4
[minor] => 2
[patch] => 1
[patchMinor] =>
[family] => Android
)
[device] => UAParser\Result\Device Object
(
[brand] => Xolo
[model] => Q600
[family] => Xolo Q600
)
[originalUserAgent] => Mozilla/5.0 (Linux; U; Android 4.2.1; en-us; Q600 Build/JOP40D) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30
)
</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></td><td>Android Webkit Browser </td><td><i class="material-icons">close</i></td><td>Android 4.2.1</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.05201</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-9cdd8b45-a2eb-406b-bd27-7e48af38ffd4">Detail</a>
<!-- Modal Structure -->
<div id="modal-9cdd8b45-a2eb-406b-bd27-7e48af38ffd4" 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.2.1
[os_producer] =>
[os_producerURL] =>
[linux_distibution] => Null
[agent_language] => English - United States
[agent_languageTag] => en-us
)
</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></td><td>Android Browser 4.0</td><td>WebKit 534.30</td><td>Android 4.2.1</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.41504</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-9795f66f-7271-430e-973a-a5c0e14dc35a">Detail</a>
<!-- Modal Structure -->
<div id="modal-9795f66f-7271-430e-973a-a5c0e14dc35a" 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] => Android Browser 4 on Android (Jelly Bean)
[browser_version] => 4
[extra_info] => Array
(
)
[operating_platform] =>
[extra_info_table] => stdClass Object
(
[System Build] => JOP40D
)
[layout_engine_name] => WebKit
[detected_addons] => Array
(
)
[operating_system_flavour_code] =>
[hardware_architecture] =>
[operating_system_flavour] =>
[operating_system_frameworks] => Array
(
)
[browser_name_code] => android-browser
[operating_system_version] => Jelly Bean
[simple_operating_platform_string] =>
[is_abusive] =>
[layout_engine_version] => 534.30
[browser_capabilities] => Array
(
)
[operating_platform_vendor_name] =>
[operating_system] => Android (Jelly Bean)
[operating_system_version_full] => 4.2.1
[operating_platform_code] =>
[browser_name] => Android Browser
[operating_system_name_code] => android
[user_agent] => Mozilla/5.0 (Linux; U; Android 4.2.1; en-us; Q600 Build/JOP40D) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30
[browser_version_full] => 4.0
[browser] => Android Browser 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>WhichBrowser<br /><small>2.0.10</small></td><td>Android Browser </td><td>Webkit 534.30</td><td>Android 4.2.1</td><td style="border-left: 1px solid #555">Lava</td><td>XOLO Q600</td><td>mobile:smart</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.02</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-342c8d32-4765-40a8-8a5c-af3a38d19ae4">Detail</a>
<!-- Modal Structure -->
<div id="modal-342c8d32-4765-40a8-8a5c-af3a38d19ae4" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>WhichBrowser result detail</h4>
<p><pre><code class="php">Array
(
[browser] => Array
(
[name] => Android Browser
)
[engine] => Array
(
[name] => Webkit
[version] => 534.30
)
[os] => Array
(
[name] => Android
[version] => 4.2.1
)
[device] => Array
(
[type] => mobile
[subtype] => smart
[manufacturer] => Lava
[model] => XOLO Q600
)
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>Woothee<br /><small>v1.2.0</small></td><td>Safari 4.0</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.001</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-3f285ff5-314b-4db4-9948-54572e92e7b6">Detail</a>
<!-- Modal Structure -->
<div id="modal-3f285ff5-314b-4db4-9948-54572e92e7b6" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>Woothee result detail</h4>
<p><pre><code class="php">Array
(
[name] => Safari
[vendor] => Apple
[version] => 4.0
[category] => smartphone
[os] => Android
[os_version] => 4.2.1
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>Wurfl<br /><small>1.6.4</small></td><td>Android Webkit 4.2</td><td><i class="material-icons">close</i></td><td>Android 4.2</td><td style="border-left: 1px solid #555">Xolo</td><td>Q600</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.087</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-1a1aee36-7ce7-4111-a391-8e2c501f1532">Detail</a>
<!-- Modal Structure -->
<div id="modal-1a1aee36-7ce7-4111-a391-8e2c501f1532" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>Wurfl result detail</h4>
<p><pre><code class="php">Array
(
[virtual] => Array
(
[is_android] => true
[is_ios] => false
[is_windows_phone] => false
[is_app] => false
[is_full_desktop] => false
[is_largescreen] => true
[is_mobile] => true
[is_robot] => false
[is_smartphone] => true
[is_touchscreen] => true
[is_wml_preferred] => false
[is_xhtmlmp_preferred] => false
[is_html_preferred] => true
[advertised_device_os] => Android
[advertised_device_os_version] => 4.2
[advertised_browser] => Android Webkit
[advertised_browser_version] => 4.2
[complete_device_name] => Xolo Q600
[form_factor] => Smartphone
[is_phone] => true
[is_app_webview] => true
)
[all] => Array
(
[brand_name] => Xolo
[model_name] => Q600
[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.2
[pointing_method] => touchscreen
[release_date] => 2013_july
[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] => 480
[resolution_height] => 854
[columns] => 60
[max_image_width] => 320
[max_image_height] => 480
[rows] => 40
[physical_screen_width] => 57
[physical_screen_height] => 100
[dual_orientation] => true
[density_class] => 1.0
[wbmp] => true
[bmp] => false
[epoc_bmp] => false
[gif_animated] => false
[jpg] => true
[png] => true
[tiff] => false
[transparent_png_alpha] => true
[transparent_png_index] => true
[svgt_1_1] => true
[svgt_1_1_plus] => false
[greyscale] => false
[gif] => true
[colors] => 65536
[webp_lossy_support] => true
[webp_lossless_support] => true
[post_method_support] => true
[basic_authentication_support] => true
[empty_option_value_support] => true
[emptyok] => false
[nokia_voice_call] => false
[wta_voice_call] => false
[wta_phonebook] => false
[wta_misc] => false
[wta_pdc] => false
[https_support] => true
[phone_id_provided] => false
[max_data_rate] => 3600
[wifi] => true
[sdio] => false
[vpn] => false
[has_cellular_radio] => true
[max_deck_size] => 2000000
[max_url_length_in_requests] => 256
[max_url_length_homepage] => 0
[max_url_length_bookmark] => 0
[max_url_length_cached_page] => 0
[max_no_of_connection_settings] => 0
[max_no_of_bookmarks] => 0
[max_length_of_username] => 0
[max_length_of_password] => 0
[max_object_size] => 0
[downloadfun_support] => false
[directdownload_support] => true
[inline_support] => false
[oma_support] => true
[ringtone] => false
[ringtone_3gpp] => false
[ringtone_midi_monophonic] => false
[ringtone_midi_polyphonic] => false
[ringtone_imelody] => false
[ringtone_digiplug] => false
[ringtone_compactmidi] => false
[ringtone_mmf] => false
[ringtone_rmf] => false
[ringtone_xmf] => false
[ringtone_amr] => false
[ringtone_awb] => false
[ringtone_aac] => false
[ringtone_wav] => false
[ringtone_mp3] => false
[ringtone_spmidi] => false
[ringtone_qcelp] => false
[ringtone_voices] => 1
[ringtone_df_size_limit] => 0
[ringtone_directdownload_size_limit] => 0
[ringtone_inline_size_limit] => 0
[ringtone_oma_size_limit] => 0
[wallpaper] => false
[wallpaper_max_width] => 0
[wallpaper_max_height] => 0
[wallpaper_preferred_width] => 0
[wallpaper_preferred_height] => 0
[wallpaper_resize] => none
[wallpaper_wbmp] => false
[wallpaper_bmp] => false
[wallpaper_gif] => false
[wallpaper_jpg] => false
[wallpaper_png] => false
[wallpaper_tiff] => false
[wallpaper_greyscale] => false
[wallpaper_colors] => 2
[wallpaper_df_size_limit] => 0
[wallpaper_directdownload_size_limit] => 0
[wallpaper_inline_size_limit] => 0
[wallpaper_oma_size_limit] => 0
[screensaver] => false
[screensaver_max_width] => 0
[screensaver_max_height] => 0
[screensaver_preferred_width] => 0
[screensaver_preferred_height] => 0
[screensaver_resize] => none
[screensaver_wbmp] => false
[screensaver_bmp] => false
[screensaver_gif] => false
[screensaver_jpg] => false
[screensaver_png] => false
[screensaver_greyscale] => false
[screensaver_colors] => 2
[screensaver_df_size_limit] => 0
[screensaver_directdownload_size_limit] => 0
[screensaver_inline_size_limit] => 0
[screensaver_oma_size_limit] => 0
[picture] => false
[picture_max_width] => 0
[picture_max_height] => 0
[picture_preferred_width] => 0
[picture_preferred_height] => 0
[picture_resize] => none
[picture_wbmp] => false
[picture_bmp] => false
[picture_gif] => false
[picture_jpg] => false
[picture_png] => false
[picture_greyscale] => false
[picture_colors] => 2
[picture_df_size_limit] => 0
[picture_directdownload_size_limit] => 0
[picture_inline_size_limit] => 0
[picture_oma_size_limit] => 0
[video] => false
[oma_v_1_0_forwardlock] => false
[oma_v_1_0_combined_delivery] => false
[oma_v_1_0_separate_delivery] => false
[streaming_video] => true
[streaming_3gpp] => true
[streaming_mp4] => true
[streaming_mov] => false
[streaming_video_size_limit] => 0
[streaming_real_media] => none
[streaming_flv] => false
[streaming_3g2] => false
[streaming_vcodec_h263_0] => 10
[streaming_vcodec_h263_3] => -1
[streaming_vcodec_mpeg4_sp] => 2
[streaming_vcodec_mpeg4_asp] => -1
[streaming_vcodec_h264_bp] => 3.0
[streaming_acodec_amr] => nb
[streaming_acodec_aac] => lc
[streaming_wmv] => none
[streaming_preferred_protocol] => 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] => false
[css_supports_width_as_percentage] => true
[css_border_image] => webkit
[css_rounded_corners] => webkit
[css_gradient] => none
[css_spriting] => true
[css_gradient_linear] => none
[is_transcoder] => false
[transcoder_ua_header] => user-agent
[rss_support] => false
[pdf_support] => true
[progressive_download] => true
[playback_vcodec_h263_0] => 10
[playback_vcodec_h263_3] => -1
[playback_vcodec_mpeg4_sp] => 0
[playback_vcodec_mpeg4_asp] => -1
[playback_vcodec_h264_bp] => 3.0
[playback_real_media] => none
[playback_3gpp] => true
[playback_3g2] => false
[playback_mp4] => true
[playback_mov] => false
[playback_acodec_amr] => nb
[playback_acodec_aac] => none
[playback_df_size_limit] => 0
[playback_directdownload_size_limit] => 0
[playback_inline_size_limit] => 0
[playback_oma_size_limit] => 0
[playback_acodec_qcelp] => false
[playback_wmv] => none
[hinted_progressive_download] => true
[html_preferred_dtd] => html4
[viewport_supported] => true
[viewport_width] => device_width_token
[viewport_userscalable] => no
[viewport_initial_scale] =>
[viewport_maximum_scale] =>
[viewport_minimum_scale] =>
[mobileoptimized] => false
[handheldfriendly] => false
[canvas_support] => full
[image_inlining] => true
[is_smarttv] => false
[is_console] => false
[nfc_support] => false
[ux_full_desktop] => false
[jqm_grade] => A
[is_sencha_touch_ok] => false
[controlcap_is_smartphone] => default
[controlcap_is_ios] => default
[controlcap_is_android] => default
[controlcap_is_robot] => default
[controlcap_is_app] => default
[controlcap_advertised_device_os] => default
[controlcap_advertised_device_os_version] => default
[controlcap_advertised_browser] => default
[controlcap_advertised_browser_version] => default
[controlcap_is_windows_phone] => default
[controlcap_is_full_desktop] => default
[controlcap_is_largescreen] => default
[controlcap_is_mobile] => default
[controlcap_is_touchscreen] => default
[controlcap_is_wml_preferred] => default
[controlcap_is_xhtmlmp_preferred] => default
[controlcap_is_html_preferred] => default
[controlcap_form_factor] => default
[controlcap_complete_device_name] => default
)
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr></table>
</div>
<div class="section">
<h1 class="header center orange-text">About this comparison</h1>
<div class="row center">
<h5 class="header light">
The primary goal of this project is simple<br />
I wanted to know which user agent parser is the most accurate in each part - device detection, bot detection and so on...<br />
<br />
The secondary goal is to provide a source for all user agent parsers to improve their detection based on this results.<br />
<br />
You can also improve this further, by suggesting ideas at <a href="https://github.com/ThaDafinser/UserAgentParserComparison">ThaDafinser/UserAgentParserComparison</a><br />
<br />
The comparison is based on the abstraction by <a href="https://github.com/ThaDafinser/UserAgentParser">ThaDafinser/UserAgentParser</a>
</h5>
</div>
</div>
<div class="card">
<div class="card-content">
Comparison created <i>2016-02-13 13:38:35</i> | by
<a href="https://github.com/ThaDafinser">ThaDafinser</a>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.3/js/materialize.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/list.js/1.1.1/list.min.js"></script>
<script>
$(document).ready(function(){
// the "href" attribute of .modal-trigger must specify the modal ID that wants to be triggered
$('.modal-trigger').leanModal();
});
</script>
</body>
</html> | Java |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>User agent detail - LG-G922 Obigo/WAP2.0 MIDP-2.0/CLDC-1.1</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">
LG-G922 Obigo/WAP2.0 MIDP-2.0/CLDC-1.1
</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">LG</td><td>G922</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] => LG-G922 Obigo/WAP2.0 MIDP-2.0/CLDC-1.1
[family] => LG G922
[brand] => LG
[model] => G922
)
</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>Teleca-Obigo </td><td> </td><td>JAVA </td><td style="border-left: 1px solid #555">LG</td><td>G922</td><td>Mobile Phone</td><td>yes</td><td></td><td style="border-left: 1px solid #555"></td><td></td><td></td><td>0.006</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] => /^lg\-g922 obigo\/wap2\.0 .*$/
[browser_name_pattern] => lg-g922 obigo/wap2.0 *
[parent] => Teleca-Obigo
[comment] => Teleca-Obigo
[browser] => Teleca-Obigo
[browser_type] => Browser
[browser_bits] => 32
[browser_maker] => Obigo
[browser_modus] => unknown
[version] => 0.0
[majorver] => 0
[minorver] => 0
[platform] => JAVA
[platform_version] => unknown
[platform_description] => unknown
[platform_bits] => 32
[platform_maker] => Oracle
[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] => 1
[aolversion] => 0
[device_name] => G922
[device_maker] => LG
[device_type] => Mobile Phone
[device_pointing_method] => unknown
[device_code_name] => G922
[device_brand_name] => LG
[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>BrowscapLite<br /><small>6014</small><br /></td>
<td colspan="12" class="center-align red lighten-1">
<strong>No result found</strong>
</td>
</tr><tr><td>BrowscapPhp<br /><small>6014</small><br /></td><td>Teleca-Obigo </td><td><i class="material-icons">close</i></td><td>JAVA </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></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.027</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] => /^.*obigo\/wap2\.0.*$/
[browser_name_pattern] => *obigo/wap2.0*
[parent] => Teleca-Obigo
[comment] => Teleca-Obigo
[browser] => Teleca-Obigo
[browser_type] => unknown
[browser_bits] => 0
[browser_maker] => Obigo
[browser_modus] => unknown
[version] => 0.0
[majorver] => 0
[minorver] => 0
[platform] => JAVA
[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] => 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>DonatjUAParser<br /><small>v0.5.1</small><br /></td><td>LG-G922 </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] =>
[browser] => LG-G922
[version] =>
)
</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>ObigoBrowser </td><td><i class="material-icons">close</i></td><td>JavaOS </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.001</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] => ObigoBrowser
[browserVersion] =>
[osName] => JavaOS
[osVersion] =>
[deviceModel] =>
[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>Obigo WAP 2.0</td><td><i class="material-icons">close</i></td><td> </td><td style="border-left: 1px solid #555">LG</td><td>G922</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.20701</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] => 0
[is_mobile] => 1
[type] => mobile-browser
[mobile_brand] => LG
[mobile_model] => G922
[version] => 2.0
[is_android] =>
[browser_name] => Obigo WAP
[operating_system_family] => unknown
[operating_system_version] =>
[is_ios] =>
[producer] => LG
[operating_system] => unknown
[mobile_screen_width] => 0
[mobile_browser] =>
)
</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>Obigo WAP2</td><td> </td><td> </td><td style="border-left: 1px solid #555">LG</td><td>G922</td><td>smartphone</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] => Obigo
[short_name] => OB
[version] => WAP2
[engine] =>
)
[operatingSystem] => Array
(
)
[device] => Array
(
[brand] => LG
[brandName] => LG
[model] => G922
[device] => 1
[deviceName] => smartphone
)
[bot] =>
[extra] => Array
(
[isBot] =>
[isBrowser] => 1
[isFeedReader] =>
[isMobileApp] =>
[isPIM] =>
[isLibrary] =>
[isMediaPlayer] =>
[isCamera] =>
[isCarBrowser] =>
[isConsole] =>
[isFeaturePhone] =>
[isPhablet] =>
[isPortableMediaPlayer] =>
[isSmartDisplay] =>
[isSmartphone] => 1
[isTablet] =>
[isTV] =>
[isDesktop] =>
[isMobile] => 1
[isTouchEnabled] =>
)
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>SinergiBrowserDetector<br /><small>6.0.1</small><br /></td>
<td colspan="12" class="center-align red lighten-1">
<strong>No result found</strong>
</td>
</tr><tr><td>UAParser<br /><small>v3.4.5</small><br /></td><td>Obigo 2.0</td><td><i class="material-icons">close</i></td><td> </td><td style="border-left: 1px solid #555">LG</td><td>G922</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.001</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] => 2
[minor] => 0
[patch] =>
[family] => Obigo
)
[os] => UAParser\Result\OperatingSystem Object
(
[major] =>
[minor] =>
[patch] =>
[patchMinor] =>
[family] => Other
)
[device] => UAParser\Result\Device Object
(
[brand] => LG
[model] => G922
[family] => LG G922
)
[originalUserAgent] => LG-G922 Obigo/WAP2.0 MIDP-2.0/CLDC-1.1
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>UserAgentApiCom<br /><small></small><br /></td><td>Obigo 2.0</td><td> </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.15201</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] => Mobile
[platform_version] => 2.0
[platform_type] => Mobile
[browser_name] => Obigo
[browser_version] => 2.0
)
</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 colspan="12" class="center-align red lighten-1">
<strong>No result found</strong>
</td>
</tr><tr><td>WhatIsMyBrowserCom<br /><small></small><br /></td><td>Obigo WAP2 Browser WAP2</td><td> </td><td> </td><td style="border-left: 1px solid #555">LG</td><td>LGG922</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.24001</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] =>
[simple_sub_description_string] =>
[simple_browser_string] => Obigo WAP2 Browser on LGG922
[browser_version] =>
[extra_info] => Array
(
)
[operating_platform] => LGG922
[extra_info_table] => Array
(
)
[layout_engine_name] =>
[detected_addons] => Array
(
)
[operating_system_flavour_code] =>
[hardware_architecture] =>
[operating_system_flavour] =>
[operating_system_frameworks] => Array
(
)
[browser_name_code] => obigo-wap2-browser
[operating_system_version] =>
[simple_operating_platform_string] =>
[is_abusive] =>
[layout_engine_version] =>
[browser_capabilities] => Array
(
[0] => MIDP v2.0
[1] => CLDC v1.1
)
[operating_platform_vendor_name] => LG
[operating_system] =>
[operating_system_version_full] =>
[operating_platform_code] => LGG922
[browser_name] => Obigo WAP2 Browser
[operating_system_name_code] =>
[user_agent] => LG-G922 Obigo/WAP2.0 MIDP-2.0/CLDC-1.1
[browser_version_full] => WAP2
[browser] => Obigo WAP2 Browser
)
</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>Obigo WAP 2.0</td><td> </td><td> </td><td style="border-left: 1px solid #555">LG</td><td>G922</td><td>mobile:feature</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.003</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] => Obigo WAP
[version] => 2.0
[type] => browser
)
[device] => Array
(
[type] => mobile
[subtype] => feature
[manufacturer] => LG
[model] => G922
)
)
</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 colspan="12" class="center-align red lighten-1">
<strong>No result found</strong>
</td>
</tr><tr><td>Wurfl<br /><small>1.7.1.0</small><br /></td><td>Java Applet </td><td><i class="material-icons">close</i></td><td> </td><td style="border-left: 1px solid #555"></td><td></td><td>Feature Phone</td><td>yes</td><td></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.016</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] => false
[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] => false
[is_touchscreen] => false
[is_wml_preferred] => false
[is_xhtmlmp_preferred] => true
[is_html_preferred] => false
[advertised_device_os] =>
[advertised_device_os_version] =>
[advertised_browser] => Java Applet
[advertised_browser_version] =>
[complete_device_name] =>
[device_name] =>
[form_factor] => Feature Phone
[is_phone] => true
[is_app_webview] => false
)
[all] => Array
(
[brand_name] =>
[model_name] =>
[unique] => true
[ununiqueness_handler] =>
[is_wireless_device] => true
[device_claims_web_support] => false
[has_qwerty_keyboard] => false
[can_skip_aligned_link_row] => true
[uaprof] =>
[uaprof2] =>
[uaprof3] =>
[nokia_series] => 0
[nokia_edition] => 0
[device_os] =>
[mobile_browser] =>
[mobile_browser_version] =>
[device_os_version] =>
[pointing_method] =>
[release_date] => 2002_july
[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] => false
[xhtml_supports_forms_in_table] => false
[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] => false
[xhtml_supports_css_cell_table_coloring] => false
[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] => false
[xhtml_document_title_support] => true
[xhtml_preferred_charset] => utf8
[opwv_xhtml_extensions_support] => false
[xhtml_make_phone_call_string] => tel:
[xhtmlmp_preferred_mime_type] => application/vnd.wap.xhtml+xml
[xhtml_table_support] => true
[xhtml_send_sms_string] => none
[xhtml_send_mms_string] => none
[xhtml_file_upload] => not_supported
[cookie_support] => true
[accept_third_party_cookie] => true
[xhtml_supports_iframe] => none
[xhtml_avoid_accesskeys] => false
[xhtml_can_embed_video] => none
[ajax_support_javascript] => false
[ajax_manipulate_css] => false
[ajax_support_getelementbyid] => false
[ajax_support_inner_html] => false
[ajax_xhr_type] => none
[ajax_manipulate_dom] => false
[ajax_support_events] => false
[ajax_support_event_listener] => false
[ajax_preferred_geoloc_api] => none
[xhtml_support_level] => 1
[preferred_markup] => html_wi_oma_xhtmlmp_1_0
[wml_1_1] => true
[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] => false
[html_web_4_0] => false
[voicexml] => false
[multipart_support] => false
[total_cache_disable_support] => false
[time_to_live_support] => false
[resolution_width] => 128
[resolution_height] => 92
[columns] => 11
[max_image_width] => 120
[max_image_height] => 92
[rows] => 6
[physical_screen_width] => 27
[physical_screen_height] => 27
[dual_orientation] => false
[density_class] => 1.0
[wbmp] => true
[bmp] => false
[epoc_bmp] => false
[gif_animated] => true
[jpg] => true
[png] => true
[tiff] => false
[transparent_png_alpha] => false
[transparent_png_index] => false
[svgt_1_1] => false
[svgt_1_1_plus] => false
[greyscale] => false
[gif] => true
[colors] => 256
[webp_lossy_support] => false
[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] => 9
[wifi] => false
[sdio] => false
[vpn] => false
[has_cellular_radio] => true
[max_deck_size] => 10000
[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] => false
[inline_support] => false
[oma_support] => false
[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] => false
[streaming_3gpp] => false
[streaming_mp4] => false
[streaming_mov] => false
[streaming_video_size_limit] => 0
[streaming_real_media] => none
[streaming_flv] => false
[streaming_3g2] => false
[streaming_vcodec_h263_0] => -1
[streaming_vcodec_h263_3] => -1
[streaming_vcodec_mpeg4_sp] => -1
[streaming_vcodec_mpeg4_asp] => -1
[streaming_vcodec_h264_bp] => -1
[streaming_acodec_amr] => none
[streaming_acodec_aac] => none
[streaming_wmv] => none
[streaming_preferred_protocol] => rtsp
[streaming_preferred_http_protocol] => none
[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] => false
[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] => false
[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] => false
[mp3] => false
[voices] => 1
[qcelp] => false
[evrc] => false
[flash_lite_version] =>
[fl_wallpaper] => false
[fl_screensaver] => false
[fl_standalone] => false
[fl_browser] => false
[fl_sub_lcd] => false
[full_flash_support] => false
[css_supports_width_as_percentage] => true
[css_border_image] => none
[css_rounded_corners] => none
[css_gradient] => none
[css_spriting] => false
[css_gradient_linear] => none
[is_transcoder] => false
[transcoder_ua_header] => user-agent
[rss_support] => false
[pdf_support] => false
[progressive_download] => false
[playback_vcodec_h263_0] => -1
[playback_vcodec_h263_3] => -1
[playback_vcodec_mpeg4_sp] => -1
[playback_vcodec_mpeg4_asp] => -1
[playback_vcodec_h264_bp] => -1
[playback_real_media] => none
[playback_3gpp] => false
[playback_3g2] => false
[playback_mp4] => false
[playback_mov] => false
[playback_acodec_amr] => none
[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] => false
[html_preferred_dtd] => xhtml_mp1
[viewport_supported] => false
[viewport_width] =>
[viewport_userscalable] =>
[viewport_initial_scale] =>
[viewport_maximum_scale] =>
[viewport_minimum_scale] =>
[mobileoptimized] => false
[handheldfriendly] => false
[canvas_support] => none
[image_inlining] => false
[is_smarttv] => false
[is_console] => false
[nfc_support] => false
[ux_full_desktop] => false
[jqm_grade] => none
[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>Obigo WAP2.0</td><td><i class="material-icons">close</i></td><td> </td><td style="border-left: 1px solid #555">LG</td><td>G922</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.001</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://en.wikipedia.org/wiki/Obigo_Browser
[title] => Obigo WAP2.0
[code] => obigo
[version] => WAP2.0
[name] => Obigo
[image] => img/16/browser/obigo.png
)
[os] => Array
(
[link] =>
[name] =>
[version] =>
[code] => null
[x64] =>
[title] =>
[type] => os
[dir] => os
[image] => img/16/os/null.png
)
[device] => Array
(
[link] => http://www.lgmobile.com
[title] => LG G922
[model] => G922
[brand] => LG
[code] => lg
[dir] => device
[type] => device
[image] => img/16/device/lg.png
)
[platform] => Array
(
[link] => http://www.lgmobile.com
[title] => LG G922
[model] => G922
[brand] => LG
[code] => lg
[dir] => device
[type] => device
[image] => img/16/device/lg.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:07:11</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> | Java |
---
category: travel
type: post
---
# 千里江山&赵孟頫&茜茜公主
住在北京的最大好处就是冬天能以 40 元的价格逛故宫,并看到别处动辄上百的展品。
## 千里江山图 & 江山秋色图




千里江山图全长 11.9 米,是王希孟用半年时间画的宫廷画。
我看到的这幅其实是清代仿品,10 月 30 号后原作就收回去休息了,
但即使是仿品,由于原料昂贵制作耗时长,就像敦煌莫高窟,
仿品依然珍贵。





因为看的是仿品,自然排队的人没那么多,据说去看真品的队伍能够排到午门台阶上。

真的值得现场一看,美术书上面根本无法表现出画作的气派。
据说这次展览高峰故宫来了 8 万人,2000 人来看画。






最后还有一副,额。。。行为艺术


## 赵孟頫

赵孟頫字画,很多人盛赞,本人表示并没觉得特别突出,
但是无比较就看不出特别,比如和乾隆的简笔画版临摹,
真的看得出大家的水平了


但是下面这个。。。真的分不清了,上面的是仿品。





## 茜茜公主
真心不了解,匈牙利的王后,展馆介绍了很多奥匈帝国的生平。
果然有人对这段历史比较了解,还看过电影(瞬间觉得自己很 low)。




| Java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.