code
stringlengths 3
1.05M
| repo_name
stringlengths 4
116
| path
stringlengths 3
942
| language
stringclasses 30
values | license
stringclasses 15
values | size
int32 3
1.05M
|
|---|---|---|---|---|---|
package com.sincsmart.attendance.util;
import com.activeandroid.util.Log;
import android.content.Context;
import android.util.TypedValue;
//常用单位转换的辅助类
public class DensityUtils {
private DensityUtils() {
/* cannot be instantiated */
throw new UnsupportedOperationException("cannot be instantiated");
}
/**
* dp转px
*
* @param context
* @param val
* @return
*/
public static int dp2px(Context context, float dpVal) {
final float scale = context.getResources().getDisplayMetrics().density;
Log.i("ldb", "分辨率" + scale);
return (int) (dpVal * scale + 0.5f);
}
/**
* sp转px
*
* @param context
* @param val
* @return
*/
public static int sp2px(Context context, float spVal) {
return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP,
spVal, context.getResources().getDisplayMetrics());
}
/**
* px转dp
*
* @param context
* @param pxVal
* @return
*/
public static float px2dp(Context context, float pxVal) {
final float scale = context.getResources().getDisplayMetrics().density;
return (pxVal / scale);
}
/**
* px转sp
*
* @param fontScale
* @param pxVal
* @return
*/
public static float px2sp(Context context, float pxVal) {
return (pxVal / context.getResources().getDisplayMetrics().scaledDensity);
}
}
|
zhilianxinke/attendance
|
src/com/sincsmart/attendance/util/DensityUtils.java
|
Java
|
mit
| 1,335
|
// Copyright (c) 2012 Ecma International. All rights reserved.
// Ecma International makes this code available under the terms and conditions set
// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
// "Use Terms"). Any redistribution of this code must retain the above
// copyright and this notice and otherwise comply with the Use Terms.
/*---
es5id: 15.2.3.7-6-a-78
description: >
Object.defineProperties will not throw TypeError when
P.configurable is false, P.writalbe is false, properties.value and
P.value are two numbers with the same value (8.12.9 step 10.a.ii.1)
includes: [propertyHelper.js]
---*/
var obj = {};
Object.defineProperty(obj, "foo", {
value: 100,
writable: false,
configurable: false
});
Object.defineProperties(obj, {
foo: {
value: 100
}
});
verifyEqualTo(obj, "foo", 100);
verifyNotWritable(obj, "foo");
verifyNotEnumerable(obj, "foo");
verifyNotConfigurable(obj, "foo");
|
PiotrDabkowski/Js2Py
|
tests/test_cases/built-ins/Object/defineProperties/15.2.3.7-6-a-78.js
|
JavaScript
|
mit
| 975
|
<!DOCTYPE html>
<html ng-app="app" ng-strict-di ng-csp>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Mumble Channel Viewer Background page</title>
<link rel="stylesheet" href="../css/vendor.min.css">
<link rel="stylesheet" href="../css/styles.min.css">
</head>
<body>
<div id="main" ng-controller="ActionController as action">
<mumble-server server="action.server" refresh="action.refresh()" settings="action.openSettings()" config="action.config" message="action.message"></mumble-server>
</div>
<script src="../js/vendor.min.js"></script>
<script src="../js/all.min.js"></script>
</body>
</html>
|
nunof07/chrome-mumble
|
src/pages/action.html
|
HTML
|
mit
| 727
|
<!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">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>V8 API Reference Guide for node.js v0.10.27 - v0.10.28: v8::HeapGraphEdge Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">V8 API Reference Guide for node.js v0.10.27 - v0.10.28
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li><a href="examples.html"><span>Examples</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="classes.html"><span>Class Index</span></a></li>
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespacev8.html">v8</a></li><li class="navelem"><a class="el" href="classv8_1_1_heap_graph_edge.html">HeapGraphEdge</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-types">Public Types</a> |
<a href="#pub-methods">Public Member Functions</a> |
<a href="classv8_1_1_heap_graph_edge-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">v8::HeapGraphEdge Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p><code>#include <<a class="el" href="v8-profiler_8h_source.html">v8-profiler.h</a>></code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:a252500cf4307fe9e4fcb0335a907259b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a252500cf4307fe9e4fcb0335a907259b"></a>enum  </td><td class="memItemRight" valign="bottom"><b>Type</b> { <br />
  <b>kContextVariable</b> = 0,
<b>kElement</b> = 1,
<b>kProperty</b> = 2,
<b>kInternal</b> = 3,
<br />
  <b>kHidden</b> = 4,
<b>kShortcut</b> = 5,
<b>kWeak</b> = 6
<br />
}</td></tr>
<tr class="separator:a252500cf4307fe9e4fcb0335a907259b"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a7f4923098074ee4c47d901f363728d08"><td class="memItemLeft" align="right" valign="top">Type </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_heap_graph_edge.html#a7f4923098074ee4c47d901f363728d08">GetType</a> () const </td></tr>
<tr class="separator:a7f4923098074ee4c47d901f363728d08"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aa91362db6bfdbecfc48d3ba57d292705"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classv8_1_1_handle.html">Handle</a>< <a class="el" href="classv8_1_1_value.html">Value</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_heap_graph_edge.html#aa91362db6bfdbecfc48d3ba57d292705">GetName</a> () const </td></tr>
<tr class="separator:aa91362db6bfdbecfc48d3ba57d292705"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:acd43a5082f1862b7c0c0094fc75af631"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classv8_1_1_heap_graph_node.html">HeapGraphNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_heap_graph_edge.html#acd43a5082f1862b7c0c0094fc75af631">GetFromNode</a> () const </td></tr>
<tr class="separator:acd43a5082f1862b7c0c0094fc75af631"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ad8fd8fa121a0e778a8b120a0c5fa227c"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classv8_1_1_heap_graph_node.html">HeapGraphNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_heap_graph_edge.html#ad8fd8fa121a0e778a8b120a0c5fa227c">GetToNode</a> () const </td></tr>
<tr class="separator:ad8fd8fa121a0e778a8b120a0c5fa227c"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>HeapSnapshotEdge represents a directed connection between heap graph nodes: from retainers to retained nodes. </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="acd43a5082f1862b7c0c0094fc75af631"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const <a class="el" href="classv8_1_1_heap_graph_node.html">HeapGraphNode</a>* v8::HeapGraphEdge::GetFromNode </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns origin node. </p>
</div>
</div>
<a class="anchor" id="aa91362db6bfdbecfc48d3ba57d292705"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classv8_1_1_handle.html">Handle</a><<a class="el" href="classv8_1_1_value.html">Value</a>> v8::HeapGraphEdge::GetName </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns edge name. This can be a variable name, an element index, or a property name. </p>
</div>
</div>
<a class="anchor" id="ad8fd8fa121a0e778a8b120a0c5fa227c"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const <a class="el" href="classv8_1_1_heap_graph_node.html">HeapGraphNode</a>* v8::HeapGraphEdge::GetToNode </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns destination node. </p>
</div>
</div>
<a class="anchor" id="a7f4923098074ee4c47d901f363728d08"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">Type v8::HeapGraphEdge::GetType </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns edge type (see HeapGraphEdge::Type). </p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>deps/v8/include/<a class="el" href="v8-profiler_8h_source.html">v8-profiler.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Tue Aug 11 2015 23:45:14 for V8 API Reference Guide for node.js v0.10.27 - v0.10.28 by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.9.1
</small></address>
</body>
</html>
|
v8-dox/v8-dox.github.io
|
3f3a71e/html/classv8_1_1_heap_graph_edge.html
|
HTML
|
mit
| 9,845
|
import './clean-rich-text-editor.css';
import select from 'select-dom';
import onetime from 'onetime';
import * as pageDetect from 'github-url-detection';
import features from '.';
function hideButtons(): void {
document.body.classList.add('rgh-clean-rich-text-editor');
}
function hideTextareaTooltip(): void {
for (const textarea of select.all('.comment-form-textarea')) {
textarea.title = '';
}
}
void features.add(__filebasename, {
include: [
pageDetect.hasRichTextEditor,
],
deduplicate: 'has-rgh-inner',
init: hideTextareaTooltip,
}, {
include: [
pageDetect.isRepo,
],
awaitDomReady: false,
init: onetime(hideButtons),
});
|
sindresorhus/refined-github
|
source/features/clean-rich-text-editor.tsx
|
TypeScript
|
mit
| 650
|
import subprocess
with open('names.txt') as f:
names = f.read().splitlines()
with open('portraits.txt') as f:
portraits = f.read().splitlines()
for i, name in enumerate(names):
portrait = portraits[i]
if portrait.endswith('.png'):
subprocess.call(['cp', 'minor/{}'.format(portrait), '{}.png'.format(name.lower())])
|
dcripplinger/rotj
|
data/images/portraits/copy_portraits.py
|
Python
|
mit
| 341
|
<h2>New Group</h2>
<br>
<?php echo render('admin/group/_form'); ?>
<p><?php echo Html::anchor('admin/group', 'Back'); ?></p>
|
hrabbit/newzearch
|
fuel/app/views/admin/group/create.php
|
PHP
|
mit
| 128
|
# CurateScience Client
This repository is the frontend/client for the [CurateScience](https://www.curatescience.org/) application. It's a single-page Javascript app written in the [Mithril Framework](https://lhorie.github.io/mithril/). It uses [Grunt](http://gruntjs.com/) for task running and [webpack](http://webpack.github.io/) to build the app for deployment.
## Contributing
Please see the CurateScience [contributing guidelines](https://github.com/ScienceCommons/api/blob/master/CONTRIBUTING.md) and set aside an hour or two to study [Mithril](https://lhorie.github.io/mithril/) if you've never worked with it before.
## Getting started
Install [node](http://nodejs.org/download/).
Ensure that you have grunt and grunt cli installed globally
```
sudo npm install -g grunt grunt-cli
```
Set your DEV_API_ROOT environment variable to the CurateScience API server you want to query (trailing slash required), e.g.:
```
export DEV_API_ROOT="http://localhost:5000/"
```
Then
```
npm install
grunt serve
```
In order to compile the icons you will need [fontforge](http://fontforge.github.io/en-US/) installed.
The Gruntfile is set up with tasks to compile and deploy the assets to an Amazon Web Services S3 account. In order to deploy to your S3 account you will need to set the environment variables:
```
AWS_S3_KEY
AWS_S3_SECRET
AWS_S3_TEST_BUCKET
AWS_S3_BUCKET
PROD_API_ROOT
```
and then run the grunt task, e.g.:
```
grunt deploy:production
```
|
ScienceCommons/www
|
README.md
|
Markdown
|
mit
| 1,500
|
import React from "react";
export default class TransactionSentModal extends React.Component {
constructor(props) {
super(props);
this.state = {
};
}
render() {
return (
<div className={this.props.transactionSent ? "transaction-sent-wrap active" : "transaction-sent-wrap"}>
{
this.props.transactionSent
?
<form className="container transactionSent" onSubmit={this.props.closeSuccessModal}>
<div className="head">
<h3>Sent </h3>
<span className="close" onClick={this.props.closeSuccessModal}>X</span>
</div>
<div className="currency">
<span>Currency:</span>
<img className={this.props.sendCoin === 'safex'
? 'coin'
: 'coin hidden-xs hidden-sm hidden-md hidden-lg'}
onClick={this.props.sendCoinSafex}
src="images/coin-white.png" alt="Safex Coin"/>
<img className={this.props.sendCoin === 'btc'
? 'coin'
: 'coin hidden-xs hidden-sm hidden-md hidden-lg'}
onClick={this.props.sendCoinBtc} src="images/btc-coin.png"
alt="Bitcoin Coin"/>
</div>
<div className="input-group">
<label htmlFor="from">From:</label>
<textarea name="from" className="form-control" readOnly
value={this.props.publicKey} placeholder="Address"
aria-describedby="basic-addon1">
</textarea>
</div>
<div className="input-group">
<label htmlFor="destination">To:</label>
<textarea name="destination" className="form-control" readOnly
value={this.props.receiveAddress} placeholder="Address"
aria-describedby="basic-addon1">
</textarea>
</div>
<div className="input-group">
<label htmlFor="txid">TX ID:</label>
<textarea name="txid" className="form-control" readOnly
value={this.props.txid} placeholder="Address"
aria-describedby="basic-addon1" rows="3">
</textarea>
</div>
<input type="hidden" readOnly name="private_key"
value={this.props.privateKey} />
<input type="hidden" readOnly name="public_key"
value={this.props.publicKey} />
<div className="form-group">
<label htmlFor="amount">Amount:</label>
<input readOnly name="amount" value={this.props.sendAmount} />
</div>
<div className="form-group">
<label htmlFor="fee">Fee(BTC):</label>
<input readOnly name="fee" value={this.props.sendFee} />
</div>
<div className="form-group">
<label htmlFor="total">Total:</label>
<input readOnly name="total" value={this.props.sendTotal} />
</div>
<button type="submit" className="sent-close button-shine">
Close
</button>
</form>
:
<div></div>
}
</div>
);
}
}
|
safex/safex_wallet
|
src/components/partials/TransactionSentModal.js
|
JavaScript
|
mit
| 4,367
|
/*
* Generated by class-dump 3.3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.
*/
#import "NSObject.h"
// Not exported
@interface TSTPasteMap : NSObject
{
set_d5b49e31 mRowTgtToPbMaps;
set_d5b49e31 mColumnTgtToPbMaps;
}
- (id).cxx_construct;
- (void).cxx_destruct;
- (id)createTgtMergeMapFromPbMergeMap:(id)arg1 andTgtRegion:(id *)arg2 andTgtBodyRange:(CDStruct_5f1f7aa9)arg3;
- (vector_764b4ef2 *)p_tgtRangesForPbRange:(CDStruct_5f1f7aa9)arg1 givenColumnMaps:(const multiset_5f6ec4d0 *)arg2 rowMaps:(const multiset_5f6ec4d0 *)arg3;
- (id)createTgtRegionByIntersectingPbRegion:(id)arg1 andTgtRegion:(id)arg2;
- (id)createTgtRegionFromPbRegion:(id)arg1;
- (CDStruct_0441cfb5)pbCellIDForTgtCellID:(CDStruct_0441cfb5)arg1;
- (CDStruct_5f1f7aa9)pbRangeForTgtRange:(CDStruct_5f1f7aa9)arg1;
- (CDStruct_0441cfb5)p_tgtCellIDForPbCellID:(CDStruct_0441cfb5)arg1 givenColumnMaps:(const multiset_5f6ec4d0 *)arg2 rowMaps:(const multiset_5f6ec4d0 *)arg3;
- (CDStruct_5f1f7aa9)p_tgtRangeForPbRange:(CDStruct_5f1f7aa9)arg1 givenColumnMaps:(const multiset_5f6ec4d0 *)arg2 rowMaps:(const multiset_5f6ec4d0 *)arg3;
- (unsigned short)p_indexForPbToTgtMaps:(const multiset_5f6ec4d0 *)arg1 andMap:(struct TSTColumnOrRowMap *)arg2;
- (unsigned short)p_indexForTgtToPbMaps:(set_d5b49e31 *)arg1 andMap:(struct TSTColumnOrRowMap *)arg2;
- (id)initWithPbTable:(id)arg1 pbRange:(CDStruct_5f1f7aa9)arg2 tgtTable:(id)arg3 tgtRange:(CDStruct_5f1f7aa9)arg4 flag:(int)arg5;
- (id)initWithPbRange:(CDStruct_5f1f7aa9)arg1 tgtRange:(CDStruct_5f1f7aa9)arg2;
@end
|
matthewsot/CocoaSharp
|
Headers/PrivateFrameworks/iWorkImport/TSTPasteMap.h
|
C
|
mit
| 1,599
|
#pragma once
#include <vector>
#include <memory>
#ifndef ARBITER_IS_AMALGAMATION
#include <arbiter/driver.hpp>
#include <arbiter/util/http.hpp>
#endif
#ifdef ARBITER_CUSTOM_NAMESPACE
namespace ARBITER_CUSTOM_NAMESPACE
{
#endif
namespace arbiter
{
namespace drivers
{
/** @brief HTTP driver. Intended as both a standalone driver as well as a base
* for derived drivers build atop HTTP.
*
* Derivers should overload the HTTP-specific put/get methods that accept
* headers and query parameters rather than Driver::put and Driver::get.
*
* Internal methods for derivers are provided as protected methods.
*/
class ARBITER_DLL Http : public Driver
{
public:
Http(http::Pool& pool);
static std::unique_ptr<Http> create(http::Pool& pool);
// Inherited from Driver.
virtual std::string type() const override { return "http"; }
/** By default, performs a HEAD request and returns the contents of the
* Content-Length header.
*/
virtual std::unique_ptr<std::size_t> tryGetSize(
std::string path) const override;
virtual void put(
std::string path,
const std::vector<char>& data) const final override
{
put(path, data, http::Headers(), http::Query());
}
/* HTTP-specific driver methods follow. Since many drivers (S3, Dropbox,
* etc.) are built atop HTTP, we'll provide HTTP-specific methods for
* derived classes to use in addition to the generic PUT/GET combinations.
*
* Specifically, we'll add POST/HEAD calls, and allow headers and query
* parameters to be passed as well.
*/
/** Perform an HTTP GET request. */
std::string get(
std::string path,
http::Headers headers = http::Headers(),
http::Query query = http::Query()) const;
/** Perform an HTTP GET request. */
std::unique_ptr<std::string> tryGet(
std::string path,
http::Headers headers = http::Headers(),
http::Query query = http::Query()) const;
/* Perform an HTTP HEAD request. */
std::size_t getSize(
std::string path,
http::Headers headers,
http::Query query = http::Query()) const;
/* Perform an HTTP HEAD request. */
std::unique_ptr<std::size_t> tryGetSize(
std::string path,
http::Headers headers,
http::Query query = http::Query()) const;
/** Perform an HTTP GET request. */
std::vector<char> getBinary(
std::string path,
http::Headers headers,
http::Query query) const;
/** Perform an HTTP GET request. */
std::unique_ptr<std::vector<char>> tryGetBinary(
std::string path,
http::Headers headers,
http::Query query) const;
/** Perform an HTTP PUT request. */
void put(
std::string path,
const std::string& data,
http::Headers headers,
http::Query query) const;
/** HTTP-derived Drivers should override this version of PUT to allow for
* custom headers and query parameters.
*/
/** Perform an HTTP PUT request. */
virtual void put(
std::string path,
const std::vector<char>& data,
http::Headers headers,
http::Query query) const;
void post(
std::string path,
const std::string& data,
http::Headers headers,
http::Query query) const;
void post(
std::string path,
const std::vector<char>& data,
http::Headers headers,
http::Query query) const;
/* These operations are other HTTP-specific calls that derived drivers may
* need for their underlying API use.
*/
http::Response internalGet(
std::string path,
http::Headers headers = http::Headers(),
http::Query query = http::Query(),
std::size_t reserve = 0) const;
http::Response internalPut(
std::string path,
const std::vector<char>& data,
http::Headers headers = http::Headers(),
http::Query query = http::Query()) const;
http::Response internalHead(
std::string path,
http::Headers headers = http::Headers(),
http::Query query = http::Query()) const;
http::Response internalPost(
std::string path,
const std::vector<char>& data,
http::Headers headers = http::Headers(),
http::Query query = http::Query()) const;
protected:
/** HTTP-derived Drivers should override this version of GET to allow for
* custom headers and query parameters.
*/
virtual bool get(
std::string path,
std::vector<char>& data,
http::Headers headers,
http::Query query) const;
http::Pool& m_pool;
private:
virtual bool get(
std::string path,
std::vector<char>& data) const final override
{
return get(path, data, http::Headers(), http::Query());
}
std::string typedPath(const std::string& p) const;
};
/** @brief HTTPS driver. Identical to the HTTP driver except for its type
* string.
*/
class Https : public Http
{
public:
Https(http::Pool& pool) : Http(pool) { }
static std::unique_ptr<Https> create(http::Pool& pool)
{
return std::unique_ptr<Https>(new Https(pool));
}
virtual std::string type() const override { return "https"; }
};
} // namespace drivers
} // namespace arbiter
#ifdef ARBITER_CUSTOM_NAMESPACE
}
#endif
|
connormanning/arbiter
|
arbiter/drivers/http.hpp
|
C++
|
mit
| 5,624
|
Chance = require('chance');
chance = new Chance();
function generateStudent() {
var numberOfStudent = chance.integer({
min: 0,
max: 10
})
console.log(numberOfStudent);
var students = [];
for (var i = 0; i < numberOfStudent; i++) {
var birthYear = chance.year({
min: 1990,
max: 2000
});
var gender = chance.gender();
students.push({
firstname: chance.first({
gender: gender
}),
lastname: chance.last(),
gender: gender,
birthday: chance.birthday({
year: birthYear
})
});
}
console.log(students);
return students;
}
function genPlaName() {
var planetsName = ["Sun", "Kepler", "Earth", "Dagoba", "Coruscant", "Venus", "Jupiter", "Hoth"];
var idName = chance.integer({
min: 0,
max: planetsName.length-1
});
var rndNumber = chance.integer({
min: 1,
max: 9999
});
return planetsName[idName] + "-" + rndNumber;
}
function generatePlanet() {
var nbrOfPlanet = chance.integer({
min: 1,
max: 10
});
var planets = [];
for (var i = 0; i < nbrOfPlanet; i++) {
var minTemperature = chance.integer({
min: -270,
max: 1000
});
var maxTemperature = chance.integer({
min: minTemperature,
max: 1000
});
planets.push({
name: genPlaName(),
minTemperature: minTemperature,
maxTemperature: maxTemperature
});
}
console.log(planets);
return planets;
}
function generatePayload() {
return generatePlanet();
}
exports.generatePayload = generatePayload;
|
verdonarthur/Teaching-HEIGVD-RES-2016-Labo-HTTPInfra
|
docker-images/node-image/src/jsonPayloadGen.js
|
JavaScript
|
mit
| 1,797
|
#!/usr/bin/env python3
# -*- encoding: utf-8 -*-
from distutils.core import setup, Extension
setup(name='sample',
ext_modules=[
Extension('sample',
['pysample.c'],
include_dirs=['/some/dir'],
define_macros=[('FOO', '1')],
undef_macros=['BAR'],
library_dirs=['/usr/local/lib'],
libraries=['sample']
)
]
)
|
xu6148152/Binea_Python_Project
|
PythonCookbook/interaction_c/setup.py
|
Python
|
mit
| 474
|
<div class="modal-shadow" (click)="stopPropagation($event)">
<div class="modal-content create-group-container">
<h2 class="modal-title">
<span *ngIf="!createGroup.info.action">发起群聊</span>
<span *ngIf="createGroup.info.action === 'add'">添加群成员</span>
<span *ngIf="createGroup.info.action === 'many'">多人会话</span>
<span class="modal-close" (click)="cancelCreateGroup($event)"></span>
</h2>
<div class="create-group-main">
<div class="create-group-list">
<div class="craete-group-search">
<search-member-component [searchResult]="searchResult" (searchKeyup)="searchKeyupEmit()" (clearInput)="clearInputEmit()" (searchBtn)="searchBtnEmit($event)" (changeChecked)="changeCheckedEmit($event)"></search-member-component>
</div>
<perfect-scrollbar class="create-group-scroll">
<div *ngFor="let item of createGroup.list">
<div class="create-group-letter" *ngIf="!item.allFilter && item.data.length > 0">{{item.letter}}</div>
<div class="create-group-member" *ngIf="!item.allFilter && item.data.length > 0">
<div *ngFor="let user of item.data; let num = index" class="create-group-item">
<div class="display-flex" *ngIf="user.show">
<div class="create-group-avatar">
<img [src]="user.avatarUrl" avatarLoad [avatarError]="3" alt="">
</div>
<div class="flex-1 create-group-username">{{user.memo_name || user.nickName || user.name}}</div>
<label class="create-group-select-label">
<input spellcheck="false" type="checkbox" (change)="selectItem($event, user)" [checked]="user.checked" [disabled]="user.disabled">
<b></b>
</label>
</div>
</div>
</div>
</div>
</perfect-scrollbar>
</div>
<div class="create-group-select">
<p class="create-group-select-title">已选成员</p>
<perfect-scrollbar class="create-group-scroll-select">
<div *ngFor="let user of selectList" class="create-group-item">
<div class="display-flex">
<div class="create-group-avatar">
<img [src]="user.avatarUrl" avatarLoad [avatarError]="3" alt="">
</div>
<div class="flex-1 create-group-username">{{user.memo_name || user.nickName || user.name}}</div>
<div class="create-group-cancel-select" *ngIf="!createGroup.info.activeSingle || (createGroup.info.activeSingle.key && user.key != createGroup.info.activeSingle.key)" (click)="cancelSelect(user)"></div>
</div>
</div>
</perfect-scrollbar>
</div>
</div>
<p class="modal-btn modal-input create-group-name">
<button type="button" *ngIf="!createGroup.info.action" (click)="nextCreateGroupAction()" class="btn-confirm btn-active float-right">下一步</button>
<button type="button" *ngIf="createGroup.info.action" (click)="confirmCreateGroup()" class="btn-confirm btn-active float-right">确定</button>
<button type="button" (click)="cancelCreateGroup($event)" class="btn-cancel btn-white float-right">取消</button>
</p>
</div>
</div>
|
jpush/jchat-web
|
src/app/components/create-group/create-group.component.html
|
HTML
|
mit
| 3,916
|
<?php
namespace Override\ScrumBundle\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use JMS\SecurityExtraBundle\Annotation\Secure;
use Override\FosUserBundle\Entity\User;
use Override\ScrumBundle\Form\UserType as UserType;
use Override\ScrumBundle\Entity\SecretaireFormation;
use Override\ScrumBundle\Entity\Professeur;
use Override\ScrumBundle\Entity\Etudiant;
/**
* User controller.
*
* @Route("/user")
*/
class UserController extends Controller
{
/**
* Lists all User entities.
*
* @Secure({"ROLE_ADMIN", "ROLE_SECRETARY"})
* @Route("/", name="user")
* @Method("GET")
* @Template()
*/
public function indexAction()
{
$em = $this->getDoctrine()->getManager();
$entities = $em->getRepository('OverrideFosUserBundle:User')->findAll();
return array(
'entities' => $entities,
);
}
/**
* Displays a form to edit an existing User entity.
*
* @Secure(roles="ROLE_ADMIN")
* @Route("/{id}/edit", name="user_edit")
* @Method("GET")
* @Template()
*/
public function editAction($id)
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('OverrideFosUserBundle:User')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find User entity.');
}
$editForm = $this->createEditForm($entity);
$deleteForm = $this->createDeleteForm($id);
return array(
'entity' => $entity,
'edit_form' => $editForm->createView(),
'delete_form' => $deleteForm->createView(),
);
}
/**
* Creates a form to edit a User entity.
*
* @param User $entity The entity
*
* @return \Symfony\Component\Form\Form The form
*/
private function createEditForm(User $entity)
{
$form = $this->createForm(new UserType(), $entity, array(
'action' => $this->generateUrl('user_update', array('id' => $entity->getId())),
'method' => 'PUT',
));
$form->add('submit', 'submit', array('label' => 'Update'));
return $form;
}
/**
* Edits an existing User entity.
*
* @Secure(roles="ROLE_ADMIN")
* @Route("/{id}", name="user_update")
* @Method("PUT")
* @Template("OverrideScrumBundle:User:edit.html.twig")
*/
public function updateAction(Request $request, $id)
{
$em = $this->getDoctrine()->getManager();
/** Retrieve the user **/
$user = $em->getRepository('OverrideFosUserBundle:User')->find($id);
if (!$user) {
throw $this->createNotFoundException('Unable to find User entity.');
}
/** Set edit and delete form **/
$deleteForm = $this->createDeleteForm($id);
$editForm = $this->createEditForm($user);
$editForm->handleRequest($request);
/** Form is valid we can insert the user **/
if ($editForm->isValid()) {
/** Remove user from all table where he can exist**/
$issetSecretaire = $em->getRepository('OverrideScrumBundle:SecretaireFormation')->findOneBy(array('user' => $user->getId()));
if($issetSecretaire) {
$em->remove($issetSecretaire);
}
$issetProfesseur = $em->getRepository('OverrideScrumBundle:Professeur')->findOneBy(array('user' => $user->getId()));
if($issetProfesseur) {
$em->remove($issetProfesseur);
}
$issetEtudiant = $em->getRepository('OverrideScrumBundle:Etudiant')->findOneBy(array('user' => $user->getId()));
if($issetEtudiant) {
$em->remove($issetEtudiant);
}
// Flushes remove from enity
$em->flush();
// Set the user role and persist
$user->setRoles(array($editForm->get('roles')->getData()));
$em->persist($user);
/** Insert in database (depends of user role) **/
switch ($editForm->get('roles')->getData()) {
case 'ROLE_ADMIN':
$user->setRoles(array('ROLE_ADMIN'));
break;
case 'ROLE_SECRETARY':
$secretaire = new SecretaireFormation();
$secretaire->setUser($user);
$em->persist($secretaire);
break;
case 'ROLE_PROFESSOR':
$professeur = new Professeur();
$professeur->setUser($user);
$em->persist($professeur);
break;
case 'ROLE_STUDENT':
// If the diplome is null redirect the user
if($editForm->get('dernierDiplome')->getData() == NULL) {
$this->get('session')->getFlashBag()->add(
"danger",
"Le diplôme doit être rempli pour l'étudiant."
);
return $this->redirect($this->generateUrl('user_edit', array('id' => $user->getId())));
}
$etudiant = new Etudiant();
$etudiant->setUser($user);
$etudiant->setDernierDiplome($editForm->get('dernierDiplome')->getData());
$em->persist($etudiant);
break;
default:
return $this->redirect($this->generateUrl('user_edit', array('id' => $user->getId())));
break;
}
// Flush in the database
$em->flush();
// Redirect to the user list
return $this->redirect($this->generateUrl('user'));
}
// Redirect to the form when form not valid
return array(
'entity' => $user,
'edit_form' => $editForm->createView(),
'delete_form' => $deleteForm->createView(),
);
}
/**
* Deletes a User entity.
*
* @Secure(roles="ROLE_ADMIN")
* @Route("/{id}", name="user_delete")
* @Method("DELETE")
*/
public function deleteAction(Request $request, $id)
{
$form = $this->createDeleteForm($id);
$form->handleRequest($request);
if ($form->isValid()) {
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('OverrideFosUserBundle:User')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find User entity.');
}
$em->remove($entity);
$em->flush();
}
return $this->redirect($this->generateUrl('user'));
}
/**
* Creates a form to delete a User entity by id.
*
* @param mixed $id The entity id
*
* @return \Symfony\Component\Form\Form The form
*/
private function createDeleteForm($id)
{
return $this->createFormBuilder()
->setAction($this->generateUrl('user_delete', array('id' => $id)))
->setMethod('DELETE')
->add('submit', 'submit', array('label' => 'Delete'))
->getForm()
;
}
}
|
debflav/scrum
|
src/Override/ScrumBundle/Controller/UserController.php
|
PHP
|
mit
| 7,518
|
dojo.provide("plugins.core.Agua.File");
/* SUMMARY: THIS CLASS IS INHERITED BY Agua.js AND CONTAINS FILE CACHE
AND FILE MANIPULATION METHODS
*/
dojo.declare( "plugins.core.Agua.File", [ ], {
/////}}}
// FILECACHE METHODS
getFoldersUrl : function () {
return Agua.cgiUrl + "agua.cgi?";
},
setFileCaches : function (url) {
console.log("Agua.File.setFileCache url: " + url);
var callback = dojo.hitch(this, function (data) {
//console.log("Agua.File.setFileCache BEFORE setData, data: ");
//console.dir({data:data});
this.setData("filecaches", data);
});
//console.log("Agua.File.setFileCache Doing this.fetchJson(url, callback)");
this.fetchJson(url, callback);
},
fetchJson : function (url, callback) {
console.log("Agua.File.fetchJson url: " + url);
var thisObject = this;
dojo.xhrGet({
url: url,
sync: false,
handleAs: "json",
handle: function(data) {
//console.log("Agua.File.fetchJson data: ");
//console.dir({data:data});
callback(data);
},
error: function(response) {
console.log("Agua.File.fetchJson Error with JSON Post, response: " + response);
}
});
},
getFileCache : function (username, location) {
console.log("Agua.File.getFileCache username: " + username);
console.log("Agua.File.getFileCache location: " + location);
var fileCaches = this.cloneData("filecaches");
console.log("Agua.File.getFileCache fileCaches: ");
console.dir({fileCaches:fileCaches});
// RETURN IF NO ENTRIES FOR USER
if ( ! fileCaches[username] ) return null;
return fileCaches[username][location];
},
setFileCache : function (username, location, item) {
console.log("Agua.File.setFileCache username: " + username);
console.log("Agua.File.setFileCache location: " + location);
console.log("Agua.File.setFileCache item: ");
console.dir({item:item});
var fileCaches = this.getData("filecaches");
console.log("Agua.File.setFileCache fileCaches: ");
console.dir({fileCaches:fileCaches});
if ( ! fileCaches ) fileCaches = {};
if ( ! fileCaches[username] ) fileCaches[username] = {};
fileCaches[username][location] = item;
var parentDir = this.getParentDir(location);
console.log("Agua.File.setFileCache parentDir: " + parentDir);
if ( ! parentDir ) {
console.log("Agua.File.setFileCache SETTING fileCaches[" + username + "][" + location + "] = item");
fileCaches[username][location] = item;
return;
}
var parent = fileCaches[username][parentDir];
console.log("Agua.File.setFileCache parent: " + parent);
if ( ! parent ) return;
console.log("Agua.File.setFileCache parent: " + parent);
this.addItemToParent(parent, item);
console.log("Agua.File.setFileCache parent: " + parent);
console.dir({parent:parent});
},
addItemToParent : function (parent, item) {
parent.items.push(item);
},
getFileSystem : function (putData, callback, request) {
console.log("Agua.File.getFileSystem caller: " + this.getFileSystem.caller.nom);
console.log("Agua.File.getFileSystem putData:");
console.dir({putData:putData});
console.log("Agua.File.getFileSystem callback: " + callback);
console.dir({callback:callback});
console.log("Agua.File.getFileSystem request:");
console.dir({request:request});
// SET DEFAULT ARGS EMPTY ARRAY
if ( ! request )
request = new Array;
// SET LOCATION
var location = '';
if ( putData.location || putData.query )
location = putData.query || putData.location;
console.log("Agua.File.getFileSystem location: " + location);
var username = putData.username;
console.log("Agua.File.getFileSystem username: " + username);
// USE IF CACHED
var fileCache = this.getFileCache(username, location);
console.log("Agua.File.getFileSystem fileCache:");
console.dir({fileCache:fileCache});
if ( fileCache ) {
console.log("Agua.File.getFileSystem fileCache IS DEFINED. Doing setTimeout callback(fileCache, request)");
// DELAY TO AVOID node is undefined ERROR
setTimeout( function() {
callback(fileCache, request);
},
10,
this);
return;
}
else {
console.log("Agua.File.getFileSystem fileCache NOT DEFINED. Doing remote query");
this.queryFileSystem(putData, callback, request);
}
},
queryFileSystem : function (putData, callback, request) {
console.log("Agua.File.queryFileSystem putData:");
console.dir({putData:putData});
console.log("Agua.File.queryFileSystem callback:");
console.dir({callback:callback});
console.log("Agua.File.queryFileSystem request:");
console.dir({request:request});
// SET LOCATION
var location = '';
if ( putData.location || putData.query )
location = putData.query;
if ( ! putData.path && location ) putData.path = location;
console.log("Agua.File.queryFileSystem location: " + location);
// SET USERNAME
var username = putData.username;
var url = this.cgiUrl + "agua.cgi";
// QUERY REMOTE
var thisObject = this;
var putArgs = {
url : url,
//url : putData.url,
contentType : "text",
sync : false,
preventCache: true,
handleAs : "json-comment-optional",
putData : dojo.toJson(putData),
handle : function(response) {
console.log("Agua.File.queryFileSystem handle response:");
console.dir({response:response});
console.log("Agua.File.queryFileSystem BEFORE this.setFileCache()");
thisObject.setFileCache(username, location, dojo.clone(response));
console.log("Agua.File.queryFileSystem AFTER this.setFileCache()");
//callback(response, request);
}
};
var deferred = dojo.xhrPut(putArgs);
deferred.addCallback(callback);
var scope = request.scope || dojo.global;
deferred.addErrback(function(error){
if(request.onError){
request.onError.call(scope, error, request);
}
});
},
removeFileTree : function (username, location) {
console.log("Agua.File.removeFileTree username: " + username);
console.log("Agua.File.removeFileTree location: " + location);
var fileCaches = this.getData("filecaches");
console.log("Agua.File.removeFileTree fileCaches: ");
console.dir({fileCaches:fileCaches});
if ( ! fileCaches ) {
console.log("Agua.File.removeFileTree fileCaches is null. Returning");
return;
}
var rootTree = fileCaches[username];
console.log("Agua.File.removeFileTree rootTree: ");
console.dir({rootTree:rootTree});
if ( ! rootTree ) {
console.log("Agua.File.removeFileTree rootTree is null. Returning");
return;
}
for ( var fileRoot in fileCaches[username] ) {
if ( fileRoot.match('^' + location +'$')
|| fileRoot.match('^' + location +'\/') ) {
console.log("Agua.File.removeFileTree DELETING fileRoot: " + fileRoot);
// delete fileCaches[username][fileRoot];
}
}
if ( ! location.match(/^(.+)\/[^\/]+$/) ) {
console.log("Agua.File.removeFileTree No parentDir. Returning");
return;
}
var parentDir = location.match(/^(.+)\/[^\/]+$/)[1];
var child = location.match(/^.+\/([^\/]+)$/)[1];
console.log("Agua.File.removeFileTree parentDir: " + parentDir);
console.log("Agua.File.removeFileTree child: " + child);
this.removeItemFromParent(fileCaches[username][parentDir], child);
var project1 = fileCaches[username][parentDir];
console.log("Agua.File.removeFileTree project1: " + project1);
console.dir({project1:project1});
console.log("Agua.File.removeFileTree END");
},
removeItemFromParent : function (parent, childName) {
for ( i = 0; i < parent.items.length; i++ ) {
var childObject = parent.items[i];
if ( childObject.name == childName ) {
parent.items.splice(i, 1);
break;
}
}
},
removeRemoteFile : function (username, location, callback) {
console.log("Agua.File.removeRemoteFile username: " + username);
console.log("Agua.File.removeRemoteFile location: " + location);
console.log("Agua.File.removeRemoteFile callback: " + callback);
// DELETE ON REMOTE
var url = this.getFoldersUrl();
var putData = new Object;
putData.mode = "removeFile";
putData.module = "Folders";
putData.sessionid = Agua.cookie('sessionid');
putData.username = Agua.cookie('username');
putData.file = location;
var thisObject = this;
dojo.xhrPut(
{
url : url,
putData : dojo.toJson(putData),
handleAs : "json",
sync : false,
handle : function(response) {
if ( callback ) callback(response);
}
}
);
},
renameFileTree : function (username, oldLocation, newLocation) {
console.log("Agua.File.renameFileTree username: " + username);
console.log("Agua.File.renameFileTree oldLocation: " + oldLocation);
console.log("Agua.File.renameFileTree newLocation: " + newLocation);
var fileCaches = this.getData("filecaches");
console.log("Agua.File.renameFileTree fileCaches: ");
console.dir({fileCaches:fileCaches});
if ( ! fileCaches ) {
console.log("Agua.File.renameFileTree fileCaches is null. Returning");
return;
}
var rootTree = fileCaches[username];
console.log("Agua.File.renameFileTree rootTree: ");
console.dir({rootTree:rootTree});
if ( ! rootTree ) {
console.log("Agua.File.renameFileTree rootTree is null. Returning");
return;
}
for ( var fileRoot in fileCaches[username] ) {
if ( fileRoot.match('^' + oldLocation +'$')
|| fileRoot.match('^' + oldLocation +'\/') ) {
console.log("Agua.File.renameFileTree DELETING fileRoot: " + fileRoot);
var value = fileCaches[username][fileRoot];
var re = new RegExp('^' + oldLocation);
var newRoot = fileRoot.replace(re, newLocation);
console.log("Agua.File.renameFileTree ADDING newRoot: " + newRoot);
delete fileCaches[username][fileRoot];
fileCaches[username][newRoot] = value;
}
}
console.log("Agua.File.renameFileTree oldLocation: " + oldLocation);
var parentDir = this.getParentDir(oldLocation);
console.log("Agua.File.renameFileTree oldLocation: " + oldLocation);
if ( ! parentDir ) return;
console.log("Agua.File.renameFileTree Doing this.renameItemInParent()");
var child = this.getChild(oldLocation);
var newChild = newLocation.match(/^.+\/([^\/]+)$/)[1];
console.log("Agua.File.renameFileTree parentDir: " + parentDir);
console.log("Agua.File.renameFileTree child: " + child);
console.log("Agua.File.renameFileTree newChild: " + newChild);
var parent = fileCaches[username][parentDir];
this.renameItemInParent(parent, child, newChild);
console.log("Agua.File.renameFileTree parent: " + parent);
console.dir({parent:parent});
console.log("Agua.File.renameFileTree END");
},
renameItemInParent : function (parent, childName, newChildName) {
for ( i = 0; i < parent.items.length; i++ ) {
var childObject = parent.items[i];
if ( childObject.name == childName ) {
var re = new RegExp(childName + "$");
parent.items[i].name= parent.items[i].name.replace(re, newChildName);
console.log("Agua.File.renameItemInParent NEW parent.items[" + i + "].name: " + parent.items[i].name);
parent.items[i].path= parent.items[i].path.replace(re, newChildName);
console.log("Agua.File.repathItemInParent NEW parent.items[" + i + "].path: " + parent.items[i].path);
break;
}
}
},
getParentDir : function (location) {
if ( ! location.match(/^(.+)\/[^\/]+$/) ) return null;
return location.match(/^(.+)\/[^\/]+$/)[1];
},
getChild : function (location) {
if ( ! location.match(/^.+\/([^\/]+)$/) ) return null;
return location.match(/^.+\/([^\/]+)$/)[1];
},
isDirectory : function (username, location) {
// USE IF CACHED
var fileCache = this.getFileCache(username, location);
console.log("Agua.File.isDirectory username: " + username);
console.log("Agua.File.isDirectory location: " + location);
console.log("Agua.File.isDirectory fileCache: ");
console.dir({fileCache:fileCache});
if ( fileCache ) return fileCache.directory;
return null;
},
isFileCacheItem : function (username, directory, itemName) {
console.log("Agua.isFileCacheItem username: " + username);
console.log("Agua.isFileCacheItem directory: " + directory);
console.log("Agua.isFileCacheItem itemName: " + itemName);
var fileCache = this.getFileCache(username, directory);
console.log("Agua.isFileCacheItem fileCache: " + fileCache);
console.dir({fileCache:fileCache});
if ( ! fileCache || ! fileCache.items ) return false;
for ( var i = 0; i < fileCache.items.length; i++ ) {
if ( fileCache.items[i].name == itemName) return true;
}
return false;
},
// FILE METHODS
renameFile : function (oldFilePath, newFilePath) {
// RENAME FILE OR FOLDER ON SERVER
var url = this.getFoldersUrl();
var query = new Object;
query.mode = "renameFile";
query.module = "Agua::Folders";
query.sessionid = Agua.cookie('sessionid');
query.username = Agua.cookie('username');
query.oldpath = oldFilePath;
query.newpath = newFilePath;
this.doPut({ url: url, query: query, sync: false });
},
createFolder : function (folderPath) {
// CREATE FOLDER ON SERVER
var url = this.getFoldersUrl();
var query = new Object;
query.mode = "newFolder";
query.module = "Agua::Folders";
query.sessionid = Agua.cookie('sessionid');
query.username = Agua.cookie('username');
query.folderpath = folderPath;
this.doPut({ url: url, query: query, sync: false });
},
// FILEINFO METHODS
getFileInfo : function (stageParameterObject, fileinfo) {
// GET THE BOOLEAN fileInfo VALUE FOR A STAGE PARAMETER
if ( fileinfo != null )
{
console.log("Agua.File.getFileInfo fileinfo parameter is present. Should you be using setFileInfo instead?. Returning null.");
return null;
}
return this._fileInfo(stageParameterObject, fileinfo);
},
setFileInfo : function (stageParameterObject, fileinfo) {
// SET THE BOOLEAN fileInfo VALUE FOR A STAGE PARAMETER
if ( ! stageParameterObject ) return;
if ( fileinfo == null )
{
console.log("Agua.File.setFileInfo fileinfo is null. Returning null.");
return null;
}
return this._fileInfo(stageParameterObject, fileinfo);
},
_fileInfo : function (stageParameterObject, fileinfo) {
// RETURN THE fileInfo BOOLEAN FOR A STAGE PARAMETER
// OR SET IT IF A VALUE IS SUPPLIED: RETURN NULL IF
// UNSUCCESSFUL, TRUE OTHERWISE
console.log("Agua.File._fileInfo plugins.core.Data._fileInfo()");
console.log("Agua.File._fileInfo stageParameterObject: ");
console.dir({stageParameterObject:stageParameterObject});
console.log("Agua.File._fileInfo fileinfo: ");
console.dir({fileinfo:fileinfo});
var uniqueKeys = ["username", "project", "workflow", "appname", "appnumber", "name", "paramtype"];
var valueArray = new Array;
for ( var i = 0; i < uniqueKeys.length; i++ ) {
valueArray.push(stageParameterObject[uniqueKeys[i]]);
}
var stageParameter = this.getEntry(this.cloneData("stageparameters"), uniqueKeys, valueArray);
console.log("Agua.File._fileInfo stageParameter found: ");
console.dir({stageParameter:stageParameter});
if ( stageParameter == null ) {
console.log("Agua.File._fileInfo stageParameter is null. Returning null");
return null;
}
// RETURN FOR GETTER
if ( fileinfo == null ) {
console.log("Agua.File._fileInfo DOING the GETTER. Returning stageParameter.exists: " + stageParameter.fileinfo.exists);
return stageParameter.fileinfo.exists;
}
console.log("Agua.File._fileInfo DOING the SETTER");
// ELSE, DO THE SETTER
stageParameter.fileinfo = fileinfo;
var success = this._removeStageParameter(stageParameter);
if ( success == false ) {
console.log("Agua.File._fileInfo Could not remove stage parameter. Returning null");
return null;
}
console.log("Agua.File._fileInfo BEFORE success = this._addStageParameter(stageParameter)");
success = this._addStageParameter(stageParameter);
if ( success == false ) {
console.log("Agua.File._fileInfo Could not add stage parameter. Returning null");
return null;
}
return true;
},
// VALIDITY METHODS
getParameterValidity : function (stageParameterObject, booleanValue) {
// GET THE BOOLEAN parameterValidity VALUE FOR A STAGE PARAMETER
//console.log("Agua.File.getParameterValidity plugins.core.Data.getParameterValidity()");
////console.log("Agua.File.getParameterValidity stageParameterObject: " + dojo.toJson(stageParameterObject));
////console.log("Agua.File.getParameterValidity booleanValue: " + booleanValue);
if ( booleanValue != null )
{
//console.log("Agua.File.getParameterValidity booleanValue parameter is present. Should you be using "setParameterValidity" instead?. Returning null.");
return null;
}
var isValid = this._parameterValidity(stageParameterObject, booleanValue);
//console.log("Agua.File.getParameterValidity '" + stageParameterObject.name + "' isValid: " + isValid);
return isValid;
},
setParameterValidity : function (stageParameterObject, booleanValue) {
// SET THE BOOLEAN parameterValidity VALUE FOR A STAGE PARAMETER
////console.log("Agua.File.setParameterValidity plugins.core.Data.setParameterValidity()");
////console.log("Agua.File.setParameterValidity stageParameterObject: " + dojo.toJson(stageParameterObject));
////console.log("Agua.File.setParameterValidity " + stageParameterObject.name + " booleanValue: " + booleanValue);
if ( booleanValue == null )
{
//console.log("Agua.File.setParameterValidity booleanValue is null. Returning null.");
return null;
}
var isValid = this._parameterValidity(stageParameterObject, booleanValue);
//console.log("Agua.File.setParameterValidity '" + stageParameterObject.name + "' isValid: " + isValid);
return isValid;
},
_parameterValidity : function (stageParameterObject, booleanValue) {
// RETURN THE parameterValidity BOOLEAN FOR A STAGE PARAMETER
// OR SET IT IF A VALUE IS SUPPLIED
////console.log("Agua.File._parameterValidity plugins.core.Data._parameterValidity()");
//console.log("Agua.File._parameterValidity stageParameterObject: " + dojo.toJson(stageParameterObject, true));
////console.log("Agua.File._parameterValidity booleanValue: " + booleanValue);
//////var filtered = this._getStageParameters();
//////var keys = ["appname"];
//////var values = ["image2eland.pl"];
//////filtered = this.filterByKeyValues(filtered, keys, values);
////////console.log("Agua.File._parameterValidity filtered: " + dojo.toJson(filtered, true));
var uniqueKeys = ["project", "workflow", "appname", "appnumber", "name", "paramtype"];
var valueArray = new Array;
for ( var i = 0; i < uniqueKeys.length; i++ )
{
valueArray.push(stageParameterObject[uniqueKeys[i]]);
}
var stageParameter = this.getEntry(this._getStageParameters(), uniqueKeys, valueArray);
//console.log("Agua.File._parameterValidity stageParameter found: " + dojo.toJson(stageParameter, true));
if ( stageParameter == null )
{
//console.log("Agua.File._parameterValidity stageParameter is null. Returning null");
return null;
}
if ( booleanValue == null )
return stageParameter.isValid;
//console.log("Agua.File._parameterValidity stageParameter: " + dojo.toJson(stageParameter, true));
//console.log("Agua.File._parameterValidity booleanValue: " + booleanValue);
// SET isValid BOOLEAN VALUE
stageParameter.isValid = booleanValue;
var success = this._removeStageParameter(stageParameter);
if ( success == false )
{
//console.log("Agua.File._parameterValidity Could not remove stage parameter. Returning null");
return null;
}
////console.log("Agua.File._parameterValidity BEFORE success = this._addStageParameter(stageParameter)");
success = this._addStageParameter(stageParameter);
if ( success == false )
{
//console.log("Agua.File._parameterValidity Could not add stage parameter. Returning null");
return null;
}
return true;
}
});
|
aguadev/aguadev
|
html/plugins/core/Agua/File.js
|
JavaScript
|
mit
| 19,766
|
<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
<head>
<title>TODO supply a title</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<br>
<label class="tituloPres">VIAS <img src="/documents/45516/48801/right164.png" /> Ventanilla Integral de Atención <img src="/documents/45516/48801/right164.png" /> Nuevo Prestador</label>
<hr>
<form ng-init="getPais();getTiposdeServicio('9');getEspecialidades('3')" id="nuevoPForm" name="nuevoPForm" novalidate>
<div id="nuevoToggler">
<h4 class="header toggler-header-collapsed acordiontitulo">Datos Generales Prestador</h4>
<div class="content toggler-content-collapsed">
<div class="datgeneralPrestador">
<div>
<div class="form-group">
<label class="control-label"> Tipo de Servicio:* </label>
<select id="tipServ" name="tipServ" ng-change="prestador.idTipoServicio = modelTipoServicio.value" ng-required="true"
ng-model="modelTipoServicio" ng-options="opt.label for opt in listaTipoServicio" >
<option value="">Seleccione</option>
</select>
<div ng-show="nuevoPForm.tipServ.$dirty && nuevoPForm.tipServ.$invalid" class="camporequerido" ng-bind="camposrequeridos"></div>
</div>
<div ng-repeat="espe in especialidades" class="form-group">
<label class="control-label"> Especialidad: * </label>
<select id="especia_{{$index}}" name="especia_{{$index}}" ng-change="setEspecialidades(espe.selected.value)" ng-required="true" ng-model="espe.selected" ng-options="opt as opt.label for opt in listaDeEspecialidad" >
<option value="">Seleccione</option>
</select>
<button ng-click="setEspecialidad($index)" > + </button>
<div ng-show="nuevoPForm.especia_{{$index}}.$dirty && nuevoPForm.especia_{{$index}}.$invalid" class="camporequerido" ng-bind="camposrequeridos"></div>
</div>
<div class="form-group">
<label class="control-label"> Nombre Común:* </label>
<input id="nomcomun" name="nomcomun" type="text" ng-model="prestador.nombre" ng-required="true"/>
<div ng-show="nuevoPForm.nomcomun.$dirty && nuevoPForm.nomcomun.$invalid" class="camporequerido" ng-bind="camposrequeridos"></div>
</div>
<div class="form-group">
<label class="control-label">Razón social:</label>
<input ng-model="prestador.razonSocial" type="text" />
</div>
<div class="form-group">
<label class="control-label"> RFC: </label>
<input ng-model="prestador.rfc" type="text" />
</div>
</div>
<div>
<div class="form-group">
<label class="control-label"> Id proveedor AXA:</label>
<input id="h1" name="h1" ng-model="prestador.noAgente" type="text" />
</div>
<div class="form-group">
<label class="control-label"> Horario atención 1: * </label>
<input id="h1" name="h1" ng-model="prestador.horarioAtencion1" ng-required="true" type="text" />
<div ng-show="nuevoPForm.h1.$dirty && nuevoPForm.h1.$invalid" class="camporequerido" ng-bind="camposrequeridos" ></div>
</div>
<div class="form-group">
<label class="control-label"> Horario atención 2: * </label>
<input id="h2" name="h2" ng-required="true" ng-model="prestador.horarioAtencion2" type="text" />
<div ng-show="nuevoPForm.h2.$dirty && nuevoPForm.h2.$invalid" class="camporequerido" ng-bind="camposrequeridos" ></div>
</div>
</div>
</div>
</div>
<h4 class="header toggler-header-collapsed acordiontitulo">Dirección Prestador</h4>
<div class="content toggler-content-collapsed">
<div class="datgeneralPrestador">
<div>
<div class="form-group">
<label class="control-label">Pais: *</label>
<select id="pais_" name="pais_" ng-change="prestadorDireccion[0].pais = modelPais.value; getListaEstado()" ng-required="true" ng-model="modelPais" ng-options="opt as opt.label for opt in Listapais">
<option value="">Seleccione</option>
</select>
<div ng-show="nuevoPForm.pais_.$dirty && nuevoPForm.pais_.$invalid" class="camporequerido" ng-bind="camposrequeridos"></div>
</div>
<div class="form-group">
<label class="control-label">Estado: *</label>
<select id="estado_" name="estado_" ng-change="prestadorDireccion[0].idEstado = selectedEstados.value; getListaDelegacion(selectedEstados.value);"
ng-required="true" ng-model="selectedEstados" ng-options="opt as opt.label for opt in listaDeEstados">
<option value="">Seleccione</option>
</select>
<div ng-show="nuevoPForm.estado_.$dirty && nuevoPForm.estado_.$invalid" class="camporequerido" ng-bind="camposrequeridos"></div>
</div>
<div class="form-group">
<label class="control-label">Delegación o Municipio: * </label>
<select id="delegacion_" name="delegacion_" ng-change="prestadorDireccion[0].idMunicipio = modelEstado.value" ng-required="true"
ng-model="modelEstado" ng-options="opt as opt.label for opt in listaDelegaciones">
<option value="">Seleccione</option>
</select>
<div ng-show="nuevoPForm.delegacion_.$dirty && nuevoPForm.delegacion_.$invalid" class="camporequerido" ng-bind="camposrequeridos"></div>
</div>
<div class="form-group">
<label class="control-label"> Codigo Postal: *</label>
<input id="cp" name="cp" ng-model="prestadorDireccion[0].codigoPostal" ng-required="true" type="number" min="0" maxlength="5" max="99999" />
<div ng-show="nuevoPForm.cp.$dirty && nuevoPForm.cp.$invalid" class="camporequerido" ng-bind="camposrequeridos">
</div>
</div>
</div>
<div>
<div class="form-group">
<label class="control-label"> Colonia: * </label>
<input id="colonia" name="colonia" ng-model="prestadorDireccion[0].colonia" ng-required="true" type="text" maxlength="100"/>
<div ng-show="nuevoPForm.colonia.$dirty && nuevoPForm.colonia.$invalid" class="camporequerido" ng-bind="camposrequeridos">
</div>
</div>
<div class="form-group">
<label class="control-label"> Calle: * </label>
<input id="calle" name="calle" ng-model="prestadorDireccion[0].calle" ng-required="true" type="text" maxlength="100"/>
<div ng-show="nuevoPForm.calle.$dirty && nuevoPForm.calle.$invalid" class="camporequerido" ng-bind="camposrequeridos">
</div>
</div>
<div class="form-group">
<label class="control-label"> Numero exterior: * </label>
<input id="numexterior" name="numexterior" ng-model="prestadorDireccion[0].numeroExterior" ng-required="true" type="text" maxlength="50"/>
<div ng-show="nuevoPForm.numexterior.$dirty && nuevoPForm.numexterior.$invalid" class="camporequerido">
</div>
</div>
<div class="form-group">
<label class="control-label"> Numero interior: </label>
<input ng-model="prestadorDireccion[0].numeroInterior" type="text" maxlength="50"/>
</div>
</div>
<div>
<div class="form-group">
<label class="control-label">Latitud: *</label>
<input id="lat" name="lat" ng-model="prestadorDireccion[0].latitud" ng-required="true" type="number" maxlength="50"/>
<div ng-show="nuevoPForm.lat.$dirty && nuevoPForm.lat.$invalid" class="camporequerido" ng-bind="camposrequeridos">
</div>
</div>
<div class="form-group">
<label class="control-label">Longitud: *</label>
<input id="longit" name="longit" ng-model="prestadorDireccion[0].longitud" ng-required="true" type="number" maxlength="50"/>
<div ng-show="nuevoPForm.longit.$dirty && nuevoPForm.longit.$invalid" class="camporequerido" ng-bind="camposrequeridos">
</div>
</div>
</div>
</div>
</div>
<h4 class="header toggler-header-collapsed acordiontitulo">Teléfono Prestador </h4>
<div class="content toggler-content-collapsed">
<div class="datgeneralPrestador">
<div>
<div class="form-group">
<label class="control-label">Teléfono 1: *</label>
<input id="tel1" name="tel1" ng-required="true" ng-model="prestadorTelefono[0].numero" type="text" maxlength="50"/>
<div ng-show="nuevoPForm.tel1.$dirty && nuevoPForm.tel1.$invalid" class="camporequerido" ng-bind="camposrequeridos">
</div>
</div>
<div class="form-group">
<label class="control-label">Teléfono 2: </label>
<input ng-model="prestadorTelefono[1].numero" type="text" maxlength="50" />
</div>
<div class="form-group">
<label class="control-label">Celular: </label>
<input ng-init="prestadorTelefono[2].tipoTelefono = 'Celular' " ng-model="prestadorTelefono[2].numero" type="text" maxlength="50" />
</div>
</div>
</div>
</div>
<h4 class="header toggler-header-collapsed acordiontitulo">Mail Prestador </h4>
<div class="content toggler-content-collapsed">
<div class="datgeneralPrestador">
<div>
<div class="form-group">
<label class="control-label">Correo electrónico 1: * </label>
<input id="mail_1" name="mail_1" ng-required="true" ng-model="prestadorEmail[0].email" type="email"/>
<div ng-show="nuevoPForm.mail_1.$dirty && nuevoPForm.mail_1.$invalid" class="camporequerido" ng-bind="camposrequeridos">
</div>
</div>
<div class="form-group">
<label class="control-label">Correo electrónico 2: </label>
<input type="email" ng-model="prestadorEmail[1].email" />
</div>
</div>
</div>
</div>
</div>
<div style="padding-left: 80%;">
<input class="btn btn-primary" type="submit" data-ng-disabled='!nuevoPForm.$valid' ng-click="savePrestador()" value="Guardar" />
</div>
</form>
</body>
</html>
<!-- <div ng-if="especialiddad" ng-repeat="espe in especialidades" class="form-group">
<label class="control-label"> Especialidad* </label>
<select ng-model="espe.selectedEspecialidadcve" ng-options="opt as opt.label for opt in listaDeEstados" >
<option value="">Seleccione</option>
</select>
<button ng-click="setEspecialidad()" > + </button>
</div> -->
<!-- <div class="form-group" ng-if="redDePreferencia">
<label class="control-label"> Red de preferencia: *</label>
<select>
<option>SI</option>
<option>NO</option>
</select>
</div>
<div class="form-group" ng-if="plann">
<label class="control-label"> Plan: *</label>
<input id="plan" name="plan" ng-model="prestador.plan" ng-required="true" type="text" />
<div ng-show=" nuevoPForm.plan.$dirty && nuevoPForm.plan.$invalid" class="camporequerido">
{{camposrequeridos}}
</div>
</div>
<div class="form-group" ng-if="gamma">
<label class="control-label"> Gama: *</label>
<input id="gama" name="gama" ng-model="prestador.gama" ng-required="true" type="text" />
<div ng-show=" nuevoPForm.gama.$dirty && nuevoPForm.gama.$invalid" class="camporequerido">
{{camposrequeridos}}
</div>
</div>
-->
<!-- <div ng-show="nuevoPForm.mail1.$dirty && nuevoPForm.mail1.$invalid" class="camporequerido">
{{camposrequeridos}}
</div>-->
|
RogelioGit/prestadores
|
app/temporal.html
|
HTML
|
mit
| 13,859
|
<?php
/**
* LitePubl CMS
*
* @copyright 2010 - 2017 Vladimir Yushko http://litepublisher.com/ http://litepublisher.ru/
* @license https://github.com/litepubl/cms/blob/master/LICENSE.txt MIT
* @link https://github.com/litepubl\cms
* @version 7.08
*/
namespace litepubl\admin\widget;
use litepubl\admin\Link;
use litepubl\core\PropException;
class Widget extends \litepubl\admin\Panel
{
public $widget;
public function __construct()
{
parent::__construct();
$this->lang->section = 'widgets';
}
public function __get($name)
{
if (method_exists($this, $get = 'get' . $name)) {
return $this->$get();
}
throw new PropException(get_class($this), $name);
}
protected function getAdminurl()
{
return Link::url('/admin/views/widgets/?idwidget=');
}
protected function getForm(): string
{
$title = $this->widget->gettitle($this->widget->id);
$this->args->title = $title;
$this->args->formtitle = $title . ' ' . $this->lang->widget;
return $this->theme->getInput('text', 'title', $title, $this->lang->widgettitle);
}
public function getContent(): string
{
$form = $this->getForm();
return $this->admin->form($form, $this->args);
}
public function processForm()
{
$widget = $this->widget;
$widget->lock();
if (isset($_POST['title'])) {
$widget->settitle($widget->id, $_POST['title']);
}
$this->doProcessForm();
$widget->unlock();
return $this->admin->success($this->lang->updated);
}
protected function doProcessForm()
{
}
}
|
litepubl/cms
|
lib/admin/widget/Widget.php
|
PHP
|
mit
| 1,705
|
<?php
/**
* Copyright (c) Frank Förster (http://frankfoerster.com)
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Frank Förster (http://frankfoerster.com)
* @link http://github.com/frankfoerster/cakephp-migrations
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
class IndexAlreadyExistsException extends Exception {
}
|
frankfoerster/cakephp-migrations
|
Model/Exception/IndexAlreadyExistsException.php
|
PHP
|
mit
| 537
|
using System;
using System.Collections;
namespace AppStudio.Data
{
/// <summary>
/// Implementation of the MainSchema class.
/// </summary>
public class MainSchema : BindableSchemaBase, IEquatable<MainSchema>
{
private string _title;
private string _subtitle;
private string _image;
private string _description;
public string Title
{
get { return _title; }
set { SetProperty(ref _title, value); }
}
public string Subtitle
{
get { return _subtitle; }
set { SetProperty(ref _subtitle, value); }
}
public string Image
{
get { return _image; }
set { SetProperty(ref _image, value); }
}
public string Description
{
get { return _description; }
set { SetProperty(ref _description, value); }
}
public override string DefaultTitle
{
get { return Title; }
}
public override string DefaultSummary
{
get { return Subtitle; }
}
public override string DefaultImageUrl
{
get { return Image; }
}
public override string DefaultContent
{
get { return Subtitle; }
}
override public string GetValue(string fieldName)
{
if (!String.IsNullOrEmpty(fieldName))
{
switch (fieldName.ToLowerInvariant())
{
case "title":
return String.Format("{0}", Title);
case "subtitle":
return String.Format("{0}", Subtitle);
case "image":
return String.Format("{0}", Image);
case "description":
return String.Format("{0}", Description);
case "defaulttitle":
return DefaultTitle;
case "defaultsummary":
return DefaultSummary;
case "defaultimageurl":
return DefaultImageUrl;
default:
break;
}
}
return String.Empty;
}
public bool Equals(MainSchema other)
{
if (other == null)
{
return false;
}
return this.Title == other.Title && this.Subtitle == other.Subtitle && this.Image == other.Image && this.Description == other.Description;
}
}
}
|
AppStudioSamples/Menu
|
scr/ClientApp/AppStudio.Data/DataSchemas/MainSchema.cs
|
C#
|
mit
| 2,679
|
/* --------------------------------------------------------------------------
*
* File MainScene.h
* Description
* Ported By Young-Hwan Mun
* Contact xmsoft77@gmail.com
*
* --------------------------------------------------------------------------
*
* Copyright (c) 2010-2013 XMSoft.
* Copyright (c) 2012 喆 肖 (12/08/10). All rights reserved.
*
* --------------------------------------------------------------------------
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library in the file COPYING.LIB;
* if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
* -------------------------------------------------------------------------- */
#ifndef __MainScene_h__
#define __MainScene_h__
#include "MapLayer.h"
//#import "InputLayer.h"
class MainScene : public CCLayer, public MapLayerDelegate
{
public :
static CCScene* scene ( KDint nLevel, KDint nStatus, KDint nLife );
protected :
MainScene ( KDvoid );
virtual ~MainScene ( KDvoid );
virtual KDbool initWithMapInformation ( KDint nLevel, KDint nStatus, KDint nLife );
public :
//
// MapLayerDelegate
//
virtual KDvoid gameOver ( KDvoid );
virtual KDvoid bornEnmey ( KDvoid );
virtual KDvoid changeTankLife ( KDint nLife );
private :
KDvoid iconTank ( KDvoid );
KDvoid showLife ( KDint nLife );
KDvoid showLevel ( KDint nLevel );
private :
CCArray* m_pIconArray;
};
#endif // __MainScene_h__
|
mcodegeeks/OpenKODE-Framework
|
04_Sample/BattleCity/Source/Views/MainScene.h
|
C
|
mit
| 2,201
|
package org.onceatime.concurrent;
import java.util.concurrent.locks.ReentrantReadWriteLock;
public class RwSample {
public static void main(String[] args) {
class CachedData {
Object data;
volatile boolean cacheValid;
final ReentrantReadWriteLock rwl = new ReentrantReadWriteLock();
void processCachedData() {
rwl.readLock().lock();
if (!cacheValid) {
// Must release read lock before acquiring write lock
rwl.readLock().unlock();
rwl.writeLock().lock();
try {
// Recheck state because another thread might have
// acquired write lock and changed state before we did.
if (!cacheValid) {
data = getData();
cacheValid = true;
}
// Downgrade by acquiring read lock before releasing write lock
rwl.readLock().lock();
} finally {
rwl.writeLock().unlock(); // Unlock write, still hold read
}
}
try {
use(data);
} finally {
rwl.readLock().unlock();
}
}
private Object getData() {
// TODO Auto-generated method stub
return null;
}
private void use(Object data2) {
// TODO Auto-generated method stub
}
}}
}
|
chinafzy/java-practise
|
src/main/java/org/onceatime/concurrent/RwSample.java
|
Java
|
mit
| 1,437
|
import { globalThis } from './global-this';
/**
* Detect if running in Node.js.
* @type {boolean}
*/
const isNode = Object.prototype.toString.call(globalThis.process) === '[object process]';
export { isNode };
|
zant95/otpauth
|
src/utils/is-node.js
|
JavaScript
|
mit
| 215
|
/**
* History.js Core
* History.js HTML4 Support
* @author Benjamin Arthur Lupton <contact@balupton.com>
* @copyright 2010-2011 Benjamin Arthur Lupton <contact@balupton.com>
* @license New BSD License <http://creativecommons.org/licenses/BSD/>
*/
define(function(require){
"use strict";
// ========================================================================
// Initialise
// Localise Globals
var
console = window.console||undefined, // Prevent a JSLint complain
document = window.document, // Make sure we are using the correct document
navigator = window.navigator, // Make sure we are using the correct navigator
sessionStorage = window.sessionStorage||false, // sessionStorage
setTimeout = window.setTimeout,
clearTimeout = window.clearTimeout,
setInterval = window.setInterval,
clearInterval = window.clearInterval,
JSON = window.JSON,
alert = window.alert,
History = window.History = window.History||{}, // Public History Object
history = window.history; // Old History Object
try {
sessionStorage.setItem('TEST', '1');
sessionStorage.removeItem('TEST');
} catch(e) {
sessionStorage = false;
}
// MooTools Compatibility
JSON.stringify = JSON.stringify||JSON.encode;
JSON.parse = JSON.parse||JSON.decode;
// Check Existence
if ( typeof History.init !== 'undefined' ) {
throw new Error('History.js Core has already been loaded...');
}
// Add the Adapter
History.Adapter = {
/**
* History.Adapter.handlers[uid][eventName] = Array
*/
handlers: {},
/**
* History.Adapter._uid
* The current element unique identifier
*/
_uid: 1,
/**
* History.Adapter.uid(element)
* @param {Element} element
* @return {String} uid
*/
uid: function(element){
return element._uid || (element._uid = History.Adapter._uid++);
},
/**
* History.Adapter.bind(el,event,callback)
* @param {Element} element
* @param {String} eventName - custom and standard events
* @param {Function} callback
* @return
*/
bind: function(element,eventName,callback){
// Prepare
var uid = History.Adapter.uid(element);
// Apply Listener
History.Adapter.handlers[uid] = History.Adapter.handlers[uid] || {};
History.Adapter.handlers[uid][eventName] = History.Adapter.handlers[uid][eventName] || [];
History.Adapter.handlers[uid][eventName].push(callback);
// Bind Global Listener
element['on'+eventName] = (function(element,eventName){
return function(event){
History.Adapter.trigger(element,eventName,event);
};
})(element,eventName);
},
/**
* History.Adapter.trigger(el,event)
* @param {Element} element
* @param {String} eventName - custom and standard events
* @param {Object} event - a object of event data
* @return
*/
trigger: function(element,eventName,event){
// Prepare
event = event || {};
var uid = History.Adapter.uid(element),
i,n;
// Apply Listener
History.Adapter.handlers[uid] = History.Adapter.handlers[uid] || {};
History.Adapter.handlers[uid][eventName] = History.Adapter.handlers[uid][eventName] || [];
// Fire Listeners
for ( i=0,n=History.Adapter.handlers[uid][eventName].length; i<n; ++i ) {
History.Adapter.handlers[uid][eventName][i].apply(this,[event]);
}
},
/**
* History.Adapter.extractEventData(key,event,extra)
* @param {String} key - key for the event data to extract
* @param {String} event - custom and standard events
* @return {mixed}
*/
extractEventData: function(key,event){
var result = (event && event[key]) || undefined;
return result;
},
/**
* History.Adapter.onDomLoad(callback)
* @param {Function} callback
* @return
*/
onDomLoad: function(callback) {
var timeout = window.setTimeout(function(){
callback();
},2000);
window.onload = function(){
clearTimeout(timeout);
callback();
};
}
};
// Initialise HTML4 Support
History.initHtml4 = function(){
// Initialise
if ( typeof History.initHtml4.initialized !== 'undefined' ) {
// Already Loaded
return false;
}
else {
History.initHtml4.initialized = true;
}
// ====================================================================
// Properties
/**
* History.enabled
* Is History enabled?
*/
History.enabled = true;
// ====================================================================
// Hash Storage
/**
* History.savedHashes
* Store the hashes in an array
*/
History.savedHashes = [];
/**
* History.isLastHash(newHash)
* Checks if the hash is the last hash
* @param {string} newHash
* @return {boolean} true
*/
History.isLastHash = function(newHash){
// Prepare
var oldHash = History.getHashByIndex(),
isLast;
// Check
isLast = newHash === oldHash;
// Return isLast
return isLast;
};
/**
* History.isHashEqual(newHash, oldHash)
* Checks to see if two hashes are functionally equal
* @param {string} newHash
* @param {string} oldHash
* @return {boolean} true
*/
History.isHashEqual = function(newHash, oldHash){
newHash = encodeURIComponent(newHash).replace(/%25/g, "%");
oldHash = encodeURIComponent(oldHash).replace(/%25/g, "%");
return newHash === oldHash;
};
/**
* History.saveHash(newHash)
* Push a Hash
* @param {string} newHash
* @return {boolean} true
*/
History.saveHash = function(newHash){
// Check Hash
if ( History.isLastHash(newHash) ) {
return false;
}
// Push the Hash
History.savedHashes.push(newHash);
// Return true
return true;
};
/**
* History.getHashByIndex()
* Gets a hash by the index
* @param {integer} index
* @return {string}
*/
History.getHashByIndex = function(index){
// Prepare
var hash = null;
// Handle
if ( typeof index === 'undefined' ) {
// Get the last inserted
hash = History.savedHashes[History.savedHashes.length-1];
}
else if ( index < 0 ) {
// Get from the end
hash = History.savedHashes[History.savedHashes.length+index];
}
else {
// Get from the beginning
hash = History.savedHashes[index];
}
// Return hash
return hash;
};
// ====================================================================
// Discarded States
/**
* History.discardedHashes
* A hashed array of discarded hashes
*/
History.discardedHashes = {};
/**
* History.discardedStates
* A hashed array of discarded states
*/
History.discardedStates = {};
/**
* History.discardState(State)
* Discards the state by ignoring it through History
* @param {object} State
* @return {true}
*/
History.discardState = function(discardedState,forwardState,backState){
//History.debug('History.discardState', arguments);
// Prepare
var discardedStateHash = History.getHashByState(discardedState),
discardObject;
// Create Discard Object
discardObject = {
'discardedState': discardedState,
'backState': backState,
'forwardState': forwardState
};
// Add to DiscardedStates
History.discardedStates[discardedStateHash] = discardObject;
// Return true
return true;
};
/**
* History.discardHash(hash)
* Discards the hash by ignoring it through History
* @param {string} hash
* @return {true}
*/
History.discardHash = function(discardedHash,forwardState,backState){
//History.debug('History.discardState', arguments);
// Create Discard Object
var discardObject = {
'discardedHash': discardedHash,
'backState': backState,
'forwardState': forwardState
};
// Add to discardedHash
History.discardedHashes[discardedHash] = discardObject;
// Return true
return true;
};
/**
* History.discardedState(State)
* Checks to see if the state is discarded
* @param {object} State
* @return {bool}
*/
History.discardedState = function(State){
// Prepare
var StateHash = History.getHashByState(State),
discarded;
// Check
discarded = History.discardedStates[StateHash]||false;
// Return true
return discarded;
};
/**
* History.discardedHash(hash)
* Checks to see if the state is discarded
* @param {string} State
* @return {bool}
*/
History.discardedHash = function(hash){
// Check
var discarded = History.discardedHashes[hash]||false;
// Return true
return discarded;
};
/**
* History.recycleState(State)
* Allows a discarded state to be used again
* @param {object} data
* @param {string} title
* @param {string} url
* @return {true}
*/
History.recycleState = function(State){
//History.debug('History.recycleState', arguments);
// Prepare
var StateHash = History.getHashByState(State);
// Remove from DiscardedStates
if ( History.discardedState(State) ) {
delete History.discardedStates[StateHash];
}
// Return true
return true;
};
// ====================================================================
// HTML4 HashChange Support
if ( History.emulated.hashChange ) {
/*
* We must emulate the HTML4 HashChange Support by manually checking for hash changes
*/
/**
* History.hashChangeInit()
* Init the HashChange Emulation
*/
History.hashChangeInit = function(){
// Define our Checker Function
History.checkerFunction = null;
// Define some variables that will help in our checker function
var lastDocumentHash = '',
iframeId, iframe,
lastIframeHash, checkerRunning,
startedWithHash = Boolean(History.getHash());
// Handle depending on the browser
if ( History.isInternetExplorer() ) {
// IE6 and IE7
// We need to use an iframe to emulate the back and forward buttons
// Create iFrame
iframeId = 'historyjs-iframe';
iframe = document.createElement('iframe');
// Adjust iFarme
// IE 6 requires iframe to have a src on HTTPS pages, otherwise it will throw a
// "This page contains both secure and nonsecure items" warning.
iframe.setAttribute('id', iframeId);
iframe.setAttribute('src', '#');
iframe.style.display = 'none';
// Append iFrame
document.body.appendChild(iframe);
// Create initial history entry
iframe.contentWindow.document.open();
iframe.contentWindow.document.close();
// Define some variables that will help in our checker function
lastIframeHash = '';
checkerRunning = false;
// Define the checker function
History.checkerFunction = function(){
// Check Running
if ( checkerRunning ) {
return false;
}
// Update Running
checkerRunning = true;
// Fetch
var
documentHash = History.getHash(),
iframeHash = History.getHash(iframe.contentWindow.document);
// The Document Hash has changed (application caused)
if ( documentHash !== lastDocumentHash ) {
// Equalise
lastDocumentHash = documentHash;
// Create a history entry in the iframe
if ( iframeHash !== documentHash ) {
//History.debug('hashchange.checker: iframe hash change', 'documentHash (new):', documentHash, 'iframeHash (old):', iframeHash);
// Equalise
lastIframeHash = iframeHash = documentHash;
// Create History Entry
iframe.contentWindow.document.open();
iframe.contentWindow.document.close();
// Update the iframe's hash
iframe.contentWindow.document.location.hash = History.escapeHash(documentHash);
}
// Trigger Hashchange Event
History.Adapter.trigger(window,'hashchange');
}
// The iFrame Hash has changed (back button caused)
else if ( iframeHash !== lastIframeHash ) {
//History.debug('hashchange.checker: iframe hash out of sync', 'iframeHash (new):', iframeHash, 'documentHash (old):', documentHash);
// Equalise
lastIframeHash = iframeHash;
// If there is no iframe hash that means we're at the original
// iframe state.
// And if there was a hash on the original request, the original
// iframe state was replaced instantly, so skip this state and take
// the user back to where they came from.
if (startedWithHash && iframeHash === '') {
History.back();
}
else {
// Update the Hash
History.setHash(iframeHash,false);
}
}
// Reset Running
checkerRunning = false;
// Return true
return true;
};
}
else {
// We are not IE
// Firefox 1 or 2, Opera
// Define the checker function
History.checkerFunction = function(){
// Prepare
var documentHash = History.getHash()||'';
// The Document Hash has changed (application caused)
if ( documentHash !== lastDocumentHash ) {
// Equalise
lastDocumentHash = documentHash;
// Trigger Hashchange Event
History.Adapter.trigger(window,'hashchange');
}
// Return true
return true;
};
}
// Apply the checker function
History.intervalList.push(setInterval(History.checkerFunction, History.options.hashChangeInterval));
// Done
return true;
}; // History.hashChangeInit
// Bind hashChangeInit
History.Adapter.onDomLoad(History.hashChangeInit);
} // History.emulated.hashChange
// ====================================================================
// HTML5 State Support
// Non-Native pushState Implementation
if ( History.emulated.pushState ) {
/*
* We must emulate the HTML5 State Management by using HTML4 HashChange
*/
/**
* History.onHashChange(event)
* Trigger HTML5's window.onpopstate via HTML4 HashChange Support
*/
History.onHashChange = function(event){
//History.debug('History.onHashChange', arguments);
// Prepare
var currentUrl = ((event && event.newURL) || History.getLocationHref()),
currentHash = History.getHashByUrl(currentUrl),
currentState = null,
currentStateHash = null,
currentStateHashExits = null,
discardObject;
// Check if we are the same state
if ( History.isLastHash(currentHash) ) {
// There has been no change (just the page's hash has finally propagated)
//History.debug('History.onHashChange: no change');
History.busy(false);
return false;
}
// Reset the double check
History.doubleCheckComplete();
// Store our location for use in detecting back/forward direction
History.saveHash(currentHash);
// Expand Hash
if ( currentHash && History.isTraditionalAnchor(currentHash) ) {
//History.debug('History.onHashChange: traditional anchor', currentHash);
// Traditional Anchor Hash
History.Adapter.trigger(window,'anchorchange');
History.busy(false);
return false;
}
// Create State
currentState = History.extractState(History.getFullUrl(currentHash||History.getLocationHref()),true);
// Check if we are the same state
if ( History.isLastSavedState(currentState) ) {
//History.debug('History.onHashChange: no change');
// There has been no change (just the page's hash has finally propagated)
History.busy(false);
return false;
}
// Create the state Hash
currentStateHash = History.getHashByState(currentState);
// Check if we are DiscardedState
discardObject = History.discardedState(currentState);
if ( discardObject ) {
// Ignore this state as it has been discarded and go back to the state before it
if ( History.getHashByIndex(-2) === History.getHashByState(discardObject.forwardState) ) {
// We are going backwards
//History.debug('History.onHashChange: go backwards');
History.back(false);
} else {
// We are going forwards
//History.debug('History.onHashChange: go forwards');
History.forward(false);
}
return false;
}
// Push the new HTML5 State
//History.debug('History.onHashChange: success hashchange');
History.pushState(currentState.data,currentState.title,encodeURI(currentState.url),false);
// End onHashChange closure
return true;
};
History.Adapter.bind(window,'hashchange',History.onHashChange);
/**
* History.pushState(data,title,url)
* Add a new State to the history object, become it, and trigger onpopstate
* We have to trigger for HTML4 compatibility
* @param {object} data
* @param {string} title
* @param {string} url
* @return {true}
*/
History.pushState = function(data,title,url,queue){
//History.debug('History.pushState: called', arguments);
// We assume that the URL passed in is URI-encoded, but this makes
// sure that it's fully URI encoded; any '%'s that are encoded are
// converted back into '%'s
url = encodeURI(url).replace(/%25/g, "%");
// Check the State
if ( History.getHashByUrl(url) ) {
throw new Error('History.js does not support states with fragment-identifiers (hashes/anchors).');
}
// Handle Queueing
if ( queue !== false && History.busy() ) {
// Wait + Push to Queue
//History.debug('History.pushState: we must wait', arguments);
History.pushQueue({
scope: History,
callback: History.pushState,
args: arguments,
queue: queue
});
return false;
}
// Make Busy
History.busy(true);
// Fetch the State Object
var newState = History.createStateObject(data,title,url),
newStateHash = History.getHashByState(newState),
oldState = History.getState(false),
oldStateHash = History.getHashByState(oldState),
html4Hash = History.getHash(),
wasExpected = History.expectedStateId == newState.id;
// Store the newState
History.storeState(newState);
History.expectedStateId = newState.id;
// Recycle the State
History.recycleState(newState);
// Force update of the title
History.setTitle(newState);
// Check if we are the same State
if ( newStateHash === oldStateHash ) {
//History.debug('History.pushState: no change', newStateHash);
History.busy(false);
return false;
}
// Update HTML5 State
History.saveState(newState);
// Fire HTML5 Event
if(!wasExpected)
History.Adapter.trigger(window,'statechange');
// Update HTML4 Hash
if ( !History.isHashEqual(newStateHash, html4Hash) && !History.isHashEqual(newStateHash, History.getShortUrl(History.getLocationHref())) ) {
History.setHash(newStateHash,false);
}
History.busy(false);
// End pushState closure
return true;
};
/**
* History.replaceState(data,title,url)
* Replace the State and trigger onpopstate
* We have to trigger for HTML4 compatibility
* @param {object} data
* @param {string} title
* @param {string} url
* @return {true}
*/
History.replaceState = function(data,title,url,queue){
//History.debug('History.replaceState: called', arguments);
// We assume that the URL passed in is URI-encoded, but this makes
// sure that it's fully URI encoded; any '%'s that are encoded are
// converted back into '%'s
url = encodeURI(url).replace(/%25/g, "%");
// Check the State
if ( History.getHashByUrl(url) ) {
throw new Error('History.js does not support states with fragment-identifiers (hashes/anchors).');
}
// Handle Queueing
if ( queue !== false && History.busy() ) {
// Wait + Push to Queue
//History.debug('History.replaceState: we must wait', arguments);
History.pushQueue({
scope: History,
callback: History.replaceState,
args: arguments,
queue: queue
});
return false;
}
// Make Busy
History.busy(true);
// Fetch the State Objects
var newState = History.createStateObject(data,title,url),
newStateHash = History.getHashByState(newState),
oldState = History.getState(false),
oldStateHash = History.getHashByState(oldState),
previousState = History.getStateByIndex(-2);
// Discard Old State
History.discardState(oldState,newState,previousState);
// If the url hasn't changed, just store and save the state
// and fire a statechange event to be consistent with the
// html 5 api
if ( newStateHash === oldStateHash ) {
// Store the newState
History.storeState(newState);
History.expectedStateId = newState.id;
// Recycle the State
History.recycleState(newState);
// Force update of the title
History.setTitle(newState);
// Update HTML5 State
History.saveState(newState);
// Fire HTML5 Event
//History.debug('History.pushState: trigger popstate');
History.Adapter.trigger(window,'statechange');
History.busy(false);
}
else {
// Alias to PushState
History.pushState(newState.data,newState.title,newState.url,false);
}
// End replaceState closure
return true;
};
} // History.emulated.pushState
// ====================================================================
// Initialise
// Non-Native pushState Implementation
if ( History.emulated.pushState ) {
/**
* Ensure initial state is handled correctly
*/
if ( History.getHash() && !History.emulated.hashChange ) {
History.Adapter.onDomLoad(function(){
History.Adapter.trigger(window,'hashchange');
});
}
} // History.emulated.pushState
}; // History.initHtml4
// Initialise History
History.init = function(options){
// Check Load Status of Adapter
if ( typeof History.Adapter === 'undefined' ) {
return false;
}
// Check Load Status of Core
if ( typeof History.initCore !== 'undefined' ) {
History.initCore();
}
// Check Load Status of HTML4 Support
if ( typeof History.initHtml4 !== 'undefined' ) {
History.initHtml4();
}
// Return true
return true;
};
// ========================================================================
// Initialise Core
// Initialise Core
History.initCore = function(options){
// Initialise
if ( typeof History.initCore.initialized !== 'undefined' ) {
// Already Loaded
return false;
}
else {
History.initCore.initialized = true;
}
// ====================================================================
// Options
/**
* History.options
* Configurable options
*/
History.options = History.options||{};
/**
* History.options.hashChangeInterval
* How long should the interval be before hashchange checks
*/
History.options.hashChangeInterval = History.options.hashChangeInterval || 100;
/**
* History.options.safariPollInterval
* How long should the interval be before safari poll checks
*/
History.options.safariPollInterval = History.options.safariPollInterval || 500;
/**
* History.options.doubleCheckInterval
* How long should the interval be before we perform a double check
*/
History.options.doubleCheckInterval = History.options.doubleCheckInterval || 500;
/**
* History.options.disableSuid
* Force History not to append suid
*/
History.options.disableSuid = History.options.disableSuid || false;
/**
* History.options.storeInterval
* How long should we wait between store calls
*/
History.options.storeInterval = History.options.storeInterval || 1000;
/**
* History.options.busyDelay
* How long should we wait between busy events
*/
History.options.busyDelay = History.options.busyDelay || 250;
/**
* History.options.debug
* If true will enable debug messages to be logged
*/
History.options.debug = History.options.debug || false;
/**
* History.options.initialTitle
* What is the title of the initial state
*/
History.options.initialTitle = History.options.initialTitle || document.title;
/**
* History.options.html4Mode
* If true, will force HTMl4 mode (hashtags)
*/
History.options.html4Mode = History.options.html4Mode || false;
/**
* History.options.delayInit
* Want to override default options and call init manually.
*/
History.options.delayInit = History.options.delayInit || false;
// ====================================================================
// Interval record
/**
* History.intervalList
* List of intervals set, to be cleared when document is unloaded.
*/
History.intervalList = [];
/**
* History.clearAllIntervals
* Clears all setInterval instances.
*/
History.clearAllIntervals = function(){
var i, il = History.intervalList;
if (typeof il !== "undefined" && il !== null) {
for (i = 0; i < il.length; i++) {
clearInterval(il[i]);
}
History.intervalList = null;
}
};
// ====================================================================
// Debug
/**
* History.debug(message,...)
* Logs the passed arguments if debug enabled
*/
History.debug = function(){
if ( (History.options.debug||false) ) {
History.log.apply(History,arguments);
}
};
/**
* History.log(message,...)
* Logs the passed arguments
*/
History.log = function(){
// Prepare
var
consoleExists = !(typeof console === 'undefined' || typeof console.log === 'undefined' || typeof console.log.apply === 'undefined'),
textarea = document.getElementById('log'),
message,
i,n,
args,arg
;
// Write to Console
if ( consoleExists ) {
args = Array.prototype.slice.call(arguments);
message = args.shift();
if ( typeof console.debug !== 'undefined' ) {
console.debug.apply(console,[message,args]);
}
else {
console.log.apply(console,[message,args]);
}
}
else {
message = ("\n"+arguments[0]+"\n");
}
// Write to log
for ( i=1,n=arguments.length; i<n; ++i ) {
arg = arguments[i];
if ( typeof arg === 'object' && typeof JSON !== 'undefined' ) {
try {
arg = JSON.stringify(arg);
}
catch ( Exception ) {
// Recursive Object
}
}
message += "\n"+arg+"\n";
}
// Textarea
if ( textarea ) {
textarea.value += message+"\n-----\n";
textarea.scrollTop = textarea.scrollHeight - textarea.clientHeight;
}
// No Textarea, No Console
else if ( !consoleExists ) {
alert(message);
}
// Return true
return true;
};
// ====================================================================
// Emulated Status
/**
* History.getInternetExplorerMajorVersion()
* Get's the major version of Internet Explorer
* @return {integer}
* @license Public Domain
* @author Benjamin Arthur Lupton <contact@balupton.com>
* @author James Padolsey <https://gist.github.com/527683>
*/
History.getInternetExplorerMajorVersion = function(){
var result = History.getInternetExplorerMajorVersion.cached =
(typeof History.getInternetExplorerMajorVersion.cached !== 'undefined')
? History.getInternetExplorerMajorVersion.cached
: (function(){
var v = 3,
div = document.createElement('div'),
all = div.getElementsByTagName('i');
while ( (div.innerHTML = '<!--[if gt IE ' + (++v) + ']><i></i><![endif]-->') && all[0] ) {}
return (v > 4) ? v : false;
})()
;
return result;
};
/**
* History.isInternetExplorer()
* Are we using Internet Explorer?
* @return {boolean}
* @license Public Domain
* @author Benjamin Arthur Lupton <contact@balupton.com>
*/
History.isInternetExplorer = function(){
var result =
History.isInternetExplorer.cached =
(typeof History.isInternetExplorer.cached !== 'undefined')
? History.isInternetExplorer.cached
: Boolean(History.getInternetExplorerMajorVersion())
;
return result;
};
/**
* History.emulated
* Which features require emulating?
*/
if (History.options.html4Mode) {
History.emulated = {
pushState : true,
hashChange: true
};
}
else {
History.emulated = {
pushState: !Boolean(
window.history && window.history.pushState && window.history.replaceState
&& !(
(/ Mobile\/([1-7][a-z]|(8([abcde]|f(1[0-8]))))/i).test(navigator.userAgent) /* disable for versions of iOS before version 4.3 (8F190) */
|| (/AppleWebKit\/5([0-2]|3[0-2])/i).test(navigator.userAgent) /* disable for the mercury iOS browser, or at least older versions of the webkit engine */
)
),
hashChange: Boolean(
!(('onhashchange' in window) || ('onhashchange' in document))
||
(History.isInternetExplorer() && History.getInternetExplorerMajorVersion() < 8)
)
};
}
/**
* History.enabled
* Is History enabled?
*/
History.enabled = !History.emulated.pushState;
/**
* History.bugs
* Which bugs are present
*/
History.bugs = {
/**
* Safari 5 and Safari iOS 4 fail to return to the correct state once a hash is replaced by a `replaceState` call
* https://bugs.webkit.org/show_bug.cgi?id=56249
*/
setHash: Boolean(!History.emulated.pushState && navigator.vendor === 'Apple Computer, Inc.' && /AppleWebKit\/5([0-2]|3[0-3])/.test(navigator.userAgent)),
/**
* Safari 5 and Safari iOS 4 sometimes fail to apply the state change under busy conditions
* https://bugs.webkit.org/show_bug.cgi?id=42940
*/
safariPoll: Boolean(!History.emulated.pushState && navigator.vendor === 'Apple Computer, Inc.' && /AppleWebKit\/5([0-2]|3[0-3])/.test(navigator.userAgent)),
/**
* MSIE 6 and 7 sometimes do not apply a hash even it was told to (requiring a second call to the apply function)
*/
ieDoubleCheck: Boolean(History.isInternetExplorer() && History.getInternetExplorerMajorVersion() < 8),
/**
* MSIE 6 requires the entire hash to be encoded for the hashes to trigger the onHashChange event
*/
hashEscape: Boolean(History.isInternetExplorer() && History.getInternetExplorerMajorVersion() < 7)
};
/**
* History.isEmptyObject(obj)
* Checks to see if the Object is Empty
* @param {Object} obj
* @return {boolean}
*/
History.isEmptyObject = function(obj) {
for ( var name in obj ) {
if ( obj.hasOwnProperty(name) ) {
return false;
}
}
return true;
};
/**
* History.cloneObject(obj)
* Clones a object and eliminate all references to the original contexts
* @param {Object} obj
* @return {Object}
*/
History.cloneObject = function(obj) {
var hash,newObj;
if ( obj ) {
hash = JSON.stringify(obj);
newObj = JSON.parse(hash);
}
else {
newObj = {};
}
return newObj;
};
// ====================================================================
// URL Helpers
/**
* History.getRootUrl()
* Turns "http://mysite.com/dir/page.html?asd" into "http://mysite.com"
* @return {String} rootUrl
*/
History.getRootUrl = function(){
// Create
var rootUrl = document.location.protocol+'//'+(document.location.hostname||document.location.host);
if ( document.location.port||false ) {
rootUrl += ':'+document.location.port;
}
rootUrl += '/';
// Return
return rootUrl;
};
/**
* History.getBaseHref()
* Fetches the `href` attribute of the `<base href="...">` element if it exists
* @return {String} baseHref
*/
History.getBaseHref = function(){
// Create
var
baseElements = document.getElementsByTagName('base'),
baseElement = null,
baseHref = '';
// Test for Base Element
if ( baseElements.length === 1 ) {
// Prepare for Base Element
baseElement = baseElements[0];
baseHref = baseElement.href.replace(/[^\/]+$/,'');
}
// Adjust trailing slash
baseHref = baseHref.replace(/\/+$/,'');
if ( baseHref ) baseHref += '/';
// Return
return baseHref;
};
/**
* History.getBaseUrl()
* Fetches the baseHref or basePageUrl or rootUrl (whichever one exists first)
* @return {String} baseUrl
*/
History.getBaseUrl = function(){
// Create
var baseUrl = History.getBaseHref()||History.getBasePageUrl()||History.getRootUrl();
// Return
return baseUrl;
};
/**
* History.getPageUrl()
* Fetches the URL of the current page
* @return {String} pageUrl
*/
History.getPageUrl = function(){
// Fetch
var
State = History.getState(false,false),
stateUrl = (State||{}).url||History.getLocationHref(),
pageUrl;
// Create
pageUrl = stateUrl.replace(/\/+$/,'').replace(/[^\/]+$/,function(part,index,string){
return (/\./).test(part) ? part : part+'/';
});
// Return
return pageUrl;
};
/**
* History.getBasePageUrl()
* Fetches the Url of the directory of the current page
* @return {String} basePageUrl
*/
History.getBasePageUrl = function(){
// Create
var basePageUrl = (History.getLocationHref()).replace(/[#\?].*/,'').replace(/[^\/]+$/,function(part,index,string){
return (/[^\/]$/).test(part) ? '' : part;
}).replace(/\/+$/,'')+'/';
// Return
return basePageUrl;
};
/**
* History.getFullUrl(url)
* Ensures that we have an absolute URL and not a relative URL
* @param {string} url
* @param {Boolean} allowBaseHref
* @return {string} fullUrl
*/
History.getFullUrl = function(url,allowBaseHref){
// Prepare
var fullUrl = url, firstChar = url.substring(0,1);
allowBaseHref = (typeof allowBaseHref === 'undefined') ? true : allowBaseHref;
// Check
if ( /[a-z]+\:\/\//.test(url) ) {
// Full URL
}
else if ( firstChar === '/' ) {
// Root URL
fullUrl = History.getRootUrl()+url.replace(/^\/+/,'');
}
else if ( firstChar === '#' ) {
// Anchor URL
fullUrl = History.getPageUrl().replace(/#.*/,'')+url;
}
else if ( firstChar === '?' ) {
// Query URL
fullUrl = History.getPageUrl().replace(/[\?#].*/,'')+url;
}
else {
// Relative URL
if ( allowBaseHref ) {
fullUrl = History.getBaseUrl()+url.replace(/^(\.\/)+/,'');
} else {
fullUrl = History.getBasePageUrl()+url.replace(/^(\.\/)+/,'');
}
// We have an if condition above as we do not want hashes
// which are relative to the baseHref in our URLs
// as if the baseHref changes, then all our bookmarks
// would now point to different locations
// whereas the basePageUrl will always stay the same
}
// Return
return fullUrl.replace(/\#$/,'');
};
/**
* History.getShortUrl(url)
* Ensures that we have a relative URL and not a absolute URL
* @param {string} url
* @return {string} url
*/
History.getShortUrl = function(url){
// Prepare
var shortUrl = url, baseUrl = History.getBaseUrl(), rootUrl = History.getRootUrl();
// Trim baseUrl
if ( History.emulated.pushState ) {
// We are in a if statement as when pushState is not emulated
// The actual url these short urls are relative to can change
// So within the same session, we the url may end up somewhere different
console.log ('History.getShortUrl IE :: ' + 'shortUrl: ' + shortUrl + ' baseUrl ' + baseUrl );
shortUrl = shortUrl.replace(baseUrl,'');
}
// Trim rootUrl
shortUrl = shortUrl.replace(rootUrl,'/');
console.log('short url pre: ', shortUrl);
// Ensure we can still detect it as a state
if ( History.isTraditionalAnchor(shortUrl) ) {
// shortUrl = './'+shortUrl;
}
// Clean It
shortUrl = shortUrl.replace(/^(\.\/)+/g,'./').replace(/\#$/,'');
console.log('short url post: ', shortUrl);
// Return
return shortUrl;
};
/**
* History.getLocationHref(document)
* Returns a normalized version of document.location.href
* accounting for browser inconsistencies, etc.
*
* This URL will be URI-encoded and will include the hash
*
* @param {object} document
* @return {string} url
*/
History.getLocationHref = function(doc) {
doc = doc || document;
// most of the time, this will be true
if (doc.URL === doc.location.href)
return doc.location.href;
// some versions of webkit URI-decode document.location.href
// but they leave document.URL in an encoded state
if (doc.location.href === decodeURIComponent(doc.URL))
return doc.URL;
// FF 3.6 only updates document.URL when a page is reloaded
// document.location.href is updated correctly
if (doc.location.hash && decodeURIComponent(doc.location.href.replace(/^[^#]+/, "")) === doc.location.hash)
return doc.location.href;
if (doc.URL.indexOf('#') == -1 && doc.location.href.indexOf('#') != -1)
return doc.location.href;
return doc.URL || doc.location.href;
};
// ====================================================================
// State Storage
/**
* History.store
* The store for all session specific data
*/
History.store = {};
/**
* History.idToState
* 1-1: State ID to State Object
*/
History.idToState = History.idToState||{};
/**
* History.stateToId
* 1-1: State String to State ID
*/
History.stateToId = History.stateToId||{};
/**
* History.urlToId
* 1-1: State URL to State ID
*/
History.urlToId = History.urlToId||{};
/**
* History.storedStates
* Store the states in an array
*/
History.storedStates = History.storedStates||[];
/**
* History.savedStates
* Saved the states in an array
*/
History.savedStates = History.savedStates||[];
/**
* History.noramlizeStore()
* Noramlize the store by adding necessary values
*/
History.normalizeStore = function(){
History.store.idToState = History.store.idToState||{};
History.store.urlToId = History.store.urlToId||{};
History.store.stateToId = History.store.stateToId||{};
};
/**
* History.getState()
* Get an object containing the data, title and url of the current state
* @param {Boolean} friendly
* @param {Boolean} create
* @return {Object} State
*/
History.getState = function(friendly,create){
// Prepare
if ( typeof friendly === 'undefined' ) { friendly = true; }
if ( typeof create === 'undefined' ) { create = true; }
// Fetch
var State = History.getLastSavedState();
// Create
if ( !State && create ) {
State = History.createStateObject();
}
// Adjust
if ( friendly ) {
State = History.cloneObject(State);
State.url = State.cleanUrl||State.url;
}
// Return
return State;
};
/**
* History.getIdByState(State)
* Gets a ID for a State
* @param {State} newState
* @return {String} id
*/
History.getIdByState = function(newState){
// Fetch ID
var id = History.extractId(newState.url),
str;
if ( !id ) {
// Find ID via State String
str = History.getStateString(newState);
if ( typeof History.stateToId[str] !== 'undefined' ) {
id = History.stateToId[str];
}
else if ( typeof History.store.stateToId[str] !== 'undefined' ) {
id = History.store.stateToId[str];
}
else {
// Generate a new ID
while ( true ) {
id = (new Date()).getTime() + String(Math.random()).replace(/\D/g,'');
if ( typeof History.idToState[id] === 'undefined' && typeof History.store.idToState[id] === 'undefined' ) {
break;
}
}
// Apply the new State to the ID
History.stateToId[str] = id;
History.idToState[id] = newState;
}
}
// Return ID
return id;
};
/**
* History.normalizeState(State)
* Expands a State Object
* @param {object} State
* @return {object}
*/
History.normalizeState = function(oldState){
// Variables
var newState, dataNotEmpty;
// Prepare
if ( !oldState || (typeof oldState !== 'object') ) {
oldState = {};
}
// Check
if ( typeof oldState.normalized !== 'undefined' ) {
return oldState;
}
// Adjust
if ( !oldState.data || (typeof oldState.data !== 'object') ) {
oldState.data = {};
}
// ----------------------------------------------------------------
// Create
newState = {};
newState.normalized = true;
newState.title = oldState.title||'';
newState.url = History.getFullUrl(oldState.url?oldState.url:(History.getLocationHref()));
newState.hash = History.getShortUrl(newState.url);
newState.data = History.cloneObject(oldState.data);
// Fetch ID
newState.id = History.getIdByState(newState);
// ----------------------------------------------------------------
// Clean the URL
newState.cleanUrl = newState.url.replace(/\??\&_suid.*/,'');
newState.url = newState.cleanUrl;
// Check to see if we have more than just a url
dataNotEmpty = !History.isEmptyObject(newState.data);
// Apply
if ( (newState.title || dataNotEmpty) && History.options.disableSuid !== true ) {
// Add ID to Hash
newState.hash = History.getShortUrl(newState.url).replace(/\??\&_suid.*/,'');
if ( !/\?/.test(newState.hash) ) {
newState.hash += '?';
}
newState.hash += '&_suid='+newState.id;
}
// Create the Hashed URL
newState.hashedUrl = History.getFullUrl(newState.hash);
// ----------------------------------------------------------------
// Update the URL if we have a duplicate
if ( (History.emulated.pushState || History.bugs.safariPoll) && History.hasUrlDuplicate(newState) ) {
newState.url = newState.hashedUrl;
}
// ----------------------------------------------------------------
// Return
return newState;
};
/**
* History.createStateObject(data,title,url)
* Creates a object based on the data, title and url state params
* @param {object} data
* @param {string} title
* @param {string} url
* @return {object}
*/
History.createStateObject = function(data,title,url){
// Hashify
var State = {
'data': data,
'title': title,
'url': url
};
// Expand the State
State = History.normalizeState(State);
// Return object
return State;
};
/**
* History.getStateById(id)
* Get a state by it's UID
* @param {String} id
*/
History.getStateById = function(id){
// Prepare
id = String(id);
// Retrieve
var State = History.idToState[id] || History.store.idToState[id] || undefined;
// Return State
return State;
};
/**
* Get a State's String
* @param {State} passedState
*/
History.getStateString = function(passedState){
// Prepare
var State, cleanedState, str;
// Fetch
State = History.normalizeState(passedState);
// Clean
cleanedState = {
data: State.data,
title: passedState.title,
url: passedState.url
};
// Fetch
str = JSON.stringify(cleanedState);
// Return
return str;
};
/**
* Get a State's ID
* @param {State} passedState
* @return {String} id
*/
History.getStateId = function(passedState){
// Prepare
var State, id;
// Fetch
State = History.normalizeState(passedState);
// Fetch
id = State.id;
// Return
return id;
};
/**
* History.getHashByState(State)
* Creates a Hash for the State Object
* @param {State} passedState
* @return {String} hash
*/
History.getHashByState = function(passedState){
// Prepare
var State, hash;
// Fetch
State = History.normalizeState(passedState);
// Hash
hash = State.hash;
// Return
return hash;
};
/**
* History.extractId(url_or_hash)
* Get a State ID by it's URL or Hash
* @param {string} url_or_hash
* @return {string} id
*/
History.extractId = function ( url_or_hash ) {
// Prepare
var id,parts,url, tmp;
// Extract
// If the URL has a #, use the id from before the #
if (url_or_hash.indexOf('#') != -1)
{
tmp = url_or_hash.split("#")[0];
}
else
{
tmp = url_or_hash;
}
parts = /(.*)\&_suid=([0-9]+)$/.exec(tmp);
url = parts ? (parts[1]||url_or_hash) : url_or_hash;
id = parts ? String(parts[2]||'') : '';
// Return
return id||false;
};
/**
* History.isTraditionalAnchor
* Checks to see if the url is a traditional anchor or not
* @param {String} url_or_hash
* @return {Boolean}
*/
History.isTraditionalAnchor = function(url_or_hash){
// Check
var isTraditional = !(/[\/\?\.]/.test(url_or_hash));
// Return
return isTraditional;
};
/**
* History.extractState
* Get a State by it's URL or Hash
* @param {String} url_or_hash
* @return {State|null}
*/
History.extractState = function(url_or_hash,create){
// Prepare
var State = null, id, url;
create = create||false;
// Fetch SUID
id = History.extractId(url_or_hash);
if ( id ) {
State = History.getStateById(id);
}
// Fetch SUID returned no State
if ( !State ) {
// Fetch URL
url = History.getFullUrl(url_or_hash);
// Check URL
id = History.getIdByUrl(url)||false;
if ( id ) {
State = History.getStateById(id);
}
// Create State
if ( !State && create && !History.isTraditionalAnchor(url_or_hash) ) {
State = History.createStateObject(null,null,url);
}
}
// Return
return State;
};
/**
* History.getIdByUrl()
* Get a State ID by a State URL
*/
History.getIdByUrl = function(url){
// Fetch
var id = History.urlToId[url] || History.store.urlToId[url] || undefined;
// Return
return id;
};
/**
* History.getLastSavedState()
* Get an object containing the data, title and url of the current state
* @return {Object} State
*/
History.getLastSavedState = function(){
return History.savedStates[History.savedStates.length-1]||undefined;
};
/**
* History.getLastStoredState()
* Get an object containing the data, title and url of the current state
* @return {Object} State
*/
History.getLastStoredState = function(){
return History.storedStates[History.storedStates.length-1]||undefined;
};
/**
* History.hasUrlDuplicate
* Checks if a Url will have a url conflict
* @param {Object} newState
* @return {Boolean} hasDuplicate
*/
History.hasUrlDuplicate = function(newState) {
// Prepare
var hasDuplicate = false,
oldState;
// Fetch
oldState = History.extractState(newState.url);
// Check
hasDuplicate = oldState && oldState.id !== newState.id;
// Return
return hasDuplicate;
};
/**
* History.storeState
* Store a State
* @param {Object} newState
* @return {Object} newState
*/
History.storeState = function(newState){
// Store the State
History.urlToId[newState.url] = newState.id;
// Push the State
History.storedStates.push(History.cloneObject(newState));
// Return newState
return newState;
};
/**
* History.isLastSavedState(newState)
* Tests to see if the state is the last state
* @param {Object} newState
* @return {boolean} isLast
*/
History.isLastSavedState = function(newState){
// Prepare
var isLast = false,
newId, oldState, oldId;
// Check
if ( History.savedStates.length ) {
newId = newState.id;
oldState = History.getLastSavedState();
oldId = oldState.id;
// Check
isLast = (newId === oldId);
}
// Return
return isLast;
};
/**
* History.saveState
* Push a State
* @param {Object} newState
* @return {boolean} changed
*/
History.saveState = function(newState){
// Check Hash
if ( History.isLastSavedState(newState) ) {
return false;
}
// Push the State
History.savedStates.push(History.cloneObject(newState));
// Return true
return true;
};
/**
* History.getStateByIndex()
* Gets a state by the index
* @param {integer} index
* @return {Object}
*/
History.getStateByIndex = function(index){
// Prepare
var State = null;
// Handle
if ( typeof index === 'undefined' ) {
// Get the last inserted
State = History.savedStates[History.savedStates.length-1];
}
else if ( index < 0 ) {
// Get from the end
State = History.savedStates[History.savedStates.length+index];
}
else {
// Get from the beginning
State = History.savedStates[index];
}
// Return State
return State;
};
/**
* History.getCurrentIndex()
* Gets the current index
* @return (integer)
*/
History.getCurrentIndex = function(){
// Prepare
var index = null;
// No states saved
if(History.savedStates.length < 1) {
index = 0;
}
else {
index = History.savedStates.length-1;
}
return index;
};
// ====================================================================
// Hash Helpers
/**
* History.getHash()
* @param {Location=} location
* Gets the current document hash
* Note: unlike location.hash, this is guaranteed to return the escaped hash in all browsers
* @return {string}
*/
History.getHash = function(doc){
var url = History.getLocationHref(doc),
hash;
hash = History.getHashByUrl(url);
return hash;
};
/**
* History.unescapeHash()
* normalize and Unescape a Hash
* @param {String} hash
* @return {string}
*/
History.unescapeHash = function(hash){
// Prepare
var result = History.normalizeHash(hash);
// Unescape hash
result = decodeURIComponent(result);
// Return result
return result;
};
/**
* History.normalizeHash()
* normalize a hash across browsers
* @return {string}
*/
History.normalizeHash = function(hash){
// Prepare
var result = hash.replace(/[^#]*#/,'').replace(/#.*/, '');
// Return result
return result;
};
/**
* History.setHash(hash)
* Sets the document hash
* @param {string} hash
* @return {History}
*/
History.setHash = function(hash,queue){
// Prepare
var State, pageUrl;
// Handle Queueing
if ( queue !== false && History.busy() ) {
// Wait + Push to Queue
//History.debug('History.setHash: we must wait', arguments);
History.pushQueue({
scope: History,
callback: History.setHash,
args: arguments,
queue: queue
});
return false;
}
// Log
//History.debug('History.setHash: called',hash);
// Make Busy + Continue
History.busy(true);
// Check if hash is a state
State = History.extractState(hash,true);
if ( State && !History.emulated.pushState ) {
// Hash is a state so skip the setHash
//History.debug('History.setHash: Hash is a state so skipping the hash set with a direct pushState call',arguments);
// PushState
History.pushState(State.data,State.title,State.url,false);
}
else if ( History.getHash() !== hash ) {
// Hash is a proper hash, so apply it
// Handle browser bugs
if ( History.bugs.setHash ) {
// Fix Safari Bug https://bugs.webkit.org/show_bug.cgi?id=56249
// Fetch the base page
pageUrl = History.getPageUrl();
// Safari hash apply
History.pushState(null,null,pageUrl+'#'+hash,false);
}
else {
// Normal hash apply
document.location.hash = hash;
}
}
// Chain
return History;
};
/**
* History.escape()
* normalize and Escape a Hash
* @return {string}
*/
History.escapeHash = function(hash){
// Prepare
var result = History.normalizeHash(hash);
// Escape hash
result = window.encodeURIComponent(result);
// IE6 Escape Bug
if ( !History.bugs.hashEscape ) {
// Restore common parts
result = result
.replace(/\%21/g,'!')
.replace(/\%26/g,'&')
.replace(/\%3D/g,'=')
.replace(/\%3F/g,'?');
}
// Return result
return result;
};
/**
* History.getHashByUrl(url)
* Extracts the Hash from a URL
* @param {string} url
* @return {string} url
*/
History.getHashByUrl = function(url){
// Extract the hash
var hash = String(url)
.replace(/([^#]*)#?([^#]*)#?(.*)/, '$2')
;
// Unescape hash
hash = History.unescapeHash(hash);
// Return hash
return hash;
};
/**
* History.setTitle(title)
* Applies the title to the document
* @param {State} newState
* @return {Boolean}
*/
History.setTitle = function(newState){
// Prepare
var title = newState.title,
firstState;
// Initial
if ( !title ) {
firstState = History.getStateByIndex(0);
if ( firstState && firstState.url === newState.url ) {
title = firstState.title||History.options.initialTitle;
}
}
// Apply
try {
document.getElementsByTagName('title')[0].innerHTML = title.replace('<','<').replace('>','>').replace(' & ',' & ');
}
catch ( Exception ) { }
document.title = title;
// Chain
return History;
};
// ====================================================================
// Queueing
/**
* History.queues
* The list of queues to use
* First In, First Out
*/
History.queues = [];
/**
* History.busy(value)
* @param {boolean} value [optional]
* @return {boolean} busy
*/
History.busy = function(value){
// Apply
if ( typeof value !== 'undefined' ) {
//History.debug('History.busy: changing ['+(History.busy.flag||false)+'] to ['+(value||false)+']', History.queues.length);
History.busy.flag = value;
}
// Default
else if ( typeof History.busy.flag === 'undefined' ) {
History.busy.flag = false;
}
// Queue
if ( !History.busy.flag ) {
// Execute the next item in the queue
clearTimeout(History.busy.timeout);
var fireNext = function(){
var i, queue, item;
if ( History.busy.flag ) return;
for ( i=History.queues.length-1; i >= 0; --i ) {
queue = History.queues[i];
if ( queue.length === 0 ) continue;
item = queue.shift();
History.fireQueueItem(item);
History.busy.timeout = setTimeout(fireNext,History.options.busyDelay);
}
};
History.busy.timeout = setTimeout(fireNext,History.options.busyDelay);
}
// Return
return History.busy.flag;
};
/**
* History.busy.flag
*/
History.busy.flag = false;
/**
* History.fireQueueItem(item)
* Fire a Queue Item
* @param {Object} item
* @return {Mixed} result
*/
History.fireQueueItem = function(item){
return item.callback.apply(item.scope||History,item.args||[]);
};
/**
* History.pushQueue(callback,args)
* Add an item to the queue
* @param {Object} item [scope,callback,args,queue]
*/
History.pushQueue = function(item){
// Prepare the queue
History.queues[item.queue||0] = History.queues[item.queue||0]||[];
// Add to the queue
History.queues[item.queue||0].push(item);
// Chain
return History;
};
/**
* History.queue (item,queue), (func,queue), (func), (item)
* Either firs the item now if not busy, or adds it to the queue
*/
History.queue = function(item,queue){
// Prepare
if ( typeof item === 'function' ) {
item = {
callback: item
};
}
if ( typeof queue !== 'undefined' ) {
item.queue = queue;
}
// Handle
if ( History.busy() ) {
History.pushQueue(item);
} else {
History.fireQueueItem(item);
}
// Chain
return History;
};
/**
* History.clearQueue()
* Clears the Queue
*/
History.clearQueue = function(){
History.busy.flag = false;
History.queues = [];
return History;
};
// ====================================================================
// IE Bug Fix
/**
* History.stateChanged
* States whether or not the state has changed since the last double check was initialised
*/
History.stateChanged = false;
/**
* History.doubleChecker
* Contains the timeout used for the double checks
*/
History.doubleChecker = false;
/**
* History.doubleCheckComplete()
* Complete a double check
* @return {History}
*/
History.doubleCheckComplete = function(){
// Update
History.stateChanged = true;
// Clear
History.doubleCheckClear();
// Chain
return History;
};
/**
* History.doubleCheckClear()
* Clear a double check
* @return {History}
*/
History.doubleCheckClear = function(){
// Clear
if ( History.doubleChecker ) {
clearTimeout(History.doubleChecker);
History.doubleChecker = false;
}
// Chain
return History;
};
/**
* History.doubleCheck()
* Create a double check
* @return {History}
*/
History.doubleCheck = function(tryAgain){
// Reset
History.stateChanged = false;
History.doubleCheckClear();
// Fix IE6,IE7 bug where calling history.back or history.forward does not actually change the hash (whereas doing it manually does)
// Fix Safari 5 bug where sometimes the state does not change: https://bugs.webkit.org/show_bug.cgi?id=42940
if ( History.bugs.ieDoubleCheck ) {
// Apply Check
History.doubleChecker = setTimeout(
function(){
History.doubleCheckClear();
if ( !History.stateChanged ) {
//History.debug('History.doubleCheck: State has not yet changed, trying again', arguments);
// Re-Attempt
tryAgain();
}
return true;
},
History.options.doubleCheckInterval
);
}
// Chain
return History;
};
// ====================================================================
// Safari Bug Fix
/**
* History.safariStatePoll()
* Poll the current state
* @return {History}
*/
History.safariStatePoll = function(){
// Poll the URL
// Get the Last State which has the new URL
var
urlState = History.extractState(History.getLocationHref()),
newState;
// Check for a difference
if ( !History.isLastSavedState(urlState) ) {
newState = urlState;
}
else {
return;
}
// Check if we have a state with that url
// If not create it
if ( !newState ) {
//History.debug('History.safariStatePoll: new');
newState = History.createStateObject();
}
// Apply the New State
//History.debug('History.safariStatePoll: trigger');
History.Adapter.trigger(window,'popstate');
// Chain
return History;
};
// ====================================================================
// State Aliases
/**
* History.back(queue)
* Send the browser history back one item
* @param {Integer} queue [optional]
*/
History.back = function(queue){
//History.debug('History.back: called', arguments);
// Handle Queueing
if ( queue !== false && History.busy() ) {
// Wait + Push to Queue
//History.debug('History.back: we must wait', arguments);
History.pushQueue({
scope: History,
callback: History.back,
args: arguments,
queue: queue
});
return false;
}
// Make Busy + Continue
History.busy(true);
// Fix certain browser bugs that prevent the state from changing
History.doubleCheck(function(){
History.back(false);
});
// Go back
history.go(-1);
// End back closure
return true;
};
/**
* History.forward(queue)
* Send the browser history forward one item
* @param {Integer} queue [optional]
*/
History.forward = function(queue){
//History.debug('History.forward: called', arguments);
// Handle Queueing
if ( queue !== false && History.busy() ) {
// Wait + Push to Queue
//History.debug('History.forward: we must wait', arguments);
History.pushQueue({
scope: History,
callback: History.forward,
args: arguments,
queue: queue
});
return false;
}
// Make Busy + Continue
History.busy(true);
// Fix certain browser bugs that prevent the state from changing
History.doubleCheck(function(){
History.forward(false);
});
// Go forward
history.go(1);
// End forward closure
return true;
};
/**
* History.go(index,queue)
* Send the browser history back or forward index times
* @param {Integer} queue [optional]
*/
History.go = function(index,queue){
//History.debug('History.go: called', arguments);
// Prepare
var i;
// Handle
if ( index > 0 ) {
// Forward
for ( i=1; i<=index; ++i ) {
History.forward(queue);
}
}
else if ( index < 0 ) {
// Backward
for ( i=-1; i>=index; --i ) {
History.back(queue);
}
}
else {
throw new Error('History.go: History.go requires a positive or negative integer passed.');
}
// Chain
return History;
};
// ====================================================================
// HTML5 State Support
// Non-Native pushState Implementation
if ( History.emulated.pushState ) {
/*
* Provide Skeleton for HTML4 Browsers
*/
// Prepare
var emptyFunction = function(){};
History.pushState = History.pushState||emptyFunction;
History.replaceState = History.replaceState||emptyFunction;
} // History.emulated.pushState
// Native pushState Implementation
else {
/*
* Use native HTML5 History API Implementation
*/
/**
* History.onPopState(event,extra)
* Refresh the Current State
*/
History.onPopState = function(event,extra){
// Prepare
var stateId = false, newState = false, currentHash, currentState;
// Reset the double check
History.doubleCheckComplete();
// Check for a Hash, and handle apporiatly
currentHash = History.getHash();
if ( currentHash ) {
// Expand Hash
currentState = History.extractState(currentHash||History.getLocationHref(),true);
if ( currentState ) {
// We were able to parse it, it must be a State!
// Let's forward to replaceState
//History.debug('History.onPopState: state anchor', currentHash, currentState);
History.replaceState(currentState.data, currentState.title, currentState.url, false);
}
else {
// Traditional Anchor
//History.debug('History.onPopState: traditional anchor', currentHash);
History.Adapter.trigger(window,'anchorchange');
History.busy(false);
}
// We don't care for hashes
History.expectedStateId = false;
return false;
}
// Ensure
stateId = History.Adapter.extractEventData('state',event,extra) || false;
// Fetch State
if ( stateId ) {
// Vanilla: Back/forward button was used
newState = History.getStateById(stateId);
}
else if ( History.expectedStateId ) {
// Vanilla: A new state was pushed, and popstate was called manually
newState = History.getStateById(History.expectedStateId);
}
else {
// Initial State
newState = History.extractState(History.getLocationHref());
}
// The State did not exist in our store
if ( !newState ) {
// Regenerate the State
newState = History.createStateObject(null,null,History.getLocationHref());
}
// Clean
History.expectedStateId = false;
// Check if we are the same state
if ( History.isLastSavedState(newState) ) {
// There has been no change (just the page's hash has finally propagated)
//History.debug('History.onPopState: no change', newState, History.savedStates);
History.busy(false);
return false;
}
// Store the State
History.storeState(newState);
History.saveState(newState);
// Force update of the title
History.setTitle(newState);
// Fire Our Event
History.Adapter.trigger(window,'statechange');
History.busy(false);
// Return true
return true;
};
History.Adapter.bind(window,'popstate',History.onPopState);
/**
* History.pushState(data,title,url)
* Add a new State to the history object, become it, and trigger onpopstate
* We have to trigger for HTML4 compatibility
* @param {object} data
* @param {string} title
* @param {string} url
* @return {true}
*/
History.pushState = function(data,title,url,queue){
//History.debug('History.pushState: called', arguments);
// Check the State
if ( History.getHashByUrl(url) && History.emulated.pushState ) {
throw new Error('History.js does not support states with fragement-identifiers (hashes/anchors).');
}
// Handle Queueing
if ( queue !== false && History.busy() ) {
// Wait + Push to Queue
//History.debug('History.pushState: we must wait', arguments);
History.pushQueue({
scope: History,
callback: History.pushState,
args: arguments,
queue: queue
});
return false;
}
// Make Busy + Continue
History.busy(true);
// Create the newState
var newState = History.createStateObject(data,title,url);
// Check it
if ( History.isLastSavedState(newState) ) {
// Won't be a change
History.busy(false);
}
else {
// Store the newState
History.storeState(newState);
History.expectedStateId = newState.id;
// Push the newState
history.pushState(newState.id,newState.title,newState.url);
// Fire HTML5 Event
History.Adapter.trigger(window,'popstate');
}
// End pushState closure
return true;
};
/**
* History.replaceState(data,title,url)
* Replace the State and trigger onpopstate
* We have to trigger for HTML4 compatibility
* @param {object} data
* @param {string} title
* @param {string} url
* @return {true}
*/
History.replaceState = function(data,title,url,queue){
//History.debug('History.replaceState: called', arguments);
// Check the State
if ( History.getHashByUrl(url) && History.emulated.pushState ) {
throw new Error('History.js does not support states with fragement-identifiers (hashes/anchors).');
}
// Handle Queueing
if ( queue !== false && History.busy() ) {
// Wait + Push to Queue
//History.debug('History.replaceState: we must wait', arguments);
History.pushQueue({
scope: History,
callback: History.replaceState,
args: arguments,
queue: queue
});
return false;
}
// Make Busy + Continue
History.busy(true);
// Create the newState
var newState = History.createStateObject(data,title,url);
// Check it
if ( History.isLastSavedState(newState) ) {
// Won't be a change
History.busy(false);
}
else {
// Store the newState
History.storeState(newState);
History.expectedStateId = newState.id;
// Push the newState
history.replaceState(newState.id,newState.title,newState.url);
// Fire HTML5 Event
History.Adapter.trigger(window,'popstate');
}
// End replaceState closure
return true;
};
} // !History.emulated.pushState
// ====================================================================
// Initialise
/**
* Load the Store
*/
if ( sessionStorage ) {
// Fetch
try {
History.store = JSON.parse(sessionStorage.getItem('History.store'))||{};
}
catch ( err ) {
History.store = {};
}
// Normalize
History.normalizeStore();
}
else {
// Default Load
History.store = {};
History.normalizeStore();
}
/**
* Clear Intervals on exit to prevent memory leaks
*/
History.Adapter.bind(window,"unload",History.clearAllIntervals);
/**
* Create the initial State
*/
History.saveState(History.storeState(History.extractState(History.getLocationHref(),true)));
/**
* Bind for Saving Store
*/
if ( sessionStorage ) {
// When the page is closed
History.onUnload = function(){
// Prepare
var currentStore, item, currentStoreString;
// Fetch
try {
currentStore = JSON.parse(sessionStorage.getItem('History.store'))||{};
}
catch ( err ) {
currentStore = {};
}
// Ensure
currentStore.idToState = currentStore.idToState || {};
currentStore.urlToId = currentStore.urlToId || {};
currentStore.stateToId = currentStore.stateToId || {};
// Sync
for ( item in History.idToState ) {
if ( !History.idToState.hasOwnProperty(item) ) {
continue;
}
currentStore.idToState[item] = History.idToState[item];
}
for ( item in History.urlToId ) {
if ( !History.urlToId.hasOwnProperty(item) ) {
continue;
}
currentStore.urlToId[item] = History.urlToId[item];
}
for ( item in History.stateToId ) {
if ( !History.stateToId.hasOwnProperty(item) ) {
continue;
}
currentStore.stateToId[item] = History.stateToId[item];
}
// Update
History.store = currentStore;
History.normalizeStore();
// In Safari, going into Private Browsing mode causes the
// Session Storage object to still exist but if you try and use
// or set any property/function of it it throws the exception
// "QUOTA_EXCEEDED_ERR: DOM Exception 22: An attempt was made to
// add something to storage that exceeded the quota." infinitely
// every second.
currentStoreString = JSON.stringify(currentStore);
try {
// Store
sessionStorage.setItem('History.store', currentStoreString);
}
catch (e) {
if (e.code === DOMException.QUOTA_EXCEEDED_ERR) {
if (sessionStorage.length) {
// Workaround for a bug seen on iPads. Sometimes the quota exceeded error comes up and simply
// removing/resetting the storage can work.
sessionStorage.removeItem('History.store');
sessionStorage.setItem('History.store', currentStoreString);
} else {
// Otherwise, we're probably private browsing in Safari, so we'll ignore the exception.
}
} else {
throw e;
}
}
};
// For Internet Explorer
History.intervalList.push(setInterval(History.onUnload,History.options.storeInterval));
// For Other Browsers
History.Adapter.bind(window,'beforeunload',History.onUnload);
History.Adapter.bind(window,'unload',History.onUnload);
// Both are enabled for consistency
}
// Non-Native pushState Implementation
if ( !History.emulated.pushState ) {
// Be aware, the following is only for native pushState implementations
// If you are wanting to include something for all browsers
// Then include it above this if block
/**
* Setup Safari Fix
*/
if ( History.bugs.safariPoll ) {
History.intervalList.push(setInterval(History.safariStatePoll, History.options.safariPollInterval));
}
/**
* Ensure Cross Browser Compatibility
*/
if ( navigator.vendor === 'Apple Computer, Inc.' || (navigator.appCodeName||'') === 'Mozilla' ) {
/**
* Fix Safari HashChange Issue
*/
// Setup Alias
History.Adapter.bind(window,'hashchange',function(){
History.Adapter.trigger(window,'popstate');
});
// Initialise Alias
if ( History.getHash() ) {
History.Adapter.onDomLoad(function(){
History.Adapter.trigger(window,'hashchange');
});
}
}
} // !History.emulated.pushState
}; // History.initCore
// Try to Initialise History
if (!History.options || !History.options.delayInit) {
History.init();
}
return History;
});
|
shovemedia/GigaJS
|
js/src/lib/History.js
|
JavaScript
|
mit
| 71,024
|
<?php
return [
/*
|--------------------------------------------------------------------------
| Pagination Language Lines
|--------------------------------------------------------------------------
|
| The following language lines are used by the paginator library to build
| the simple pagination links. You are free to change them to anything
| you want to customize your views to better match your application.
|
*/
'previous' => '« পূর্ববর্তী',
'next' => 'পরবর্তী »',
];
|
iluminar/goodwork
|
resources/lang/bn/pagination.php
|
PHP
|
mit
| 575
|
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Global any_tag</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="../../index.html" title="Chapter 1. Boost.MPI">
<link rel="up" href="../../mpi/reference.html#header.boost.mpi.communicator_hpp" title="Header <boost/mpi/communicator.hpp>">
<link rel="prev" href="any_source.html" title="Global any_source">
<link rel="next" href="operator___idp9815920.html" title="Function operator==">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="any_source.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../mpi/reference.html#header.boost.mpi.communicator_hpp"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="operator___idp9815920.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.mpi.any_tag"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Global any_tag</span></h2>
<p>boost::mpi::any_tag — A constant representing "any tag.". </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: <<a class="link" href="../../mpi/reference.html#header.boost.mpi.communicator_hpp" title="Header <boost/mpi/communicator.hpp>">boost/mpi/communicator.hpp</a>>
</span><span class="keyword">const</span> <span class="keyword">int</span> any_tag<span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idp10483936"></a><h2>Description</h2>
<p>This constant may be used for the <code class="computeroutput">tag</code> parameter of <code class="computeroutput">receive</code> operations to indicate that a <code class="computeroutput">send</code> with any tag will be matched by the receive. </p>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2005-2007 Douglas Gregor,
Matthias Troyer, Trustees of Indiana University<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">
http://www.boost.org/LICENSE_1_0.txt </a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="any_source.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../mpi/reference.html#header.boost.mpi.communicator_hpp"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="operator___idp9815920.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
|
calvinfarias/IC2015-2
|
BOOST/boost_1_61_0/libs/mpi/doc/html/boost/mpi/any_tag.html
|
HTML
|
mit
| 4,028
|
/*!
* jQuery.tabbed() v1.0.1
* https://github.com/chovy/tabbed-navigation
*
* Copyright 2012, Anthony Ettinger
* Dual licensed under the MIT or GPL Version 2 licenses.
*
* Date: Tue Feb 14 19:48:04 PST 2012
*/
.tabbed .tabs:after, .clfx:after { content: '.'; display: block; visibility: hidden; overflow: hidden; clear: both; font-size: 0; height: 0; }
.tabbed { }
.tabbed .tabs, .tabbed .tabs li, .tabbed .tabs a { display: block; }
.tabbed .tabs { list-style-type: none; padding-left: 20px; }
.tabbed .tabs li { border: 1px solid black; border-radius: 5px 5px 0 0; float: left; border-bottom: none; margin-right: 10px; }
.tabbed .tabs a { padding: 5px 10px; text-decoration: none; }
.tabbed .tabs a, .tabbed .tabs a:active, .tabbed .tabs a:focus { outline: none; }
.tabbed .tabs .active a { margin-bottom: -1px; border-bottom: 1px solid white; }
.tabbed .contents { border: 1px solid black; border-radius: 5px; }
.tabbed .content { display: none; padding: 20px; }
.tabbed .content:first-child { display: block; }
|
chovy/tabbed-navigation
|
releases/jquery.tabbed-1.0.1/jquery.tabbed.css
|
CSS
|
mit
| 1,025
|
<!DOCTYPE html>
<html xmlns:msxsl="urn:schemas-microsoft-com:xslt">
<head>
<meta content="en-us" http-equiv="Content-Language" />
<meta content="text/html; charset=utf-16" http-equiv="Content-Type" />
<title _locid="PortabilityAnalysis0">.NET Portability Report</title>
<style>
/* Body style, for the entire document */
body {
background: #F3F3F4;
color: #1E1E1F;
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
padding: 0;
margin: 0;
}
/* Header1 style, used for the main title */
h1 {
padding: 10px 0px 10px 10px;
font-size: 21pt;
background-color: #E2E2E2;
border-bottom: 1px #C1C1C2 solid;
color: #201F20;
margin: 0;
font-weight: normal;
}
/* Header2 style, used for "Overview" and other sections */
h2 {
font-size: 18pt;
font-weight: normal;
padding: 15px 0 5px 0;
margin: 0;
}
/* Header3 style, used for sub-sections, such as project name */
h3 {
font-weight: normal;
font-size: 15pt;
margin: 0;
padding: 15px 0 5px 0;
background-color: transparent;
}
h4 {
font-weight: normal;
font-size: 12pt;
margin: 0;
padding: 0 0 0 0;
background-color: transparent;
}
/* Color all hyperlinks one color */
a {
color: #1382CE;
}
/* Paragraph text (for longer informational messages) */
p {
font-size: 10pt;
}
/* Table styles */
table {
border-spacing: 0 0;
border-collapse: collapse;
font-size: 10pt;
}
table th {
background: #E7E7E8;
text-align: left;
text-decoration: none;
font-weight: normal;
padding: 3px 6px 3px 6px;
}
table td {
vertical-align: top;
padding: 3px 6px 5px 5px;
margin: 0px;
border: 1px solid #E7E7E8;
background: #F7F7F8;
}
.NoBreakingChanges {
color: darkgreen;
font-weight:bold;
}
.FewBreakingChanges {
color: orange;
font-weight:bold;
}
.ManyBreakingChanges {
color: red;
font-weight:bold;
}
.BreakDetails {
margin-left: 30px;
}
.CompatMessage {
font-style: italic;
font-size: 10pt;
}
.GoodMessage {
color: darkgreen;
}
/* Local link is a style for hyperlinks that link to file:/// content, there are lots so color them as 'normal' text until the user mouse overs */
.localLink {
color: #1E1E1F;
background: #EEEEED;
text-decoration: none;
}
.localLink:hover {
color: #1382CE;
background: #FFFF99;
text-decoration: none;
}
/* Center text, used in the over views cells that contain message level counts */
.textCentered {
text-align: center;
}
/* The message cells in message tables should take up all avaliable space */
.messageCell {
width: 100%;
}
/* Padding around the content after the h1 */
#content {
padding: 0px 12px 12px 12px;
}
/* The overview table expands to width, with a max width of 97% */
#overview table {
width: auto;
max-width: 75%;
}
/* The messages tables are always 97% width */
#messages table {
width: 97%;
}
/* All Icons */
.IconSuccessEncoded, .IconInfoEncoded, .IconWarningEncoded, .IconErrorEncoded {
min-width: 18px;
min-height: 18px;
background-repeat: no-repeat;
background-position: center;
}
/* Success icon encoded */
.IconSuccessEncoded {
/* Note: Do not delete the comment below. It is used to verify the correctness of the encoded image resource below before the product is released */
/* [---XsltValidateInternal-Base64EncodedImage:IconSuccess#Begin#background-image: url(data:image/png;base64,#Separator#);#End#] */
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABPElEQVR4Xp1Tv0vDUBi8FqeA4NpBcBLcWnQSApncOnTo4FSnjP0DsnXpH5CxiwbHDg4Zuj4oOEXiJgiC4FDcCkLWmIMc1Pfw+eMgQ77v3Xf3Pe51YKGqqisAEwCR1TIAsiAIblSo6xrdHeJR85Xle3mdmCQKb0PsfqyxxzM8K15HZADl/H5+sHpZwYfxyRjTs+kWwKBx8yoHd2mRiuzF8mkJniWH/13u3Fjrs/EdhsdDFHGB/DLXEJBDLh1MWPAhPo1BLB4WX5yQywHR+m3tVe/t97D52CB/ziG0nIgD/qDuYg8WuCcVZ2YGwlJ3YDugkpR/VNcAEx6GEKhERSr71FuO4YCM4XBdwKvecjIlkSnsO0Hyp/GxSeJAdzBKzpOtnPwyyiPdAZhpZptT04tU+zk7s8czeges//s5C5+CwqrR4/gw+AAAAABJRU5ErkJggg==);
}
/* Information icon encoded */
.IconInfoEncoded {
/* Note: Do not delete the comment below. It is used to verify the correctness of the encoded image resource below before the product is released */
/* [---XsltValidateInternal-Base64EncodedImage:IconInformation#Begin#background-image: url(data:image/png;base64,#Separator#);#End#] */
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABHElEQVR4Xs2TsUoDQRRF7wwoziokjZUKadInhdhukR9YP8DMX1hYW+QvdsXa/QHBbcXC7W0CamWTQnclFutceIQJwwaWNLlwm5k5d94M76mmaeCrrmsLYOocY12FcxZFUeozCqKqqgYA8uevv1H6VuPxcwlfk5N92KHBxfFeCSAxxswlYAW/Xr989x/mv9gkhtyMDhcAxgzRsp7flj8B/HF1RsMXq+NZMkopaHe7lbKxQUEIGbKsYNoGn969060hZBkQex/W8oRQwsQaW2o3Ago2SVcJUzAgY3N0lTCZZm+zPS8HB51gMmS1DEYyOz9acKO1D8JWTlafKIMxdhvlfdyT94Vv5h7P8Ky7nQzACmhvKq3zk3PjW9asz9D/1oigecsioooAAAAASUVORK5CYII=);
}
/* Warning icon encoded */
.IconWarningEncoded {
/* Note: Do not delete the comment below. It is used to verify the correctness of the encoded image resource below before the product is released */
/* [---XsltValidateInternal-Base64EncodedImage:IconWarning#Begin#background-image: url(data:image/png;base64,#Separator#);#End#] */
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAx0lEQVR4XpWSMQ7CMAxFf4xAyBMLCxMrO8dhaBcuwdCJS3RJBw7SA/QGTCxdWJgiQYWKXJWKIXHIlyw5lqr34tQgEOdcBsCOx5yZK3hCCKdYXneQkh4pEfqzLfu+wVDSyyzFoJjfz9NB+pAF+eizx2Vruts0k15mPgvS6GYvpVtQhB61IB/dk6AF6fS4Ben0uIX5odtFe8Q/eW1KvFeH4e8khT6+gm5B+t3juyDt7n0jpe+CANTd+oTUjN/U3yVaABnSUjFz/gFq44JaVSCXeQAAAABJRU5ErkJggg==);
}
/* Error icon encoded */
.IconErrorEncoded {
/* Note: Do not delete the comment below. It is used to verify the correctness of the encoded image resource below before the product is released */
/* [---XsltValidateInternal-Base64EncodedImage:IconError#Begin#background-image: url(data:image/png;base64,#Separator#);#End#] */
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABQElEQVR4XqWTvUoEQRCE6wYPZUA80AfwAQz23uCMjA7MDRQEIzPBVEyNTQUFIw00vcQTTMzuAh/AxEQQT8HF/3G/oGGnEUGuoNnd6qoZuqltyKEsyzVJq5I6rnUp6SjGeGhESikzzlc1eL7opfuVbrqbU1Zw9NCgtQMaZpY0eNnaaL2fHusvTK5vKu7sjSS1Y4y3QUA6K3e3Mau5UFDyMP7tYF9o8cAHZv68vipoIJg971PZIZ5HiwdvYGGvFVFHmGmZ2MxwmQYPXubPl9Up0tfoMQGetXd6mRbvhBw+boZ6WF7Mbv1+GsHRk0fQmPAH1GfmZirbCfDJ61tw3Px8/8pZsPAG4jlVhcPgZ7adwNWBB68lkRQWFiTgFlbnLY3DGGM7izIJIyT/jjIvEJw6fdJTc6krDzh6aMwMP9bvDH4ADSsa9uSWVJkAAAAASUVORK5CYII=);
}
</style>
</head>
<body>
<h1 _locid="PortabilityReport">.NET Portability Report</h1>
<div id="content">
<div id="submissionId" style="font-size:8pt;">
<p>
<i>
Submission Id
1a622499-c8ad-4b30-9569-c1f382628e95
</i>
</p>
</div>
<h2 _locid="SummaryTitle">
<a name="Portability Summary"></a>Portability Summary
</h2>
<div id="summary">
<table>
<tbody>
<tr>
<th>Assembly</th>
<th>ASP.NET 5,Version=v1.0</th>
<th>Windows,Version=v8.1</th>
<th>.NET Framework,Version=v4.6</th>
<th>Windows Phone,Version=v8.1</th>
</tr>
<tr>
<td><strong><a href="#RabbitBus.Serialization.Json">RabbitBus.Serialization.Json</a></strong></td>
<td class="text-center">100.00 %</td>
<td class="text-center">95.45 %</td>
<td class="text-center">100.00 %</td>
<td class="text-center">95.45 %</td>
</tr>
</tbody>
</table>
</div>
<div id="details">
<a name="RabbitBus.Serialization.Json"><h3>RabbitBus.Serialization.Json</h3></a>
<table>
<tbody>
<tr>
<th>Target type</th>
<th>ASP.NET 5,Version=v1.0</th>
<th>Windows,Version=v8.1</th>
<th>.NET Framework,Version=v4.6</th>
<th>Windows Phone,Version=v8.1</th>
<th>Recommended changes</th>
</tr>
<tr>
<td>System.Diagnostics.TraceEventType</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Reflection.BindingFlags</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Text.Encoding</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Call Encoding.GetString(byte[], int, int)</td>
</tr>
<tr>
<td style="padding-left:2em">GetString(System.Byte[])</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Call Encoding.GetString(byte[], int, int)</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</tbody>
</table>
<p>
<a href="#Portability Summary">Back to Summary</a>
</p>
</div>
</div>
</body>
</html>
|
kuhlenh/port-to-core
|
Reports/ra/rabbitbus.serialization.json.2.1.0/RabbitBus.Serialization.Json-net40.html
|
HTML
|
mit
| 13,357
|
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SamLu.RegularExpression.Extend
{
/// <summary>
/// 包含所有正则复数分支的分支的集合。
/// </summary>
/// <typeparam name="T">正则接受的对象的类型。</typeparam>
public class RegexMultiBranchBranchCollection<T> : IDictionary<RegexMultiBranchBranchPredicate<T>, RegexObject<T>>, ICollection<RegexMultiBranchBranch<T>>
{
private IDictionary<RegexMultiBranchBranchPredicate<T>, RegexMultiBranchBranch<T>> innerDic;
/// <summary>
/// 初始化 <see cref="RegexMultiBranchBranchCollection{T}"/> 类的新实例。
/// </summary>
public RegexMultiBranchBranchCollection() =>
this.innerDic = new Dictionary<RegexMultiBranchBranchPredicate<T>, RegexMultiBranchBranch<T>>();
public RegexMultiBranchBranchCollection(IEnumerable<RegexMultiBranchBranch<T>> branches) :
this((branches ?? throw new ArgumentNullException(nameof(branches)))
.ToDictionary(branch => branch.Predicate)
)
{ }
public RegexMultiBranchBranchCollection(IDictionary<RegexMultiBranchBranchPredicate<T>, RegexObject<T>> dictionary) :
this((dictionary ?? throw new ArgumentNullException(nameof(dictionary)))
.ToDictionary(
(pair => pair.Key),
(pair => new RegexMultiBranchBranch<T>(pair.Key, pair.Value))
)
)
{ }
protected RegexMultiBranchBranchCollection(IDictionary<RegexMultiBranchBranchPredicate<T>, RegexMultiBranchBranch<T>> dictionary) =>
this.innerDic = dictionary ?? throw new ArgumentNullException(nameof(dictionary));
public RegexObject<T> this[RegexMultiBranchBranchPredicate<T> key]
{
get => this.innerDic[key].Pattern;
set => this.innerDic[key].Pattern = value;
}
#region Predicates
/// <summary>
/// 获取 <see cref="RegexMultiBranchBranchCollection{T}"/> 的检测条件集合。
/// </summary>
public ICollection<RegexMultiBranchBranchPredicate<T>> Predicates => this.innerDic.Keys;
ICollection<RegexMultiBranchBranchPredicate<T>> IDictionary<RegexMultiBranchBranchPredicate<T>, RegexObject<T>>.Keys => this.Predicates;
#endregion
#region Patterns
/// <summary>
/// 获取 <see cref="RegexMultiBranchBranchCollection{T}"/> 的正则模式集合。
/// </summary>
public ICollection<RegexObject<T>> Patterns => new ReadOnlyCollection<RegexObject<T>>(this.innerDic.Values.Select(branch => branch.Pattern).ToList());
ICollection<RegexObject<T>> IDictionary<RegexMultiBranchBranchPredicate<T>, RegexObject<T>>.Values => this.Patterns;
#endregion
/// <summary>
/// 获取 <see cref="RegexMultiBranchBranchCollection{T}"/> 包含的元素数。
/// </summary>
public int Count => this.innerDic.Count;
#region IsReadOnly
bool ICollection<RegexMultiBranchBranch<T>>.IsReadOnly => this.innerDic.IsReadOnly;
bool ICollection<KeyValuePair<RegexMultiBranchBranchPredicate<T>, RegexObject<T>>>.IsReadOnly => this.innerDic.IsReadOnly;
#endregion
#region Add
public void Add(RegexMultiBranchBranchPredicate<T> key, RegexObject<T> value) =>
this.innerDic.Add(key, new RegexMultiBranchBranch<T>(key, value));
public void Add(RegexMultiBranchBranch<T> branch) =>
this.innerDic.Add(branch.Predicate, branch);
void ICollection<KeyValuePair<RegexMultiBranchBranchPredicate<T>, RegexObject<T>>>.Add(KeyValuePair<RegexMultiBranchBranchPredicate<T>, RegexObject<T>> item) =>
this.Add(item.Key, item.Value);
#endregion
public void Clear() => this.innerDic.Clear();
#region Contains
public bool Contains(RegexMultiBranchBranch<T> branch)
{
if (branch == null) throw new ArgumentNullException(nameof(branch));
return this.ContainsPredicate(branch.Predicate) &&
EqualityComparer<RegexMultiBranchBranch<T>>.Default.Equals(branch, this.innerDic[branch.Predicate]);
}
bool ICollection<KeyValuePair<RegexMultiBranchBranchPredicate<T>, RegexObject<T>>>.Contains(KeyValuePair<RegexMultiBranchBranchPredicate<T>, RegexObject<T>> item) =>
this.ContainsPredicate(item.Key) && EqualityComparer<RegexObject<T>>.Default.Equals(this[item.Key], item.Value);
#endregion
#region ContainsPredicate
public bool ContainsPredicate(RegexMultiBranchBranchPredicate<T> predicate) =>
this.innerDic.ContainsKey(predicate);
bool IDictionary<RegexMultiBranchBranchPredicate<T>, RegexObject<T>>.ContainsKey(RegexMultiBranchBranchPredicate<T> key) =>
this.ContainsPredicate(key);
#endregion
#region CopyTo
public void CopyTo(RegexMultiBranchBranch<T>[] array, int arrayIndex)
{
if (array == null) throw new ArgumentNullException(nameof(array));
if (arrayIndex < 0 || arrayIndex > array.Length) throw new ArgumentOutOfRangeException(nameof(arrayIndex), arrayIndex, $"{nameof(arrayIndex)} 的值小于 0 。");
if (array.Length - arrayIndex < this.Count) throw new ArgumentException($"源 {typeof(RegexMultiBranchBranchPredicate<T>).FullName} 中的元素数目大于从目标 {nameof(array)} 的 {nameof(arrayIndex)} 从头到尾的可用空间。");
var pairArray = new KeyValuePair<RegexMultiBranchBranchPredicate<T>, RegexMultiBranchBranch<T>>[array.Length];
this.innerDic.CopyTo(pairArray, arrayIndex);
for (int i = arrayIndex; i < array.Length; i++)
array[i] = new RegexMultiBranchBranch<T>(pairArray[i].Key, pairArray[i].Value.Pattern);
}
void ICollection<KeyValuePair<RegexMultiBranchBranchPredicate<T>, RegexObject<T>>>.CopyTo(KeyValuePair<RegexMultiBranchBranchPredicate<T>, RegexObject<T>>[] array, int arrayIndex)
{
if (array == null) throw new ArgumentNullException(nameof(array));
if (arrayIndex < 0 || arrayIndex > array.Length) throw new ArgumentOutOfRangeException(nameof(arrayIndex), arrayIndex, $"{nameof(arrayIndex)} 的值小于 0 。");
if (array.Length - arrayIndex < this.Count) throw new ArgumentException($"源 {typeof(RegexMultiBranchBranchPredicate<T>).FullName} 中的元素数目大于从目标 {nameof(array)} 的 {nameof(arrayIndex)} 从头到尾的可用空间。");
var pairArray = new KeyValuePair<RegexMultiBranchBranchPredicate<T>, RegexMultiBranchBranch<T>>[array.Length];
this.innerDic.CopyTo(pairArray, arrayIndex);
for (int i = arrayIndex; i < array.Length; i++)
array[i] = new KeyValuePair<RegexMultiBranchBranchPredicate<T>, RegexObject<T>>(pairArray[i].Key, pairArray[i].Value.Pattern);
}
#endregion
#region GetEnumerator
/// <summary>
/// 返回一个循环访问集合的枚举器。
/// </summary>
/// <returns>用于循环访问集合的枚举数。</returns>
public IEnumerator<RegexMultiBranchBranch<T>> GetEnumerator()
{
var enumerator = this.innerDic.GetEnumerator();
while (enumerator.MoveNext())
{
var current = enumerator.Current;
yield return new RegexMultiBranchBranch<T>(current.Key, current.Value.Pattern);
}
}
IEnumerator<KeyValuePair<RegexMultiBranchBranchPredicate<T>, RegexObject<T>>> IEnumerable<KeyValuePair<RegexMultiBranchBranchPredicate<T>, RegexObject<T>>>.GetEnumerator()
{
var enumerator = this.innerDic.GetEnumerator();
while (enumerator.MoveNext())
{
var current = enumerator.Current;
yield return new KeyValuePair<RegexMultiBranchBranchPredicate<T>, RegexObject<T>>(current.Key, current.Value.Pattern);
}
}
#endregion
#region
public bool Remove(RegexMultiBranchBranchPredicate<T> key) => this.innerDic.Remove(key);
public bool Remove(RegexMultiBranchBranch<T> branch)
{
if (branch == null) throw new ArgumentNullException(nameof(branch));
if (this.Contains(branch))
{
this.Remove(branch.Predicate);
return true;
}
else return false;
}
bool ICollection<KeyValuePair<RegexMultiBranchBranchPredicate<T>, RegexObject<T>>>.Remove(KeyValuePair<RegexMultiBranchBranchPredicate<T>, RegexObject<T>> item)
{
if (((ICollection<KeyValuePair<RegexMultiBranchBranchPredicate<T>, RegexObject<T>>>)this).Contains(item))
{
this.Remove(item.Key);
return true;
}
else return false;
}
#endregion
public bool TryGetValue(RegexMultiBranchBranchPredicate<T> key, out RegexObject<T> value)
{
if (this.ContainsPredicate(key))
{
value = this[key];
return true;
}
else
{
value = null;
return false;
}
}
IEnumerator IEnumerable.GetEnumerator() => this.GetEnumerator();
}
}
|
lufengfan/SamLu.RegularExpression
|
src/SamLu.RegularExpression/Extend/RegexMultiBranchBranchCollection.cs
|
C#
|
mit
| 9,630
|
/*******************************************************************************
* The MIT License (MIT)
*
* Copyright (c) 2015 Igor Deplano
*
* 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 it.polito.ai.polibox.web.controllers.authentication;
import it.polito.ai.polibox.persistency.model.DeviceLogin;
import it.polito.ai.polibox.persistency.model.dao.DeviceLoginDao;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;
/**
* questo filtro si occupa di autenticare ogni richiesta che viene fatta per il
* servizio rest.
*
* @author "Igor Deplano"
*
*/
@Component("customSecurityAuthenticationInterceptor")
public class CustomSecurityAuthenticationInterceptor implements HandlerInterceptor {
@Autowired
private DeviceLoginDao deviceLoginDao;
public CustomSecurityAuthenticationInterceptor() {
}
public boolean preHandle(HttpServletRequest request,
HttpServletResponse response, Object handler) throws Exception {
DeviceLogin d=deviceLoginDao.authenticateDevice(Integer.parseInt(request.getHeader("user")),
Integer.parseInt(request.getHeader("device")),
request.getHeader("password"));
if(d!=null){
if(d.getUser()==Integer.parseInt(request.getHeader("user")))
return true;
}
return false;
}
public void postHandle(HttpServletRequest request,
HttpServletResponse response, Object handler,
ModelAndView modelAndView) throws Exception {
}
public void afterCompletion(HttpServletRequest request,
HttpServletResponse response, Object handler, Exception ex)
throws Exception {
}
public DeviceLoginDao getDeviceLoginDao() {
return deviceLoginDao;
}
public void setDeviceLoginDao(DeviceLoginDao deviceLoginDao) {
this.deviceLoginDao = deviceLoginDao;
}
}
|
IDepla/polibox
|
src/main/java/it/polito/ai/polibox/web/controllers/authentication/CustomSecurityAuthenticationInterceptor.java
|
Java
|
mit
| 3,118
|
//****************************************************************************
// Fichier: GridHelp.cpp
// Classe: CGridHelp
// Usage:
//
// To use CGridHelp. There are 3 steps:
// 1) initialization of the DLL with the method : Initialize
// 2) Open a grid and used it :
// Open
// GetValue
// GetNbCols
// GetNbRows
// 3) Close de grid: Close
//
//****************************************************************************
// 03-04-2006 Rémi Saint-Amant Initial version
//****************************************************************************
#include "stdafx.h"
#include <crtdbg.h>
#include <windows.h>
#include "Basic/UtilStd.h"
#include "ModelBase/GridHelp.h"
namespace WBSF
{
//****************************************************************************
// Summary: Constructor
//
// Description: To Create and initialize an object
//
// Input:
//
// Output:
//
// Note:
//****************************************************************************
CGridHelp::CGridHelp()
{
m_hDll = NULL;
m_OpenFunction = NULL;
m_CloseFunction = NULL;
m_GetNbColsFunction = NULL;
m_GetNbRowsFunction = NULL;
m_GetValueFunction = NULL;
m_GetValueLatLonFunction = NULL;
}
//****************************************************************************
// Summary: Destructor
//
// Description: Destroy and clean memory
//
// Input:
//
// Output:
//
// Note:
//****************************************************************************
CGridHelp::~CGridHelp()
{
if (m_hDll)
{
FreeLibrary((HMODULE)m_hDll);
m_hDll = NULL;
}
m_OpenFunction = NULL;
m_GetNbColsFunction = NULL;
m_GetNbRowsFunction = NULL;
m_GetValueFunction = NULL;
m_GetValueLatLonFunction = NULL;
m_CloseFunction = NULL;
}
//****************************************************************************
// Summary: initialize the class
//
// Description: initialize the dll with file path
//
// Input: DLLFilePath : the file path of the dll (tempGenLib.dll)
//
// Output: ERMsg : error message
//
// Note:
//****************************************************************************
ERMsg CGridHelp::Initialize(const char* DLLFilePath)
{
ERMsg message;
if (m_hDll)
{
//if a dll is loaded : free
FreeLibrary((HMODULE)m_hDll);
m_hDll = NULL;
}
//load dll
m_hDll = LoadLibraryW(convert(DLLFilePath).c_str());
if (m_hDll != NULL)
{
//if loaded : load function
m_OpenFunction = (OpenFunction)GetProcAddress((HMODULE)m_hDll, "Open");
m_CloseFunction = (CloseFunction)GetProcAddress((HMODULE)m_hDll, "Close");
m_GetNbColsFunction = (GetNbColsFunction)GetProcAddress((HMODULE)m_hDll, "GetNbCols");
m_GetNbRowsFunction = (GetNbRowsFunction)GetProcAddress((HMODULE)m_hDll, "GetNbRows");
m_GetValueFunction = (GetValueFunction)GetProcAddress((HMODULE)m_hDll, "GetValue");
m_GetValueLatLonFunction = (GetValueLatLonFunction)GetProcAddress((HMODULE)m_hDll, "GetValueLatLon");
}
else
{
message.asgType(ERMsg::ERREUR);
message.ajoute("error");
}
return message;
}
//****************************************************************************
// Summary: Open a grid
//
// Description: Open a grid for reading
//
// Input: filePath : the file path of the grid
//
// Output: ERMsg : error message
//
// Note:
//****************************************************************************
ERMsg CGridHelp::Open(const char* filePath)
{
_ASSERTE(m_OpenFunction != NULL);
ERMsg message;
char messageOut[1024] = { 0 };
if (!m_OpenFunction(filePath, messageOut))
{
message.asgType(ERMsg::ERREUR);
message.ajoute(messageOut);
}
return message;
}
//****************************************************************************
// Summary: Close a grid
//
// Description: Close a grid
//
// Input:
//
// Output:
//
// Note:
//****************************************************************************
void CGridHelp::Close()
{
_ASSERTE(m_CloseFunction != NULL);
m_CloseFunction();
}
//****************************************************************************
// Summary: Get the number of columns
//
// Description: Get the number of columns of the open grid
//
// Input:
//
// Output: the number of cols
//
// Note:
//****************************************************************************
long CGridHelp::GetNbCols()
{
_ASSERTE(m_GetNbColsFunction != NULL);
ERMsg message;
return m_GetNbColsFunction();
}
//****************************************************************************
// Summary: Get the number of rows
//
// Description: Get the number of rows of the open grid
//
// Input:
//
// Output: the number of rows
//
// Note:
//****************************************************************************
long CGridHelp::GetNbRows()
{
_ASSERTE(m_GetNbRowsFunction != NULL);
return m_GetNbRowsFunction();
}
//****************************************************************************
// Summary: Get the values
//
// Description: Get the value of a cell at the position col, row
//
// Input: col: the columns
// row: the rows
//
// Output: The value of the cell
//
// Note:
//
//****************************************************************************
double CGridHelp::GetValue(long col, long row)
{
_ASSERTE(m_GetValueFunction != NULL);
return m_GetValueFunction(col, row);
}
//****************************************************************************
// Summary: Get the values
//
// Description: Get the value of a cell at the position lat lon in decimal degrre
//
// Input: lat: latitude in degree of the cell. Negatif for southern coord.
// lon: longitude in degree of the cell. Negatif for western coord.
//
// Output: The value of the cell
//
// Note: ever if the grid is projected, the coordinate are always in degree
//
//****************************************************************************
double CGridHelp::GetValueLatLon(const double& lat, const double& lon)
{
_ASSERTE(m_GetValueLatLonFunction != NULL);
return m_GetValueLatLonFunction(lat, lon);
}
}
|
RNCan/WeatherBasedSimulationFramework
|
wbs/src/ModelBase/GridHelp.cpp
|
C++
|
mit
| 6,502
|
import logging
import time
import os
from fuocore.models import (
BaseModel,
SongModel,
LyricModel,
PlaylistModel,
AlbumModel,
ArtistModel,
SearchModel,
UserModel,
)
from .provider import provider
logger = logging.getLogger(__name__)
MUSIC_LIBRARY_PATH = os.path.expanduser('~') + '/Music'
class NBaseModel(BaseModel):
# FIXME: remove _detail_fields and _api to Meta
_api = provider.api
class Meta:
allow_get = True
provider = provider
class NSongModel(SongModel, NBaseModel):
@classmethod
def get(cls, identifier):
data = cls._api.song_detail(int(identifier))
song, _ = NeteaseSongSchema(strict=True).load(data)
return song
@classmethod
def list(cls, identifiers):
song_data_list = cls._api.songs_detail(identifiers)
songs = []
for song_data in song_data_list:
song, _ = NeteaseSongSchema(strict=True).load(song_data)
songs.append(song)
return songs
def _refresh_url(self):
"""刷新获取 url,失败的时候返回空而不是 None"""
songs = self._api.weapi_songs_url([int(self.identifier)])
if songs and songs[0]['url']:
self.url = songs[0]['url']
else:
self.url = ''
def _find_in_local(self):
# TODO: make this a API in SongModel
path = os.path.join(MUSIC_LIBRARY_PATH, self.filename)
if os.path.exists(path):
logger.debug('find local file for {}'.format(self))
return path
return None
# NOTE: if we want to override model attribute, we must
# implement both getter and setter.
@property
def url(self):
"""
We will always check if this song file exists in local library,
if true, we return the url of the local file.
.. note::
As netease song url will be expired after a period of time,
we can not use static url here. Currently, we assume that the
expiration time is 20 minutes, after the url expires, it
will be automaticly refreshed.
"""
local_path = self._find_in_local()
if local_path:
return local_path
if not self._url:
self._refresh_url()
elif time.time() > self._expired_at:
logger.info('song({}) url is expired, refresh...'.format(self))
self._refresh_url()
return self._url
@url.setter
def url(self, value):
self._expired_at = time.time() + 60 * 20 * 1 # 20 minutes
self._url = value
@property
def lyric(self):
if self._lyric is not None:
assert isinstance(self._lyric, LyricModel)
return self._lyric
data = self._api.get_lyric_by_songid(self.identifier)
lrc = data.get('lrc', {})
lyric = lrc.get('lyric', '')
self._lyric = LyricModel(
identifier=self.identifier,
content=lyric
)
return self._lyric
@lyric.setter
def lyric(self, value):
self._lyric = value
class NAlbumModel(AlbumModel, NBaseModel):
@classmethod
def get(cls, identifier):
album_data = cls._api.album_infos(identifier)
if album_data is None:
return None
album, _ = NeteaseAlbumSchema(strict=True).load(album_data)
return album
@property
def desc(self):
if self._desc is None:
self._desc = self._api.album_desc(self.identifier)
return self._desc
@desc.setter
def desc(self, value):
self._desc = value
class NArtistModel(ArtistModel, NBaseModel):
@classmethod
def get(cls, identifier):
artist_data = cls._api.artist_infos(identifier)
artist = artist_data['artist']
artist['songs'] = artist_data['hotSongs'] or []
artist, _ = NeteaseArtistSchema(strict=True).load(artist)
return artist
@property
def desc(self):
if self._desc is None:
self._desc = self._api.artist_desc(self.identifier)
return self._desc
@desc.setter
def desc(self, value):
self._desc = value
class NPlaylistModel(PlaylistModel, NBaseModel):
class Meta:
fields = ('uid')
@classmethod
def get(cls, identifier):
data = cls._api.playlist_detail(identifier)
playlist, _ = NeteasePlaylistSchema(strict=True).load(data)
return playlist
def add(self, song_id, allow_exist=True):
rv = self._api.op_music_to_playlist(song_id, self.identifier, 'add')
if rv == 1:
song = NSongModel.get(song_id)
self.songs.append(song)
return True
elif rv == -1:
return True
return False
def remove(self, song_id, allow_not_exist=True):
rv = self._api.op_music_to_playlist(song_id, self.identifier, 'del')
if rv != 1:
return False
# XXX: make it O(1) if you want
for song in self.songs:
if song.identifier == song_id:
self.songs.remove(song)
return True
class NSearchModel(SearchModel, NBaseModel):
pass
class NUserModel(UserModel, NBaseModel):
class Meta:
fields = ('cookies', )
fields_no_get = ('cookies', )
@classmethod
def get(cls, identifier):
user = {'id': identifier}
user_brief = cls._api.user_brief(identifier)
user.update(user_brief)
playlists = cls._api.user_playlists(identifier)
user['playlists'] = []
user['fav_playlists'] = []
for pl in playlists:
if pl['userId'] == identifier:
user['playlists'].append(pl)
else:
user['fav_playlists'].append(pl)
user, _ = NeteaseUserSchema(strict=True).load(user)
return user
def search(keyword, **kwargs):
_songs = provider.api.search(keyword)
id_song_map = {}
songs = []
if _songs:
for song in _songs:
id_song_map[str(song['id'])] = song
schema = NeteaseSongSchema(strict=True)
s, _ = schema.load(song)
songs.append(s)
return NSearchModel(q=keyword, songs=songs)
# import loop
from .schemas import (
NeteaseSongSchema,
NeteaseAlbumSchema,
NeteaseArtistSchema,
NeteasePlaylistSchema,
NeteaseUserSchema,
) # noqa
|
cosven/feeluown-core
|
fuocore/netease/models.py
|
Python
|
mit
| 6,421
|
import deepFreeze from 'deep-freeze';
import article_details from '../../app/assets/javascripts/reducers/article_details';
import { RECEIVE_ARTICLE_DETAILS } from '../../app/assets/javascripts/constants/article_details';
import '../testHelper';
describe('article_details reducer', () => {
it('Should return initial state if no action type matches', () => {
const mockAction = {
type: 'NO_TYPE'
};
const initialState = {};
deepFreeze(initialState);
const result = article_details(undefined, mockAction);
expect(result).to.deep.eq(initialState);
});
it('should reutrn a new state if action type is RECEIVE_ARTICLE_DETAILS', () => {
const mockAction = {
type: RECEIVE_ARTICLE_DETAILS,
articleId: 586,
data: {
article_details: 'best article ever'
}
};
const expectedState = {
586: 'best article ever'
};
expect(article_details(undefined, mockAction)).to.deep.eq(expectedState);
});
});
|
sejalkhatri/WikiEduDashboard
|
test/reducers/article_details.spec.js
|
JavaScript
|
mit
| 981
|
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "kirppu_project.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
|
jlaunonen/kirppu
|
manage.py
|
Python
|
mit
| 257
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace _2.Array_Elements_Egual_To_Their_Index
{
class arrElementEgualIndex
{
static void Main(string[] args)
{
int[] array = Console.ReadLine().Split(' ')
.Select(int.Parse).ToArray();
for (int i = 0; i < array.Length; i++)
{
if (array[i] == i)
{
Console.Write(array[i] + " ");
}
}
Console.WriteLine();
}
}
}
|
NedkoNedevv/Fundamentals
|
Arrays - More Exercises/2.Array Elements Egual To Their Index/arrElementEgualIndex.cs
|
C#
|
mit
| 613
|
# codekit-scanner
```
$ npm install codekit-scanner
```
Scans Codekit dependencies of a core JS file like
```
// @codekit-prepend 'js/framework.utilities.js'
// @codekit-prepend 'js/framework.file.js'
// @codekit-prepend 'core.config.js'
(function(){
console.log("Hello World, I am core.js");
})()
// @codekit-append 'modules/module.js'
// @codekit-append 'views/view.js'
```
Resolves dependencies by local JS directory and framework directory just like Codekit does.
## Gulp Integration
```
var codekit = require('codekit-scanner');
gulp.task('default', function () {
codekit({file: 'js/core.js', fw: 'external/UIFramework', jsDir : 'js'}, function(files){
console.log('files',files);
gulp.src(files)
.pipe(sourcemaps.init())
.pipe(uglify())
.pipe(concat('core-min.js'))
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('dist/js'));
});
});
```
|
ukuhnhardt/codekit-scanner
|
README.md
|
Markdown
|
mit
| 935
|
package org.openapitools.client.model
case class FreeStyleProject (
_class: Option[String],
_name: Option[String],
_url: Option[String],
_color: Option[String],
_actions: Option[List[FreeStyleProjectactions]],
_description: Option[String],
_displayName: Option[String],
_displayNameOrNull: Option[String],
_fullDisplayName: Option[String],
_fullName: Option[String],
_buildable: Option[Boolean],
_builds: Option[List[FreeStyleBuild]],
_firstBuild: Option[FreeStyleBuild],
_healthReport: Option[List[FreeStyleProjecthealthReport]],
_inQueue: Option[Boolean],
_keepDependencies: Option[Boolean],
_lastBuild: Option[FreeStyleBuild],
_lastCompletedBuild: Option[FreeStyleBuild],
_lastFailedBuild: Option[String],
_lastStableBuild: Option[FreeStyleBuild],
_lastSuccessfulBuild: Option[FreeStyleBuild],
_lastUnstableBuild: Option[String],
_lastUnsuccessfulBuild: Option[String],
_nextBuildNumber: Option[Integer],
_queueItem: Option[String],
_concurrentBuild: Option[Boolean],
_scm: Option[NullSCM]
)
object FreeStyleProject {
def toStringBody(var_class: Object, var_name: Object, var_url: Object, var_color: Object, var_actions: Object, var_description: Object, var_displayName: Object, var_displayNameOrNull: Object, var_fullDisplayName: Object, var_fullName: Object, var_buildable: Object, var_builds: Object, var_firstBuild: Object, var_healthReport: Object, var_inQueue: Object, var_keepDependencies: Object, var_lastBuild: Object, var_lastCompletedBuild: Object, var_lastFailedBuild: Object, var_lastStableBuild: Object, var_lastSuccessfulBuild: Object, var_lastUnstableBuild: Object, var_lastUnsuccessfulBuild: Object, var_nextBuildNumber: Object, var_queueItem: Object, var_concurrentBuild: Object, var_scm: Object) =
s"""
| {
| "class":$var_class,"name":$var_name,"url":$var_url,"color":$var_color,"actions":$var_actions,"description":$var_description,"displayName":$var_displayName,"displayNameOrNull":$var_displayNameOrNull,"fullDisplayName":$var_fullDisplayName,"fullName":$var_fullName,"buildable":$var_buildable,"builds":$var_builds,"firstBuild":$var_firstBuild,"healthReport":$var_healthReport,"inQueue":$var_inQueue,"keepDependencies":$var_keepDependencies,"lastBuild":$var_lastBuild,"lastCompletedBuild":$var_lastCompletedBuild,"lastFailedBuild":$var_lastFailedBuild,"lastStableBuild":$var_lastStableBuild,"lastSuccessfulBuild":$var_lastSuccessfulBuild,"lastUnstableBuild":$var_lastUnstableBuild,"lastUnsuccessfulBuild":$var_lastUnsuccessfulBuild,"nextBuildNumber":$var_nextBuildNumber,"queueItem":$var_queueItem,"concurrentBuild":$var_concurrentBuild,"scm":$var_scm
| }
""".stripMargin
}
|
cliffano/swaggy-jenkins
|
clients/scala-gatling/generated/src/gatling/scala/org/openapitools/client/model/FreeStyleProject.scala
|
Scala
|
mit
| 2,755
|
# Greasemonkey Script for Harvest
Greasemonkey is a Firefox extension that allows you to customize the way webpages look and function.
http://www.greasespot.net/
This Script adds some custom Buttons Harvest
|
ymc-maha/grease-harvest
|
README.md
|
Markdown
|
mit
| 209
|
extern "C"
{
#include "lualib.h"
#include "lauxlib.h"
}
#include "tconstant.h"
int main (void)
{
int tolua_tconstant_open (lua_State*);
lua_State* L = lua_open();
luaL_openlibs(L);
tolua_tconstant_open(L);
luaL_dofile(L,"tconstant.lua");
lua_close(L);
return 0;
}
|
drupalhunter-team/TrackMonitor
|
ExternalComponents/Tolua/src/tests/tconstant.cpp
|
C++
|
mit
| 278
|
require 'test_helper'
class ResubmitTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end
|
garyhsieh/mturk-survey
|
test/unit/resubmit_test.rb
|
Ruby
|
mit
| 122
|
// ------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
// ------------------------------------------------------------------------------
// **NOTE** This file was generated by a tool and any changes will be overwritten.
namespace Microsoft.Graph
{
using System;
using System.Collections.Generic;
using System.IO;
/// <summary>
/// The interface IWorkbookFunctionsMultiNomialRequestBuilder.
/// </summary>
public partial interface IWorkbookFunctionsMultiNomialRequestBuilder
{
/// <summary>
/// Builds the request.
/// </summary>
/// <param name="options">The query and header options for the request.</param>
/// <returns>The built request.</returns>
IWorkbookFunctionsMultiNomialRequest Request(IEnumerable<Option> options = null);
}
}
|
garethj-msft/msgraph-sdk-dotnet
|
src/Microsoft.Graph/Requests/Generated/IWorkbookFunctionsMultiNomialRequestBuilder.cs
|
C#
|
mit
| 1,006
|
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using JigLibX.Vehicles;
using JigLibX.Collision;
namespace OurCity.PhysicObjects
{
class CarObject : PhysicObject
{
private Car car;
private Model wheel;
public CarObject(ConceptGameScreen game, Model model, Model wheels, bool FWDrive,
bool RWDrive,
float maxSteerAngle,
float steerRate,
float wheelSideFriction,
float wheelFwdFriction,
float wheelTravel,
float wheelRadius,
float wheelZOffset,
float wheelRestingFrac,
float wheelDampingFrac,
int wheelNumRays,
float driveTorque,
float gravity)
: base(game, model)
{
car = new Car(FWDrive, RWDrive, maxSteerAngle, steerRate,
wheelSideFriction, wheelFwdFriction, wheelTravel, wheelRadius,
wheelZOffset, wheelRestingFrac, wheelDampingFrac,
wheelNumRays, driveTorque, gravity);
this.body = car.Chassis.Body;
this.collision = car.Chassis.Skin;
this.wheel = wheels;
SetCarMass(100.0f);
}
private void DrawWheel(Wheel wh, bool rotated)
{
Camera camera = GameplayScreen.Camera;
foreach (ModelMesh mesh in wheel.Meshes)
{
foreach (BasicEffect effect in mesh.Effects)
{
float steer = wh.SteerAngle;
Matrix rot;
if (rotated) rot = Matrix.CreateRotationY(MathHelper.ToRadians(180.0f));
else rot = Matrix.Identity;
effect.World = rot * Matrix.CreateRotationZ(MathHelper.ToRadians(-wh.AxisAngle)) * // rotate the wheels
Matrix.CreateRotationY(MathHelper.ToRadians(steer)) *
Matrix.CreateTranslation(wh.Pos + wh.Displacement * wh.LocalAxisUp) * car.Chassis.Body.Orientation * // oritentation of wheels
Matrix.CreateTranslation(car.Chassis.Body.Position); // translation
effect.View = camera.View;
effect.Projection = camera.Projection;
effect.EnableDefaultLighting();
effect.PreferPerPixelLighting = true;
}
mesh.Draw();
}
}
public override void Draw(GameTime gameTime)
{
DrawWheel(car.Wheels[0], true);
DrawWheel(car.Wheels[1], true);
DrawWheel(car.Wheels[2], false);
DrawWheel(car.Wheels[3], false);
base.Draw(gameTime);
}
public Car Car
{
get { return this.car; }
}
private void SetCarMass(float mass)
{
body.Mass = mass;
Vector3 min, max;
car.Chassis.GetDims(out min, out max);
Vector3 sides = max - min;
float Ixx = (1.0f / 12.0f) * mass * (sides.Y * sides.Y + sides.Z * sides.Z);
float Iyy = (1.0f / 12.0f) * mass * (sides.X * sides.X + sides.Z * sides.Z);
float Izz = (1.0f / 12.0f) * mass * (sides.X * sides.X + sides.Y * sides.Y);
Matrix inertia = Matrix.Identity;
inertia.M11 = Ixx; inertia.M22 = Iyy; inertia.M33 = Izz;
car.Chassis.Body.BodyInertia = inertia;
car.SetupDefaultWheels();
}
public override void ApplyEffects(BasicEffect effect)
{
//
}
}
}
|
mrq-cz/ourcity
|
OurCity/OurCity/OurCity/PhysicObjects/CarObject.cs
|
C#
|
mit
| 3,827
|
// 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 <_AVATOR_DATADetail.hpp>
#include <common/ATFCore.hpp>
START_ATF_NAMESPACE
namespace Register
{
class _AVATOR_DATARegister : public IRegister
{
public:
void Register() override
{
auto& hook_core = CATFCore::get_instance();
for (auto& r : Detail::_AVATOR_DATA_functions)
hook_core.reg_wrapper(r.pBind, r);
}
};
}; // end namespace Register
END_ATF_NAMESPACE
|
goodwinxp/Yorozuya
|
library/ATF/_AVATOR_DATARegister.hpp
|
C++
|
mit
| 679
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Login Page - Photon Admin Panel Theme</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
<link rel="shortcut icon" href="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/bootstrap/css/css_compiled/css/css_compiled/js/plugins/favicon.ico"/>
<link rel="apple-touch-icon" href="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/bootstrap/css/css_compiled/css/css_compiled/js/plugins/iosicon.png"/>
<link rel="stylesheet" href="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/bootstrap/css/css_compiled/css/css_compiled/js/plugins/css/css_compiled/photon-min.css?v1.1" media="all"/>
<link rel="stylesheet" href="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/bootstrap/css/css_compiled/css/css_compiled/js/plugins/css/css_compiled/photon-min-part2.css?v1.1" media="all"/>
<link rel="stylesheet" href="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/bootstrap/css/css_compiled/css/css_compiled/js/plugins/css/css_compiled/photon-responsive-min.css?v1.1" media="all"/>
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="css/css_compiled/ie-only-min.css?v1.1" />
<![endif]-->
<!--[if lt IE 9]>
<link rel="stylesheet" type="text/css" href="css/css_compiled/ie8-only-min.css?v1.1" />
<script type="text/javascript" src="js/plugins/excanvas.js"></script>
<script type="text/javascript" src="js/plugins/html5shiv.js"></script>
<script type="text/javascript" src="js/plugins/respond.min.js"></script>
<script type="text/javascript" src="js/plugins/fixFontIcons.js"></script>
<![endif]-->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.0/jquery-ui.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/bootstrap/css/css_compiled/css/css_compiled/js/plugins/js/bootstrap/bootstrap.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/bootstrap/css/css_compiled/css/css_compiled/js/plugins/js/plugins/modernizr.custom.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/bootstrap/css/css_compiled/css/css_compiled/js/plugins/js/plugins/jquery.pnotify.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/bootstrap/css/css_compiled/css/css_compiled/js/plugins/js/plugins/less-1.3.1.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/bootstrap/css/css_compiled/css/css_compiled/js/plugins/js/plugins/xbreadcrumbs.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/bootstrap/css/css_compiled/css/css_compiled/js/plugins/js/plugins/jquery.maskedinput-1.3.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/bootstrap/css/css_compiled/css/css_compiled/js/plugins/js/plugins/jquery.autotab-1.1b.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/bootstrap/css/css_compiled/css/css_compiled/js/plugins/js/plugins/charCount.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/bootstrap/css/css_compiled/css/css_compiled/js/plugins/js/plugins/jquery.textareaCounter.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/bootstrap/css/css_compiled/css/css_compiled/js/plugins/js/plugins/elrte.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/bootstrap/css/css_compiled/css/css_compiled/js/plugins/js/plugins/elrte.en.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/bootstrap/css/css_compiled/css/css_compiled/js/plugins/js/plugins/select2.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/bootstrap/css/css_compiled/css/css_compiled/js/plugins/js/plugins/jquery-picklist.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/bootstrap/css/css_compiled/css/css_compiled/js/plugins/js/plugins/jquery.validate.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/bootstrap/css/css_compiled/css/css_compiled/js/plugins/js/plugins/additional-methods.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/bootstrap/css/css_compiled/css/css_compiled/js/plugins/js/plugins/jquery.form.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/bootstrap/css/css_compiled/css/css_compiled/js/plugins/js/plugins/jquery.metadata.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/bootstrap/css/css_compiled/css/css_compiled/js/plugins/js/plugins/jquery.mockjax.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/bootstrap/css/css_compiled/css/css_compiled/js/plugins/js/plugins/jquery.uniform.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/bootstrap/css/css_compiled/css/css_compiled/js/plugins/js/plugins/jquery.tagsinput.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/bootstrap/css/css_compiled/css/css_compiled/js/plugins/js/plugins/jquery.rating.pack.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/bootstrap/css/css_compiled/css/css_compiled/js/plugins/js/plugins/farbtastic.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/bootstrap/css/css_compiled/css/css_compiled/js/plugins/js/plugins/jquery.timeentry.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/bootstrap/css/css_compiled/css/css_compiled/js/plugins/js/plugins/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/bootstrap/css/css_compiled/css/css_compiled/js/plugins/js/plugins/jquery.jstree.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/bootstrap/css/css_compiled/css/css_compiled/js/plugins/js/plugins/dataTables.bootstrap.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/bootstrap/css/css_compiled/css/css_compiled/js/plugins/js/plugins/jquery.mousewheel.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/bootstrap/css/css_compiled/css/css_compiled/js/plugins/js/plugins/jquery.mCustomScrollbar.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/bootstrap/css/css_compiled/css/css_compiled/js/plugins/js/plugins/jquery.flot.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/bootstrap/css/css_compiled/css/css_compiled/js/plugins/js/plugins/jquery.flot.stack.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/bootstrap/css/css_compiled/css/css_compiled/js/plugins/js/plugins/jquery.flot.pie.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/bootstrap/css/css_compiled/css/css_compiled/js/plugins/js/plugins/jquery.flot.resize.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/bootstrap/css/css_compiled/css/css_compiled/js/plugins/js/plugins/raphael.2.1.0.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/bootstrap/css/css_compiled/css/css_compiled/js/plugins/js/plugins/justgage.1.0.1.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/bootstrap/css/css_compiled/css/css_compiled/js/plugins/js/plugins/jquery.qrcode.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/bootstrap/css/css_compiled/css/css_compiled/js/plugins/js/plugins/jquery.clock.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/bootstrap/css/css_compiled/css/css_compiled/js/plugins/js/plugins/jquery.countdown.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/bootstrap/css/css_compiled/css/css_compiled/js/plugins/js/plugins/jquery.jqtweet.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/bootstrap/css/css_compiled/css/css_compiled/js/plugins/js/plugins/jquery.cookie.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/bootstrap/css/css_compiled/css/css_compiled/js/plugins/js/plugins/bootstrap-fileupload.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/bootstrap/css/css_compiled/css/css_compiled/js/plugins/js/plugins/prettify/prettify.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/bootstrap/css/css_compiled/css/css_compiled/js/plugins/js/plugins/bootstrapSwitch.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/bootstrap/css/css_compiled/css/css_compiled/js/plugins/js/plugins/mfupload.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/bootstrap/css/css_compiled/css/css_compiled/js/plugins/js/common.js"></script>
</head>
<body class="body-login">
<div class="nav-fixed-topright" style="visibility: hidden">
<ul class="nav nav-user-menu">
<li class="user-sub-menu-container">
<a href="javascript:;">
<i class="user-icon"></i><span class="nav-user-selection">Theme Options</span><i class="icon-menu-arrow"></i>
</a>
<ul class="nav user-sub-menu">
<li class="light">
<a href="javascript:;">
<i class='icon-photon stop'></i>Light Version
</a>
</li>
<li class="dark">
<a href="javascript:;">
<i class='icon-photon stop'></i>Dark Version
</a>
</li>
</ul>
</li>
<li>
<a href="javascript:;">
<i class="icon-photon mail"></i>
</a>
</li>
<li>
<a href="javascript:;">
<i class="icon-photon comment_alt2_stroke"></i>
<div class="notification-count">12</div>
</a>
</li>
</ul>
</div>
<script>
$(function(){
setTimeout(function(){
$('.nav-fixed-topright').removeAttr('style');
}, 300);
$(window).scroll(function(){
if($('.breadcrumb-container').length){
var scrollState = $(window).scrollTop();
if (scrollState > 0) $('.nav-fixed-topright').addClass('nav-released');
else $('.nav-fixed-topright').removeClass('nav-released')
}
});
$('.user-sub-menu-container').on('click', function(){
$(this).toggleClass('active-user-menu');
});
$('.user-sub-menu .light').on('click', function(){
if ($('body').is('.light-version')) return;
$('body').addClass('light-version');
setTimeout(function() {
$.cookie('themeColor', 'light', {
expires: 7,
path: '/'
});
}, 500);
});
$('.user-sub-menu .dark').on('click', function(){
if ($('body').is('.light-version')) {
$('body').removeClass('light-version');
$.cookie('themeColor', 'dark', {
expires: 7,
path: '/'
});
}
});
});
</script>
<div class="container-login">
<div class="form-centering-wrapper">
<div class="form-window-login">
<div class="form-window-login-logo">
<div class="login-logo">
<img src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/bootstrap/css/css_compiled/css/css_compiled/js/plugins/images/photon/login-logo@2x.png" alt="Photon UI"/>
</div>
<h2 class="login-title">Welcome to Photon UI!</h2>
<div class="login-member">Not a Member? <a href="elrte.en.js.html#">Sign Up »</a>
<a href="elrte.en.js.html#" class="btn btn-facebook"><i class="icon-fb"></i>Login with Facebook<i class="icon-fb-arrow"></i></a>
</div>
<div class="login-or">Or</div>
<div class="login-input-area">
<form method="POST" action="dashboard.php">
<span class="help-block">Login With Your Photon Account</span>
<input type="text" name="email" placeholder="Email">
<input type="password" name="password" placeholder="Password">
<button type="submit" class="btn btn-large btn-success btn-login">Login</button>
</form>
<a href="elrte.en.js.html#" class="forgot-pass">Forgot Your Password?</a>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-1936460-27']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</body>
</html>
|
user-tony/photon-rails
|
lib/assets/images/photon/plugins/elrte/js/bootstrap/css/css_compiled/css/css_compiled/js/plugins/elrte.en.js.html
|
HTML
|
mit
| 14,373
|
var db = require('../models');
exports.checkItemsList = function (req, res, next) {
var data = {
items: []
};
db.Item.findAll().then(function (results) {
for (var i = 0; i < results.length; i++) {
data.items.push(results[i].dataValues);
}
// console.log(data.items);
console.log('items list controller working');
res.locals.items = data.items;
next();
}).catch(function (error) {
console.log(error);
console.log('items list controller error');
next();
});
};
|
yoonslee/project2-game
|
controllers/itemController.js
|
JavaScript
|
mit
| 522
|
# -*- coding: utf-8 -*-
# Copyright 2017-TODAY LasLabs Inc.
# License MIT (https://opensource.org/licenses/MIT).
import properties
from datetime import datetime, date
from ..base_model import BaseModel
class Domain(properties.HasProperties):
"""This represents a full search query."""
OR = 'OR'
AND = 'AND'
def __init__(self, queries=None, join_with=AND):
"""Initialize a domain, with optional queries."""
self.query = []
if queries is not None:
for query in queries:
self.add_query(query, join_with)
@classmethod
def from_tuple(cls, queries):
"""Create a ``Domain`` given a set of complex query tuples.
Args:
queries (iter): An iterator of complex queries. Each iteration
should contain either:
* A data-set compatible with :func:`~domain.Domain.add_query`
* A string to switch the join type
Example::
[('subject', 'Test1'),
'OR',
('subject', 'Test2')',
('subject', 'Test3')',
]
# The above is equivalent to:
# subject:'Test1' OR subject:'Test2' OR subject:'Test3'
[('modified_at', datetime(2017, 01, 01)),
('status', 'active'),
]
# The above is equivalent to:
# modified_at:[2017-01-01T00:00:00Z TO *]
# AND status:"active"
Returns:
Domain: A domain representing the input queries.
"""
domain = cls()
join_with = cls.AND
for query in queries:
if query in [cls.OR, cls.AND]:
join_with = query
else:
domain.add_query(query, join_with)
return domain
def add_query(self, query, join_with=AND):
"""Join a new query to existing queries on the stack.
Args:
query (tuple or list or DomainCondition): The condition for the
query. If a ``DomainCondition`` object is not provided, the
input should conform to the interface defined in
:func:`~.domain.DomainCondition.from_tuple`.
join_with (str): The join string to apply, if other queries are
already on the stack.
"""
if not isinstance(query, DomainCondition):
query = DomainCondition.from_tuple(query)
if len(self.query):
self.query.append(join_with)
self.query.append(query)
def __str__(self):
"""Return a string usable as the query in an API request."""
if not self.query:
return '*'
return '(%s)' % ' '.join([str(q) for q in self.query])
class DomainCondition(properties.HasProperties):
"""This represents one condition of a domain query."""
field = properties.String(
'Field to search on',
required=True,
)
value = properties.String(
'String Value',
required=True,
)
@property
def field_name(self):
"""Return the name of the API field."""
return BaseModel._to_camel_case(self.field)
def __init__(self, field, value, **kwargs):
"""Initialize a new generic query condition.
Args:
field (str): Field name to search on. This should be the
Pythonified name as in the internal models, not the
name as provided in the API e.g. ``first_name`` for
the Customer's first name instead of ``firstName``.
value (mixed): The value of the field.
"""
return super(DomainCondition, self).__init__(
field=field, value=value, **kwargs
)
@classmethod
def from_tuple(cls, query):
"""Create a condition from a query tuple.
Args:
query (tuple or list): Tuple or list that contains a query domain
in the format of ``(field_name, field_value,
field_value_to)``. ``field_value_to`` is only applicable in
the case of a date search.
Returns:
DomainCondition: An instance of a domain condition. The specific
type will depend on the data type of the first value provided
in ``query``.
"""
field, query = query[0], query[1:]
try:
cls = TYPES[type(query[0])]
except KeyError:
# We just fallback to the base class if unknown type.
pass
return cls(field, *query)
def __str__(self):
"""Return a string usable as a query part in an API request."""
return '%s:"%s"' % (self.field_name, self.value)
class DomainConditionBoolean(DomainCondition):
"""This represents an integer query."""
value = properties.Bool(
'Boolean Value',
required=True,
)
def __str__(self):
"""Return a string usable as a query part in an API request."""
value = 'true' if self.value else 'false'
return '%s:%s' % (self.field_name, value)
class DomainConditionInteger(DomainCondition):
"""This represents an integer query."""
value = properties.Integer(
'Integer Value',
required=True,
)
def __str__(self):
"""Return a string usable as a query part in an API request."""
return '%s:%d' % (self.field_name, self.value)
class DomainConditionDateTime(DomainCondition):
"""This represents a date time query."""
value = properties.DateTime(
'Date From',
required=True,
)
value_to = properties.DateTime(
'Date To',
)
def __init__(self, field, value_from, value_to=None):
"""Initialize a new datetime query condition.
Args:
field (str): Field name to search on. This should be the
Pythonified name as in the internal models, not the
name as provided in the API e.g. ``first_name`` for
the Customer's first name instead of ``firstName``.
value_from (date or datetime): The start value of the field.
value_to (date or datetime, optional): The ending value for
the field. If omitted, will search to now.
"""
return super(DomainConditionDateTime, self).__init__(
field=field, value=value_from, value_to=value_to,
)
def __str__(self):
"""Return a string usable as a query part in an API request."""
value_to = self.value_to.isoformat() if self.value_to else '*'
return '%s:[%sZ TO %sZ]' % (
self.field_name,
self.value.isoformat(),
value_to,
)
TYPES = {
bool: DomainConditionBoolean,
int: DomainConditionInteger,
date: DomainConditionDateTime,
datetime: DomainConditionDateTime,
}
__all__ = [
'Domain',
'DomainCondition',
'DomainConditionBoolean',
'DomainConditionDateTime',
'DomainConditionInteger',
]
|
LasLabs/python-helpscout
|
helpscout/domain/__init__.py
|
Python
|
mit
| 7,131
|
<?php
/**
* This is core configuration file.
*
* Use it to configure core behavior of Cake.
*
* @link http://cakephp.org CakePHP(tm) Project
* @package app.Config
* @since CakePHP(tm) v 0.2.9
*/
/**
* CakePHP Debug Level:
*
* Production Mode:
* 0: No error messages, errors, or warnings shown. Flash messages redirect.
*
* Development Mode:
* 1: Errors and warnings shown, model caches refreshed, flash messages halted.
* 2: As in 1, but also with full debug messages and SQL output.
*
* In production mode, flash messages redirect after a time interval.
* In development mode, you need to click the flash message to continue.
*/
Configure::write('debug', 2);
/**
* Configure the Error handler used to handle errors for your application. By default
* ErrorHandler::handleError() is used. It will display errors using Debugger, when debug > 0
* and log errors with CakeLog when debug = 0.
*
* Options:
*
* - `handler` - callback - The callback to handle errors. You can set this to any callable type,
* including anonymous functions.
* Make sure you add App::uses('MyHandler', 'Error'); when using a custom handler class
* - `level` - integer - The level of errors you are interested in capturing.
* - `trace` - boolean - Include stack traces for errors in log files.
*
* @see ErrorHandler for more information on error handling and configuration.
*/
Configure::write('Error', array(
'handler' => 'ErrorHandler::handleError',
'level' => E_ALL & ~E_DEPRECATED,
'trace' => true
));
/**
* Configure the Exception handler used for uncaught exceptions. By default,
* ErrorHandler::handleException() is used. It will display a HTML page for the exception, and
* while debug > 0, framework errors like Missing Controller will be displayed. When debug = 0,
* framework errors will be coerced into generic HTTP errors.
*
* Options:
*
* - `handler` - callback - The callback to handle exceptions. You can set this to any callback type,
* including anonymous functions.
* Make sure you add App::uses('MyHandler', 'Error'); when using a custom handler class
* - `renderer` - string - The class responsible for rendering uncaught exceptions. If you choose a custom class you
* should place the file for that class in app/Lib/Error. This class needs to implement a render method.
* - `log` - boolean - Should Exceptions be logged?
* - `skipLog` - array - list of exceptions to skip for logging. Exceptions that
* extend one of the listed exceptions will also be skipped for logging.
* Example: `'skipLog' => array('NotFoundException', 'UnauthorizedException')`
*
* @see ErrorHandler for more information on exception handling and configuration.
*/
Configure::write('Exception', array(
'handler' => 'ErrorHandler::handleException',
'renderer' => 'ExceptionRenderer',
'log' => true
));
/**
* Application wide charset encoding
*/
Configure::write('App.encoding', 'UTF-8');
/**
* To configure CakePHP *not* to use mod_rewrite and to
* use CakePHP pretty URLs, remove these .htaccess
* files:
*
* /.htaccess
* /app/.htaccess
* /app/webroot/.htaccess
*
* And uncomment the App.baseUrl below. But keep in mind
* that plugin assets such as images, CSS and JavaScript files
* will not work without URL rewriting!
* To work around this issue you should either symlink or copy
* the plugin assets into you app's webroot directory. This is
* recommended even when you are using mod_rewrite. Handling static
* assets through the Dispatcher is incredibly inefficient and
* included primarily as a development convenience - and
* thus not recommended for production applications.
*/
//Configure::write('App.baseUrl', env('SCRIPT_NAME'));
/**
* To configure CakePHP to use a particular domain URL
* for any URL generation inside the application, set the following
* configuration variable to the http(s) address to your domain. This
* will override the automatic detection of full base URL and can be
* useful when generating links from the CLI (e.g. sending emails)
*/
//Configure::write('App.fullBaseUrl', 'http://example.com');
/**
* Web path to the public images directory under webroot.
* If not set defaults to 'img/'
*/
//Configure::write('App.imageBaseUrl', 'img/');
/**
* Web path to the CSS files directory under webroot.
* If not set defaults to 'css/'
*/
//Configure::write('App.cssBaseUrl', 'css/');
/**
* Web path to the js files directory under webroot.
* If not set defaults to 'js/'
*/
//Configure::write('App.jsBaseUrl', 'js/');
/**
* Uncomment the define below to use CakePHP prefix routes.
*
* The value of the define determines the names of the routes
* and their associated controller actions:
*
* Set to an array of prefixes you want to use in your application. Use for
* admin or other prefixed routes.
*
* Routing.prefixes = array('admin', 'manager');
*
* Enables:
* `admin_index()` and `/admin/controller/index`
* `manager_index()` and `/manager/controller/index`
*
*/
//Configure::write('Routing.prefixes', array('admin'));
/**
* Turn off all caching application-wide.
*
*/
//Configure::write('Cache.disable', true);
/**
* Enable cache checking.
*
* If set to true, for view caching you must still use the controller
* public $cacheAction inside your controllers to define caching settings.
* You can either set it controller-wide by setting public $cacheAction = true,
* or in each action using $this->cacheAction = true.
*
*/
//Configure::write('Cache.check', true);
/**
* Enable cache view prefixes.
*
* If set it will be prepended to the cache name for view file caching. This is
* helpful if you deploy the same application via multiple subdomains and languages,
* for instance. Each version can then have its own view cache namespace.
* Note: The final cache file name will then be `prefix_cachefilename`.
*/
//Configure::write('Cache.viewPrefix', 'prefix');
/**
* Session configuration.
*
* Contains an array of settings to use for session configuration. The defaults key is
* used to define a default preset to use for sessions, any settings declared here will override
* the settings of the default config.
*
* ## Options
*
* - `Session.cookie` - The name of the cookie to use. Defaults to 'CAKEPHP'
* - `Session.timeout` - The number of minutes you want sessions to live for. This timeout is handled by CakePHP
* - `Session.cookieTimeout` - The number of minutes you want session cookies to live for.
* - `Session.checkAgent` - Do you want the user agent to be checked when starting sessions? You might want to set the
* value to false, when dealing with older versions of IE, Chrome Frame or certain web-browsing devices and AJAX
* - `Session.defaults` - The default configuration set to use as a basis for your session.
* There are four builtins: php, cake, cache, database.
* - `Session.handler` - Can be used to enable a custom session handler. Expects an array of callables,
* that can be used with `session_save_handler`. Using this option will automatically add `session.save_handler`
* to the ini array.
* - `Session.autoRegenerate` - Enabling this setting, turns on automatic renewal of sessions, and
* sessionids that change frequently. See CakeSession::$requestCountdown.
* - `Session.ini` - An associative array of additional ini values to set.
*
* The built in defaults are:
*
* - 'php' - Uses settings defined in your php.ini.
* - 'cake' - Saves session files in CakePHP's /tmp directory.
* - 'database' - Uses CakePHP's database sessions.
* - 'cache' - Use the Cache class to save sessions.
*
* To define a custom session handler, save it at /app/Model/Datasource/Session/<name>.php.
* Make sure the class implements `CakeSessionHandlerInterface` and set Session.handler to <name>
*
* To use database sessions, run the app/Config/Schema/sessions.php schema using
* the cake shell command: cake schema create Sessions
*
*/
Configure::write('Session', array(
'defaults' => 'php'
));
/**
* A random string used in security hashing methods.
*/
Configure::write('Security.salt', '94846d00d3a440ae01a650d0ac5c42e2883e2b31');
/**
* A random numeric string (digits only) used to encrypt/decrypt strings.
*/
Configure::write('Security.cipherSeed', '623431653463303430653263306235');
/**
* Apply timestamps with the last modified time to static assets (js, css, images).
* Will append a query string parameter containing the time the file was modified. This is
* useful for invalidating browser caches.
*
* Set to `true` to apply timestamps when debug > 0. Set to 'force' to always enable
* timestamping regardless of debug value.
*/
//Configure::write('Asset.timestamp', true);
/**
* Compress CSS output by removing comments, whitespace, repeating tags, etc.
* This requires a/var/cache directory to be writable by the web server for caching.
* and /vendors/csspp/csspp.php
*
* To use, prefix the CSS link URL with '/ccss/' instead of '/css/' or use HtmlHelper::css().
*/
//Configure::write('Asset.filter.css', 'css.php');
/**
* Plug in your own custom JavaScript compressor by dropping a script in your webroot to handle the
* output, and setting the config below to the name of the script.
*
* To use, prefix your JavaScript link URLs with '/cjs/' instead of '/js/' or use JsHelper::link().
*/
//Configure::write('Asset.filter.js', 'custom_javascript_output_filter.php');
/**
* The class name and database used in CakePHP's
* access control lists.
*/
Configure::write('Acl.classname', 'DbAcl');
Configure::write('Acl.database', 'default');
/**
* Uncomment this line and correct your server timezone to fix
* any date & time related errors.
*/
//date_default_timezone_set('UTC');
/**
* Cache Engine Configuration
* Default settings provided below
*
* File storage engine.
*
* Cache::config('default', array(
* 'engine' => 'File', //[required]
* 'duration' => 3600, //[optional]
* 'probability' => 100, //[optional]
* 'path' => CACHE, //[optional] use system tmp directory - remember to use absolute path
* 'prefix' => 'cake_', //[optional] prefix every cache file with this string
* 'lock' => false, //[optional] use file locking
* 'serialize' => true, //[optional]
* 'mask' => 0664, //[optional]
* ));
*
* APC (http://pecl.php.net/package/APC)
*
* Cache::config('default', array(
* 'engine' => 'Apc', //[required]
* 'duration' => 3600, //[optional]
* 'probability' => 100, //[optional]
* 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string
* ));
*
* Xcache (http://xcache.lighttpd.net/)
*
* Cache::config('default', array(
* 'engine' => 'Xcache', //[required]
* 'duration' => 3600, //[optional]
* 'probability' => 100, //[optional]
* 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string
* 'user' => 'user', //user from xcache.admin.user settings
* 'password' => 'password', //plaintext password (xcache.admin.pass)
* ));
*
* Memcache (http://www.danga.com/memcached/)
*
* Cache::config('default', array(
* 'engine' => 'Memcache', //[required]
* 'duration' => 3600, //[optional]
* 'probability' => 100, //[optional]
* 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string
* 'servers' => array(
* '127.0.0.1:11211' // localhost, default port 11211
* ), //[optional]
* 'persistent' => true, // [optional] set this to false for non-persistent connections
* 'compress' => false, // [optional] compress data in Memcache (slower, but uses less memory)
* ));
*
* Wincache (http://php.net/wincache)
*
* Cache::config('default', array(
* 'engine' => 'Wincache', //[required]
* 'duration' => 3600, //[optional]
* 'probability' => 100, //[optional]
* 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string
* ));
*/
/**
* Configure the cache handlers that CakePHP will use for internal
* metadata like class maps, and model schema.
*
* By default File is used, but for improved performance you should use APC.
*
* Note: 'default' and other application caches should be configured in app/Config/bootstrap.php.
* Please check the comments in bootstrap.php for more info on the cache engines available
* and their settings.
*/
$engine = 'File';
// In development mode, caches should expire quickly.
$duration = '+999 days';
if (Configure::read('debug') > 0) {
$duration = '+10 seconds';
}
// Prefix each application on the same server with a different string, to avoid Memcache and APC conflicts.
$prefix = 'app_';
/**
* Configure the cache used for general framework caching. Path information,
* object listings, and translation cache files are stored with this configuration.
*/
Cache::config('_cake_core_', array(
'engine' => $engine,
'prefix' => $prefix . 'cake_core_',
'path' => CACHE . 'persistent' . DS,
'serialize' => ($engine === 'File'),
'duration' => $duration
));
/**
* Configure the cache for model and datasource caches. This cache configuration
* is used to store schema descriptions, and table listings in connections.
*/
Cache::config('_cake_model_', array(
'engine' => $engine,
'prefix' => $prefix . 'cake_model_',
'path' => CACHE . 'models' . DS,
'serialize' => ($engine === 'File'),
'duration' => $duration
));
|
previewict/cakephp-form-builder
|
app/Config/core.php
|
PHP
|
mit
| 13,709
|
Public Class ChooseAction
Inherits GH_Component
Sub New()
MyBase.New("Choose Action", "Action", "Choose agent next action", "Owl.Learning", "Reinforcement")
End Sub
Public Overrides ReadOnly Property ComponentGuid As Guid
Get
Return New Guid("{7B38BC76-BD51-48F2-B122-84FB91079021}")
End Get
End Property
Protected Overrides ReadOnly Property Icon As Bitmap
Get
Return My.Resources.Icons_new_14
End Get
End Property
Public Overrides ReadOnly Property Exposure As GH_Exposure
Get
Return GH_Exposure.secondary
End Get
End Property
Protected Overrides Sub RegisterInputParams(pManager As GH_InputParamManager)
pManager.AddParameter(New Param_OwlQAgent)
pManager.AddIntegerParameter("State", "S", "Current state", GH_ParamAccess.item)
pManager.AddNumberParameter("Epsilon", "E", "Epsilon", GH_ParamAccess.item, 0.1)
End Sub
Protected Overrides Sub RegisterOutputParams(pManager As GH_OutputParamManager)
pManager.AddParameter(New Param_OwlQAgent)
pManager.AddIntegerParameter("Action", "A", "Chosen action", GH_ParamAccess.item)
End Sub
Protected Overrides Sub SolveInstance(DA As IGH_DataAccess)
Dim nql As QAgent = Nothing
If Not DA.GetData(0, nql) Then Return
Dim state As Integer = -1
If Not DA.GetData(1, state) Then Return
Dim eps As Double = 0
If Not DA.GetData(2, eps) Then Return
DA.SetData(1, nql.ChooseAction(state, eps))
DA.SetData(0, nql)
End Sub
End Class
|
mateuszzwierzycki/Owl
|
Owl.GH/Components/Owl.Learning/Reinforcement/2/ChooseAction.vb
|
Visual Basic
|
mit
| 1,543
|
/*
* Qt4 bitcoin GUI.
*
* W.J. van der Laan 2011-2012
* The Bitcoin Developers 2011-2012
*/
#include <QApplication>
#include "bitcoingui.h"
#include "transactiontablemodel.h"
#include "optionsdialog.h"
#include "aboutdialog.h"
#include "clientmodel.h"
#include "walletmodel.h"
#include "walletframe.h"
#include "optionsmodel.h"
#include "transactiondescdialog.h"
#include "bitcoinunits.h"
#include "guiconstants.h"
#include "notificator.h"
#include "guiutil.h"
#include "rpcconsole.h"
#include "ui_interface.h"
#include "wallet.h"
#include "init.h"
#ifdef Q_OS_MAC
#include "macdockiconhandler.h"
#endif
#include <QMenuBar>
#include <QMenu>
#include <QIcon>
#include <QVBoxLayout>
#include <QToolBar>
#include <QStatusBar>
#include <QLabel>
#include <QMessageBox>
#include <QProgressBar>
#include <QStackedWidget>
#include <QDateTime>
#include <QMovie>
#include <QTimer>
#include <QDragEnterEvent>
#if QT_VERSION < 0x050000
#include <QUrl>
#endif
#include <QMimeData>
#include <QStyle>
#include <QSettings>
#include <QDesktopWidget>
#include <QListWidget>
#include <iostream>
const QString BitcoinGUI::DEFAULT_WALLET = "~Default";
BitcoinGUI::BitcoinGUI(QWidget *parent) :
QMainWindow(parent),
clientModel(0),
encryptWalletAction(0),
changePassphraseAction(0),
aboutQtAction(0),
trayIcon(0),
notificator(0),
rpcConsole(0),
prevBlocks(0)
{
restoreWindowGeometry();
setWindowTitle(tr("Woodcoin") + " - " + tr("Wallet"));
#ifndef Q_OS_MAC
QApplication::setWindowIcon(QIcon(":icons/bitcoin"));
setWindowIcon(QIcon(":icons/bitcoin"));
#else
setUnifiedTitleAndToolBarOnMac(true);
QApplication::setAttribute(Qt::AA_DontShowIconsInMenus);
#endif
// Create wallet frame and make it the central widget
walletFrame = new WalletFrame(this);
setCentralWidget(walletFrame);
// Accept D&D of URIs
setAcceptDrops(true);
// Create actions for the toolbar, menu bar and tray/dock icon
// Needs walletFrame to be initialized
createActions();
// Create application menu bar
createMenuBar();
// Create the toolbars
createToolBars();
// Create system tray icon and notification
createTrayIcon();
// Create status bar
statusBar();
// Status bar notification icons
QFrame *frameBlocks = new QFrame();
frameBlocks->setContentsMargins(0,0,0,0);
frameBlocks->setMinimumWidth(56);
frameBlocks->setMaximumWidth(56);
QHBoxLayout *frameBlocksLayout = new QHBoxLayout(frameBlocks);
frameBlocksLayout->setContentsMargins(3,0,3,0);
frameBlocksLayout->setSpacing(3);
labelEncryptionIcon = new QLabel();
labelConnectionsIcon = new QLabel();
labelBlocksIcon = new QLabel();
frameBlocksLayout->addStretch();
frameBlocksLayout->addWidget(labelEncryptionIcon);
frameBlocksLayout->addStretch();
frameBlocksLayout->addWidget(labelConnectionsIcon);
frameBlocksLayout->addStretch();
frameBlocksLayout->addWidget(labelBlocksIcon);
frameBlocksLayout->addStretch();
// Progress bar and label for blocks download
progressBarLabel = new QLabel();
progressBarLabel->setVisible(false);
progressBar = new QProgressBar();
progressBar->setAlignment(Qt::AlignCenter);
progressBar->setVisible(false);
// Override style sheet for progress bar for styles that have a segmented progress bar,
// as they make the text unreadable (workaround for issue #1071)
// See https://qt-project.org/doc/qt-4.8/gallery.html
QString curStyle = QApplication::style()->metaObject()->className();
if(curStyle == "QWindowsStyle" || curStyle == "QWindowsXPStyle")
{
progressBar->setStyleSheet("QProgressBar { background-color: #e8e8e8; border: 1px solid grey; border-radius: 7px; padding: 1px; text-align: center; } QProgressBar::chunk { background: QLinearGradient(x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #FF8000, stop: 1 orange); border-radius: 7px; margin: 0px; }");
}
statusBar()->addWidget(progressBarLabel);
statusBar()->addWidget(progressBar);
statusBar()->addPermanentWidget(frameBlocks);
syncIconMovie = new QMovie(":/movies/update_spinner", "mng", this);
rpcConsole = new RPCConsole(this);
connect(openRPCConsoleAction, SIGNAL(triggered()), rpcConsole, SLOT(show()));
// Install event filter to be able to catch status tip events (QEvent::StatusTip)
this->installEventFilter(this);
// Initially wallet actions should be disabled
setWalletActionsEnabled(false);
}
BitcoinGUI::~BitcoinGUI()
{
saveWindowGeometry();
if(trayIcon) // Hide tray icon, as deleting will let it linger until quit (on Ubuntu)
trayIcon->hide();
#ifdef Q_OS_MAC
delete appMenuBar;
MacDockIconHandler::instance()->setMainWindow(NULL);
#endif
}
void BitcoinGUI::createActions()
{
QActionGroup *tabGroup = new QActionGroup(this);
overviewAction = new QAction(QIcon(":/icons/overview"), tr("&Overview"), this);
overviewAction->setStatusTip(tr("Show general overview of wallet"));
overviewAction->setToolTip(overviewAction->statusTip());
overviewAction->setCheckable(true);
overviewAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_1));
tabGroup->addAction(overviewAction);
sendCoinsAction = new QAction(QIcon(":/icons/send"), tr("&Send"), this);
sendCoinsAction->setStatusTip(tr("Send coins to a Woodcoin address"));
sendCoinsAction->setToolTip(sendCoinsAction->statusTip());
sendCoinsAction->setCheckable(true);
sendCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_2));
tabGroup->addAction(sendCoinsAction);
receiveCoinsAction = new QAction(QIcon(":/icons/receiving_addresses"), tr("&Receive"), this);
receiveCoinsAction->setStatusTip(tr("Show the list of addresses for receiving payments"));
receiveCoinsAction->setToolTip(receiveCoinsAction->statusTip());
receiveCoinsAction->setCheckable(true);
receiveCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_3));
tabGroup->addAction(receiveCoinsAction);
historyAction = new QAction(QIcon(":/icons/history"), tr("&Transactions"), this);
historyAction->setStatusTip(tr("Browse transaction history"));
historyAction->setToolTip(historyAction->statusTip());
historyAction->setCheckable(true);
historyAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_4));
tabGroup->addAction(historyAction);
addressBookAction = new QAction(QIcon(":/icons/address-book"), tr("&Addresses"), this);
addressBookAction->setStatusTip(tr("Edit the list of stored addresses and labels"));
addressBookAction->setToolTip(addressBookAction->statusTip());
addressBookAction->setCheckable(true);
addressBookAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_5));
tabGroup->addAction(addressBookAction);
connect(overviewAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
connect(overviewAction, SIGNAL(triggered()), this, SLOT(gotoOverviewPage()));
connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(gotoSendCoinsPage()));
connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(gotoReceiveCoinsPage()));
connect(historyAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
connect(historyAction, SIGNAL(triggered()), this, SLOT(gotoHistoryPage()));
connect(addressBookAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
connect(addressBookAction, SIGNAL(triggered()), this, SLOT(gotoAddressBookPage()));
quitAction = new QAction(QIcon(":/icons/quit"), tr("E&xit"), this);
quitAction->setStatusTip(tr("Quit application"));
quitAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q));
quitAction->setMenuRole(QAction::QuitRole);
aboutAction = new QAction(QIcon(":/icons/bitcoin"), tr("&About Woodcoin"), this);
aboutAction->setStatusTip(tr("Show information about Woodcoin"));
aboutAction->setMenuRole(QAction::AboutRole);
aboutQtAction = new QAction(QIcon(":/trolltech/qmessagebox/images/qtlogo-64.png"), tr("About &Qt"), this);
aboutQtAction->setStatusTip(tr("Show information about Qt"));
aboutQtAction->setMenuRole(QAction::AboutQtRole);
optionsAction = new QAction(QIcon(":/icons/options"), tr("&Options..."), this);
optionsAction->setStatusTip(tr("Modify configuration options for Woodcoin"));
optionsAction->setMenuRole(QAction::PreferencesRole);
toggleHideAction = new QAction(QIcon(":/icons/bitcoin"), tr("&Show / Hide"), this);
toggleHideAction->setStatusTip(tr("Show or hide the main Window"));
encryptWalletAction = new QAction(QIcon(":/icons/lock_closed"), tr("&Encrypt Wallet..."), this);
encryptWalletAction->setStatusTip(tr("Encrypt the private keys that belong to your wallet"));
encryptWalletAction->setCheckable(true);
backupWalletAction = new QAction(QIcon(":/icons/filesave"), tr("&Backup Wallet..."), this);
backupWalletAction->setStatusTip(tr("Backup wallet to another location"));
changePassphraseAction = new QAction(QIcon(":/icons/key"), tr("&Change Passphrase..."), this);
changePassphraseAction->setStatusTip(tr("Change the passphrase used for wallet encryption"));
signMessageAction = new QAction(QIcon(":/icons/edit"), tr("Sign &message..."), this);
signMessageAction->setStatusTip(tr("Sign messages with your Woodcoin addresses to prove you own them"));
verifyMessageAction = new QAction(QIcon(":/icons/transaction_0"), tr("&Verify message..."), this);
verifyMessageAction->setStatusTip(tr("Verify messages to ensure they were signed with specified Woodcoin addresses"));
openRPCConsoleAction = new QAction(QIcon(":/icons/debugwindow"), tr("&Debug window"), this);
openRPCConsoleAction->setStatusTip(tr("Open debugging and diagnostic console"));
connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
connect(aboutAction, SIGNAL(triggered()), this, SLOT(aboutClicked()));
connect(aboutQtAction, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
connect(optionsAction, SIGNAL(triggered()), this, SLOT(optionsClicked()));
connect(toggleHideAction, SIGNAL(triggered()), this, SLOT(toggleHidden()));
connect(encryptWalletAction, SIGNAL(triggered(bool)), walletFrame, SLOT(encryptWallet(bool)));
connect(backupWalletAction, SIGNAL(triggered()), walletFrame, SLOT(backupWallet()));
connect(changePassphraseAction, SIGNAL(triggered()), walletFrame, SLOT(changePassphrase()));
connect(signMessageAction, SIGNAL(triggered()), this, SLOT(gotoSignMessageTab()));
connect(verifyMessageAction, SIGNAL(triggered()), this, SLOT(gotoVerifyMessageTab()));
}
void BitcoinGUI::createMenuBar()
{
#ifdef Q_OS_MAC
// Create a decoupled menu bar on Mac which stays even if the window is closed
appMenuBar = new QMenuBar();
#else
// Get the main window's menu bar on other platforms
appMenuBar = menuBar();
#endif
// Configure the menus
QMenu *file = appMenuBar->addMenu(tr("&File"));
file->addAction(backupWalletAction);
file->addAction(signMessageAction);
file->addAction(verifyMessageAction);
file->addSeparator();
file->addAction(quitAction);
QMenu *settings = appMenuBar->addMenu(tr("&Settings"));
settings->addAction(encryptWalletAction);
settings->addAction(changePassphraseAction);
settings->addSeparator();
settings->addAction(optionsAction);
QMenu *help = appMenuBar->addMenu(tr("&Help"));
help->addAction(openRPCConsoleAction);
help->addSeparator();
help->addAction(aboutAction);
help->addAction(aboutQtAction);
}
void BitcoinGUI::createToolBars()
{
QToolBar *toolbar = addToolBar(tr("Tabs toolbar"));
toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
toolbar->addAction(overviewAction);
toolbar->addAction(sendCoinsAction);
toolbar->addAction(receiveCoinsAction);
toolbar->addAction(historyAction);
toolbar->addAction(addressBookAction);
}
void BitcoinGUI::setClientModel(ClientModel *clientModel)
{
this->clientModel = clientModel;
if(clientModel)
{
// Replace some strings and icons, when using the testnet
if(clientModel->isTestNet())
{
setWindowTitle(windowTitle() + QString(" ") + tr("[testnet]"));
#ifndef Q_OS_MAC
QApplication::setWindowIcon(QIcon(":icons/bitcoin_testnet"));
setWindowIcon(QIcon(":icons/bitcoin_testnet"));
#else
MacDockIconHandler::instance()->setIcon(QIcon(":icons/bitcoin_testnet"));
#endif
if(trayIcon)
{
// Just attach " [testnet]" to the existing tooltip
trayIcon->setToolTip(trayIcon->toolTip() + QString(" ") + tr("[testnet]"));
trayIcon->setIcon(QIcon(":/icons/toolbar_testnet"));
}
toggleHideAction->setIcon(QIcon(":/icons/toolbar_testnet"));
aboutAction->setIcon(QIcon(":/icons/toolbar_testnet"));
}
// Create system tray menu (or setup the dock menu) that late to prevent users from calling actions,
// while the client has not yet fully loaded
createTrayIconMenu();
// Keep up to date with client
setNumConnections(clientModel->getNumConnections());
connect(clientModel, SIGNAL(numConnectionsChanged(int)), this, SLOT(setNumConnections(int)));
setNumBlocks(clientModel->getNumBlocks(), clientModel->getNumBlocksOfPeers());
connect(clientModel, SIGNAL(numBlocksChanged(int,int)), this, SLOT(setNumBlocks(int,int)));
// Receive and report messages from network/worker thread
connect(clientModel, SIGNAL(message(QString,QString,unsigned int)), this, SLOT(message(QString,QString,unsigned int)));
rpcConsole->setClientModel(clientModel);
walletFrame->setClientModel(clientModel);
}
}
bool BitcoinGUI::addWallet(const QString& name, WalletModel *walletModel)
{
setWalletActionsEnabled(true);
return walletFrame->addWallet(name, walletModel);
}
bool BitcoinGUI::setCurrentWallet(const QString& name)
{
return walletFrame->setCurrentWallet(name);
}
void BitcoinGUI::removeAllWallets()
{
setWalletActionsEnabled(false);
walletFrame->removeAllWallets();
}
void BitcoinGUI::setWalletActionsEnabled(bool enabled)
{
overviewAction->setEnabled(enabled);
sendCoinsAction->setEnabled(enabled);
receiveCoinsAction->setEnabled(enabled);
historyAction->setEnabled(enabled);
encryptWalletAction->setEnabled(enabled);
backupWalletAction->setEnabled(enabled);
changePassphraseAction->setEnabled(enabled);
signMessageAction->setEnabled(enabled);
verifyMessageAction->setEnabled(enabled);
addressBookAction->setEnabled(enabled);
}
void BitcoinGUI::createTrayIcon()
{
#ifndef Q_OS_MAC
trayIcon = new QSystemTrayIcon(this);
trayIcon->setToolTip(tr("Woodcoin client"));
trayIcon->setIcon(QIcon(":/icons/toolbar"));
trayIcon->show();
#endif
notificator = new Notificator(QApplication::applicationName(), trayIcon);
}
void BitcoinGUI::createTrayIconMenu()
{
QMenu *trayIconMenu;
#ifndef Q_OS_MAC
// return if trayIcon is unset (only on non-Mac OSes)
if (!trayIcon)
return;
trayIconMenu = new QMenu(this);
trayIcon->setContextMenu(trayIconMenu);
connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
this, SLOT(trayIconActivated(QSystemTrayIcon::ActivationReason)));
#else
// Note: On Mac, the dock icon is used to provide the tray's functionality.
MacDockIconHandler *dockIconHandler = MacDockIconHandler::instance();
dockIconHandler->setMainWindow((QMainWindow *)this);
trayIconMenu = dockIconHandler->dockMenu();
#endif
// Configuration of the tray icon (or dock icon) icon menu
trayIconMenu->addAction(toggleHideAction);
trayIconMenu->addSeparator();
trayIconMenu->addAction(sendCoinsAction);
trayIconMenu->addAction(receiveCoinsAction);
trayIconMenu->addSeparator();
trayIconMenu->addAction(signMessageAction);
trayIconMenu->addAction(verifyMessageAction);
trayIconMenu->addSeparator();
trayIconMenu->addAction(optionsAction);
trayIconMenu->addAction(openRPCConsoleAction);
#ifndef Q_OS_MAC // This is built-in on Mac
trayIconMenu->addSeparator();
trayIconMenu->addAction(quitAction);
#endif
}
#ifndef Q_OS_MAC
void BitcoinGUI::trayIconActivated(QSystemTrayIcon::ActivationReason reason)
{
if(reason == QSystemTrayIcon::Trigger)
{
// Click on system tray icon triggers show/hide of the main window
toggleHideAction->trigger();
}
}
#endif
void BitcoinGUI::saveWindowGeometry()
{
QSettings settings;
settings.setValue("nWindowPos", pos());
settings.setValue("nWindowSize", size());
}
void BitcoinGUI::restoreWindowGeometry()
{
QSettings settings;
QPoint pos = settings.value("nWindowPos").toPoint();
QSize size = settings.value("nWindowSize", QSize(850, 550)).toSize();
if (!pos.x() && !pos.y())
{
QRect screen = QApplication::desktop()->screenGeometry();
pos.setX((screen.width()-size.width())/2);
pos.setY((screen.height()-size.height())/2);
}
resize(size);
move(pos);
}
void BitcoinGUI::optionsClicked()
{
if(!clientModel || !clientModel->getOptionsModel())
return;
OptionsDialog dlg;
dlg.setModel(clientModel->getOptionsModel());
dlg.exec();
}
void BitcoinGUI::aboutClicked()
{
AboutDialog dlg;
dlg.setModel(clientModel);
dlg.exec();
}
void BitcoinGUI::gotoOverviewPage()
{
if (walletFrame) walletFrame->gotoOverviewPage();
}
void BitcoinGUI::gotoHistoryPage()
{
if (walletFrame) walletFrame->gotoHistoryPage();
}
void BitcoinGUI::gotoAddressBookPage()
{
if (walletFrame) walletFrame->gotoAddressBookPage();
}
void BitcoinGUI::gotoReceiveCoinsPage()
{
if (walletFrame) walletFrame->gotoReceiveCoinsPage();
}
void BitcoinGUI::gotoSendCoinsPage(QString addr)
{
if (walletFrame) walletFrame->gotoSendCoinsPage(addr);
}
void BitcoinGUI::gotoSignMessageTab(QString addr)
{
if (walletFrame) walletFrame->gotoSignMessageTab(addr);
}
void BitcoinGUI::gotoVerifyMessageTab(QString addr)
{
if (walletFrame) walletFrame->gotoVerifyMessageTab(addr);
}
void BitcoinGUI::setNumConnections(int count)
{
QString icon;
switch(count)
{
case 0: icon = ":/icons/connect_0"; break;
case 1: case 2: case 3: icon = ":/icons/connect_1"; break;
case 4: case 5: case 6: icon = ":/icons/connect_2"; break;
case 7: case 8: case 9: icon = ":/icons/connect_3"; break;
default: icon = ":/icons/connect_4"; break;
}
labelConnectionsIcon->setPixmap(QIcon(icon).pixmap(STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE));
labelConnectionsIcon->setToolTip(tr("%n active connection(s) to Woodcoin network", "", count));
}
void BitcoinGUI::setNumBlocks(int count, int nTotalBlocks)
{
// Prevent orphan statusbar messages (e.g. hover Quit in main menu, wait until chain-sync starts -> garbelled text)
statusBar()->clearMessage();
// Acquire current block source
enum BlockSource blockSource = clientModel->getBlockSource();
switch (blockSource) {
case BLOCK_SOURCE_NETWORK:
progressBarLabel->setText(tr("Synchronizing with network..."));
break;
case BLOCK_SOURCE_DISK:
progressBarLabel->setText(tr("Importing blocks from disk..."));
break;
case BLOCK_SOURCE_REINDEX:
progressBarLabel->setText(tr("Reindexing blocks on disk..."));
break;
case BLOCK_SOURCE_NONE:
// Case: not Importing, not Reindexing and no network connection
progressBarLabel->setText(tr("No block source available..."));
break;
}
QString tooltip;
QDateTime lastBlockDate = clientModel->getLastBlockDate();
QDateTime currentDate = QDateTime::currentDateTime();
int secs = lastBlockDate.secsTo(currentDate);
if(count < nTotalBlocks)
{
tooltip = tr("Processed %1 of %2 (estimated) blocks of transaction history.").arg(count).arg(nTotalBlocks);
}
else
{
tooltip = tr("Processed %1 blocks of transaction history.").arg(count);
}
// Set icon state: spinning if catching up, tick otherwise
if(secs < 90*60 && count >= nTotalBlocks)
{
tooltip = tr("Up to date") + QString(".<br>") + tooltip;
labelBlocksIcon->setPixmap(QIcon(":/icons/synced").pixmap(STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE));
walletFrame->showOutOfSyncWarning(false);
progressBarLabel->setVisible(false);
progressBar->setVisible(false);
}
else
{
// Represent time from last generated block in human readable text
QString timeBehindText;
if(secs < 48*60*60)
{
timeBehindText = tr("%n hour(s)","",secs/(60*60));
}
else if(secs < 14*24*60*60)
{
timeBehindText = tr("%n day(s)","",secs/(24*60*60));
}
else
{
timeBehindText = tr("%n week(s)","",secs/(7*24*60*60));
}
progressBarLabel->setVisible(true);
progressBar->setFormat(tr("%1 behind").arg(timeBehindText));
progressBar->setMaximum(1000000000);
progressBar->setValue(clientModel->getVerificationProgress() * 1000000000.0 + 0.5);
progressBar->setVisible(true);
tooltip = tr("Catching up...") + QString("<br>") + tooltip;
labelBlocksIcon->setMovie(syncIconMovie);
if(count != prevBlocks)
syncIconMovie->jumpToNextFrame();
prevBlocks = count;
walletFrame->showOutOfSyncWarning(true);
tooltip += QString("<br>");
tooltip += tr("Last received block was generated %1 ago.").arg(timeBehindText);
tooltip += QString("<br>");
tooltip += tr("Transactions after this will not yet be visible.");
}
// Don't word-wrap this (fixed-width) tooltip
tooltip = QString("<nobr>") + tooltip + QString("</nobr>");
labelBlocksIcon->setToolTip(tooltip);
progressBarLabel->setToolTip(tooltip);
progressBar->setToolTip(tooltip);
}
void BitcoinGUI::message(const QString &title, const QString &message, unsigned int style, bool *ret)
{
QString strTitle = tr("Woodcoin"); // default title
// Default to information icon
int nMBoxIcon = QMessageBox::Information;
int nNotifyIcon = Notificator::Information;
// Override title based on style
QString msgType;
switch (style) {
case CClientUIInterface::MSG_ERROR:
msgType = tr("Error");
break;
case CClientUIInterface::MSG_WARNING:
msgType = tr("Warning");
break;
case CClientUIInterface::MSG_INFORMATION:
msgType = tr("Information");
break;
default:
msgType = title; // Use supplied title
}
if (!msgType.isEmpty())
strTitle += " - " + msgType;
// Check for error/warning icon
if (style & CClientUIInterface::ICON_ERROR) {
nMBoxIcon = QMessageBox::Critical;
nNotifyIcon = Notificator::Critical;
}
else if (style & CClientUIInterface::ICON_WARNING) {
nMBoxIcon = QMessageBox::Warning;
nNotifyIcon = Notificator::Warning;
}
// Display message
if (style & CClientUIInterface::MODAL) {
// Check for buttons, use OK as default, if none was supplied
QMessageBox::StandardButton buttons;
if (!(buttons = (QMessageBox::StandardButton)(style & CClientUIInterface::BTN_MASK)))
buttons = QMessageBox::Ok;
QMessageBox mBox((QMessageBox::Icon)nMBoxIcon, strTitle, message, buttons);
int r = mBox.exec();
if (ret != NULL)
*ret = r == QMessageBox::Ok;
}
else
notificator->notify((Notificator::Class)nNotifyIcon, strTitle, message);
}
void BitcoinGUI::changeEvent(QEvent *e)
{
QMainWindow::changeEvent(e);
#ifndef Q_OS_MAC // Ignored on Mac
if(e->type() == QEvent::WindowStateChange)
{
if(clientModel && clientModel->getOptionsModel()->getMinimizeToTray())
{
QWindowStateChangeEvent *wsevt = static_cast<QWindowStateChangeEvent*>(e);
if(!(wsevt->oldState() & Qt::WindowMinimized) && isMinimized())
{
QTimer::singleShot(0, this, SLOT(hide()));
e->ignore();
}
}
}
#endif
}
void BitcoinGUI::closeEvent(QCloseEvent *event)
{
if(clientModel)
{
#ifndef Q_OS_MAC // Ignored on Mac
if(!clientModel->getOptionsModel()->getMinimizeToTray() &&
!clientModel->getOptionsModel()->getMinimizeOnClose())
{
QApplication::quit();
}
#endif
}
QMainWindow::closeEvent(event);
}
void BitcoinGUI::askFee(qint64 nFeeRequired, bool *payFee)
{
QString strMessage = tr("This transaction is over the size limit. You can still send it for a fee of %1, "
"which goes to the nodes that process your transaction and helps to support the network. "
"Do you want to pay the fee?").arg(BitcoinUnits::formatWithUnit(BitcoinUnits::BTC, nFeeRequired));
QMessageBox::StandardButton retval = QMessageBox::question(
this, tr("Confirm transaction fee"), strMessage,
QMessageBox::Yes|QMessageBox::Cancel, QMessageBox::Yes);
*payFee = (retval == QMessageBox::Yes);
}
void BitcoinGUI::incomingTransaction(const QString& date, int unit, qint64 amount, const QString& type, const QString& address)
{
// On new transaction, make an info balloon
message((amount)<0 ? tr("Sent transaction") : tr("Incoming transaction"),
tr("Date: %1\n"
"Amount: %2\n"
"Type: %3\n"
"Address: %4\n")
.arg(date)
.arg(BitcoinUnits::formatWithUnit(unit, amount, true))
.arg(type)
.arg(address), CClientUIInterface::MSG_INFORMATION);
}
void BitcoinGUI::dragEnterEvent(QDragEnterEvent *event)
{
// Accept only URIs
if(event->mimeData()->hasUrls())
event->acceptProposedAction();
}
void BitcoinGUI::dropEvent(QDropEvent *event)
{
if(event->mimeData()->hasUrls())
{
int nValidUrisFound = 0;
QList<QUrl> uris = event->mimeData()->urls();
foreach(const QUrl &uri, uris)
{
if (walletFrame->handleURI(uri.toString()))
nValidUrisFound++;
}
// if valid URIs were found
if (nValidUrisFound)
walletFrame->gotoSendCoinsPage();
else
message(tr("URI handling"), tr("URI can not be parsed! This can be caused by an invalid Woodcoin address or malformed URI parameters."),
CClientUIInterface::ICON_WARNING);
}
event->acceptProposedAction();
}
bool BitcoinGUI::eventFilter(QObject *object, QEvent *event)
{
// Catch status tip events
if (event->type() == QEvent::StatusTip)
{
// Prevent adding text from setStatusTip(), if we currently use the status bar for displaying other stuff
if (progressBarLabel->isVisible() || progressBar->isVisible())
return true;
}
return QMainWindow::eventFilter(object, event);
}
void BitcoinGUI::handleURI(QString strURI)
{
// URI has to be valid
if (!walletFrame->handleURI(strURI))
message(tr("URI handling"), tr("URI can not be parsed! This can be caused by an invalid Woodcoin address or malformed URI parameters."),
CClientUIInterface::ICON_WARNING);
}
void BitcoinGUI::setEncryptionStatus(int status)
{
switch(status)
{
case WalletModel::Unencrypted:
labelEncryptionIcon->hide();
encryptWalletAction->setChecked(false);
changePassphraseAction->setEnabled(false);
encryptWalletAction->setEnabled(true);
break;
case WalletModel::Unlocked:
labelEncryptionIcon->show();
labelEncryptionIcon->setPixmap(QIcon(":/icons/lock_open").pixmap(STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE));
labelEncryptionIcon->setToolTip(tr("Wallet is <b>encrypted</b> and currently <b>unlocked</b>"));
encryptWalletAction->setChecked(true);
changePassphraseAction->setEnabled(true);
encryptWalletAction->setEnabled(false); // TODO: decrypt currently not supported
break;
case WalletModel::Locked:
labelEncryptionIcon->show();
labelEncryptionIcon->setPixmap(QIcon(":/icons/lock_closed").pixmap(STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE));
labelEncryptionIcon->setToolTip(tr("Wallet is <b>encrypted</b> and currently <b>locked</b>"));
encryptWalletAction->setChecked(true);
changePassphraseAction->setEnabled(true);
encryptWalletAction->setEnabled(false); // TODO: decrypt currently not supported
break;
}
}
void BitcoinGUI::showNormalIfMinimized(bool fToggleHidden)
{
// activateWindow() (sometimes) helps with keyboard focus on Windows
if (isHidden())
{
show();
activateWindow();
}
else if (isMinimized())
{
showNormal();
activateWindow();
}
else if (GUIUtil::isObscured(this))
{
raise();
activateWindow();
}
else if(fToggleHidden)
hide();
}
void BitcoinGUI::toggleHidden()
{
showNormalIfMinimized(true);
}
void BitcoinGUI::detectShutdown()
{
if (ShutdownRequested())
QMetaObject::invokeMethod(QCoreApplication::instance(), "quit", Qt::QueuedConnection);
}
|
woodedlawn/woodcoin
|
src/qt/bitcoingui.cpp
|
C++
|
mit
| 29,694
|
---
layout: post
category: leetcode
title: 1862. 向下取整数对和
tags: leetcode
---
## title
[problem link](https://leetcode-cn.com/problems/sum-of-floored-pairs/)
给你一个整数数组 `nums` ,请你返回所有下标对 `0 <= i, j < nums.length` 的 `floor(nums[i] / nums[j])` 结果之和。由于答案可能会很大,请你返回答案对`109 + 7` **取余** 的结果。
函数 `floor()` 返回输入数字的整数部分。
**示例 1:**
```
输入:nums = [2,5,9]
输出:10
解释:
floor(2 / 5) = floor(2 / 9) = floor(5 / 9) = 0
floor(2 / 2) = floor(5 / 5) = floor(9 / 9) = 1
floor(5 / 2) = 2
floor(9 / 2) = 4
floor(9 / 5) = 1
我们计算每一个数对商向下取整的结果并求和得到 10 。
```
**示例 2:**
```
输入:nums = [7,7,7,7,7,7,7]
输出:49
```
**提示:**
- `1 <= nums.length <= 105`
- `1 <= nums[i] <= 105`
## solution
前缀和。
```python
class Solution:
def sumOfFlooredPairs(self, nums: List[int]) -> int:
if not nums: return 0
mod = 10 ** 9 + 7
ans = 0
nums = sorted(nums)
upper = nums[-1]
pre = [0] * (upper + 1)
counter = collections.Counter(nums)
for i in range(nums[0], nums[-1] + 1, 1):
pre[i] = pre[i - 1] + counter[i]
# 前缀和
def sumv(a, b):
return pre[b] - pre[a]
for v in range(1, upper + 1):
if counter[v]:
k = 1
while k * v <= upper:
ans += sumv(k * v - 1, min(upper, k * v + v - 1)) * k * counter[v]
ans %= mod
k += 1
return ans
```
|
mafulong/mafulong.github.io
|
_posts/Algorithms/leetcode/2021-05-22-1862. 向下取整数对和.md
|
Markdown
|
mit
| 1,663
|
"""
Pylot command line tool
manage.py
Command line tool to manage your application
"""
import argparse
from application import get_config
import application.model as model
from pylot import utils
config = get_config()
NAME = "Pylot Manager"
__version__ = config.APP_VERSION
def setup():
# Create all db
model.db.create_all()
roles = ["user", "admin", "superadmin"]
# Setup the SUPERADMIN
email = config.ADMIN_EMAIL
name = config.ADMIN_NAME
user = model.User.get_by_email(email)
if not user:
model.User.User.new(email=email,
name=name,
role="SUPERADMIN")
def main():
parser = argparse.ArgumentParser(description="%s v.%s" % (NAME, __version__))
parser.add_argument("--setup", help="Setup the system", action="store_true")
parser.add_argument("--upload-static-to-s3", help="Upload all static files to S3", action="store_true")
arg = parser.parse_args()
if arg.setup:
# Default setup
print("Setting up...")
setup()
if arg.upload_static_to_s3:
# Upload static files to s3
import flask_s3
import run_www # Or the main application run file
print("Upload static files to S3")
flask_s3.create_all(run_www.app)
if __name__ == "__main__":
main()
|
mardix/pylot
|
pylot/app_templates/manage.py
|
Python
|
mit
| 1,343
|
<!DOCTYPE html>
<html xmlns:msxsl="urn:schemas-microsoft-com:xslt">
<head>
<meta content="en-us" http-equiv="Content-Language" />
<meta content="text/html; charset=utf-16" http-equiv="Content-Type" />
<title _locid="PortabilityAnalysis0">.NET Portability Report</title>
<style>
/* Body style, for the entire document */
body {
background: #F3F3F4;
color: #1E1E1F;
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
padding: 0;
margin: 0;
}
/* Header1 style, used for the main title */
h1 {
padding: 10px 0px 10px 10px;
font-size: 21pt;
background-color: #E2E2E2;
border-bottom: 1px #C1C1C2 solid;
color: #201F20;
margin: 0;
font-weight: normal;
}
/* Header2 style, used for "Overview" and other sections */
h2 {
font-size: 18pt;
font-weight: normal;
padding: 15px 0 5px 0;
margin: 0;
}
/* Header3 style, used for sub-sections, such as project name */
h3 {
font-weight: normal;
font-size: 15pt;
margin: 0;
padding: 15px 0 5px 0;
background-color: transparent;
}
h4 {
font-weight: normal;
font-size: 12pt;
margin: 0;
padding: 0 0 0 0;
background-color: transparent;
}
/* Color all hyperlinks one color */
a {
color: #1382CE;
}
/* Paragraph text (for longer informational messages) */
p {
font-size: 10pt;
}
/* Table styles */
table {
border-spacing: 0 0;
border-collapse: collapse;
font-size: 10pt;
}
table th {
background: #E7E7E8;
text-align: left;
text-decoration: none;
font-weight: normal;
padding: 3px 6px 3px 6px;
}
table td {
vertical-align: top;
padding: 3px 6px 5px 5px;
margin: 0px;
border: 1px solid #E7E7E8;
background: #F7F7F8;
}
.NoBreakingChanges {
color: darkgreen;
font-weight:bold;
}
.FewBreakingChanges {
color: orange;
font-weight:bold;
}
.ManyBreakingChanges {
color: red;
font-weight:bold;
}
.BreakDetails {
margin-left: 30px;
}
.CompatMessage {
font-style: italic;
font-size: 10pt;
}
.GoodMessage {
color: darkgreen;
}
/* Local link is a style for hyperlinks that link to file:/// content, there are lots so color them as 'normal' text until the user mouse overs */
.localLink {
color: #1E1E1F;
background: #EEEEED;
text-decoration: none;
}
.localLink:hover {
color: #1382CE;
background: #FFFF99;
text-decoration: none;
}
/* Center text, used in the over views cells that contain message level counts */
.textCentered {
text-align: center;
}
/* The message cells in message tables should take up all avaliable space */
.messageCell {
width: 100%;
}
/* Padding around the content after the h1 */
#content {
padding: 0px 12px 12px 12px;
}
/* The overview table expands to width, with a max width of 97% */
#overview table {
width: auto;
max-width: 75%;
}
/* The messages tables are always 97% width */
#messages table {
width: 97%;
}
/* All Icons */
.IconSuccessEncoded, .IconInfoEncoded, .IconWarningEncoded, .IconErrorEncoded {
min-width: 18px;
min-height: 18px;
background-repeat: no-repeat;
background-position: center;
}
/* Success icon encoded */
.IconSuccessEncoded {
/* Note: Do not delete the comment below. It is used to verify the correctness of the encoded image resource below before the product is released */
/* [---XsltValidateInternal-Base64EncodedImage:IconSuccess#Begin#background-image: url(data:image/png;base64,#Separator#);#End#] */
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABPElEQVR4Xp1Tv0vDUBi8FqeA4NpBcBLcWnQSApncOnTo4FSnjP0DsnXpH5CxiwbHDg4Zuj4oOEXiJgiC4FDcCkLWmIMc1Pfw+eMgQ77v3Xf3Pe51YKGqqisAEwCR1TIAsiAIblSo6xrdHeJR85Xle3mdmCQKb0PsfqyxxzM8K15HZADl/H5+sHpZwYfxyRjTs+kWwKBx8yoHd2mRiuzF8mkJniWH/13u3Fjrs/EdhsdDFHGB/DLXEJBDLh1MWPAhPo1BLB4WX5yQywHR+m3tVe/t97D52CB/ziG0nIgD/qDuYg8WuCcVZ2YGwlJ3YDugkpR/VNcAEx6GEKhERSr71FuO4YCM4XBdwKvecjIlkSnsO0Hyp/GxSeJAdzBKzpOtnPwyyiPdAZhpZptT04tU+zk7s8czeges//s5C5+CwqrR4/gw+AAAAABJRU5ErkJggg==);
}
/* Information icon encoded */
.IconInfoEncoded {
/* Note: Do not delete the comment below. It is used to verify the correctness of the encoded image resource below before the product is released */
/* [---XsltValidateInternal-Base64EncodedImage:IconInformation#Begin#background-image: url(data:image/png;base64,#Separator#);#End#] */
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABHElEQVR4Xs2TsUoDQRRF7wwoziokjZUKadInhdhukR9YP8DMX1hYW+QvdsXa/QHBbcXC7W0CamWTQnclFutceIQJwwaWNLlwm5k5d94M76mmaeCrrmsLYOocY12FcxZFUeozCqKqqgYA8uevv1H6VuPxcwlfk5N92KHBxfFeCSAxxswlYAW/Xr989x/mv9gkhtyMDhcAxgzRsp7flj8B/HF1RsMXq+NZMkopaHe7lbKxQUEIGbKsYNoGn969060hZBkQex/W8oRQwsQaW2o3Ago2SVcJUzAgY3N0lTCZZm+zPS8HB51gMmS1DEYyOz9acKO1D8JWTlafKIMxdhvlfdyT94Vv5h7P8Ky7nQzACmhvKq3zk3PjW9asz9D/1oigecsioooAAAAASUVORK5CYII=);
}
/* Warning icon encoded */
.IconWarningEncoded {
/* Note: Do not delete the comment below. It is used to verify the correctness of the encoded image resource below before the product is released */
/* [---XsltValidateInternal-Base64EncodedImage:IconWarning#Begin#background-image: url(data:image/png;base64,#Separator#);#End#] */
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAx0lEQVR4XpWSMQ7CMAxFf4xAyBMLCxMrO8dhaBcuwdCJS3RJBw7SA/QGTCxdWJgiQYWKXJWKIXHIlyw5lqr34tQgEOdcBsCOx5yZK3hCCKdYXneQkh4pEfqzLfu+wVDSyyzFoJjfz9NB+pAF+eizx2Vruts0k15mPgvS6GYvpVtQhB61IB/dk6AF6fS4Ben0uIX5odtFe8Q/eW1KvFeH4e8khT6+gm5B+t3juyDt7n0jpe+CANTd+oTUjN/U3yVaABnSUjFz/gFq44JaVSCXeQAAAABJRU5ErkJggg==);
}
/* Error icon encoded */
.IconErrorEncoded {
/* Note: Do not delete the comment below. It is used to verify the correctness of the encoded image resource below before the product is released */
/* [---XsltValidateInternal-Base64EncodedImage:IconError#Begin#background-image: url(data:image/png;base64,#Separator#);#End#] */
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABQElEQVR4XqWTvUoEQRCE6wYPZUA80AfwAQz23uCMjA7MDRQEIzPBVEyNTQUFIw00vcQTTMzuAh/AxEQQT8HF/3G/oGGnEUGuoNnd6qoZuqltyKEsyzVJq5I6rnUp6SjGeGhESikzzlc1eL7opfuVbrqbU1Zw9NCgtQMaZpY0eNnaaL2fHusvTK5vKu7sjSS1Y4y3QUA6K3e3Mau5UFDyMP7tYF9o8cAHZv68vipoIJg971PZIZ5HiwdvYGGvFVFHmGmZ2MxwmQYPXubPl9Up0tfoMQGetXd6mRbvhBw+boZ6WF7Mbv1+GsHRk0fQmPAH1GfmZirbCfDJ61tw3Px8/8pZsPAG4jlVhcPgZ7adwNWBB68lkRQWFiTgFlbnLY3DGGM7izIJIyT/jjIvEJw6fdJTc6krDzh6aMwMP9bvDH4ADSsa9uSWVJkAAAAASUVORK5CYII=);
}
</style>
</head>
<body>
<h1 _locid="PortabilityReport">.NET Portability Report</h1>
<div id="content">
<div id="submissionId" style="font-size:8pt;">
<p>
<i>
Submission Id
40d81f68-e207-4143-8a2e-3fa3f6948d61
</i>
</p>
</div>
<h2 _locid="SummaryTitle">
<a name="Portability Summary"></a>Portability Summary
</h2>
<div id="summary">
<table>
<tbody>
<tr>
<th>Assembly</th>
<th>ASP.NET 5,Version=v1.0</th>
<th>Windows,Version=v8.1</th>
<th>.NET Framework,Version=v4.6</th>
<th>Windows Phone,Version=v8.1</th>
</tr>
<tr>
<td><strong><a href="#JackieUtils">JackieUtils</a></strong></td>
<td class="text-center">78.73 %</td>
<td class="text-center">66.52 %</td>
<td class="text-center">100.00 %</td>
<td class="text-center">66.52 %</td>
</tr>
</tbody>
</table>
</div>
<div id="details">
<a name="JackieUtils"><h3>JackieUtils</h3></a>
<table>
<tbody>
<tr>
<th>Target type</th>
<th>ASP.NET 5,Version=v1.0</th>
<th>Windows,Version=v8.1</th>
<th>.NET Framework,Version=v4.6</th>
<th>Windows Phone,Version=v8.1</th>
<th>Recommended changes</th>
</tr>
<tr>
<td>System.Collections.CollectionBase</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_Count</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Collections.Hashtable</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">#ctor</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">Add(System.Object,System.Object)</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">Clear</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">ContainsKey(System.Object)</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_Item(System.Object)</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_SyncRoot</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">set_Item(System.Object,System.Object)</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Collections.Specialized.NameObjectCollectionBase</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_Count</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Collections.Specialized.NameValueCollection</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">Add(System.String,System.String)</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_AllKeys</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_Item(System.String)</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Data.Common.DbCommand</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">ExecuteNonQuery</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">ExecuteScalar</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Data.Common.DbConnection</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">Close</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">Open</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Data.Common.DbDataReader</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">Close</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_FieldCount</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">GetName(System.Int32)</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">GetValue(System.Int32)</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">Read</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Data.Common.DbParameter</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">set_Value(System.Object)</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Data.Common.DbParameterCollection</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">AddRange(System.Array)</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">Clear</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Drawing.Bitmap</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">#ctor(System.Int32,System.Int32)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Drawing.Brush</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Drawing.Color</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_Black</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_Brown</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_DarkBlue</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_DarkCyan</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_Green</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_LightGray</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_Orange</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_Purple</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_Red</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_White</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Drawing.Font</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">#ctor(System.String,System.Single,System.Drawing.FontStyle)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Drawing.FontStyle</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Drawing.Graphics</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">Clear(System.Drawing.Color)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">Dispose</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">DrawRectangle(System.Drawing.Pen,System.Int32,System.Int32,System.Int32,System.Int32)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">DrawString(System.String,System.Drawing.Font,System.Drawing.Brush,System.Single,System.Single)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">FromImage(System.Drawing.Image)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Drawing.Image</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">Dispose</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_Height</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_Width</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">Save(System.IO.Stream,System.Drawing.Imaging.ImageFormat)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Drawing.Imaging.ImageFormat</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_Jpeg</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Drawing.Pen</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">#ctor(System.Drawing.Color,System.Single)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Drawing.SolidBrush</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">#ctor(System.Drawing.Color)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Environment</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Use Directory.GetCurrentDirectory()</td>
</tr>
<tr>
<td style="padding-left:2em">get_CurrentDirectory</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Use Directory.GetCurrentDirectory()</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.IO.Directory</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">CreateDirectory(System.String)</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">GetFiles(System.String,System.String)</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.IO.DirectoryInfo</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.IO.StreamReader</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Use File.Open to get a Stream then pass it to StreamReader constructor</td>
</tr>
<tr>
<td style="padding-left:2em">#ctor(System.String,System.Text.Encoding)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Use File.Open to get a Stream then pass it to StreamReader constructor</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.IO.StreamWriter</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Use File.Open to get a Stream then pass it to StreamWriter constructor</td>
</tr>
<tr>
<td style="padding-left:2em">#ctor(System.String,System.Boolean)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Use File.Open to get a Stream then pass it to StreamWriter constructor</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.IO.TextReader</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Use Dispose instead</td>
</tr>
<tr>
<td style="padding-left:2em">Close</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Use Dispose instead</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.IO.TextWriter</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Use Dispose instead</td>
</tr>
<tr>
<td style="padding-left:2em">Close</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Use Dispose instead</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Net.CookieContainer</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">Add(System.Net.CookieCollection)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Net.HttpWebRequest</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_ClientCertificates</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Use System.Net.Http.WinHttpHandler.ClientCertificates</td>
</tr>
<tr>
<td style="padding-left:2em">get_ServicePoint</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Not supported - connections and connection groups are managed internally by the HTTP stack</td>
</tr>
<tr>
<td style="padding-left:2em">set_AllowAutoRedirect(System.Boolean)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Use System.Net.Http.HttpClientHandler.AllowAutoRedirect</td>
</tr>
<tr>
<td style="padding-left:2em">set_Host(System.String)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">set_KeepAlive(System.Boolean)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Use System.Net.Http.HttpResponseMessage.Headers.Connection.Add("Keep-Alive")</td>
</tr>
<tr>
<td style="padding-left:2em">set_ProtocolVersion(System.Version)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Use System.Net.Http.HttpRequestMessage.Version</td>
</tr>
<tr>
<td style="padding-left:2em">set_ReadWriteTimeout(System.Int32)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Use System.Net.Http.WinHttpHandler.ReceiveTimeout, .SendTimeout</td>
</tr>
<tr>
<td style="padding-left:2em">set_Referer(System.String)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Use System.Net.Http.HttpRequestMessage.Headers.Referrer</td>
</tr>
<tr>
<td style="padding-left:2em">set_UserAgent(System.String)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Use System.Net.Http.HttpClient.DefaultRequestHeaders.UserAgent (applies to all requests made by that client) or System.Net.Http.HttpRequestMessage.Headers.UserAgent (applies to specific request)</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Net.HttpWebResponse</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Use System.Net.Http.HttpContent.Headers.ContentEncoding</td>
</tr>
<tr>
<td style="padding-left:2em">get_CharacterSet</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_ContentEncoding</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Use System.Net.Http.HttpContent.Headers.ContentEncoding</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Net.Security.RemoteCertificateValidationCallback</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Not supported for HTTP - use new Handler and ignorable server certificate errors instead</td>
</tr>
<tr>
<td style="padding-left:2em">#ctor(System.Object,System.IntPtr)</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Not supported for HTTP - use new Handler and ignorable server certificate errors instead</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Net.Security.SslPolicyErrors</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Not supported for HTTP - use new Handler and ignorable server certificate errors instead</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Net.ServicePoint</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Use System.Net.Http.HttpClient, System.Net.Http.HttpClientHandler and System.Net.Http.WinHttpHandler types instead</td>
</tr>
<tr>
<td style="padding-left:2em">set_ConnectionLimit(System.Int32)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Use System.Net.Http.HttpClient, System.Net.Http.HttpClientHandler and System.Net.Http.WinHttpHandler types instead</td>
</tr>
<tr>
<td style="padding-left:2em">set_Expect100Continue(System.Boolean)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Not supported. Expect: 100-Continue is turned off always.</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Net.ServicePointManager</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Use System.Net.HttpClient or WinHttpHandler instead.</td>
</tr>
<tr>
<td style="padding-left:2em">set_ServerCertificateValidationCallback(System.Net.Security.RemoteCertificateValidationCallback)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Use System.Net.Http.HttpClient, System.Net.Http.HttpClientHandler and System.Net.Http.WinHttpHandler types instead</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Net.WebProxy</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">#ctor(System.String,System.Boolean)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">#ctor(System.String,System.Int32)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">set_Credentials(System.Net.ICredentials)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Net.WebRequest</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Use System.Net.Http.HttpClient.SendAsync (returns an HttpResponseMessage)</td>
</tr>
<tr>
<td style="padding-left:2em">GetRequestStream</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Use an System.Net.Http.HttpContent object in the System.Net.Http.HttpRequestMessage when using the HttpClient APIs</td>
</tr>
<tr>
<td style="padding-left:2em">GetResponse</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Use System.Net.Http.HttpClient.SendAsync (returns an HttpResponseMessage)</td>
</tr>
<tr>
<td style="padding-left:2em">set_ContentLength(System.Int64)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Use System.Net.Http.HttpContent.Headers.ContentLength</td>
</tr>
<tr>
<td style="padding-left:2em">set_Timeout(System.Int32)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Use System.Net.Http.HttpClient.Timeout. More granular timeouts available: Use System.Net.Http.WinHttpHandler.ConnectTimeout, .ReceiveTimeout, .SendTimeout</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Reflection.Assembly</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Use System.Activator.CreateInstance(Assembly.GetType()) on type you are interested in.</td>
</tr>
<tr>
<td style="padding-left:2em">CreateInstance(System.String,System.Boolean)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Use System.Activator.CreateInstance(Assembly.GetType()) on type you are interested in.</td>
</tr>
<tr>
<td style="padding-left:2em">GetTypes</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Use Assembly.DefinedTypes</td>
</tr>
<tr>
<td style="padding-left:2em">LoadFrom(System.String)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Use AssemblyLoadContext</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Reflection.BindingFlags</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Security.Cryptography.X509Certificates.X509Certificate</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">#ctor(System.String)</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Security.Cryptography.X509Certificates.X509CertificateCollection</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">Add(System.Security.Cryptography.X509Certificates.X509Certificate)</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">GetEnumerator</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Security.Cryptography.X509Certificates.X509CertificateCollection.X509CertificateEnumerator</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_Current</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">MoveNext</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Security.Cryptography.X509Certificates.X509Chain</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Text.Encoding</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Call Encoding.GetString(byte[], int, int)</td>
</tr>
<tr>
<td style="padding-left:2em">get_Default</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Use GetEncoding(0)</td>
</tr>
<tr>
<td style="padding-left:2em">GetString(System.Byte[])</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Call Encoding.GetString(byte[], int, int)</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Type</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">GetMethod(System.String)</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">GetMethods</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">GetProperties</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">GetProperty(System.String,System.Reflection.BindingFlags)</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Web.Caching.Cache</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_Item(System.String)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">GetEnumerator</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">Insert(System.String,System.Object)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">Insert(System.String,System.Object,System.Web.Caching.CacheDependency,System.DateTime,System.TimeSpan)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">Insert(System.String,System.Object,System.Web.Caching.CacheDependency,System.DateTime,System.TimeSpan,System.Web.Caching.CacheItemPriority,System.Web.Caching.CacheItemRemovedCallback)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">Remove(System.String)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Web.Caching.CacheDependency</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Web.Caching.CacheItemPriority</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Web.Caching.CacheItemRemovedCallback</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Web.HttpContext</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_Current</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_Request</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_Server</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_Session</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Web.HttpRequest</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_Item(System.String)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Web.HttpRuntime</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_Cache</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Web.HttpServerUtility</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">MapPath(System.String)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Web.SessionState.HttpSessionState</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">Clear</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_Item(System.String)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">set_Item(System.String,System.Object)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</tbody>
</table>
<p>
<a href="#Portability Summary">Back to Summary</a>
</p>
</div>
</div>
</body>
</html>
|
kuhlenh/port-to-core
|
Reports/ja/jackieutils.1.3.0.6/JackieUtils-net40.html
|
HTML
|
mit
| 102,170
|
import $ from 'jquery'
import template from './Loadbox.html'
import Mustache from 'mustache'
import img1 from '../../images/load-circle.png'
import img2 from '../../images/load-bg.png'
import img3 from '../../images/logo.png'
import img4 from '../../images/slogan.png'
import img5 from '../../images/panel-bg.jpg'
import img6 from '../../images/button.png'
import img7 from '../../images/leftnav.png'
import img8 from '../../images/intro_1_pic.png'
import img9 from '../../images/intro_2_pic.png'
import img10 from '../../images/intro_3_pic.png'
import img11 from '../../images/intro_1_txt.png'
import img12 from '../../images/intro_2_txt.png'
import img13 from '../../images/intro_3_txt.png'
import img14 from '../../images/intro_4_txt.png'
import img15 from '../../images/intro_5_txt.png'
import img16 from '../../images/bg.jpg'
export default class Loadbox {
constructor(type) {
this.type = type;
}
render() {
let preload = []
switch(this.type) {
case 'landing':
preload = [img1,img2,img3,img4,img5,img6,img7,img8,img9,img10,img11,img12,img13,img14,img15,img16]
break
default:
preload = []
}
$('#preload').html(
Mustache.render(template, {preload: preload})
);
}
}
|
RainKolwa/goon_cowala_feb
|
src/components/Loadbox/Index.js
|
JavaScript
|
mit
| 1,235
|
const postcss = require('postcss');
const fs = require('fs');
const plugin = require('../index');
const pkg = require('../package.json');
/**
* Runs the plugins process function. Tests whether the given input is equal
* to the expected output with the given options.
*
* @param {string} input Input fixture file name.
* @param {object} opts Options to be used by the plugin.
* @return {function}
*/
function run(input, opts = {}) {
const raw = fs.readFileSync(`./test/fixtures/${input}.css`, 'utf8');
const expected = fs.readFileSync(`./test/fixtures/${input}.expected.css`, 'utf8');
return postcss([plugin(opts)]).process(raw, { from: undefined })
.then(result => {
expect(result.css).toEqual(expected);
expect(result.warnings().length).toBe(0);
});
}
it('Should replace strings in comments and styles.', () => {
return run('basic', { data: pkg });
});
it('Should throw a TypeError if invalid pattern is supplied.', () => {
return run('basic', { data: pkg, pattern: '' }).catch(e =>
expect(e).toBeInstanceOf(TypeError)
)
});
it('Should not replace anything in styles when “commentsOnly” option is set to TRUE.', () => {
return run('commentsOnly', { data: pkg, commentsOnly: true });
});
it('Should not replace anything without data', () => {
return run('noChanges');
});
it('Should not change unknown variables', () => {
return run('noChanges', { data: pkg });
});
it('Should work with deep data objects', () => {
return run('deep', { data: { level1: { level2: 'test' } } });
});
it('Should work with a custom RegEx', () => {
return run('otherRegex', { data: pkg, pattern: /%\s?([^\s]+?)\s?%/gi });
});
it('Should work with a custom RegEx object', () => {
return run('basic', { data: pkg, pattern: new RegExp(/{{\s?([^\s]+?)\s?}}/, 'gi') });
});
it('Should work with a custom RegEx string', () => {
return run('basic', { data: pkg, pattern: '{{\\s?([^\\s]+?)\\s?}}' });
});
it('Should work with another custom RegEx string', () => {
return run('otherRegex', { data: pkg, pattern: '%\\s?([^\\s]+?)\\s?%' });
});
it('Should work with empty string values', () => {
return run('empty', { data: { value: '' } });
});
it('Should work with undefined values', () => {
return run('noChanges', { data: { value: undefined } });
});
it('Should work with null values', () => {
return run('noChanges', { data: { value: null } });
});
it('Should work with null data', () => {
return run('noChanges', { data: null });
});
it('Should not replace multiple times', () => {
return run('noDuplicate', {
pattern: /(a)/g,
data: { a: 'abc'}
});
});
it('Should replace strings in selectors', () => {
return run('selectors', {
pattern: /(foo)/g,
data: { 'foo': 'bar' },
});
});
it('Should replace regex to empty in selectors', () => {
return run('regexEmpty', {
pattern: /\[.*\]:delete\s+/gi,
data: { replaceAll: '' }
});
});
it('Should replace regex to single value in selectors', () => {
return run('regexValue', {
pattern: /\[.*\]:delete/gi,
data: { replaceAll: '.newValue' }
});
});
it('Should work with custom Regex string', () => {
return run('customRegexValue', {
pattern: new RegExp(/%replace_me%/, 'gi'),
data: { replaceAll: 'new awesome string :)' }
});
});
it('Should replace properties and values', () => {
return run('replaceProperties', {
pattern: /##\((.*?)\)/g,
data: {
'prop': 'color',
'name': 'basic',
'key': 'dark',
'value': '#9c9c9c'
},
});
});
|
gridonic/postcss-replace
|
test/index.test.js
|
JavaScript
|
mit
| 3,694
|
<?php
return array (
'id' => 'htc_desire_500_ver1',
'fallback' => 'generic_android_ver4_1',
'capabilities' =>
array (
'uaprof' => 'http://www.htcmms.com.tw/Android/Vodafone/0P3Z11/ua-profile.xml',
'model_name' => 'Desire 500',
'brand_name' => 'HTC',
'release_date' => '2013_august',
'physical_screen_height' => '94',
'physical_screen_width' => '57',
'resolution_width' => '480',
'resolution_height' => '800',
'max_data_rate' => '7200',
),
);
|
cuckata23/wurfl-data
|
data/htc_desire_500_ver1.php
|
PHP
|
mit
| 489
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>printf: 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.13.1 / printf - 1.0.1</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
printf
<small>
1.0.1
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-02-18 03:17:35 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-02-18 03:17:35 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-threads base
base-unix base
conf-findutils 1 Virtual package relying on findutils
conf-gmp 4 Virtual package relying on a GMP lib system installation
coq 8.13.1 Formal proof management system
num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.12.1 The OCaml compiler (virtual package)
ocaml-base-compiler 4.12.1 Official release 4.12.1
ocaml-config 2 OCaml Switch Configuration
ocaml-options-vanilla 1 Ensure that OCaml is compiled with no special options enabled
ocamlfind 1.9.3 A library manager for OCaml
zarith 1.12 Implements arithmetic and logical operations over arbitrary-precision integers
# opam file:
opam-version: "2.0"
maintainer: "gmalecha@gmail.com"
homepage: "https://github.com/gmalecha/coq-printf"
dev-repo: "git+https://github.com/gmalecha/coq-printf"
bug-reports: "https://github.com/gmalecha/coq-printf/issues"
authors: ["Gregory Malecha"]
license: "MIT"
build: [
[make "-j%{jobs}%"]
]
install: [
[make "install"]
]
depends: [
"ocaml"
"coq" {>= "8.8" & < "8.12~"}
]
tags: [
"date:2020-03-18"
"logpath:Printf"
]
synopsis:
"Implementation of sprintf for Coq"
description: "Library providing implementation of sprintf for Coq"
url {
src: "https://github.com/gmalecha/coq-printf/archive/v1.0.1.tar.gz"
checksum: "sha512=41870c51fc40f751fbb6e793a5b54b2f9cbddc43efc860758c0af0b291f5a9454583676e87a5584b28a5e72ebdcdd0f903c743160c501b3d940fe232738d718d"
}
</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-printf.1.0.1 coq.8.13.1</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.13.1).
The following dependencies couldn't be met:
- coq-printf -> coq < 8.12~ -> ocaml < 4.12
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-printf.1.0.1</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>
|
coq-bench/coq-bench.github.io
|
clean/Linux-x86_64-4.12.1-2.0.8/released/8.13.1/printf/1.0.1.html
|
HTML
|
mit
| 6,839
|
//
// ViewController.h
// lineAnimotion
//
// Created by pengshixin on 16/6/23.
// Copyright © 2016年 pengshixin. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@end
|
ShixinPeng/lineAnimotion
|
lineAnimotion/lineAnimotion/ViewController.h
|
C
|
mit
| 223
|
require 'pry'
module Zephyre
class Controller
attr_reader :request
def initialize(env)
@request ||= Rack::Request.new(env)
end
def params
request.params
end
def response(body, status=200, header={})
@response = Rack::Response.new(body, status, header)
end
def get_response
@response
end
def render(*args)
response(render_template(*args), 200, {"Content-Type" => "text/html"})
end
def render_template(view_name, locals = {})
filename = File.join("app", "views", controller_name, "#{view_name}.erb")
# If we find a file, render it, otherwise just render whatever was passed as a string
template = File.file?(filename) ? File.read(filename) : view_name.to_s
vars = {}
instance_variables.each do |var|
key = var.to_s.gsub("@", "").to_sym
vars[key] = instance_variable_get(var)
end
ERB.new(template).result(binding)
end
def controller_name
self.class.to_s.gsub(/Controller$/, "").to_snake_case
end
def dispatch(action)
content = self.send(action)
if get_response
get_response
else
render(action)
get_response
end
end
def self.action(action_name)
-> (env) { self.new(env).dispatch(action_name) }
end
end
end
|
alexdovzhanyn/zephyre
|
lib/zephyre/controller.rb
|
Ruby
|
mit
| 1,246
|
<link rel="import" href="libs.html">
<link rel="import" href="x-tab.html">
<template id="tabs">
<style>
:host {
display: block;
}
:host([border]) {
border: 1px solid rgba(127,127,127,0.1);
padding-top: 5px;
background-color: rgba(127,127,127,0.1);
}
.tabs-inner {
z-index: 1;
}
/*:host([chrome]) .tabs-inner > ::content > *:first-child {
margin-left: 4px;
}*/
.tabs-toolbar {
display: none;
}
:host([toolbar]) .tabs-toolbar {
display: block;
z-index: 2;
--margin-top: -1px;
border: 1px solid rgba(127,127,127,0.5);
border-top: none;
background-color: rgba(127,127,127,0.5);
padding: 2px;
}
</style>
<div class="tabs-inner">
<content select="&tab, .tab"></content>
</div>
<div class="tabs-toolbar">
<content></content>
</div>
</template>
<script>
(function() {
"use strict"
var domutil = attrs.domutil;
function Tabs(options) {
this.super(options);
}
function prepare(tabs, tab, z) {
tab.style.zIndex = z--;
tab._tabsfn = function(e) {
if( this.getAttribute('disabled') === null ) tabs.select(this);
var href = this.getAttribute('href');
if( href ) window.location.href = href;
};
tab.addEventListener('click', tab._tabsfn);
}
Tabs.prototype = {
onReady: function() {
// event regist for "connect" attribute
var self = this;
var dom = this.dom;
this.on('tabselect tabdeselect tabclose', function(e) {
var connect = self.connect();
var connectBy = self.connectBy();
var tab = e.detail.selected || e.detail.deselected || e.detail.closed;
var tabs = self.tabs();
var invoke = function(method, index) {
if( typeof connect[method] !== 'function' )
return console.warn('not compatible connected element.' + method + ' function not defined', connect, 'of', this);
if( !connectBy ) {
// default by index
connect[method](index);
} else {
// by attribute name value
var v = tab.getAttribute(connectBy);
if( v ) connect[method](connectBy, v);
}
}
if( connect ) {
// tab 가 attach 된 시점에서 for 대상이 하위에 존재한다면, 아직 초기화되지 않았을테니, setTimeout 으로 호출
setTimeout(function() {
if( !e.defaultPrevented ) {
if( typeof connect === 'string' ) connect = domutil.closest(dom, connect) || document.querySelector(connect) || connect;
if( !connect ) return console.warn('not found connected element', dom, connect);
if( e.type === 'tabselect' ) invoke('select', e.detail.selectedIndex);
else if( e.type === 'tabdeselect' ) invoke('deselect', e.detail.deselectedIndex);
else if( e.type === 'tabclose' ) invoke('close', e.detail.closedIndex);
}
}, 1);
}
});
// initial active
var tabs = this.tabs();
var active = tabs[0];
tabs.forEach(function(tab) {
if( tab.getAttribute('active') !== null ) active = tab;
tab.removeAttribute('active');
});
if( active ) this.select(active);
},
onAdd: function(e) {
var self = this;
var tabs = this.tabs();
e.detail.added.forEach(function(el) {
if( !~tabs.indexOf(el) ) return;
if( el.nodeType === 1 ) prepare(self, el, z);
});
var z = 1000;
tabs.forEach(function(tab) {
tab.style.zIndex = z--;
});
var selected = this.selected;
if( selected ) selected.style.zIndex = 1000;
this.tabsizing();
},
onRemove: function(e) {
e.detail.removed.forEach(function(el) {
if( el._tabsfn ) {
el.removeEventListener('click', el._tabsfn);
el.removeEventListener('close', el._tabsfn);
}
});
},
// options
toolbar: function(toolbar) {
if( !arguments.length ) return this.attr('toolbar') !== null ? true : false;
this.attr('toolbar', toolbar !== null ? '' : null);
return this;
},
equally: function(equally) {
if( !arguments.length ) return this.attr('equally') !== null ? true : false;
this.attr('equally', equally !== null ? '' : null);
this.tabsizing();
return this;
},
// methods
tabsizing: function() {
if( this.equally() ) {
var tabs = this.tabs();
var length = tabs.length;
var width = (100 / length) + '%';
tabs.forEach(function(tab) {
tab.style.width = width;
});
}
return this;
},
tabs: function(attr, value) {
var tabs = [].slice.call(this.shadowdom().find('content[select]').getDistributedNodes());
if( !arguments.length ) return tabs;
return tabs.filter(function(tab) {
return child.getAttribute && child.getAttribute(attr) === value ? true : false;
});
},
indexOf: function(tab) {
return this.tabs().indexOf(tab);
},
select: function(tab, value) {
var tabs = this.tabs();
if( typeof tab === 'number' ) tab = tabs[tab];
if( typeof tab === 'string' ) tab = this.tabs(tab, value)[0];
var index = tabs.indexOf(tab);
if( !~index ) return console.error('tab does not a member of this tab', arguments[0]);
var dom = this.dom;
var changed = this.selected ? true : false;
this.deselect();
tab.setAttribute('active', '');
tab.style.zIndex = 1000;
this.selected = dom.selected = tab;
var detail = {selected:tab,selectedIndex:index};
this.fire('tabselect', detail);
this.fire(tab, 'select', detail);
if( changed ) this.fire('tabchange', detail);
return this;
},
deselect: function() {
if( this.selected ) {
var dom = this.dom;
var tabs = this.tabs();
var old = this.selected;
var detail = {deselected:old,deselectedIndex:tabs.indexOf(old)};
this.fire('tabdeselect', detail);
this.fire(old, 'deselect', detail);
this.selected = dom.selected = null;
var z = 1000;
tabs.forEach(function(tab) {
tab.removeAttribute('active');
tab.style.zIndex = z--;
});
}
return this;
},
close: function(tab) {
var tabs = this.tabs();
if( typeof tab === 'number' ) tab = tabs[tab];
if( typeof tab === 'string' ) tab = this.tabs(tab, value)[0];
var index = tabs.indexOf(tab);
if( ~index ) {
var detail = {closed:tab,closedIndex:index};
var e = this.fire('tabclose', detail, true);
var e2 = this.fire(tab, 'close', detail, true);
if( !e.defaultPrevented && !e2.defaultPrevented ) {
if( this.selected === tab ) this.deselect();
this.dom.removeChild(tab);
this.fire('tabclosed', detail, true);
this.fire(tab, 'closed', {from:this}, true);
index = index - 1;
if( index < 0 ) index = 0;
this.select(index);
this.tabsizing();
return true;
}
}
return false;
},
next: function() {
var tabs = this.tabs();
var index = tabs.indexOf(this.selected);
var next = tabs[index+1];
if( next ) this.select(next);
return this;
},
prev: function() {
var tabs = this.tabs();
var index = tabs.indexOf(this.selected);
var prev = tabs[index-1];
if( prev ) this.select(prev);
return this;
}
};
Tabs = UIAlien(Tabs, {
name: 'tabs',
tpl: '#tabs',
options: {
equally: Boolean,
connect: String,
connectBy: String,
creatable: Boolean
},
events: ['tabselect', 'tabdeselect', 'tabchange', 'tabclose']
});
})();
</script>
<!-- --
<link rel="import" href="x-cards.html">
<x-tabs id="tab1" connect="#cards" connect-by="name" equally>
<x-tab name="a">tab1</x-tab>
<x-tab name="b">tab2</x-tab>
</x-tabs>
<br>
<a href="javascript:document.querySelector('#tab1').prev();">tab1.prev</a>
<a href="javascript:document.querySelector('#tab1').next();">tab1.next</a>
<br>
<x-tabs id="tab2" connect="#cards" chrome>
<x-tab active>tab1</x-tab>
<x-tab>tab2</x-tab>
<x-tab closable>tab3</x-tab>
<x-tab onselect="console.log('selected', this)">tab4</x-tab>
<x-tab ondeselect="console.log('deselected', this)">tab5</x-tab>
<x-tab>tab6</x-tab>
</x-tabs>
<x-cards id="cards">
<div name="a">content1</div>
<div name="b">content2</div>
<div>content3</div>
<div>content4</div>
<div>content5</div>
<div>content6</div>
</x-cards>
<br>
<a href="javascript:document.querySelector('#tab2').prev();">tab2.prev</a>
<a href="javascript:document.querySelector('#tab2').next();">tab2.next</a>
<x-tabs chrome connect="#cards2">
<x-tab>tab1</x-tab>
<x-tab active>tab2</x-tab>
<x-tab closable>closable</x-tab>
<x-tab onselect="console.log('selected', this)">tab1</x-tab>
<x-tab ondeselect="console.log('deselected', this)">tab1</x-tab>
<x-tab>tab1</x-tab>
</x-tabs>
<x-cards id="cards2" style="border:1px solid #ccc;border-top:none;min-height:300px;">
<div>content1</div>
<div>content2</div>
<div>content3</div>
<div>content4</div>
<div>content5</div>
<div>content6</div>
</x-cards>
<x-tabs select="2" ontabselect="console.log('tabselect', this.selected, this.selectedIndex);" ontabdeselect="console.log('tabdeselect', event.detail.deselected, event.detail.deselectedIndex);">
<x-tab>tab1</x-tab>
<x-tab active>tab2</x-tab>
<x-tab closable>closable</x-tab>
<x-tab onselect="console.log('selected', this)">tab1</x-tab>
<x-tab ondeselect="console.log('deselected', this)">tab1</x-tab>
<x-tab>tab1</x-tab>
<div>div</div>
</x-tabs>
<script>
if( document === (document._currentScript || document.currentScript).ownerDocument ) {
window.addEventListener('load', function() {
var UI = UIAlien;
var tabs = new UI.Tabs({
attrs: ['chrome'],
html: '<x-tab>ptab1</x-tab><x-tab>ptab2</x-tab>'
});
tabs.add(new UI.Tab({title:'tab1'}));
tabs.add(new UI.Tab({title:'tab2', closable:true, active:true}));
console.log('tabs', tabs.dom);
document.body.appendChild(tabs.dom);
});
}
</script>
-->
|
attrs/ui-aliens
|
src/tags/x-tabs.html
|
HTML
|
mit
| 11,116
|
#!/usr/bin/env python2
# Copyright (c) 2015 The Bitcoin Core developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
from test_framework.test_framework import ComparisonTestFramework
from test_framework.util import *
from test_framework.mininode import CTransaction, NetworkThread
from test_framework.blocktools import create_coinbase, create_block
from test_framework.comptool import TestInstance, TestManager
from test_framework.script import CScript, OP_1NEGATE, OP_NOP3, OP_DROP
from binascii import hexlify, unhexlify
from io import BytesIO
import time
import itertools
'''
This test is meant to exercise BIP forks
Connect to a single node.
regtest lock-in with 108/144 block signalling
activation after a further 144 blocks
mine 2 block and save coinbases for later use
mine 141 blocks to transition from DEFINED to STARTED
mine 100 blocks signalling readiness and 44 not in order to fail to change state this period
mine 108 blocks signalling readiness and 36 blocks not signalling readiness (STARTED->LOCKED_IN)
mine a further 143 blocks (LOCKED_IN)
test that enforcement has not triggered (which triggers ACTIVE)
test that enforcement has triggered
'''
class BIP9SoftForksTest(ComparisonTestFramework):
def __init__(self):
self.num_nodes = 1
def setup_network(self):
self.nodes = start_nodes(1, self.options.tmpdir,
extra_args=[['-debug', '-whitelist=127.0.0.1']],
binary=[self.options.testbinary])
def run_test(self):
self.test = TestManager(self, self.options.tmpdir)
self.test.add_all_connections(self.nodes)
NetworkThread().start() # Start up network handling in another thread
self.test.run()
def create_transaction(self, node, coinbase, to_address, amount):
from_txid = node.getblock(coinbase)['tx'][0]
inputs = [{ "txid" : from_txid, "vout" : 0}]
outputs = { to_address : amount }
rawtx = node.createrawtransaction(inputs, outputs)
tx = CTransaction()
f = BytesIO(unhexlify(rawtx))
tx.deserialize(f)
tx.nVersion = 2
return tx
def sign_transaction(self, node, tx):
signresult = node.signrawtransaction(hexlify(tx.serialize()))
tx = CTransaction()
f = BytesIO(unhexlify(signresult['hex']))
tx.deserialize(f)
return tx
def generate_blocks(self, number, version, test_blocks = []):
for i in xrange(number):
block = create_block(self.tip, create_coinbase(self.height), self.last_block_time + 1)
block.nVersion = version
block.rehash()
block.solve()
test_blocks.append([block, True])
self.last_block_time += 1
self.tip = block.sha256
self.height += 1
return test_blocks
def get_bip9_status(self, key):
info = self.nodes[0].getblockchaininfo()
for row in info['bip9_softforks']:
if row['id'] == key:
return row
raise IndexError ('key:"%s" not found' % key)
def test_BIP(self, bipName, activated_version, invalidate, invalidatePostSignature):
# generate some coins for later
self.coinbase_blocks = self.nodes[0].generate(2)
self.height = 3 # height of the next block to build
self.tip = int ("0x" + self.nodes[0].getbestblockhash() + "L", 0)
self.nodeaddress = self.nodes[0].getnewaddress()
self.last_block_time = int(time.time())
assert_equal(self.get_bip9_status(bipName)['status'], 'defined')
# Test 1
# Advance from DEFINED to STARTED
test_blocks = self.generate_blocks(141, 4)
yield TestInstance(test_blocks, sync_every_block=False)
assert_equal(self.get_bip9_status(bipName)['status'], 'started')
# Test 2
# Fail to achieve LOCKED_IN 100 out of 144 signal bit 1
# using a variety of bits to simulate multiple parallel softforks
test_blocks = self.generate_blocks(50, activated_version) # 0x20000001 (signalling ready)
test_blocks = self.generate_blocks(20, 4, test_blocks) # 0x00000004 (signalling not)
test_blocks = self.generate_blocks(50, activated_version, test_blocks) # 0x20000101 (signalling ready)
test_blocks = self.generate_blocks(24, 4, test_blocks) # 0x20010000 (signalling not)
yield TestInstance(test_blocks, sync_every_block=False)
assert_equal(self.get_bip9_status(bipName)['status'], 'started')
# Test 3
# 108 out of 144 signal bit 1 to achieve LOCKED_IN
# using a variety of bits to simulate multiple parallel softforks
test_blocks = self.generate_blocks(58, activated_version) # 0x20000001 (signalling ready)
test_blocks = self.generate_blocks(26, 4, test_blocks) # 0x00000004 (signalling not)
test_blocks = self.generate_blocks(50, activated_version, test_blocks) # 0x20000101 (signalling ready)
test_blocks = self.generate_blocks(10, 4, test_blocks) # 0x20010000 (signalling not)
yield TestInstance(test_blocks, sync_every_block=False)
assert_equal(self.get_bip9_status(bipName)['status'], 'locked_in')
# Test 4
# 143 more version 536870913 blocks (waiting period-1)
test_blocks = self.generate_blocks(143, 4)
yield TestInstance(test_blocks, sync_every_block=False)
assert_equal(self.get_bip9_status(bipName)['status'], 'locked_in')
# Test 5
# Check that the new rule is enforced
spendtx = self.create_transaction(self.nodes[0],
self.coinbase_blocks[0], self.nodeaddress, 1.0)
invalidate(spendtx)
spendtx = self.sign_transaction(self.nodes[0], spendtx)
spendtx.rehash()
invalidatePostSignature(spendtx)
spendtx.rehash()
block = create_block(self.tip, create_coinbase(self.height), self.last_block_time + 1)
block.nVersion = activated_version
block.vtx.append(spendtx)
block.hashMerkleRoot = block.calc_merkle_root()
block.rehash()
block.solve()
self.last_block_time += 1
self.tip = block.sha256
self.height += 1
yield TestInstance([[block, True]])
assert_equal(self.get_bip9_status(bipName)['status'], 'active')
# Test 6
# Check that the new sequence lock rules are enforced
spendtx = self.create_transaction(self.nodes[0],
self.coinbase_blocks[1], self.nodeaddress, 1.0)
invalidate(spendtx)
spendtx = self.sign_transaction(self.nodes[0], spendtx)
spendtx.rehash()
invalidatePostSignature(spendtx)
spendtx.rehash()
block = create_block(self.tip, create_coinbase(self.height), self.last_block_time + 1)
block.nVersion = 5
block.vtx.append(spendtx)
block.hashMerkleRoot = block.calc_merkle_root()
block.rehash()
block.solve()
self.last_block_time += 1
yield TestInstance([[block, False]])
# Restart all
stop_nodes(self.nodes)
wait_bitcoinds()
shutil.rmtree(self.options.tmpdir)
self.setup_chain()
self.setup_network()
self.test.clear_all_connections()
self.test.add_all_connections(self.nodes)
NetworkThread().start() # Start up network handling in another thread
def get_tests(self):
for test in itertools.chain(
self.test_BIP('csv', 536870913, self.sequence_lock_invalidate, self.donothing),
self.test_BIP('csv', 536870913, self.mtp_invalidate, self.donothing),
self.test_BIP('csv', 536870913, self.donothing, self.csv_invalidate)
):
yield test
def donothing(self, tx):
return
def csv_invalidate(self, tx):
'''Modify the signature in vin 0 of the tx to fail CSV
Prepends -1 CSV DROP in the scriptSig itself.
'''
tx.vin[0].scriptSig = CScript([OP_1NEGATE, OP_NOP3, OP_DROP] +
list(CScript(tx.vin[0].scriptSig)))
def sequence_lock_invalidate(self, tx):
'''Modify the nSequence to make it fails once sequence lock rule is activated (high timespan)
'''
tx.vin[0].nSequence = 0x00FFFFFF
tx.nLockTime = 0
def mtp_invalidate(self, tx):
'''Modify the nLockTime to make it fails once MTP rule is activated
'''
# Disable Sequence lock, Activate nLockTime
tx.vin[0].nSequence = 0x90FFFFFF
tx.nLockTime = self.last_block_time
if __name__ == '__main__':
BIP9SoftForksTest().main()
|
Kangmo/bitcoin
|
qa/rpc-tests/bip9-softforks.py
|
Python
|
mit
| 8,775
|
require 'rails_helper'
RSpec.describe "user_infos/index", type: :view do
before(:each) do
assign(:user_infos, [
UserInfo.create!(
:hometown => "Hometown",
:major => "Major",
:age => "Age",
:description => "MyText",
:show_email => false
),
UserInfo.create!(
:hometown => "Hometown",
:major => "Major",
:age => "Age",
:description => "MyText",
:show_email => false
)
])
end
it "renders a list of user_infos" do
render
assert_select "tr>td", :text => "Hometown".to_s, :count => 2
assert_select "tr>td", :text => "Major".to_s, :count => 2
assert_select "tr>td", :text => "Age".to_s, :count => 2
assert_select "tr>td", :text => "MyText".to_s, :count => 2
assert_select "tr>td", :text => false.to_s, :count => 2
end
end
|
code4naropa/ournaropa-forum
|
spec/views/ournaropa_forum/user_infos/index.html.erb_spec.rb
|
Ruby
|
mit
| 860
|
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" />
<meta name="HandheldFriendly" content="True" />
<title>Woven</title>
</head>
<body>
<canvas id="c">Sorry, your browser does not support canvas.</canvas>
<script>
var experiment = {};
experiment.setup = function () {
// check if the browser has any idea if we can do the setup yet
if (!window.innerWidth) {
setTimeout(experiment.setup, 500);
return;
}
// grab canvas and drawing context
var canvas = document.getElementById('c'), context = canvas.getContext('2d');
if (!context) {
return;
}
// some css tweaks
document.body.style.background = "#000000";
document.body.style.margin = 0;
document.body.style.overflow = "hidden";
// fill canvas to browser size
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
// draw here
context.fillStyle = "#ffffff";
context.fillRect(0, 0, canvas.width, canvas.height);
var shapeStroke = "#000000";
var shapeFill = "#ffffff";
var shapes = [];
shapes[0] = ['stroke-hor', 'stroke-vert', 'fill-hor', 'fill-vert'];
shapes[1] = ['stroke-hor', 'fill-hor', 'stroke-vert', 'fill-vert'];
shapes[2] = ['stroke-vert', 'fill-vert', 'stroke-hor', 'fill-hor'];
var nX = Math.ceil(canvas.width / 32) + 3;
var nY = Math.ceil(canvas.height / 32) + 3;
for (var y = 0; y < nY; y++) {
for (var x = 0; x < nX; x++) {
var point = {
x: -32 + (x * 32),
y: -32 + (y * 32),
};
var chosenShapes = shapes[Math.floor(Math.random() * shapes.length)];
for (var s = 0; s < chosenShapes.length; s++) {
switch (chosenShapes[s]) {
case 'stroke-hor':
context.fillStyle = shapeStroke;
context.fillRect(point.x - 16, point.y - 6, 32, 13);
break;
case 'stroke-vert':
context.fillStyle = shapeStroke;
context.fillRect(point.x - 6, point.y - 16, 13, 32);
break;
case 'fill-hor':
context.fillStyle = shapeFill;
context.fillRect(point.x - 16, point.y - 5, 32, 10);
break;
case 'fill-vert':
context.fillStyle = shapeFill;
context.fillRect(point.x - 5, point.y - 16, 10, 32);
break;
}
}
}
}
};// end setup closure
// if this html document is ready we can begin thinking of the experiment setup
if (document.readyState === 'complete'){
experiment.setup();
} else {
window.onload = function (){
experiment.setup();
}
}
</script>
</body>
</html>
|
Quinten/doodles
|
woven.html
|
HTML
|
mit
| 3,034
|
package backend
import (
"testing"
"github.com/stretchr/testify/assert"
)
var (
testStartAttributesTestCases = []struct {
A []*StartAttributes
O []*StartAttributes
}{
{
A: []*StartAttributes{
{Language: ""},
{Language: "ruby"},
{Language: "python", Dist: "trusty"},
{Language: "python", Dist: "trusty", Group: "edge"},
{Language: "python", Dist: "frob", Group: "edge", OS: "flob"},
{Language: "python", Dist: "frob", OsxImage: "", Group: "edge", OS: "flob"},
{Language: "python", Dist: "frob", OsxImage: "", Group: "edge", OS: "flob", VMType: "premium"},
},
O: []*StartAttributes{
{Language: "default", Dist: "precise", Group: "stable", OS: "linux", VMType: "default"},
{Language: "ruby", Dist: "precise", Group: "stable", OS: "linux", VMType: "default"},
{Language: "python", Dist: "trusty", Group: "stable", OS: "linux", VMType: "default"},
{Language: "python", Dist: "trusty", Group: "edge", OS: "linux", VMType: "default"},
{Language: "python", Dist: "frob", Group: "edge", OS: "flob", VMType: "default"},
{Language: "python", Dist: "frob", OsxImage: "", Group: "edge", OS: "flob", VMType: "default"},
{Language: "python", Dist: "frob", OsxImage: "", Group: "edge", OS: "flob", VMType: "premium"},
},
},
}
)
func TestStartAttributes(t *testing.T) {
sa := &StartAttributes{}
assert.Equal(t, "", sa.Dist)
assert.Equal(t, "", sa.Group)
assert.Equal(t, "", sa.Language)
assert.Equal(t, "", sa.OS)
assert.Equal(t, "", sa.OsxImage)
assert.Equal(t, "", sa.VMType)
}
func TestStartAttributes_SetDefaults(t *testing.T) {
for _, tc := range testStartAttributesTestCases {
for i, sa := range tc.A {
expected := tc.O[i]
sa.SetDefaults("default", "precise", "stable", "linux", "default")
assert.Equal(t, expected, sa)
}
}
}
|
solarce/worker
|
backend/start_attributes_test.go
|
GO
|
mit
| 1,823
|
while True:
input_number = int(raw_input())
if input_number == 42:
break
print input_number,
exit()
|
sandy-8925/codechef
|
test.py
|
Python
|
mit
| 112
|
USE ANTERO
ALTER TABLE sa.sa_suorat_amk1_henkilokunta ADD [sopimus_alkupvm] varchar(50) NULL;
ALTER TABLE sa.sa_suorat_amk1_henkilokunta ADD [sopimus_loppupvm] varchar(50) NULL;
|
CSCfi/antero
|
db_archive/sql_archive/1937__alter_table_sa_suorat_amk1_henkilokunta.sql
|
SQL
|
mit
| 182
|
---
layout: post
title: "[原创]db2pd中lockname对应的详细信息"
date: 2016-05-20 13:35:00
category: DB2
tags: DB2 Lockname db2pd
---
* content
{:toc}
调查锁的过程中,需要确认锁的对象表和锁的范围信息,可以用什么方法简单去查看锁的过程中锁的对象和那些记录被锁了?
### 问题
调查锁的过程中,需要确认锁的对象表和锁的范围信息,可以用什么方法简单去查看锁的过程中锁的对象和那些记录被锁了?
刚好同事问起在调查锁的过程中,怎么查看锁中锁的对象表和具体的行信息呢?下面通过简单例子去确认。
特别是:MON_FORMAT_LOCK_NAME()函数的使用。
### 测试&总结
#### 使用的os平台和数据库:
[db2inst1@oc6748481478 ~]$ cat /etc/redhat-release
Red Hat Enterprise Linux Workstation release 6.6 (Santiago)
[db2inst1@oc6748481478 ~]$ db2level
DB21085I This instance or install (instance name, where applicable:
"db2inst1") uses "64" bits and DB2 code release "SQL10055" with level
identifier "0606010E".
Informational tokens are "DB2 v10.5.0.5", "s141128", "IP23633", and Fix Pack
"5".
Product is installed at "/opt/ibm/db2/V10.5".
[db2inst1@oc6748481478 ~]$
#### 测试步骤:
session1和session2 为两个终端连接到sample
#### step1:创建表
session1:
创建测试表t1:
另外自动提交设置为off
[db2inst1@oc6748481478 ~]$ db2 drop table t1
DB20000I The SQL command completed successfully.
[db2inst1@oc6748481478 ~]$
[db2inst1@oc6748481478 ~]$ db2 "create table t1 (col1 char(20))"
DB20000I The SQL command completed successfully.
[db2inst1@oc6748481478 ~]$ db2
(c) Copyright IBM Corporation 1993,2007
Command Line Processor for DB2 Client 10.5.5
You can issue database manager commands and SQL statements from the command
prompt. For example:
db2 => connect to sample
db2 => bind sample.bnd
For general help, type: ?.
For command help, type: ? command, where command can be
the first few keywords of a database manager command. For example:
? CATALOG DATABASE for help on the CATALOG DATABASE command
? CATALOG for help on all of the CATALOG commands.
To exit db2 interactive mode, type QUIT at the command prompt. Outside
interactive mode, all commands must be prefixed with 'db2'.
To list the current command option settings, type LIST COMMAND OPTIONS.
For more detailed help, refer to the Online Reference Manual.
db2 => list command options
Command Line Processor Option Settings
Backend process wait time (seconds) (DB2BQTIME) = 1
No. of retries to connect to backend (DB2BQTRY) = 60
Request queue wait time (seconds) (DB2RQTIME) = 5
Input queue wait time (seconds) (DB2IQTIME) = 5
Command options (DB2OPTIONS) =
Option Description Current Setting
------ ---------------------------------------- ---------------
-a Display SQLCA OFF
-b Auto-Bind ON
-c Auto-Commit ON
-d Retrieve and display XML declarations OFF
-e Display SQLCODE/SQLSTATE OFF
-f Read from input file OFF
-i Display XML data with indentation OFF
-j Return code for system calls OFF
-l Log commands in history file OFF
-m Display the number of rows affected OFF
-n Remove new line character OFF
-o Display output ON
-p Display interactive input prompt ON
-q Preserve whitespaces & linefeeds OFF
-r Save output to report file OFF
-s Stop execution on command error OFF
-t Set statement termination character OFF
-v Echo current command OFF
-w Display FETCH/SELECT warning messages ON
-x Suppress printing of column headings OFF
-z Save all output to output file OFF
db2 => update command options using c off
DB20000I The UPDATE COMMAND OPTIONS command completed successfully.
db2 =>
session2:
[db2inst1@oc6748481478 ~]$ db2 "select * from t1"
COL1
--------------------
0 record(s) selected.
[db2inst1@oc6748481478 ~]$
##### step2:对t1表插入6个record
session1:
db2 => insert into t1 values('a1'),('a2'),('a3'),('a4'),('a5'),('a6')
DB20000I The SQL command completed successfully.
db2 => select * from t1
COL1
--------------------
a1
a2
a3
a4
a5
a6
6 record(s) selected.
db2 =>
session2:
[db2inst1@oc6748481478 ~]$ db2 "select * from t1"
COL1
--------------------
0 record(s) selected.
[db2inst1@oc6748481478 ~]$ db2 "select * from t1 with ur"
COL1
--------------------
a1
a2
a3
a4
a5
a6
6 record(s) selected.
[db2inst1@oc6748481478 ~]$
session1:
db2 => commit
DB20000I The SQL command completed successfully.
db2 =>
session2:
[db2inst1@oc6748481478 ~]$ db2 "select * from t1"
COL1
--------------------
a1
a2
a3
a4
a5
a6
6 record(s) selected.
[db2inst1@oc6748481478 ~]$ db2 "select * from t1 with ur"
COL1
--------------------
a1
a2
a3
a4
a5
a6
6 record(s) selected.
[db2inst1@oc6748481478 ~]$
#### step3:对t1表更新其中的a5
session1:
db2 => update t1 set col1='a5+update' where col1='a5'
DB20000I The SQL command completed successfully.
db2 => select * from t1
COL1
--------------------
a1
a2
a3
a4
a5+update
a6
6 record(s) selected.
db2 =>
session2:
[db2inst1@oc6748481478 ~]$ db2 "select * from t1"
COL1
--------------------
a1
a2
a3
a4
a5
a6
6 record(s) selected.
[db2inst1@oc6748481478 ~]$ db2 "select * from t1 with ur"
COL1
--------------------
a1
a2
a3
a4
a5+update
a6
6 record(s) selected.
[db2inst1@oc6748481478 ~]$
#### step4:db2pd -locks的结果
[db2inst1@oc6748481478 ~]$ db2pd -d sample -locks
Database Member 0 -- Database SAMPLE -- Active -- Up 0 days 00:28:17 -- Date 2016-05-23-10.57.20.740720
Locks:
Address TranHdl Lockname Type Mode Sts Owner Dur HoldCount Att ReleaseFlg rrIID
0x00007F46BCEDDB80 12 03001000080000000000000052 RowLock ..X G 12 1 0 0x00200000 0x40000000 0
0x00007F46BCEDCA80 12 4141414141664164FE8BC714C1 PlanLock ..S G 12 1 0 0x00000000 0x40000000 0
0x00007F46BCEDCC00 12 03001000000000000000000054 TableLock .IX G 12 1 0 0x00202000 0x40000000 0
[db2inst1@oc6748481478 ~]$
#### step5:分析和调查对象lockname的详细信息
查看lock:
Lockname Type
03001000080000000000000052 RowLock
4141414141664164FE8BC714C1 PlanLock
03001000000000000000000054 TableLock
通过lock name来查看详细锁的对象信息:
[db2inst1@oc6748481478 ~]$ db2 "SELECT SUBSTR(NAME,1,20) AS NAME,SUBSTR(VALUE,1,50) AS VALUE FROM TABLE( MON_FORMAT_LOCK_NAME('03001000080000000000000052')) as LOCKS"
NAME VALUE
-------------------- --------------------------------------------------
LOCK_OBJECT_TYPE ROW
ROWID 8
DATA_PARTITION_ID 0
PAGEID 0
TBSP_NAME IBMDB2SAMPLEREL
TABSCHEMA DB2INST1
TABNAME T1
7 record(s) selected.
[db2inst1@oc6748481478 ~]$ db2 "SELECT SUBSTR(NAME,1,20) AS NAME,SUBSTR(VALUE,1,50) AS VALUE FROM TABLE( MON_FORMAT_LOCK_NAME('4141414141664164FE8BC714C1')) as LOCKS"
NAME VALUE
-------------------- --------------------------------------------------
LOCK_OBJECT_TYPE PLAN
PACKAGE_TOKEN AAAAAfAd
INTERNAL HashPkgID:14c78bfe,LoadingBit:0
3 record(s) selected.
[db2inst1@oc6748481478 ~]$ db2 "SELECT SUBSTR(NAME,1,20) AS NAME,SUBSTR(VALUE,1,50) AS VALUE FROM TABLE( MON_FORMAT_LOCK_NAME('03001000000000000000000054')) as LOCKS"
NAME VALUE
-------------------- --------------------------------------------------
LOCK_OBJECT_TYPE TABLE
TBSP_NAME IBMDB2SAMPLEREL
TABSCHEMA DB2INST1
TABNAME T1
4 record(s) selected.
[db2inst1@oc6748481478 ~]$
#### 关于Lockname的总结
例如:
十六进制:
03001000080000000000000052
0300 1000 080000000000 0000 52
两个字节是表空间ID,03
两个字节是表ID,10
8个字节:表分区2字节,数据页4字节,SLOT 2字节,
两个字节是锁ID,00
最后一个字节是锁类型 52
表空间ID:0003,表ID:0010,表分区0000,数据页00000000,SLOT:0008, 锁类型:52
化成10进制,你的表空间ID是3,表ID是16,ROWID是0000 0000 0000 00008=8。
用下面的方法看看是哪张表:
[db2inst1@oc6748481478 ~]$ db2 "select substr(TABSCHEMA,1,20) as tabschema,substr(TABNAME,1,20) as tabname,tbspaceid,tableid from syscat.tables where tabname='T1'"
TABSCHEMA TABNAME TBSPACEID TABLEID
-------------------- -------------------- --------- -------
DB2INST1 T1 3 16
1 record(s) selected.
[db2inst1@oc6748481478 ~]$
[db2inst1@oc6748481478 ~]$ db2 "select col1,rid() as rid from t1 where rid()>0"
COL1 RID
-------------------- --------------------
a1 4
a2 5
a3 6
a4 7
a5 8
a6 9
6 record(s) selected.
[db2inst1@oc6748481478 ~]$
#### 参考资料
[MON_FORMAT_LOCK_NAME table function - Format the internal lock name and return details](http://www.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.sql.rtn.doc/doc/r0056427.html?cp=SSEPGG_10.5.0%2F3-6-1-3-10-5&lang=en)
---
|
bigdatalyn/bigdatalyn.github.io
|
_posts/2016-05-20-DB2-lockname-detail.md
|
Markdown
|
mit
| 11,743
|
<?php
/*
* This file is part of the zzAgenda package.
*
* (c) OV Corporation SAS <contact@ov-corporation.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace ZZFramework\Event;
interface EventSubscriberInterface
{
public function getObservedEvents();
}
|
croziere/zzAgenda
|
lib/ZZFramework/Event/EventSubscriberInterface.php
|
PHP
|
mit
| 374
|
// Import React
import React from "react";
// Import Spectacle Core tags
import {
BlockQuote,
Cite,
CodePane,
Deck,
Heading,
Image,
Link,
Quote,
Slide,
Spectacle,
Text,
Code,
Markdown,
List,
ListItem
} from "spectacle";
import CodeSlide from "spectacle-code-slide";
// Import image preloader util
import preloader from "spectacle/lib/utils/preloader";
// Import theme
import createTheme from "spectacle/lib/themes/default";
// Import custom component
// import Interactive from "../assets/interactive";
// Require CSS
require("normalize.css");
require("spectacle/lib/themes/default/index.css");
const images = {
styleguide: require("../assets/styleguide.png"),
invision: require("../assets/invision_styleguide.png"),
canvas: require("../assets/canvas.png"),
toggle: require("../assets/toggle.png"),
panda: require("../assets/panda.jpg"),
checkbox: require("../assets/checkbox.png"),
happy: require("../assets/happy.jpg"),
button: require("../assets/button.png"),
production: require("../assets/production.png"),
development: require("../assets/development.png"),
initial: require("../assets/initial.png"),
applyTheme: require("../assets/applyTheme.png"),
themed: require("../assets/themed.png"),
zoomed: require("../assets/zoomed.png"),
variableSupport: require("../assets/variableSupport.png"),
holyGrail: require("../assets/holyGrail.jpg"),
microservices: require("../assets/microservices.jpg")
};
preloader(images);
const theme = createTheme({
primary: "#1bb7b6"
}, {
primary: "Lato"
});
export default class Presentation extends React.Component {
render() {
return (
<Spectacle theme={theme}>
<Deck transition={["zoom", "slide"]} transitionDuration={500}>
<Slide transition={["zoom"]} bgColor="primary">
<Heading size={1} fit caps lineHeight={1} textColor="black">
Style Guide Driven Development
</Heading>
<Heading size={1} fit caps>
<i>
<small style={{ paddingRight: "4px", textTransform: "lowercase", fontWeight: "normal" }}>with</small>
</i>
React and CSS Modules
</Heading>
</Slide>
<Slide transition={["slide"]} bgColor="black"
notes={`
A little information about myself: I'm Lead UI Engineer on the UI dev team at Instructure.
We're a cross-functional team made up of designers and engineers and we work closely with
both Engineering and Product Design/UX.
Our goal is to build tools and establish processes that make it easier for our designers and
developers to more easily collaborate.
`}
>
<Heading size={1} fit caps lineHeight={1} textColor="primary">
Jennifer Stern
</Heading>
<Heading size={1} fit caps>
Lead UI Engineer @ <Link href="http://instructure.com" textColor="tertiary">Instructure</Link>
</Heading>
<Text lineHeight={1} textColor="tertiary">
jstern@instructure.com
</Text>
</Slide>
<Slide
bgImage={images.styleguide.replace("/", "")} bgDarken={0.50}
notes={`
What's a style guide?
Where application development is concerned:
It's all about better process and communication between designers and developers
(and in a larger org between developers -- reducing duplication of efforts)
To produce a more consistent UX and to be able to build out UI code more efficiently.
`}
>
<Heading size={1} fit caps lineHeight={1}>
What's a Style Guide?
</Heading>
<BlockQuote bgColor="rgba(0, 0, 0, 0.6)" margin="1em 0" padding="1em 1.5em">
<Quote textColor="tertiary" textSize="1em" bold={false} lineHeight={1.5}>
A style guide is a set of standards for the writing and design of documents,
either for general use or for a specific publication, organization, or field....
<Text margin="1em 0px 0px" textSize="1em" textColor="primary" caps bold lineHeight={1.2}>
A style guide establishes and enforces style to improve communication.
</Text>
</Quote>
<Cite textColor="tertiary" textSize="0.5em">
<Link textColor="tertiary" href="https://en.wikipedia.org/wiki/Style_guide">
Wikipedia
</Link>
</Cite>
</BlockQuote>
</Slide>
<Slide
notes={`
Our designers maintain a static style guide in Sketch app and they share it
with us in invision.
This document doesn't really reflect the state of the current application UI
and is time consuming to maintain.
`}
>
<Text textSize="1rem" textColor="tertiary" fit caps lineHeight={1}>
Static Style Guide
</Text>
<div className="browser">
<Image src={images.invision.replace("/", "")} margin="0" height="500px" />
</div>
</Slide>
<Slide
notes={`
vs a "live" style guide...
In recent years it's become pretty standard to build out a "living" style
guide and there are a bunch of open source tools to help you generate documentation
from your Sass or CSS style sheets.
`}
>
<Text textSize="1rem" textColor="tertiary" fit caps lineHeight={1}>
Live Style Guide
</Text>
<Text textSize="3rem" textColor="tertiary">(or pattern library)</Text>
<div className="browser">
<Image src={images.canvas.replace("/", "")} margin="0" height="400px" />
</div>
</Slide>
<Slide
notes={`
We've had one our living style guide for a while now and the documentation looks like this.
When I first starting building out documentation like this, I was thinking...
`}
>
<Text textSize="1rem" textColor="tertiary" fit caps lineHeight={1}>
In a Live Style Guide
</Text>
<Text textSize="1rem" textColor="tertiary" fit caps lineHeight={1}>
Documentation lives with the source code in the same repository
</Text>
</Slide>
<CodeSlide
transition={["slide"]}
lang="jsx"
code={require("raw!../assets/buttons.scss")}
ranges={[
{ loc: [0, 0], title: "buttons.scss" },
{ loc: [0, 21]}
]}
/>
<Slide
bgColor="black"
transition={["slide"]}
notes={`
Is this the holy grail? Can we finally have a 'single source of truth' owned by
both design and engineering and stop manually updating documentation that is usually
out of date as soon as we write it?
`}
>
<Image src={images.holyGrail.replace("/", "")} margin="0" />
</Slide>
<Slide
bgColor="black"
transition={["slide"]}
notes={`
Well... Nope.
As it turns out, our "live" style guide is still out of sync with the application code,
and most designers and developers don't reference it when they are working on new features
(if they know it exists).
Why?
There is a steep learning curve to working in our monolithic code base, and since the old
style guide lives there and is part of that build, it's difficult to set up and
get running. So it's not really fair to ask designers to learn to update the documentation.
In fact, most developers aren't familiar with the style guide part of the build
because our current front end build process and testing setup is confusing and cumbersome.
`}
>
<Image src={images.panda.replace("/", "")} margin="0" />
</Slide>
<Slide
notes={`
So let's take a look at a custom checkbox (toggle) in our sass style guide.
Notice that there is a lot of markup to copy and paste.
Also to make it accessible we need to add some JS behavior to it.
So the documentation doesn't necessarily reflect what's in the application code
in terms of html markup or JS for behavior.
The scss code for this component lives in a common css file that is used across the
application.
Most developers are reluctant to make changes to CSS because they aren't sure what they may
break and so they probably never see the files that have the documentation comment blocks.
This leads to lots of one-off solutions and overrides, duplication of effort and
inconsistency in the UX.
`}
>
<Text textSize="1rem" textColor="tertiary" fit caps lineHeight={1}>
A custom checkbox in <b>Sass</b>
</Text>
<div className="browser">
<Image src={images.toggle.replace("/", "")} margin="0" height="500px" />
</div>
</Slide>
<Slide
notes={`
Let's compare that Toggle documentation with a custom checkbox (toggle)
in our new React style guide.
`}
>
<Text textSize="1rem" textColor="tertiary" fit caps lineHeight={1}>
A custom checkbox in <b>React</b>
</Text>
<div className="browser">
<Image src={images.checkbox.replace("/", "")} margin="0" height="500px" />
</div>
</Slide>
<Slide
notes={`
Similar to our old style guide:
the documentation is generated from the source code + markdown in comment blocks.
Examples are generated from code blocks.
Property documentation is generated from code + comment blocks using react-docgen.
But in this case, CSS, JS, HTML and documentation are bundled and documented as one
component.
Notice that here we're encapsulating style, markup and behavior for the component.
And we've replaced all of those lines of code with one.
`}
>
<Text textSize="1rem" textColor="tertiary" fit caps lineHeight={1}>
<b>CSS, JS, HTML</b> & documentation
</Text>
<Text textColor="tertiary" caps fit>
in one place
</Text>
</Slide>
<CodeSlide
transition={["slide"]}
lang="jsx"
code={require("raw!../assets/checkbox.js")}
ranges={[
{ loc: [48, 270], title: "checkbox.js" },
{ loc: [21, 24]}
]}
/>
<Slide
transition={["spin", "slide"]}
bgImage={images.styleguide.replace("/", "")} bgDarken={0.50}
notes={`
So that's great, but how do we get designers and developers to share ownership of
our living style guide v2.0 (and actually use it)?
`}
>
<BlockQuote bgColor="rgba(0, 0, 0, 0.6)" margin="1em 0" padding="1em 1.5em">
<Quote textColor="tertiary" textSize="1em" bold={false} lineHeight={1.2}>
Make the right things easy and the wrong things hard.
</Quote>
<Cite textColor="tertiary" textSize="0.5em">
<Link textColor="tertiary" href="https://en.wikipedia.org/wiki/Style_guide">
Jonathan Snook
</Link>
</Cite>
</BlockQuote>
<Text textColor="tertiary" textSize="0.75em">And now I'll attempt to live code...</Text>
</Slide>
<Slide
notes={`
The component library code is in a separate repository and the documentation app
is easy to install and and run locally.
We've spent lots of time on scaffolding and tools to make it super easy to
spin up a new component and write documentation and tests for it.
(webpack dev server + hot reloading, eslint, stylelint)
Now designers can (at minimum) pull down code from a pull request and run it locally.
(We're working on convincing them that they can update it too :) )
The easiest thing used to be to make a one-off solution for the feature, but we've
made it a lot easier to contribute to the shared UI code instead.
`}
>
<Image src={images.happy.replace("/", "")} margin="0" />
</Slide>
<Slide
transition={["spin", "slide"]}
bgImage={images.styleguide.replace("/", "")} bgDarken={0.50}
notes={`
So now that we're bundling JS, CSS and HTML together into a single component, how can we be sure
that it will render the same in the application as it does in our style guide?
Can we take advantage of the fact that we're using JS to render these components?
Should we consider writing our CSS in JS (as inline styles)?
Lots of react component libraries are using frameworks like Radium and Aphrodite to write CSS in JS.
`}
>
<BlockQuote bgColor="rgba(0, 0, 0, 0.6)" margin="1em 0" padding="1em 1.5em">
<Quote textColor="tertiary" textSize="1em" bold={false} lineHeight={1.2}>
CSS in JS?
<Markdown>
{`
1. Global Namespaces
2. Dependencies
3. Dead Code Elimination
4. Minification
5. Sharing Constants
6. Non-Deterministic Resolution
7. Isolation
`}
</Markdown>
</Quote>
<Cite textColor="tertiary" textSize="0.5em">
<Link textColor="tertiary" href="">
Christopher "vjeux" Chedeau
</Link>
</Cite>
</BlockQuote>
</Slide>
<Slide
notes={`
CSS Modules solves 1-6 and half of 7
With CSS modules we can isolate components and make them more durable by
limiting the scope of their CSS.
With CSS modules we can write our class names as if they were only scoped
to the component we're working on without worrying that we'll accidentally
break something somewhere else.
`}
>
<Text textSize="1rem" textColor="tertiary" fit caps lineHeight={1}>
CSS Modules
</Text>
<Text textColor="tertiary" caps fit>
(isolate component styles <b>without writing CSS in JS</b>)
</Text>
</Slide>
<CodeSlide
transition={["slide"]}
lang="jsx"
code={require("raw!../assets/button.css")}
ranges={[
{ loc: [0, 0], title: "button.css" },
{ loc: [274, 280], title: "local classes"}
]}
/>
<Slide
notes={`
CSS Modules
`}
>
<Text textSize="1rem" textColor="tertiary" fit caps lineHeight={1}>
CSS Modules
</Text>
<Text textColor="tertiary" caps fit>
loading a CSS file in a JS component
</Text>
</Slide>
<CodeSlide
transition={["slide"]}
lang="jsx"
code={require("raw!../assets/button.js")}
ranges={[
{ loc: [0, 0], title: "button.js" },
{ loc: [7, 9], title: "importing styles"},
{ loc: [161, 168], title: "rendering styles"},
{ loc: [184, 195] }
]}
/>
<Slide
notes={`
Generated class names in production
`}
>
<Text textSize="1rem" textColor="tertiary" fit caps lineHeight={1}>
<small>with</small> production config
</Text>
<div className="browser">
<Image src={images.production.replace("/", "")} margin="0" height="550px" />
</div>
</Slide>
<Slide
notes={`
Generated class names in development
Note that it's pretty similar to the BEM class name format
This makes it easy to debug issues in dev mode.
`}
>
<Text textSize="1rem" textColor="tertiary" fit caps lineHeight={1}>
<small>with</small> development config
</Text>
<div className="browser">
<Image src={images.development.replace("/", "")} margin="0" height="550px" />
</div>
</Slide>
<Slide
notes={`
The other half of #7
Prevent the cascade with all: initial and postcss-initial
We need to roll out these components bit by bit, so they need to work when older
legacy CSS and various versions of Bootstrap CSS.
We want to be pretty sure they'll work the same in the consuming app as they do in
the documentation app.
`}
>
<Text textSize="1rem" textColor="tertiary" fit caps lineHeight={1}>
Prevent the Cascade
</Text>
<Text textColor="tertiary" caps fit>
with <Code textSize="1em" caps={false}>all: initial</Code> and postcss-initial
</Text>
<div className="browser">
<Image src={images.initial.replace("/", "")} margin="0" width="100%" />
</div>
</Slide>
<Slide
transition={["spin", "slide"]}
bgImage={images.styleguide.replace("/", "")} bgDarken={0.50}
notes={`
As it turns out, bundling component JS, CSS and markup together
makes writing accessibile UIs a whole lot easier.
What does it mean for a UI to be accesible?
It's about building your UI so that it works with assistive tech like screen readers,
keyboards (for users who can't use a mouse) and for people who may be color blind or
have partial vision.
`}
>
<Heading size={1} fit caps>Accessibility</Heading>
</Slide>
<Slide
notes={`
A11y benefits (Button and Link components)
In Canvas, we fix a lot of a11y bugs around buttons. Usually
we've added onClick behavior to a div or we've styled a link to look
like a button (or vice versa).
Rule of thumb for keyboard a11y:
If it looks like a button it should behave like a button.
If it looks like a link it should behave like a link.
`}
>
<Text textSize="1rem" textColor="tertiary" fit caps lineHeight={1}>
Accessible Buttons
</Text>
<div className="browser">
<Image src={images.button.replace("/", "")} margin="0" height="500px" />
</div>
</Slide>
<Slide
notes={`
(JS...)
A11y benefits (Button and Link components)
Take a look at the handleKeyDown method
`}
>
<Text textSize="1rem" textColor="tertiary" fit caps lineHeight={1}>
Adding (JS) behavior to components for <b>accessibility</b>
</Text>
</Slide>
<CodeSlide
transition={["slide"]}
lang="jsx"
code={require("raw!../assets/button.js")}
ranges={[
{ loc: [0, 0], title: "button.js" },
{ loc: [113, 134]}
]}
/>
<Slide
notes={`
(html...)
A11y benefits (unit tests)
We can use tools like axe-core and eslint-plugin-jsx-a11y to run unit tests to verify
that the components are accessible and lint for common a11y issues
(e.g. missing alt attributes on images).
`}
>
<Text textSize="1rem" textColor="tertiary" fit caps lineHeight={1}>
Unit tests for Accessibility using <b>axe-core</b>
</Text>
</Slide>
<CodeSlide
transition={["slide"]}
lang="jsx"
code={require("raw!../assets/checkbox.test.js")}
ranges={[
{ loc: [0, 0], title: "checkbox.test.js" },
{ loc: [79, 87]}
]}
/>
<Slide
notes={`
(color variables...)
A11y benefits (color contrast)
Notice the variables are defined in JS...
`}
>
<Text textSize="1rem" textColor="tertiary" fit caps lineHeight={1}>
Testing <b>color contrast</b> for a11y
</Text>
</Slide>
<CodeSlide
transition={["slide"]}
lang="jsx"
code={require("raw!../assets/button.test.js")}
ranges={[
{ loc: [0, 0], title: "theme.test.js" },
{ loc: [8, 14]}
]}
/>
<Slide
transition={["spin", "slide"]}
bgImage={images.styleguide.replace("/", "")} bgDarken={0.50}
notes={`
`}
>
<Heading size={1} caps>Themes</Heading>
</Slide>
<Slide
notes={`
Sass variables
Notice the global (color) variables.
Notice the functional (link) variables.
What's the drawback here?
We need to pre-process all of the variations and custom brands as part of our build.
How can we avoid this?
We can write our variables (not our CSS) in JS.
`}
>
<Text textSize="1rem" textColor="tertiary" fit caps lineHeight={1}>
SASS variables <b>in the monolith</b>
</Text>
</Slide>
<CodeSlide
transition={["slide"]}
lang="css"
code={require("raw!../assets/variables.scss")}
ranges={[
{ loc: [0, 0], title: "variables.scss" },
{ loc: [186, 188], title: "global variables"},
{ loc: [204, 208], title: "functional variables"}
]}
/>
<Slide
notes={`
Global/Brand JS variables
`}
>
<Text textSize="1rem" textColor="tertiary" fit caps lineHeight={1}>
<b>Global brand variables</b> defined in JS
</Text>
</Slide>
<CodeSlide
transition={["slide"]}
lang="js"
code={require("raw!../assets/brand.js")}
ranges={[
{ loc: [0, 0], title: "brand.js" },
{ loc: [4, 9], title: "global color variables"}
]}
/>
<Slide
notes={`
Component/functional variables
`}
>
<Text textSize="1rem" textColor="tertiary" fit caps lineHeight={1}>
<b>Component variables</b> defined in JS
</Text>
</Slide>
<CodeSlide
transition={["slide"]}
lang="js"
code={require("raw!../assets/theme.js")}
ranges={[
{ loc: [0, 0], title: "theme.js" },
{ loc: [7, 14], title: "component variables"}
]}
/>
<Slide
notes={`
Now these variables are accessible withing our JS code too...
and we can do run time themeing.
Here's the ApplyTheme component.
`}
>
<Text textSize="1rem" textColor="tertiary" fit caps lineHeight={1}>
Applying themes at run time
</Text>
<div className="browser">
<Image src={images.applyTheme.replace("/", "")} margin="0" width="800px" />
</div>
</Slide>
<Slide
notes={`
How does this work without writing inline styles with JS?
...CSS custom properties
`}
>
<Text textSize="1rem" textColor="tertiary" fit caps lineHeight={1}>
CSS custom properties
</Text>
<div className="browser">
<Image src={images.themed.replace("/", "")} margin="0" width="800px" />
</div>
</Slide>
<Slide
notes={`
Setting custom properties with JS
`}
>
<Code textColor="tertiary" fit lineHeight={1}>
CSSStyleDeclaration.setProperty()
</Code>
<CodePane
lang="js"
source={require("raw!../assets/setProperty.js")}
textSize="1em"
margin="1em auto"
/>
</Slide>
<Slide
notes={`
CSS custom properties have pretty good browser support
`}
>
<Text textSize="1rem" textColor="tertiary" fit caps lineHeight={1}>
CSS custom properties
</Text>
<Text textSize="2rem" textColor="tertiary" lineHeight={1}>
(we wrote a polyfill for IE)
</Text>
<div className="browser">
<Image src={images.variableSupport.replace("/", "")} margin="0" width="800px" />
</div>
</Slide>
<Slide
transition={["spin", "slide"]}
bgImage={images.microservices.replace("/", "")} bgDarken={0.70}
notes={`
How's it going so far?
`}
>
<Text textSize="1rem" textColor="tertiary" fit caps lineHeight={1}>
Built to Scale
</Text>
<Text textSize="3rem" textColor="tertiary" bold>
We're using our UI components in multiple applications as we start breaking up the monolith
into microservices
</Text>
<Text textColor="tertiary">
&
</Text>
<Text textSize="3rem" textColor="tertiary" bold>
Our professional services team is using the library to build custom integrations with a seamless UX.
</Text>
</Slide>
<Slide
transition={["spin", "slide"]}
bgImage={images.styleguide.replace("/", "")} bgDarken={0.70}
notes={`
Questions
`}
>
<Heading textColor="tertiary" fit caps lineHeight={1}>
Questions?
</Heading>
<Text fit margin="2em 0" bold textColor="tertiary">
https://github.com/instructure/instructure-ui
</Text>
<Text caps lineHeight={1} textColor="primary" bold margin="1em 0">
We're Hiring!
</Text>
<Text textColor="tertiary">
Contact Ariel: apao@instructure.com
</Text>
</Slide>
<Slide
notes={`
Resources and Links
`}
>
<Text textSize="1rem" textColor="tertiary" fit caps lineHeight={1}>
Resources and Links
</Text>
<List textColor="tertiary">
<ListItem>
<Link textColor="tertiary" href="https://github.com/reactjs/react-docgen">react-docgen</Link>
</ListItem>
<ListItem>
<Link textColor="tertiary" href="http://eslint.org/">eslint</Link>
</ListItem>
<ListItem>
<Link textColor="tertiary" href="https://github.com/stylelint/stylelint">stylelint</Link>
</ListItem>
<ListItem>
<Link textColor="tertiary" href="https://github.com/dequelabs/axe-core">axe-core</Link>
</ListItem>
<ListItem>
<Link textColor="tertiary" href="https://www.npmjs.com/package/eslint-plugin-jsx-a11y">eslint-plugin-jsx-a11y</Link>
</ListItem>
<ListItem>
<Link textColor="tertiary" href="https://github.com/maximkoretskiy/postcss-initial">postcss-initial</Link>
</ListItem>
<ListItem>
<Link textColor="tertiary" href="https://github.com/css-modules/css-modules">css modules</Link>
</ListItem>
<ListItem>
<Link textColor="tertiary" href="https://github.com/webpack/css-loader">webpack css-loader</Link>
</ListItem>
</List>
</Slide>
</Deck>
</Spectacle>
);
}
}
|
junyper/react-meetup
|
presentation/index.js
|
JavaScript
|
mit
| 29,727
|
About gflags
============
Home: https://github.com/gflags/gflags
Package license: BSD
Feedstock license: BSD 3-Clause
Summary: A C++ library that implements commandline flags processing.
Installing gflags
=================
Installing gflags from the conda-forge channel can be achieved by adding conda-forge to your channels with:
```
conda config --add channels conda-forge
```
Once the conda-forge channel has been enabled, gflags can be installed with:
```
conda install gflags
```
It is possible to list all of the versions of gflags available on your platform with:
```
conda search gflags --channel conda-forge
```
About conda-forge
=================
conda-forge is a community-led conda channel of installable packages.
In order to provide high-quality builds, the process has been automated into the
conda-forge GitHub organization. The conda-forge organization contains one repository
for each of the installable packages. Such a repository is known as a *feedstock*.
A feedstock is made up of a conda recipe (the instructions on what and how to build
the package) and the necessary configurations for automatic building using freely
available continuous integration services. Thanks to the awesome service provided by
[CircleCI](https://circleci.com/), [AppVeyor](http://www.appveyor.com/)
and [TravisCI](https://travis-ci.org/) it is possible to build and upload installable
packages to the [conda-forge](https://anaconda.org/conda-forge)
[Anaconda-Cloud](http://docs.anaconda.org/) channel for Linux, Windows and OSX respectively.
To manage the continuous integration and simplify feedstock maintenance
[conda-smithy](http://github.com/conda-forge/conda-smithy) has been developed.
Using the ``conda-forge.yml`` within this repository, it is possible to regenerate all of
this feedstock's supporting files (e.g. the CI configuration files) with ``conda smithy regenerate``.
Terminology
===========
**feedstock** - the conda recipe (raw material), supporting scripts and CI configuration.
**conda-smithy** - the tool which helps orchestrate the feedstock.
Its primary use is in the construction of the CI ``.yml`` files
and simplify the management of *many* feedstocks.
**conda-forge** - the place where the feedstock and smithy live and work to
produce the finished article (built conda distributions)
Current build status
====================
Linux: [](https://circleci.com/gh/conda-forge/gflags-feedstock)
OSX: [](https://travis-ci.org/conda-forge/gflags-feedstock)
Windows: [](https://ci.appveyor.com/project/conda-forge/gflags-feedstock/branch/master)
Current release info
====================
Version: [](https://anaconda.org/conda-forge/gflags)
Downloads: [](https://anaconda.org/conda-forge/gflags)
Updating gflags-feedstock
=========================
If you would like to improve the gflags recipe, please take the normal
route of forking this repository and submitting a PR. Upon submission, your changes will
be run on the appropriate platforms to give the reviewer an opportunity to confirm that the
changes result in a successful build. Once merged, the recipe will be re-built and uploaded
automatically to the conda-forge channel, whereupon they will be available for everybody to
install and use.
In order to produce a uniquely identifiable distribution:
* If the version of a package **is not** being increased, please add or increase
the [``build/number``](http://conda.pydata.org/docs/building/meta-yaml.html#build-number-and-string).
* If the version of a package **is** being increased, please remember to return
the [``build/number``](http://conda.pydata.org/docs/building/meta-yaml.html#build-number-and-string)
back to 0.
|
willyd/conda-recipes
|
gflags/README.md
|
Markdown
|
mit
| 4,188
|
import json
from django import template
from django.utils.safestring import mark_safe
register = template.Library()
def jsonfilter(value):
return mark_safe(json.dumps(value))
register.filter('json', jsonfilter)
|
Open511/open511-server
|
open511_server/templatetags/open511.py
|
Python
|
mit
| 220
|
/**
* General elements
*/
@import url(figure.css);
@import url(http://fonts.googleapis.com/css?family=Open+Sans+Condensed:300);
@import url(http://fonts.googleapis.com/css?family=Roboto);
@import url(comments.css);
@import url(form.css);
@import url(table.css);
body {
background-color: #F3F1EA;
color: #555;
font-family: 'Roboto', arial, sans-serif;
overflow-y: scroll;
margin: 0 auto;
overflow: hidden;
}
h1 {
font-size: 2.2em;
margin: 10px 0;
}
h2 {
font-size: 1.8em;
}
h3 {
font-size: 1.4em;
}
hr {
border: 0;
color: #BDB6AD;
background-color: #BDB6AD;
height: 1px;
}
li {
list-style-type: none;
}
/**
* Layout of the main page elements
*/
#headerbar{
background-color: #55463A;
padding: 1px;
width: 100%;
margin: 0 auto 20px auto;
}
.headerbarnav{
margin: 0 auto;
width: 960px;
overflow: hidden;
}
.headerbarnav a{
color: #D6CAC1;
text-decoration: none;
font-size: 0.8em;
padding: 10px 0 10px 20px;
}
.headerbarnav a:hover{
color: #FFF;
}
.nopaddingleft{
padding-left: 0 !important;
}
#wrapper {
margin: 0 auto;
width: 960px;
}
/**
* Layout for header
*/
#header {
position: relative;
margin-bottom: 15px;
}
.sitetitle {
position: absolute;
top: 3px;
left: 110px;
font-size: 54px;
font-family: 'Open Sans Condensed', sans-serif;
}
.siteslogan {
position: absolute;
top: 70px;
left: 110px;
font-style: italic;
color: #BDB6AD;
}
/**
* Layout for main
*/
#main {
min-height: 20em;
}
.article{
margin: 40px auto 0 auto;
border: 1px solid #BDB6AD;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
padding: 5px 15px;
}
.articleAnswer{
margin-top: 40px;
border: 1px solid #BDB6AD;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
padding: 5px 15px;
width: 93%;
}
.smallArticle{
margin: 30px 0;
padding: 5px 15px;
margin-right: 1%;
width: 29%;
float: left;
}
.smallArticle h3{
margin: 10px 0;
}
.alert{
margin: 3% 0;
}
.success, .error{
margin: 30px auto;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
padding: 15px 25px;
width: 50%;
text-align: center;
}
.success p, .error p{
font-size: 1.1em;
}
.success{
border: 3px solid #75AA80;
color: #75AA80;
background-color: #BAE0B9;
}
.error{
border: 3px solid #B45211;
color: #B45211;
background-color: #E4A561
}
.question {
margin: 20px auto;
padding: 0 0 15px 0;
}
.questionTitle{
margin-bottom: 1px;
}
.questionSubTitle{
margin-top: 0;
font-size: 0.9em;
color: #BDB6AD;
}
.questionContainer{
margin-bottom: 30px;
border-bottom: 1px dashed #BDB6AD;
}
/**
* Layout for footer
*/
.footer {
margin-top: 30px;
background-color: #D3C7A3;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
padding: 15px;
overflow: hidden;
color: #6F5A36;
clear: both;
}
.footer a{
color: #6F5A36;
text-decoration: none;
padding: 0 5px;
}
.footer a:hover, .footer a:active{
color: #FFF;
}
.copyright{
float: right;
font-size: 0.9em;
margin: 5px;
}
.usersummery {
float: left;
width: 22%;
min-width: 200px;
margin: 10px 1%;
}
.usersummery p {
margin: 0 0 10px 15px;
font-size: 0.7em;
}
.profileLink{
color: #0D6A9E;
text-decoration: none;
font-weight: bolder;
}
.profileLink:hover{
color: #34A0DD;
}
.bold{
font-weight: bolder;
}
.left{
float: left;
}
.right{
float: right;
}
.clearBoth{
clear: both;
}
.overflow{
overflow: hidden;
}
.paddingBottom {
padding-bottom: 20px;
}
.marginRight{
margin-right: 5px;
}
.marginRightBottom{
margin-right: 10px;
margin-bottom: 10px;
}
.margrinFour{
margin: 4px;
}
.marginLeft{
margin-left: 15px;
}
.notop{
margin-top: 0;
}
.marginTop{
margin: 20px;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
background-color: #E9E7E0;
padding: 15px;
}
.dashed{
border-top: 1px dashed #BDB6AD;
padding-top: 25px;
}
.displayNone{
display: none;
}
|
eddo81/WGTOTW
|
webroot/css/owl_style.css
|
CSS
|
mit
| 4,027
|
<button class="kuiMicroButton" title="Edit">
<span class="kuiIcon fa-gear"></span>
</button>
|
istresearch/PulseTheme
|
kibana/ui_framework/doc_site/src/views/micro_button/micro_button.html
|
HTML
|
mit
| 95
|
---
layout: post
date: '2015-12-16'
title: "Weddington Way Alfred Sung D665 Sleeveless Floor-Length Aline/Princess"
category: Weddington Way
tags: [Weddington Way,Aline/Princess ,V-neck,Floor-Length,Sleeveless]
---
### Weddington Way Alfred Sung D665
Just **$129.99**
### Sleeveless Floor-Length Aline/Princess
<table><tr><td>BRANDS</td><td>Weddington Way</td></tr><tr><td>Silhouette</td><td>Aline/Princess </td></tr><tr><td>Neckline</td><td>V-neck</td></tr><tr><td>Hemline/Train</td><td>Floor-Length</td></tr><tr><td>Sleeve</td><td>Sleeveless</td></tr></table>
<a href="https://www.readybrides.com/en/weddington-way/16108-weddington-way-alfred-sung-d665.html"><img src="//static.msromantic.com/36359/weddington-way-alfred-sung-d665.jpg" alt="Weddington Way Alfred Sung D665" style="width:100%;" /></a>
<!-- break --><a href="https://www.readybrides.com/en/weddington-way/16108-weddington-way-alfred-sung-d665.html"><img src="//static.msromantic.com/36358/weddington-way-alfred-sung-d665.jpg" alt="Weddington Way Alfred Sung D665" style="width:100%;" /></a>
Buy it: [https://www.readybrides.com/en/weddington-way/16108-weddington-way-alfred-sung-d665.html](https://www.readybrides.com/en/weddington-way/16108-weddington-way-alfred-sung-d665.html)
|
variousweddingdress/variousweddingdress.github.io
|
_posts/2015-12-16-Weddington-Way-Alfred-Sung-D665-Sleeveless-FloorLength-AlinePrincess.md
|
Markdown
|
mit
| 1,252
|
<?php
namespace Anroots\Pgca\Test;
use Faker\Factory;
use Faker\Generator;
abstract class TestCase extends \PHPUnit_Framework_TestCase
{
/**
* @return Generator
* @SuppressWarnings(PHPMD.StaticAccess)
*/
public function getFaker()
{
return Factory::create();
}
}
|
anroots/pgca
|
tests/Anroots/Pgca/Test/TestCase.php
|
PHP
|
mit
| 305
|
using System;
using System.Linq;
using FluentAssertions;
using Paster.Specs.Fakes;
using Xbehave;
using xBehave.Paster.Gherkin;
using xBehave.Paster.System;
using Xunit;
namespace Paster.Specs
{
[Trait("Invalid gherkin","")]
public class BadSourceData
{
[Scenario(DisplayName = "Pasting an Empty string")]
public void EmptyString(EnvironmentClipboard clipboard, GherkinPaster sut, TestEnvironment environment)
{
"Given a complete system".Given(() =>
{
environment = FakesLibrary.CreateDefaultEnvironment();
sut = new GherkinPaster(environment);
});
"and a empty string "
.And(() => clipboard = FakesLibrary.CreateShim(String.Empty));
"When the text is pasted"
.Then(() => sut.PasteGherkin(clipboard));
"Then no lines are received by the environment"
.Then(() => environment.LinesWritten.Count()
.Should()
.Be(0));
}
[Scenario(DisplayName = "Pasting invalid gherkin")]
public void InvalidGherkin(EnvironmentClipboard clipboard, GherkinPaster sut, TestEnvironment environment)
{
"Given a complete system".Given(() =>
{
environment = FakesLibrary.CreateDefaultEnvironment();
sut = new GherkinPaster(environment);
});
"and an invalid string of gherkin"
.And(() => clipboard = FakesLibrary.CreateShim("This is not valid gherkin"));
"When the text is pasted"
.Then(() => sut.PasteGherkin(clipboard));
"Then no lines are received by the environment"
.Then(() => environment.LinesWritten.Count()
.Should()
.Be(0));
}
}
}
|
xbehave/xbehave.net-visual-studio
|
src/Paster.Specs/BadSourceData.cs
|
C#
|
mit
| 1,963
|
import { Ng2PopupComponent } from "./ng2-popup.component";
import { Ng2MessagePopupComponent } from "./ng2-message-popup.component";
export { Ng2PopupComponent, Ng2MessagePopupComponent };
export declare class Ng2PopupModule {
}
|
salim101/MathQuiz
|
frontend/node_modules/ng2-popup/dist/ng2-popup.module.d.ts
|
TypeScript
|
mit
| 229
|
{% if not error and list.length %}
{% for model in list %}
{% if model.type == 'dir' %}
{% include "_dir.html" %}
{% else %}
{% include "_file.html" %}
{% endif %}
{% endfor %}
{% elseif error %}
<p class="error-text"><i>Error occurred while getting directory entries.</i></p>
{% else %}
<p><i>Directory is empty</i></p>
{% endif %}
|
huahu/zenturio-editor
|
views/tree-inner.html
|
HTML
|
mit
| 364
|
<?xml version="1.0" ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<!-- saved from url=(0017)http://localhost/ -->
<script language="JavaScript" src="../../displayToc.js"></script>
<script language="JavaScript" src="../../tocParas.js"></script>
<script language="JavaScript" src="../../tocTab.js"></script>
<title></title>
<link rel="stylesheet" href="../../Active.css" type="text/css" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:" />
</head>
<body>
<ul id="index">
<li><a href="#NAME">NAME</a></li>
<li><a href="#VERSION">VERSION</a></li>
<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
<li><a href="#REMEMBER-">REMEMBER!</a></li>
<li><a href="#SEE-ALSO">SEE ALSO</a></li>
<li><a href="#AUTHOR">AUTHOR</a></li>
<li><a href="#COPYRIGHT-AND-LICENSE">COPYRIGHT AND LICENSE</a></li>
</ul>
<h1 id="NAME">NAME</h1>
<p>HTML::Parse - Deprecated, a wrapper around HTML::TreeBuilder</p>
<h1 id="VERSION">VERSION</h1>
<p>This document describes version 5.03 of HTML::Parse, released September 22, 2012 as part of <a>HTML-Tree</a>.</p>
<h1 id="SYNOPSIS">SYNOPSIS</h1>
<pre><code> See the documentation for HTML::TreeBuilder</code></pre>
<h1 id="DESCRIPTION">DESCRIPTION</h1>
<p>Disclaimer: This module is provided only for backwards compatibility with earlier versions of this library. New code should <i>not</i> use this module, and should really use the HTML::Parser and HTML::TreeBuilder modules directly, instead.</p>
<p>The <code>HTML::Parse</code> module provides functions to parse HTML documents. There are two functions exported by this module:</p>
<dl>
<dt id="parse_html-html-or-parse_html-html-obj-">parse_html($html) or parse_html($html, $obj)</dt>
<dd>
<p>This function is really just a synonym for $obj->parse($html) and $obj is assumed to be a subclass of <code>HTML::Parser</code>. Refer to <a href="../../lib/HTML/Parser.html">HTML::Parser</a> for more documentation.</p>
<p>If $obj is not specified, the $obj will default to an internally created new <code>HTML::TreeBuilder</code> object configured with strict_comment() turned on. That class implements a parser that builds (and is) a HTML syntax tree with HTML::Element objects as nodes.</p>
<p>The return value from parse_html() is $obj.</p>
</dd>
<dt id="parse_htmlfile-file-obj-">parse_htmlfile($file, [$obj])</dt>
<dd>
<p>Same as parse_html(), but pulls the HTML to parse, from the named file.</p>
<p>Returns <code>undef</code> if the file could not be opened, or $obj otherwise.</p>
</dd>
</dl>
<p>When a <code>HTML::TreeBuilder</code> object is created, the following variables control how parsing takes place:</p>
<dl>
<dt id="HTML::Parse::IMPLICIT_TAGS">$HTML::Parse::IMPLICIT_TAGS</dt>
<dd>
<p>Setting this variable to true will instruct the parser to try to deduce implicit elements and implicit end tags. If this variable is false you get a parse tree that just reflects the text as it stands. Might be useful for quick & dirty parsing. Default is true.</p>
<p>Implicit elements have the implicit() attribute set.</p>
</dd>
<dt id="HTML::Parse::IGNORE_UNKNOWN">$HTML::Parse::IGNORE_UNKNOWN</dt>
<dd>
<p>This variable contols whether unknow tags should be represented as elements in the parse tree. Default is true.</p>
</dd>
<dt id="HTML::Parse::IGNORE_TEXT">$HTML::Parse::IGNORE_TEXT</dt>
<dd>
<p>Do not represent the text content of elements. This saves space if all you want is to examine the structure of the document. Default is false.</p>
</dd>
<dt id="HTML::Parse::WARN">$HTML::Parse::WARN</dt>
<dd>
<p>Call warn() with an appropriate message for syntax errors. Default is false.</p>
</dd>
</dl>
<h1 id="REMEMBER-">REMEMBER!</h1>
<p>HTML::TreeBuilder objects should be explicitly destroyed when you're finished with them. See <a>HTML::TreeBuilder</a>.</p>
<h1 id="SEE-ALSO">SEE ALSO</h1>
<p><a href="../../lib/HTML/Parser.html">HTML::Parser</a>, <a>HTML::TreeBuilder</a>, <a>HTML::Element</a></p>
<h1 id="AUTHOR">AUTHOR</h1>
<p>Current maintainers:</p>
<ul>
<li><p>Christopher J. Madsen <span style="white-space: nowrap;"><code><perl AT cjmweb.net></code></span></p>
</li>
<li><p>Jeff Fearn <span style="white-space: nowrap;"><code><jfearn AT cpan.org></code></span></p>
</li>
</ul>
<p>Original HTML-Tree author:</p>
<ul>
<li><p>Gisle Aas</p>
</li>
</ul>
<p>Former maintainers:</p>
<ul>
<li><p>Sean M. Burke</p>
</li>
<li><p>Andy Lester</p>
</li>
<li><p>Pete Krawczyk <span style="white-space: nowrap;"><code><petek AT cpan.org></code></span></p>
</li>
</ul>
<p>You can follow or contribute to HTML-Tree's development at <a href="http://github.com/madsen/HTML-Tree">http://github.com/madsen/HTML-Tree</a>.</p>
<h1 id="COPYRIGHT-AND-LICENSE">COPYRIGHT AND LICENSE</h1>
<p>Copyright 1995-1998 Gisle Aas, 1999-2004 Sean M. Burke, 2005 Andy Lester, 2006 Pete Krawczyk, 2010 Jeff Fearn, 2012 Christopher J. Madsen.</p>
<p>This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.</p>
<p>The programs in this library are distributed in the hope that they will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose.</p>
</body>
</html>
|
amidoimidazol/bio_info
|
Beginning Perl for Bioinformatics/html/lib/HTML/Parse.html
|
HTML
|
mit
| 5,379
|
using System;
using TechTalk.SpecFlow;
namespace ServiceRegister.Tests.Infrastructure
{
public static class CurrentScenarioContext
{
public static Guid OrganizationId
{
get { return ScenarioContext.Current.Get<Guid>("OrganizationId"); }
set { ScenarioContext.Current.Set(value, "OrganizationId"); }
}
public static Guid ServiceId
{
get { return ScenarioContext.Current.Get<Guid>("ServiceId"); }
set { ScenarioContext.Current.Set(value, "ServiceId"); }
}
}
}
|
City-of-Helsinki/palvelutietovaranto
|
Source/ServiceRegister.Tests.Infrastructure/CurrentScenarioContext.cs
|
C#
|
mit
| 570
|
package Movement;
/**
* This is an abstract class ChessUnitMovement.
* It is built to handle chess units movement.
* This class must be implemented to support a units movement.
* @author thapaliya
*/
public abstract class ChessUnitMovement
{
/**
*
* @param currentRow of the unit
* @param currentColum of the unit
* @param desiredRow for the unit
* @param desiredColum for the unit
* @return true if the move of this chess unit from the current position to the
* desired position is valid for this unit.
*/
public abstract boolean acceptMove( int currentRow, int currentColum, int desiredRow, int desiredColum);
}
|
thesashi7/SimpleChess
|
src/Movement/ChessUnitMovement.java
|
Java
|
mit
| 674
|
# Shortcodes
---
When you open `/public/seeder.php`, you'll see we use `Hi [first_name]!` message, this will print out *Hi Andrew!* if your name is *Andrew*. This feature called *Shortcode*
You can use shortcode for your bot content. Of course, just add that shortcode to what string which you want. Currently, we have some shortcode available:
- [first_name]
- [last_name]
- [profile_pic]
- [locale]
- [timezone]
- [gender]
Example:
```
// Bot send [first_name] [last_name] when people text: 'say my name'
$bot->answer('say my name', '[first_name] [last_name]')
```
|
gigaai/docs
|
standalone/shortcodes.md
|
Markdown
|
mit
| 590
|
---
layout: post
title: tair 1:tair学习
category: 技术
tags: Tair
keywords:
description: 单机安装笔记
---
{:toc}
|
George5814/George5814.github.io
|
_posts/技术/DB/tair/2019-03-19-1-tair-setup.md
|
Markdown
|
mit
| 129
|
package config
const (
// XPathEpisodesOverviewPagePageItems to retrieve pages where videos are schon
XPathEpisodesOverviewPagePageItems = "//a[@class='pageItem']/@href"
// XPathEpisodesItems to retrieve video urls from a page
XPathEpisodesItems = "//div[@class='modCon']/div[@class='mod modD modMini']/div[@class='boxCon']/div[contains(@class, 'box')]/div[contains(@class, 'teaser')]/a[@class='linkAll']/@href"
// XPathVideoPageVideoTags to find all video tags on final video page
XPathVideoPageVideoTags = "//video/@id"
// XPathVideoPageXmlDataTag to find the concrete element where xml url can be extracted, %s is placeholder for video id
XPathVideoPageXmlDataTag = "//a[@id='%s']/@onclick"
// XPathXmlSeriesTitle title of series
XPathXmlSeriesTitle = "//avDocument/topline"
// XPathXmlEpisodeTitle title of episode
XPathXmlEpisodeTitle = "//avDocument/headline"
// XPathXmlEpisodeLanguageCode language of episode
XPathXmlEpisodeLanguageCode = "//avDocument/language"
// XPathXmlEpisodeDescription episodes description
XPathXmlEpisodeDescription = "//avDocument/broadcast/broadcastDescription"
// XPathXmlAssets documents assets where video url can be found
XPathXmlAssets = "//avDocument/assets/asset"
)
|
rkl-/kika-downloader
|
src/kika-downloader/config/xpath.go
|
GO
|
mit
| 1,236
|
---
layout: sidebar-right
title: "The Marriage of Opposites by Alice Hoffman"
date: 2018-03-13
author: the-borrowers
category: staff-picks
excerpt: '<cite>The Marriage of Opposites</cite> has a beautiful and interesting setting, strong characters and well-defined relationships.'
featured-image: /images/featured/featured-marriage-of-opposites.jpg
featured-alt: "The Marriage of Opposites"
featured-link-text: "Read The Borrowers' review of <cite>The Marriage of Opposites</cite>"
breadcrumb: staff-picks
genre: historical
genre-image: /images/featured/featured-marriage-of-opposites-genre.jpg
genre-alt: 'The Marriage of Opposites'
---

**[See <cite>The Marriage of Opposites</cite> in our catalogue](https://suffolk.spydus.co.uk/cgi-bin/spydus.exe/ENQ/OPAC/BIBENQ?BRN=1804179)**
> "The daughter of a merchant, Rachel is married off as a teenager to a local widower, whose business will help her father's, and finds herself suddenly running a household and stepmother to three children.
> "When her husband dies unexpectedly, his 22-year-old nephew, Frédérick, arrives from France to settle the estate, only to fall passionately in love with both Rachel and the glorious island of her birth. Their love sparks a scandal in the little town - one that has reverberations halfway across the globe. One of the children of this union is Jacobo Camille Pissarro who, inspired by his mother's iron will and faith in her own heart, will grow up to become one of the founders of Impressionism."
Everyone in the group enjoyed this book, and it provoked a wide ranging discussion. Unlike other books by Alice Hoffman, this is a novel based on historical records, covering the true life and marriages of Rachel Pomie.
The setting of the island of St Thomas in the Caribbean makes for rich and colourful visual descriptions, as well as insights into a range of cultural issues. These include island life in general, the closed communities of religious sects and the harsh divisions within them, and the experiences of émigrés who fled from persecution. We also learned about contemporary attitudes towards slaves and mixed race relationships.
The women in this novel, real and fictitious alike, are strong characters. Rachel is passionate and principled, and holds exceptional attitudes and power for a woman living in the 19th century. The relationships between women, in particular with their domestic slaves, are well-defined and interesting, and the interactions between Rachel and her children and step-children are lovely.
<cite>The Marriage of Opposites</cite> is a slow read, but enjoyable once you get used to the pace. It is enlivened by being written from various points of view.
|
suffolklibraries/sljekyll
|
new-suggestions/reviews/_posts/2018-03-13-the-marriage-of-opposites-by-alice-hoffman.md
|
Markdown
|
mit
| 2,772
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Coq bench</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.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">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<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="../../..">Unstable</a></li>
<li class="active"><a href="">8.4pl4 / contrib:area-method 8.4.dev</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="../../../../../about.html">About</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../../..">« Up</a>
<h1>contrib:area-method <small>8.4.dev</small></h1>
<table class="table table-striped text-center">
<thead>
<tr>
<td>Date</td>
<td>Time</td>
<td>Relative</td>
<td>Status</td>
</tr>
</thead>
<tbody>
<tr>
<td>2015-01-30</td>
<td>06:22:40</td>
<td><script>document.write(moment("2015-01-30 06:22:40 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script></td>
<td class="danger"><a href="2015-01-30_06-22-40.html">Error</a></td>
</tr>
<tr>
<td>2015-01-06</td>
<td>22:16:02</td>
<td><script>document.write(moment("2015-01-06 22:16:02 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script></td>
<td class="success"><a href="2015-01-06_22-16-02.html">5 m 11 s</a></td>
</tr>
<tr>
<td>2014-12-12</td>
<td>20:53:37</td>
<td><script>document.write(moment("2014-12-12 20:53:37 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script></td>
<td class="success"><a href="2014-12-12_20-53-37.html">5 m 14 s</a></td>
</tr>
<tr>
<td>2014-12-05</td>
<td>05:10:05</td>
<td><script>document.write(moment("2014-12-05 05:10:05 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script></td>
<td class="success"><a href="2014-12-05_05-10-05.html">5 m 35 s</a></td>
</tr>
<tr>
<td>2014-11-29</td>
<td>03:38:54</td>
<td><script>document.write(moment("2014-11-29 03:38:54 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script></td>
<td class="success"><a href="2014-11-29_03-38-54.html">5 m 8 s</a></td>
</tr>
<tr>
<td>2014-11-21</td>
<td>12:12:52</td>
<td><script>document.write(moment("2014-11-21 12:12:52 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script></td>
<td class="success"><a href="2014-11-21_12-12-52.html">5 m 10 s</a></td>
</tr>
<tr>
<td>2014-11-19</td>
<td>11:05:16</td>
<td><script>document.write(moment("2014-11-19 11:05:16 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script></td>
<td class="danger"><a href="2014-11-19_11-05-16.html">Lint error</a></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
<small>Sources are on <a href="https://github.com/coq-bench">GitHub</a>. © Guillaume Claret.</small>
</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>
|
coq-bench/coq-bench.github.io-old
|
clean/Linux-x86_64-4.01.0-1.2.0/unstable/8.4pl4/contrib:area-method/8.4.dev/index.html
|
HTML
|
mit
| 5,350
|
package cz.crcs.ectester.standalone.libs;
import java.security.Provider;
import java.util.Set;
/**
* @author Jan Jancar johny@neuromancer.sk
*/
public class MatrixsslLib extends NativeECLibrary {
public MatrixsslLib() {
super("matrixssl_provider");
}
@Override
native Provider createProvider();
@Override
public native Set<String> getCurves();
}
|
petrs/ECTester
|
src/cz/crcs/ectester/standalone/libs/MatrixsslLib.java
|
Java
|
mit
| 385
|
module Control.DList where
{--
Your basic difference list, from Haskell to Idris, and back
This answers the Haskell exercise posed at http://lpaste.net/107593
--}
import Control.Arrow (app)
import Control.Monad
import Control.Monad.Trans.Writer
import Data.Monoid
infixr 5 |>
infixl 5 <|
data DList a = DL { unDL :: [a] -> [a] }
cons :: a -> [a] -> [a]
cons a list = a : list
(<|) :: DList a -> a -> DList a
dlist <| a = DL ((unDL dlist) . (cons a))
(|>) :: a -> DList a -> DList a
a |> dlist = DL ((cons a) . (unDL dlist))
emptyDL :: DList a
emptyDL = DL id
dlToList :: DList a -> [a]
dlToList dlist = unDL dlist []
-- added a fromList for difference lists to start from somewhere
dl :: [a] -> DList a
dl = DL . (++)
dl' :: a -> DList a -- your monadic return
dl' x = dl [x]
-- DLists are monoidal (perfect for writing to *cough* Writer *cough*)
instance Monoid (DList a) where
mempty = emptyDL
d1 `mappend` d2 = DL (unDL d1 . unDL d2)
samp :: Writer (DList Char) () -- from Writer w a
samp = (\f twoB -> mapM_ f [twoB, " or not ", twoB]) (tell . dl) "to be"
-- *Control.DList> dlToList $ snd $ runWriter samp ~> "to be or not to be"
-- So now let's make DList a monad
-- which means we have to make it a Functor, then an Applicative one
-- You know: because monads are functors.
-- No, they aren't but in Haskell they are required to be, because reasons.
instance Monad DList where
return = pure
difflist >>= f = {-- ugh! --} mconcat . map f $ dlToList difflist
-- but to be a monad these days, you MUST be applicative, so ...
instance Applicative DList where
pure = dl'
dlfs <*> dlargs = dl $ zipWith (curry app) (dlToList dlfs) (dlToList dlargs)
-- but applicative needs to be a functor, so ...
instance Functor DList where
fmap f = dl . map f . dlToList
-- and while we're at it, let's make DList a Foldable instance
{--
Okay, last week, we looked at improving the views on DList so that we could
make it a monad, so that it could participate with MultiMap, which has a
requirement of monadicity on the element-container-class.
But is that the 'right' improvement?
Looking at MultiMap, it's not so that a contain should be a monad, because
what is the usage for these containers? Their monadicity?
No, it's their foldability.
This exercise is inspired by @argumatronic xxx.
What is a Foldable instance?
(quick lookup of Data.Foldable)
A Foldable instance is something that which can be folded.
(audience, sarcastically: Thank you, geophf)
me: yer welcks.
So, (... or maybe we need to ba Traversable, too?)
(... I'll put more thought into this ... laterz).
So, if what we need, really, is a Foldable instance (not a Monad), then we need
to make DList a Foldable instance, too.
Today's Haskell exercise: declare DList to be Foldable and define the Foldable
functions for it. --}
instance Foldable DList where
foldr f z = foldr f z . dlToList
-- let's talk Traversibility, now:
{-- a solution to the problem posted at http://lpaste.net/4868288594713772032
So, we made DList a Foldable instance, all for @argumatronic, and she was
grateful for the source material for @HaskellBook ...
(geophf waits for the influx of gratitude)
... but then she was all like, "Phfeh! Foldable is so yesterday! Traversable
is where it's at! Get with the times!"
So, there's that.
So, Traversable. What is it?
traversable, adj.: that which can be traversed, see traversable.
(audience, sarcastic: gee! thanks, geophf!)
(geophf: yer welcks)
Okay, but seriously, looking at the documentation for Data.Traversable, we see
that
class (Functor t, Foldable t) => Traversable t where ...
Well, as we've done yesterday and the proceeding week, we've already made DList
a Functor (and an Applicative Functor, no less, which will come in (very)
handy today) and, yesterday, made it Foldable, so we've met the prerequisites
of being able to make DList Traversable.
What is the power of traversibility? Well, if you have some arbitrary type, t,
that's a Traversable type, then you know you can map(M) or sequence over it...
... and as we learned in the '70s, being able to map over a type is a very
powerful and useful thing to have.
So, let's do this for DList: let's make DList a Traversable instance.
Generally, with Applicative Functors, as the minimally-complete definition
is traverse or sequenceA. Let's do this. --}
instance Traversable DList where
traverse f = (pure dl <*>) . traverse f . dlToList
-- And if we just want a feelz, yo:
instance Show (DList a) where show = const "a DList"
|
geophf/1HaskellADay
|
exercises/HAD/Control/DList.hs
|
Haskell
|
mit
| 4,555
|
// <copyright file="SwitchableSection.cs" company="Cui Ziqiang">
// Copyright (c) 2017 Cui Ziqiang
// </copyright>
namespace CrossCutterN.Weaver.Switch
{
using System;
using System.Collections.Generic;
using Mono.Cecil.Cil;
/// <summary>
/// Switchable section implementation.
/// </summary>
internal sealed class SwitchableSection : ISwitchableSection
{
/// <inheritdoc/>
public int StartIndex { private get; set; }
/// <inheritdoc/>
public int EndIndex { private get; set; }
/// <inheritdoc/>
public Instruction StartInstruction { get; private set; }
/// <inheritdoc/>
public Instruction EndInstruction { get; private set; }
/// <inheritdoc/>
public bool HasSetStartEndInstruction => StartInstruction != null && EndInstruction != null;
/// <inheritdoc/>
public void SetInstructions(IList<Instruction> instructions, Instruction defaultInstruction)
{
if (StartIndex == -1)
{
return;
}
#if DEBUG
if (EndIndex == -1)
{
throw new InvalidOperationException("End index not set yet");
}
if (EndIndex <= StartIndex)
{
throw new InvalidOperationException("End index should be above start index");
}
if (StartIndex >= instructions.Count)
{
throw new ArgumentException("Instruction list not correctly populated");
}
#endif
StartInstruction = instructions[StartIndex];
EndInstruction = EndIndex >= instructions.Count ? defaultInstruction : instructions[EndIndex];
StartIndex = -1;
EndIndex = -1;
}
/// <inheritdoc/>
public void Reset()
{
StartIndex = -1;
EndIndex = -1;
StartInstruction = null;
EndInstruction = null;
}
/// <inheritdoc/>
public void AdjustEndInstruction(Instruction originalEnd, Instruction newEnd)
{
#if DEBUG
if (newEnd == null)
{
throw new ArgumentNullException("newEnd");
}
#endif
if (EndInstruction != null && EndInstruction == originalEnd)
{
EndInstruction = newEnd;
}
}
}
}
|
keeper013/CrossCutterN
|
CrossCutterN.Weaver/Switch/SwitchableSection.cs
|
C#
|
mit
| 2,421
|
<footer class="footer">
<div class="p2 wrap">
<div class="measure mt1 center">
<small>
All contents on this website by
<a xmlns:cc="http://creativecommons.org/ns#" href="https://timothygu.github.io/" property="cc:attributionName" rel="cc:attributionURL">
Tiancheng "Timothy" Gu
</a>,
unless specified otherwise, are licensed under a
<a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">
Creative Commons Attribution-ShareAlike 4.0 International License
</a>.<br>
Theme by <a href="http://johnotander.com">John Otander</a> (<a href="https://twitter.com/4lpine">@4lpine</a>).<br>
</> available on <a href="https://github.com/TimothyGu/timothygu.github.io">Github</a>.
</small>
</div>
</div>
</footer>
{% if site.google_analytics %}
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script','//www.google-analytics.com/analytics.js','ga');ga('create', '{{ site.google_analytics }}', 'auto');ga('send', 'pageview');
</script>
{% endif %}
|
TimothyGu/timothygu.github.io
|
_includes/footer.html
|
HTML
|
mit
| 1,279
|
/**
* @file AccessDeniedException.java
* @brief 로그인을 하지 않았거나 세션이 끊긴 경우 발생하는 Exception
* @author 개발3/파트3
* @author 최경진
* @date 생성 : 2014. 4. 17.
* @date 최종수정: 2014. 4. 17.
*/
package com.juseyo.certification.exception;
/**
* @brief AccessDeniedException
* @author 개발3팀/파트3/최경진
* @version 1.0
* @date 생성: 2014. 4. 17.
* @date 최종수정: 2014. 4. 17.
* @remark
*/
public class SessionNotFoundException extends Exception {
/**
*
*/
private static final long serialVersionUID = -5968061856227840420L;
public SessionNotFoundException() {
super();
}
public SessionNotFoundException(String msg) {
super(msg);
}
}
|
zupper77/juseyo
|
src/main/java/com/juseyo/certification/exception/SessionNotFoundException.java
|
Java
|
mit
| 778
|
kloutedmentions
===============
Twitter web client sorting mentions by senders Klout scores.
|
mikerudolph/kloutedmentions
|
README.md
|
Markdown
|
mit
| 94
|
<?php
/* TwigBundle:Exception:traces.xml.twig */
class __TwigTemplate_05a06802ecd3434c77ee29212d49ed457ae32c039667ade3058cbb9e3ff2db70 extends Twig_Template
{
public function __construct(Twig_Environment $env)
{
parent::__construct($env);
$this->parent = false;
$this->blocks = array(
);
}
protected function doDisplay(array $context, array $blocks = array())
{
// line 1
echo " <traces>
";
// line 2
$context['_parent'] = (array) $context;
$context['_seq'] = twig_ensure_traversable($this->getAttribute((isset($context["exception"]) ? $context["exception"] : $this->getContext($context, "exception")), "trace", array()));
foreach ($context['_seq'] as $context["_key"] => $context["trace"]) {
// line 3
echo " <trace>
";
// line 4
$this->env->loadTemplate("TwigBundle:Exception:trace.txt.twig")->display(array("trace" => $context["trace"]));
// line 5
echo "
</trace>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['trace'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 8
echo " </traces>
";
}
public function getTemplateName()
{
return "TwigBundle:Exception:traces.xml.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
return array ( 39 => 8, 31 => 5, 29 => 4, 26 => 3, 22 => 2, 19 => 1,);
}
}
|
thmohd/demo
|
app/cache/dev/twig/05/a0/6802ecd3434c77ee29212d49ed457ae32c039667ade3058cbb9e3ff2db70.php
|
PHP
|
mit
| 1,699
|
class CreateApiVerifications < ActiveRecord::Migration
def up
create_table :api_verifications do |t|
t.string :name
t.string :key
t.string :secret
t.timestamps null: false
end
end
def down
drop_table :api_verifications
end
end
|
Christianjuth/Portfolio
|
db/migrate/20161104123431_create_api_verifications.rb
|
Ruby
|
mit
| 273
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>equations: 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.7.2 / equations - 1.2.3+8.13</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
equations
<small>
1.2.3+8.13
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-03-08 19:39:34 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-03-08 19:39:34 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-num base Num library distributed with the OCaml compiler
base-threads base
base-unix base
camlp5 7.14 Preprocessor-pretty-printer of OCaml
conf-findutils 1 Virtual package relying on findutils
conf-perl 2 Virtual package relying on perl
coq 8.7.2 Formal proof management system
num 0 The Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.03.0 The OCaml compiler (virtual package)
ocaml-base-compiler 4.03.0 Official 4.03.0 release
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.3 A library manager for OCaml
# opam file:
opam-version: "2.0"
authors: [ "Matthieu Sozeau <matthieu.sozeau@inria.fr>" "Cyprien Mangin <cyprien.mangin@m4x.org>" ]
dev-repo: "git+https://github.com/mattam82/Coq-Equations.git"
maintainer: "matthieu.sozeau@inria.fr"
homepage: "https://mattam82.github.io/Coq-Equations"
bug-reports: "https://github.com/mattam82/Coq-Equations/issues"
license: "LGPL-2.1-or-later"
synopsis: "A function definition package for Coq"
description: """
Equations is a function definition plugin for Coq, that allows the
definition of functions by dependent pattern-matching and well-founded,
mutual or nested structural recursion and compiles them into core
terms. It automatically derives the clauses equations, the graph of the
function and its associated elimination principle.
"""
tags: [
"keyword:dependent pattern-matching"
"keyword:functional elimination"
"category:Miscellaneous/Coq Extensions"
"logpath:Equations"
]
build: [
["./configure.sh"]
[make "-j%{jobs}%"]
]
install: [
[make "install"]
]
run-test: [
[make "test-suite"]
]
depends: [
"coq" {>= "8.13" & < "8.14~"}
]
url {
src: "https://github.com/mattam82/Coq-Equations/archive/v1.2.3-8.13.tar.gz"
checksum: "sha512=0d478dde49cdc8e063ff64accf1fce77af57c63bbcf96bd408670cc73f8785353fa77d46559520d3c4d13d242437b8d0e54dfad390f5a22876b9c5239c39bfc5"
}
</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-equations.1.2.3+8.13 coq.8.7.2</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.7.2).
The following dependencies couldn't be met:
- coq-equations -> coq >= 8.13 -> ocaml >= 4.05.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-equations.1.2.3+8.13</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>
|
coq-bench/coq-bench.github.io
|
clean/Linux-x86_64-4.03.0-2.0.5/released/8.7.2/equations/1.2.3+8.13.html
|
HTML
|
mit
| 7,375
|
local Ansi = require('opus.ansi')
local UI = require('opus.ui')
local Util = require('opus.util')
local colors = _G.colors
local fs = _G.fs
local textutils = _G.textutils
local RECIPES_DIR = 'usr/etc/recipes'
local NAMES_DIR = 'usr/etc/names'
local RECIPE_BOOKS = 'packages/recipeBook/etc/recipeBook.db'
local db = Util.readTable(RECIPE_BOOKS)
local function getRecipeBooks()
local books = { }
if not fs.exists(RECIPES_DIR) then
fs.makeDir(RECIPES_DIR)
end
for _,book in pairs(db) do
local path = fs.combine(RECIPES_DIR, book.localName .. '.db')
table.insert(books, {
recipePath = path,
namePath = fs.combine(NAMES_DIR, book.localName .. '.db'),
name = book.name,
url = book.url,
version = book.version,
enabled = fs.exists(path),
})
end
return books
end
local page = UI.Page {
info = UI.Window {
x = 2, ex = -2, y = 2, ey = 5,
button = UI.Button {
ex = -1, y = 3, width = 10,
text = 'Enable',
event = 'grid_select',
},
addButton = UI.Button {
ex = -12, y = 3, width = 10,
text = 'Add Book',
event = 'add_book',
},
},
grid = UI.ScrollingGrid {
y = 6,
headerBackgroundColor = colors.black,
headerTextColor = colors.cyan,
columns = {
{ heading = 'Name', key = 'name' },
{ heading = 'Version', key = 'version' },
},
values = getRecipeBooks(),
sortColumn = 'name',
autospace = true,
},
add = UI.SlideOut {
backgroundColor = colors.cyan,
titleBar = UI.TitleBar {
title = 'Add a new book',
},
form = UI.Form {
x = 2, ex = -2, y = 2, ey = -1,
[1] = UI.TextEntry {
formLabel = 'Name', formKey = 'name',
shadowText = 'Friendly name',
limit = 64,
required = true,
},
[2] = UI.TextEntry {
formLabel = 'Version', formKey = 'version',
shadowText = 'Mod version',
limit = 10,
},
[3] = UI.TextEntry {
formLabel = 'URL', formKey = 'url',
shadowText = 'URL for recipes',
limit = 128,
required = true,
},
[4] = UI.TextEntry {
formLabel = 'File name', formKey = 'localName',
shadowText = 'Short name for saving file',
limit = 20,
required = true,
},
},
},
notification = UI.Notification { },
}
function page.info:draw()
local book = self.parent.grid:getSelected()
self:clear()
if book then
self:setCursorPos(1, 1)
self:print(
string.format('Name: %s%s%s\n', Ansi.yellow, book.name, Ansi.reset))
self:print(
string.format('Version: %s%s%s\n', Ansi.yellow, book.version, Ansi.reset))
self.button.text = book.enabled and 'Disable' or 'Enable'
self.button:draw()
self.addButton:draw()
end
end
function page.grid:getRowTextColor(row, selected)
if row.enabled then
return colors.white
end
return selected and colors.lightGray or colors.gray
end
function page:save(book, enable)
if enable then
self.notification:info('Downloading...')
self:sync()
local s = pcall(function()
local recipes = Util.download(book.url)
if recipes then
recipes = textutils.unserialize(recipes)
local names = { }
for k,v in pairs(recipes.recipes) do
names[k] = v.displayName
v.displayName = nil
end
Util.writeTable(book.namePath, names)
Util.writeTable(book.recipePath, recipes)
end
book.enabled = true
self.notification:success('Download complete')
end)
if not s then
self.notification:error('Download failed')
end
else
fs.delete(book.recipePath)
fs.delete(book.namePath)
book.enabled = false
end
end
function page:eventHandler(event)
if event.type == 'grid_select' then
local book = self.grid:getSelected()
self:save(book, not book.enabled)
self.info:draw()
self.grid:draw()
elseif event.type == 'add_book' then
self.add.form:setValues({ })
self.add:show()
elseif event.type == 'form_complete' then
self.add:hide()
table.insert(db, self.add.form.values)
Util.writeTable(RECIPE_BOOKS, db)
self.grid:setValues(getRecipeBooks())
self.grid:draw()
elseif event.type == 'form_cancel' then
self.add:hide()
elseif event.type == 'grid_focus_row' then
self.info:draw()
elseif event.type == 'quit' then
UI:exitPullEvents()
end
UI.Page.eventHandler(self, event)
end
UI:setPage(page)
UI:pullEvents()
|
kepler155c/opus-apps
|
recipeBook/recipeBook.lua
|
Lua
|
mit
| 4,294
|
---
layout: essay
type: essay
title: My Journey in Web Development
date: 2017-02-23
labels:
- HTML
- CSS
- UI Framework
---
<img class="ui medium circular right floated image" src="../images/html.jpg">
## The world of HTML and CSS
When I first started learning how to develop a website, I went to the basics. The [resulting page](http://kodayv.ics415.com/campus/introduction.php) was basic and honestly boring, as you can see. Being functional only as a page with information, it fails at maintaining the interest of the viewer. In today’s world of technology, part of the function of a webpage is that it is pleasing to the eye to behold, and strikes interest in the viewer. HTML and CSS by itself is difficult to achieve that level of attraction.
<BR>
<img class="ui small left floated image" src="../images/css.png">
## CSS Frameworks
The next level of my web development journey took me to use a CSS framework, called [W3](https://www.w3schools.com/w3css/default.asp). This framework allowed me to make aesthetically pleasing pages [like this one](http://www2.hawaii.edu/~kodayv/ics311f16/). With an already established CSS, making nice webpages was easier and faster, after the initial commitment to learn the directory. This framework was also free for public use, so there is no monetary commitment.
<BR>
<img class="ui medium right floated image" src="https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcReNAQPdKvi97R1fQy4_MBAiF5siJQOIq3t5DxOlDfjYgwo5NBk">
## UI Frameworks
The last level of web development took me to a UI Framework. [Semantic UI](http://semantic-ui.com/) was the framework I used in this experience. I was fortunate to have the ability to use the framework under the University’s Student subscription, allowing me to bypass the cost of the program. This framework was also complicated to get started with. A lot of time was devoted to understanding how the framework could be applied to a website. However, once the educational commitment was completed, the framework enabled me to develop a professional webpage [like this one](http://www2.hawaii.edu/~kodayv/ics311f16/snow.html) in a fairly reasonable amount of time.
<BR>
<img class="ui medium circular left floated image" src="https://images.pexels.com/photos/39284/macbook-apple-imac-computer-39284.jpeg?w=1260&h=750&auto=compress&cs=tinysrgb">
## Which is Better?
My journey in this realm of web development has given me an appreciation of all the various tools available to use. The question what is better actually will depends on the preference of time versus cost. Using a UI platform, while lowering the time of development once learned how to use, also costs money. The CSS framework, also requiring learning time, requires a little more time in development but can still produce similar results with no added costs. Both will make a webpage attractive and functional in less time that raw HTML and CSS. Personally, I do not believe that something is worth more because it costs more, and will lean towards developing web pages at competitive prices due to no subscription fees.
|
kodayv/kodayv.github.io
|
essays/UIinterface.md
|
Markdown
|
mit
| 3,098
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Kayak;
namespace Pivot.Update.Server
{
class HttpErrorDataProducer : BufferedProducer
{
public HttpErrorDataProducer()
: base("The server did not understand your request.")
{
}
}
}
|
hach-que/Pivot.Update
|
Pivot.Update.Server/HttpErrorDataProducer.cs
|
C#
|
mit
| 325
|
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.text import slugify
from django.contrib.auth.models import (
User
)
from pastryio.models.mixins import ArchiveMixin
class BaseProfile(ArchiveMixin):
user = models.OneToOneField(User)
avatar = models.ImageField(_("avatar"), blank=True)
def __unicode__(self):
return self.user.username
@property
def slug(self):
return slugify(self.user.first_name)
|
octaflop/pastryio
|
apps/profiles/models.py
|
Python
|
mit
| 496
|
## Bookmarks tagged [[open-graph-protocol]](https://www.codever.land/search?q=[open-graph-protocol])
_<sup><sup>[www.codever.land/bookmarks/t/open-graph-protocol](https://www.codever.land/bookmarks/t/open-graph-protocol)</sup></sup>_
---
#### [The Open Graph protocol home page](https://ogp.me/)
_<sup>https://ogp.me/</sup>_
The Open Graph protocol enables any web page to become a rich object in a social graph.
* **tags**: [open-graph-protocol](../tagged/open-graph-protocol.md)
---
|
Codingpedia/bookmarks
|
tagged/open-graph-protocol.md
|
Markdown
|
mit
| 487
|
import {
AudioSourceErrorEvent,
AudioSourceInitializingEvent,
AudioSourceOffEvent,
AudioSourceReadyEvent,
AudioStreamNodeAttachedEvent,
AudioStreamNodeAttachingEvent,
AudioStreamNodeDetachedEvent
} from 'microsoft-cognitiveservices-speech-sdk/distrib/lib/src/common/AudioSourceEvents';
export {
AudioSourceErrorEvent,
AudioSourceInitializingEvent,
AudioSourceOffEvent,
AudioSourceReadyEvent,
AudioStreamNodeAttachedEvent,
AudioStreamNodeAttachingEvent,
AudioStreamNodeDetachedEvent
};
|
billba/botchat
|
packages/testharness/pre/external/microsoft-cognitiveservices-speech-sdk/distrib/lib/src/common/AudioSourceEvents.js
|
JavaScript
|
mit
| 514
|