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
|
---|---|---|---|---|---|
import { TransformResult, MarkResult } from "./result";
import Input from './input';
export declare function toRoma(sentence: Input): Promise<TransformResult>;
export declare function toHira(sentence: Input): Promise<TransformResult>;
export declare function toKata(sentence: Input): Promise<TransformResult>;
export declare function markKana(sentence: Input, leftEdge?: string, rightEdge?: string, seperateFlg?: boolean): Promise<MarkResult>;
export declare function markKata(sentence: Input, leftEdge?: string, rightEdge?: string, seperateFlg?: boolean): Promise<MarkResult>;
| bakabird/kakasijs | dist/kanji.d.ts | TypeScript | mit | 578 |
@ECHO OFF
REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set BUILDDIR=_build
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
set I18NSPHINXOPTS=%SPHINXOPTS% .
if NOT "%PAPER%" == "" (
set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS%
)
if "%1" == "" goto help
if "%1" == "help" (
:help
echo.Please use `make ^<target^>` where ^<target^> is one of
echo. html to make standalone HTML files
echo. dirhtml to make HTML files named index.html in directories
echo. singlehtml to make a single large HTML file
echo. pickle to make pickle files
echo. json to make JSON files
echo. htmlhelp to make HTML files and a HTML help project
echo. qthelp to make HTML files and a qthelp project
echo. devhelp to make HTML files and a Devhelp project
echo. epub to make an epub
echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter
echo. text to make text files
echo. man to make manual pages
echo. texinfo to make Texinfo files
echo. gettext to make PO message catalogs
echo. changes to make an overview over all changed/added/deprecated items
echo. xml to make Docutils-native XML files
echo. pseudoxml to make pseudoxml-XML files for display purposes
echo. linkcheck to check all external links for integrity
echo. doctest to run all doctests embedded in the documentation if enabled
goto end
)
if "%1" == "clean" (
for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
del /q /s %BUILDDIR%\*
goto end
)
%SPHINXBUILD% 2> nul
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)
if "%1" == "html" (
%SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The HTML pages are in %BUILDDIR%/html.
goto end
)
if "%1" == "dirhtml" (
%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
goto end
)
if "%1" == "singlehtml" (
%SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
goto end
)
if "%1" == "pickle" (
%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
if errorlevel 1 exit /b 1
echo.
echo.Build finished; now you can process the pickle files.
goto end
)
if "%1" == "json" (
%SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
if errorlevel 1 exit /b 1
echo.
echo.Build finished; now you can process the JSON files.
goto end
)
if "%1" == "htmlhelp" (
%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
if errorlevel 1 exit /b 1
echo.
echo.Build finished; now you can run HTML Help Workshop with the ^
.hhp project file in %BUILDDIR%/htmlhelp.
goto end
)
if "%1" == "qthelp" (
%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
if errorlevel 1 exit /b 1
echo.
echo.Build finished; now you can run "qcollectiongenerator" with the ^
.qhcp project file in %BUILDDIR%/qthelp, like this:
echo.^> qcollectiongenerator %BUILDDIR%\qthelp\preguntale.qhcp
echo.To view the help file:
echo.^> assistant -collectionFile %BUILDDIR%\qthelp\preguntale.ghc
goto end
)
if "%1" == "devhelp" (
%SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
if errorlevel 1 exit /b 1
echo.
echo.Build finished.
goto end
)
if "%1" == "epub" (
%SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The epub file is in %BUILDDIR%/epub.
goto end
)
if "%1" == "latex" (
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
if errorlevel 1 exit /b 1
echo.
echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
goto end
)
if "%1" == "latexpdf" (
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
cd %BUILDDIR%/latex
make all-pdf
cd %BUILDDIR%/..
echo.
echo.Build finished; the PDF files are in %BUILDDIR%/latex.
goto end
)
if "%1" == "latexpdfja" (
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
cd %BUILDDIR%/latex
make all-pdf-ja
cd %BUILDDIR%/..
echo.
echo.Build finished; the PDF files are in %BUILDDIR%/latex.
goto end
)
if "%1" == "text" (
%SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The text files are in %BUILDDIR%/text.
goto end
)
if "%1" == "man" (
%SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The manual pages are in %BUILDDIR%/man.
goto end
)
if "%1" == "texinfo" (
%SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo.
goto end
)
if "%1" == "gettext" (
%SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The message catalogs are in %BUILDDIR%/locale.
goto end
)
if "%1" == "changes" (
%SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
if errorlevel 1 exit /b 1
echo.
echo.The overview file is in %BUILDDIR%/changes.
goto end
)
if "%1" == "linkcheck" (
%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
if errorlevel 1 exit /b 1
echo.
echo.Link check complete; look for any errors in the above output ^
or in %BUILDDIR%/linkcheck/output.txt.
goto end
)
if "%1" == "doctest" (
%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
if errorlevel 1 exit /b 1
echo.
echo.Testing of doctests in the sources finished, look at the ^
results in %BUILDDIR%/doctest/output.txt.
goto end
)
if "%1" == "xml" (
%SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The XML files are in %BUILDDIR%/xml.
goto end
)
if "%1" == "pseudoxml" (
%SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml.
goto end
)
:end
| milmazz/preguntale | docs/make.bat | Batchfile | mit | 6,709 |
import React, { Component } from 'react'
var Link = require('react-router').Link;
var helper = require('./../../helper');
var config = require('./../../config');
export default class LocationItem extends Component {
constructor(props) {
super(props);
this.state={
hover: true,
mainImg: config.domain + 'images/icon/default.png'
}
}
componentDidMount() {
var img = new Image();
var self = this;
img.onload = function(){
self.setState({
mainImg : config.domain + 'images/zport/'+ self.props.data.id + '/ico.jpg'
})
};
img.src = config.domain + 'images/zport/'+ self.props.data.id + '/ico.jpg';
}
mouseOver () {
this.setState({hover: true});
}
mouseOut () {
this.setState({hover: false});
}
handleClick() {
this.props.onClick(this.props.data);
}
render(){
var cn = "list-group-item";
if(this.props.active){
cn += " active-location";
}
if(this.state.hover==true){
this.state.toogle = 'location-block-open'
}else{
this.state.toogle = 'location-block-close'
}
return (
<div className="col-md-12 border-item">
<Link to={'/place/'+this.props.data.id} className="location-title">
<h4 className="location-title">{this.props.data.title}</h4>
</Link>
<div className="col-md-6 p-0">
<a className="fancyimage" data-fancybox-group="group" href={this.state.mainImg}>
<img className='img-responsive' src={this.state.mainImg}/>
</a>
</div>
<div className="col-md-6 location-block-open" >
<ul className="list-group p-0">
<li className="list-group-item">
<i className="glyphicon glyphicon-home"></i> {this.props.data.title}
</li>
<li className="list-group-item">
<i className="glyphicon glyphicon-star"></i> Тип: {helper.type(this.props.data.type)}
</li>
<li className="list-group-item">
<i className="glyphicon glyphicon-send"></i> Дистанция: {this.props.data.distance} м.
</li>
<li className="list-group-item">
<i className="glyphicon glyphicon-shopping-cart"></i> Удобства: <i className={this.props.data.toilet==true ? "glyphicon glyphicon-ok" : " glyphicon glyphicon-remove"}></i>
</li>
<li className="list-group-item">
<i className="glyphicon glyphicon-equalizer"></i> Душ: <i className={this.props.data.dush==true ? "glyphicon glyphicon-ok" : " glyphicon glyphicon-remove"}></i>
</li>
<li className="list-group-item">
<i className="glyphicon glyphicon-expand"></i> TV: <i className={this.props.data.tv==true ? "glyphicon glyphicon-ok" : " glyphicon glyphicon-remove"}></i>
</li>
<li className="list-group-item">
<i className="glyphicon glyphicon-folder-close"></i> Холодильник: <i className={this.props.data.refrigeter==true ? "glyphicon glyphicon-ok" : " glyphicon glyphicon-remove"}></i>
</li>
<li className="list-group-item">
<i className="glyphicon glyphicon-globe"></i> Кондиционер: <i className={this.props.data.conditioner==true ? "glyphicon glyphicon-ok" : " glyphicon glyphicon-remove"}></i>
</li>
</ul>
<span className="glyphicon glyphicon-zoom-in"></span>
</div>
</div>
)
}
};
| fix2015/BE-for-Gport | FE/components/main/locationItem/LocationItem.js | JavaScript | mit | 4,232 |
(function (r) {
"use strict";
var modules = {
helper: r('../helpers'),
data: r('../data'),
room: r('../Rooms/roomFunctions'),
playerSetup: {
player: r('../PlayerSetup/player-manager')
},
commands: r('../commands'),
events: {
enterRoom: r('./enterRoom'),
kill: r('./kill'),
exits: r('./findExits'),
},
loadPlayerLocation: r('../loadRoom'),
world: {
valston: r('../../World/valston/prison')
},
};
var findObject = function (playerInfo, room, item, event) {
var container = null;
item = item.trim().toLowerCase();
//check if item contains a container e.g get sword chest
// This gets the last item of a string -> item.split(" ").pop();
if (item.split(" ").length > 1) {
container = item.split(" ").pop();
// item = item.match(/"(.*)"|'(.*)'/);
}
console.log("find object " + item + "/" + event + "/" + container);
var name = playerInfo.getName();
var socket = playerInfo.getSocket();
var roomItems = room.items || [];
var playersInRoom = room.players || [];
var mobsInRoom = room.mobs || [];
var playerInv = playerInfo.getInventory() || [];
var eq = playerInfo.findEquipment() || [];
var eqCount = eq.length;
var allItems = roomItems.concat(playersInRoom, playerInv, mobsInRoom);
var allItemCount = allItems.length;
var notFoundMsg = 'Sorry you don\'t see that here';
var itemKeywords;
var findNthItem;
var found = false;
var multi = false;
if (/^\d+\./.test(item)) {
findNthItem = parseInt(item.split('.')[0], 10);
multi = true;
item = item.split('.')[1];
}
var eventLookUp = {
"look at": function (item) {
var description = item.description.look;
var response = {
"forRoom": name + ' looks at a ' + item.name,
"forPlayer": 'You look at a ' + item.name
};
if (item.type == 'object') {
// change a to an if item.name starts with a vowel a,e,i,o,u
// EDIT: which can still be incorrect, maybe include an overide or set the action description in the item?
var itemNameStartsWith = item.name.substr(0, 1).toLowerCase();
if (itemNameStartsWith == 'a' || itemNameStartsWith == 'e' || itemNameStartsWith == 'i' || itemNameStartsWith == 'o' || itemNameStartsWith == 'u') {
response.forRoom = name + ' looks at an ' + item.name;
response.forPlayer = 'You look at an ' + item.name;
} else {
response.forRoom = name + ' looks at a ' + item.name;
response.forPlayer = 'You look at a ' + item.name;
}
} else {
if (item.name == playerInfo.name || item.name == 'self') {
var sex = playerInfo.sex == 'Male' ? 'himself.' : 'herself.';
response.forRoom = name + ' looks at ' + sex;
response.forPlayer = 'You look at yourself';
}
else {
response.forRoom = name + ' looks at ' + item.name;
response.forPlayer = 'You look at ' + item.name;
}
description = item.description || playerInfo.description;
};
modules.playerSetup.player.playerManager.broadcastPlayerEvent(playerInfo, room.players, response);
modules.helper.helpers.send(socket, description);
},
"look in": function (item) {
var response = {
"forRoom": '',
"forPlayer": ''
}
//if item is a container
if (item.actions.container == true) {
//get container items array
var containerItems = item.items;
var containerItemCount = containerItems.length;
if (item.actions.locked == true) {
response.forRoom = name + ' tries to open the ' + item.name + ' but it\'s locked';
response.forPlayer = 'You attempt to open the ' + item.name + ' but it\'s locked';
modules.playerSetup.player.playerManager.broadcastPlayerEvent(playerInfo, room.players, response);
} else {
if (containerItemCount > 0) {
response.forRoom = name + ' looks inside a ' + item.name;
response.forPlayer = 'You look inside the ' + item.name + ' and see:';
modules.playerSetup.player.playerManager.broadcastPlayerEvent(playerInfo, room.players, response);
var chestItems = '';
for (var j = 0; j < containerItemCount; j++) {
if (item.items[j].count > 1) {
chestItems += item.items[j].name + ' (' + item.items[j].count + ')\r\n';
} else {
chestItems += item.items[j].name + '\r\n';
}
}
modules.helper.helpers.send(socket, chestItems);
} else {
response.forRoom = name + ' looks inside a ' + item.name;
response.forPlayer = 'You look inside the ' + item.name + ' but nothing is inside';
modules.playerSetup.player.playerManager.broadcastPlayerEvent(playerInfo, room.players, response);
}
}
} else {
modules.helper.helpers.send(socket, "A " + item.name + " is not a container");
response.forRoom = name + ' tries to look inside a ' + item.name;
response.forPlayer = "A " + item.name + " is not a container";
modules.playerSetup.player.playerManager.broadcastPlayerEvent(playerInfo, room.players, response);
}
},
"exam": function (item) {
console.log('inside exam function')
var description = item.description.exam;
var response = {
"forRoom": name + ' takes a closer look at a ' + item.name,
"forPlayer": 'You take a closer look at a' + item.name
};
if (item.type == 'object') {
// change a to an if item.name starts with a vowel a,e,i,o,u
// EDIT: which can still be incorrect, maybe include an overide or set the action description in the item?
var itemNameStartsWith = item.name.substr(0, 1).toLowerCase();
if (itemNameStartsWith == 'a' || itemNameStartsWith == 'e' || itemNameStartsWith == 'i' || itemNameStartsWith == 'o' || itemNameStartsWith == 'u') {
response.forRoom = name + ' takes a closer look at an ' + item.name;
response.forPlayer = 'You take a closer look at an ' + item.name;
} else {
response.forRoom = name + ' takes a closer look at a ' + item.name;
response.forPlayer = 'You take a closer look at a ' + item.name;
}
} else {
if (item.name == playerInfo.name || item.name == 'self') {
var sex = playerInfo.sex == 'Male' ? 'himself.' : 'herself.';
response.forRoom = name + ' looks at ' + sex;
response.forPlayer = 'You look at yourself';
}
else {
response.forRoom = name + ' looks at ' + item.name;
response.forPlayer = 'You look at ' + item.name;
}
description = item.description || playerInfo.description;
};
modules.playerSetup.player.playerManager.broadcastPlayerEvent(playerInfo, room.players, response);
modules.helper.helpers.send(socket, description);
},
"get": function (item, index) {
console.log('inside get function for ' + item.name);
var description = item.name;
var response = {
"forRoom": name + ' gets a ' + item.name,
"forPlayer": 'You get a' + item.name
};
if (item.type == 'object') {
// change a to an if item.name starts with a vowel a,e,i,o,u
// EDIT: which can still be incorrect, maybe include an overide or set the action description in the item?
var itemNameStartsWith = item.name.substr(0, 1).toLowerCase();
if (itemNameStartsWith == 'a' || itemNameStartsWith == 'e' || itemNameStartsWith == 'i' || itemNameStartsWith == 'o' || itemNameStartsWith == 'u') {
response.forRoom = name + ' gets an ' + item.name;
response.forPlayer = 'You get an ' + item.name;
} else {
response.forRoom = name + ' gets a ' + item.name;
response.forPlayer = 'You get a ' + item.name;
}
}
if (item.location != 'inv') {
modules.playerSetup.player.playerManager.broadcastPlayerEvent(playerInfo, room.players, response);
var itemLocation = {
room: function () { roomItems.splice(index, 1); },
};
itemLocation.room(index);
item.location = 'inv';
playerInfo.setInventory(item, 'get');
} else {
modules.helper.helpers.send(socket, 'Sorry you don\'t see that here');
}
// remove item from room
//save room
// save player!?
},
"drop": function (item) {
console.log('inside drop function');
var description = item.name;
var response = {
"forRoom": name + ' drops a ' + item.name,
"forPlayer": 'You drop a' + item.name
};
if (item.type == 'object') {
// change a to an if item.name starts with a vowel a,e,i,o,u
// EDIT: which can still be incorrect, maybe include an overide or set the action description in the item?
var itemNameStartsWith = item.name.substr(0, 1).toLowerCase();
if (itemNameStartsWith == 'a' || itemNameStartsWith == 'e' || itemNameStartsWith == 'i' || itemNameStartsWith == 'o' || itemNameStartsWith == 'u') {
response.forRoom = name + ' drops an ' + item.name;
response.forPlayer = 'You drop an ' + item.name;
} else {
response.forRoom = name + ' drop a ' + item.name;
response.forPlayer = 'You drop a ' + item.name;
}
}
console.log('item location is ' + item.location)
if (item.location == 'inv') {
modules.playerSetup.player.playerManager.broadcastPlayerEvent(playerInfo, room.players, response);
item.location = 'room';
room.items.push(item);
playerInfo.setInventory(item, 'drop');
} else {
modules.helper.helpers.send(socket, 'Sorry you don\'t have a ' + item.name + ' to drop');
}
// remove item from room
//save room
// save player!?
},
"wear": function (item, index) {
console.log('inside wear function');
var response = {
"forRoom": name + ' wears a ' + item.name,
"forPlayer": 'You wear a' + item.name
};
if (item.type == 'object') {
// change a to an if item.name starts with a vowel a,e,i,o,u
// EDIT: which can still be incorrect, maybe include an overide or set the action description in the item?
var itemNameStartsWith = item.name.substr(0, 1).toLowerCase();
if (itemNameStartsWith == 'a' || itemNameStartsWith == 'e' || itemNameStartsWith == 'i' || itemNameStartsWith == 'o' || itemNameStartsWith == 'u') {
response.forRoom = name + ' wears an ' + item.name;
response.forPlayer = 'You wear an ' + item.name;
} else {
response.forRoom = name + ' wears a ' + item.name;
response.forPlayer = 'You wear a ' + item.name;
}
}
if (item.location == 'inv') {
if (item.equipable === true) {
modules.playerSetup.player.playerManager.broadcastPlayerEvent(playerInfo, room.players, response);
var itemLocation = {
inv: function () { playerInv.splice(index, 1); },
};
itemLocation.inv(index);
item.location = 'equiped';
playerInfo.setEquipment(item, 'wear');
} else {
response.forRoom = name + 'tries to wear a ' + item.name;
response.forPlayer = 'Sorry ' + item.name + ' cannot be worn';
modules.playerSetup.player.playerManager.broadcastPlayerEvent(playerInfo, room.players, response);
}
} else {
modules.helper.helpers.send(socket, 'Sorry you don\'t have a ' + item.name + ' to wear');
}
},
"remove": function (item, index) {
console.log('inside remove function');
console.log(item)
var response = {
"forRoom": name + ' removes a ' + item.name,
"forPlayer": 'You removes a' + item.name
};
if (item.type == 'object') {
// change a to an if item.name starts with a vowel a,e,i,o,u
// EDIT: which can still be incorrect, maybe include an overide or set the action description in the item?
var itemNameStartsWith = item.name.substr(0, 1).toLowerCase();
if (itemNameStartsWith == 'a' || itemNameStartsWith == 'e' || itemNameStartsWith == 'i' || itemNameStartsWith == 'o' || itemNameStartsWith == 'u') {
response.forRoom = name + ' remove an ' + item.name;
response.forPlayer = 'You remove an ' + item.name;
} else {
response.forRoom = name + ' remove a ' + item.name;
response.forPlayer = 'You remove a ' + item.name;
}
}
if (item.location == 'equiped') {
//check if removable? e.g cursed?
//if (item.removable === true) {
modules.playerSetup.player.playerManager.broadcastPlayerEvent(playerInfo, room.players, response);
playerInv.push(item);
item.location = 'inv';
playerInfo.setEquipment(item, 'remove');
// }
} else {
modules.helper.helpers.send(socket, 'Sorry you don\'t have a ' + item.name + ' to remove');
}
},
"kill": function (item, index) {
console.log('inside kill function');
console.log(item)
console.log('inside get function for ' + item.name);
var description = item.name;
var response = {
"forRoom": name + ' attack a ' + item.name,
"forPlayer": 'You attack a' + item.name
};
if (item.type == 'mob') {
// change a to an if item.name starts with a vowel a,e,i,o,u
// EDIT: which can still be incorrect, maybe include an overide or set the action description in the item?
var itemNameStartsWith = item.name.substr(0, 1).toLowerCase();
if (itemNameStartsWith == 'a' || itemNameStartsWith == 'e' || itemNameStartsWith == 'i' || itemNameStartsWith == 'o' || itemNameStartsWith == 'u') {
response.forRoom = name + ' attacks an ' + item.name;
response.forPlayer = 'You attack an ' + item.name;
} else {
response.forRoom = name + ' attacks a ' + item.name;
response.forPlayer = 'You attack a ' + item.name;
}
}
//kill function
modules.events.kill.kill.initCombat(playerInfo, item);
}
}
if (event === 'drop' || event === 'wear' || event === 'wield') {
allItemCount = playerInv.length;
allItems = playerInv;
}
if (event === 'remove') {
allItemCount = eqCount;
allItems = eq;
notFoundMsg = 'Sorry you do not have that equipped';
}
var object = item;
if (container !== null) {
object = container;
item = item.split(' ').slice(0, 1).join(' ');
}
//used for keeping count of items looped for all
var totalAllItems = 0;
if (object === 'all') {
if (event === 'drop') {
allItems = playerInv;
} else {
allItems = roomItems;
}
allItemCount = allItems.length;
console.log("Number of items " + allItemCount)
}
/*
* Loop through All Items in the room
* =====================================
* By default this contains: Items, Players, inventory & Mobs
* unless specified for example; if the event is drop, wear or wield these actions
* can only be used on items in the players inventory so allItems will only contain inventory items. (see above)
*
* if Multi is true it will look for x.item eg. 2.sword will get the 2nd sword in allItems.
*
* If a container is specified it will look for this 1st then loop through the container items array for the item.
*
* Currently if you type get long sword it will think sword is a container and will search for it.
* TODO: allow for multiple space keywords e.g get 'long sword' or get "long sword"
*
*/
var containerItems;
var containerItemsCount;
var containerKeywords;
for (var i = 0; i < allItemCount; i++) {
if (object === 'all') {
totalAllItems += 1;
if (totalAllItems <= allItemCount) {
console.log("look count " + i + "totalI " + totalAllItems);
eventLookUp[event](allItems[i], i);
i -= 1;
found = true;
}
}
else {
if (found === false) {
itemKeywords = allItems[i].keywords;
if (multi && itemKeywords.indexOf(object) > -1) {
if (findNthItem === i - 1) {
console.log(allItems[i] + "\n\r");
if (container !== null) {
if (allItems[i].actions.container === true) {
console.log("Is container\r\n");
containerItems = allItems[i].items;
containerItemsCount = containerItems.length;
console.log("items include " + containerItems);
for (let j = 0; j < containerItemsCount; j++) {
containerKeywords = containerItems[j].keywords;
console.log(containerKeywords + " find item " + item);
if (containerKeywords.indexOf(item) > -1) {
console.log("found " + containerItems[j]);
eventLookUp[event](containerItems[j], j);
break;
}
}
}
} else {
eventLookUp[event](allItems[i], i);
}
found = true;
}
} else if (multi === false && itemKeywords.indexOf(object) > -1 || object === 'all') {
console.log(allItems[i] + "\n\r");
if (container !== null) {
if (allItems[i].actions.container === true) {
console.log("Is container\r\n");
containerItems = allItems[i].items;
containerItemsCount = containerItems.length;
console.log("items include " + containerItems);
for (let j = 0; j < containerItemsCount; j++) {
containerKeywords = containerItems[j].keywords;
console.log(containerKeywords + " find item " + item);
if (containerKeywords.indexOf(item) > -1) {
console.log("found " + containerItems[j]);
eventLookUp[event](containerItems[j], j);
break;
}
}
}
} else {
eventLookUp[event](allItems[i], i);
}
found = true;
}
}
}
};
//another for loop but for players and inventory if it's not found in room?
if (!found) {
modules.helper.helpers.send(socket, notFoundMsg);
}
}
exports.findObject = findObject;
})(require); | LiamKenneth/MudDungeonJS | Game/Core/Events/findObject.js | JavaScript | mit | 23,998 |
/// <reference path="./ReadersSynphonyWrapper.ts" />
/// <reference path="./libSynphony/jquery.text-markup.d.ts" />
/// <reference path="./jquery.div-columns.ts" />
/// <reference path="../../../typings/jqueryui/jqueryui.d.ts" />
/// <reference path="../../js/editableDivUtils.ts" />
/// <reference path="./directoryWatcher.ts" />
/// <reference path="../../../lib/localizationManager/localizationManager.ts" />
/// <reference path="readerTools.ts" />
/// <reference path="../toolbox.ts" />
/// <reference path="./libSynphony/synphony_lib.d.ts" />
import { DirectoryWatcher } from "./directoryWatcher";
import { resizeWordList } from "./readerTools";
import theOneLocalizationManager from '../../../lib/localizationManager/localizationManager';
import { ToolBox } from "../toolbox";
import "./libSynphony/jquery.text-markup.ts";
import './jquery.div-columns.ts';
import { ReaderStage, ReaderLevel, ReaderSettings } from './ReaderSettings';
import * as _ from 'underscore';
import { theOneLanguageDataInstance, theOneLibSynphony } from './libSynphony/synphony_lib';
import ReadersSynphonyWrapper from './ReadersSynphonyWrapper';
import { DataWord, TextFragment } from './libSynphony/bloomSynphonyExtensions';
import axios from "axios";
import { EditableDivUtils } from '../../js/editableDivUtils';
var SortType = {
alphabetic: "alphabetic",
byLength: "byLength",
byFrequency: "byFrequency"
};
export var MarkupType = {
None: 0,
Leveled: 1,
Decodable: 2
};
var sortIconSelectedClass = "sortIconSelected"; // The class we apply to the selected sort icon
var disabledIconClass = "disabledIcon"; // The class we apply to icons that are disabled.
var disabledLimitClass = "disabledLimit"; // The class we apply to max values that are disabled (0).
export class DRTState {
stage: number = 1;
level: number = 1;
markupType: number = MarkupType.Decodable;
}
export class ReaderToolsModel {
previousHeight: number = 0;
previousWidth: number = 0;
stageNumber: number = 1;
levelNumber: number = 1;
synphony: ReadersSynphonyWrapper = null; // to ensure detection of async issues, don't init until we load its settings
sort: string = SortType.alphabetic;
currentMarkupType: number = MarkupType.None;
allWords = {};
texts = [];
setupType: string = '';
fontName: string = '';
readableFileExtensions: string[] = [];
directoryWatcher: DirectoryWatcher = null;
maxAllowedWords: number = 10000;
// remember words so we can update the counts real-time
pageIDToText = [];
// BL-599: Speed up the decodable reader tool
stageGraphemes = [];
activeElement: HTMLElement;
undoStack: any[];
redoStack: any[];
wordListChangedListeners: any = {};
// some things need to wait until the word list has finished loading
wordListLoaded: boolean = false;
ckEditorLoaded: boolean = false;
allowedWordFilesRemaining: number = 0;
public clearForTest() {
this.stageNumber = 1;
this.levelNumber = 1;
this.synphony = null;
this.sort = SortType.alphabetic;
this.currentMarkupType = MarkupType.None;
this.allWords = {};
this.texts = [];
this.setupType = '';
this.fontName = '';
this.readableFileExtensions = [];
this.directoryWatcher = null;
this.maxAllowedWords = 10000;
this.pageIDToText = [];
this.stageGraphemes = [];
this.activeElement = null;
this.undoStack = [];
this.redoStack = [];
this.wordListChangedListeners = {};
}
public getReadableFileExtensions() {
return ['txt', 'js', 'json'];
}
readyToDoMarkup(): boolean { return this.wordListLoaded && this.ckEditorLoaded; }
setCkEditorLoaded(): void { this.ckEditorLoaded = true; }
incrementStage(): void {
this.setStageNumber(this.stageNumber + 1);
}
decrementStage(): void {
this.setStageNumber(this.stageNumber - 1);
}
setStageNumber(stage: number, skipSave?: boolean): void {
// this much needs to be done immediately; otherwise, the result of
// different routines calling setStageNumber is unpredictable, depending on
// when the different asyncGetText() calls complete.
var stages = this.synphony.getStages();
if (stage < 1 || stage > stages.length) {
return;
}
this.stageNumber = stage;
this.updateStageLabel();
this.updateStageButtonsAvalibility();
theOneLocalizationManager.asyncGetText("Common.Loading", "Loading...", "").then((loadingMessage) => {
// this may result in a need to resize the word list
this.previousHeight = 0;
$("#letterList").html(loadingMessage);
$("#wordList").html(loadingMessage);
// OK, now let that changed number and the "loading" messages
// make it to the user's screen, then start doing the work.
window.setTimeout(() => {
if (this.stageNumber === stage) {
this.stageGraphemes = this.getKnownGraphemes(stage);
}
// Both setting the letters and words require that to be done,
// but they can be done independently of each other.
// By separating them, we allow the letters to update while
// the words are still being generated.
window.setTimeout(() => {
// make sure this is still the stage they want
// (it won't be if they are rapidly clicking the next/previous stage buttons)
if (this.stageNumber === stage) {
this.updateLetterList();
}
}, 0);
window.setTimeout(() => {
// make sure this is still the stage they want
// (it won't be if they are rapidly clicking the next/previous stage buttons)
if (this.stageNumber === stage) {
this.updateWordList();
}
}, 0);
if (!skipSave) {
this.saveState();
// When we're actually changing the stage number is the only time we want
// to update the default.
axios.post("/bloom/api/readers/io/defaultStage?stage=" + this.stageNumber);
}
if (this.readyToDoMarkup()) {
this.doMarkup();
}
// The 1/2 second delay here gives us a chance to click quickly and change the stage before we start working
// If that happens, the check that is the first line of this setTimeout function will decide to bail out.
}, 500);
});
}
updateStageLabel(): void {
var stages = this.synphony.getStages();
if (stages.length <= 0) {
this.updateElementContent("stageNumber", "0");
return;
}
if (this.stageNumber > stages.length) {
this.stageNumber = stages.length;
}
this.updateElementContent("stageNumber", stages[this.stageNumber - 1].getName());
}
incrementLevel(): void {
this.setLevelNumber(this.levelNumber + 1);
}
decrementLevel(): void {
this.setLevelNumber(this.levelNumber - 1);
}
setLevelNumber(val: number, skipSave?: boolean): void {
var levels = this.synphony.getLevels();
if (val < 1 || val > levels.length) {
return;
}
this.levelNumber = val;
this.updateLevelLabel();
this.enableLevelButtons();
this.updateLevelLimits();
if (!skipSave) {
this.saveState();
// When we're actually changing the level is the only time we want
// to update the default.
axios.post("/bloom/api/readers/io/defaultLevel?level=" + this.levelNumber);
}
this.doMarkup();
}
updateLevelLabel(): void {
var levels = this.synphony.getLevels();
if (levels.length <= 0) {
this.updateElementContent("levelNumber", "0");
return;
}
if (levels.length < this.levelNumber) {
this.setLevelNumber(levels.length);
return;
}
this.updateElementContent("levelNumber", levels[this.levelNumber - 1].getName());
}
sortByLength(): void {
this.setSort(SortType.byLength);
}
sortByFrequency(): void {
this.setSort(SortType.byFrequency);
}
sortAlphabetically(): void {
this.setSort(SortType.alphabetic);
}
setSort(sortType: string, skipSave?: boolean): void {
this.sort = sortType;
this.updateSortStatus();
this.updateWordList();
if (!skipSave) {
this.saveState();
}
}
updateSortStatus(): void {
this.updateSelectedStatus("sortAlphabetic", this.sort === SortType.alphabetic);
this.updateSelectedStatus("sortLength", this.sort === SortType.byLength);
this.updateSelectedStatus("sortFrequency", this.sort === SortType.byFrequency);
}
updateSelectedStatus(eltId: string, isSelected: boolean): void {
this.setPresenceOfClass(eltId, isSelected, sortIconSelectedClass);
}
/**
* Should be called when the browser has loaded the page, and when the user has changed configuration.
* It updates various things in the UI to be consistent with the state of things in the model.
*/
updateControlContents(): void {
this.updateLetterList();
this.updateNumberOfStages();
this.updateNumberOfLevels();
this.updateStageLabel();
this.updateStageButtonsAvalibility();
this.enableLevelButtons();
this.updateLevelLimits();
this.updateLevelLabel();
this.updateWordList();
}
updateNumberOfStages(): void {
this.updateElementContent("numberOfStages", this.synphony.getStages().length.toString());
}
updateNumberOfLevels(): void {
this.updateElementContent("numberOfLevels", this.synphony.getLevels().length.toString());
}
updateStageButtonsAvalibility(): void {
this.updateDisabledStatus("decStage", this.stageNumber <= 1);
this.updateDisabledStatus("incStage", this.stageNumber >= this.synphony.getStages().length);
}
updateDisabledStatus(eltId: string, isDisabled: boolean): void {
this.setPresenceOfClass(eltId, isDisabled, disabledIconClass);
}
/**
* Find the element with the indicated ID, and make sure that it has the className in its class attribute
* if isWanted is true, and not otherwise.
* (Tests currently assume it will be added last, but this is not required.)
* (class names used with this method should not occur as sub-strings within a longer class name)
*/
setPresenceOfClass(eltId: string, isWanted: boolean, className: string): void {
var old = this.getElementAttribute(eltId, "class");
// this can happen during testing
if (!old) old = "";
if (isWanted && old.indexOf(className) < 0) {
this.setElementAttribute(eltId, "class", old + (old.length ? " " : "") + className);
}
else if (!isWanted && old.indexOf(className) >= 0) {
this.setElementAttribute(eltId, "class", old.replace(className, "").replace(" ", " ").trim());
}
}
enableLevelButtons(): void {
this.updateDisabledStatus("decLevel", this.levelNumber <= 1);
this.updateDisabledStatus("incLevel", this.levelNumber >= this.synphony.getLevels().length);
}
updateLevelLimits(): void {
var level = this.synphony.getLevels()[this.levelNumber - 1];
if (!level)
level = new ReaderLevel("");
this.updateLevelLimit("maxWordsPerPage", level.getMaxWordsPerPage());
this.updateLevelLimit("maxWordsPerPageBook", level.getMaxWordsPerPage());
this.updateLevelLimit("maxWordsPerSentence", level.getMaxWordsPerSentence());
this.updateLevelLimit("maxWordsPerBook", level.getMaxWordsPerBook());
this.updateLevelLimit("maxUniqueWordsPerBook", level.getMaxUniqueWordsPerBook());
this.updateLevelLimit("maxAverageWordsPerSentence", level.getMaxAverageWordsPerSentence());
if (level.thingsToRemember.length) {
var list = document.getElementById('thingsToRemember');
if (list !== null) {
list.innerHTML = '';
for (var i = 0; i < level.thingsToRemember.length; i++) {
var li = document.createElement('li');
li.innerHTML = level.thingsToRemember[i];
list.appendChild(li);
}
}
}
}
updateLevelLimit(id: string, limit: number): void {
if (limit !== 0) {
this.updateElementContent(id, limit.toString());
}
this.updateDisabledLimit(id, limit === 0);
}
updateDisabledLimit(eltId: string, isDisabled: boolean): void {
this.setPresenceOfClass(eltId, isDisabled, disabledLimitClass);
}
/**
* Displays the list of words for the current Stage.
*/
updateWordList(): void {
// show the correct headings
//reviewSLog
var useAllowedWords = (this.synphony.source) ? this.synphony.source.useAllowedWords === 1 : false;
// this happens during unit testing
if (document.getElementById('make-letter-word-list-div')) {
document.getElementById('make-letter-word-list-div').style.display = useAllowedWords ? 'none' : '';
document.getElementById('letters-in-this-stage').style.display = useAllowedWords ? 'none' : '';
document.getElementById('letterList').parentElement.style.display = useAllowedWords ? 'none' : '';
document.getElementById('sample-words-this-stage').style.display = useAllowedWords ? 'none' : '';
document.getElementById('sortFrequency').style.display = useAllowedWords ? 'none' : '';
document.getElementById('allowed-words-this-stage').style.display = useAllowedWords ? '' : 'none';
document.getElementById('allowed-word-list-truncated').style.display = useAllowedWords ? '' : 'none';
}
if (!this.readyToDoMarkup()) return;
var wordList = document.getElementById('wordList');
if (wordList) document.getElementById('wordList').innerHTML = '';
var stages = this.synphony.getStages();
if (stages.length === 0) return;
var words: DataWord[];
if (useAllowedWords)
words = this.getAllowedWordsAsObjects(this.stageNumber);
else
words = this.getStageWordsAndSightWords(this.stageNumber);
resizeWordList(false);
// All cases use localeCompare for alphabetic sort. This is not ideal; it will use whatever
// locale the browser thinks is current. When we implement ldml-dependent sorting we can improve this.
switch (this.sort) {
case SortType.alphabetic:
words.sort(function (a: DataWord, b: DataWord) {
return a.Name.localeCompare(b.Name);
});
break;
case SortType.byLength:
words.sort(function (a: DataWord, b: DataWord) {
if (a.Name.length === b.Name.length) {
return a.Name.localeCompare(b.Name);
}
return a.Name.length - b.Name.length;
});
break;
case SortType.byFrequency:
words.sort(function (a: DataWord, b: DataWord) {
var aFreq = a.Count;
var bFreq = b.Count;
if (aFreq === bFreq) {
return a.Name.localeCompare(b.Name);
}
return bFreq - aFreq; // MOST frequent first
});
break;
default:
}
// add the words
var result = '';
var longestWord = '';
for (var i = 0; i < words.length; i++) {
var w: DataWord = words[i];
result += '<div class="word' + (w.isSightWord ? ' sight-word' : '') + '">' + w.Name + '</div>';
if (w.Name.length > longestWord.length) longestWord = w.Name;
}
var div = $('div.wordList');
div.css('font-family', this.fontName);
this.updateElementContent("wordList", result);
$.divsToColumnsBasedOnLongestWord('word', longestWord);
}
/**
* Displays the list of letters for the current Stage.
*/
updateLetterList(): void {
var stages = this.synphony.getStages();
if (stages.length === 0) {
// In case the user deletes all stages, and something had been displayed before.
this.updateElementContent("letterList", "");
return;
}
if (this.stageNumber > 0) {
this.stageGraphemes = this.getKnownGraphemes(this.stageNumber); //BL-838
}
// Letters up through current stage
var letters = this.stageGraphemes;
// All the letters in the order they were entered on the Letters tab in the set up dialog
var allLetters = this.synphony.source.letters.split(' ');
// Sort our letters based on the order they were entered
letters.sort(function (a, b) {
return allLetters.indexOf(a) - allLetters.indexOf(b);
});
var result = "";
for (var i = 0; i < letters.length; i++) {
var letter = letters[i];
result += '<div class="letter">' + letter + '</div>';
}
var div = $('div.letterList');
div.css('font-family', this.fontName);
this.updateElementContent("letterList", result);
$.divsToColumns('letter');
}
/**
* Get the sight words for the current stage and all previous stages.
* Note: The list returned may contain sight words from previous stages that are now decodable.
* @param stageNumber
* @returns An array of strings
*/
getSightWords(stageNumber?: number): string[] {
var stages: ReaderStage[] = this.synphony.getStages(stageNumber);
var sightWords: string[] = [];
if (stages.length > 0) {
for (var i = 0; i < stages.length; i++) {
if (stages[i].sightWords) sightWords = _.union(sightWords, stages[i].sightWords.split(' '));
}
}
return sightWords;
}
/**
* Get the sight words for the current stage and all previous stages as an array of DataWord objects
* Note: The list returned may contain sight words from previous stages that are now decodable.
* @param stageNumber
* @returns An array of DataWord objects
*/
getSightWordsAsObjects(stageNumber: number): DataWord[] {
var words: string[] = this.getSightWords(stageNumber);
var returnVal: DataWord[] = [];
for (var i = 0; i < words.length; i++) {
var dw = new DataWord(words[i]);
dw.isSightWord = true;
returnVal.push(dw);
}
return returnVal;
}
/**
* Get the graphemes for the current stage and all previous stages
* @param stageNumber
* @returns An array of strings
*/
getKnownGraphemes(stageNumber: number): string[] {
var stages = this.synphony.getStages(stageNumber);
// compact to remove empty items if no graphemes are selected
return _.compact(_.pluck(stages, 'letters').join(' ').split(' '));
}
/**
*
* @returns An array of DataWord objects
*/
getStageWords(): DataWord[] {
if ((!this.stageGraphemes) || (this.stageGraphemes.length === 0)) return [];
return this.selectWordsFromSynphony(false, this.stageGraphemes, this.stageGraphemes, true, true);
}
getStageWordsAndSightWords(stageNumber: number): DataWord[] {
if (!this.readyToDoMarkup()) return;
// first get the sight words
var sightWords = this.getSightWordsAsObjects(stageNumber);
var stageWords = this.getStageWords();
return _.uniq(stageWords.concat(sightWords), false, function (w: DataWord) {
return w.Name;
});
}
/**
* Change the markup type when the user selects a different Tool.
* @param {int} markupType
* returns true if doMarkup called
*/
setMarkupType(markupType: number): boolean {
var newMarkupType = null;
switch (markupType) {
case 1:
if (this.currentMarkupType !== MarkupType.Decodable)
newMarkupType = MarkupType.Decodable;
break;
case 2:
if (this.currentMarkupType !== MarkupType.Leveled)
newMarkupType = MarkupType.Leveled;
break;
default:
if (this.currentMarkupType !== MarkupType.None)
newMarkupType = MarkupType.None;
break;
}
// if no change, return now
if (newMarkupType === null) return false;
var didMarkup = false;
if (newMarkupType !== this.currentMarkupType) {
var page: HTMLIFrameElement = <HTMLIFrameElement>parent.window.document.getElementById('page');
if (page)
$('.bloom-editable', page.contentWindow.document).removeSynphonyMarkup();
this.currentMarkupType = newMarkupType;
this.doMarkup();
didMarkup = true;
}
this.saveState();
return didMarkup;
}
getElementsToCheck(): JQuery {
var page: HTMLIFrameElement = <HTMLIFrameElement>parent.window.document.getElementById('page');
// this happens during unit testing
if (!page) {
return $('.bloom-page')
.not('.bloom-frontMatter, .bloom-backMatter')
.find('.bloom-content1.bloom-editable');
}
// if this is a cover page, return an empty set
var cover = $('body', page.contentWindow.document).find('div.cover');
if (cover['length'] > 0) return $();
// not a cover page, return elements to check
return $('.bloom-page', page.contentWindow.document)
.not('.bloom-frontMatter, .bloom-backMatter')
.find('.bloom-content1.bloom-editable');
}
noteFocus(element: HTMLElement): void {
this.activeElement = element;
this.undoStack = [];
this.redoStack = [];
this.undoStack.push({
html: element.innerHTML,
text: element.textContent,
offset: EditableDivUtils.getElementSelectionIndex(this.activeElement)
});
}
shouldHandleUndo(): boolean {
return this.currentMarkupType !== MarkupType.None;
}
undo(): void {
if (!this.activeElement) return;
if (this.activeElement.textContent == this.undoStack[this.undoStack.length - 1].text && this.undoStack.length > 1) {
this.redoStack.push(this.undoStack.pop());
}
this.activeElement.innerHTML = this.undoStack[this.undoStack.length - 1].html;
var restoreOffset = this.undoStack[this.undoStack.length - 1].offset;
if (restoreOffset < 0) return;
EditableDivUtils.makeSelectionIn(this.activeElement, restoreOffset, null, true);
}
canUndo(): boolean {
if (!this.activeElement) return false;
if (this.undoStack && (this.undoStack.length > 1 || this.activeElement.textContent !== this.undoStack[0].text)) {
return true;
}
return false;
}
redo(): void {
if (!this.activeElement) return;
if (this.redoStack.length > 0) {
this.undoStack.push(this.redoStack.pop());
}
this.activeElement.innerHTML = this.undoStack[this.undoStack.length - 1].html;
var restoreOffset = this.undoStack[this.undoStack.length - 1].offset;
if (restoreOffset < 0) return;
EditableDivUtils.makeSelectionIn(this.activeElement, restoreOffset, null, true);
}
getPageWindow(): Window {
return (<HTMLIFrameElement>top.document.getElementById('page')).contentWindow;
}
/**
* Displays the correct markup for the current page.
*/
doMarkup(): void {
if (!this.readyToDoMarkup()) return;
if (this.currentMarkupType === MarkupType.None) return;
var oldSelectionPosition = -1;
if (this.activeElement) oldSelectionPosition = EditableDivUtils.getElementSelectionIndex(this.activeElement);
var editableElements = this.getElementsToCheck();
// qtips can be orphaned if the element they belong to is deleted
// (and so the mouse can't move off their owning element, and they never go away).
// BL-2758 But if we're in a source collection we may have valid source bubbles,
// don't delete them!
if (editableElements.length > 0)
$(editableElements[0]).closest('body').children('.qtip:not(".uibloomSourceTextsBubble")').remove();
switch (this.currentMarkupType) {
case MarkupType.Leveled:
if (editableElements.length > 0) {
var options = {
maxWordsPerSentence: this.maxWordsPerSentenceOnThisPage(),
maxWordsPerPage: this.maxWordsPerPage()
};
editableElements.checkLeveledReader(options);
// update current page words
var pageDiv = $('body', this.getPageWindow().document).find('div.bloom-page');
if (pageDiv.length) {
if (pageDiv[0].id)
this.pageIDToText[pageDiv[0].id] = editableElements['allWords'];
}
}
this.updateMaxWordsPerSentenceOnPage();
this.updateTotalWordsOnPage();
this.displayBookTotals();
break;
case MarkupType.Decodable:
if (editableElements.length == 0) return;
// get current stage and all previous stages
var stages = this.synphony.getStages(this.stageNumber);
if (stages.length === 0) return;
// get word lists
var cumulativeWords: DataWord[];
var sightWords: string[];
if (this.synphony.source.useAllowedWords === 1) {
cumulativeWords = [];
sightWords = this.selectWordsFromAllowedLists(this.stageNumber);
}
else {
cumulativeWords = this.getStageWords();
sightWords = this.getSightWords(this.stageNumber);
}
editableElements.checkDecodableReader({
focusWords: cumulativeWords,
previousWords: cumulativeWords,
// theOneLibSynphony lowercases the text, so we must do the same with sight words. (BL-2550)
sightWords: sightWords.join(' ').toLowerCase().split(/\s/),
knownGraphemes: this.stageGraphemes
});
break;
default:
}
if (this.activeElement && this.activeElement.textContent != this.undoStack[this.undoStack.length - 1].text) {
this.undoStack.push({
html: this.activeElement.innerHTML,
text: this.activeElement.textContent,
offset: oldSelectionPosition
});
this.redoStack = []; // ok because only referred to by this variable.
}
// the contentWindow is not available during unit testing
var page: HTMLIFrameElement = <HTMLIFrameElement>parent.window.document.getElementById('page');
if (page)
page.contentWindow.postMessage('Qtips', "*");
}
maxWordsPerSentenceOnThisPage(): number {
var levels: ReaderLevel[] = this.synphony.getLevels();
if (levels.length <= 0) {
return 9999;
}
return levels[this.levelNumber - 1].getMaxWordsPerSentence();
}
maxWordsPerBook(): number {
var levels: ReaderLevel[] = this.synphony.getLevels();
if (levels.length <= 0) {
return 999999;
}
return levels[this.levelNumber - 1].getMaxWordsPerBook();
}
maxUniqueWordsPerBook(): number {
var levels: ReaderLevel[] = this.synphony.getLevels();
if (levels.length <= 0) {
return 99999;
}
return levels[this.levelNumber - 1].getMaxUniqueWordsPerBook();
}
maxAverageWordsPerSentence(): number {
var levels: ReaderLevel[] = this.synphony.getLevels();
if (levels.length <= 0) {
return 99999;
}
return levels[this.levelNumber - 1].getMaxAverageWordsPerSentence();
}
maxWordsPerPage(): number {
var levels: ReaderLevel[] = this.synphony.getLevels();
if (levels.length <= 0) {
return 9999;
}
return levels[this.levelNumber - 1].getMaxWordsPerPage();
}
// Though I'm not using this now, it was hard-won, and instructive. So I'm leaving it here
// as an example for now in case we need to do this transformResponse thing.
// getTextOfWholeBook(): void {
// //review: on the server, this is actually a json string
// axios.get<string>('/bloom/api/readers/textOfContentPages',
// {
// //when there are no content pages in the book, the server returns, properly, "{}"
// //However the default transformResponse of axios eagerly does a JSON.Parse on everything,
// //even if we say we only want text/plain and the server says it gave text/plain. Sheesh.
// //So we specify our own identity transformResponse
// transformResponse: (data: string) => <string>data }
// ).then(result => {
// //The return looks like {'12547c' : 'hello there', '898af87' : 'words of this page', etc.}
// this.pageIDToText = JSON.parse(result.data);
// this.doMarkup();
// });
// }
getTextOfWholeBook(): void {
axios.get('/bloom/api/readers/io/textOfContentPages').then(result => {
//result.data looks like {'0bbf0bc5-4533-4c26-92d9-bea8fd064525:' : 'Jane saw spot', 'AAbf0bc5-4533-4c26-92d9-bea8fd064525:' : 'words of this page', etc.}
this.pageIDToText = result.data as any[];
this.doMarkup();
});
}
displayBookTotals(): void {
if (this.pageIDToText.length === 0) {
this.getTextOfWholeBook();
return;
}
var pageStrings = _.values(this.pageIDToText);
this.updateActualCount(this.countWordsInBook(pageStrings), this.maxWordsPerBook(), 'actualWordCount');
this.updateActualCount(this.maxWordsPerPageInBook(pageStrings), this.maxWordsPerPage(), 'actualWordsPerPageBook');
this.updateActualCount(this.uniqueWordsInBook(pageStrings), this.maxUniqueWordsPerBook(), 'actualUniqueWords');
this.updateActualCount(this.averageWordsInSentence(pageStrings), this.maxAverageWordsPerSentence(), 'actualAverageWordsPerSentence');
}
countWordsInBook(pageStrings: string[]): number {
var total = 0;
for (var i = 0; i < pageStrings.length; i++) {
var page = pageStrings[i];
var fragments: TextFragment[] = theOneLibSynphony.stringToSentences(page);
// remove inter-sentence space
fragments = fragments.filter(function (frag) {
return frag.isSentence;
});
for (var j = 0; j < fragments.length; j++) {
total += fragments[j].wordCount();
}
}
return total;
}
uniqueWordsInBook(pageStrings: string[]): number {
var wordMap = {};
for (var i = 0; i < pageStrings.length; i++) {
var page = pageStrings[i];
var fragments: TextFragment[] = theOneLibSynphony.stringToSentences(page);
// remove inter-sentence space
fragments = fragments.filter(function (frag) {
return frag.isSentence;
});
for (var j = 0; j < fragments.length; j++) {
var words = fragments[j].words;
for (var k = 0; k < words.length; k++) {
wordMap[words[k]] = 1;
}
}
}
return Object.keys(wordMap).length;
}
maxWordsPerPageInBook(pageStrings: string[]): number {
var maxWords = 0;
for (var i = 0; i < pageStrings.length; i++) {
var page = pageStrings[i];
// split into sentences
var fragments: TextFragment[] = theOneLibSynphony.stringToSentences(page);
// remove inter-sentence space
fragments = fragments.filter(function (frag) {
return frag.isSentence;
});
var subMax = 0;
for (var j = 0; j < fragments.length; j++) {
subMax += fragments[j].wordCount();
}
if (subMax > maxWords) maxWords = subMax;
}
return maxWords;
}
averageWordsInSentence(pageStrings: string[]): number {
var sentenceCount = 0;
var wordCount = 0;
for (var i = 0; i < pageStrings.length; i++) {
var page = pageStrings[i];
var fragments: TextFragment[] = theOneLibSynphony.stringToSentences(page);
// remove inter-sentence space
fragments = fragments.filter(function (frag) {
return frag.isSentence;
});
for (var j = 0; j < fragments.length; j++) {
wordCount += fragments[j].words.length;
sentenceCount++;
}
}
if (sentenceCount == 0) {
return 0;
}
return Math.round(wordCount / sentenceCount);
//return Math.round(10 * wordCount / sentenceCount) / 10; // for one decimal place
}
updateActualCount(actual: number, max: number, id: string): void {
$('#' + id).html(actual.toString());
var acceptable = (actual <= max) || (max === 0);
// The two styles here must match ones defined in ReaderTools.htm or its stylesheet.
// It's important NOT to use two names where one is a substring of the other (e.g., unacceptable
// instead of tooLarge). That will mess things up going from the longer to the shorter.
this.setPresenceOfClass(id, acceptable, "acceptable");
this.setPresenceOfClass(id, !acceptable, "tooLarge");
}
updateMaxWordsPerSentenceOnPage(): void {
this.updateActualCount(this.getElementsToCheck().getMaxSentenceLength(), this.maxWordsPerSentenceOnThisPage(), 'actualWordsPerSentence');
}
updateTotalWordsOnPage(): void {
this.updateActualCount(this.getElementsToCheck().getTotalWordCount(), this.maxWordsPerPage(), 'actualWordsPerPage');
}
/** Should be called early on, before other init. */
setSynphony(val: ReadersSynphonyWrapper): void {
this.synphony = val;
}
// getSynphony(): ReadersSynphonyWrapper {
// return this.synphony;
// }
/**
* This group of functions uses jquery (if loaded) to update the real model.
* Unit testing should spy or otherwise replace these functions, since $ will not be usefully defined.
*/
updateElementContent(id: string, val: string): void {
$("#" + id).html(val);
}
getElementAttribute(id: string, attrName: string): string {
return $("#" + id).attr(attrName);
}
setElementAttribute(id: string, attrName: string, val: string): void {
$("#" + id).attr(attrName, val);
}
/**
* Add words from a file to the list of all words. Does not produce duplicates.
* @param fileContents
*/
addWordsFromFile(fileContents: string): void {
//reviewslog: at the moment, thes first two clauses just do the same things
// is this a Synphony data file?
if (fileContents.substr(0, 12) === '{"LangName":' ||
//TODO remove this is bizarre artifact of the original synphony, where the data file was actually some javascript. Still used in a unit test.
fileContents.substr(0, 12) === 'setLangData(') {
theOneLibSynphony.langDataFromString(fileContents);
if (this.synphony) {
this.synphony.loadFromLangData(theOneLanguageDataInstance);
} else {
console.warn("ReaderToolsModel.AddWordsFromFile() - this.synphony is null, fileContents starts: " + fileContents.substr(0, 24));
}
}
// handle sample texts files that are just a set of space-delimited words
else {
var words = theOneLibSynphony.getWordsFromHtmlString(fileContents);
// Limit the number of words processed from files. The program hangs on very long lists.
var lim = words.length;
var wordNames = Object.keys(this.allWords);
if (wordNames.length + words.length > this.maxAllowedWords) {
lim = this.maxAllowedWords - wordNames.length;
}
for (var i = 0; i < lim; i++) {
this.allWords[words[i]] = 1 + (this.allWords[words[i]] || 0);
}
}
}
beginSetTextsList(textsArg: string[]): Promise<void> {
// only save the file types we can read
this.texts = textsArg.filter(t => {
var ext = t.split('.').pop();
return this.getReadableFileExtensions().indexOf(ext) > -1;
});
return this.beginGetAllSampleFiles().then(() => {
this.addWordsToSynphony();
// The word list has been received. Now we are using setTimeout() to delay the remainder of the word
// list processing so the UI doesn't appear frozen as long.
setTimeout(() => {
this.wordListLoaded = true;
this.updateControlContents(); // needed if user deletes all of the stages.
this.doMarkup();
this.updateWordList();
this.processWordListChangedListeners();
//note, this endpoint is confusing because it appears that ultimately we only use the word list out of this file (see "sampleTextsList").
//This ends up being written to a ReaderToolsWords-xyz.json (matching its use, if not it contents).
axios.post('/bloom/api/readers/io/synphonyLanguageData', theOneLanguageDataInstance);
}, 200);
});
}
/**
* Called to process sample data files.
* When all of them are read and processed, the promise is resolved.
*/
beginGetAllSampleFiles(): Promise<void> {
// The <any> works around a flaw in the declaration of axios.all in axios.d.ts.
return (<any>axios).all(this.texts.map(fileName => {
return axios.get('/bloom/api/readers/io/sampleFileContents', { params: { fileName: fileName } })
.then(result => {
// this same code runs both for simple word list text files, and for synphony .json files
// downstream here, code actually changes the json string back into an object, sigh. But
// we're looking for a non-risky patch here as 3.7 is about to go out the door.
// We had two bugs related to getting this wrong: BL-3969, BL-3970
if (typeof result.data === "string" || <any>result.data instanceof String) {
this.setSampleFileContents(result.data); // simple wordlist file
} else {
this.setSampleFileContents(JSON.stringify(result.data)); //synphony json
}
});
}));
}
/**
* Called in response to a request for the contents of a sample text file
* @param fileContents
*/
setSampleFileContents(fileContents: string): void {
this.addWordsFromFile(fileContents);
}
/**
* Notify anyone who wants to know that the word list changed
*/
processWordListChangedListeners(): void {
var handlers = Object.keys(this.wordListChangedListeners);
for (var j = 0; j < handlers.length; j++)
this.wordListChangedListeners[handlers[j]]();
}
/**
* Take the list of words collected from the sample files, add it to SynPhony, and update the Stages.
*/
addWordsToSynphony() {
// add words to the word list
ReadersSynphonyWrapper.addWords(this.allWords);
theOneLibSynphony.processVocabularyGroups();
}
/**
* Gets words from SynPhony that match the input criteria
* @param justWordName Return just the word names, not DataWord objects
* @param desiredGPCs An array of strings
* @param knownGPCs An array of strings
* @param restrictToKnownGPCs
* @param [allowUpperCase]
* @param [syllableLengths] An array of integers, uses 1-24 if empty
* @param [selectedGroups] An array of strings, uses all groups if empty
* @param [partsOfSpeech] An array of strings, uses all parts of speech if empty
* @returns An array of strings or DataWord objects
*/
selectWordsFromSynphony(justWordName: boolean, desiredGPCs: string[], knownGPCs: string[],
restrictToKnownGPCs: boolean, allowUpperCase?: boolean, syllableLengths?: number[],
selectedGroups?: string[], partsOfSpeech?: string[]): any[] {
if (!selectedGroups) {
selectedGroups = [];
for (var i = 1; i <= theOneLanguageDataInstance.VocabularyGroups; i++)
selectedGroups.push('group' + i);
}
if (!syllableLengths) {
//using 24 as an arbitrary max number of syllables
syllableLengths = [];
for (var j = 1; j < 25; j++)
syllableLengths.push(j);
}
if (!partsOfSpeech)
partsOfSpeech = [];
if (justWordName)
return theOneLibSynphony.selectGPCWordNamesWithArrayCompare(desiredGPCs, knownGPCs, restrictToKnownGPCs, allowUpperCase, syllableLengths, selectedGroups, partsOfSpeech);
else
return theOneLibSynphony.selectGPCWordsFromCache(desiredGPCs, knownGPCs, restrictToKnownGPCs, allowUpperCase, syllableLengths, selectedGroups, partsOfSpeech);
}
selectWordsFromAllowedLists(stageNumber: number): string[] {
var stages: ReaderStage[] = this.synphony.getStages(stageNumber);
var words: string[] = [];
for (var i = 0; i < stages.length; i++) {
if (stages[i].allowedWords)
words = words.concat(stages[i].allowedWords);
}
// we are limiting the number of words to maxAllowedWords for performance reasons
if (words.length > this.maxAllowedWords) {
words = words.slice(0, this.maxAllowedWords);
}
return words;
}
getToolboxWindow(): Window {
// ReaderToolsModel is only loaded into the toolbox, so the toolbox window is simply the current window.
//return window;
return (<HTMLIFrameElement>document.getElementById('toolbox')).contentWindow;
}
/**
* Get the allowed words for the current stage and all previous stages as an array of DataWord objects
* @param stageNumber
* @returns An array of DataWord objects
*/
getAllowedWordsAsObjects(stageNumber: number): DataWord[] {
var words: string[] = this.selectWordsFromAllowedLists(stageNumber);
var returnVal: DataWord[] = [];
for (var i = 0; i < words.length; i++) {
returnVal.push(new DataWord(words[i]));
}
// inform the user if the list was truncated
//var toolbox: Document = this.getToolboxWindow().document;
var toolbox = $('#toolbox');
var msgDiv: JQuery = $(toolbox).find('#allowed-word-list-truncated');
// if the list was truncated, show the message
if (words.length < this.maxAllowedWords) {
msgDiv.html('');
}
else {
msgDiv.html(theOneLocalizationManager.simpleDotNetFormat($(toolbox).find('#allowed_word_list_truncated_text').html(), [this.maxAllowedWords.toLocaleString()]));
}
return returnVal;
}
saveState(): void {
// this is needed for unit testing
var toolbox = $('#toolbox');
if (typeof toolbox.accordion !== 'function') return;
// this is also needed for unit testing
var active = toolbox.accordion('option', 'active');
if (isNaN(active)) return;
ToolBox.fireCSharpToolboxEvent('saveToolboxSettingsEvent', "state\tdecodableReader\t" + "stage:" + this.stageNumber + ";sort:" + this.sort);
ToolBox.fireCSharpToolboxEvent('saveToolboxSettingsEvent', "state\tleveledReader\t" + this.levelNumber);
}
restoreState(): void {
// this is needed for unit testing
var toolbox = $('#toolbox');
if (typeof toolbox.accordion !== 'function') return;
var state = new DRTState();
if (!this.currentMarkupType) this.currentMarkupType = state.markupType;
// when restoring state we do NOT want to save the results; things are presumably unchanged,
// and saving the state of a new book from a template can override system defaults we have
// not yet applied to the book.
this.setStageNumber(state.stage, true);
this.setLevelNumber(state.level, true);
}
getAllowedWordsLists(): void {
var stages = this.synphony.getStages();
// remember how many we are loading so we know when we're finished
this.allowedWordFilesRemaining = stages.length;
stages.forEach((stage, index) => {
// BL-4184: Even if the decodable reader setup doesn't have a filename for each stage,
// we need to ensure that execution still passes through the "if all loaded" section of
// the setAllowedWordsListList() method.
if (stage.allowedWordsFile) {
axios.get('/bloom/api/readers/io/allowedWordsList', { params: { 'fileName': stage.allowedWordsFile } })
.then(result => this.setAllowedWordsListList(result.data, index));
} else {
this.setAllowedWordsListList(null, index);
}
// During Linux testing of BL-3498, the this (_this in the TS converted to JS), in the axios.get callback was
// undefined without this bind(). This .bind() is also the fix for BL-3496.
// But apparently when we switched to TS v2.0, it's no longer needed
}/*.bind(this)*/);
}
setAllowedWordsListList(fileContents: string, stageIndex: number): void {
// remove this one from the count of files remaining
this.allowedWordFilesRemaining--;
if (fileContents) {
this.synphony.getStages()[stageIndex].setAllowedWordsString(fileContents);
}
// if all loaded...
if (this.allowedWordFilesRemaining < 1) {
this.wordListLoaded = true;
this.updateControlContents();
this.doMarkup();
}
}
}
// In case this code is loaded into more than one iframe, we want them to share a single instance.
// So, we will put it in the top window, and let the first instance which executes this block create it.
if (!(<any>top).theOneReaderToolsModel) {
(<any>top).theOneReaderToolsModel = new ReaderToolsModel();
}
export function getTheOneReaderToolsModel() { return (<any>top).theOneReaderToolsModel; }
| andrew-polk/BloomDesktop | src/BloomBrowserUI/bookEdit/toolbox/readers/readerToolsModel.ts | TypeScript | mit | 48,221 |
select
sum(l.extendedprice * l.discount) as revenue
from
lineitem l
where
l.shipdate >= date('1996-01-01')
and l.shipdate < date('1996-01-01', '+1 year')
and l.discount between 0.04 and 0.07
and l.quantity < 25; | HPI-SWA-Lab/SQPyte | tpch/sqlite-queries-in/6.sql | SQL | mit | 225 |
import ActivatableControllerMixin from 'client/mixins/activatable-controller';
import SortableControllerMixin from 'client/mixins/sortable-controller';
import ListControlsControllerMixin from 'client/mixins/list-controls-controller';
var ItemsController = Em.ArrayController.extend(ActivatableControllerMixin, SortableControllerMixin, ListControlsControllerMixin, {
needs: ['application', 'item/index', 'item/edit'],
// the route sets GroupId
GroupId: null,
// various sort orders
sortedTitleAsc: Ember.computed.equal('userSorted', 'title-asc'),
sortedPriorityAsc: Ember.computed.equal('userSorted', 'priority-asc'),
sortedRatingAsc: Ember.computed.equal('userSorted', 'rating-asc'),
sortedCompleteAsc: Ember.computed.equal('userSorted', 'complete-asc'),
actions: {
sortByTitle: function () {
var direction = this.get('userSorted') === 'title-asc' ? false : true;
this.set('sortProperties', ['title']);
this.set('sortAscending', direction);
},
sortByPriority: function () {
var direction = this.get('userSorted') === 'priority-asc' ? false : true;
this.set('sortProperties', ['priority']);
this.set('sortAscending', direction);
},
sortByRating: function () {
var direction = this.get('userSorted') === 'rating-asc' ? false : true;
this.set('sortProperties', ['rating']);
this.set('sortAscending', direction);
},
sortByComplete: function () {
var direction = this.get('userSorted') === 'complete-asc' ? false : true;
this.set('sortProperties', ['complete']);
this.set('sortAscending', direction);
},
patchChecked: function (model) {
this.api.patch('items', model, 'complete').catch(function () {
alert('Sorry, something went wrong saving your checkmark! Please try again later.');
});
},
delete: function (item) {
var self = this;
if(!confirm('Are you sure you want to delete ' + Ember.get(item, 'title') + '?')) {
return;
}
this.api.deleteModel('items', item).then(function () {
var id = Ember.get(item, 'id'),
routeName = self.get('controllers.application').get('currentRouteName');
// if we were viewing or editing that item, we need to transition away
if (routeName.indexOf('item.index') !== -1 && self.get('controllers.item/index').get('model.id') === id) {
self.transitionToRoute('items');
} else if (routeName.indexOf('item.edit') !== -1 && self.get('controllers.item/edit').get('model.id') === id) {
self.transitionToRoute('items');
}
self.store.deleteModels('items', item);
self.get('model').removeObject(item);
}).catch(function () {
alert('Sorry, something went wrong deleting your item! Please try again later.');
});
}
}
});
export default ItemsController;
| darvelo/wishlist | app/scripts/app/controllers/items.js | JavaScript | mit | 2,879 |
var NODE_ENV = require("node-env")
var path = require("path")
var argv = require("optimist").argv
var RequireFresh = require("require-fresh")
var repo = require("../repo")
var loadTemplate = RequireFresh({
dir: path.join(__dirname, "..", "templates"),
watch: NODE_ENV !== "production"
})
var PORT = argv.port || argv.p || 5842
module.exports = {
repo: repo,
loadTemplate: loadTemplate,
port: PORT
}
| Raynos/process-dashboard | config/production.js | JavaScript | mit | 422 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# olopy documentation build configuration file, created by
# sphinx-quickstart on Sun Sep 25 20:42:38 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))
# -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinx.ext.viewcode',
'sphinx.ext.githubpages',
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
# The encoding of source files.
#
# source_encoding = 'utf-8-sig'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = 'olopy'
copyright = '2016, Marcello Del Buono'
author = 'Marcello Del Buono'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '0.0.13'
# The full version, including alpha/beta/rc tags.
release = '0.0.13'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#
# today = ''
#
# Else, today_fmt is used as the format for a strftime call.
#
# today_fmt = '%B %d, %Y'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
# The reST default role (used for this markup: `text`) to use for all
# documents.
#
# default_role = None
# If true, '()' will be appended to :func: etc. cross-reference text.
#
# add_function_parentheses = True
# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
#
# add_module_names = True
# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
#
# show_authors = False
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# A list of ignored prefixes for module index sorting.
# modindex_common_prefix = []
# If true, keep warnings as "system message" paragraphs in the built documents.
# keep_warnings = False
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False
# -- Options for HTML output ----------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'classic'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}
# Add any paths that contain custom themes here, relative to this directory.
# html_theme_path = []
# The name for this set of Sphinx documents.
# "<project> v<release> documentation" by default.
#
# html_title = 'olopy v0.0.13'
# A shorter title for the navigation bar. Default is the same as html_title.
#
# html_short_title = None
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
#
# html_logo = None
# The name of an image file (relative to this directory) to use as a favicon of
# the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
#
# html_favicon = None
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
# directly to the root of the documentation.
#
# html_extra_path = []
# If not None, a 'Last updated on:' timestamp is inserted at every page
# bottom, using the given strftime format.
# The empty string is equivalent to '%b %d, %Y'.
#
# html_last_updated_fmt = None
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#
# html_use_smartypants = True
# Custom sidebar templates, maps document names to template names.
#
# html_sidebars = {}
# Additional templates that should be rendered to pages, maps page names to
# template names.
#
# html_additional_pages = {}
# If false, no module index is generated.
#
# html_domain_indices = True
# If false, no index is generated.
#
# html_use_index = True
# If true, the index is split into individual pages for each letter.
#
# html_split_index = False
# If true, links to the reST sources are added to the pages.
#
# html_show_sourcelink = True
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
#
# html_show_sphinx = True
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
#
# html_show_copyright = True
# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
#
# html_use_opensearch = ''
# This is the file name suffix for HTML files (e.g. ".xhtml").
# html_file_suffix = None
# Language to be used for generating the HTML full-text search index.
# Sphinx supports the following languages:
# 'da', 'de', 'en', 'es', 'fi', 'fr', 'h', 'it', 'ja'
# 'nl', 'no', 'pt', 'ro', 'r', 'sv', 'tr', 'zh'
#
# html_search_language = 'en'
# A dictionary with options for the search language support, empty by default.
# 'ja' uses this config value.
# 'zh' user can custom change `jieba` dictionary path.
#
# html_search_options = {'type': 'default'}
# The name of a javascript file (relative to the configuration directory) that
# implements a search results scorer. If empty, the default will be used.
#
# html_search_scorer = 'scorer.js'
# Output file base name for HTML help builder.
htmlhelp_basename = 'olopydoc'
# -- Options for LaTeX output ---------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',
# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'olopy.tex', 'olopy Documentation',
'Marcello Del Buono', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
# the title page.
#
# latex_logo = None
# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
#
# latex_use_parts = False
# If true, show page references after internal links.
#
# latex_show_pagerefs = False
# If true, show URL addresses after external links.
#
# latex_show_urls = False
# Documents to append as an appendix to all manuals.
#
# latex_appendices = []
# It false, will not define \strong, \code, itleref, \crossref ... but only
# \sphinxstrong, ..., \sphinxtitleref, ... To help avoid clash with user added
# packages.
#
# latex_keep_old_macro_names = True
# If false, no module index is generated.
#
# latex_domain_indices = True
# -- Options for manual page output ---------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'olopy', 'olopy Documentation',
[author], 1)
]
# If true, show URL addresses after external links.
#
# man_show_urls = False
# -- Options for Texinfo output -------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'olopy', 'olopy Documentation',
author, 'olopy', 'One line description of project.',
'Miscellaneous'),
]
# Documents to append as an appendix to all manuals.
#
# texinfo_appendices = []
# If false, no module index is generated.
#
# texinfo_domain_indices = True
# How to display URL addresses: 'footnote', 'no', or 'inline'.
#
# texinfo_show_urls = 'footnote'
# If true, do not generate a @detailmenu in the "Top" node's menu.
#
# texinfo_no_detailmenu = False
# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/': None}
# Change the sys.path to make the olopy package visible
import os
import sys
sys.path.insert(0, os.path.abspath('..')) | onlabsorg/olopy | doc/conf.py | Python | mit | 10,152 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>
<BODY>
<A name=1></a><hr>
<A name=2></a><hr>
<A name=3></a><hr>
<A name=4></a><hr>
<A name=5></a><hr>
<A name=6></a><hr>
<A name=7></a><hr>
<A name=8></a><hr>
<A name=9></a><hr>
<A name=10></a><hr>
<A name=11></a><hr>
<A name=12></a><hr>
<A name=13></a><hr>
<A name=14></a><hr>
<A name=15></a><hr>
<A name=16></a><hr>
<A name=17></a><hr>
<A name=18></a>June 16, 2014<br>
Tex Hall, Chairman<br>
Three Affiliated Tribes<br>
404 Frontage Road<br>
New Town, ND 58763<br>
RE:<br>
WELL PERMITTED ON FORT BERTHOLD RESERVATION<br>
FORT BERTHOLD 148-94-28B-33-11H<br>
NENW Section 28-148N-94W<br>
Dunn County<br>
NDIC File No. 28628<br>
Chairman Hall:<br>
Please be advised that HRC OPERATING, LLC was issued the above captioned permit on June 16, 2014 and will<br>
remain in effect for a period of one year. In addition, it was permitted with a 1280 acre spacing unit in Sections 28 &<br>
33-T148N-R94W via Commission Order 24180.<br>
Should you have any questions, feel free to contact me.<br>
Sincerely,<br>
Todd L. Holweger<br>
Mineral Resources Permit Manager<br>
cc: </span><span class="ft5">Tax Commissioner<br>
Field Inspector<br>
<hr>
<A name=19></a>June 16, 2014<br>
Mark H. Johnson<br>
Permit Agent<br>
HRC OPERATING, LLC<br>
1801 CALIFORNIA STREET SUITE 3500<br>
DENVER, CO 80202<br>
RE:<br>
HORIZONTAL WELL<br>
FORT BERTHOLD 148-94-28B-33-11H<br>
NENW Section 28-148N-94W<br>
Dunn County<br>
Well File # 28628<br>
Dear Mark:<br>
Pursuant to Commission Order No. 24180, approval to drill the above captioned well is hereby given. The approval<br>
is granted on the condition that all portions of the well bore not isolated by cement, be no closer than the </span><span class="ft3">200' setback<br>
from the north & south boundaries and </span><span class="ft3">500' setback </span><span class="ft1">from the east & west boundaries within the 1280 acre spacing unit<br>
consisting of Sections 28 & 33-T148N-R94W.<br>
PERMIT STIPULATIONS: Effective June 1, 2014, a covered leak-proof container (with placard) for filter<br>
sock disposal must be maintained on the well site beginning when the well is spud, and must remain on-site<br>
during clean-out, completion, and flow-back whenever filtration operations are conducted.<br>
HRC<br>
OPERATING, LLC must take into consideration NDAC 43-02-03-28 (Safety Regulation) when<br>
contemplating simultaneous operations on the above captioned location. Pursuant to NDAC 43-02-03-28<br>
(Safety Regulation) "No boiler, portable electric lighting generator, or treater shall be placed nearer than 150<br>
feet to any producing well or oil tank." Placement as close as one hundred twenty-five feet [38.10 meters] may<br>
be allowed if a spark or flame arrestor is utilized on the equipment. HRC OPERATING, LLC must contact<br>
NDIC Field Inspector Allen Christensen at 701-989-9183 prior to location construction.<br>
Drilling pit<br>
NDAC 43-02-03-19.4 states that "a pit may be utilized to bury drill cuttings and solids generated during well drilling<br>
and completion operations, providing the pit can be constructed, used and reclaimed in a manner that will prevent<br>
pollution of the land surface and freshwaters. Reserve and circulation of mud system through earthen pits are<br>
prohibited. All pits shall be inspected by an authorized representative of the director prior to lining and use. Drill<br>
cuttings and solids must be stabilized in a manner approved by the director prior to placement in a cuttings pit."<br>
Form 1 Changes & Hard Lines<br>
Any changes, shortening of casing point or lengthening at Total Depth must have prior approval by the NDIC. The<br>
proposed directional plan is at a legal location. Based on the azimuth of the proposed lateral the maximum legal<br>
coordinate from the well head is: 10127 S.<br>
Location Construction Commencement (Three Day Waiting Period)<br>
Operators shall not commence operations on a drill site until the 3rd business day following publication of the<br>
approved drilling permit on the NDIC - OGD Daily Activity Report. If circumstances require operations to<br>
commence before the 3rd business day following publication on the Daily Activity Report, the waiting period may be<br>
waived by the Director. Application for a waiver must be by sworn affidavit providing the information necessary to<br>
evaluate the extenuating circumstances, the factors of NDAC 43-02-03-16.2 (1), (a)-(f), and any other information that<br>
would allow the Director to conclude that in the event another owner seeks revocation of the drilling permit, the<br>
applicant should retain the permit.<br>
<hr>
<A name=20></a>Mark H. Johnson<br>
June 16, 2014<br>
Page 2<br>
Permit Fee & Notification<br>
Payment was received in the amount of $100 via credit card .The permit fee has been received. It is requested that<br>
notification be given immediately upon the spudding of the well. This information should be relayed to the Oil & Gas<br>
Division, Bismarck, via telephone. The following information must be included: Well name, legal location, permit<br>
number, drilling contractor, company representative, date and time of spudding. Office hours are 8:00 a.m. to 12:00<br>
p.m. and 1:00 p.m. to 5:00 p.m. Central Time. Our telephone number is (701) 328-8020, leave a message if after hours<br>
or on the weekend.<br>
Survey Requirements for Horizontal, Horizontal Re-entry, and Directional Wells<br>
NDAC Section 43-02-03-25 (Deviation Tests and Directional Surveys) states in part (that) the survey contractor shall<br>
file a certified copy of all surveys with the director free of charge within thirty days of completion. Surveys must be<br>
submitted as one electronic copy, or in a form approved by the director. However, the director may require the<br>
directional survey to be filed immediately after completion if the survey is needed to conduct the operation of the<br>
director's office in a timely manner. Certified surveys must be submitted via email in one adobe document, with a<br>
certification cover page to </span><span class="ft2">[email protected]</span><span class="ft0">.<br>
Survey points shall be of such frequency to accurately determine the entire location of the well bore.<br>
Specifically, the Horizontal and Directional well survey frequency is 100 feet in the vertical, 30 feet in the curve (or<br>
when sliding) and 90 feet in the lateral.<br>
Surface casing cement<br>
Tail cement utilized on surface casing must have a minimum compressive strength of 500 psi within 12 hours,<br>
and tail cement utilized on production casing must have a minimum compressive strength of 500 psi before drilling the<br>
plug or initiating tests.<br>
Logs<br>
NDAC Section 43-02-03-31 requires the running of (1) a suite of open hole logs from which formation tops and<br>
porosity zones can be determined, (2) a Gamma Ray Log run from total depth to ground level elevation of the well<br>
bore, and (3) a log from which the presence and quality of cement can be determined (Standard CBL or Ultrasonic<br>
cement evaluation log) in every well in which production or intermediate casing has been set, this log must be run prior<br>
to completing the well. All logs run must be submitted free of charge, as one digital TIFF (tagged image file format)<br>
copy and one digital LAS (log ASCII) formatted copy. Digital logs may be submitted on a standard CD, DVD, or<br>
attached to an email sent to </span><span class="ft2">[email protected]<br>
Thank you for your cooperation.<br>
Sincerely,<br>
David Burns<br>
Engineering Technician<br>
<hr>
<A name=21></a>INDUSTRIAL COMMISSION OF NORTH DAKOTA<br>
OIL AND GAS DIVISION<br>
600 EAST BOULEVARD DEPT 405<br>
BISMARCK, ND 58505-0840<br>
SFN 54269 (08-2005)<br>
PLEASE READ INSTRUCTIONS BEFORE FILLING OUT FORM.<br>
PLEASE SUBMIT THE ORIGINAL AND ONE COPY.<br>
Type of Work<br>
Type of Well<br>
Approximate Date Work Will Start<br>
Confidential Status<br>
New Location<br>
Oil & Gas<br>
7 / 1 / 2014<br>
No<br>
Operator<br>
Telephone Number<br>
HRC OPERATING, LLC<br>
303.297.2028<br>
Address<br>
City<br>
State<br>
Zip Code<br>
1801 CALIFORNIA STREET SUITE 3500<br>
DENVER<br>
CO<br>
80202<br>
Notice has been provided to the owner of any<br>
This well is not located within five hundred<br>
permanently occupied dwelling within 1,320 feet.<br>
feet of an occupied dwelling.<br>
enter data for additional laterals on page 2)<br>
Well Name<br>
Well Number<br>
FORT BERTHOLD<br>
148-94-28B-33-11H<br>
Surface Footages<br>
Qtr-Qtr<br>
Section<br>
Township<br>
Range<br>
County<br>
224 </span><span class="ft0">FL<br>
N<br>
2519 </span><span class="ft0">F </span><span class="ft6">W </span><span class="ft0">L<br>
NENW<br>
28<br>
148<br>
94<br>
Dunn<br>
Longstring Casing Point Footages<br>
Qtr-Qtr<br>
Section<br>
Township<br>
Range<br>
County<br>
545 </span><span class="ft0">F </span><span class="ft6">N </span><span class="ft0">L<br>
2024 </span><span class="ft0">F </span><span class="ft6">E<br>
L<br>
NWNE<br>
28<br>
148<br>
94<br>
Dunn<br>
Longstring Casing Point Coordinates From Well Head<br>
Azimuth<br>
Longstring Total Depth<br>
321 S </span><span class="ft0">From WH<br>
734 E </span><span class="ft0">From WH<br>
142.7<br>
11304 </span><span class="ft0">Feet MD<br>
10960 </span><span class="ft0">Feet TVD<br>
Bottom Hole Footages From Nearest Section Line<br>
Qtr-Qtr<br>
Section<br>
Township<br>
Range<br>
County<br>
249 </span><span class="ft0">F </span><span class="ft6">S<br>
LF<br>
1635<br>
E<br>
L<br>
SWSE<br>
33<br>
148<br>
94<br>
Dunn<br>
Bottom Hole Coordinates From Well Head<br>
KOP Lateral 1<br>
Azimuth Lateral 1<br>
Estimated Total Depth Lateral 1<br>
10078 S </span><span class="ft0">From WH<br>
1124 E </span><span class="ft0">From WH<br>
10398 </span><span class="ft0">Feet MD<br>
180<br>
21147 </span><span class="ft0">Feet MD<br>
10856 </span><span class="ft0">Feet TVD<br>
Latitude of Well Head<br>
Longitude of Well Head<br>
NAD Reference<br>
Description of<br>
(Subject to NDIC Approval)<br>
47<br>
36<br>
59.96<br>
-102<br>
39<br>
47.93<br>
NAD83<br>
Spacing Unit:<br>
Sections 28 & 33-T148N-R94W<br>
Ground Elevation<br>
Acres in Spacing/Drilling Unit<br>
Spacing/Drilling Unit Setback Requirement<br>
Industrial Commission Order<br>
2337 </span><span class="ft0">Feet Above S.L.<br>
1280<br>
200 </span><span class="ft8">Feet N/S<br>
500<br>
Feet<br>
Feet E/W<br>
24180<br>
North Line of Spacing/Drilling Unit<br>
South Line of Spacing/Drilling Unit<br>
East Line of Spacing/Drilling Unit<br>
West Line of Spacing/Drilling Unit<br>
5277 </span><span class="ft0">Feet<br>
5278 </span><span class="ft0">Feet<br>
10548 </span><span class="ft0">Feet<br>
10557 </span><span class="ft0">Feet<br>
Objective Horizons<br>
Pierre Shale Top<br>
Three Forks B1<br>
2063<br>
Proposed<br>
Size<br>
Weight<br>
Depth<br>
Cement Volume<br>
Surface Casing<br>
9<br>
5/8<br>
36 </span><span class="ft0">Lb./Ft. </span><span class="ft6">2200<br>
Feet<br>
772<br>
Sacks<br>
Proposed<br>
Size<br>
Weight(s)<br>
Longstring Total Depth<br>
Cement Volume<br>
Cement Top<br>
Top Dakota Sand<br>
Longstring Casing<br>
70<br>
32<br>
Lb./Ft.<br>
11304 </span><span class="ft0">Feet MD<br>
10960 </span><span class="ft0">Feet TVD<br>
840<br>
Sacks<br>
3949 </span><span class="ft0">Feet<br>
4949<br>
Feet<br>
Base of Last<br>
Last<br>
Salt (If<br>
Charles </span><span class="ft0">Applicable)<br>
Salt (If Applicable)<br>
9223 </span><span class="ft0">Feet<br>
Proposed Logs<br>
Triple Combo {w/GR to surf}, GR-MWD thru curve/lateral, CBL {see comments}<br>
Drilling Mud Type (Vertical Hole - Below Surface Casing)<br>
Drilling Mud Type (Lateral)<br>
Invert<br>
Brine<br>
Survey Type in Vertical Portion of Well<br>
Survey Frequency: Build Section<br>
Survey Frequency: Lateral<br>
Survey Contractor<br>
MWD </span><span class="ft0">Every 100 Feet<br>
30 </span><span class="ft0">Feet<br>
90 </span><span class="ft0">Feet<br>
Pathfinder<br>
proposed mud/cementing plan,<br>
directional plot/plan, $100 fee.<br>
<hr>
<A name=22></a>Page 2<br>
SFN 54269 (08-2005)<br>
Form 4 Log Waiver is being requested.<br>
Cutings will be hauled to Indian Hills or Prairie Disposal.<br>
Lateral 2<br>
KOP Lateral 2<br>
Azimuth Lateral 2<br>
Estimated Total Depth Lateral 2<br>
KOP Coordinates From Well Head<br>
Feet MD<br>
Feet MD<br>
Feet TVD<br>
From WH<br>
From WH<br>
Formation Entry Point Coordinates From Well Head<br>
Bottom Hole Coordinates From Well Head<br>
From WH<br>
From WH<br>
From WH<br>
From WH<br>
KOP Footages From Nearest Section Line<br>
Qtr-Qtr<br>
Section<br>
Township<br>
Range<br>
County<br>
FL<br>
FL<br>
Bottom Hole Footages From Nearest Section Line<br>
Qtr-Qtr<br>
Section<br>
Township<br>
Range<br>
County<br>
FL<br>
F<br>
L<br>
Lateral 3<br>
KOP Lateral 3<br>
Azimuth Lateral 3<br>
Estimated Total Depth Lateral 3<br>
KOP Coordinates From Well Head<br>
Feet MD<br>
Feet MD<br>
Feet TVD<br>
From WH<br>
From WH<br>
Formation Entry Point Coordinates From Well Head<br>
Bottom Hole Coordinates From Well Head<br>
From WH<br>
From WH<br>
From WH<br>
From WH<br>
KOP Footages From Nearest Section Line<br>
Qtr-Qtr<br>
Section<br>
Township<br>
Range<br>
County<br>
F<br>
L<br>
FL<br>
Bottom Hole Footages From Nearest Section Line<br>
Qtr-Qtr<br>
Section<br>
Township<br>
Range<br>
County<br>
F<br>
L<br>
FL<br>
Lateral 4<br>
KOP Lateral 4<br>
Azimuth Lateral 4<br>
Estimated Total Depth Lateral 4<br>
KOP Coordinates From Well Head<br>
Feet MD<br>
Feet MD<br>
Feet TVD<br>
From WH<br>
From WH<br>
Formation Entry Point Coordinates From Well Head<br>
Bottom Hole Coordinates From Well Head<br>
From WH<br>
From WH<br>
From WH<br>
From WH<br>
KOP Footages From Nearest Section Line<br>
Qtr-Qtr<br>
Section<br>
Township<br>
Range<br>
County<br>
FL<br>
FL<br>
Bottom Hole Footages From Nearest Section Line<br>
Qtr-Qtr<br>
Section<br>
Township<br>
Range<br>
County<br>
FL<br>
FL<br>
Lateral 5<br>
KOP Lateral 5<br>
Azimuth Lateral 5<br>
Estimated Total Depth Lateral 5<br>
KOP Coordinates From Well Head<br>
Feet MD<br>
Feet MD<br>
Feet TVD<br>
From WH<br>
From WH<br>
Formation Entry Point Coordinates From Well Head<br>
Bottom Hole Coordinates From Well Head<br>
From WH<br>
From WH<br>
From WH<br>
From WH<br>
KOP Footages From Nearest Section Line<br>
Qtr-Qtr<br>
Section<br>
Township<br>
Range<br>
County<br>
FL<br>
FL<br>
Bottom Hole Footages From Nearest Section Line<br>
Qtr-Qtr<br>
Section<br>
Township<br>
Range<br>
County<br>
FL<br>
FL<br>
Date<br>
I hereby swear or affirm the information provided is true, complete and correct as determined from all available records.<br>
3 / 10 / 2014<br>
Signature<br>
Printed Name<br>
Title<br>
ePermit<br>
Mark H. Johnson<br>
Permit Agent<br>
Email Address(es)<br>
Permit and File Number<br>
API Number<br>
Date Approved<br>
28628<br>
025<br>
02583<br>
6 / 16 / 2014<br>
Field<br>
By<br>
MCGREGORY BUTTES<br>
David Burns<br>
Pool<br>
Permit Type<br>
Title<br>
BAKKEN<br>
DEVELOPMENT<br>
Engineering Technician<br>
<hr>
<A name=23></a>April 9, 2014<br>
RE:<br>
Filter Socks and Other Filter Media<br>
Leakproof Container Required<br>
Oil and Gas Wells<br>
Dear Operator,<br>
North Dakota Administrative Code Section 43-02-03-19.2 states in part that all waste material associated with<br>
exploration or production of oil and gas must be properly disposed of in an authorized facility in accord with all<br>
applicable local, state, and federal laws and regulations.<br>
Filtration systems are commonly used during oil and gas operations in North Dakota. The Commission is very<br>
concerned about the proper disposal of used filters (including filter socks) used by the oil and gas industry.<br>
Effective June 1, 2014, a container must be maintained on each well drilled in North Dakota beginning when the<br>
well is spud and must remain on-site during clean-out, completion, and flow-back whenever filtration operations<br>
are conducted. The on-site container must be used to store filters until they can be properly disposed of in an<br>
authorized facility. Such containers must be:<br>
leakproof to prevent any fluids from escaping the container<br>
covered to prevent precipitation from entering the container<br>
placard to indicate only filters are to be placed in the container<br>
If the operator will not utilize a filtration system, a waiver to the container requirement will be considered, but<br>
only upon the operator submitting a Sundry Notice (Form 4) justifying their request.<br>
As previously stated in our March 13, 2014 letter, North Dakota Administrative Code Section 33-20-02.1-01<br>
states in part that every person who transports solid waste (which includes oil and gas exploration and production<br>
wastes) is required to have a valid permit issued by the North Dakota Department of Health, Division of Waste<br>
Management. Please contact the Division of Waste Management at (701) 328-5166 with any questions on the<br>
solid waste program. Note oil and gas exploration and production wastes include produced water, drilling mud,<br>
invert mud, tank bottom sediment, pipe scale, filters, and fly ash.<br>
Thank you for your cooperation.<br>
Sincerely,<br>
Bruce E. Hicks<br>
Assistant Director<br>
<hr>
<A name=24></a>R</span><span class="ft1">O</span><span class="ft2">Y </span><span class="ft1">JE</span><span class="ft2">NS</span><span class="ft1">E<br>
T<br>
N<br>
REGISTERED<br>
LAND<br>
SURVEYOR<br>
N<br>
LS. - 4654<br>
O<br>
A<br>
R<br>
T<br>
T </span><span class="ft1">H D</span><span class="ft2">A </span><span class="ft1">KO<br>
<hr>
<A name=25></a>NDIC PROPOSED DRILLING PLAN<br>
Fort Berthold 148-94-28B-33-11H<br>
1.<br>
ESTIMATED TOPS OF GEOLOGIC MARKERS (2,363 KB)<br>
FORMATION<br>
ESTIMATED<br>
ESTIMATED<br>
TOP TVD<br>
DEPTH Sub Sea<br>
Pierre<br>
2063<br>
300<br>
Mowry/Top Dakota<br>
4949<br>
-2586<br>
Rierdon<br>
6183<br>
-3820<br>
Tyler<br>
8002<br>
-5639<br>
Kibbey Lime<br>
8497<br>
-6134<br>
Charles<br>
8656<br>
-6293<br>
Base Last Salt<br>
9223<br>
-6860<br>
Lodgepole<br>
9992<br>
-7629<br>
Bakken<br>
10849<br>
-8486<br>
Middle Bakken<br>
10868<br>
-8505<br>
Lower Bakken<br>
10913<br>
-8550<br>
Three Forks<br>
10935<br>
-8572<br>
Three Forks Target<br>
10952<br>
-8589<br>
2.<br>
PROPOSED CASING PROGRAM<br>
Casing Program: All New<br>
Hole Size<br>
Casing Size<br>
Wt./Ft.<br>
Grade<br>
Joint<br>
Depth Set (md)<br>
13½"<br>
9-5/8"<br>
36#<br>
J-55<br>
LT&C<br>
0 2,200'<br>
8¾"<br>
7"<br>
32#<br>
P-110<br>
BT&C<br>
0 11,304'<br>
6"<br>
4½"<br>
13.5#<br>
P-110<br>
BT&C<br>
10,298' 21,147'<br>
3.<br>
PROPOSED CEMENTING PROGRAM<br>
Surface Casing<br>
CASING<br>
SLURRY<br>
FT. of<br>
SX<br>
XC<br>
CEMENT TYPE<br>
WEIGHT<br>
YIELD<br>
FILL<br>
S<br>
(%)<br>
(ppg)<br>
(ft</span><span class="ft4">3</span><span class="ft3">/sx)<br>
9-5/8"<br>
Lead<br>
1,700'<br>
487<br>
70<br>
Premium Lite + 3% CaCl</span><span class="ft4">2 </span><span class="ft5">+ 0.01 gps<br>
11.5<br>
2.90<br>
FP-6L + 12% gel + 1% Sodium<br>
Metasilicate + ¼ pps Cello Flake<br>
9-5/8"<br>
Tail<br>
500'<br>
285<br>
70<br>
Type III cement + 2% CaCl</span><span class="ft4">2 </span><span class="ft5">+ 0.01<br>
14.2<br>
1.52<br>
gps FP-6L + ¼ pps Cello Flake<br>
A cement top job is required if cement fallback is greater than 10' below ground level.<br>
<hr>
<A name=26></a>Intermediate Casing<br>
CASING<br>
SLURRY<br>
FT. of<br>
SX<br>
XC<br>
CEMENT TYPE<br>
WEIGHT<br>
YIELD<br>
FILL<br>
S<br>
(%)<br>
(ppg)<br>
(ft3/sx)<br>
7"<br>
Lead<br>
2,742'<br>
244<br>
30<br>
Premium Lite + 3% KCl + 0.6% R-3<br>
11.8<br>
2.20<br>
+ 0.4% FL-25 + 8% gel + 0.5%<br>
Sodium Metasilicate + ¼ pps Cello<br>
Flake<br>
7"<br>
Tail<br>
4,612'<br>
596<br>
30<br>
Class G + 0.3% R-3 + 3% KCl +<br>
15.8<br>
1.54<br>
0.3% FL-25 + 0.5% Sodium<br>
Metasilicate + ¼ pps Cello Flake +<br>
35% Silica Flour.<br>
Cement volumes for the 7" Production Casing will be calculated to provide a top of cement to<br>
3,949'. Actual cement volumes may vary due to variations in the actual hole size and may be<br>
determined by caliper log, if available.<br>
All waiting on cement (WOC) times will be adequate to achieve a minimum of 500 psi<br>
compressive strength at the casing shoe prior to drilling out.<br>
Production Liner<br>
The liner will be uncemented.<br>
4. MUD PROGRAM<br>
Depth<br>
MW<br>
Mud Type<br>
FV<br>
FL<br>
0' 2,200'<br>
±8.5<br>
Fresh Water<br>
Hi Vis Sweeps<br>
NC<br>
2,200' - 11,304'<br>
9.5 10.8<br>
70/30 Invert<br>
36-48<br>
20-25 cc<br>
11,304' - 21,147' (TD)<br>
9.6 10.5<br>
Brine Water<br>
25-30<br>
NC<br>
5. DISPOSAL OF DRILL CUTTINGS<br>
Cuttings will be taken to one of the following approved disposal sites:<br>
Prairie Disposal, Inc.<br>
102 C10 52</span><span class="ft3">nd </span><span class="ft1">St. NW<br>
Tioga, ND 58852<br>
720.273.8999<br>
IHD Solids Management, LLC<br>
5009 139</span><span class="ft3">th </span><span class="ft1">Ave NW<br>
Williston, ND 58801<br>
701.774.8514<br>
6. STIMULATION<br>
HRC Operating, LLC will not use any of the below listed diesel based compounds in the<br>
Hydraulic Stimulation of this well. Any compounds/fluids with the following Chemical Abstract<br>
Service Registry Numbers will not be used:<br>
<hr>
<A name=27></a>68334-30-5 (Primary Name: Fuels, diesel)<br>
68476-34-6 (Primary Name: Fuels, diesel, No. 2)<br>
68476-30-2 (Primary Name: Fuel oil No. 2)<br>
68476-31-3 (Primary Name: Fuel oil, No. 4)<br>
8008-20-6 (Primary Name: Kerosene)<br>
<hr>
<A name=28></a>David, <br>
Here are the answers, please let me know if you need in another form. <br>
Liner top to be set 100' above KOP. <br>
Frac string is utilized. <br>
Frac technique plug and perf usually 30 stage <br>
Cuttings will be taken to one of the following approved disposal sites: <br>
Prairie Disposal, Inc. <br>
102 C10 52nd St. NW <br>
Tioga, ND 58852 <br>
720.273.8999 <br>
IHD Solids Management, LLC <br>
5009 139th Ave NW <br>
Williston, ND 58801 <br>
701.774.8514 <br>
Mark Johnson <br>
<hr>
<A name=29></a>Company: HRC Operating, LLC<br>
Field: Dunn Co., ND<br>
Location: Sec.28-T148N-R94W<br>
Well: Fort Berthold 148-94-28B-33-11H<br>
Borehole: Original Hole<br>
Plan: Rev 0<br>
SECTION DETAILS<br>
Vertical Point<br>
SHL: 224' FNL & 2519' FWL<br>
Sec<br>
MD<br>
Inc<br>
Azi<br>
TVD<br>
+N/-S<br>
+E/-W<br>
Dleg<br>
TFace<br>
VSect<br>
Annotation<br>
Begin Drop<br>
(Sec.28-T148N-R94W)<br>
KOP, Build 10°/100' DLS<br>
1<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
PBHL: 250' FSL & 1650' FEL<br>
2<br>
2200.00<br>
0.00<br>
0.00<br>
2200.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
Begin Nudge<br>
(Sec.33-T148N-R94W)<br>
Hold Tangent<br>
3<br>
2400.00<br>
3.00<br>
70.00<br>
2399.91<br>
1.79<br>
4.92<br>
1.50<br>
70.00<br>
-1.23<br>
Hold Tangent<br>
FB 148-94-33D-28-4H<br>
4 10000.00<br>
3.00<br>
70.00<br>
9989.49<br>
137.83<br>
378.68<br>
0.00<br>
0.00<br>
-95.02<br>
Begin Drop<br>
Notice:<br>
Begin Nudge<br>
5 10200.00<br>
0.00<br>
0.00 10189.40<br>
139.62<br>
383.60<br>
1.50 180.00<br>
-96.26<br>
Vertical Point<br>
Section Lines and Hardlines<br>
6 10397.67<br>
0.00<br>
0.00 10387.07<br>
139.62<br>
383.60<br>
0.00<br>
0.00<br>
-96.26<br>
KOP, Build 10°/100' DLS<br>
are estimates only and are<br>
FB 148-94-33D-28-5H<br>
7 11303.67<br>
90.60 142.75 10960.00<br>
-321.23<br>
734.04 10.00 142.75<br>
400.59<br>
LP, Begin Turn<br>
0<br>
subject to customer approval<br>
200' From N-S<br>
8 12545.27<br>
90.60 180.00 10946.52<br>
-1477.13 1123.61<br>
3.00<br>
89.80<br>
1592.53<br>
EOT, Hold to TD<br>
9<br>
21146.75<br>
90.60 180.00 10856.45<br>
-10078.14 1123.58<br>
0.00<br>
0.00<br>
10140.58<br>
PBHL/TD<br>
7" Csg<br>
WELL DETAILS: Fort Berthold 148-94-28B-33-11H<br>
LP, Begin Turn<br>
Ground Level:<br>
2337.00<br>
+N/-S<br>
+E/-W<br>
Northing<br>
Easting<br>
Latittude<br>
Longitude<br>
0.00<br>
0.00<br>
718519.90<br>
1434988.62<br>
47° 36' 59.962 N<br>
102° 39' 47.930 W<br>
s<br>
EOT, Hold to TD<br>
)<br>
ein<br>
-W<br>
L<br>
E<br>
WELLBORE TARGET DETAILS<br>
-2500<br>
n<br>
m<br>
ft/in<br>
tio<br>
ro<br>
Name<br>
TVD<br>
+N/-S<br>
+E/-W<br>
Shape<br>
s<br>
ce<br>
'F<br>
PBHL Fort Berthold 148-94-28B-33-11H<br>
10856.45<br>
-10078.14<br>
1123.58<br>
Point<br>
u<br>
S<br>
00<br>
0<br>
5<br>
0<br>
CASING DETAILS<br>
FORMATION TOP DETAILS<br>
5(2<br>
TVD<br>
MD<br>
Name<br>
Size<br>
TVDPath<br>
MDPath<br>
Formation<br>
)<br>
Section 28<br>
10960.00<br>
11303.67<br>
7" Csg<br>
7<br>
2063.00<br>
2063.00<br>
Pierre<br>
4949.00<br>
4952.59<br>
Mowry/Top Dakota Gp<br>
(+<br>
6183.00<br>
6188.28<br>
Rierdon<br>
-5000<br>
T<br>
6891.00<br>
6897.25<br>
Top Pine Salt<br>
rth<br>
M<br>
Azimuths to True North<br>
6977.00<br>
6983.37<br>
Base Pine Salt<br>
o<br>
Magnetic North: 7.65°<br>
7129.00<br>
7135.58<br>
Top Opeche Salt<br>
Section 33<br>
7209.00<br>
7215.69<br>
Base Opeche Salt<br>
7465.00<br>
7472.04<br>
Amsden<br>
(-)/N<br>
Magnetic Field<br>
8002.00<br>
8009.78<br>
Tyler<br>
Strength: 56361.9snT<br>
th<br>
8497.00<br>
8505.46<br>
Kibbey Lime<br>
Dip Angle: 72.80°<br>
u<br>
8656.00<br>
8664.68<br>
Charles (Top Madison)<br>
Date: 01/21/2014<br>
9223.00<br>
9232.46<br>
Base Last Salt<br>
So<br>
Model: IGRF2010<br>
9408.00<br>
9417.71<br>
Mission Canyon<br>
9992.00<br>
10002.51<br>
Lodgepole<br>
10848.52<br>
10934.13<br>
Bakken<br>
-7500<br>
10867.29<br>
10967.11<br>
Middle Bakken<br>
10912.59<br>
11062.87<br>
Lower Bakken Shale<br>
10935.08<br>
11127.96<br>
Three Forks<br>
10951.51<br>
11198.72<br>
Top Target Top<br>
8400<br>
)<br>
9000<br>
ft/in<br>
-10000<br>
su<br>
FB 148-94-28A-33-2H<br>
0<br>
PBHL/TD<br>
0<br>
FB 148-94-28B-33-12H<br>
2<br>
Begin Drop<br>
FB 148-94-28A-33-1H<br>
9600<br>
(1<br>
th<br>
Vertical Point<br>
-2500<br>
0<br>
2500<br>
5000<br>
7500<br>
pe<br>
West(-)/East(+) (2500 usft/in)<br>
D </span><span class="ft0">10200<br>
KOP, Build 10°/100' DLS<br>
la<br>
rtic<br>
PBHL/TD<br>
e<br>
LP, Begin Turn<br>
EOT, Hold to TD<br>
V </span><span class="ft0">10800<br>
eruT<br>
7" Csg<br>
-600<br>
0<br>
600<br>
1200<br>
1800<br>
2400<br>
3000<br>
3600<br>
4200<br>
4800<br>
5400<br>
6000<br>
6600<br>
7200<br>
7800<br>
8400<br>
9000<br>
9600<br>
10200<br>
10800<br>
Vertical Section at 173.64° (1200 usft/in)<br>
<hr>
<A name=30></a>HRC Operating, LLC<br>
Dunn Co., ND<br>
Sec.28-T148N-R94W<br>
Fort Berthold 148-94-28B-33-11H<br>
Original Hole<br>
Plan: Rev 0<br>
Standard Planning Report<br>
22 January, 2014<br>
<hr>
<A name=31></a>Schlumberger<br>
Planning Report<br>
Database:<br>
EDM 5000.1 Single User Db<br>
Local Co-ordinate Reference:<br>
Well Fort Berthold 148-94-28B-33-11H<br>
Company:<br>
HRC Operating, LLC<br>
TVD Reference:<br>
KB @ 2363.00usft (Stoneham 16)<br>
Project:<br>
Dunn Co., ND<br>
MD Reference:<br>
KB @ 2363.00usft (Stoneham 16)<br>
Site:<br>
Sec.28-T148N-R94W<br>
North Reference:<br>
True<br>
Well:<br>
Fort Berthold 148-94-28B-33-11H<br>
Survey Calculation Method:<br>
Minimum Curvature<br>
Wellbore:<br>
Original Hole<br>
Design:<br>
Rev 0<br>
Project<br>
Dunn Co., ND<br>
Map System:<br>
US State Plane 1983<br>
System Datum:<br>
Mean Sea Level<br>
Geo Datum:<br>
North American Datum 1983<br>
Map Zone:<br>
North Dakota Southern Zone<br>
Site<br>
Sec.28-T148N-R94W<br>
Site Position:<br>
Northing:<br>
718,519.90 usft<br>
Latitude:<br>
47° 36' 59.962 N<br>
From:<br>
Lat/Long<br>
Easting:<br>
1,434,988.63 usft<br>
Longitude:<br>
102° 39' 47.930 W<br>
Position Uncertainty:<br>
0.00 usft<br>
Slot Radius:<br>
13-3/16 "<br>
Grid Convergence:<br>
-1.58 °<br>
Well<br>
Fort Berthold 148-94-28B-33-11H<br>
Well Position<br>
+N/-S<br>
0.00 usft<br>
Northing:<br>
718,519.90 usft<br>
Latitude:<br>
47° 36' 59.962 N<br>
+E/-W<br>
0.00 usft<br>
Easting:<br>
1,434,988.63 usft<br>
Longitude:<br>
102° 39' 47.930 W<br>
Position Uncertainty<br>
0.00 usft<br>
Wellhead Elevation:<br>
2,363.00 usft<br>
Ground Level:<br>
2,337.00 usft<br>
Wellbore<br>
Original Hole<br>
Magnetics<br>
Model Name<br>
Sample Date<br>
Declination<br>
Dip Angle<br>
Field Strength<br>
(°)<br>
(°)<br>
(nT)<br>
IGRF2010<br>
01/21/14<br>
7.65<br>
72.80<br>
56,362<br>
Design<br>
Rev 0<br>
Audit Notes:<br>
Version:<br>
Phase:<br>
PROTOTYPE<br>
Tie On Depth:<br>
0.00<br>
Vertical Section:<br>
Depth From (TVD)<br>
+N/-S<br>
+E/-W<br>
Direction<br>
(usft)<br>
(usft)<br>
(usft)<br>
(°)<br>
0.00<br>
0.00<br>
0.00<br>
173.64<br>
Plan Sections<br>
Measured<br>
Vertical<br>
Dogleg<br>
Build<br>
Turn<br>
Depth<br>
Inclination<br>
Azimuth<br>
Depth<br>
+N/-S<br>
+E/-W<br>
Rate<br>
Rate<br>
Rate<br>
TFO<br>
(usft)<br>
(°)<br>
(°)<br>
(usft)<br>
(usft)<br>
(usft)<br>
(°/100usft)<br>
(°/100usft)<br>
(°/100usft)<br>
(°)<br>
Target<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
2,200.00<br>
0.00<br>
0.00<br>
2,200.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
2,400.00<br>
3.00<br>
70.00<br>
2,399.91<br>
1.79<br>
4.92<br>
1.50<br>
1.50<br>
0.00<br>
70.00<br>
10,000.00<br>
3.00<br>
70.00<br>
9,989.49<br>
137.83<br>
378.68<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
10,200.00<br>
0.00<br>
0.00<br>
10,189.40<br>
139.62<br>
383.60<br>
1.50<br>
-1.50<br>
0.00<br>
180.00<br>
10,397.67<br>
0.00<br>
0.00<br>
10,387.07<br>
139.62<br>
383.60<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
11,303.67<br>
90.60<br>
142.75<br>
10,960.00<br>
-321.23<br>
734.04<br>
10.00<br>
10.00<br>
0.00<br>
142.75<br>
12,545.27<br>
90.60<br>
180.00<br>
10,946.52<br>
-1,477.13<br>
1,123.61<br>
3.00<br>
0.00<br>
3.00<br>
89.80<br>
21,146.75<br>
90.60<br>
180.00<br>
10,856.45<br>
-10,078.14<br>
1,123.58<br>
0.00<br>
0.00<br>
0.00<br>
0.00 PBHL Fort Berthold 148-94-28B-33-11H<br>
01/22/14 8:58:30AM<br>
Page 2<br>
COMPASS 5000.1 Build 70<br>
<hr>
<A name=32></a>Schlumberger<br>
Planning Report<br>
Database:<br>
EDM 5000.1 Single User Db<br>
Local Co-ordinate Reference:<br>
Well Fort Berthold 148-94-28B-33-11H<br>
Company:<br>
HRC Operating, LLC<br>
TVD Reference:<br>
KB @ 2363.00usft (Stoneham 16)<br>
Project:<br>
Dunn Co., ND<br>
MD Reference:<br>
KB @ 2363.00usft (Stoneham 16)<br>
Site:<br>
Sec.28-T148N-R94W<br>
North Reference:<br>
True<br>
Well:<br>
Fort Berthold 148-94-28B-33-11H<br>
Survey Calculation Method:<br>
Minimum Curvature<br>
Wellbore:<br>
Original Hole<br>
Design:<br>
Rev 0<br>
Planned Survey<br>
Measured<br>
Vertical<br>
Vertical<br>
Dogleg<br>
Build<br>
Turn<br>
Depth<br>
Inclination<br>
Azimuth<br>
Depth<br>
+N/-S<br>
+E/-W<br>
Section<br>
Rate<br>
Rate<br>
Rate<br>
(usft)<br>
(°)<br>
(°)<br>
(usft)<br>
(usft)<br>
(usft)<br>
(usft)<br>
(°/100usft)<br>
(°/100usft)<br>
(°/100usft)<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
100.00<br>
0.00<br>
0.00<br>
100.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
200.00<br>
0.00<br>
0.00<br>
200.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
300.00<br>
0.00<br>
0.00<br>
300.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
400.00<br>
0.00<br>
0.00<br>
400.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
500.00<br>
0.00<br>
0.00<br>
500.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
600.00<br>
0.00<br>
0.00<br>
600.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
700.00<br>
0.00<br>
0.00<br>
700.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
800.00<br>
0.00<br>
0.00<br>
800.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
900.00<br>
0.00<br>
0.00<br>
900.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
1,000.00<br>
0.00<br>
0.00<br>
1,000.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
1,100.00<br>
0.00<br>
0.00<br>
1,100.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
1,200.00<br>
0.00<br>
0.00<br>
1,200.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
1,300.00<br>
0.00<br>
0.00<br>
1,300.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
1,400.00<br>
0.00<br>
0.00<br>
1,400.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
1,500.00<br>
0.00<br>
0.00<br>
1,500.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
1,600.00<br>
0.00<br>
0.00<br>
1,600.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
1,700.00<br>
0.00<br>
0.00<br>
1,700.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
1,800.00<br>
0.00<br>
0.00<br>
1,800.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
1,900.00<br>
0.00<br>
0.00<br>
1,900.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
2,000.00<br>
0.00<br>
0.00<br>
2,000.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
2,063.00<br>
0.00<br>
0.00<br>
2,063.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
Pierre<br>
2,100.00<br>
0.00<br>
0.00<br>
2,100.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
2,200.00<br>
0.00<br>
0.00<br>
2,200.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
0.00<br>
Begin Nudge<br>
2,300.00<br>
1.50<br>
70.00<br>
2,299.99<br>
0.45<br>
1.23<br>
-0.31<br>
1.50<br>
1.50<br>
0.00<br>
2,400.00<br>
3.00<br>
70.00<br>
2,399.91<br>
1.79<br>
4.92<br>
-1.23<br>
1.50<br>
1.50<br>
0.00<br>
Hold Tangent<br>
2,500.00<br>
3.00<br>
70.00<br>
2,499.77<br>
3.58<br>
9.84<br>
-2.47<br>
0.00<br>
0.00<br>
0.00<br>
2,600.00<br>
3.00<br>
70.00<br>
2,599.63<br>
5.37<br>
14.76<br>
-3.70<br>
0.00<br>
0.00<br>
0.00<br>
2,700.00<br>
3.00<br>
70.00<br>
2,699.50<br>
7.16<br>
19.67<br>
-4.94<br>
0.00<br>
0.00<br>
0.00<br>
2,800.00<br>
3.00<br>
70.00<br>
2,799.36<br>
8.95<br>
24.59<br>
-6.17<br>
0.00<br>
0.00<br>
0.00<br>
2,900.00<br>
3.00<br>
70.00<br>
2,899.22<br>
10.74<br>
29.51<br>
-7.40<br>
0.00<br>
0.00<br>
0.00<br>
3,000.00<br>
3.00<br>
70.00<br>
2,999.09<br>
12.53<br>
34.43<br>
-8.64<br>
0.00<br>
0.00<br>
0.00<br>
3,100.00<br>
3.00<br>
70.00<br>
3,098.95<br>
14.32<br>
39.34<br>
-9.87<br>
0.00<br>
0.00<br>
0.00<br>
3,200.00<br>
3.00<br>
70.00<br>
3,198.81<br>
16.11<br>
44.26<br>
-11.11<br>
0.00<br>
0.00<br>
0.00<br>
3,300.00<br>
3.00<br>
70.00<br>
3,298.68<br>
17.90<br>
49.18<br>
-12.34<br>
0.00<br>
0.00<br>
0.00<br>
3,400.00<br>
3.00<br>
70.00<br>
3,398.54<br>
19.69<br>
54.10<br>
-13.57<br>
0.00<br>
0.00<br>
0.00<br>
3,500.00<br>
3.00<br>
70.00<br>
3,498.40<br>
21.48<br>
59.02<br>
-14.81<br>
0.00<br>
0.00<br>
0.00<br>
3,600.00<br>
3.00<br>
70.00<br>
3,598.26<br>
23.27<br>
63.93<br>
-16.04<br>
0.00<br>
0.00<br>
0.00<br>
3,700.00<br>
3.00<br>
70.00<br>
3,698.13<br>
25.06<br>
68.85<br>
-17.28<br>
0.00<br>
0.00<br>
0.00<br>
3,800.00<br>
3.00<br>
70.00<br>
3,797.99<br>
26.85<br>
73.77<br>
-18.51<br>
0.00<br>
0.00<br>
0.00<br>
3,900.00<br>
3.00<br>
70.00<br>
3,897.85<br>
28.64<br>
78.69<br>
-19.75<br>
0.00<br>
0.00<br>
0.00<br>
4,000.00<br>
3.00<br>
70.00<br>
3,997.72<br>
30.43<br>
83.61<br>
-20.98<br>
0.00<br>
0.00<br>
0.00<br>
4,100.00<br>
3.00<br>
70.00<br>
4,097.58<br>
32.22<br>
88.52<br>
-22.21<br>
0.00<br>
0.00<br>
0.00<br>
4,200.00<br>
3.00<br>
70.00<br>
4,197.44<br>
34.01<br>
93.44<br>
-23.45<br>
0.00<br>
0.00<br>
0.00<br>
4,300.00<br>
3.00<br>
70.00<br>
4,297.30<br>
35.80<br>
98.36<br>
-24.68<br>
0.00<br>
0.00<br>
0.00<br>
4,400.00<br>
3.00<br>
70.00<br>
4,397.17<br>
37.59<br>
103.28<br>
-25.92<br>
0.00<br>
0.00<br>
0.00<br>
4,500.00<br>
3.00<br>
70.00<br>
4,497.03<br>
39.38<br>
108.20<br>
-27.15<br>
0.00<br>
0.00<br>
0.00<br>
4,600.00<br>
3.00<br>
70.00<br>
4,596.89<br>
41.17<br>
113.11<br>
-28.38<br>
0.00<br>
0.00<br>
0.00<br>
4,700.00<br>
3.00<br>
70.00<br>
4,696.76<br>
42.96<br>
118.03<br>
-29.62<br>
0.00<br>
0.00<br>
0.00<br>
4,800.00<br>
3.00<br>
70.00<br>
4,796.62<br>
44.75<br>
122.95<br>
-30.85<br>
0.00<br>
0.00<br>
0.00<br>
01/22/14 8:58:30AM<br>
Page 3<br>
COMPASS 5000.1 Build 70<br>
<hr>
<A name=33></a>Schlumberger<br>
Planning Report<br>
Database:<br>
EDM 5000.1 Single User Db<br>
Local Co-ordinate Reference:<br>
Well Fort Berthold 148-94-28B-33-11H<br>
Company:<br>
HRC Operating, LLC<br>
TVD Reference:<br>
KB @ 2363.00usft (Stoneham 16)<br>
Project:<br>
Dunn Co., ND<br>
MD Reference:<br>
KB @ 2363.00usft (Stoneham 16)<br>
Site:<br>
Sec.28-T148N-R94W<br>
North Reference:<br>
True<br>
Well:<br>
Fort Berthold 148-94-28B-33-11H<br>
Survey Calculation Method:<br>
Minimum Curvature<br>
Wellbore:<br>
Original Hole<br>
Design:<br>
Rev 0<br>
Planned Survey<br>
Measured<br>
Vertical<br>
Vertical<br>
Dogleg<br>
Build<br>
Turn<br>
Depth<br>
Inclination<br>
Azimuth<br>
Depth<br>
+N/-S<br>
+E/-W<br>
Section<br>
Rate<br>
Rate<br>
Rate<br>
(usft)<br>
(°)<br>
(°)<br>
(usft)<br>
(usft)<br>
(usft)<br>
(usft)<br>
(°/100usft)<br>
(°/100usft)<br>
(°/100usft)<br>
4,900.00<br>
3.00<br>
70.00<br>
4,896.48<br>
46.54<br>
127.87<br>
-32.09<br>
0.00<br>
0.00<br>
0.00<br>
4,952.59<br>
3.00<br>
70.00<br>
4,949.00<br>
47.48<br>
130.45<br>
-32.73<br>
0.00<br>
0.00<br>
0.00<br>
Mowry/Top Dakota Gp<br>
5,000.00<br>
3.00<br>
70.00<br>
4,996.35<br>
48.33<br>
132.79<br>
-33.32<br>
0.00<br>
0.00<br>
0.00<br>
5,100.00<br>
3.00<br>
70.00<br>
5,096.21<br>
50.12<br>
137.70<br>
-34.55<br>
0.00<br>
0.00<br>
0.00<br>
5,200.00<br>
3.00<br>
70.00<br>
5,196.07<br>
51.91<br>
142.62<br>
-35.79<br>
0.00<br>
0.00<br>
0.00<br>
5,300.00<br>
3.00<br>
70.00<br>
5,295.93<br>
53.70<br>
147.54<br>
-37.02<br>
0.00<br>
0.00<br>
0.00<br>
5,400.00<br>
3.00<br>
70.00<br>
5,395.80<br>
55.49<br>
152.46<br>
-38.26<br>
0.00<br>
0.00<br>
0.00<br>
5,500.00<br>
3.00<br>
70.00<br>
5,495.66<br>
57.28<br>
157.38<br>
-39.49<br>
0.00<br>
0.00<br>
0.00<br>
5,600.00<br>
3.00<br>
70.00<br>
5,595.52<br>
59.07<br>
162.29<br>
-40.72<br>
0.00<br>
0.00<br>
0.00<br>
5,700.00<br>
3.00<br>
70.00<br>
5,695.39<br>
60.86<br>
167.21<br>
-41.96<br>
0.00<br>
0.00<br>
0.00<br>
5,800.00<br>
3.00<br>
70.00<br>
5,795.25<br>
62.65<br>
172.13<br>
-43.19<br>
0.00<br>
0.00<br>
0.00<br>
5,900.00<br>
3.00<br>
70.00<br>
5,895.11<br>
64.44<br>
177.05<br>
-44.43<br>
0.00<br>
0.00<br>
0.00<br>
6,000.00<br>
3.00<br>
70.00<br>
5,994.98<br>
66.23<br>
181.97<br>
-45.66<br>
0.00<br>
0.00<br>
0.00<br>
6,100.00<br>
3.00<br>
70.00<br>
6,094.84<br>
68.02<br>
186.88<br>
-46.89<br>
0.00<br>
0.00<br>
0.00<br>
6,188.28<br>
3.00<br>
70.00<br>
6,183.00<br>
69.60<br>
191.23<br>
-47.98<br>
0.00<br>
0.00<br>
0.00<br>
Rierdon<br>
6,200.00<br>
3.00<br>
70.00<br>
6,194.70<br>
69.81<br>
191.80<br>
-48.13<br>
0.00<br>
0.00<br>
0.00<br>
6,300.00<br>
3.00<br>
70.00<br>
6,294.56<br>
71.60<br>
196.72<br>
-49.36<br>
0.00<br>
0.00<br>
0.00<br>
6,400.00<br>
3.00<br>
70.00<br>
6,394.43<br>
73.39<br>
201.64<br>
-50.60<br>
0.00<br>
0.00<br>
0.00<br>
6,500.00<br>
3.00<br>
70.00<br>
6,494.29<br>
75.18<br>
206.56<br>
-51.83<br>
0.00<br>
0.00<br>
0.00<br>
6,600.00<br>
3.00<br>
70.00<br>
6,594.15<br>
76.97<br>
211.47<br>
-53.06<br>
0.00<br>
0.00<br>
0.00<br>
6,700.00<br>
3.00<br>
70.00<br>
6,694.02<br>
78.76<br>
216.39<br>
-54.30<br>
0.00<br>
0.00<br>
0.00<br>
6,800.00<br>
3.00<br>
70.00<br>
6,793.88<br>
80.55<br>
221.31<br>
-55.53<br>
0.00<br>
0.00<br>
0.00<br>
6,897.25<br>
3.00<br>
70.00<br>
6,891.00<br>
82.29<br>
226.09<br>
-56.73<br>
0.00<br>
0.00<br>
0.00<br>
Top Pine Salt<br>
6,900.00<br>
3.00<br>
70.00<br>
6,893.74<br>
82.34<br>
226.23<br>
-56.77<br>
0.00<br>
0.00<br>
0.00<br>
6,983.37<br>
3.00<br>
70.00<br>
6,977.00<br>
83.83<br>
230.33<br>
-57.80<br>
0.00<br>
0.00<br>
0.00<br>
Base Pine Salt<br>
7,000.00<br>
3.00<br>
70.00<br>
6,993.60<br>
84.13<br>
231.15<br>
-58.00<br>
0.00<br>
0.00<br>
0.00<br>
7,100.00<br>
3.00<br>
70.00<br>
7,093.47<br>
85.92<br>
236.06<br>
-59.24<br>
0.00<br>
0.00<br>
0.00<br>
7,135.58<br>
3.00<br>
70.00<br>
7,129.00<br>
86.56<br>
237.81<br>
-59.67<br>
0.00<br>
0.00<br>
0.00<br>
Top Opeche Salt<br>
7,200.00<br>
3.00<br>
70.00<br>
7,193.33<br>
87.71<br>
240.98<br>
-60.47<br>
0.00<br>
0.00<br>
0.00<br>
7,215.69<br>
3.00<br>
70.00<br>
7,209.00<br>
87.99<br>
241.75<br>
-60.66<br>
0.00<br>
0.00<br>
0.00<br>
Base Opeche Salt<br>
7,300.00<br>
3.00<br>
70.00<br>
7,293.19<br>
89.50<br>
245.90<br>
-61.70<br>
0.00<br>
0.00<br>
0.00<br>
7,400.00<br>
3.00<br>
70.00<br>
7,393.06<br>
91.29<br>
250.82<br>
-62.94<br>
0.00<br>
0.00<br>
0.00<br>
7,472.04<br>
3.00<br>
70.00<br>
7,465.00<br>
92.58<br>
254.36<br>
-63.83<br>
0.00<br>
0.00<br>
0.00<br>
Amsden<br>
7,500.00<br>
3.00<br>
70.00<br>
7,492.92<br>
93.08<br>
255.74<br>
-64.17<br>
0.00<br>
0.00<br>
0.00<br>
7,600.00<br>
3.00<br>
70.00<br>
7,592.78<br>
94.87<br>
260.65<br>
-65.41<br>
0.00<br>
0.00<br>
0.00<br>
7,700.00<br>
3.00<br>
70.00<br>
7,692.65<br>
96.66<br>
265.57<br>
-66.64<br>
0.00<br>
0.00<br>
0.00<br>
7,800.00<br>
3.00<br>
70.00<br>
7,792.51<br>
98.45<br>
270.49<br>
-67.87<br>
0.00<br>
0.00<br>
0.00<br>
7,900.00<br>
3.00<br>
70.00<br>
7,892.37<br>
100.24<br>
275.41<br>
-69.11<br>
0.00<br>
0.00<br>
0.00<br>
8,000.00<br>
3.00<br>
70.00<br>
7,992.23<br>
102.03<br>
280.33<br>
-70.34<br>
0.00<br>
0.00<br>
0.00<br>
8,009.78<br>
3.00<br>
70.00<br>
8,002.00<br>
102.21<br>
280.81<br>
-70.46<br>
0.00<br>
0.00<br>
0.00<br>
Tyler<br>
8,100.00<br>
3.00<br>
70.00<br>
8,092.10<br>
103.82<br>
285.24<br>
-71.58<br>
0.00<br>
0.00<br>
0.00<br>
8,200.00<br>
3.00<br>
70.00<br>
8,191.96<br>
105.61<br>
290.16<br>
-72.81<br>
0.00<br>
0.00<br>
0.00<br>
8,300.00<br>
3.00<br>
70.00<br>
8,291.82<br>
107.40<br>
295.08<br>
-74.04<br>
0.00<br>
0.00<br>
0.00<br>
8,400.00<br>
3.00<br>
70.00<br>
8,391.69<br>
109.19<br>
300.00<br>
-75.28<br>
0.00<br>
0.00<br>
0.00<br>
8,500.00<br>
3.00<br>
70.00<br>
8,491.55<br>
110.98<br>
304.92<br>
-76.51<br>
0.00<br>
0.00<br>
0.00<br>
01/22/14 8:58:30AM<br>
Page 4<br>
COMPASS 5000.1 Build 70<br>
<hr>
<A name=34></a>Schlumberger<br>
Planning Report<br>
Database:<br>
EDM 5000.1 Single User Db<br>
Local Co-ordinate Reference:<br>
Well Fort Berthold 148-94-28B-33-11H<br>
Company:<br>
HRC Operating, LLC<br>
TVD Reference:<br>
KB @ 2363.00usft (Stoneham 16)<br>
Project:<br>
Dunn Co., ND<br>
MD Reference:<br>
KB @ 2363.00usft (Stoneham 16)<br>
Site:<br>
Sec.28-T148N-R94W<br>
North Reference:<br>
True<br>
Well:<br>
Fort Berthold 148-94-28B-33-11H<br>
Survey Calculation Method:<br>
Minimum Curvature<br>
Wellbore:<br>
Original Hole<br>
Design:<br>
Rev 0<br>
Planned Survey<br>
Measured<br>
Vertical<br>
Vertical<br>
Dogleg<br>
Build<br>
Turn<br>
Depth<br>
Inclination<br>
Azimuth<br>
Depth<br>
+N/-S<br>
+E/-W<br>
Section<br>
Rate<br>
Rate<br>
Rate<br>
(usft)<br>
(°)<br>
(°)<br>
(usft)<br>
(usft)<br>
(usft)<br>
(usft)<br>
(°/100usft)<br>
(°/100usft)<br>
(°/100usft)<br>
8,505.46<br>
3.00<br>
70.00<br>
8,497.00<br>
111.08<br>
305.18<br>
-76.58<br>
0.00<br>
0.00<br>
0.00<br>
Kibbey Lime<br>
8,600.00<br>
3.00<br>
70.00<br>
8,591.41<br>
112.77<br>
309.83<br>
-77.75<br>
0.00<br>
0.00<br>
0.00<br>
8,664.68<br>
3.00<br>
70.00<br>
8,656.00<br>
113.93<br>
313.01<br>
-78.54<br>
0.00<br>
0.00<br>
0.00<br>
Charles (Top Madison)<br>
8,700.00<br>
3.00<br>
70.00<br>
8,691.27<br>
114.56<br>
314.75<br>
-78.98<br>
0.00<br>
0.00<br>
0.00<br>
8,800.00<br>
3.00<br>
70.00<br>
8,791.14<br>
116.35<br>
319.67<br>
-80.21<br>
0.00<br>
0.00<br>
0.00<br>
8,900.00<br>
3.00<br>
70.00<br>
8,891.00<br>
118.14<br>
324.59<br>
-81.45<br>
0.00<br>
0.00<br>
0.00<br>
9,000.00<br>
3.00<br>
70.00<br>
8,990.86<br>
119.93<br>
329.51<br>
-82.68<br>
0.00<br>
0.00<br>
0.00<br>
9,100.00<br>
3.00<br>
70.00<br>
9,090.73<br>
121.72<br>
334.42<br>
-83.92<br>
0.00<br>
0.00<br>
0.00<br>
9,200.00<br>
3.00<br>
70.00<br>
9,190.59<br>
123.51<br>
339.34<br>
-85.15<br>
0.00<br>
0.00<br>
0.00<br>
9,232.46<br>
3.00<br>
70.00<br>
9,223.00<br>
124.09<br>
340.94<br>
-85.55<br>
0.00<br>
0.00<br>
0.00<br>
Base Last Salt<br>
9,300.00<br>
3.00<br>
70.00<br>
9,290.45<br>
125.30<br>
344.26<br>
-86.38<br>
0.00<br>
0.00<br>
0.00<br>
9,400.00<br>
3.00<br>
70.00<br>
9,390.32<br>
127.09<br>
349.18<br>
-87.62<br>
0.00<br>
0.00<br>
0.00<br>
9,417.71<br>
3.00<br>
70.00<br>
9,408.00<br>
127.41<br>
350.05<br>
-87.84<br>
0.00<br>
0.00<br>
0.00<br>
Mission Canyon<br>
9,500.00<br>
3.00<br>
70.00<br>
9,490.18<br>
128.88<br>
354.10<br>
-88.85<br>
0.00<br>
0.00<br>
0.00<br>
9,600.00<br>
3.00<br>
70.00<br>
9,590.04<br>
130.67<br>
359.01<br>
-90.09<br>
0.00<br>
0.00<br>
0.00<br>
9,700.00<br>
3.00<br>
70.00<br>
9,689.90<br>
132.46<br>
363.93<br>
-91.32<br>
0.00<br>
0.00<br>
0.00<br>
9,800.00<br>
3.00<br>
70.00<br>
9,789.77<br>
134.25<br>
368.85<br>
-92.55<br>
0.00<br>
0.00<br>
0.00<br>
9,900.00<br>
3.00<br>
70.00<br>
9,889.63<br>
136.04<br>
373.77<br>
-93.79<br>
0.00<br>
0.00<br>
0.00<br>
10,000.00<br>
3.00<br>
70.00<br>
9,989.49<br>
137.83<br>
378.68<br>
-95.02<br>
0.00<br>
0.00<br>
0.00<br>
Begin Drop<br>
10,002.51<br>
2.96<br>
70.00<br>
9,992.00<br>
137.87<br>
378.81<br>
-95.05<br>
1.50<br>
-1.50<br>
0.00<br>
Lodgepole<br>
10,100.00<br>
1.50<br>
70.00<br>
10,089.41<br>
139.17<br>
382.37<br>
-95.95<br>
1.50<br>
-1.50<br>
0.00<br>
10,200.00<br>
0.00<br>
0.00<br>
10,189.40<br>
139.62<br>
383.60<br>
-96.26<br>
1.50<br>
-1.50<br>
0.00<br>
Vertical Point<br>
10,300.00<br>
0.00<br>
0.00<br>
10,289.40<br>
139.62<br>
383.60<br>
-96.26<br>
0.00<br>
0.00<br>
0.00<br>
10,397.67<br>
0.00<br>
0.00<br>
10,387.07<br>
139.62<br>
383.60<br>
-96.26<br>
0.00<br>
0.00<br>
0.00<br>
KOP, Build 10°/100' DLS<br>
10,400.00<br>
0.23<br>
142.75<br>
10,389.40<br>
139.62<br>
383.61<br>
-96.25<br>
10.00<br>
10.00<br>
0.00<br>
10,500.00<br>
10.23<br>
142.75<br>
10,488.86<br>
132.37<br>
389.12<br>
-88.44<br>
10.00<br>
10.00<br>
0.00<br>
10,600.00<br>
20.23<br>
142.75<br>
10,585.22<br>
111.48<br>
405.00<br>
-65.92<br>
10.00<br>
10.00<br>
0.00<br>
10,700.00<br>
30.23<br>
142.75<br>
10,675.57<br>
77.59<br>
430.78<br>
-29.38<br>
10.00<br>
10.00<br>
0.00<br>
10,800.00<br>
40.23<br>
142.75<br>
10,757.14<br>
31.72<br>
465.65<br>
20.07<br>
10.00<br>
10.00<br>
0.00<br>
10,900.00<br>
50.23<br>
142.75<br>
10,827.48<br>
-24.72<br>
508.57<br>
80.92<br>
10.00<br>
10.00<br>
0.00<br>
10,934.13<br>
53.65<br>
142.75<br>
10,848.52<br>
-46.11<br>
524.84<br>
103.98<br>
10.00<br>
10.00<br>
0.00<br>
Bakken<br>
10,967.11<br>
56.94<br>
142.75<br>
10,867.29<br>
-67.69<br>
541.24<br>
127.24<br>
10.00<br>
10.00<br>
0.00<br>
Middle Bakken<br>
11,000.00<br>
60.23<br>
142.75<br>
10,884.43<br>
-90.03<br>
558.23<br>
151.32<br>
10.00<br>
10.00<br>
0.00<br>
11,062.87<br>
66.52<br>
142.75<br>
10,912.59<br>
-134.74<br>
592.23<br>
199.53<br>
10.00<br>
10.00<br>
0.00<br>
Lower Bakken Shale<br>
11,100.00<br>
70.23<br>
142.75<br>
10,926.27<br>
-162.21<br>
613.12<br>
229.15<br>
10.00<br>
10.00<br>
0.00<br>
11,127.96<br>
73.03<br>
142.75<br>
10,935.08<br>
-183.34<br>
629.19<br>
251.92<br>
10.00<br>
10.00<br>
0.00<br>
Three Forks<br>
11,198.72<br>
80.11<br>
142.75<br>
10,951.51<br>
-238.08<br>
670.82<br>
310.94<br>
10.00<br>
10.00<br>
0.00<br>
Top Target Top<br>
11,200.00<br>
80.23<br>
142.75<br>
10,951.73<br>
-239.09<br>
671.58<br>
312.02<br>
10.00<br>
10.00<br>
0.00<br>
11,300.00<br>
90.23<br>
142.75<br>
10,960.03<br>
-318.31<br>
731.82<br>
397.44<br>
10.00<br>
10.00<br>
0.00<br>
11,303.67<br>
90.60<br>
142.75<br>
10,960.00<br>
-321.23<br>
734.04<br>
400.59<br>
10.00<br>
10.00<br>
0.00<br>
01/22/14 8:58:30AM<br>
Page 5<br>
COMPASS 5000.1 Build 70<br>
<hr>
<A name=35></a>Schlumberger<br>
Planning Report<br>
Database:<br>
EDM 5000.1 Single User Db<br>
Local Co-ordinate Reference:<br>
Well Fort Berthold 148-94-28B-33-11H<br>
Company:<br>
HRC Operating, LLC<br>
TVD Reference:<br>
KB @ 2363.00usft (Stoneham 16)<br>
Project:<br>
Dunn Co., ND<br>
MD Reference:<br>
KB @ 2363.00usft (Stoneham 16)<br>
Site:<br>
Sec.28-T148N-R94W<br>
North Reference:<br>
True<br>
Well:<br>
Fort Berthold 148-94-28B-33-11H<br>
Survey Calculation Method:<br>
Minimum Curvature<br>
Wellbore:<br>
Original Hole<br>
Design:<br>
Rev 0<br>
Planned Survey<br>
Measured<br>
Vertical<br>
Vertical<br>
Dogleg<br>
Build<br>
Turn<br>
Depth<br>
Inclination<br>
Azimuth<br>
Depth<br>
+N/-S<br>
+E/-W<br>
Section<br>
Rate<br>
Rate<br>
Rate<br>
(usft)<br>
(°)<br>
(°)<br>
(usft)<br>
(usft)<br>
(usft)<br>
(usft)<br>
(°/100usft)<br>
(°/100usft)<br>
(°/100usft)<br>
LP, Begin Turn - 7" Csg<br>
11,400.00<br>
90.61<br>
145.64<br>
10,958.98<br>
-399.34<br>
790.39<br>
484.46<br>
3.00<br>
0.01<br>
3.00<br>
11,500.00<br>
90.62<br>
148.64<br>
10,957.91<br>
-483.33<br>
844.64<br>
573.94<br>
3.00<br>
0.01<br>
3.00<br>
11,600.00<br>
90.62<br>
151.64<br>
10,956.83<br>
-570.04<br>
894.42<br>
665.63<br>
3.00<br>
0.01<br>
3.00<br>
11,700.00<br>
90.63<br>
154.64<br>
10,955.73<br>
-659.23<br>
939.59<br>
759.28<br>
3.00<br>
0.00<br>
3.00<br>
11,800.00<br>
90.63<br>
157.64<br>
10,954.63<br>
-750.67<br>
980.03<br>
854.64<br>
3.00<br>
0.00<br>
3.00<br>
11,900.00<br>
90.63<br>
160.64<br>
10,953.53<br>
-844.10<br>
1,015.63<br>
951.44<br>
3.00<br>
0.00<br>
3.00<br>
12,000.00<br>
90.63<br>
163.64<br>
10,952.42<br>
-939.27<br>
1,046.30<br>
1,049.41<br>
3.00<br>
0.00<br>
3.00<br>
12,100.00<br>
90.63<br>
166.64<br>
10,951.32<br>
-1,035.91<br>
1,071.94<br>
1,148.30<br>
3.00<br>
0.00<br>
3.00<br>
12,200.00<br>
90.63<br>
169.64<br>
10,950.22<br>
-1,133.75<br>
1,092.48<br>
1,247.82<br>
3.00<br>
0.00<br>
3.00<br>
12,300.00<br>
90.62<br>
172.64<br>
10,949.14<br>
-1,232.54<br>
1,107.88<br>
1,347.71<br>
3.00<br>
-0.01<br>
3.00<br>
12,400.00<br>
90.61<br>
175.64<br>
10,948.06<br>
-1,332.01<br>
1,118.08<br>
1,447.69<br>
3.00<br>
-0.01<br>
3.00<br>
12,500.00<br>
90.60<br>
178.64<br>
10,946.99<br>
-1,431.86<br>
1,123.07<br>
1,547.48<br>
3.00<br>
-0.01<br>
3.00<br>
12,545.27<br>
90.60<br>
180.00<br>
10,946.52<br>
-1,477.13<br>
1,123.61<br>
1,592.53<br>
3.00<br>
-0.01<br>
3.00<br>
EOT, Hold to TD<br>
12,600.00<br>
90.60<br>
180.00<br>
10,945.95<br>
-1,531.85<br>
1,123.61<br>
1,646.92<br>
0.00<br>
0.00<br>
0.00<br>
12,700.00<br>
90.60<br>
180.00<br>
10,944.90<br>
-1,631.85<br>
1,123.61<br>
1,746.30<br>
0.00<br>
0.00<br>
0.00<br>
12,800.00<br>
90.60<br>
180.00<br>
10,943.85<br>
-1,731.84<br>
1,123.61<br>
1,845.68<br>
0.00<br>
0.00<br>
0.00<br>
12,900.00<br>
90.60<br>
180.00<br>
10,942.80<br>
-1,831.84<br>
1,123.60<br>
1,945.05<br>
0.00<br>
0.00<br>
0.00<br>
13,000.00<br>
90.60<br>
180.00<br>
10,941.76<br>
-1,931.83<br>
1,123.60<br>
2,044.43<br>
0.00<br>
0.00<br>
0.00<br>
13,100.00<br>
90.60<br>
180.00<br>
10,940.71<br>
-2,031.83<br>
1,123.60<br>
2,143.81<br>
0.00<br>
0.00<br>
0.00<br>
13,200.00<br>
90.60<br>
180.00<br>
10,939.66<br>
-2,131.82<br>
1,123.60<br>
2,243.19<br>
0.00<br>
0.00<br>
0.00<br>
13,300.00<br>
90.60<br>
180.00<br>
10,938.62<br>
-2,231.82<br>
1,123.60<br>
2,342.57<br>
0.00<br>
0.00<br>
0.00<br>
13,400.00<br>
90.60<br>
180.00<br>
10,937.57<br>
-2,331.81<br>
1,123.60<br>
2,441.95<br>
0.00<br>
0.00<br>
0.00<br>
13,500.00<br>
90.60<br>
180.00<br>
10,936.52<br>
-2,431.81<br>
1,123.60<br>
2,541.33<br>
0.00<br>
0.00<br>
0.00<br>
13,600.00<br>
90.60<br>
180.00<br>
10,935.47<br>
-2,531.80<br>
1,123.60<br>
2,640.71<br>
0.00<br>
0.00<br>
0.00<br>
13,700.00<br>
90.60<br>
180.00<br>
10,934.43<br>
-2,631.79<br>
1,123.60<br>
2,740.08<br>
0.00<br>
0.00<br>
0.00<br>
13,800.00<br>
90.60<br>
180.00<br>
10,933.38<br>
-2,731.79<br>
1,123.60<br>
2,839.46<br>
0.00<br>
0.00<br>
0.00<br>
13,900.00<br>
90.60<br>
180.00<br>
10,932.33<br>
-2,831.78<br>
1,123.60<br>
2,938.84<br>
0.00<br>
0.00<br>
0.00<br>
14,000.00<br>
90.60<br>
180.00<br>
10,931.29<br>
-2,931.78<br>
1,123.60<br>
3,038.22<br>
0.00<br>
0.00<br>
0.00<br>
14,100.00<br>
90.60<br>
180.00<br>
10,930.24<br>
-3,031.77<br>
1,123.60<br>
3,137.60<br>
0.00<br>
0.00<br>
0.00<br>
14,200.00<br>
90.60<br>
180.00<br>
10,929.19<br>
-3,131.77<br>
1,123.60<br>
3,236.98<br>
0.00<br>
0.00<br>
0.00<br>
14,300.00<br>
90.60<br>
180.00<br>
10,928.14<br>
-3,231.76<br>
1,123.60<br>
3,336.36<br>
0.00<br>
0.00<br>
0.00<br>
14,400.00<br>
90.60<br>
180.00<br>
10,927.10<br>
-3,331.76<br>
1,123.60<br>
3,435.74<br>
0.00<br>
0.00<br>
0.00<br>
14,500.00<br>
90.60<br>
180.00<br>
10,926.05<br>
-3,431.75<br>
1,123.60<br>
3,535.11<br>
0.00<br>
0.00<br>
0.00<br>
14,600.00<br>
90.60<br>
180.00<br>
10,925.00<br>
-3,531.74<br>
1,123.60<br>
3,634.49<br>
0.00<br>
0.00<br>
0.00<br>
14,700.00<br>
90.60<br>
180.00<br>
10,923.96<br>
-3,631.74<br>
1,123.60<br>
3,733.87<br>
0.00<br>
0.00<br>
0.00<br>
14,800.00<br>
90.60<br>
180.00<br>
10,922.91<br>
-3,731.73<br>
1,123.60<br>
3,833.25<br>
0.00<br>
0.00<br>
0.00<br>
14,900.00<br>
90.60<br>
180.00<br>
10,921.86<br>
-3,831.73<br>
1,123.60<br>
3,932.63<br>
0.00<br>
0.00<br>
0.00<br>
15,000.00<br>
90.60<br>
180.00<br>
10,920.81<br>
-3,931.72<br>
1,123.60<br>
4,032.01<br>
0.00<br>
0.00<br>
0.00<br>
15,100.00<br>
90.60<br>
180.00<br>
10,919.77<br>
-4,031.72<br>
1,123.60<br>
4,131.39<br>
0.00<br>
0.00<br>
0.00<br>
15,200.00<br>
90.60<br>
180.00<br>
10,918.72<br>
-4,131.71<br>
1,123.60<br>
4,230.77<br>
0.00<br>
0.00<br>
0.00<br>
15,300.00<br>
90.60<br>
180.00<br>
10,917.67<br>
-4,231.71<br>
1,123.60<br>
4,330.15<br>
0.00<br>
0.00<br>
0.00<br>
15,400.00<br>
90.60<br>
180.00<br>
10,916.63<br>
-4,331.70<br>
1,123.60<br>
4,429.52<br>
0.00<br>
0.00<br>
0.00<br>
15,500.00<br>
90.60<br>
180.00<br>
10,915.58<br>
-4,431.70<br>
1,123.60<br>
4,528.90<br>
0.00<br>
0.00<br>
0.00<br>
15,600.00<br>
90.60<br>
180.00<br>
10,914.53<br>
-4,531.69<br>
1,123.60<br>
4,628.28<br>
0.00<br>
0.00<br>
0.00<br>
15,700.00<br>
90.60<br>
180.00<br>
10,913.48<br>
-4,631.68<br>
1,123.60<br>
4,727.66<br>
0.00<br>
0.00<br>
0.00<br>
15,800.00<br>
90.60<br>
180.00<br>
10,912.44<br>
-4,731.68<br>
1,123.59<br>
4,827.04<br>
0.00<br>
0.00<br>
0.00<br>
15,900.00<br>
90.60<br>
180.00<br>
10,911.39<br>
-4,831.67<br>
1,123.59<br>
4,926.42<br>
0.00<br>
0.00<br>
0.00<br>
16,000.00<br>
90.60<br>
180.00<br>
10,910.34<br>
-4,931.67<br>
1,123.59<br>
5,025.80<br>
0.00<br>
0.00<br>
0.00<br>
16,100.00<br>
90.60<br>
180.00<br>
10,909.30<br>
-5,031.66<br>
1,123.59<br>
5,125.18<br>
0.00<br>
0.00<br>
0.00<br>
16,200.00<br>
90.60<br>
180.00<br>
10,908.25<br>
-5,131.66<br>
1,123.59<br>
5,224.55<br>
0.00<br>
0.00<br>
0.00<br>
16,300.00<br>
90.60<br>
180.00<br>
10,907.20<br>
-5,231.65<br>
1,123.59<br>
5,323.93<br>
0.00<br>
0.00<br>
0.00<br>
01/22/14 8:58:30AM<br>
Page 6<br>
COMPASS 5000.1 Build 70<br>
<hr>
<A name=36></a>Schlumberger<br>
Planning Report<br>
Database:<br>
EDM 5000.1 Single User Db<br>
Local Co-ordinate Reference:<br>
Well Fort Berthold 148-94-28B-33-11H<br>
Company:<br>
HRC Operating, LLC<br>
TVD Reference:<br>
KB @ 2363.00usft (Stoneham 16)<br>
Project:<br>
Dunn Co., ND<br>
MD Reference:<br>
KB @ 2363.00usft (Stoneham 16)<br>
Site:<br>
Sec.28-T148N-R94W<br>
North Reference:<br>
True<br>
Well:<br>
Fort Berthold 148-94-28B-33-11H<br>
Survey Calculation Method:<br>
Minimum Curvature<br>
Wellbore:<br>
Original Hole<br>
Design:<br>
Rev 0<br>
Planned Survey<br>
Measured<br>
Vertical<br>
Vertical<br>
Dogleg<br>
Build<br>
Turn<br>
Depth<br>
Inclination<br>
Azimuth<br>
Depth<br>
+N/-S<br>
+E/-W<br>
Section<br>
Rate<br>
Rate<br>
Rate<br>
(usft)<br>
(°)<br>
(°)<br>
(usft)<br>
(usft)<br>
(usft)<br>
(usft)<br>
(°/100usft)<br>
(°/100usft)<br>
(°/100usft)<br>
16,400.00<br>
90.60<br>
180.00<br>
10,906.15<br>
-5,331.65<br>
1,123.59<br>
5,423.31<br>
0.00<br>
0.00<br>
0.00<br>
16,500.00<br>
90.60<br>
180.00<br>
10,905.11<br>
-5,431.64<br>
1,123.59<br>
5,522.69<br>
0.00<br>
0.00<br>
0.00<br>
16,600.00<br>
90.60<br>
180.00<br>
10,904.06<br>
-5,531.64<br>
1,123.59<br>
5,622.07<br>
0.00<br>
0.00<br>
0.00<br>
16,700.00<br>
90.60<br>
180.00<br>
10,903.01<br>
-5,631.63<br>
1,123.59<br>
5,721.45<br>
0.00<br>
0.00<br>
0.00<br>
16,800.00<br>
90.60<br>
180.00<br>
10,901.97<br>
-5,731.62<br>
1,123.59<br>
5,820.83<br>
0.00<br>
0.00<br>
0.00<br>
16,900.00<br>
90.60<br>
180.00<br>
10,900.92<br>
-5,831.62<br>
1,123.59<br>
5,920.21<br>
0.00<br>
0.00<br>
0.00<br>
17,000.00<br>
90.60<br>
180.00<br>
10,899.87<br>
-5,931.61<br>
1,123.59<br>
6,019.58<br>
0.00<br>
0.00<br>
0.00<br>
17,100.00<br>
90.60<br>
180.00<br>
10,898.82<br>
-6,031.61<br>
1,123.59<br>
6,118.96<br>
0.00<br>
0.00<br>
0.00<br>
17,200.00<br>
90.60<br>
180.00<br>
10,897.78<br>
-6,131.60<br>
1,123.59<br>
6,218.34<br>
0.00<br>
0.00<br>
0.00<br>
17,300.00<br>
90.60<br>
180.00<br>
10,896.73<br>
-6,231.60<br>
1,123.59<br>
6,317.72<br>
0.00<br>
0.00<br>
0.00<br>
17,400.00<br>
90.60<br>
180.00<br>
10,895.68<br>
-6,331.59<br>
1,123.59<br>
6,417.10<br>
0.00<br>
0.00<br>
0.00<br>
17,500.00<br>
90.60<br>
180.00<br>
10,894.64<br>
-6,431.59<br>
1,123.59<br>
6,516.48<br>
0.00<br>
0.00<br>
0.00<br>
17,600.00<br>
90.60<br>
180.00<br>
10,893.59<br>
-6,531.58<br>
1,123.59<br>
6,615.86<br>
0.00<br>
0.00<br>
0.00<br>
17,700.00<br>
90.60<br>
180.00<br>
10,892.54<br>
-6,631.57<br>
1,123.59<br>
6,715.24<br>
0.00<br>
0.00<br>
0.00<br>
17,800.00<br>
90.60<br>
180.00<br>
10,891.50<br>
-6,731.57<br>
1,123.59<br>
6,814.61<br>
0.00<br>
0.00<br>
0.00<br>
17,900.00<br>
90.60<br>
180.00<br>
10,890.45<br>
-6,831.56<br>
1,123.59<br>
6,913.99<br>
0.00<br>
0.00<br>
0.00<br>
18,000.00<br>
90.60<br>
180.00<br>
10,889.40<br>
-6,931.56<br>
1,123.59<br>
7,013.37<br>
0.00<br>
0.00<br>
0.00<br>
18,100.00<br>
90.60<br>
180.00<br>
10,888.35<br>
-7,031.55<br>
1,123.59<br>
7,112.75<br>
0.00<br>
0.00<br>
0.00<br>
18,200.00<br>
90.60<br>
180.00<br>
10,887.31<br>
-7,131.55<br>
1,123.59<br>
7,212.13<br>
0.00<br>
0.00<br>
0.00<br>
18,300.00<br>
90.60<br>
180.00<br>
10,886.26<br>
-7,231.54<br>
1,123.59<br>
7,311.51<br>
0.00<br>
0.00<br>
0.00<br>
18,400.00<br>
90.60<br>
180.00<br>
10,885.21<br>
-7,331.54<br>
1,123.59<br>
7,410.89<br>
0.00<br>
0.00<br>
0.00<br>
18,500.00<br>
90.60<br>
180.00<br>
10,884.17<br>
-7,431.53<br>
1,123.59<br>
7,510.27<br>
0.00<br>
0.00<br>
0.00<br>
18,600.00<br>
90.60<br>
180.00<br>
10,883.12<br>
-7,531.53<br>
1,123.58<br>
7,609.65<br>
0.00<br>
0.00<br>
0.00<br>
18,700.00<br>
90.60<br>
180.00<br>
10,882.07<br>
-7,631.52<br>
1,123.58<br>
7,709.02<br>
0.00<br>
0.00<br>
0.00<br>
18,800.00<br>
90.60<br>
180.00<br>
10,881.02<br>
-7,731.51<br>
1,123.58<br>
7,808.40<br>
0.00<br>
0.00<br>
0.00<br>
18,900.00<br>
90.60<br>
180.00<br>
10,879.98<br>
-7,831.51<br>
1,123.58<br>
7,907.78<br>
0.00<br>
0.00<br>
0.00<br>
19,000.00<br>
90.60<br>
180.00<br>
10,878.93<br>
-7,931.50<br>
1,123.58<br>
8,007.16<br>
0.00<br>
0.00<br>
0.00<br>
19,100.00<br>
90.60<br>
180.00<br>
10,877.88<br>
-8,031.50<br>
1,123.58<br>
8,106.54<br>
0.00<br>
0.00<br>
0.00<br>
19,200.00<br>
90.60<br>
180.00<br>
10,876.84<br>
-8,131.49<br>
1,123.58<br>
8,205.92<br>
0.00<br>
0.00<br>
0.00<br>
19,300.00<br>
90.60<br>
180.00<br>
10,875.79<br>
-8,231.49<br>
1,123.58<br>
8,305.30<br>
0.00<br>
0.00<br>
0.00<br>
19,400.00<br>
90.60<br>
180.00<br>
10,874.74<br>
-8,331.48<br>
1,123.58<br>
8,404.68<br>
0.00<br>
0.00<br>
0.00<br>
19,500.00<br>
90.60<br>
180.00<br>
10,873.69<br>
-8,431.48<br>
1,123.58<br>
8,504.05<br>
0.00<br>
0.00<br>
0.00<br>
19,600.00<br>
90.60<br>
180.00<br>
10,872.65<br>
-8,531.47<br>
1,123.58<br>
8,603.43<br>
0.00<br>
0.00<br>
0.00<br>
19,700.00<br>
90.60<br>
180.00<br>
10,871.60<br>
-8,631.47<br>
1,123.58<br>
8,702.81<br>
0.00<br>
0.00<br>
0.00<br>
19,800.00<br>
90.60<br>
180.00<br>
10,870.55<br>
-8,731.46<br>
1,123.58<br>
8,802.19<br>
0.00<br>
0.00<br>
0.00<br>
19,900.00<br>
90.60<br>
180.00<br>
10,869.51<br>
-8,831.45<br>
1,123.58<br>
8,901.57<br>
0.00<br>
0.00<br>
0.00<br>
20,000.00<br>
90.60<br>
180.00<br>
10,868.46<br>
-8,931.45<br>
1,123.58<br>
9,000.95<br>
0.00<br>
0.00<br>
0.00<br>
20,100.00<br>
90.60<br>
180.00<br>
10,867.41<br>
-9,031.44<br>
1,123.58<br>
9,100.33<br>
0.00<br>
0.00<br>
0.00<br>
20,200.00<br>
90.60<br>
180.00<br>
10,866.36<br>
-9,131.44<br>
1,123.58<br>
9,199.71<br>
0.00<br>
0.00<br>
0.00<br>
20,300.00<br>
90.60<br>
180.00<br>
10,865.32<br>
-9,231.43<br>
1,123.58<br>
9,299.08<br>
0.00<br>
0.00<br>
0.00<br>
20,400.00<br>
90.60<br>
180.00<br>
10,864.27<br>
-9,331.43<br>
1,123.58<br>
9,398.46<br>
0.00<br>
0.00<br>
0.00<br>
20,500.00<br>
90.60<br>
180.00<br>
10,863.22<br>
-9,431.42<br>
1,123.58<br>
9,497.84<br>
0.00<br>
0.00<br>
0.00<br>
20,600.00<br>
90.60<br>
180.00<br>
10,862.18<br>
-9,531.42<br>
1,123.58<br>
9,597.22<br>
0.00<br>
0.00<br>
0.00<br>
20,700.00<br>
90.60<br>
180.00<br>
10,861.13<br>
-9,631.41<br>
1,123.58<br>
9,696.60<br>
0.00<br>
0.00<br>
0.00<br>
20,800.00<br>
90.60<br>
180.00<br>
10,860.08<br>
-9,731.41<br>
1,123.58<br>
9,795.98<br>
0.00<br>
0.00<br>
0.00<br>
20,900.00<br>
90.60<br>
180.00<br>
10,859.03<br>
-9,831.40<br>
1,123.58<br>
9,895.36<br>
0.00<br>
0.00<br>
0.00<br>
21,000.00<br>
90.60<br>
180.00<br>
10,857.99<br>
-9,931.39<br>
1,123.58<br>
9,994.74<br>
0.00<br>
0.00<br>
0.00<br>
21,100.00<br>
90.60<br>
180.00<br>
10,856.94<br>
-10,031.39<br>
1,123.58<br>
10,094.11<br>
0.00<br>
0.00<br>
0.00<br>
21,146.75<br>
90.60<br>
180.00<br>
10,856.45<br>
-10,078.14<br>
1,123.58<br>
10,140.58<br>
0.00<br>
0.00<br>
0.00<br>
PBHL/TD<br>
01/22/14 8:58:30AM<br>
Page 7<br>
COMPASS 5000.1 Build 70<br>
<hr>
<A name=37></a>Schlumberger<br>
Planning Report<br>
Database:<br>
EDM 5000.1 Single User Db<br>
Local Co-ordinate Reference:<br>
Well Fort Berthold 148-94-28B-33-11H<br>
Company:<br>
HRC Operating, LLC<br>
TVD Reference:<br>
KB @ 2363.00usft (Stoneham 16)<br>
Project:<br>
Dunn Co., ND<br>
MD Reference:<br>
KB @ 2363.00usft (Stoneham 16)<br>
Site:<br>
Sec.28-T148N-R94W<br>
North Reference:<br>
True<br>
Well:<br>
Fort Berthold 148-94-28B-33-11H<br>
Survey Calculation Method:<br>
Minimum Curvature<br>
Wellbore:<br>
Original Hole<br>
Design:<br>
Rev 0<br>
Design Targets<br>
Target Name<br>
- hit/miss target<br>
Dip Angle<br>
Dip Dir.<br>
TVD<br>
+N/-S<br>
+E/-W<br>
Northing<br>
Easting<br>
- Shape<br>
(°)<br>
(°)<br>
(usft)<br>
(usft)<br>
(usft)<br>
(usft)<br>
(usft)<br>
Latitude<br>
Longitude<br>
PBHL Fort Berthold 148-94-28B-33-11H<br>
0.00<br>
0.00 10,856.45<br>
-10,078.14<br>
1,123.58<br>
708,414.65<br>
1,435,834.27<br>
47° 35' 20.501 N<br>
102° 39' 31.540 W<br>
- plan hits target center<br>
- Point<br>
Casing Points<br>
Measured<br>
Vertical<br>
Casing<br>
Hole<br>
Depth<br>
Depth<br>
Diameter<br>
Diameter<br>
(usft)<br>
(usft)<br>
Name<br>
(")<br>
(")<br>
11,303.67<br>
10,960.00<br>
7" Csg<br>
7<br>
7-1/2<br>
Formations<br>
Measured<br>
Vertical<br>
Dip<br>
Depth<br>
Depth<br>
Direction<br>
Dip<br>
(usft)<br>
(usft)<br>
(°)<br>
Name<br>
Lithology<br>
(°)<br>
2,063.00<br>
2,063.00 Pierre<br>
0.00<br>
4,952.59<br>
4,949.00 Mowry/Top Dakota Gp<br>
0.00<br>
6,188.28<br>
6,183.00 Rierdon<br>
0.00<br>
6,897.25<br>
6,891.00 Top Pine Salt<br>
0.00<br>
6,983.37<br>
6,977.00 Base Pine Salt<br>
0.00<br>
7,135.58<br>
7,129.00 Top Opeche Salt<br>
0.00<br>
7,215.69<br>
7,209.00 Base Opeche Salt<br>
0.00<br>
7,472.04<br>
7,465.00 Amsden<br>
0.00<br>
8,009.78<br>
8,002.00 Tyler<br>
0.00<br>
8,505.46<br>
8,497.00 Kibbey Lime<br>
0.00<br>
8,664.68<br>
8,656.00 Charles (Top Madison)<br>
0.00<br>
9,232.46<br>
9,223.00 Base Last Salt<br>
0.00<br>
9,417.71<br>
9,408.00 Mission Canyon<br>
0.00<br>
10,002.51<br>
9,992.00 Lodgepole<br>
0.00<br>
10,934.13<br>
10,848.52 Bakken<br>
0.60<br>
10,967.11<br>
10,867.29 Middle Bakken<br>
0.60<br>
11,062.87<br>
10,912.59 Lower Bakken Shale<br>
0.60<br>
11,127.96<br>
10,935.08 Three Forks<br>
0.60<br>
11,198.72<br>
10,951.51 Top Target Top<br>
0.60<br>
Plan Annotations<br>
Measured<br>
Vertical<br>
Local Coordinates<br>
Depth<br>
Depth<br>
+N/-S<br>
+E/-W<br>
(usft)<br>
(usft)<br>
(usft)<br>
(usft)<br>
Comment<br>
2,200.00<br>
2,200.00<br>
0.00<br>
0.00<br>
Begin Nudge<br>
2,400.00<br>
2,399.91<br>
1.79<br>
4.92<br>
Hold Tangent<br>
10,000.00<br>
9,989.49<br>
137.83<br>
378.68<br>
Begin Drop<br>
10,200.00<br>
10,189.40<br>
139.62<br>
383.60<br>
Vertical Point<br>
10,397.67<br>
10,387.07<br>
139.62<br>
383.60<br>
KOP, Build 10°/100' DLS<br>
11,303.67<br>
10,960.00<br>
-321.23<br>
734.04<br>
LP, Begin Turn<br>
12,545.27<br>
10,946.52<br>
-1,477.13<br>
1,123.61<br>
EOT, Hold to TD<br>
21,146.75<br>
10,856.45<br>
-10,078.14<br>
1,123.58<br>
PBHL/TD<br>
01/22/14 8:58:30AM<br>
Page 8<br>
COMPASS 5000.1 Build 70<br>
<hr>
<A name=38></a>R</span><span class="ft1">O</span><span class="ft2">Y </span><span class="ft1">JE</span><span class="ft2">NS</span><span class="ft1">E<br>
T<br>
N<br>
REGISTERED<br>
LAND<br>
SURVEYOR<br>
N<br>
LS. - 4654<br>
O<br>
A<br>
R<br>
T<br>
T </span><span class="ft1">H D</span><span class="ft2">A </span><span class="ft1">KO<br>
<hr>
<A name=39></a><hr>
<A name=40></a><hr>
<A name=41></a><hr>
<A name=42></a><hr>
<A name=43></a><hr>
<A name=44></a><hr>
<A name=45></a><hr>
<A name=46></a>1.5 MI. +/-<br>
BIA 12<br>
MANDAREE<br>
.OC .O<br>
IE<br>
C<br>
Y 22<br>
I. +/-<br>
Z<br>
N<br>
M<br>
N<br>
N<br>
7.4<br>
E<br>
U<br>
HIGHWA<br>
cK<br>
D<br>
M<br>
McKENZIE CO.<br>
T149N<br>
DUNN CO.<br>
T148N<br>
PROPOSED LOCATION:<br>
LITTLE BEAR PAD - FORT BERTHOLD<br>
148-94-28B-33-12H & 148-94-28B-33-11H<br>
BIA 14<br>
ON EXISTING FB 148-94-28A-33-2H<br>
& 148-94-28A-33-1H WELL PAD<br>
I. +/-<br>
M<br>
0.7<br>
MI. +/-<br>
SEE TOPO "B"<br>
1.5<br>
1.6 MI. +/-<br>
R R<br>
95 94<br>
W W<br>
LEGEND:<br>
HRC OPERATING, LLC<br>
PROPOSED LOCATION<br>
LITTLE BEAR PAD - FORT BERTHOLD 148-94-28B-33-12H<br>
& 148-94-28B-33-11H ON EXISTING FB 148-94-28A-33-2H<br>
& 148-94-28A-33-1H WELL PAD<br>
SECTION 28, T148N, R94W, 5TH P.M.<br>
NE 1/4 NW 1/4<br>
Uintah Engineering & Land Surveying<br>
A C C E S S R O A D<br>
U<br>
09 18 13<br>
E<br>
85 South 200 East Vernal, Utah 84078<br>
M A P<br>
L<br>
(435) 789-1017 * FAX (435) 789-1813<br>
A<br>
MONTH<br>
DAY<br>
YEAR<br>
S<br>
SCALE: 1:100,000<br>
DRAWNBY: J.C.<br>
REV: 12-23-13 M.M.<br>
TOPO<br>
<hr>
<A name=47></a>T148N<br>
PROPOSEDLOCATION:<br>
LITTLEBEARPAD- FORTBERTHOLD<br>
148-94-28B-33-12H&148-94-28B-33-11H<br>
ONEXISTINGFB148-94-28A-33-2H<br>
&148-94-28A-33-1HWELLPAD<br>
MANDAREE 12.7 MI. +/-<br>
SEE DETAIL"A"<br>
T1031A-A<br>
T1031A-B<br>
DETAIL"A"</span><span class="ft19">PROPOSED FENCE </span><span class="ft17">EXISTING PIPELINE<br>
2<br>
1<br>
R<br>
94<br>
EXISTING FENCE<br>
W<br>
LEGEND:<br>
1<br>
INSTALLCATTLE GAURD<br>
2<br>
INSTALL18" CMP<br>
LEGEND:<br>
HRCOPERATING, LLC<br>
EXISTINGROAD<br>
LITTLE BEARPAD - FORTBERTHOLD 148-94-28B-33-12H<br>
EXISTINGFENCE<br>
&148-94-28B-33-11H ONEXISTINGFB 148-94-28A-33-2H<br>
&148-94-28A-33-1HWELLPAD<br>
PROPOSED FENCE<br>
SECTION 28, T148N, R94W, 5THP.M.<br>
EXISTINGPIPELINE<br>
NE1/4 NW1/4<br>
Uintah Engineering &Land Surveying<br>
ACCESS ROAD<br>
U<br>
09 18 13<br>
E<br>
85 South 200 East Vernal, Utah 84078<br>
MAP<br>
L<br>
(435) 789-1017 * FAX (435) 789-1813<br>
B<br>
MONTH<br>
DAY<br>
YEAR<br>
S<br>
SCALE: 1"=2000'<br>
DRAWNBY: J.C.<br>
REV: 12-23-13 M.M.<br>
TOPO<br>
<hr>
<A name=48></a>T148N<br>
FB 148-94-21A-20-3H<br>
FB 148-94-21A-20-2H FB 148-94-21A-20-1H<br>
PROPOSEDLOCATION:<br>
LITTLEBEARPAD- FORTBERTHOLD<br>
148-94-28B-33-12H&148-94-28B-33-11H<br>
ONEXISTINGFB148-94-28A-33-2H<br>
&148-94-28A-33-1HWELLPAD<br>
FB 148-94-28A-33-1H<br>
FB 148-94-28A-33-2H<br>
R<br>
94<br>
W<br>
LEGEND:<br>
HRCOPERATING, LLC<br>
LITTLE BEARPAD - FORTBERTHOLD 148-94-28B-33-12H<br>
DISPOSALWELLS<br>
&148-94-28B-33-11H ONEXISTINGFB 148-94-28A-33-2H<br>
PRODUCINGWELLS<br>
ABANDONEDWELLS<br>
&148-94-28A-33-1HWELLPAD<br>
SECTION 28, T148N, R94W, 5THP.M.<br>
SHUTINWELLS<br>
TEMPORARILYABANDONED<br>
NE1/4 NW1/4<br>
Uintah Engineering &Land Surveying<br>
TOPOGRAPHIC<br>
U<br>
09 18 13<br>
E<br>
85 South 200 East Vernal, Utah 84078<br>
MAP<br>
L<br>
(435) 789-1017 * FAX (435) 789-1813<br>
C<br>
MONTH<br>
DAY<br>
YEAR<br>
S<br>
SCALE: 1"=2000'<br>
DRAWNBY: J.C.<br>
REV: 12-23-13 M.M.<br>
TOPO<br>
<hr>
<A name=49></a>HRC OPERATING, LLC<br>
LITTLE BEAR PAD FORT BERTHOLD<br>
148-94-28B-33-12H & 148-94-28B-33-11H ON EXISTING<br>
FB 148-94-28A-33-2H & 148-94-28A-33-1H WELL PAD<br>
SECTION 29, T148N, R94W, 5</span><span class="ft4">th </span><span class="ft3">P.M.<br>
PROCEED IN A WESTERLY DIRECTION FROM MANDAREE, NORTH<br>
DAKOTA ALONG<br>
BIA<br>
12<br>
APPROXIMATELY<br>
1.5<br>
MILES<br>
TO<br>
THE<br>
JUNCTION OF THIS ROAD AND HIGHWAY 22 TO THE SOUTHEAST; TURN<br>
LEFT AND PROCEED IN A SOUTHEASTERLY, THEN SOUTHWESTERLY,<br>
THEN THEN SOUTHERLY DIRECTION APPROXIMATELY 7.4 MILES TO THE<br>
JUNCTION OF THIS ROAD AND BIA 14 TO THE EAST; TURN LEFT AND<br>
PROCEED IN AN EASTERLY DIRECTION APPROXIMATELY 0.7 MILES TO<br>
THE JUNCTION OF THIS ROAD AND AN EXISTING ROAD TO THE SOUTH;<br>
TURN RIGHT AND PROCEED IN A SOUTHERLY, THEN SOUTHEASTERLY<br>
DIRECTION APPROXIMATELY 1.5 MILES TO THE JUNCTION OF THIS ROAD<br>
AND AN EXISTING ROAD TO THE EAST; TURN LEFT AND PROCEED IN A<br>
NORTHEASTERLY, THEN SOUTHEASTERLY, THEN EASTERLY DIRECTION<br>
APPROXIMATELY 1.6 MILES TO THE #148-94-28A-33-2H & #148-94-28A-33-1H<br>
WELL PAD AND THE PROPOSED LOCATION.<br>
TOTAL DISTANCE FROM MANDAREE, NORTH DAKOTA TO THE PROPOSED<br>
WELL LOCATION IS APPROXIMATELY 12.7 MILES.<br>
<hr>
<A name=50></a>HRC OPERATING, LLC<br>
LITTLE BEAR PAD - FORT BERTHOLD 148-94-28B-33-12H & 148-94-28B-33-11H<br>
ON EXISTING FB 148-94-28A-33-2H & 148-94-28A-33-1H WELL PAD<br>
LOCATED IN DUNN COUNTY, NORTH DAKOTA<br>
SECTION 28, T148N, R94W, 5th P.M.<br>
148-94-28B-33-12H<br>
148-94-28B-33-11H<br>
PHOTO: VIEW OF LOCATION STAKES<br>
CAMERA ANGLE: EASTERLY<br>
EXISTING ACCESS<br>
PHOTO: VIEW OF EXISTING ACCESS<br>
CAMERA ANGLE: EASTERLY<br>
U </span><span class="ft7">Uintah Engineering & Land Surveying<br>
LOCATION PHOTOS<br>
09 18 13 </span><span class="ft1">PHOTO<br>
MONTH<br>
DAY<br>
YEAR<br>
EL </span><span class="ft8">85South200East Vernal,Utah84078<br>
- Since 1964 -<br>
(435) 789-1017 * FAX (435) 789-1813<br>
TAKEN BY: G.R.<br>
DRAWN BY: J.C.<br>
REV:12-23-13 M.M.<br>
S<br>
<hr>
<A name=51></a>R</span><span class="ft1">OY J</span><span class="ft2">ENS</span><span class="ft1">E<br>
T<br>
N<br>
REGISTERED<br>
LAND<br>
SURVEYOR<br>
N<br>
LS. - 4654<br>
O<br>
A<br>
R<br>
T<br>
T </span><span class="ft2">H </span><span class="ft1">DA KO<br>
<hr>
<A name=52></a>REGISTERED<br>
LAND<br>
SURVEYOR<br>
LS. - 4654<br>
<hr>
<A name=53></a><hr>
<A name=54></a>Burns, David J.<br>
From:<br>
Mark Johnson <[email protected]><br>
Sent:<br>
Monday, June 16, 2014 9:47 AM<br>
To:<br>
Burns, David J.<br>
Subject:<br>
HRC Operating, LLC - Little Bear Pad<br>
Dave, <br>
<br>
This email is to confirm HRC Operating, LLC has applied for and is working towards BLM approval on the following wells:<br>
<br>
Fort Berthold 1489428B3312H <br>
Fort Berthold 1489428B3313H <br>
<br>
If you have any other questions please give me a call. <br>
<br>
Thanks, <br>
<br>
Mark H. Johnson <br>
Halcón Resources Corporation <br>
HRC Operating, LLC <br>
1801 California Street Suite 3500 <br>
Denver, CO 80202 <br>
7208896025 Direct <br>
3035481953 Cell <br>
<br>
1<br>
<hr>
<A name="outline"></a><h1>Document Outline</h1>
<ul><li>Form 4
<li>4-intent- change in SHL
<ul><li>4-Well Name Change
</ul><li>4-intent- log waiver; Chapter 43-02-03-31
<li>Form 1
</ul><hr>
</BODY>
</HTML>
| datamade/elpc_bakken | html/pdf/W28628.pdfs.html | HTML | mit | 70,643 |
<?php
namespace MeadSteve\DiceApi\Renderer;
use MeadSteve\DiceApi\Dice;
interface DiceRenderer
{
/**
* @param Dice[] $diceCollection
* @return mixed
*/
public function renderDice(array $diceCollection);
public function contentType() : string;
public function urlPrefix() : string;
}
| meadsteve/DiceApi | src/Renderer/DiceRenderer.php | PHP | mit | 318 |
package com.pablodomingos.classes.rps.servicos;
import java.io.IOException;
import org.apache.commons.io.IOUtils;
import org.junit.Assert;
import org.junit.Test;
import com.pablodomingos.classes.FabricaDeObjetosFake;
public class LoteRpsConsultaSituacaoTest {
@Test
public void xmlDeveSerGeradoCorretamente() throws IOException{
String xmlTest = IOUtils.toString(getClass().getClassLoader().getResourceAsStream("loteRpsConsultaSituacao.xml"));
LoteRpsConsultaSituacao consultaSituacaoLote = new LoteRpsConsultaSituacao("AP1057893n16X103sfhF4RPm", FabricaDeObjetosFake.getRpsPrestador());
String xml = consultaSituacaoLote.converterParaXml();
Assert.assertEquals(xml, xmlTest);
}
}
| pablopdomingos/nfse | nfse-bh/src/test/java/com/pablodomingos/classes/rps/servicos/LoteRpsConsultaSituacaoTest.java | Java | mit | 744 |
package com.billybyte.dse.outputs;
public class CorrRiskDerSen extends AbstractSensitivityType {
@Override
public String getString() {
return "CORR_RISK";
}
}
| bgithub1/common-libs | src/main/java/com/billybyte/dse/outputs/CorrRiskDerSen.java | Java | mit | 167 |
// $Id: gatewayd.cpp 80826 2008-03-04 14:51:23Z wotte $
// ============================================================================
//
// = LIBRARY
// gateway
//
// = FILENAME
// peerd.h
//
// = DESCRIPTION
// Driver for the gateway daemon (gatewayd). Note that this is
// completely generic code due to the Service Configurator
// framework!
//
// = AUTHOR
// Douglas C. Schmidt
//
// ============================================================================
#include "ace/OS_NS_unistd.h"
#include "ace/Service_Config.h"
#include "ace/Service_Object.h"
#include "ace/Log_Msg.h"
#include "ace/Reactor.h"
#include "Gateway.h"
ACE_RCSID (Gateway,
gatewayd,
"$Id: gatewayd.cpp 80826 2008-03-04 14:51:23Z wotte $")
int
ACE_TMAIN (int argc, ACE_TCHAR *argv[])
{
if (ACE_OS::access (ACE_DEFAULT_SVC_CONF, F_OK) != 0)
{
// Use static linking.
ACE_Service_Object_Ptr sp = ACE_SVC_INVOKE (Gateway);
if (sp->init (argc - 1, argv + 1) == -1)
ACE_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("%p\n"),
ACE_TEXT ("init")),
1);
// Run forever, performing the configured services until we
// are shut down by a SIGINT/SIGQUIT signal.
ACE_Reactor::instance ()->run_reactor_event_loop ();
// Destructor of <ACE_Service_Object_Ptr> automagically call
// <fini>.
}
else
{
if (ACE_Service_Config::open (argc, argv) == -1)
ACE_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("%p\n"),
ACE_TEXT ("open")),
1);
else // Use dynamic linking.
// Run forever, performing the configured services until we are
// shut down by a signal (e.g., SIGINT or SIGQUIT).
ACE_Reactor::instance ()->run_reactor_event_loop ();
}
return 0;
}
| binghuo365/BaseLab | 3rd/ACE-5.7.0/ACE_wrappers/apps/Gateway/Gateway/gatewayd.cpp | C++ | mit | 1,915 |
<?php
/*
* This file is part of PHP CS Fixer.
*
* (c) Fabien Potencier <[email protected]>
* Dariusz Rumiński <[email protected]>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace PhpCsFixer\Fixer\Basic;
use PhpCsFixer\AbstractFixer;
use PhpCsFixer\Fixer\ConfigurationDefinitionFixerInterface;
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
use PhpCsFixer\FixerConfiguration\FixerOptionBuilder;
use PhpCsFixer\FixerConfiguration\InvalidOptionsForEnvException;
use PhpCsFixer\FixerDefinition\CodeSample;
use PhpCsFixer\FixerDefinition\FixerDefinition;
use PhpCsFixer\FixerDefinition\VersionSpecification;
use PhpCsFixer\FixerDefinition\VersionSpecificCodeSample;
use PhpCsFixer\Tokenizer\Token;
use PhpCsFixer\Tokenizer\Tokens;
use Symfony\Component\OptionsResolver\Options;
/**
* Removes Zero-width space (ZWSP), Non-breaking space (NBSP) and other invisible unicode symbols.
*
* @author Ivan Boprzenkov <[email protected]>
*/
final class NonPrintableCharacterFixer extends AbstractFixer implements ConfigurationDefinitionFixerInterface
{
private $symbolsReplace;
private static $tokens = [
T_STRING_VARNAME,
T_INLINE_HTML,
T_VARIABLE,
T_COMMENT,
T_ENCAPSED_AND_WHITESPACE,
T_CONSTANT_ENCAPSED_STRING,
T_DOC_COMMENT,
];
public function __construct()
{
parent::__construct();
$this->symbolsReplace = [
pack('H*', 'e2808b') => ['', '200b'], // ZWSP U+200B
pack('H*', 'e28087') => [' ', '2007'], // FIGURE SPACE U+2007
pack('H*', 'e280af') => [' ', '202f'], // NBSP U+202F
pack('H*', 'e281a0') => ['', '2060'], // WORD JOINER U+2060
pack('H*', 'c2a0') => [' ', 'a0'], // NO-BREAK SPACE U+A0
];
}
/**
* {@inheritdoc}
*/
public function getDefinition()
{
return new FixerDefinition(
'Remove Zero-width space (ZWSP), Non-breaking space (NBSP) and other invisible unicode symbols.',
[
new CodeSample(
'<?php echo "'.pack('H*', 'e2808b').'Hello'.pack('H*', 'e28087').'World'.pack('H*', 'c2a0')."!\";\n"
),
new VersionSpecificCodeSample(
'<?php echo "'.pack('H*', 'e2808b').'Hello'.pack('H*', 'e28087').'World'.pack('H*', 'c2a0')."!\";\n",
new VersionSpecification(70000),
['use_escape_sequences_in_strings' => true]
),
],
null,
'Risky when strings contain intended invisible characters.'
);
}
/**
* {@inheritdoc}
*/
public function isRisky()
{
return true;
}
/**
* {@inheritdoc}
*/
public function isCandidate(Tokens $tokens)
{
return count($tokens) > 1 && $tokens->isAnyTokenKindsFound(self::$tokens);
}
/**
* {@inheritdoc}
*/
protected function createConfigurationDefinition()
{
return new FixerConfigurationResolver([
(new FixerOptionBuilder('use_escape_sequences_in_strings', 'Whether characters should be replaced with escape sequences in strings.'))
->setAllowedTypes(['bool'])
->setDefault(false) // @TODO 3.0 change to true
->setNormalizer(function (Options $options, $value) {
if (PHP_VERSION_ID < 70000 && $value) {
throw new InvalidOptionsForEnvException('Escape sequences require PHP 7.0+.');
}
return $value;
})
->getOption(),
]);
}
/**
* {@inheritdoc}
*/
protected function applyFix(\SplFileInfo $file, Tokens $tokens)
{
$replacements = [];
$escapeSequences = [];
foreach ($this->symbolsReplace as $character => list($replacement, $codepoint)) {
$replacements[$character] = $replacement;
$escapeSequences[$character] = '\u{'.$codepoint.'}';
}
foreach ($tokens as $index => $token) {
$content = $token->getContent();
if (
$this->configuration['use_escape_sequences_in_strings']
&& $token->isGivenKind([T_CONSTANT_ENCAPSED_STRING, T_ENCAPSED_AND_WHITESPACE])
) {
if (!preg_match('/'.implode('|', array_keys($escapeSequences)).'/', $content)) {
continue;
}
$previousToken = $tokens[$index - 1];
$stringTypeChanged = false;
if ($previousToken->isGivenKind(T_START_HEREDOC)) {
$previousTokenContent = $previousToken->getContent();
if (false !== strpos($previousTokenContent, '\'')) {
$tokens[$index - 1] = new Token([T_START_HEREDOC, str_replace('\'', '', $previousTokenContent)]);
$stringTypeChanged = true;
}
} elseif ("'" === $content[0]) {
$content = preg_replace('/^\'(.*)\'$/', '"$1"', $content);
$stringTypeChanged = true;
}
if ($stringTypeChanged) {
$content = preg_replace('/([\\\\$])/', '\\\\$1', $content);
}
$tokens[$index] = new Token([$token->getId(), strtr($content, $escapeSequences)]);
continue;
}
if ($token->isGivenKind(self::$tokens)) {
$tokens[$index] = new Token([$token->getId(), strtr($content, $replacements)]);
}
}
}
}
| Soullivaneuh/PHP-CS-Fixer | src/Fixer/Basic/NonPrintableCharacterFixer.php | PHP | mit | 5,770 |
#ifndef GUIUTIL_H
#define GUIUTIL_H
#include <QString>
#include <QObject>
#include <QMessageBox>
QT_BEGIN_NAMESPACE
class QFont;
class QLineEdit;
class QWidget;
class QDateTime;
class QUrl;
class QAbstractItemView;
QT_END_NAMESPACE
class SendCoinsRecipient;
/** Utility functions used by the Bitcoin Qt UI.
*/
namespace GUIUtil
{
// Create human-readable string from date
QString dateTimeStr(const QDateTime &datetime);
QString dateTimeStr(qint64 nTime);
// Render Bitcoin addresses in monospace font
QFont bitcoinAddressFont();
// Set up widgets for address and amounts
void setupAddressWidget(QLineEdit *widget, QWidget *parent);
void setupAmountWidget(QLineEdit *widget, QWidget *parent);
// Parse "TrustPlus:" URI into recipient object, return true on successful parsing
// See Bitcoin URI definition discussion here: https://bitcointalk.org/index.php?topic=33490.0
bool parseBitcoinURI(const QUrl &uri, SendCoinsRecipient *out);
bool parseBitcoinURI(QString uri, SendCoinsRecipient *out);
// HTML escaping for rich text controls
QString HtmlEscape(const QString& str, bool fMultiLine=false);
QString HtmlEscape(const std::string& str, bool fMultiLine=false);
/** Copy a field of the currently selected entry of a view to the clipboard. Does nothing if nothing
is selected.
@param[in] column Data column to extract from the model
@param[in] role Data role to extract from the model
@see TransactionView::copyLabel, TransactionView::copyAmount, TransactionView::copyAddress
*/
void copyEntryData(QAbstractItemView *view, int column, int role=Qt::EditRole);
/** Get save filename, mimics QFileDialog::getSaveFileName, except that it appends a default suffix
when no suffix is provided by the user.
@param[in] parent Parent window (or 0)
@param[in] caption Window caption (or empty, for default)
@param[in] dir Starting directory (or empty, to default to documents directory)
@param[in] filter Filter specification such as "Comma Separated Files (*.csv)"
@param[out] selectedSuffixOut Pointer to return the suffix (file type) that was selected (or 0).
Can be useful when choosing the save file format based on suffix.
*/
QString getSaveFileName(QWidget *parent=0, const QString &caption=QString(),
const QString &dir=QString(), const QString &filter=QString(),
QString *selectedSuffixOut=0);
/** Get connection type to call object slot in GUI thread with invokeMethod. The call will be blocking.
@returns If called from the GUI thread, return a Qt::DirectConnection.
If called from another thread, return a Qt::BlockingQueuedConnection.
*/
Qt::ConnectionType blockingGUIThreadConnection();
// Determine whether a widget is hidden behind other windows
bool isObscured(QWidget *w);
// Open debug.log
void openDebugLogfile();
/** Qt event filter that intercepts ToolTipChange events, and replaces the tooltip with a rich text
representation if needed. This assures that Qt can word-wrap long tooltip messages.
Tooltips longer than the provided size threshold (in characters) are wrapped.
*/
class ToolTipToRichTextFilter : public QObject
{
Q_OBJECT
public:
explicit ToolTipToRichTextFilter(int size_threshold, QObject *parent = 0);
protected:
bool eventFilter(QObject *obj, QEvent *evt);
private:
int size_threshold;
};
bool GetStartOnSystemStartup();
bool SetStartOnSystemStartup(bool fAutoStart);
/** Help message for Bitcoin-Qt, shown with --help. */
class HelpMessageBox : public QMessageBox
{
Q_OBJECT
public:
HelpMessageBox(QWidget *parent = 0);
/** Show message box or print help message to standard output, based on operating system. */
void showOrPrint();
/** Print help message to console */
void printToConsole();
private:
QString header;
QString coreOptions;
QString uiOptions;
};
} // namespace GUIUtil
#endif // GUIUTIL_H
| TrustPlus/TrustPlus | src/qt/guiutil.h | C | mit | 4,246 |
"use strict";
var Hero = (function () {
function Hero() {
}
return Hero;
}());
exports.Hero = Hero;
//# sourceMappingURL=hero.class.js.map | malditonekro/the_hero_editor | src/app/class/hero/hero.class.js | JavaScript | mit | 150 |
<?php
namespace app\modules\admin\models;
use Yii;
class Category extends \yii\db\ActiveRecord
{
public static function tableName(){
return 'category';
}
public function getCategory(){
return $this->hasOne(Category::className(), ['id'=>'parent_id']);
}
/**
* @inheritdoc
*/
public function rules()
{
return [
[['parent_id'], 'integer'],
[['name'], 'required'],
[['name', 'keywords', 'description'], 'string', 'max' => 255],
];
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
'id' => '№ категории',
'parent_id' => 'Родительская кат',
'name' => 'Наименование',
'keywords' => 'Ключ слова',
'description' => 'Мета-описание',
];
}
}
| fine-proj/yiishop | modules/admin/models/Category.php | PHP | mit | 922 |
using System.Collections.Generic;
using System.Collections.ObjectModel;
namespace WebApiLongRunningTask.Sample.Areas.HelpPage.ModelDescriptions
{
public class ParameterDescription
{
public ParameterDescription()
{
Annotations = new Collection<ParameterAnnotation>();
}
public Collection<ParameterAnnotation> Annotations { get; private set; }
public string Documentation { get; set; }
public string Name { get; set; }
public ModelDescription TypeDescription { get; set; }
}
} | nemec/WebApiLongRunningTask | WebApiLongRunningTask.Sample/Areas/HelpPage/ModelDescriptions/ParameterDescription.cs | C# | mit | 559 |
<?php
/**
* Interface for objects that modify $options for elgg_get_entities/metadata/etc.
*
* @access private
*/
interface Elggx_QueryModifierInterface {
/**
* Get the modified $options array for an elgg_get_*() query
*
* @return array
*/
public function getOptions();
}
| mrclay/Elgg-elggx_lists_api | classes/Elggx/QueryModifierInterface.php | PHP | mit | 288 |
<?php declare(strict_types=1);
namespace GraphQL\Tests\Type;
use DMS\PHPUnitExtensions\ArraySubset\ArraySubsetAsserts;
use GraphQL\GraphQL;
use GraphQL\Language\SourceLocation;
use GraphQL\Tests\ErrorHelper;
use GraphQL\Type\Definition\EnumType;
use GraphQL\Type\Definition\InputObjectType;
use GraphQL\Type\Definition\ObjectType;
use GraphQL\Type\Definition\ResolveInfo;
use GraphQL\Type\Definition\Type;
use GraphQL\Type\Introspection;
use GraphQL\Type\Schema;
use GraphQL\Validator\Rules\ProvidedRequiredArguments;
use PHPUnit\Framework\TestCase;
use function Safe\json_encode;
class IntrospectionTest extends TestCase
{
use ArraySubsetAsserts;
/**
* @see it('executes an introspection query')
*/
public function testExecutesAnIntrospectionQuery(): void
{
$emptySchema = new Schema([
'query' => new ObjectType([
'name' => 'QueryRoot',
'fields' => [
'a' => Type::string(),
],
]),
]);
$request = Introspection::getIntrospectionQuery([
'descriptions' => false,
'directiveIsRepeatable' => true,
]);
$expected = [
'data' => [
'__schema' => [
'mutationType' => null,
'subscriptionType' => null,
'queryType' => ['name' => 'QueryRoot'],
'types' => [
[
'kind' => 'OBJECT',
'name' => 'QueryRoot',
'inputFields' => null,
'interfaces' => [],
'enumValues' => null,
'possibleTypes' => null,
'fields' => [
[
'name' => 'a',
'args' => [],
'type' => [
'kind' => 'SCALAR',
'name' => 'String',
'ofType' => null,
],
'isDeprecated' => false,
'deprecationReason' => null,
],
],
],
[
'kind' => 'SCALAR',
'name' => 'String',
'fields' => null,
'inputFields' => null,
'interfaces' => null,
'enumValues' => null,
'possibleTypes' => null,
],
[
'kind' => 'OBJECT',
'name' => '__Schema',
'fields' => [
0 => [
'name' => 'types',
'args' => [],
'type' => [
'kind' => 'NON_NULL',
'name' => null,
'ofType' => [
'kind' => 'LIST',
'name' => null,
'ofType' => [
'kind' => 'NON_NULL',
'name' => null,
'ofType' => [
'kind' => 'OBJECT',
'name' => '__Type',
'ofType' => null,
],
],
],
],
'isDeprecated' => false,
'deprecationReason' => null,
],
1 => [
'name' => 'queryType',
'args' => [],
'type' => [
'kind' => 'NON_NULL',
'name' => null,
'ofType' => [
'kind' => 'OBJECT',
'name' => '__Type',
'ofType' => null,
],
],
'isDeprecated' => false,
'deprecationReason' => null,
],
[
'name' => 'mutationType',
'args' => [],
'type' => [
'kind' => 'OBJECT',
'name' => '__Type',
'ofType' => null,
],
'isDeprecated' => false,
'deprecationReason' => null,
],
[
'name' => 'subscriptionType',
'args' => [],
'type' => [
'kind' => 'OBJECT',
'name' => '__Type',
'ofType' => null,
],
'isDeprecated' => false,
'deprecationReason' => null,
],
[
'name' => 'directives',
'args' => [],
'type' => [
'kind' => 'NON_NULL',
'name' => null,
'ofType' => [
'kind' => 'LIST',
'name' => null,
'ofType' => [
'kind' => 'NON_NULL',
'name' => null,
'ofType' => [
'kind' => 'OBJECT',
'name' => '__Directive',
],
],
],
],
'isDeprecated' => false,
'deprecationReason' => null,
],
],
'inputFields' => null,
'interfaces' => [],
'enumValues' => null,
'possibleTypes' => null,
],
[
'kind' => 'OBJECT',
'name' => '__Type',
'fields' => [
0 => [
'name' => 'kind',
'args' => [],
'type' => [
'kind' => 'NON_NULL',
'name' => null,
'ofType' => [
'kind' => 'ENUM',
'name' => '__TypeKind',
],
],
'isDeprecated' => false,
'deprecationReason' => null,
],
1 => [
'name' => 'name',
'args' => [],
'type' => [
'kind' => 'SCALAR',
'name' => 'String',
],
'isDeprecated' => false,
'deprecationReason' => null,
],
2 => [
'name' => 'description',
'args' => [],
'type' => [
'kind' => 'SCALAR',
'name' => 'String',
],
'isDeprecated' => false,
'deprecationReason' => null,
],
3 => [
'name' => 'fields',
'args' => [
0 => [
'name' => 'includeDeprecated',
'type' => [
'kind' => 'SCALAR',
'name' => 'Boolean',
],
'defaultValue' => 'false',
],
],
'type' => [
'kind' => 'LIST',
'name' => null,
'ofType' => [
'kind' => 'NON_NULL',
'name' => null,
'ofType' => [
'kind' => 'OBJECT',
'name' => '__Field',
],
],
],
'isDeprecated' => false,
'deprecationReason' => null,
],
4 => [
'name' => 'interfaces',
'args' => [],
'type' => [
'kind' => 'LIST',
'name' => null,
'ofType' => [
'kind' => 'NON_NULL',
'name' => null,
'ofType' => [
'kind' => 'OBJECT',
'name' => '__Type',
'ofType' => null,
],
],
],
'isDeprecated' => false,
'deprecationReason' => null,
],
5 => [
'name' => 'possibleTypes',
'args' => [],
'type' => [
'kind' => 'LIST',
'name' => null,
'ofType' => [
'kind' => 'NON_NULL',
'name' => null,
'ofType' => [
'kind' => 'OBJECT',
'name' => '__Type',
'ofType' => null,
],
],
],
'isDeprecated' => false,
'deprecationReason' => null,
],
6 => [
'name' => 'enumValues',
'args' => [
0 => [
'name' => 'includeDeprecated',
'type' => [
'kind' => 'SCALAR',
'name' => 'Boolean',
],
'defaultValue' => 'false',
],
],
'type' => [
'kind' => 'LIST',
'name' => null,
'ofType' => [
'kind' => 'NON_NULL',
'name' => null,
'ofType' => [
'kind' => 'OBJECT',
'name' => '__EnumValue',
],
],
],
'isDeprecated' => false,
'deprecationReason' => null,
],
7 => [
'name' => 'inputFields',
'args' => [],
'type' => [
'kind' => 'LIST',
'name' => null,
'ofType' => [
'kind' => 'NON_NULL',
'name' => null,
'ofType' => [
'kind' => 'OBJECT',
'name' => '__InputValue',
'ofType' => null,
],
],
],
'isDeprecated' => false,
'deprecationReason' => null,
],
8 => [
'name' => 'ofType',
'args' => [],
'type' => [
'kind' => 'OBJECT',
'name' => '__Type',
'ofType' => null,
],
'isDeprecated' => false,
'deprecationReason' => null,
],
],
'inputFields' => null,
'interfaces' => [],
'enumValues' => null,
'possibleTypes' => null,
],
[
'kind' => 'ENUM',
'name' => '__TypeKind',
'fields' => null,
'inputFields' => null,
'interfaces' => null,
'enumValues' => [
0 => [
'name' => 'SCALAR',
'isDeprecated' => false,
'deprecationReason' => null,
],
1 => [
'name' => 'OBJECT',
'isDeprecated' => false,
'deprecationReason' => null,
],
2 => [
'name' => 'INTERFACE',
'isDeprecated' => false,
'deprecationReason' => null,
],
3 => [
'name' => 'UNION',
'isDeprecated' => false,
'deprecationReason' => null,
],
4 => [
'name' => 'ENUM',
'isDeprecated' => false,
'deprecationReason' => null,
],
5 => [
'name' => 'INPUT_OBJECT',
'isDeprecated' => false,
'deprecationReason' => null,
],
6 => [
'name' => 'LIST',
'isDeprecated' => false,
'deprecationReason' => null,
],
7 => [
'name' => 'NON_NULL',
'isDeprecated' => false,
'deprecationReason' => null,
],
],
'possibleTypes' => null,
],
[
'kind' => 'SCALAR',
'name' => 'Boolean',
'fields' => null,
'inputFields' => null,
'interfaces' => null,
'enumValues' => null,
'possibleTypes' => null,
],
[
'kind' => 'OBJECT',
'name' => '__Field',
'fields' => [
0 => [
'name' => 'name',
'args' => [],
'type' => [
'kind' => 'NON_NULL',
'name' => null,
'ofType' => [
'kind' => 'SCALAR',
'name' => 'String',
'ofType' => null,
],
],
'isDeprecated' => false,
'deprecationReason' => null,
],
1 => [
'name' => 'description',
'args' => [],
'type' => [
'kind' => 'SCALAR',
'name' => 'String',
'ofType' => null,
],
'isDeprecated' => false,
'deprecationReason' => null,
],
2 => [
'name' => 'args',
'args' => [],
'type' => [
'kind' => 'NON_NULL',
'name' => null,
'ofType' => [
'kind' => 'LIST',
'name' => null,
'ofType' => [
'kind' => 'NON_NULL',
'name' => null,
'ofType' => [
'kind' => 'OBJECT',
'name' => '__InputValue',
'ofType' => null,
],
],
],
],
'isDeprecated' => false,
'deprecationReason' => null,
],
3 => [
'name' => 'type',
'args' => [],
'type' => [
'kind' => 'NON_NULL',
'name' => null,
'ofType' => [
'kind' => 'OBJECT',
'name' => '__Type',
'ofType' => null,
],
],
'isDeprecated' => false,
'deprecationReason' => null,
],
4 => [
'name' => 'isDeprecated',
'args' => [],
'type' => [
'kind' => 'NON_NULL',
'name' => null,
'ofType' => [
'kind' => 'SCALAR',
'name' => 'Boolean',
'ofType' => null,
],
],
'isDeprecated' => false,
'deprecationReason' => null,
],
5 => [
'name' => 'deprecationReason',
'args' => [],
'type' => [
'kind' => 'SCALAR',
'name' => 'String',
'ofType' => null,
],
'isDeprecated' => false,
'deprecationReason' => null,
],
],
'inputFields' => null,
'interfaces' => [],
'enumValues' => null,
'possibleTypes' => null,
],
[
'kind' => 'OBJECT',
'name' => '__InputValue',
'fields' => [
0 => [
'name' => 'name',
'args' => [],
'type' => [
'kind' => 'NON_NULL',
'name' => null,
'ofType' => [
'kind' => 'SCALAR',
'name' => 'String',
'ofType' => null,
],
],
'isDeprecated' => false,
'deprecationReason' => null,
],
1 => [
'name' => 'description',
'args' => [],
'type' => [
'kind' => 'SCALAR',
'name' => 'String',
'ofType' => null,
],
'isDeprecated' => false,
'deprecationReason' => null,
],
2 => [
'name' => 'type',
'args' => [],
'type' => [
'kind' => 'NON_NULL',
'name' => null,
'ofType' => [
'kind' => 'OBJECT',
'name' => '__Type',
'ofType' => null,
],
],
'isDeprecated' => false,
'deprecationReason' => null,
],
3 => [
'name' => 'defaultValue',
'args' => [],
'type' => [
'kind' => 'SCALAR',
'name' => 'String',
'ofType' => null,
],
'isDeprecated' => false,
'deprecationReason' => null,
],
],
'inputFields' => null,
'interfaces' => [],
'enumValues' => null,
'possibleTypes' => null,
],
[
'kind' => 'OBJECT',
'name' => '__EnumValue',
'fields' => [
0 => [
'name' => 'name',
'args' => [],
'type' => [
'kind' => 'NON_NULL',
'name' => null,
'ofType' => [
'kind' => 'SCALAR',
'name' => 'String',
'ofType' => null,
],
],
'isDeprecated' => false,
'deprecationReason' => null,
],
1 => [
'name' => 'description',
'args' => [],
'type' => [
'kind' => 'SCALAR',
'name' => 'String',
'ofType' => null,
],
'isDeprecated' => false,
'deprecationReason' => null,
],
2 => [
'name' => 'isDeprecated',
'args' => [],
'type' => [
'kind' => 'NON_NULL',
'name' => null,
'ofType' => [
'kind' => 'SCALAR',
'name' => 'Boolean',
'ofType' => null,
],
],
'isDeprecated' => false,
'deprecationReason' => null,
],
3 => [
'name' => 'deprecationReason',
'args' => [],
'type' => [
'kind' => 'SCALAR',
'name' => 'String',
'ofType' => null,
],
'isDeprecated' => false,
'deprecationReason' => null,
],
],
'inputFields' => null,
'interfaces' => [],
'enumValues' => null,
'possibleTypes' => null,
],
[
'kind' => 'OBJECT',
'name' => '__Directive',
'fields' => [
0 => [
'name' => 'name',
'args' => [],
'type' => [
'kind' => 'NON_NULL',
'name' => null,
'ofType' => [
'kind' => 'SCALAR',
'name' => 'String',
'ofType' => null,
],
],
'isDeprecated' => false,
'deprecationReason' => null,
],
1 => [
'name' => 'description',
'args' => [],
'type' => [
'kind' => 'SCALAR',
'name' => 'String',
'ofType' => null,
],
'isDeprecated' => false,
'deprecationReason' => null,
],
2 => [
'name' => 'args',
'args' => [],
'type' => [
'kind' => 'NON_NULL',
'name' => null,
'ofType' => [
'kind' => 'LIST',
'name' => null,
'ofType' => [
'kind' => 'NON_NULL',
'name' => null,
'ofType' => [
'kind' => 'OBJECT',
'name' => '__InputValue',
'ofType' => null,
],
],
],
],
'isDeprecated' => false,
'deprecationReason' => null,
],
3 => [
'name' => 'isRepeatable',
'args' => [],
'type' => [
'kind' => 'NON_NULL',
'name' => null,
'ofType' => [
'kind' => 'SCALAR',
'name' => 'Boolean',
'ofType' => null,
],
],
'isDeprecated' => false,
'deprecationReason' => null,
],
4 => [
'name' => 'locations',
'args' => [],
'type' => [
'kind' => 'NON_NULL',
'name' => null,
'ofType' => [
'kind' => 'LIST',
'name' => null,
'ofType' => [
'kind' => 'NON_NULL',
'name' => null,
'ofType' => [
'kind' => 'ENUM',
'name' => '__DirectiveLocation',
'ofType' => null,
],
],
],
],
'isDeprecated' => false,
'deprecationReason' => null,
],
],
'inputFields' => null,
'interfaces' => [],
'enumValues' => null,
'possibleTypes' => null,
],
[
'kind' => 'ENUM',
'name' => '__DirectiveLocation',
'fields' => null,
'inputFields' => null,
'interfaces' => null,
'enumValues' => [
0 => [
'name' => 'QUERY',
'isDeprecated' => false,
'deprecationReason' => null,
],
1 => [
'name' => 'MUTATION',
'isDeprecated' => false,
'deprecationReason' => null,
],
2 => [
'name' => 'SUBSCRIPTION',
'isDeprecated' => false,
'deprecationReason' => null,
],
3 => [
'name' => 'FIELD',
'isDeprecated' => false,
'deprecationReason' => null,
],
4 => [
'name' => 'FRAGMENT_DEFINITION',
'isDeprecated' => false,
'deprecationReason' => null,
],
5 => [
'name' => 'FRAGMENT_SPREAD',
'isDeprecated' => false,
'deprecationReason' => null,
],
6 => [
'name' => 'INLINE_FRAGMENT',
'isDeprecated' => false,
'deprecationReason' => null,
],
7 => [
'name' => 'VARIABLE_DEFINITION',
'isDeprecated' => false,
'deprecationReason' => null,
],
[
'name' => 'SCHEMA',
'isDeprecated' => false,
'deprecationReason' => null,
],
[
'name' => 'SCALAR',
'isDeprecated' => false,
'deprecationReason' => null,
],
[
'name' => 'OBJECT',
'isDeprecated' => false,
'deprecationReason' => null,
],
[
'name' => 'FIELD_DEFINITION',
'isDeprecated' => false,
'deprecationReason' => null,
],
[
'name' => 'ARGUMENT_DEFINITION',
'isDeprecated' => false,
'deprecationReason' => null,
],
[
'name' => 'INTERFACE',
'isDeprecated' => false,
'deprecationReason' => null,
],
[
'name' => 'UNION',
'isDeprecated' => false,
'deprecationReason' => null,
],
[
'name' => 'ENUM',
'isDeprecated' => false,
'deprecationReason' => null,
],
[
'name' => 'ENUM_VALUE',
'isDeprecated' => false,
'deprecationReason' => null,
],
[
'name' => 'INPUT_OBJECT',
'isDeprecated' => false,
'deprecationReason' => null,
],
[
'name' => 'INPUT_FIELD_DEFINITION',
'isDeprecated' => false,
'deprecationReason' => null,
],
],
'possibleTypes' => null,
],
],
'directives' => [
0 => [
'name' => 'include',
'isRepeatable' => false,
'args' => [
0 => [
'defaultValue' => null,
'name' => 'if',
'type' => [
'kind' => 'NON_NULL',
'name' => null,
'ofType' => [
'kind' => 'SCALAR',
'name' => 'Boolean',
'ofType' => null,
],
],
],
],
'locations' => [
0 => 'FIELD',
1 => 'FRAGMENT_SPREAD',
2 => 'INLINE_FRAGMENT',
],
],
1 => [
'name' => 'skip',
'isRepeatable' => false,
'args' => [
0 => [
'defaultValue' => null,
'name' => 'if',
'type' => [
'kind' => 'NON_NULL',
'name' => null,
'ofType' => [
'kind' => 'SCALAR',
'name' => 'Boolean',
'ofType' => null,
],
],
],
],
'locations' => [
0 => 'FIELD',
1 => 'FRAGMENT_SPREAD',
2 => 'INLINE_FRAGMENT',
],
],
2 => [
'name' => 'deprecated',
'isRepeatable' => false,
'args' => [
0 => [
'defaultValue' => '"No longer supported"',
'name' => 'reason',
'type' => [
'kind' => 'SCALAR',
'name' => 'String',
'ofType' => null,
],
],
],
'locations' => [
0 => 'FIELD_DEFINITION',
1 => 'ENUM_VALUE',
],
],
],
],
],
];
$actual = GraphQL::executeQuery($emptySchema, $request)->toArray();
// self::assertEquals($expected, $actual);
self::assertArraySubset($expected, $actual);
}
/**
* @see it('introspects on input object')
*/
public function testIntrospectsOnInputObject(): void
{
$TestInputObject = new InputObjectType([
'name' => 'TestInputObject',
'fields' => [
'a' => ['type' => Type::string(), 'defaultValue' => "tes\t de\fault"],
'b' => ['type' => Type::listOf(Type::string())],
'c' => ['type' => Type::string(), 'defaultValue' => null],
],
]);
$TestType = new ObjectType([
'name' => 'TestType',
'fields' => [
'field' => [
'type' => Type::string(),
'args' => ['complex' => ['type' => $TestInputObject]],
'resolve' => static function ($testType, $args) {
return json_encode($args['complex']);
},
],
],
]);
$schema = new Schema(['query' => $TestType]);
$request = '
{
__type(name: "TestInputObject") {
kind
name
inputFields {
name
type { ...TypeRef }
defaultValue
}
}
}
fragment TypeRef on __Type {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
}
}
}
}
';
$expectedFragment = [
'kind' => 'INPUT_OBJECT',
'name' => 'TestInputObject',
'inputFields' => [
[
'name' => 'a',
'type' => [
'kind' => 'SCALAR',
'name' => 'String',
'ofType' => null,
],
'defaultValue' => '"tes\t de\fault"',
],
[
'name' => 'b',
'type' => [
'kind' => 'LIST',
'name' => null,
'ofType' => [
'kind' => 'SCALAR',
'name' => 'String',
'ofType' => null,
],
],
'defaultValue' => null,
],
[
'name' => 'c',
'type' => [
'kind' => 'SCALAR',
'name' => 'String',
'ofType' => null,
],
'defaultValue' => 'null', // defaultValue was set (even if it was set to null)
],
],
];
$result = GraphQL::executeQuery($schema, $request)->toArray();
self::assertEquals($expectedFragment, $result['data']['__type'] ?? null);
}
/**
* @see it('supports the __type root field')
*/
public function testSupportsTheTypeRootField(): void
{
$TestType = new ObjectType([
'name' => 'TestType',
'fields' => [
'testField' => [
'type' => Type::string(),
],
],
]);
$schema = new Schema(['query' => $TestType]);
$request = '
{
__type(name: "TestType") {
name
}
}
';
$expected = [
'data' => [
'__type' => ['name' => 'TestType'],
],
];
self::assertEquals($expected, GraphQL::executeQuery($schema, $request)->toArray());
}
/**
* @see it('identifies deprecated fields')
*/
public function testIdentifiesDeprecatedFields(): void
{
$TestType = new ObjectType([
'name' => 'TestType',
'fields' => [
'nonDeprecated' => [
'type' => Type::string(),
],
'deprecated' => [
'type' => Type::string(),
'deprecationReason' => 'Removed in 1.0',
],
],
]);
$schema = new Schema(['query' => $TestType]);
$request = '
{
__type(name: "TestType") {
name
fields(includeDeprecated: true) {
name
isDeprecated,
deprecationReason
}
}
}
';
$expected = [
'data' => [
'__type' => [
'name' => 'TestType',
'fields' => [
[
'name' => 'nonDeprecated',
'isDeprecated' => false,
'deprecationReason' => null,
],
[
'name' => 'deprecated',
'isDeprecated' => true,
'deprecationReason' => 'Removed in 1.0',
],
],
],
],
];
self::assertEquals($expected, GraphQL::executeQuery($schema, $request)->toArray());
}
/**
* @see it('respects the includeDeprecated parameter for fields')
*/
public function testRespectsTheIncludeDeprecatedParameterForFields(): void
{
$TestType = new ObjectType([
'name' => 'TestType',
'fields' => [
'nonDeprecated' => [
'type' => Type::string(),
],
'deprecated' => [
'type' => Type::string(),
'deprecationReason' => 'Removed in 1.0',
],
],
]);
$schema = new Schema(['query' => $TestType]);
$request = '
{
__type(name: "TestType") {
name
trueFields: fields(includeDeprecated: true) {
name
}
falseFields: fields(includeDeprecated: false) {
name
}
omittedFields: fields {
name
}
}
}
';
$expected = [
'data' => [
'__type' => [
'name' => 'TestType',
'trueFields' => [
['name' => 'nonDeprecated'],
['name' => 'deprecated'],
],
'falseFields' => [
['name' => 'nonDeprecated'],
],
'omittedFields' => [
['name' => 'nonDeprecated'],
],
],
],
];
self::assertEquals($expected, GraphQL::executeQuery($schema, $request)->toArray());
}
/**
* @see it('identifies deprecated enum values')
*/
public function testIdentifiesDeprecatedEnumValues(): void
{
$TestEnum = new EnumType([
'name' => 'TestEnum',
'values' => [
'NONDEPRECATED' => ['value' => 0],
'DEPRECATED' => ['value' => 1, 'deprecationReason' => 'Removed in 1.0'],
'ALSONONDEPRECATED' => ['value' => 2],
],
]);
$TestType = new ObjectType([
'name' => 'TestType',
'fields' => [
'testEnum' => ['type' => $TestEnum],
],
]);
$schema = new Schema(['query' => $TestType]);
$request = '
{
__type(name: "TestEnum") {
name
enumValues(includeDeprecated: true) {
name
isDeprecated,
deprecationReason
}
}
}
';
$expected = [
'data' => [
'__type' => [
'name' => 'TestEnum',
'enumValues' => [
[
'name' => 'NONDEPRECATED',
'isDeprecated' => false,
'deprecationReason' => null,
],
[
'name' => 'DEPRECATED',
'isDeprecated' => true,
'deprecationReason' => 'Removed in 1.0',
],
[
'name' => 'ALSONONDEPRECATED',
'isDeprecated' => false,
'deprecationReason' => null,
],
],
],
],
];
self::assertEquals($expected, GraphQL::executeQuery($schema, $request)->toArray());
}
/**
* @see it('respects the includeDeprecated parameter for enum values')
*/
public function testRespectsTheIncludeDeprecatedParameterForEnumValues(): void
{
$TestEnum = new EnumType([
'name' => 'TestEnum',
'values' => [
'NONDEPRECATED' => ['value' => 0],
'DEPRECATED' => ['value' => 1, 'deprecationReason' => 'Removed in 1.0'],
'ALSONONDEPRECATED' => ['value' => 2],
],
]);
$TestType = new ObjectType([
'name' => 'TestType',
'fields' => [
'testEnum' => ['type' => $TestEnum],
],
]);
$schema = new Schema(['query' => $TestType]);
$request = '
{
__type(name: "TestEnum") {
name
trueValues: enumValues(includeDeprecated: true) {
name
}
falseValues: enumValues(includeDeprecated: false) {
name
}
omittedValues: enumValues {
name
}
}
}
';
$expected = [
'data' => [
'__type' => [
'name' => 'TestEnum',
'trueValues' => [
['name' => 'NONDEPRECATED'],
['name' => 'DEPRECATED'],
['name' => 'ALSONONDEPRECATED'],
],
'falseValues' => [
['name' => 'NONDEPRECATED'],
['name' => 'ALSONONDEPRECATED'],
],
'omittedValues' => [
['name' => 'NONDEPRECATED'],
['name' => 'ALSONONDEPRECATED'],
],
],
],
];
self::assertEquals($expected, GraphQL::executeQuery($schema, $request)->toArray());
}
/**
* @see it('fails as expected on the __type root field without an arg')
*/
public function testFailsAsExpectedOnTheTypeRootFieldWithoutAnArg(): void
{
$TestType = new ObjectType([
'name' => 'TestType',
'fields' => [
'testField' => [
'type' => Type::string(),
],
],
]);
$schema = new Schema(['query' => $TestType]);
$request = '
{
__type {
name
}
}
';
$expected = [
'errors' => [
ErrorHelper::create(
ProvidedRequiredArguments::missingFieldArgMessage('__type', 'name', 'String!'),
[new SourceLocation(3, 9)]
),
],
];
self::assertArraySubset($expected, GraphQL::executeQuery($schema, $request)->toArray());
}
/**
* @see it('exposes descriptions on types and fields')
*/
public function testExposesDescriptionsOnTypesAndFields(): void
{
$QueryRoot = new ObjectType([
'name' => 'QueryRoot',
'fields' => ['a' => Type::string()],
]);
$schema = new Schema(['query' => $QueryRoot]);
$request = '
{
schemaType: __type(name: "__Schema") {
name,
description,
fields {
name,
description
}
}
}
';
$expected = [
'data' => [
'schemaType' => [
'name' => '__Schema',
'description' => 'A GraphQL Schema defines the capabilities of a '
. 'GraphQL server. It exposes all available types and '
. 'directives on the server, as well as the entry '
. 'points for query, mutation, and subscription operations.',
'fields' => [
[
'name' => 'types',
'description' => 'A list of all types supported by this server.',
],
[
'name' => 'queryType',
'description' => 'The type that query operations will be rooted at.',
],
[
'name' => 'mutationType',
'description' => 'If this server supports mutation, the type that '
. 'mutation operations will be rooted at.',
],
[
'name' => 'subscriptionType',
'description' => 'If this server support subscription, the type that subscription operations will be rooted at.',
],
[
'name' => 'directives',
'description' => 'A list of all directives supported by this server.',
],
],
],
],
];
self::assertEquals($expected, GraphQL::executeQuery($schema, $request)->toArray());
}
/**
* @see it('exposes descriptions on enums')
*/
public function testExposesDescriptionsOnEnums(): void
{
$QueryRoot = new ObjectType([
'name' => 'QueryRoot',
'fields' => ['a' => Type::string()],
]);
$schema = new Schema(['query' => $QueryRoot]);
$request = '
{
typeKindType: __type(name: "__TypeKind") {
name,
description,
enumValues {
name,
description
}
}
}
';
$expected = [
'data' => [
'typeKindType' => [
'name' => '__TypeKind',
'description' => 'An enum describing what kind of type a given `__Type` is.',
'enumValues' => [
[
'description' => 'Indicates this type is a scalar.',
'name' => 'SCALAR',
],
[
'description' => 'Indicates this type is an object. '
. '`fields` and `interfaces` are valid fields.',
'name' => 'OBJECT',
],
[
'description' => 'Indicates this type is an interface. '
. '`fields`, `interfaces`, and `possibleTypes` are valid fields.',
'name' => 'INTERFACE',
],
[
'description' => 'Indicates this type is a union. '
. '`possibleTypes` is a valid field.',
'name' => 'UNION',
],
[
'description' => 'Indicates this type is an enum. '
. '`enumValues` is a valid field.',
'name' => 'ENUM',
],
[
'description' => 'Indicates this type is an input object. '
. '`inputFields` is a valid field.',
'name' => 'INPUT_OBJECT',
],
[
'description' => 'Indicates this type is a list. '
. '`ofType` is a valid field.',
'name' => 'LIST',
],
[
'description' => 'Indicates this type is a non-null. '
. '`ofType` is a valid field.',
'name' => 'NON_NULL',
],
],
],
],
];
self::assertEquals($expected, GraphQL::executeQuery($schema, $request)->toArray());
}
/**
* @see it('executes an introspection query without calling global fieldResolver')
*/
public function testExecutesAnIntrospectionQueryWithoutCallingGlobalFieldResolver(): void
{
$QueryRoot = new ObjectType([
'name' => 'QueryRoot',
'fields' => [
'onlyField' => ['type' => Type::string()],
],
]);
$schema = new Schema(['query' => $QueryRoot]);
$source = Introspection::getIntrospectionQuery(['directiveIsRepeatable' => true]);
$calledForFields = [];
$fieldResolver = static function ($value, array $_1, $_2, ResolveInfo $info) use (&$calledForFields) {
$calledForFields["{$info->parentType->name}::{$info->fieldName}"] = true;
return $value;
};
GraphQL::executeQuery($schema, $source, null, null, null, null, $fieldResolver);
self::assertEmpty($calledForFields);
}
}
| webonyx/graphql-php | tests/Type/IntrospectionTest.php | PHP | mit | 63,326 |
'use strict';
/**
* Module dependencies.
*/
var mongoose = require('mongoose'),
errorHandler = require('./errors.server.controller'),
Coach = mongoose.model('Coach'),
_ = require('lodash');
/**
* Create a Coach
*/
exports.create = function (req, res) {
var coach = new Coach(req.body);
coach.user = req.user;
coach.save(function (err) {
if (err) {
return res.status(400).send({
message: errorHandler.getErrorMessage(err)
});
} else {
res.jsonp(coach);
}
});
};
/**
* Show the current Coach
*/
exports.read = function (req, res) {
res.jsonp(req.coach);
};
/**
* Update a Coach
*/
exports.update = function (req, res) {
var coach = req.coach;
coach = _.extend(coach, req.body);
coach.save(function (err) {
if (err) {
return res.status(400).send({
message: errorHandler.getErrorMessage(err)
});
} else {
res.jsonp(coach);
}
});
};
/**
* Delete an Coach
*/
exports.delete = function (req, res) {
var coach = req.coach;
coach.remove(function (err) {
if (err) {
return res.status(400).send({
message: errorHandler.getErrorMessage(err)
});
} else {
res.jsonp(coach);
}
});
};
/**
* List of Coaches
*/
exports.list = function (req, res) {
Coach.find().sort('-created').populate('user', 'displayName').exec(function (err, coaches) {
if (err) {
return res.status(400).send({
message: errorHandler.getErrorMessage(err)
});
} else {
res.jsonp(coaches);
}
});
};
/**
* Coach middleware
*/
exports.coachByID = function (req, res, next, id) {
Coach.findById(id).populate('user', 'displayName').exec(function (err, coach) {
if (err) {
return next(err);
}
if (!coach) {
return next(new Error('Failed to load Coach ' + id));
}
req.coach = coach;
next();
});
};
/**
* Coach authorization middleware
*/
exports.hasAuthorization = function (req, res, next) {
if (req.coach.user.id !== req.user.id) {
return res.status(403).send('User is not authorized');
}
next();
};
| pashashow/INDSA | app/controllers/coaches.server.controller.js | JavaScript | mit | 2,023 |
var BookAppointmentApi;
;(function($) {
$.BookAppointmentView = function(p) {
p = $.extend
({
serviceModulePath: '',
appointmentSuccessPage: ''
}, p);
function AspxCommonObj() {
var aspxCommonObj = {
StoreID: AspxCommerce.utils.GetStoreID(),
PortalID: AspxCommerce.utils.GetPortalID(),
CultureName: AspxCommerce.utils.GetCultureName(),
UserName: AspxCommerce.utils.GetUserName()
};
return aspxCommonObj;
};
var serviceDateID = 0;
var BookAppointment = function() {
var aspxCommonObj = {
StoreID: AspxCommerce.utils.GetStoreID(),
PortalID: AspxCommerce.utils.GetPortalID(),
CultureName: AspxCommerce.utils.GetCultureName(),
UserName: AspxCommerce.utils.GetUserName()
};
var servicePath = p.serviceModulePath + "ServiceHandler.ashx/";
var $ajaxCall = function(url, method, param, successFx, errorFnx) {
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
async: false,
url: url + method,
data: param,
success: successFx,
error: errorFnx
});
};
var userValue = {
itemType: 'servicetype',
gatewayName: '',
paymentMethodId: 0,
paymentMethodName: "",
paymentMethodCode: "",
paymentFriendlyName: "",
sessionValue: '',
productItemID: 0
};
var loadPaymentGateway = function(data) {
if (data.d.startsWith('System.Web.HttpException')) {
csscody.alert("<h2>" + getLocale(AspxServiceLocale, "Information Alert") + "</h2><p>" + getLocale(AspxServiceLocale, "Sorry Failed to load payment gateway.") + "</p>");
$("#btnPaymentInfoContinue").prop("disabled", "disabled");
return false;
} else {
var dvList = $("<div>" + data.d + "</div>");
if (dvList.find('div').length > 0) {
var button = dvList.find('input:last');
dvList.find('input:last').remove();
$('#dvPaymentInfo input[type="button"]').remove();
$('#dvPaymentInfo').find('div').not('.sfButtonwrapper').not('.cssClassClear').not('#dvPGList').not('.cssClassPaymentList').remove();
$('#dvPaymentInfo .sfButtonwrapper').before(dvList);
$('#dvPaymentInfo input[type="button"]').remove();
$('#dvPlaceOrder .sfButtonwrapper ').find('input').not("#btnPlaceBack").remove();
$('#dvPlaceOrder .sfButtonwrapper div ').remove();
} else {
$('#dvPaymentInfo').find('div').not('.sfButtonwrapper').not('.cssClassClear').not('#dvPGList').not('.cssClassPaymentList').remove();
$('#dvPlaceOrder .sfButtonwrapper ').find('input').not("#btnPlaceBack").remove();
$('#dvPlaceOrder .sfButtonwrapper ').find('div').remove();
}
}
};
var getSessionValue = function(data) {
userValue.sessionValue = parseFloat(data.d);
};
var setSessionValue = function(sessionKey, sessionValue) {
var url = AspxCommerce.utils.GetAspxServicePath() + "AspxCoreHandler.ashx/";
var param =JSON2.stringify({ key: sessionKey, value: sessionValue });
$ajaxCall(url, "SetSessionVariable", param, getSessionValue, null);
};
var loadControl = function(ControlName, Name) {
userValue.gatewayName = Name;
var yy = AspxCommerce.utils.GetAspxServicePath();
var url = yy + "LoadControlHandler.aspx/Result";
var param = "{ controlName:'" + AspxCommerce.utils.GetAspxRootPath() + ControlName + "'}";
$ajaxCall(url, "", param, loadPaymentGateway, getPaymentGateWayLoadErrorMsg);
};
var getPaymentGateWayLoadErrorMsg = function() {
};
var bindPaymentGateWayList = function(data) {
if (data.d.length > 0) {
$.each(data.d, function(index, item) {
if (item.PaymentGatewayTypeID == 1 || item.PaymentGatewayTypeID == 2) {
$('#dvPGList').append('<input id="rdb' + item.PaymentGatewayTypeName + '" name="PGLIST" type="radio" realname="' + item.PaymentGatewayTypeName + '" friendlyname="' + item.FriendlyName + '" source="' + item.ControlSource + '" value="' + item.PaymentGatewayTypeID + '" class="cssClassRadioBtn" /><b><label> ' + item.PaymentGatewayTypeName + '</label></b>');
}
});
$('#dvPGList input[name="PGLIST"]:first').prop("checked", "checked");
$('#dvPGList input[name="PGLIST"]').bind("click", function () {
BookAppointment.setSessionValue("Gateway", $(this).attr('value'));
BookAppointment.setSessionValue("ServiceType", true);
BookAppointment.setSessionValue("PaymentMethodName", $(this).attr('friendlyname'));
if ('paypal' == $(this).attr('friendlyname').toLowerCase()) {
userValue.paymentMethodCode = "Paypal";
userValue.paymentMethodName = "Paypal";
} else {
}
loadControl($(this).attr('source'), $.trim($(this).attr('friendlyname')));
userValue.paymentMethodName = $(this).next('b').find('label').html();
userValue.paymentFriendlyName = $(this).attr('friendlyname');
userValue.paymentMethodId = $(this).attr('value');
});
$('#dvPGList input[name="PGLIST"]:first').trigger('click');
}
};
var loadPGatewayList = function() {
var aspxCommonInfo = AspxCommonObj();
aspxCommonInfo.UserName = null;
var url = aspxservicePath + "AspxCoreHandler.ashx/";
var param = JSON2.stringify({ aspxCommonObj: aspxCommonInfo });
$ajaxCall(url, "GetPGList", param, bindPaymentGateWayList, null);
};
var bindStoreLocation = function(data) {
$("#ddlStoreLocation").html('');
var storeLocation = "";
if (data.d.length > 0) {
storeLocation = "<option value='0'> --- </option>";
$.each(data.d, function(index, value) {
storeLocation += "<option value=" + value.LocationID + ">" + value.StoreName + "</option>";
});
} else {
storeLocation += "<option value='0'>" + getLocale(AspxServiceLocale, "No Store Available") + "</option>";
}
$("#ddlStoreLocation").append(storeLocation);
};
var getStoreLocation = function(serviceCategoryId) {
var commonInfo = AspxCommonObj();
commonInfo.UserName = null;
commonInfo.CultureName = null;
var url = servicePath;
var param = JSON2.stringify({ aspxCommonObj: commonInfo, serviceCategoryId: serviceCategoryId });
$ajaxCall(url, "GetAllStoresForService", param, bindStoreLocation, null);
};
var bindAllServices = function(data) {
$("#ddlServices").html('');
var serviceName = "<option value='0'> --- </option>";
$.each(data.d, function(index, value) {
serviceName += "<option value=" + value.ServiceCategoryID + ">" + value.ServiceName + "</option>";
});
$("#ddlServices").append(serviceName);
var catId = 0;
var prodtId = 0;
if (window.location.search.substring(1) != '') {
catId = BookAppointment.GetQueryStringParams('cid');
prodtId = BookAppointment.GetQueryStringParams('pid');
$('#ddlServices').val(catId);
$('#ddlServices').trigger('change');
$("#ddlServiceProducts").val(prodtId);
$("#ddlServiceProducts").trigger('change');
$('#ddlServices').prop('disabled', 'disabled');
$("#ddlServiceProducts").prop('disabled', 'disabled');
$('#ddlServices').addClass('cssDisable');
$("#ddlServiceProducts").addClass('cssDisable');
} else {
$('#ddlServices').removeAttr('disabled');
$('#ddlServiceProducts').removeAttr('disabled');
}
};
var getAllServices = function() {
var url = servicePath;
var param = JSON2.stringify({ aspxCommonObj: aspxCommonObj });
$ajaxCall(url, "GetAllServices", param, bindAllServices, null);
};
var bindServiceProducts = function(data) {
$("#ddlServiceProducts").html('');
var serviceProducts = '';
if (data.d.length > 0) {
serviceProducts = "<option value='0'> --- </option>";
$.each(data.d, function(index, value) {
serviceProducts += "<option value=" + value.ItemID + " price=" + value.Price + " duration=" + value.ServiceDuration + ">" + value.ItemName + "</option>";
});
} else {
serviceProducts += "<option value='0'>" + getLocale(AspxServiceLocale, "No Products Available") + "</option>";
}
$("#ddlServiceProducts").append(serviceProducts);
$('.cssServiceProductsPrice,.cssServiceProductDuration').hide();
$('#serviceProductPrice').prop('disabled', 'disabled');
$('#serviceProductPrice').addClass('cssDisable');
};
var getServiceProducts = function(serviceId) {
var commonInfo = AspxCommonObj();
var url = servicePath;
var param = JSON2.stringify({ serviceId: serviceId, aspxCommonObj: commonInfo });
$ajaxCall(url, "GetServiceProducts", param, bindServiceProducts, null);
};
function parseJsonDate(jsonDate, id) {
var dateArr = [];
var jsonServiceDate = jsonDate;
var serviceDate = new Date(parseInt(jsonServiceDate.replace("/Date(", '').replace(")/", ''), 10));
var yearFrom = parseInt(serviceDate.getFullYear());
dateArr.push(yearFrom);
var monthFrom = parseInt((1 + serviceDate.getMonth()));
dateArr.push(monthFrom);
var daysFrom = parseInt(serviceDate.getDate());
dateArr.push(daysFrom);
dateArr.push(id);
return dateArr;
}
var calucatedays = function(serviceDateFrom, serviceDateTo) {
var x = serviceDateFrom;
var y = serviceDateTo;
var z = (y - x) / (1000 * 60 * 60 * 24);
return z;
}
var bindServiceDates = function(data) {
var dates = [];
if (data.d.length > 0) {
$.each(data.d, function(index, value) {
if (index == 0) {
if (value.ServiceDateFrom != null && value.ServiceDateTo != null) {
var dateFrom = [];
var serviceDateFrm = value.ServiceDateFrom;
var serviceDateFrom = new Date(parseInt(serviceDateFrm.replace("/Date(", '').replace(")/", ''), 10));
var yearFrom = parseInt(serviceDateFrom.getFullYear());
dateFrom.push(yearFrom);
var monthFrom = parseInt((1 + serviceDateFrom.getMonth()));
dateFrom.push(monthFrom);
var daysFrom = parseInt(serviceDateFrom.getDate());
dateFrom.push(daysFrom);
dateFrom.push(value.ServiceDateID);
dates.push(dateFrom);
var dateTo = [];
var serviceDate2 = value.ServiceDateTo;
var serviceDateTo = new Date(parseInt(serviceDate2.replace("/Date(", '').replace(")/", ''), 10));
var yearTo = parseInt(serviceDateTo.getFullYear());
dateTo.push(yearTo);
var monthTo = parseInt((1 + serviceDateTo.getMonth()));
dateTo.push(monthTo);
var daysTo = parseInt(serviceDateTo.getDate());
dateTo.push(daysTo);
dateTo.push(value.ServiceDateID);
dates.push(dateTo);
var daycount = calucatedays(serviceDateFrom, serviceDateTo);
for (var i = 0; i < Math.abs(daycount); i++) {
var dateRange = [];
var dateRangeFrm = value.ServiceDateFrom;
var dateRangeFrom = new Date(parseInt(dateRangeFrm.replace("/Date(", '').replace(")/", ''), 10));
dateRangeFrom.setDate(dateRangeFrom.getDate() + i);
var dateRangeyearFrom = parseInt(dateRangeFrom.getFullYear());
dateRange.push(dateRangeyearFrom);
var dateRangemonthFrom = parseInt((1 + dateRangeFrom.getMonth()));
dateRange.push(dateRangemonthFrom);
var dateRangedaysFrom = parseInt(dateRangeFrom.getDate());
dateRange.push(dateRangedaysFrom);
dateRange.push(value.ServiceDateID);
dates.push(dateRange);
}
} else if (value.ServiceDateFrom == null || value.ServiceDateTo == null) {
if (value.ServiceDateFrom != null) {
dates.push(parseJsonDate(value.ServiceDateFrom, value.ServiceDateID));
}
if (value.ServiceDateTo != null) {
dates.push(parseJsonDate(value.ServiceDateTo, value.ServiceDateID));
}
}
} else {
if (value.ServiceDateFrom != null && value.ServiceDateTo != null) {
var dateFromIndex = [];
var serviceDateFrmIndex = value.ServiceDateFrom;
var serviceDateFromIndex = new Date(parseInt(serviceDateFrmIndex.replace("/Date(", '').replace(")/", ''), 10));
var yearFromIndex = parseInt(serviceDateFromIndex.getFullYear());
dateFromIndex.push(yearFromIndex);
var monthFromIndex = parseInt((1 + serviceDateFromIndex.getMonth()));
dateFromIndex.push(monthFromIndex);
var daysFromIndex = parseInt(serviceDateFromIndex.getDate());
dateFromIndex.push(daysFromIndex);
dateFromIndex.push(value.ServiceDateID);
for (var a = 0; a < dates.length; a++) {
if (dates[a][0] == dateFromIndex[0] && dates[a][1] == dateFromIndex[1] && dates[a][2] == dateFromIndex[2]) {
var xx = dates[a][3] + '-' + dateFromIndex[3];
dates[a][3] = xx;
}
}
dates.push(dateFromIndex);
var dateToIndex = [];
var serviceDate2Index = value.ServiceDateTo;
var serviceDateToIndex = new Date(parseInt(serviceDate2Index.replace("/Date(", '').replace(")/", ''), 10));
var yearToIndex = parseInt(serviceDateToIndex.getFullYear());
dateToIndex.push(yearToIndex);
var monthToIndex = parseInt((1 + serviceDateToIndex.getMonth()));
dateToIndex.push(monthToIndex);
var daysToIndex = parseInt(serviceDateToIndex.getDate());
dateToIndex.push(daysToIndex);
dateToIndex.push(value.ServiceDateID);
for (var b = 0; b < dates.length; b++) {
if (dates[b][0] == dateToIndex[0] && dates[b][1] == dateToIndex[1] && dates[b][2] == dateToIndex[2]) {
var yy = dates[b][3] + '-' + dateToIndex[3];
dates[b][3] = yy;
}
}
dates.push(dateToIndex);
for (var ii = 1; ii < Math.abs(daysToIndex - daysFromIndex) ; ii++) {
var dateRangeIndex = [];
var dateRangeFrmIndex = value.ServiceDateFrom;
var dateRangeFromIndex = new Date(parseInt(dateRangeFrmIndex.replace("/Date(", '').replace(")/", ''), 10));
var dateRangeyearFromIndex = parseInt(dateRangeFromIndex.getFullYear());
dateRangeIndex.push(dateRangeyearFromIndex);
var dateRangemonthFromIndex = parseInt((1 + dateRangeFromIndex.getMonth()));
dateRangeIndex.push(dateRangemonthFromIndex);
var dateRangedaysFromIndex = parseInt(dateRangeFromIndex.getDate());
dateRangeIndex.push(dateRangedaysFromIndex + ii);
dateRangeIndex.push(value.ServiceDateID);
for (var c = 0; c < dates.length; c++) {
if (dates[c][0] == dateRangeIndex[0] && dates[c][1] == dateRangeIndex[1] && dates[c][2] == dateRangeIndex[2]) {
var zz = dates[c][3] + '-' + dateRangeIndex[3];
dates[c][3] = zz;
}
}
dates.push(dateRangeIndex);
}
} else if (value.ServiceDateFrom == null || value.ServiceDateTo == null) {
if (value.ServiceDateFrom != null) {
dates.push(parseJsonDate(value.ServiceDateFrom, value.ServiceDateID));
}
if (value.ServiceDateTo != null) {
dates.push(parseJsonDate(value.ServiceDateTo, value.ServiceDateID));
}
}
}
});
$('#txtAvailableDate').removeClass('hasDatepicker').datepicker(
{
dateFormat: 'mm/dd/yy',
changeMonth: true,
changeYear: true,
minDate: 0,
beforeShowDay: function(date) {
var year = date.getFullYear();
var month = date.getMonth();
var day = date.getDate();
for (var i = 0; i < dates.length; i++) {
if (year == dates[i][0] && month == dates[i][1] - 1 && day == dates[i][2]) {
serviceDateID = dates[i][3];
return [true, 'ui-state-highlight ui-state-active'];
}
}
return [false];
},
onSelect: function(date) {
var dateVal = date.split('/');
var datevalue = 0;
if (dateVal[1].legth == 1) {
datevalue = '0' + dateVal[1];
} else {
datevalue = dateVal[1];
}
BookAppointment.GetServiceAvailableTime();
$("#lblAvailableDateError").hide();
}
});
} else {
$('#txtAvailableDate').removeClass('hasDatepicker').datepicker(
{
dateFormat: 'mm/dd/yy',
changeMonth: true,
changeYear: true,
minDate: 0,
beforeShowDay: function(date) {
var year = date.getFullYear(), month = date.getMonth(), day = date.getDate();
for (var i = 0; i < dates.length; i++)
if (year == dates[i][0] && month == dates[i][1] - 1 && day == dates[i][2]) {
return [true, 'ui-state-highlight ui-state-active'];
}
return [false];
},
onSelect: function(date) {
var dateVal = date.split('/');
var datevalue = 0;
if (dateVal[1].legth == 1) {
datevalue = '0' + dateVal[1];
} else {
datevalue = dateVal[1];
}
$('.ui-datepicker-calendar > tbody tr').each(function() {
$(this).find('td a').each(function() {
if (parseInt($(this).html()) == datevalue) {
serviceDateID = $(this).parent('td:eq(0)').attr('title');
}
});
});
BookAppointment.GetServiceAvailableTime();
$("#lblAvailableDateError").hide();
}
});
}
};
var getServicesDates = function(serviceId, branchId, empId) {
var commonInfo = AspxCommonObj();
commonInfo.UserName = null;
var getServiceDateInfo = {
ServiceID: serviceId,
BranchID: branchId,
EmployeeID: empId
};
var url = servicePath;
var param = JSON2.stringify({ getServiceDateObj: getServiceDateInfo, aspxCommonObj: commonInfo });
$ajaxCall(url, "GetServiceDates", param, bindServiceDates, null);
};
var getServiceAvailableTime = function() {
var commonInfo = AspxCommonObj();
commonInfo.UserName = null;
var getServiceAvailbalbeTimeObj = {
CategoryID: $.trim($('#ddlServices').val()),
BranchID: $.trim($('#ddlStoreLocation').val()),
EmployeeID: $('#ddlStoreServiceProviders option:selected').val(),
ServiceDateID: serviceDateID,
ServiceDate: $.trim($('#txtAvailableDate').val()),
ItemID: $('#ddlServiceProducts option:selected').val()
};
var url = servicePath;
var param = JSON2.stringify({ getServiceTimeObj: getServiceAvailbalbeTimeObj, aspxCommonObj: commonInfo });
$ajaxCall(url, "GetServiceAvailableTime", param, bindServiceTime, errorServiceTime);
};
var errorServiceTime = function() {
$('.cssClassUlTimeList').html('').html('<li>' + getLocale(AspxServiceLocale, "Time is not allocated!") + '</li>');
};
var bindServiceTime = function(data) {
if (data.d.length > 0) {
var serviceTimeHeader = '';
var serviceTime = '';
serviceTimeHeader += '<li class="cssServiceTime"><label class="cssClassHeaderTimeFrom cssClassLabel">' + getLocale(AspxServiceLocale, "From") + '</label> <label class="cssClassHeaderTimeTo cssClassLabel">' + getLocale(AspxServiceLocale, "To") + '</label></li>';
$.each(data.d, function(index, value) {
if (value.ServiceTimeFrom == '' && value.ServiceTimeTo == '') {
serviceTimeHeader = '';
serviceTimeHeader = '<li>Time is not allocated!</li>';
} else {
serviceTime += '<li class="cssServiceTime cssClassDuration_' + value.ServiceTimeID + '">';
serviceTime += '<input type="checkbox" name="chkServiceTime" value=' + value.ServiceTimeID + '>';
serviceTime += '<label class="cssClassTimeFrom"><span>' + value.ServiceTimeFrom + '</span></label>';
serviceTime += ' <label class="cssClassTimeTo"><span>' + value.ServiceTimeTo + '</span></label>';
serviceTime += '<div class="cssClassServiceDuration"><ul class="cssClassServiceDurationUl_' + value.ServiceTimeID + '">';
serviceTime += '<li class="cssClassServiceDurationLi"></li></ul></div>';
serviceTime += '</li>';
}
});
serviceTimeHeader += serviceTime;
$('.cssClassUlTimeList').html('').append(serviceTimeHeader);
$('.cssClassAvailableTime').show();
var container = $('#idServiceTimeLi');
container.find('input[name=chkServiceTime]').click(function(e) {
if (this.checked) {
container.find('input[name=chkServiceTime]').not(this).removeAttr('checked');
$("#lblTimeError").html('');
var $obj = $(this).parent('li').parent('ul');
$obj.find('.cssServiceTime').each(function() {
if ($(this).find('input[name= ]').prop('checked') == true) {
} else if ($(this).find('input[name=chkServiceTime]').prop('checked') == false) {
$(this).find('.cssClassServiceDuration .cssClassServiceDurationLi').animate({
width: ['toggle', 'swing'],
height: ['toggle', 'swing'],
opacity: 'toggle'
}, 1000);
} else {
}
});
} else {
$('.cssClassServiceDurationUl_' + $(this).val()).html('');
}
});
} else {
$('.cssClassAvailableTime').show();
$('.cssClassUlTimeList').html('').html('<li>' + getLocale(AspxServiceLocale, "Time is not allocated!") + '</li>');
}
};
var bindServiceIntervalTime = function(id, timeFrom, timeTo) {
var sD = '';
timeFrom = timeFrom.replace('AM', ' AM').replace('PM', ' PM');
var amPmFrom = timeFrom.match(/[a-z]/gi).join('');
var amPmTo = timeTo.match(/[a-z]/gi).join('');
var x1 = Date.parse("1/1/2013" + ' ' + timeFrom);
var x2 = Date.parse("1/1/2013" + ' ' + timeTo);
if (x2 > x1) {
sD = ((x2 - x1) / 1000 / 60);
} else {
alert(getLocale(AspxServiceLocale, "Valid time duration does not exist."));
return false;
}
var duration = $.trim($('#serviceProductDuration').html().replace(/[^-0-9\.]+/g, ''));
var tF = timeFrom.replace(/[^-0-9-:\.]+/g, '');
tF = tF.split(/:/);
var tT = timeTo.replace(/[^-0-9-:\.]+/g, '');
tT = tT.split(/:/);
var count = Math.floor(sD / duration);
var serviceAvailableTime = '';
var interval = [];
var tfInitial = tF[0];
var ttInitial = tT[0];
for (var i = 0; i < count; i++) {
var intervalFrom = '';
var intervalTo = '';
serviceAvailableTime += '<li class="cssClassServiceDurationLi">';
serviceAvailableTime += '<input type="checkbox" name="chkServiceTimeInterval" value=' + i + '>';
if (JSON2.stringify(duration * i).length == 1) {
intervalFrom = tF[0] + ':' + 0 + duration * i;
serviceAvailableTime += '<label class="cssClassServiceTimeFrom"><span>' + intervalFrom + ' ' + amPmFrom + '</span></label>';
} else {
if (duration * i >= 60) {
var hrs = Math.floor((duration * i) / 60);
tF[0] = parseInt(tfInitial) + hrs;
if (tF[0] >= 12) {
amPmFrom = amPmTo;
}
if (tF[0] > 12) {
tF[0] = tF[0] % 12;
}
var mins = (duration * i) % 60;
if (JSON2.stringify(mins).length == 1) {
intervalFrom = tF[0] + ':' + '0' + '0';
} else {
intervalFrom = tF[0] + ':' + mins;
}
} else {
intervalFrom = tF[0] + ':' + duration * i;
}
serviceAvailableTime += '<label class="cssClassServiceTimeFrom"><span>' + intervalFrom + ' ' + amPmFrom + '</span></label>';
}
if (duration * (i + 1) >= 60) {
var hrsT = Math.floor((duration * (i + 1)) / 60);
tF[0] = parseInt(tfInitial) + hrsT;
if (tF[0] >= 12) {
amPmFrom = amPmTo;
}
if (tF[0] > 12) {
tF[0] = tF[0] % 12;
}
var minsT = (duration * (i + 1)) % 60;
if (JSON2.stringify(minsT).length == 1) {
intervalTo = tF[0] + ':' + '0' + '0';
} else {
intervalTo = tF[0] + ':' + minsT;
}
serviceAvailableTime += ' <label class="cssClassServiceTimeTo"><span>' + intervalTo + ' ' + amPmFrom + '</span></label>';
} else {
intervalTo = tF[0] + ':' + duration * (i + 1);
serviceAvailableTime += ' <label class="cssClassServiceTimeTo"><span>' + intervalTo + ' ' + amPmFrom + '</span></label>';
}
serviceAvailableTime += '<input type="hidden" value="' + intervalFrom + ' ' + amPmFrom + '-' + intervalTo + ' ' + amPmFrom + '"/><span class="cssServiceBooked"></span></li>';
interval.push(intervalFrom + ' ' + amPmFrom + '-' + intervalTo + ' ' + amPmFrom);
}
if (serviceAvailableTime != '') {
$(".cssClassServiceDurationUl_" + id).html('').append(serviceAvailableTime);
} else {
$(".cssClassServiceDurationUl_" + id).addClass('sfIntervalNotAvailable').html(getLocale(AspxServiceLocale, 'Not Available'));
}
var timeIntervalContainer = $(".cssClassServiceDurationUl_" + id);
timeIntervalContainer.find('input[name=chkServiceTimeInterval]').click(function() {
if (this.checked) {
timeIntervalContainer.find('input[name=chkServiceTimeInterval]').not(this).removeAttr('checked');
} else {
}
});
return interval;
};
var getBookedServiceTime = function(timeId) {
var commonInfo = AspxCommonObj();
commonInfo.UserName = null;
var getServiceBookedTimeObj = {
ServiceCategoryID: $.trim($('#ddlServices').val()),
BranchID: $.trim($('#ddlStoreLocation').val()),
EmployeeID: $('#ddlStoreServiceProviders option:selected').val(),
ServiceDateID: serviceDateID,
ServiceDate: $.trim($('#txtAvailableDate').val()),
ServiceTimeID: timeId,
ItemID: $('#ddlServiceProducts option:selected').val()
};
var url = servicePath;
var param = JSON2.stringify({ bookedTimeObj: getServiceBookedTimeObj, aspxCommonObj: commonInfo });
$ajaxCall(url, "GetServiceBookedTime", param, bindServiceBookedTime, errorServiceBookedTime);
};
var bindServiceBookedTime = function(data) {
var timeFrom = '';
var timeTo = '';
var preferredTimeId = '';
$('#idServiceTimeLi li').each(function() {
if ($(this).find('input[name=chkServiceTime]').prop('checked')) {
timeFrom = $(this).find('.cssClassTimeFrom span').html();
timeTo = $(this).find('.cssClassTimeTo span').html();
preferredTimeId = $(this).find('input[name=chkServiceTime]').val();
}
});
if (data.d.length > 0) {
var intervalArr = bindServiceIntervalTime(preferredTimeId, timeFrom, timeTo);
if (intervalArr.length > 0) {
$.each(data.d, function(index, value) {
for (var i = 0; i < intervalArr.length; i++) {
var duration = parseInt($.trim($('#serviceProductDuration').html().replace(/[^-0-9\.]+/g, '')));
var bookedInterval = value.ServiceBookedInterval;
bookedInterval = bookedInterval.split('-');
var bookedIntervalF = bookedInterval[0];
var bookIff = bookedIntervalF.replace(/[^-0-9-:\.]+/g, '');
bookIff = bookIff.split(/:/);
var bookIntervalT = bookedInterval[1];
var bookItt = bookIntervalT.replace(/[^-0-9-:\.]+/g, '');
bookItt = bookItt.split(/:/);
var totalInterval = ((parseInt(bookItt[0]) - parseInt(bookIff[0])) * 60) + (parseInt(bookItt[1]) - parseInt(bookIff[1]));
if (duration < totalInterval) {
if (checkIntervalIsInDuration(intervalArr[i], value.ServiceBookedInterval, 0)) {
var $hiden1 = $('#idServiceTimeLi li').find("input:hidden[value='" + intervalArr[i] + "']");
$hiden1.parent('li:eq(0)').find("input[name=chkServiceTimeInterval]").prop('disabled', 'disabled');
$hiden1.parent('li:eq(0)').addClass('booked');
}
} else if (totalInterval == duration) {
if (intervalArr[i] == value.ServiceBookedInterval) {
var $hiden = $('#idServiceTimeLi li').find("input:hidden[value='" + intervalArr[i] + "']");
$hiden.parent('li:eq(0)').find("input[name=chkServiceTimeInterval]").prop('disabled', 'disabled');
$hiden.parent('li:eq(0)').addClass('booked');
}
} else if (duration > totalInterval) {
if (checkIntervalIsInDuration(intervalArr[i], value.ServiceBookedInterval, 1)) {
var $hiden3 = $('#idServiceTimeLi li').find("input:hidden[value='" + intervalArr[i] + "']");
$hiden3.parent('li:eq(0)').find("input[name=chkServiceTimeInterval]").prop('disabled', 'disabled');
$hiden3.parent('li:eq(0)').addClass('booked');
}
}
}
});
} else {
}
} else {
bindServiceIntervalTime(preferredTimeId, timeFrom, timeTo);
}
};
var errorServiceBookedTime = function() {
};
var checkIntervalIsInDuration = function(intervalVal, bookedInterVal, x) {
var boolval = false;
var intervalValue = intervalVal.split('-');
var intervalValueFrom = intervalValue[0].replace(/[^-0-9-:\.]+/g, '');
var intervalValueTo = intervalValue[1].replace(/[^-0-9-:\.]+/g, '');
var bookedIntervalValue = bookedInterVal.split('-');
var bookedIntervalValueFrom = bookedIntervalValue[0].replace(/[^-0-9-:\.]+/g, '');
var bookedIntervalValueTo = bookedIntervalValue[1].replace(/[^-0-9-:\.]+/g, '');
if (x == 1) {
if ((Date.parse("1/1/2013" + ' ' + intervalValueFrom) <= Date.parse("1/1/2013" + ' ' + bookedIntervalValueFrom)) &&
(Date.parse("1/1/2013" + ' ' + intervalValueFrom) <= Date.parse("1/1/2013" + ' ' + bookedIntervalValueTo)) &&
(Date.parse("1/1/2013" + ' ' + intervalValueTo) >= Date.parse("1/1/2013" + ' ' + bookedIntervalValueTo))) {
boolval = true;
} else if ((Date.parse("1/1/2013" + ' ' + intervalValueFrom) <= Date.parse("1/1/2013" + ' ' + bookedIntervalValueFrom)) &&
(Date.parse("1/1/2013" + ' ' + intervalValueTo) >= Date.parse("1/1/2013" + ' ' + bookedIntervalValueFrom))) {
boolval = true;
}
} else if (x == 0) {
if ((Date.parse("1/1/2013" + ' ' + intervalValueFrom) <= Date.parse("1/1/2013" + ' ' + bookedIntervalValueFrom)) &&
(Date.parse("1/1/2013" + ' ' + intervalValueTo) <= Date.parse("1/1/2013" + ' ' + bookedIntervalValueTo))) {
if ((Date.parse("1/1/2013" + ' ' + intervalValueFrom) <= Date.parse("1/1/2013" + ' ' + bookedIntervalValueFrom)) &&
(Date.parse("1/1/2013" + ' ' + intervalValueTo) <= Date.parse("1/1/2013" + ' ' + bookedIntervalValueFrom))) {
boolval = false;
} else {
boolval = true;
}
} else if ((Date.parse("1/1/2013" + ' ' + intervalValueFrom) >= Date.parse("1/1/2013" + ' ' + bookedIntervalValueFrom)) &&
(Date.parse("1/1/2013" + ' ' + intervalValueFrom) >= Date.parse("1/1/2013" + ' ' + bookedIntervalValueTo)) &&
(Date.parse("1/1/2013" + ' ' + intervalValueTo) >= Date.parse("1/1/2013" + ' ' + bookedIntervalValueTo))) {
boolval = false;
} else if ((Date.parse("1/1/2013" + ' ' + intervalValueFrom) >= Date.parse("1/1/2013" + ' ' + bookedIntervalValueFrom)) &&
(Date.parse("1/1/2013" + ' ' + intervalValueFrom) <= Date.parse("1/1/2013" + ' ' + bookedIntervalValueTo)) &&
(Date.parse("1/1/2013" + ' ' + intervalValueTo) >= Date.parse("1/1/2013" + ' ' + bookedIntervalValueTo))) {
boolval = true;
} else if ((Date.parse("1/1/2013" + ' ' + intervalValueFrom) >= Date.parse("1/1/2013" + ' ' + bookedIntervalValueFrom)) &&
(Date.parse("1/1/2013" + ' ' + intervalValueFrom) <= Date.parse("1/1/2013" + ' ' + bookedIntervalValueTo))) {
if ((Date.parse("1/1/2013" + ' ' + intervalValueFrom) >= Date.parse("1/1/2013" + ' ' + bookedIntervalValueFrom)) &&
(Date.parse("1/1/2013" + ' ' + intervalValueFrom) <= Date.parse("1/1/2013" + ' ' + bookedIntervalValueTo)) &&
(Date.parse("1/1/2013" + ' ' + intervalValueTo) >= Date.parse("1/1/2013" + ' ' + bookedIntervalValueTo))) {
boolval = false;
} else {
boolval = true;
}
}
}
return boolval;
};
var saveBookAppointment = function(orderId) {
var appointmentStausId = 1;
var firstName = Encoder.htmlEncode($.trim($("#txtFirstName").val()));
var lastName = Encoder.htmlEncode($.trim($("#txtLastName").val()));
var timeFrom = '';
var timeTo = '';
var serviceIntervalFrm = '';
var serviceIntervalTo = '';
var preferredTimeId = '';
$('#idServiceTimeLi li').each(function() {
if ($(this).find('input[name=chkServiceTime]').prop('checked')) {
timeFrom = $(this).find('.cssClassTimeFrom span').html();
timeTo = $(this).find('.cssClassTimeTo span').html();
preferredTimeId = $(this).find('input[name=chkServiceTime]').val();
$(this).find('.cssClassServiceDuration ul li').each(function() {
if ($(this).find('input[name=chkServiceTimeInterval]').prop('checked')) {
serviceIntervalFrm = $(this).find('.cssClassServiceTimeFrom span').html();
serviceIntervalTo = $(this).find('.cssClassServiceTimeTo span').html();
}
});
}
});
var preferredTime = timeFrom + '-' + timeTo;
var interval = serviceIntervalFrm + '-' + serviceIntervalTo;
var bookAppointmentInfo = {
infoData: {
OrderID: orderId,
AppointmentStatusID: appointmentStausId,
AppointmentStatusName: 'Pending',
Title: $.trim($("#ddlTitle option:selected").text()), UserName: firstName + ' ' + lastName,
FirstName: firstName,
LastName: lastName,
Gender: $.trim($('input[name=gender]:checked').val()),
PhoneNumber: Encoder.htmlEncode($.trim($("#txtPhoneNumber").val())),
MobileNumber: Encoder.htmlEncode($.trim($("#txtMobileNumber").val())),
Email: Encoder.htmlEncode($.trim($("#txtEmailAddressAppointment").val())),
PreferredDate: $.trim($('#txtAvailableDate').val()),
preferredTime: preferredTime,
TypeOfTreatment: Encoder.htmlEncode($.trim($("#txtTypeofTreatment").val())),
StoreLocation: $.trim($("#ddlStoreLocation option:selected").val()),
TypeOfCustomer: $.trim($('input[name=customerType]:checked').val()),
MembershipElite: $.trim($('input[name=membershipElite]:checked').val()),
ServiceCategoryID: $.trim($('#ddlServices option:selected').val()),
ServiceCategoryName: $.trim($('#ddlServices option:selected').text()),
ServiceProductID: $.trim($('#ddlServiceProducts option:selected').val()),
ServiceProductName: $.trim($('#ddlServiceProducts option:selected').text()),
ServiceProductPrice: $.trim($('#serviceProductPrice').html().replace(/[^-0-9\.]+/g, "")),
PaymentMethodID: userValue.paymentMethodId,
PaymentMethodName: userValue.paymentMethodName,
StoreLocationName: $.trim($('#ddlStoreLocation option:selected').text()),
ServiceDateId: serviceDateID,
PreferredTimeInterval: interval,
PreferredTimeId: preferredTimeId,
ServiceDuration: $.trim($('#serviceProductDuration').html()),
EmployeeID: $('#ddlStoreServiceProviders option:selected').val(),
EmployeeName: $('#ddlStoreServiceProviders option:selected').text(),
AddedOn: ''
}
};
var commonInfo = AspxCommonObj();
commonInfo.UserName = null;
var appointmentId = 0;
var url = servicePath;
var param = JSON2.stringify({ appointmentId: appointmentId, aspxCommonObj: commonInfo, obj: bookAppointmentInfo.infoData });
$ajaxCall(url, "SaveBookAppointment", param, saveBookAppointmentSucess, null);
return saveBookAppointmentSucess;
};
var saveBookAppointmentSucess = function(msg) {
if (msg.d) {
if (userValue.paymentFriendlyName.toLowerCase() == "cashondelivery") {
document.location = AspxCommerce.utils.GetAspxRedirectPath() + p.appointmentSuccessPage + pageExtension;
} else if (userValue.paymentFriendlyName.toLowerCase() == "paypal") {
var x = AspxCommerce.utils.GetStoreID() + "#" + AspxCommerce.utils.GetPortalID() + "#" + AspxCommerce.utils.GetUserName() + "#" + AspxCommerce.utils.GetCustomerID() + "#" + AspxCommerce.utils.GetSessionCode() + "#" + AspxCommerce.utils.GetCultureName();
BookAppointment.setSessionValue("PaypalData", x);
document.location = AspxCommerce.utils.GetAspxRedirectPath() + "Modules/AspxCommerce/AspxServiceItems/" + "PayThroughPaypal" + pageExtension;
}
} else {
csscody.error("<h2>" + getLocale(AspxServiceLocale, "Error Message") + "</h2><p>" + getLocale(AspxServiceLocale, "Sorry Failed to save appointment.") + "</p>");
var url = servicePath;
var param = JSON2.stringify({ aspxCommonObj: aspxCommonObj, orderId: orderId });
$ajaxCall(url, "DeleteAppointmentForError", param, null, null);
return false;
}
};
var enableCheckBox = function() {
var container = $('#chkGender');
container.find('input[name=gender]').click(function(e) {
if (this.checked) {
container.find('input[name=gender]').not(this).removeAttr('checked');
$("#genderError").html('');
}
});
var customerContainer = $('#customerType');
customerContainer.find('input[name=customerType]').click(function(e) {
if (this.checked) {
customerContainer.find('input[name=customerType]').not(this).removeAttr('checked');
$("#customerTypeError").html('');
}
});
var membershipEliteContainer = $('#membershipElite');
membershipEliteContainer.find('input[name=membershipElite]').click(function(e) {
if (this.checked) {
membershipEliteContainer.find('input[name=membershipElite]').not(this).removeAttr('checked');
$("#membershipeEliteError").html('');
}
});
};
var loadTimeDropDown = function() {
var timeHrsOption = '';
for (var i = 0; i <= 12; i++) {
if (JSON2.stringify(i).length == 1) {
timeHrsOption += '<option value="' + 0 + i + '">' + 0 + i + '</option>';
} else {
timeHrsOption += '<option value="' + i + '">' + i + '</option>';
}
}
var timeMinOption = '';
timeMinOption += '<option value="' + 0 + 0 + '">' + 0 + 0 + '</option>';
timeMinOption += '<option value="' + 15 + '">' + 15 + '</option>';
timeMinOption += '<option value="' + 30 + '">' + 30 + '</option>';
timeMinOption += '<option value="' + 45 + '">' + 45 + '</option>';
};
var clearForm = function() {
$('#ddlServices').val(0);
$('#ddlServiceProducts').val(0);
$("#ddlStoreLocation").val(0);
$('.cssClassAvailableDate').val('').hide();
$('.cssClassAvailableTime').hide();
$("#ddlTitle").val(0);
$("#txtFirstName").val('');
$("#txtLastName").val('');
$('input[name=gender]:checked').removeAttr('checked');
$("#txtMobileNumber").val('');
$("#txtPhoneNumber").val('');
$("#txtEmailAddressAppointment").val('');
$("#txtTypeofTreatment").val('');
$('input[name=customerType]:checked').removeAttr('checked');
$('input[name=membershipElite]:checked').removeAttr('checked');
$('.cssServiceProductsPrice,.cssServiceProductDuration').show();
$('#serviceProductPrice').val('');
};
var verifyForm = function() {
var c = $("#form1").validate({
rules: {
FirstName: {
required: true,
minlength: 2
},
LastName: {
required: true,
minlength: 2
},
MobileNumber: {
required: true,
number: true,
minlength: 10,
maxlength: 15
},
PhoneNumber: {
required: true,
number: true,
minlength: 7,
maxlength: 12
},
AppointmentEmail: {
required: true,
email: true
}
},
messages: {
FirstName: {
required: getLocale(AspxServiceLocale, '* field required'),
minlength: getLocale(AspxServiceLocale, "* (at least 2 chars)")
},
LastName: {
required: getLocale(AspxServiceLocale, '* field required'),
minlength: getLocale(AspxServiceLocale, "* (at least 2 chars)")
},
MobileNumber: {
required: getLocale(AspxServiceLocale, '* field required'),
minlength: getLocale(AspxServiceLocale, "*(at least 10 digits)"),
maxlength: getLocale(AspxServiceLocale, "*(at most 15 digits)")
},
PhoneNumber: {
required: getLocale(AspxServiceLocale, '* field required'),
minlength: getLocale(AspxServiceLocale, "*(at least 7 digits)"),
maxlength: getLocale(AspxServiceLocale, "*(at most 12 digits)")
},
AppointmentEmail: {
required: getLocale(AspxServiceLocale, '* field required'),
email: getLocale(AspxServiceLocale, "Please enter valid email id")
},
TypeOfTreatment: {
required: getLocale(AspxServiceLocale, '* field required')
}
}
});
if (c.form()) {
if ($('input[name=gender]:checked').length > 0) {
if ($('input[name=customerType]:checked').length > 0) {
if ($('input[name=membershipElite]:checked').length > 0) {
if ($("#ddlServices").val() != 0) {
$('#serviceError').html('');
if ($("#ddlServiceProducts").val() != 0) {
if ($("#ddlStoreLocation").val() != 0) {
$('#ddlStoreLocation').removeClass('error');
if ($("#txtAvailableDate").val() != '') {
$("#lblAvailableDateError").hide();
if ($('.cssClassAvailableTime:visible').length > 0) {
if ($('input[name=chkServiceTime]:checked').length > 0) {
$("#lblTimeError").html('').removeClass("red");
return true;
} else {
$('.cssClassAvailableTime').show();
$("#lblTimeError").html(getLocale(AspxServiceLocale, "Select one available time")).css("color", "red");
return false;
}
} else {
$('.cssClassAvailableTime').show();
$("#lblTimeError").html(getLocale(AspxServiceLocale, "Time is not allocated for this date!")).css("color", "red");
return false;
}
} else {
$("#lblAvailableDateError").show();
return false; }
} else {
$('#storeError').html(getLocale(AspxServiceLocale, 'required')).css("color", "red");
return false;
}
} else {
$('#serviceProductError').html(getLocale(AspxServiceLocale, 'required')).css("color", "red");
return false;
}
} else {
$('#serviceError').html(getLocale(AspxServiceLocale, 'required')).css("color", "red");
return false;
}
} else {
$("#membershipeEliteError").html(getLocale(AspxServiceLocale, "Select one membership elite")).css("color", "red");
return false;
}
} else {
$("#customerTypeError").html(getLocale(AspxServiceLocale, "Select one customer type")).css("color", "red");
return false;
}
} else {
$("#genderError").html(getLocale(AspxServiceLocale, "Select one gender")).css("color", "red");
return false;
}
} else {
return false;
}
};
var getQueryStringParams = function(sParam) {
var sPageURL = window.location.search.substring(1);
var sURLVariables = sPageURL.split('&');
for (var i = 0; i < sURLVariables.length; i++) {
var sParameterName = sURLVariables[i].split('=');
if (sParameterName[0] == sParam) {
return sParameterName[1];
}
}
};
var bindServiceProviderEmployee = function(data) {
$("#ddlStoreServiceProviders").html('');
var serviceProvierEmployee = "<option value='0'> --- </option>";
$.each(data.d, function(index, value) {
serviceProvierEmployee += "<option value=" + value.EmployeeID + ">" + value.EmployeeName + "</option>";
});
$("#ddlStoreServiceProviders").append(serviceProvierEmployee);
};
var getServceProviderEmployee = function(serviceId, branchId) {
var url = servicePath;
var param = JSON2.stringify({ serviceCategoryId: serviceId, storeBranchId: branchId, aspxCommonObj: aspxCommonObj });
$ajaxCall(url, "GetServiceProviderNameListFront", param, bindServiceProviderEmployee, null);
};
var init = function () {
$('#ddlStoreLocation').change(function() {
$('.cssClassAvailableTime').hide();
if ($(this).val() != 0) {
$('.cssClassServiceProvider').show();
$('#storeError').html('');
var serviceId = $('#ddlServices').val();
var branchId = $(this).val();
if ($('#ddlServiceProducts').val() != 0) {
$('#storeError').html('');
getServceProviderEmployee(serviceId, branchId);
} else {
$('#serviceProductError').html(getLocale(AspxServiceLocale, 'Please select product first')).css("color", "red");
$(this).val(0);
return false;
}
} else {
$('.cssClassAvailableDate,.cssClassAvailableTime').hide();
$('#ddlStoreServiceProviders').val(0);
$('.cssClassServiceProvider').hide();
}
});
$('#ddlStoreServiceProviders').change(function() {
if ($(this).val() != 0) {
var serviceId = $('#ddlServices').val();
var branchId = $('#ddlStoreLocation option:selected').val();
var empId = $('#ddlStoreServiceProviders option:selected').val();
BookAppointment.GetServicesDates(serviceId, branchId, empId);
$('#txtAvailableDate').val('');
$('.cssClassAvailableDate').show();
$('.cssClassAvailableTime').hide();
} else {
$('.cssClassAvailableDate,.cssClassAvailableTime').hide();
}
});
$('#ddlServices').change(function() {
$('#ddlStoreLocation').val(0);
if ($(this).val() != 0) {
$('#serviceError').html('');
$('.cssClassUlTimeList').html('');
$("#lblTimeError").html('').removeClass("red");
var serviceId = $(this).val();
BookAppointment.GetServiceProducts(serviceId);
BookAppointment.GetStoreLocation(serviceId);
} else {
$("#ddlServiceProducts").val(0);
$("#ddlServiceProducts").trigger('change');
$('#ddlStoreLocation').trigger('change');
return false;
}
if ($('#ddlStoreLocation').val() == 0) {
$('.cssClassAvailableDate,.cssClassAvailableTime').hide();
}
});
$("#ddlServiceProducts").change(function () {
$('.cssClassAvailableTime').hide();
$('#txtAvailableDate').val('');
if ($(this).val() == 0) {
$('.cssServiceProductsPrice,.cssServiceProductDuration,.cssClassAvailableTime,.cssClassAvailableDate').hide();
$('#ddlStoreLocation').val(0);
if ($('#ddlServices').val() == 0) {
$(this).html('').append("<option value='0'> --- </option>");
}
} else {
$('.cssServiceProductsPrice,.cssServiceProductDuration').show();
$('#serviceProductError').html('');
var price = $("#ddlServiceProducts option:selected").attr('price');
$('#serviceProductPrice').html(parseFloat(price).toFixed(2));
$('#serviceProductDuration').html($("#ddlServiceProducts option:selected").attr('duration') + ' ' + 'minutes');
setSessionValue("GrandTotalAll",$('#serviceProductPrice').html().replace(/[^-0-9\.]+/g, ""));
userValue.productItemID = parseInt($("#ddlServiceProducts option:selected").val());
}
});
$('#btnPlaceOrder').bind('click', function() {
var timeChecked = false;
$('.cssClassServiceDuration ul li').each(function() {
if ($(this).find('input[name=chkServiceTimeInterval]').prop('checked')) {
timeChecked = true;
}
});
if (BookAppointment.VerifyForm()) {
if (timeChecked == true) {
saveOrderDetailsFirst();
}
else {
csscody.alert("<h2>" + getLocale(AspxServiceLocale, "Information Alert") + "</h2><p>" + getLocale(AspxServiceLocale, "Please select one time duration.") + "</p>");
return false;
}
} else {
csscody.alert("<h2>" + getLocale(AspxServiceLocale, "Information Alert") + "</h2><p>" + getLocale(AspxServiceLocale, "Please fill up all required fields.") + "</p>");
return false;
}
});
$('.cssClassAvailableTime').on('click', 'input[name=chkServiceTime]', function() {
if ($('input[name=chkServiceTime]:checked').length > 0) {
var x = $(this).parent('li').prop('class');
x = x.split('_');
var timeId = x[1];
getBookedServiceTime(timeId);
} else {
}
});
BookAppointment.EnableCheckBox();
BookAppointment.GetAllServices();
BookAppointment.LoadPGatewayList();
var titleOptions = '<option value="1">Mr</option>';
titleOptions += '<option value="2">Ms</option>';
titleOptions += '<option value="3">Mrs</option>';
$("#ddlTitle").html('').append(titleOptions);
};
var getSession = function(Key) {
var url = aspxservicePath + "AspxCoreHandler.ashx/";;
var param = JSON2.stringify({ key: Key });
$ajaxCall(url, "GetSessionVariableCart", param, function(data) {
userValue.sessionValue = parseFloat(data.d);
}, null);
return userValue.sessionValue;
};
var saveOrderDetailsFirst = function () {
var creditCardTransactionType = $('#ddlTransactionType option:selected').text();
var cardNo = $('#txtCardNo').val();
var cardCode = $('#txtCardCode').val();
var CardType = $('#cardType option:selected').text();
var expireDate;
expireDate = $('#lstMonth option:selected').text();
expireDate += $('#lstYear option:selected').text();
var accountNumber = $('#txtAccountNumber').val();
var routingNumber = $('#txtRoutingNumber').val();
var accountType = $('#ddlAccountType option:selected').text();
var bankName = $('#txtBankName').val();
var accountHoldername = $('#txtAccountHolderName').val();
var checkType = $('#ddlChequeType option:selected').text();
var checkNumber = $('#txtChequeNumber').val();
var recurringBillingStatus = false;
if ($('#chkRecurringBillingStatus').is(':checked'))
recurringBillingStatus = true;
else
recurringBillingStatus = false;
var paymentMethodName = "Cash On Delivery";
var paymentMethodCode = "Cash On Delivery";
var isBillingAsShipping = false;
var orderRemarks = Encoder.htmlEncode($("#txtAdditionalNote").val()) == undefined ? '' : Encoder.htmlEncode($("#txtAdditionalNote").val());
var currencyCode = "USD";
var isTestRequest = "TRUE";
var isEmailCustomer = "TRUE";
var discountAmount = "";
var taxTotal = 0; BookAppointment.GetSession("Gateway");
var paymentGatewayID = userValue.sessionValue; var paymentGatewaySubTypeID = 1;
BookAppointment.GetSession("GrandTotalAll");
var amount = userValue.sessionValue;
var OrderDetails = {
BillingAddressInfo: {
AddressID: 0,
FirstName: Encoder.htmlEncode($.trim($("#txtFirstName").val())),
LastName: Encoder.htmlEncode($.trim($("#txtLastName").val())),
CompanyName: "",
EmailAddress: Encoder.htmlEncode($.trim($("#txtEmailAddressAppointment").val())),
Address: "",
Address2: "",
City: "",
State: "",
Zip: "",
Country: "",
Phone: Encoder.htmlEncode($.trim($("#txtPhoneNumber").val())),
Mobile: Encoder.htmlEncode($.trim($("#txtMobileNumber").val())),
Fax: "",
Website: "",
IsDefaultBilling: true,
IsBillingAsShipping: false
}, objSPAddressInfo: {
AddressID: 0,
FirstName: "",
LastName: "",
CompanyName: "",
EmailAddress: "",
Address: "",
Address2: "",
City: "",
State: "",
Zip: "",
Country: "",
Phone: "",
Mobile: "",
Fax: "",
Website: "",
isDefaultShipping: true
},
PaymentInfo: {
PaymentMethodName: paymentMethodName,
PaymentMethodCode: paymentMethodCode,
CardNumber: "",
TransactionType: creditCardTransactionType,
CardType: CardType,
CardCode: "",
ExpireDate: "",
AccountNumber: accountNumber,
RoutingNumber: routingNumber,
AccountType: accountType,
BankName: bankName,
AccountHolderName: accountHoldername,
ChequeType: checkType,
ChequeNumber: checkNumber,
RecurringBillingStatus: recurringBillingStatus
},
OrderDetailsInfo: {
SessionCode: '',
IsGuestUser: false,
InvoiceNumber: "",
TransactionID: 0,
GrandTotal: amount,
DiscountAmount: 0,
CouponDiscountAmount: 0,
CouponCode: '',
PurchaseOrderNumber: 0,
PaymentGatewayTypeID: paymentGatewayID,
PaymentGateSubTypeID: paymentGatewaySubTypeID,
ClientIPAddress: clientIPAddress,
UserBillingAddressID: $('.cssClassBillingAddressInfo span').prop('id'),
ShippingMethodID: 0, PaymentMethodID: 0,
TaxTotal: taxTotal,
CurrencyCode: currencyCode,
CustomerID: AspxCommerce.utils.GetCustomerID(),
ResponseCode: 0,
ResponseReasonCode: 0,
ResponseReasonText: "",
Remarks: "", IsMultipleCheckOut: false,
IsTest: isTestRequest,
IsEmailCustomer: isEmailCustomer,
IsDownloadable: true//CheckOut.UserCart.IsDownloadItemInCart
},
CommonInfo: {
PortalID: AspxCommerce.utils.GetPortalID(),
StoreID: AspxCommerce.utils.GetStoreID(),
CultureName: AspxCommerce.utils.GetCultureName(),
AddedBy: AspxCommerce.utils.GetUserName(),
IsActive: true//CheckOut.UserCart.isActive
}
};
var lstItemsCol = {
OrderID: 0,
ShippingAddressID: 0,
ShippingMethodID: 0,
ItemID: BookAppointment.UserValue.productItemID,
Variants: '',
Quantity: 1,
Price: amount,
Weight: 0,
Remarks: '',
orderItemRemarks: '',
ShippingRate: 0,
IsDownloadable: true
};
var arrItem = [];
arrItem[0] = lstItemsCol;
var paramData = {
OrderDetailsCollection: {
ObjOrderDetails: OrderDetails.OrderDetailsInfo,
LstOrderItemsInfo: arrItem, ObjPaymentInfo: OrderDetails.PaymentInfo,
ObjBillingAddressInfo: OrderDetails.BillingAddressInfo,
ObjShippingAddressInfo: OrderDetails.objSPAddressInfo,
ObjCommonInfo: OrderDetails.CommonInfo,
ObjOrderTaxInfo: []//CheckOut.UserCart.objTaxList
}
};
var url = aspxservicePath + "AspxCoreHandler.ashx/";;
var param = JSON2.stringify({ "orderDetail": paramData.OrderDetailsCollection });
$ajaxCall(url, "SaveOrderDetails", param, orderSaveSucess, orderSaveError);
};
var orderSaveSucess = function() {
var orderId = BookAppointment.GetSession("OrderID");
var isSucess = BookAppointment.SaveBookAppointment(userValue.sessionValue);
};
var orderSaveError = function() {
csscody.error("<h2>" + getLocale(AspxServiceLocale, "Error Message") + "</h2><p>" + getLocale(AspxServiceLocale, "Sorry Failed to save order.") + "</p>");
return false;
};
return {
Init: init,
EnableCheckBox: enableCheckBox,
ClearForm: clearForm,
GetStoreLocation: getStoreLocation,
SaveBookAppointment: saveBookAppointment,
GetAllServices: getAllServices,
GetServiceProducts: getServiceProducts,
GetServicesDates: getServicesDates,
GetServiceAvailableTime: getServiceAvailableTime,
LoadPGatewayList: loadPGatewayList,
UserValue: userValue,
setSessionValue: setSessionValue,
VerifyForm: verifyForm,
GetSession: getSession,
GetQueryStringParams: getQueryStringParams
};
} ();
BookAppointment.Init();
};
$.fn.BookAppointment = function(p) {
$.BookAppointmentView(p);
};
})(jQuery); | AspxCommerce/AspxCommerce2.7 | SageFrame/Modules/AspxCommerce/AspxServiceItems/js/BookAppointment.js | JavaScript | mit | 73,067 |
import { h } from 'omi';
import createSvgIcon from './utils/createSvgIcon';
export default createSvgIcon(h("path", {
d: "M21 11l2-2c-3.73-3.73-8.87-5.15-13.7-4.31l2.58 2.58c3.3-.02 6.61 1.22 9.12 3.73zm-2 2c-1.08-1.08-2.36-1.85-3.72-2.33l3.02 3.02.7-.69zM9 17l3 3 3-3c-1.65-1.66-4.34-1.66-6 0zM3.41 1.64L2 3.05 5.05 6.1C3.59 6.83 2.22 7.79 1 9l2 2c1.23-1.23 2.65-2.16 4.17-2.78l2.24 2.24C7.79 10.89 6.27 11.74 5 13l2 2c1.35-1.35 3.11-2.04 4.89-2.06l7.08 7.08 1.41-1.41L3.41 1.64z"
}), 'WifiOffOutlined'); | AlloyTeam/Nuclear | components/icon/esm/wifi-off-outlined.js | JavaScript | mit | 506 |
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
namespace MvcDating.Models
{
public class RegisterExternalLoginModel
{
[Required]
[Display(Name = "User name")]
public string UserName { get; set; }
[DataType(DataType.EmailAddress)]
public string Email { get; set; }
[Required]
public int Gender { get; set; }
[DataType(DataType.Date)]
[DisplayFormat(DataFormatString = "{0:yyyy-MM-dd}", ApplyFormatInEditMode = true)]
[Required(ErrorMessage = "Birthday must be set")]
public DateTime Birthday { get; set; }
public string ExternalLoginData { get; set; }
}
public class LocalPasswordModel
{
[Required]
[DataType(DataType.Password)]
[Display(Name = "Current password")]
public string OldPassword { get; set; }
[Required]
[StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
[DataType(DataType.Password)]
[Display(Name = "New password")]
public string NewPassword { get; set; }
[DataType(DataType.Password)]
[Display(Name = "Confirm new password")]
[Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")]
public string ConfirmPassword { get; set; }
}
public class LoginModel
{
[Required]
[Display(Name = "Email")]
public string Email { get; set; }
[Required]
[DataType(DataType.Password)]
[Display(Name = "Password")]
public string Password { get; set; }
[Display(Name = "Remember me?")]
public bool RememberMe { get; set; }
}
public class Gender
{
public string Name { get; set; }
public int Value { get; set; }
}
public class Genders
{
public static List<Gender> GetList()
{
return new List<Gender>
{
new Gender {Name = "Male", Value = 0},
new Gender {Name = "Male", Value = 1},
};
}
}
public class RegisterModel
{
[Required]
[Display(Name = "User name")]
public string UserName { get; set; }
[Required(ErrorMessage = "Select your gender")]
[Display(Name = "Gender")]
public int Gender { get; set; }
[Required]
[DataType(DataType.EmailAddress)]
[Display(Name = "Email")]
public string Email { get; set; }
[Required]
[StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
[DataType(DataType.Password)]
[Display(Name = "Password")]
public string Password { get; set; }
[DataType(DataType.Password)]
[Display(Name = "Confirm password")]
[Compare("Password", ErrorMessage = "The password and confirmation password do not match.")]
public string ConfirmPassword { get; set; }
}
public class ExternalLogin
{
public string Provider { get; set; }
public string ProviderDisplayName { get; set; }
public string ProviderUserId { get; set; }
}
}
| nightwolfz/MvcDating | MvcDating/Models/AccountModels.cs | C# | mit | 3,281 |
# reactable
> A static website powered by [React.js](http://facebook.github.io/react/)
> and [Webpack](http://webpack.github.io/).
**Note**: *This project is based on [react-static-boilerplate](https://github.com/koistya/react-static-boilerplate).*
### Features
✓ Generates static `.html` pages from [React](http://facebook.github.io/react/) components<br>
✓ Generates routes based on the list of files in the `/pages` folder<br>
✓ Next generation JavaScript with [Babel](https://github.com/babel/babel)<br>
✓ [Sass](http://sass-lang.com/) syntax for CSS via [postCSS](https://github.com/postcss/postcss) and [precss](https://github.com/jonathantneal/precss)<br>
✓ Development web server with [BrowserSync](http://www.browsersync.io) and [React Transform](https://github.com/gaearon/babel-plugin-react-transform)<br>
✓ Bundling and optimization with [Webpack](http://webpack.github.io/)<br>
✓ [Code-splitting](https://github.com/webpack/docs/wiki/code-splitting) and async chunk loading<br>
✓ Easy deployment to [GitHub Pages](https://pages.github.com/), [Amazon S3](http://davidwalsh.name/hosting-website-amazon-s3) or [Firebase](https://www.firebase.com/)<br>
✓ [Yeoman](http://yeoman.io/) generator ([generator-react-static](https://www.npmjs.com/package/generator-react-static))<br>
### Directory Layout
```
.
├── /build/ # The folder for compiled output
├── /node_modules/ # 3rd-party libraries and utilities
├── /components/ # React components
├── /lib/ # Libraries and utilities
├── /pages/ # React.js-based web pages
│ ├── /blog/ # Blog post entries example
│ ├── /404.js # Not Found page
│ ├── /500.js # Error page
│ ├── /about.js # About Us page
│ └── /index.js # Home page
├── /static/ # Static files such as favicon.ico etc.
├── /test/ # Unit and integration tests
├── /tools/ # Build automation scripts and utilities
│── app.js # The main JavaScript file (entry point)
│── config.js # Website configuration / settings
│── LICENSE.txt # License file
│── package.json # Dev dependencies and NPM scripts
└── README.md # Project overview
```
### Getting Started
Just clone the repo, install Node.js modules and run `npm start`:
```
$ git clone -o react-static-boilerplate -b master --single-branch \
https://github.com/koistya/react-static-boilerplate.git MyApp
$ cd MyApp
$ npm install
$ npm start
```
Then open [http://localhost:3000/](http://localhost:3000/) in your browser.
### How to Test
The unit tests are powered by [chai](http://chaijs.com/) and [mocha](http://mochajs.org/).
```
$ npm test
```
### How to Deploy
```shell
$ npm run deploy # Deploys the project to GitHub Pages
```
### Related Projects
* [React Starter Kit](https://github.com/kriasoft/react-starter-kit)
* [React Routing](https://github.com/kriasoft/react-routing)
* [React Decorators](https://github.com/kriasoft/react-decorators)
### Learn More
* [Getting Started with React.js](http://facebook.github.io/react/)
* [Getting Started with GraphQL and Relay](https://quip.com/oLxzA1gTsJsE)
* [React.js Questions on StackOverflow](http://stackoverflow.com/questions/tagged/reactjs)
* [React.js Discussion Board](https://discuss.reactjs.org/)
* [Learn ES6](https://babeljs.io/docs/learn-es6/), [ES6 Features](https://github.com/lukehoban/es6features#readme)
---
Copyright (c) Sid. All rights reserved.
| websiddu/reactable | README.md | Markdown | mit | 3,935 |
module Abstractor
module Methods
module Models
module AbstractorAbstractionSourceType
def self.included(base)
base.send :include, SoftDelete
# Associations
base.send :has_many, :abstractor_abstraction_sources
# base.send :attr_accessible, :deleted_at, :name
end
end
end
end
end | NUBIC/abstractor | lib/abstractor/methods/models/abstractor_abstraction_source_type.rb | Ruby | mit | 359 |
package name.ratson.cordova.admob;
import android.os.Bundle;
import android.provider.Settings;
import android.support.annotation.NonNull;
import android.util.Log;
import com.google.ads.mediation.admob.AdMobAdapter;
import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GoogleApiAvailability;
import org.apache.cordova.CallbackContext;
import org.apache.cordova.CordovaInterface;
import org.apache.cordova.CordovaPlugin;
import org.apache.cordova.CordovaWebView;
import org.apache.cordova.PluginResult;
import org.apache.cordova.PluginResult.Status;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Iterator;
import name.ratson.cordova.admob.banner.BannerExecutor;
import name.ratson.cordova.admob.interstitial.InterstitialExecutor;
import name.ratson.cordova.admob.rewardvideo.RewardVideoExecutor;
/**
* This class represents the native implementation for the AdMob Cordova plugin.
* This plugin can be used to request AdMob ads natively via the Google AdMob SDK.
* The Google AdMob SDK is a dependency for this plugin.
*/
public class AdMob extends CordovaPlugin {
/**
* Common tag used for logging statements.
*/
private static final String TAG = "AdMob";
public final AdMobConfig config = new AdMobConfig();
private BannerExecutor bannerExecutor = null;
private InterstitialExecutor interstitialExecutor = null;
private RewardVideoExecutor rewardVideoExecutor = null;
private boolean isGpsAvailable = false;
@Override
public void initialize(CordovaInterface cordova, CordovaWebView webView) {
super.initialize(cordova, webView);
isGpsAvailable = (GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(cordova.getActivity()) == ConnectionResult.SUCCESS);
Log.w(TAG, String.format("isGooglePlayServicesAvailable: %s", isGpsAvailable ? "true" : "false"));
}
/**
* This is the main method for the AdMob plugin. All API calls go through here.
* This method determines the action, and executes the appropriate call.
*
* @param action The action that the plugin should execute.
* @param inputs The input parameters for the action.
* @param callbackContext The callback context.
* @return A PluginResult representing the result of the provided action. A
* status of INVALID_ACTION is returned if the action is not recognized.
*/
@Override
public boolean execute(String action, JSONArray inputs, CallbackContext callbackContext) throws JSONException {
if (bannerExecutor == null) {
bannerExecutor = new BannerExecutor(this);
}
if (interstitialExecutor == null) {
interstitialExecutor = new InterstitialExecutor(this);
}
if (rewardVideoExecutor == null) {
rewardVideoExecutor = new RewardVideoExecutor(this);
}
PluginResult result = null;
if (Actions.SET_OPTIONS.equals(action)) {
JSONObject options = inputs.optJSONObject(0);
result = executeSetOptions(options, callbackContext);
} else if (Actions.CREATE_BANNER.equals(action)) {
JSONObject options = inputs.optJSONObject(0);
result = bannerExecutor.prepareAd(options, callbackContext);
} else if (Actions.DESTROY_BANNER.equals(action)) {
result = bannerExecutor.removeAd(callbackContext);
} else if (Actions.REQUEST_AD.equals(action)) {
JSONObject options = inputs.optJSONObject(0);
result = bannerExecutor.requestAd(options, callbackContext);
} else if (Actions.SHOW_AD.equals(action)) {
boolean show = inputs.optBoolean(0);
result = bannerExecutor.showAd(show, callbackContext);
} else if (Actions.PREPARE_INTERSTITIAL.equals(action)) {
JSONObject options = inputs.optJSONObject(0);
result = interstitialExecutor.prepareAd(options, callbackContext);
} else if (Actions.CREATE_INTERSTITIAL.equals(action)) {
JSONObject options = inputs.optJSONObject(0);
result = interstitialExecutor.createAd(options, callbackContext);
} else if (Actions.REQUEST_INTERSTITIAL.equals(action)) {
JSONObject options = inputs.optJSONObject(0);
result = interstitialExecutor.requestAd(options, callbackContext);
} else if (Actions.SHOW_INTERSTITIAL.equals(action)) {
boolean show = inputs.optBoolean(0);
result = interstitialExecutor.showAd(show, callbackContext);
} else if(Actions.IS_INTERSTITIAL_READY.equals(action)) {
result = interstitialExecutor.isReady(callbackContext);
} else if (Actions.CREATE_REWARD_VIDEO.equals(action)) {
JSONObject options = inputs.optJSONObject(0);
result = rewardVideoExecutor.prepareAd(options, callbackContext);
} else if (Actions.SHOW_REWARD_VIDEO.equals(action)) {
boolean show = inputs.optBoolean(0);
result = rewardVideoExecutor.showAd(show, callbackContext);
} else if(Actions.IS_REWARD_VIDEO_READY.equals(action)) {
result = rewardVideoExecutor.isReady(callbackContext);
} else {
Log.d(TAG, String.format("Invalid action passed: %s", action));
result = new PluginResult(Status.INVALID_ACTION);
}
if (result != null) {
callbackContext.sendPluginResult(result);
}
return true;
}
private PluginResult executeSetOptions(JSONObject options, CallbackContext callbackContext) {
Log.w(TAG, "executeSetOptions");
config.setOptions(options);
callbackContext.success();
return null;
}
public AdRequest buildAdRequest() {
AdRequest.Builder builder = new AdRequest.Builder();
if (config.isTesting || isRunningInTestLab()) {
builder = builder.addTestDevice(AdRequest.DEVICE_ID_EMULATOR).addTestDevice(getDeviceId());
}
if (config.testDeviceList != null) {
Iterator<String> iterator = config.testDeviceList.iterator();
while (iterator.hasNext()) {
builder = builder.addTestDevice(iterator.next());
}
}
Bundle bundle = new Bundle();
bundle.putInt("cordova", 1);
if (config.adExtras != null) {
Iterator<String> it = config.adExtras.keys();
while (it.hasNext()) {
String key = it.next();
try {
bundle.putString(key, config.adExtras.get(key).toString());
} catch (JSONException exception) {
Log.w(TAG, String.format("Caught JSON Exception: %s", exception.getMessage()));
}
}
}
builder = builder.addNetworkExtrasBundle(AdMobAdapter.class, bundle);
if (config.gender != null) {
if ("male".compareToIgnoreCase(config.gender) != 0) {
builder.setGender(AdRequest.GENDER_MALE);
} else if ("female".compareToIgnoreCase(config.gender) != 0) {
builder.setGender(AdRequest.GENDER_FEMALE);
} else {
builder.setGender(AdRequest.GENDER_UNKNOWN);
}
}
if (config.location != null) {
builder.setLocation(config.location);
}
if ("yes".equals(config.forFamily)) {
builder.setIsDesignedForFamilies(true);
} else if ("no".equals(config.forFamily)) {
builder.setIsDesignedForFamilies(false);
}
if ("yes".equals(config.forChild)) {
builder.tagForChildDirectedTreatment(true);
} else if ("no".equals(config.forChild)) {
builder.tagForChildDirectedTreatment(false);
}
if (config.contentURL != null) {
builder.setContentUrl(config.contentURL);
}
return builder.build();
}
@Override
public void onPause(boolean multitasking) {
if (bannerExecutor != null) {
bannerExecutor.pauseAd();
}
super.onPause(multitasking);
}
@Override
public void onResume(boolean multitasking) {
super.onResume(multitasking);
isGpsAvailable = (GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(cordova.getActivity()) == ConnectionResult.SUCCESS);
if (bannerExecutor != null) {
bannerExecutor.resumeAd();
}
}
@Override
public void onDestroy() {
if (bannerExecutor != null) {
bannerExecutor.destroy();
bannerExecutor = null;
}
if (interstitialExecutor != null) {
interstitialExecutor.destroy();
interstitialExecutor = null;
}
if (rewardVideoExecutor != null) {
rewardVideoExecutor.destroy();
rewardVideoExecutor = null;
}
super.onDestroy();
}
@NonNull
private String getDeviceId() {
// This will request test ads on the emulator and deviceby passing this hashed device ID.
String ANDROID_ID = Settings.Secure.getString(cordova.getActivity().getContentResolver(), Settings.Secure.ANDROID_ID);
return md5(ANDROID_ID).toUpperCase();
}
private boolean isRunningInTestLab() {
String testLabSetting = Settings.System.getString(cordova.getActivity().getContentResolver(), "firebase.test.lab");
return "true".equals(testLabSetting);
}
private static String md5(final String s) {
try {
MessageDigest digest = java.security.MessageDigest.getInstance("MD5");
digest.update(s.getBytes());
byte messageDigest[] = digest.digest();
StringBuffer hexString = new StringBuffer();
for (int i = 0; i < messageDigest.length; i++) {
String h = Integer.toHexString(0xFF & messageDigest[i]);
while (h.length() < 2)
h = "0" + h;
hexString.append(h);
}
return hexString.toString();
} catch (NoSuchAlgorithmException e) {
}
return "";
}
}
| ratson/cordova-plugin-admob-free | src/android/AdMob.java | Java | mit | 10,407 |
import { Injectable } from '@angular/core'
import { Http, Response, Headers, RequestOptions } from '@angular/http'
import { AuthModel, ToasterModel } from '../models'
import {Subject, BehaviorSubject, ReplaySubject, Observable} from 'rxjs'
import { API_ROOT, CookieDomain } from '../config'
import { Cookie } from 'angular2-cookies'
import { ResourceService } from './resources'
import { Router } from '@angular/router'
import { ShowtoasterService } from './showtoaster'
import { GlobalValService } from './globalval.service'
@Injectable()
export class AuthService {
authInitialState: AuthModel = new AuthModel()
tokenSubject: Subject<any> = new BehaviorSubject<Object>(this.authInitialState.token)
userSubject: Subject<Object> = new ReplaySubject<Object>(1)
snsLoginsSubject: Subject<string[]> = new ReplaySubject<string[]>(1)
constructor(
public http: Http,
public rs: ResourceService,
private _router: Router,
private showtoasterService: ShowtoasterService,
private globalValService: GlobalValService
) {
//token, 如果cookie存在, 则
if (this.authInitialState.token !== ''){
this.getUserInfo()
}else{
this.userSubject.next(this.authInitialState.user)
}
this.getSnsLogins()
}
saveCookie(name:string,value:string):void {
Cookie.save(name, value, null, null, CookieDomain)
}
getCookie(name:string) {
return Cookie.load(name)
}
deleteCookie(name:string):void {
Cookie.remove(name)
}
//登录请求.
localLogin(data: Object):void {
this.rs.localLogin(data)
.subscribe((res: Response) => {
//成功
let token = res.json().token
this.saveCookie('token',token)
this.tokenSubject.next(token)
this.getUserInfo()
let toasterInfo = new ToasterModel({
content: '有朋自远方来, 不亦乐乎!',
type: 'success'
})
this.showtoasterService.showToaster(toasterInfo)
this._router.navigate(['/'])
},(err:any)=>{
let toasterInfo = new ToasterModel({
content: err.json().error_msg || '登录失败',
type: 'error'
})
this.showtoasterService.showToaster(toasterInfo)
this.globalValService.getCaptchaUrl()
})
}
getUserInfo():void{
this.rs.getMe().subscribe((res:Response)=>{
this.userSubject.next(res.json())
})
}
logout():void{
this.deleteCookie('token')
this.tokenSubject.next('')
this.userSubject.next(this.authInitialState.user)
this._router.navigate(['/'])
}
updateUser(data:Object):void{
this.rs.mdUser(data).subscribe((res:Response)=>{
this.userSubject.next(res.json().data)
let toasterInfo = new ToasterModel({
content:'更新用户成功.',
type: 'success'
})
this.showtoasterService.showToaster(toasterInfo)
},(err:any)=>{
let toasterInfo = new ToasterModel({
content: err.json().error_msg || '更新用户资料失败',
type: 'error'
})
this.showtoasterService.showToaster(toasterInfo)
})
}
getSnsLogins(){
this.rs.getSnsLogins()
.subscribe((res:Response)=>{
this.snsLoginsSubject.next(res.json().data)
},(err)=>{
this.snsLoginsSubject.next([])
})
}
} | jackhutu/jackblog-angular2 | src/services/auth.service.ts | TypeScript | mit | 3,177 |
// JavaScript Document
<!--
//** Animated Collapsible DIV v2.0- (c) Dynamic Drive DHTML code library: http://www.dynamicdrive.com.
//** May 24th, 08'- Script rewritten and updated to 2.0.
//** June 4th, 08'- Version 2.01: Bug fix to work with jquery 1.2.6 (which changed the way attr() behaves).
//** March 5th, 09'- Version 2.2, which adds the following:
//1) ontoggle($, divobj, state) event that fires each time a DIV is expanded/collapsed, including when the page 1st loads
//2) Ability to expand a DIV via a URL parameter string, ie: index.htm?expanddiv=jason or index.htm?expanddiv=jason,kelly
//** March 9th, 09'- Version 2.2.1: Optimized ontoggle event handler slightly.
var animatedcollapse={
divholders: {}, //structure: {div.id, div.attrs, div.$divref}
divgroups: {}, //structure: {groupname.count, groupname.lastactivedivid}
statusholders: {}, //structure: {[statuselement.id, stype, [opensrc, closedsrc]], $target}
lastactiveingroup: {}, //structure: {lastactivediv.id}
show:function(divids){ //public method
if (typeof divids=="object"){
for (var i=0; i<divids.length; i++)
this.showhide(divids[i], "show")
}
else
this.showhide(divids, "show")
},
hide:function(divids){ //public method
if (typeof divids=="object"){
for (var i=0; i<divids.length; i++)
this.showhide(divids[i], "hide")
}
else
this.showhide(divids, "hide")
},
toggle:function(divid){ //public method
if (typeof divid=="object")
divid=divid[0]
this.showhide(divid, "toggle")
},
addDiv:function(divid, attrstring){ //public function
this.divholders[divid]=({id: divid, $divref: null, attrs: attrstring})
this.divholders[divid].getAttr=function(name){ //assign getAttr() function to each divholder object
var attr=new RegExp(name+"=([^,]+)", "i") //get name/value config pair (ie: width=400px,)
return (attr.test(this.attrs) && parseInt(RegExp.$1)!=0)? RegExp.$1 : null //return value portion (string), or 0 (false) if none found
}
this.currentid=divid //keep track of current div object being manipulated (in the event of chaining)
return this
},
showhide:function(divid, action){
var $divref=this.divholders[divid].$divref //reference collapsible DIV
if (this.divholders[divid] && $divref.length==1){ //if DIV exists
var targetgroup=this.divgroups[$divref.attr('groupname')] //find out which group DIV belongs to (if any)
if ($divref.attr('groupname') && targetgroup.count>1 && (action=="show" || action=="toggle" && $divref.css('display')=='none')){ //If current DIV belongs to a group
if (targetgroup.lastactivedivid && targetgroup.lastactivedivid!=divid) //if last active DIV is set
this.slideengine(targetgroup.lastactivedivid, 'hide') //hide last active DIV within group first
this.slideengine(divid, 'show')
targetgroup.lastactivedivid=divid //remember last active DIV
}
else{
this.slideengine(divid, action)
}
}
},
slideengine:function(divid, action){
var $divref=this.divholders[divid].$divref
if (this.divholders[divid] && $divref.length==1){ //if this DIV exists
var animateSetting={height: action}
if ($divref.attr('fade'))
animateSetting.opacity=action
$divref.animate(animateSetting, $divref.attr('speed')? parseInt($divref.attr('speed')) : 500, function(){
if (animatedcollapse.ontoggle){
try{
animatedcollapse.ontoggle(jQuery, $divref.get(0), $divref.css('display'))
}
catch(e){
alert("An error exists inside your \"ontoggle\" function:\n\n"+e+"\n\nAborting execution of function.")
}
}
})
return false
}
},
generatemap:function(){
var map={}
for (var i=0; i<arguments.length; i++){
if (arguments[i][1]!=null){ //do not generate name/value pair if value is null
map[arguments[i][0]]=arguments[i][1]
}
}
return map
},
init:function(){
var ac=this
jQuery(document).ready(function($){
animatedcollapse.ontoggle=animatedcollapse.ontoggle || null
var urlparamopenids=animatedcollapse.urlparamselect() //Get div ids that should be expanded based on the url (['div1','div2',etc])
var persistopenids=ac.getCookie('acopendivids') //Get list of div ids that should be expanded due to persistence ('div1,div2,etc')
var groupswithpersist=ac.getCookie('acgroupswithpersist') //Get list of group names that have 1 or more divs with "persist" attribute defined
if (persistopenids!=null) //if cookie isn't null (is null if first time page loads, and cookie hasnt been set yet)
persistopenids=(persistopenids=='nada')? [] : persistopenids.split(',') //if no divs are persisted, set to empty array, else, array of div ids
groupswithpersist=(groupswithpersist==null || groupswithpersist=='nada')? [] : groupswithpersist.split(',') //Get list of groups with divs that are persisted
jQuery.each(ac.divholders, function(){ //loop through each collapsible DIV object
this.$divref=$('#'+this.id)
if ((this.getAttr('persist') || jQuery.inArray(this.getAttr('group'), groupswithpersist)!=-1) && persistopenids!=null){ //if this div carries a user "persist" setting, or belong to a group with at least one div that does
var cssdisplay=(jQuery.inArray(this.id, persistopenids)!=-1)? 'block' : 'none'
}
else{
var cssdisplay=this.getAttr('hide')? 'none' : null
}
if (urlparamopenids[0]=="all" || jQuery.inArray(this.id, urlparamopenids)!=-1){ //if url parameter string contains the single array element "all", or this div's ID
cssdisplay='block' //set div to "block", overriding any other setting
}
else if (urlparamopenids[0]=="none"){
cssdisplay='none' //set div to "none", overriding any other setting
}
this.$divref.css(ac.generatemap(['height', this.getAttr('height')], ['display', cssdisplay]))
this.$divref.attr(ac.generatemap(['groupname', this.getAttr('group')], ['fade', this.getAttr('fade')], ['speed', this.getAttr('speed')]))
if (this.getAttr('group')){ //if this DIV has the "group" attr defined
var targetgroup=ac.divgroups[this.getAttr('group')] || (ac.divgroups[this.getAttr('group')]={}) //Get settings for this group, or if it no settings exist yet, create blank object to store them in
targetgroup.count=(targetgroup.count||0)+1 //count # of DIVs within this group
if (jQuery.inArray(this.id, urlparamopenids)!=-1){ //if url parameter string contains this div's ID
targetgroup.lastactivedivid=this.id //remember this DIV as the last "active" DIV (this DIV will be expanded). Overrides other settings
targetgroup.overridepersist=1 //Indicate to override persisted div that would have been expanded
}
if (!targetgroup.lastactivedivid && this.$divref.css('display')!='none' || cssdisplay=="block" && typeof targetgroup.overridepersist=="undefined") //if this DIV was open by default or should be open due to persistence
targetgroup.lastactivedivid=this.id //remember this DIV as the last "active" DIV (this DIV will be expanded)
this.$divref.css({display:'none'}) //hide any DIV that's part of said group for now
}
}) //end divholders.each
jQuery.each(ac.divgroups, function(){ //loop through each group
if (this.lastactivedivid && urlparamopenids[0]!="none") //show last "active" DIV within each group (one that should be expanded), unless url param="none"
ac.divholders[this.lastactivedivid].$divref.show()
})
if (animatedcollapse.ontoggle){
jQuery.each(ac.divholders, function(){ //loop through each collapsible DIV object and fire ontoggle event
animatedcollapse.ontoggle(jQuery, this.$divref.get(0), this.$divref.css('display'))
})
}
/* //reserved for future implementation
var $allcontrols=$('a[rel]').filter('[@rel^="collapse["], [@rel^="expand["], [@rel^="toggle["]') //get all elements on page with rel="collapse[]", "expand[]" and "toggle[]"
$allcontrols.each(function(){ //loop though each control link
this._divids=this.getAttribute('rel').replace(/(^\w+)|(\s+)/g, "").replace(/[\[\]']/g, "") //cache value 'div1,div2,etc' within identifier[div1,div2,etc]
$(this).click(function(){ //assign click behavior to each control link
var relattr=this.getAttribute('rel')
var divids=(this._divids=="")? [] : this._divids.split(',') //convert 'div1,div2,etc' to array
if (divids.length>0){
animatedcollapse[/expand/i.test(relattr)? 'show' : /collapse/i.test(relattr)? 'hide' : 'toggle'](divids) //call corresponding public function
return false
}
}) //end control.click
})// end control.each
*/
$(window).bind('unload', function(){
ac.uninit()
})
}) //end doc.ready()
},
uninit:function(){
var opendivids='', groupswithpersist=''
jQuery.each(this.divholders, function(){
if (this.$divref.css('display')!='none'){
opendivids+=this.id+',' //store ids of DIVs that are expanded when page unloads: 'div1,div2,etc'
}
if (this.getAttr('group') && this.getAttr('persist'))
groupswithpersist+=this.getAttr('group')+',' //store groups with which at least one DIV has persistance enabled: 'group1,group2,etc'
})
opendivids=(opendivids=='')? 'nada' : opendivids.replace(/,$/, '')
groupswithpersist=(groupswithpersist=='')? 'nada' : groupswithpersist.replace(/,$/, '')
this.setCookie('acopendivids', opendivids)
this.setCookie('acgroupswithpersist', groupswithpersist)
},
getCookie:function(Name){
var re=new RegExp(Name+"=[^;]*", "i"); //construct RE to search for target name/value pair
if (document.cookie.match(re)) //if cookie found
return document.cookie.match(re)[0].split("=")[1] //return its value
return null
},
setCookie:function(name, value, days){
if (typeof days!="undefined"){ //if set persistent cookie
var expireDate = new Date()
expireDate.setDate(expireDate.getDate()+days)
document.cookie = name+"="+value+"; path=/; expires="+expireDate.toGMTString()
}
else //else if this is a session only cookie
document.cookie = name+"="+value+"; path=/"
},
urlparamselect:function(){
window.location.search.match(/expanddiv=([\w\-_,]+)/i) //search for expanddiv=divid or divid1,divid2,etc
return (RegExp.$1!="")? RegExp.$1.split(",") : []
}
}
--> | NikoRoberts/BuzzerBeaterStats | scripts/animatedcollapse.js | JavaScript | mit | 10,006 |
const path = require("path");
const staticLoader = require("fs").readFileSync(path.join(__dirname, "../loaders/static.js"));
function staticLoaderBuilder(shardRepository) {
shardRepository
.getEntryShards()
.filter(shard => !shard.isDynamic)
.map(shard => buildStaticLodaer(shard, shardRepository))
.filter(Boolean)
.forEach(shard => shardRepository.setShard(shard));
}
function buildStaticLodaer(shard, shardRepository) {
const dest = shard.dest && typeof shard.dest === "string" ? shard.dest : null;
if (!dest || !shard.modules.length) {
return;
}
const dirname = path.dirname(dest);
const filename = "loader-" + path.basename(dest);
const shardPaths = shardRepository
.getShards(shard.loadOrder)
.filter(shard => shard.modules.length || shard.content)
.map(shard => shard.dest)
.filter(shardPath => shardPath && typeof shardPath === "string")
.map(shardPath => `"./${path.relative(dirname, shardPath)}"`);
return {
name: filename,
content: `(function(){\n${staticLoader}\n;load([${shardPaths}]);\n})();`,
dest: path.join(dirname, filename)
};
}
module.exports = staticLoaderBuilder;
| MiguelCastillo/bit-bundler-splitter | src/shard/staticLoaderBuilder.js | JavaScript | mit | 1,167 |
const expect = require('unexpected');
const td = require('testdouble');
require('../../lib')(td);
describe('td.verifyOnce', () => {
/** **************************************************************************
*/
it('works as expected when the call was made', () => {
const fn = td.function();
td.when(fn(td.matchers.anything())).thenReturn('yay');
fn('something');
td.verifyOnce(fn('something'));
});
/** **************************************************************************
*/
it('throws as normal when call was not made', () => {
const fn = td.function();
td.when(fn(td.matchers.anything())).thenReturn('yay');
fn('something else');
try {
td.verifyOnce(fn('something'));
} catch (err) {
expect(err.message, 'to begin with', 'Unsatisfied verification on test double.\n\n');
}
});
});
| pingvinen/testdoublejs-convenience | test/unit/verifyOnce.spec.js | JavaScript | mit | 870 |
using System;
using System.Collections.Generic;
using System.Text;
namespace P06_TrafficLights.Enums
{
public enum LightState
{
Green = 1,
Yellow = 2,
Red = 3
}
}
| Hris91/C-Development-New | C# OOP Advanced/Exercises/04.Reflection-Exercise/P06_TrafficLights/Enums/LightState.cs | C# | mit | 203 |
import unittest
from pyvdp.merchantmeasurement import MerchantBenchmarkModel
class TestRetrieveMetricsPayloadModel(unittest.TestCase):
def test_attributes(self):
attrs = {
'requestHeader': object,
'requestData': object
}
model = MerchantBenchmarkModel(**attrs)
for attr, value in attrs.items():
self.assertTrue(hasattr(model, attr), 'missing %s attribute' % attr)
self.assertEqual(model.__getattribute__(attr), value)
class TestRequestHeader(unittest.TestCase):
def test_attributes(self):
attrs = {
'messageDateTime': str,
'requestMessageId': str
}
model = MerchantBenchmarkModel.RequestHeader(**attrs)
for attr, value in attrs.items():
self.assertTrue(hasattr(model, attr), 'missing %s attribute' % attr)
class TestRequestData(unittest.TestCase):
def test_attributes(self):
attrs = {
'merchantCategoryCodes': list,
'merchantCategoryGroupsCodes': list,
'zipList': list,
'msaList': list,
'countryList': list,
'monthList': list,
'groupList': list,
'cardPresentIndicator': '2'
}
model = MerchantBenchmarkModel.RequestData(**attrs)
for attr, value in attrs.items():
self.assertTrue(hasattr(model, attr), 'missing %s attribute' % attr)
self.assertEqual(model.__getattribute__(attr), value)
| ppokrovsky/pyvdp | tests/pyvdp/merchantmeasurement/test_models.py | Python | mit | 1,513 |
#!/bin/bash
# Created by Ben Bass
# Copyright 2013 Technology Revealed. All rights reserved.
# PI schedule
vers="pi-schedule-0.3"
# 0.1 Initial testing
# 0.2 default setting to true, changed logic for Saturday and Sunday.
# 0.3 Changing local to local.plist, and variable to IsWeekday from SendPILogs, and swapped default to False.
log="/Library/Logs/com.trmacs/pi-schedule.log"
err_log="/Library/Logs/com.trmacs/pi-schedule-err.log"
exec 1>> "${log}"
exec 2>> "${err_log}"
dayofweek=$(date +%A)
when=$(date +"%A %B %e, %G at %I:%M %p")
IsWeekday=`/usr/libexec/PlistBuddy -c "Print :IsWeekday" /Library/Scripts/trmacs/settings.plist`
# Check to see if IsWeekday exists, if not, then add it.
if [ -z "$IsWeekday" ]; then
echo "SendPILogs does not exits, Adding. on $when"
/usr/libexec/PlistBuddy -c "Add :IsWeekday bool True" /Library/Scripts/trmacs/settings.plist
fi
if [ "$dayofweek" == "Saturday" ]; then
echo "Disabling the mailing of PI logs for the weekend on $when"
/usr/libexec/PlistBuddy -c "Set :IsWeekday False" /Library/Scripts/trmacs/settings.plist
exit 0
fi
if [ "$dayofweek" == "Sunday" ]; then
echo "Disabling the mailing of PI logs for the weekend on $when"
/usr/libexec/PlistBuddy -c "Set :IsWeekday False" /Library/Scripts/trmacs/settings.plist
exit 0
fi
if [ "$dayofweek" == "Monday" ]; then
echo "Enabling PI logs to be mailed on $when"
echo " "
/usr/libexec/PlistBuddy -c "Set :IsWeekday True" /Library/Scripts/trmacs/settings.plist
exit 0
fi
# default set the sending of the logs to true
echo "Closing - Setting to True by default on $when"
/usr/libexec/PlistBuddy -c "Set :IsWeekday True" /Library/Scripts/trmacs/settings.plist
exit 0
| benbasscom/Private-Eyes | Scripts/pi-schedule.sh | Shell | mit | 1,675 |
---
layout: post
title: "Welcome to Erics booty!"
date: 2020-06-05 19:12:21 -0500
categories: jekyll update
---
You’ll find this post in your `_posts` directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run `jekyll serve`, which launches a web server and auto-regenerates your site when a file is updated.
Jekyll requires blog post files to be named according to the following format:
`YEAR-MONTH-DAY-title.MARKUP`
Where `YEAR` is a four-digit number, `MONTH` and `DAY` are both two-digit numbers, and `MARKUP` is the file extension representing the format used in the file. After that, include the necessary front matter. Take a look at the source for this post to get an idea about how it works.
Jekyll also offers powerful support for code snippets:
{% highlight ruby %}
def print_hi(name)
puts "Hi, #{name}"
end
print_hi('Tom')
#=> prints 'Hi, Tom' to STDOUT.
{% endhighlight %}
Check out the [Jekyll docs][jekyll-docs] for more info on how to get the most out of Jekyll. File all bugs/feature requests at [Jekyll’s GitHub repo][jekyll-gh]. If you have questions, you can ask them on [Jekyll Talk][jekyll-talk].
[jekyll-docs]: https://jekyllrb.com/docs/home
[jekyll-gh]: https://github.com/jekyll/jekyll
[jekyll-talk]: https://talk.jekyllrb.com/
| Sailia/Sailia.github.io | blog/_posts/2020-06-05-welcome-to-jekyll.markdown | Markdown | mit | 1,370 |
<h1>Edit {{.Title}}</h1>
<form action="/save/{{.Title}}" method="POST">
<div><textarea name="body" rows="20" cols="80">{{printf "%s" .Body}}</textarea></div>
<div><input type="submit" value="Save"></div>
</form>
| ScottMaclure/gowiki | templates/edit.html | HTML | mit | 221 |
/*
* Copyright 1997-2022 Optimatika
*
* 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 org.ojalgo.finance.business;
import java.math.BigDecimal;
import java.util.Currency;
import org.ojalgo.function.constant.BigMath;
import org.ojalgo.type.StandardType;
public interface QuantityPriceAmountStructure {
static BigDecimal getImpliedAmount(final QuantityPriceAmountStructure structure) {
final BigDecimal quantity = structure.getQuantity();
final BigDecimal price = structure.getPrice();
if ((quantity != null) && (price != null)) {
return BigMath.MULTIPLY.invoke(quantity, price);
} else {
return BigMath.ZERO;
}
}
static BigDecimal getImpliedPrice(final QuantityPriceAmountStructure structure) {
final BigDecimal quantity = structure.getQuantity();
final BigDecimal amount = structure.getAmount();
if ((amount != null) && (quantity != null) && (quantity.signum() != 0)) {
return BigMath.DIVIDE.invoke(amount, quantity);
} else {
return BigMath.ONE;
}
}
static BigDecimal getImpliedQuantity(final QuantityPriceAmountStructure structure) {
final BigDecimal price = structure.getPrice();
final BigDecimal amount = structure.getAmount();
if ((amount != null) && (price != null) && (price.signum() != 0)) {
return BigMath.DIVIDE.invoke(amount, price);
} else {
return BigMath.ZERO;
}
}
/**
* quantity * price = amount
*
* @see StandardType#AMOUNT
*/
BigDecimal getAmount();
Currency getCurrency();
/**
* quantity * price = amount
*
* @see StandardType#PRICE
*/
BigDecimal getPrice();
/**
* quantity * price = amount
*
* @see StandardType#QUANTITY
*/
BigDecimal getQuantity();
}
| optimatika/ojAlgo-finance | src/main/java/org/ojalgo/finance/business/QuantityPriceAmountStructure.java | Java | mit | 2,924 |
<!DOCTYPE html>
<html dir="ltr" lang="en-US">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="author" content="SemiColonWeb" />
<!-- Stylesheets
============================================= -->
<link href="http://fonts.googleapis.com/css?family=Lato:300,400,400italic,600,700|Raleway:300,400,500,600,700|Crete+Round:400italic" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="css/bootstrap.css" type="text/css" />
<link rel="stylesheet" href="style.css" type="text/css" />
<link rel="stylesheet" href="css/dark.css" type="text/css" />
<link rel="stylesheet" href="css/font-icons.css" type="text/css" />
<link rel="stylesheet" href="css/animate.css" type="text/css" />
<link rel="stylesheet" href="css/magnific-popup.css" type="text/css" />
<link rel="stylesheet" href="css/responsive.css" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!--[if lt IE 9]>
<script src="http://css3-mediaqueries-js.googlecode.com/svn/trunk/css3-mediaqueries.js"></script>
<![endif]-->
<!-- Document Title
============================================= -->
<title>Page | Canvas</title>
</head>
<body class="stretched">
<!-- Document Wrapper
============================================= -->
<div id="wrapper" class="clearfix">
<!-- Header
============================================= -->
<header id="header" class="full-header">
<div id="header-wrap">
<div class="container clearfix">
<div id="primary-menu-trigger"><i class="icon-reorder"></i></div>
<!-- Logo
============================================= -->
<div id="logo">
<a href="index.html" class="standard-logo" data-dark-logo="images/logo-dark.png"><img src="images/logo.png" alt="Canvas Logo"></a>
<a href="index.html" class="retina-logo" data-dark-logo="images/[email protected]"><img src="images/[email protected]" alt="Canvas Logo"></a>
</div><!-- #logo end -->
<!-- Primary Navigation
============================================= -->
<nav id="primary-menu">
<ul>
<li><a href="index.html"><div>Home</div></a>
<ul>
<li><a href="index-corporate.html"><div>Home - Corporate</div></a>
<ul>
<li><a href="index-corporate.html"><div>Corporate - Layout 1</div></a></li>
<li><a href="index-corporate-2.html"><div>Corporate - Layout 2</div></a></li>
<li><a href="index-corporate-3.html"><div>Corporate - Layout 3</div></a></li>
<li><a href="index-corporate-4.html"><div>Corporate - Layout 4</div></a></li>
</ul>
</li>
<li><a href="index-portfolio.html"><div>Home - Portfolio</div></a>
<ul>
<li><a href="index-portfolio.html"><div>Portfolio - Layout 1</div></a></li>
<li><a href="index-portfolio-2.html"><div>Portfolio - Layout 2</div></a></li>
<li><a href="index-portfolio-3.html"><div>Portfolio - Masonry</div></a></li>
<li><a href="index-portfolio-4.html"><div>Portfolio - AJAX</div></a></li>
</ul>
</li>
<li><a href="index-blog.html"><div>Home - Blog</div></a>
<ul>
<li><a href="index-blog.html"><div>Blog - Layout 1</div></a></li>
<li><a href="index-blog-2.html"><div>Blog - Layout 2</div></a></li>
<li><a href="index-blog-3.html"><div>Blog - Layout 3</div></a></li>
</ul>
</li>
<li><a href="index-shop.html"><div>Home - Shop</div></a>
<ul>
<li><a href="index-shop.html"><div>Shop - Layout 1</div></a></li>
<li><a href="index-shop-2.html"><div>Shop - Layout 2</div></a></li>
</ul>
</li>
<li><a href="index-magazine.html"><div>Home - Magazine</div></a>
<ul>
<li><a href="index-magazine.html"><div>Magazine - Layout 1</div></a></li>
<li><a href="index-magazine-2.html"><div>Magazine - Layout 2</div></a></li>
<li><a href="index-magazine-3.html"><div>Magazine - Layout 3</div></a></li>
</ul>
</li>
<li><a href="landing.html"><div>Home - Landing Page</div></a>
<ul>
<li><a href="landing.html"><div>Landing Page - Layout 1</div></a></li>
<li><a href="landing-2.html"><div>Landing Page - Layout 2</div></a></li>
<li><a href="landing-3.html"><div>Landing Page - Layout 3</div></a></li>
<li><a href="landing-4.html"><div>Landing Page - Layout 4</div></a></li>
<li><a href="landing-5.html"><div>Landing Page - Layout 5</div></a></li>
</ul>
</li>
<li><a href="index-fullscreen-image.html"><div>Home - Full Screen</div></a>
<ul>
<li><a href="index-fullscreen-image.html"><div>Full Screen - Image</div></a></li>
<li><a href="index-fullscreen-slider.html"><div>Full Screen - Slider</div></a></li>
<li><a href="index-fullscreen-video.html"><div>Full Screen - Video</div></a></li>
</ul>
</li>
<li><a href="index-onepage.html"><div>Home - One Page</div></a>
<ul>
<li><a href="index-onepage.html"><div>One Page - Default</div></a></li>
<li><a href="index-onepage-2.html"><div>One Page - Submenu</div></a></li>
<li><a href="index-onepage-3.html"><div>One Page - Dots Style</div></a></li>
</ul>
</li>
<li><a href="index-wedding.html"><div>Home - Wedding</div></a></li>
<li><a href="index-restaurant.html"><div>Home - Restaurant</div></a></li>
<li><a href="index-events.html"><div>Home - Events</div></a></li>
<li><a href="index-parallax.html"><div>Home - Parallax</div></a></li>
<li><a href="index-app-showcase.html"><div>Home - App Showcase</div></a></li>
<li><a href="index-boxed.html"><div>Home - Boxed Layout</div></a></li>
</ul>
</li>
<li><a href="#"><div>Features</div></a>
<ul>
<li><a href="#"><div><i class="icon-stack"></i>Sliders</div></a>
<ul>
<li><a href="slider-revolution.html"><div>Revolution Slider</div></a>
<ul>
<li><a href="rs-demo-premium-concept.html"><div>Premium Templates</div></a></li>
<li><a href="slider-revolution.html"><div>Full Screen</div></a></li>
<li><a href="slider-revolution-fullwidth.html"><div>Full Width</div></a></li>
<li><a href="slider-revolution-kenburns.html"><div>Kenburns Effect</div></a></li>
<li><a href="slider-revolution-html5-videos.html"><div>HTML5 Video</div></a></li>
</ul>
</li>
<li><a href="slider-canvas.html"><div>Canvas Slider</div></a>
<ul>
<li><a href="slider-canvas.html"><div>Full Width</div></a></li>
<li><a href="slider-canvas-fade.html"><div>Fade Transition</div></a></li>
<li><a href="slider-canvas-autoplay.html"><div>Autoplay Feature</div></a></li>
<li><a href="slider-canvas-video-event.html"><div>Custom Video Event</div></a></li>
<li><a href="slider-canvas-pagination.html"><div>Pagination Navigation</div></a></li>
<li><a href="slider-canvas-3.html"><div>3 Columns</div></a></li>
<li><a href="slider-canvas-4.html"><div>4 Columns</div></a></li>
<li><a href="slider-canvas-5.html"><div>5 Columns</div></a></li>
</ul>
</li>
<li><a href="slider-flex.html"><div>Flex Slider</div></a>
<ul>
<li><a href="slider-flex.html"><div>Default Layout</div></a></li>
<li><a href="slider-flex-thumbs.html"><div>with Thumbs</div></a></li>
</ul>
</li>
<li><a href="slider-owl.html"><div>Owl Slider</div></a>
<ul>
<li><a href="slider-owl-full.html"><div>Full Width</div></a></li>
<li><a href="slider-owl.html"><div>Boxed Width</div></a></li>
<li><a href="slider-owl-videos.html"><div>Video Slider</div></a></li>
</ul>
</li>
<li><a href="static-parallax.html"><div>Static Media</div></a>
<ul>
<li><a href="static-parallax.html"><div>Static - Parallax</div></a></li>
<li><a href="static-image.html"><div>Static - Image</div></a></li>
<li><a href="static-thumbs-grid.html"><div>Static - Thumb Gallery</div></a></li>
<li><a href="static-html5-video.html"><div>Static - HTML5 Video</div></a></li>
<li><a href="static-embed-video.html"><div>Static - Embedded Video</div></a></li>
</ul>
</li>
<li><a href="slider-camera.html"><div>Camera Slider</div></a></li>
<li><a href="slider-elastic.html"><div>Elastic Slider</div></a></li>
<li><a href="slider-nivo.html"><div>Nivo Slider</div></a></li>
</ul>
</li>
<li><a href="widgets.html"><div><i class="icon-gift"></i>Widgets</div></a>
<ul>
<li><a href="widgets.html"><div>Links</div></a></li>
<li><a href="widgets.html"><div>Flickr Photostream</div></a></li>
<li><a href="widgets.html"><div>Dribbble Shots</div></a></li>
<li><a href="widgets.html"><div>Instagram Feed</div></a></li>
<li><a href="widgets.html"><div>Posts List</div></a></li>
<li><a href="widgets.html"><div>Twitter Feed</div></a></li>
<li><a href="widgets.html"><div>Tabbed Widgets</div></a></li>
<li><a href="widgets.html"><div>Carousel</div></a></li>
<li><a href="widgets.html"><div>Subscribers</div></a></li>
<li><a href="widgets.html"><div>Social Icons</div></a></li>
<li><a href="widgets.html"><div>Testimonials</div></a></li>
<li><a href="widgets.html"><div>Quick Contact</div></a></li>
<li><a href="widgets.html"><div>Tags Cloud</div></a></li>
<li><a href="widgets.html"><div>Video Embeds</div></a></li>
<li><a href="widgets.html"><div>Raw Text/HTML</div></a></li>
</ul>
</li>
<li><a href="#"><div><i class="icon-umbrella"></i>Headers</div></a>
<ul>
<li><a href="header-light.html"><div>Light Version</div></a></li>
<li><a href="header-dark.html"><div>Dark Version</div></a></li>
<li><a href="header-transparent.html"><div>Transparent</div></a></li>
<li><a href="header-semi-transparent.html"><div>Semi Transparent</div></a>
<ul>
<li><a href="header-semi-transparent.html"><div>Light Version</div></a></li>
<li><a href="header-semi-transparent-dark.html"><div>Dark Version</div></a></li>
</ul>
</li>
<li><a href="header-side-left.html"><div>Left Side Header</div></a>
<ul>
<li><a href="header-side-left.html"><div>Fixed Position</div></a></li>
<li><a href="header-side-left-open.html"><div>OnClick Open</div></a></li>
<li><a href="header-side-left-open-push.html"><div>Push Content</div></a></li>
</ul>
</li>
<li><a href="header-side-right.html"><div>Right Side Header</div></a>
<ul>
<li><a href="header-side-right.html"><div>Fixed Position</div></a></li>
<li><a href="header-side-right-open.html"><div>OnClick Open</div></a></li>
<li><a href="header-side-right-open-push.html"><div>Push Content</div></a></li>
</ul>
</li>
<li><a href="header-floating.html"><div>Floating Version</div></a></li>
<li><a href="static-sticky.html"><div>Static Sticky</div></a></li>
<li><a href="responsive-sticky.html"><div>Responsive Sticky</div></a></li>
<li><a href="logo-changer.html"><div>Alternate Logos</div></a></li>
<li><a href="alternate-mobile-menu.html"><div>Alternate Mobile Menu</div></a></li>
</ul>
</li>
<li><a href="side-panel.html"><div><i class="icon-line-layout"></i>Side Panel</div></a>
<ul>
<li><a href="side-panel-left-overlay.html"><div>Left Overlay</div></a></li>
<li><a href="side-panel-left-push.html"><div>Left Push</div></a></li>
<li><a href="side-panel-right-overlay.html"><div>Right Overlay</div></a></li>
<li><a href="side-panel.html"><div>Right Push</div></a></li>
<li><a href="side-panel-light.html"><div>Light Background</div></a></li>
</ul>
</li>
<li><a href="mega-menu.html"><div><i class="icon-line-columns"></i>Mega Menu</div></a></li>
<li><a href="#"><div><i class="icon-align-justify2"></i>Menu Styles</div></a>
<ul>
<li><a href="header-light.html"><div>Menu - Style 1</div></a></li>
<li><a href="menu-2.html"><div>Menu - Style 2</div></a></li>
<li><a href="menu-3.html"><div>Menu - Style 3</div></a></li>
<li><a href="menu-4.html"><div>Menu - Style 4</div></a></li>
<li><a href="menu-5.html"><div>Menu - Style 5</div></a></li>
<li><a href="menu-6.html"><div>Menu - Style 6</div></a></li>
<li><a href="menu-7.html"><div>Menu - Style 7</div></a></li>
<li><a href="menu-8.html"><div>Menu - Style 8</div></a></li>
<li><a href="menu-9.html"><div>Menu - Style 9</div></a></li>
<li><a href="menu-10.html"><div>Menu - Overlay</div></a></li>
<li><a href="split-menu.html"><div>Menu - Split Layout</div></a></li>
</ul>
</li>
<li><a href="#"><div><i class="icon-ok-sign"></i>Page Titles</div></a>
<ul>
<li><a href="page.html"><div>Left Align</div></a></li>
<li><a href="page-title-right.html"><div>Right Align</div></a></li>
<li><a href="page-title-center.html"><div>Center Align</div></a></li>
<li><a href="page-titledark.html"><div>Dark Style</div></a></li>
<li><a href="page-title-pattern.html"><div>Pattern Background</div></a></li>
<li><a href="page-title-parallax.html"><div>Parallax Background</div></a>
<ul>
<li><a href="page-title-parallax.html"><div>Default Header</div></a></li>
<li><a href="page-title-parallax-header.html"><div>Transparent Header</div></a></li>
</ul>
</li>
<li><a href="page-title-video.html"><div>HTML5 Video</div></a></li>
<li><a href="page-title-nobg.html"><div>No Background</div></a></li>
<li><a href="page-title-mini.html"><div>Mini Version</div></a></li>
</ul>
</li>
<li><a href="contact.html"><div><i class="icon-envelope-alt"></i>Contact Pages</div></a>
<ul>
<li><a href="contact.html">Contact 1</a></li>
<li><a href="contact-2.html">Contact 2</a></li>
<li><a href="contact-3.html">Contact 3</a></li>
<li><a href="contact-4.html">Contact 4</a></li>
<li><a href="contact-5.html">Contact 5</a></li>
<li><a href="contact-6.html">Contact 6</a></li>
<li><a href="contact-7.html">Contact 7</a></li>
</ul>
</li>
<li><a href="#footer" data-scrollto="#footer"><div><i class="icon-th"></i>Footers</div></a>
<ul>
<li><a href="sticky-footer.html"><div>Sticky Footer</div></a></li>
<li><a href="#footer" data-scrollto="#footer"><div>Footer - Layout 1</div></a></li>
<li><a href="footer-2.html#footer"><div>Footer - Layout 2</div></a></li>
<li><a href="footer-3.html#footer"><div>Footer - Layout 3</div></a></li>
<li><a href="footer-4.html#footer"><div>Footer - Layout 4</div></a></li>
<li><a href="footer-5.html#footer"><div>Footer - Layout 5</div></a></li>
<li><a href="footer-6.html#footer"><div>Footer - Layout 6</div></a></li>
<li><a href="footer-7.html#footer"><div>Footer - Layout 7</div></a></li>
</ul>
</li>
<li><a href="#"><div><i class="icon-calendar3"></i>Events</div></a>
<ul>
<li><a href="events-calendar.html"><div>Full Width Calendar</div></a></li>
<li><a href="events-list.html"><div>Events List</div></a>
<ul>
<li><a href="events-list.html"><div>Right Sidebar</div></a></li>
<li><a href="events-list-left-sidebar.html"><div>Left Sidebar</div></a></li>
<li><a href="events-list-both-sidebar.html"><div>Both Sidebar</div></a></li>
<li><a href="events-list-fullwidth.html"><div>Full Width</div></a></li>
<li><a href="events-list-parallax.html"><div>Parallax List</div></a></li>
</ul>
</li>
<li><a href="event-single.html"><div>Single Event</div></a>
<ul>
<li><a href="event-single-right-sidebar.html"><div>Right Sidebar</div></a></li>
<li><a href="event-single-left-sidebar.html"><div>Left Sidebar</div></a></li>
<li><a href="event-single-both-sidebar.html"><div>Both Sidebar</div></a></li>
<li><a href="event-single.html"><div>Full Width</div></a></li>
</ul>
</li>
<li><a href="event-single-full-width-image.html"><div>Single Event - Full</div></a>
<ul>
<li><a href="event-single-full-width-image.html"><div>Parallax Image</div></a></li>
<li><a href="event-single-full-width-map.html"><div>Google Map</div></a></li>
<li><a href="event-single-full-width-slider.html"><div>Slider Gallery</div></a></li>
<li><a href="event-single-full-width-video.html"><div>HTML5 Video</div></a></li>
</ul>
</li>
</ul>
</li>
<li><a href="modal-onload.html"><div><i class="icon-line-expand"></i>Modal OnLoad</div></a>
<ul>
<li><a href="modal-onload.html"><div>Simple Layout</div></a></li>
<li><a href="modal-onload-iframe.html"><div>Video iFrame</div></a></li>
<li><a href="modal-onload-subscribe.html"><div>Subscription Form</div></a></li>
<li><a href="modal-onload-common-height.html"><div>Common Height</div></a></li>
<li><a href="modal-onload-cookie.html"><div>Cookies Enabled</div></a></li>
</ul>
</li>
<li><a href="coming-soon.html"><div><i class="icon-time"></i>Coming Soon</div></a>
<ul>
<li><a href="coming-soon.html"><div>Simple Layout</div></a></li>
<li><a href="coming-soon-2.html"><div>Parallax Image</div></a></li>
<li><a href="coming-soon-3.html"><div>HTML5 Video</div></a></li>
</ul>
</li>
<li><a href="profile.html"><div><i class="icon-user"></i>User Profile</div></a></li>
</ul>
</li>
<li class="mega-menu"><a href="#"><div>Pages</div></a>
<div class="mega-menu-content style-2 clearfix">
<ul class="mega-menu-column col-md-3">
<li class="mega-menu-title"><a href="#"><div>Introduction</div></a>
<ul>
<li><a href="about.html"><div>About Us</div></a></li>
<li><a href="about-2.html"><div>About Us - Layout 2</div></a></li>
<li><a href="about-me.html"><div>About Me</div></a></li>
<li><a href="team.html"><div>Team Members</div></a></li>
<li><a href="jobs.html"><div>Careers</div></a></li>
<li><a href="side-navigation.html"><div>Side Navigation</div></a></li>
<li><a href="page-submenu.html"><div>Page Submenu</div></a></li>
<li><a href="sitemap.html"><div>Sitemap</div></a></li>
</ul>
</li>
</ul>
<ul class="mega-menu-column col-md-3">
<li class="mega-menu-title"><a href="#"><div>Utility</div></a>
<ul>
<li><a href="services.html"><div>Services - Layout 1</div></a></li>
<li><a href="services-2.html"><div>Services - Layout 2</div></a></li>
<li><a href="services-3.html"><div>Services - Layout 3</div></a></li>
<li><a href="faqs.html"><div>FAQs - Layout 1</div></a></li>
<li><a href="faqs-2.html"><div>FAQs - Layout 2</div></a></li>
<li><a href="faqs-3.html"><div>FAQs - Layout 3</div></a></li>
<li><a href="faqs-4.html"><div>FAQs - Layout 4</div></a></li>
<li><a href="maintenance.html"><div>Maintenance Page</div></a></li>
</ul>
</li>
</ul>
<ul class="mega-menu-column col-md-3">
<li class="mega-menu-title"><a href="#"><div>Layout Grids</div></a>
<ul>
<li><a href="full-width.html"><div>Full Width</div></a></li>
<li><a href="full-width-wide.html"><div>Full Width - Wide</div></a></li>
<li><a href="right-sidebar.html"><div>Right Sidebar</div></a></li>
<li><a href="left-sidebar.html"><div>Left Sidebar</div></a></li>
<li><a href="both-sidebar.html"><div>Both Sidebar</div></a></li>
<li><a href="both-right-sidebar.html"><div>Both Right Sidebar</div></a></li>
<li><a href="both-left-sidebar.html"><div>Both Left Sidebar</div></a></li>
<li><a href="blank-page.html"><div>Blank Page</div></a></li>
</ul>
</li>
</ul>
<ul class="mega-menu-column col-md-3">
<li class="mega-menu-title"><a href="#"><div>Miscellaneous</div></a>
<ul>
<li><a href="login-register.html"><div>Login/Register</div></a></li>
<li><a href="login-register-2.html"><div>Login/Register - Style 2</div></a></li>
<li><a href="login-register-3.html"><div>Login/Register - Style 3</div></a></li>
<li><a href="login-1.html"><div>Login - Style 1</div></a></li>
<li><a href="login-2.html"><div>Login - Style 2</div></a></li>
<li><a href="404.html"><div>404 - Simple Layout</div></a></li>
<li><a href="404-2.html"><div>404 - Parallax Image</div></a></li>
<li><a href="404-3.html"><div>404 - HTML5 Video</div></a></li>
</ul>
</li>
</ul>
</div>
</li>
<li class="mega-menu"><a href="#"><div>Portfolio</div></a>
<div class="mega-menu-content style-2 clearfix">
<ul class="mega-menu-column col-5">
<li class="mega-menu-title"><a href="#"><div>Grids</div></a>
<ul>
<li><a href="portfolio-1.html"><div>1 Column</div></a></li>
<li><a href="portfolio-2.html"><div>2 Columns</div></a></li>
<li><a href="portfolio-3.html"><div>3 Columns</div></a></li>
<li><a href="portfolio.html"><div>4 Columns</div></a></li>
<li><a href="portfolio-5.html"><div>5 Columns</div></a></li>
<li><a href="portfolio-6.html"><div>6 Columns</div></a></li>
</ul>
</li>
</ul>
<ul class="mega-menu-column col-5">
<li class="mega-menu-title"><a href="#"><div>Masonry</div></a>
<ul>
<li><a href="portfolio-mixed-masonry.html"><div>Mixed Columns</div></a></li>
<li><a href="portfolio-2-masonry.html"><div>2 Columns</div></a></li>
<li><a href="portfolio-3-masonry.html"><div>3 Columns</div></a></li>
<li><a href="portfolio-masonry.html"><div>4 Columns</div></a></li>
<li><a href="portfolio-5-masonry.html"><div>5 Columns</div></a></li>
<li><a href="portfolio-6-masonry.html"><div>6 Columns</div></a></li>
</ul>
</li>
</ul>
<ul class="mega-menu-column col-5">
<li class="mega-menu-title"><a href="#"><div>Loading Styles</div></a>
<ul>
<li><a href="portfolio.html"><div>jQuery Filter</div></a></li>
<li><a href="portfolio-jpagination.html"><div>jQuery Pagination</div></a></li>
<li><a href="portfolio-infinity-scroll.html"><div>Infinity Scroll</div></a></li>
<li><a href="portfolio-ajax.html"><div>AJAX In Page</div></a></li>
<li><a href="portfolio-ajax-in-modal.html"><div>AJAX In Modal</div></a></li>
<li><a href="portfolio-filter-styles.html"><div>Filter Styles</div></a></li>
</ul>
</li>
</ul>
<ul class="mega-menu-column col-5">
<li class="mega-menu-title"><a href="#"><div>Single Project</div></a>
<ul>
<li><a href="portfolio-single-extended.html"><div>Extended Item</div></a></li>
<li><a href="portfolio-single-fullwidth.html"><div>Parallax Image</div></a></li>
<li><a href="portfolio-single-gallery-full.html"><div>Slider Gallery</div></a></li>
<li><a href="portfolio-single-video-fullwidth-left-sidebar.html"><div>HTML5 Video</div></a></li>
<li><a href="portfolio-single-thumbs-right-sidebar.html"><div>Masonry Thumbs</div></a></li>
<li><a href="portfolio-single-video-both-sidebar.html"><div>Embed Video</div></a></li>
</ul>
</li>
</ul>
<ul class="mega-menu-column col-5">
<li class="mega-menu-title"><a href="#"><div>Layouts</div></a>
<ul>
<li><a href="portfolio-nomargin.html"><div>Default</div></a></li>
<li><a href="portfolio-1-alt-right-sidebar.html"><div>Right Sidebar</div></a></li>
<li><a href="portfolio-3-left-sidebar.html"><div>Left Sidebar</div></a></li>
<li><a href="portfolio-2-both-sidebar.html"><div>Both Sidebar</div></a></li>
<li><a href="portfolio-fullwidth-notitle.html"><div>100% Width</div></a></li>
<li><a href="portfolio-parallax.html"><div>Parallax</div></a></li>
</ul>
</li>
</ul>
</div>
</li>
<li class="mega-menu"><a href="#"><div>Blog</div></a>
<div class="mega-menu-content style-2 clearfix">
<ul class="mega-menu-column col-md-3">
<li class="mega-menu-title"><a href="#"><div>Default</div></a>
<ul>
<li><a href="blog.html"><div>Right Sidebar</div></a></li>
<li><a href="blog-left-sidebar.html"><div>Left Sidebar</div></a></li>
<li><a href="blog-both-sidebar.html"><div>Both Sidebar</div></a></li>
<li><a href="blog-full-width.html"><div>Full Width</div></a></li>
</ul>
</li>
<li class="mega-menu-title"><a href="#"><div>Timeline</div></a>
<ul>
<li><a href="blog-timeline-right-sidebar.html"><div>Right Sidebar</div></a></li>
<li><a href="blog-timeline-left-sidebar.html"><div>Left Sidebar</div></a></li>
<li><a href="blog-timeline.html"><div>Full Width</div></a></li>
</ul>
</li>
</ul>
<ul class="mega-menu-column col-md-3">
<li class="mega-menu-title"><a href="#"><div>Masonry</div></a>
<ul>
<li><a href="blog-masonry.html"><div>4 Columns</div></a></li>
<li><a href="blog-masonry-3.html"><div>3 Columns</div></a></li>
<li><a href="blog-masonry-2.html"><div>2 Columns</div></a></li>
<li><a href="blog-masonry-full.html"><div>100% Width</div></a></li>
</ul>
</li>
<li class="mega-menu-title"><a href="#"><div>Grid</div></a>
<ul>
<li><a href="blog-grid.html"><div>4 Columns</div></a></li>
<li><a href="blog-grid-3.html"><div>3 Columns</div></a></li>
<li><a href="blog-grid-2.html"><div>2 Columns</div></a></li>
</ul>
</li>
</ul>
<ul class="mega-menu-column col-md-3">
<li class="mega-menu-title"><a href="#"><div>Small Thumbs</div></a>
<ul>
<li><a href="blog-small-left-sidebar.html"><div>Left Sidebar</div></a></li>
<li><a href="blog-small.html"><div>Right Sidebar</div></a></li>
<li><a href="blog-small-both-sidebar.html"><div>Both Sidebar</div></a></li>
<li><a href="blog-small-full-width.html"><div>Full Width</div></a></li>
<li><a href="blog-small-alt.html"><div>Alternate Layout</div></a></li>
</ul>
</li>
<li class="mega-menu-title"><a href="#"><div>Item Splitting</div></a>
<ul>
<li><a href="blog-grid.html"><div>Pagination</div></a></li>
<li><a href="blog-masonry.html"><div>Infinite Scroll</div></a></li>
</ul>
</li>
</ul>
<ul class="mega-menu-column col-md-3">
<li class="mega-menu-title"><a href="#"><div>Single</div></a>
<ul>
<li><a href="blog-single.html"><div>Default Layout</div></a></li>
<li><a href="blog-single-left-sidebar.html"><div>Left Sidebar</div></a></li>
<li><a href="blog-single-full.html"><div>Full Width</div></a></li>
<li><a href="blog-single-small.html"><div>Small Image</div></a></li>
<li><a href="blog-single-split-right-sidebar.html"><div>Split Layout</div></a></li>
</ul>
</li>
<li class="mega-menu-title"><a href="#"><div>Comments Module</div></a>
<ul>
<li><a href="blog-single-left-sidebar.html#comments"><div>Facebook Comments</div></a></li>
<li><a href="blog-single-small.html#comments"><div>Disqus Comments</div></a></li>
</ul>
</li>
</ul>
</div>
</li>
<li><a href="shop.html"><div>Shop</div></a>
<ul>
<li><a href="shop.html"><div>4 Columns</div></a></li>
<li><a href="shop-3.html"><div>3 Columns</div></a>
<ul>
<li><a href="shop-3.html"><div>Full Width</div></a></li>
<li><a href="shop-3-right-sidebar.html"><div>Right Sidebar</div></a></li>
<li><a href="shop-3-left-sidebar.html"><div>Left Sidebar</div></a></li>
</ul>
</li>
<li><a href="shop-2.html"><div>2 Columns</div></a>
<ul>
<li><a href="shop-2-right-sidebar.html"><div>Right Sidebar</div></a></li>
<li><a href="shop-2-left-sidebar.html"><div>Left Sidebar</div></a></li>
<li><a href="shop-2-both-sidebar.html"><div>Both Sidebar</div></a></li>
</ul>
</li>
<li><a href="shop-1.html"><div>1 Columns</div></a>
<ul>
<li><a href="shop-1.html"><div>Full Width</div></a></li>
<li><a href="shop-1-right-sidebar.html"><div>Right Sidebar</div></a></li>
<li><a href="shop-1-left-sidebar.html"><div>Left Sidebar</div></a></li>
<li><a href="shop-1-both-sidebar.html"><div>Both Sidebar</div></a></li>
</ul>
</li>
<li><a href="shop-category-parallax.html"><div>Categories - Parallax</div></a></li>
<li><a href="shop-combination-filter.html"><div>Combination Filter</div></a></li>
<li><a href="shop-single.html"><div>Single Product</div></a>
<ul>
<li><a href="shop-single.html"><div>Full Width</div></a></li>
<li><a href="shop-single-right-sidebar.html"><div>Right Sidebar</div></a></li>
<li><a href="shop-single-left-sidebar.html"><div>Left Sidebar</div></a></li>
<li><a href="shop-single-both-sidebar.html"><div>Both Sidebar</div></a></li>
</ul>
</li>
<li><a href="cart.html"><div>Cart</div></a></li>
<li><a href="checkout.html"><div>Checkout</div></a></li>
</ul>
</li>
<li class="mega-menu"><a href="#"><div>Shortcodes</div></a>
<div class="mega-menu-content clearfix">
<ul class="mega-menu-column col-5">
<li><a href="animations.html"><div><i class="icon-magic"></i>Animations</div></a></li>
<li><a href="buttons.html"><div><i class="icon-link"></i>Buttons</div></a></li>
<li><a href="carousel.html"><div><i class="icon-heart3"></i>Carousel</div></a></li>
<li><a href="charts.html"><div><i class="icon-bar-chart"></i>Charts</div></a></li>
<li><a href="clients.html"><div><i class="icon-apple"></i>Clients</div></a></li>
<li><a href="columns-grids.html"><div><i class="icon-th-large"></i>Columns</div></a></li>
<li><a href="counters.html"><div><i class="icon-time"></i>Counters</div></a></li>
<li><a href="component-datatable.html"><div><i class="icon-table"></i>Data Tables</div></a></li>
<li><a href="component-datepicker.html"><div><i class="icon-calendar3"></i>Date & Time Pickers</div></a></li>
</ul>
<ul class="mega-menu-column col-5">
<li><a href="dividers.html"><div><i class="icon-indent-right"></i>Dividers</div></a></li>
<li><a href="featured-boxes.html"><div><i class="icon-lightbulb"></i>Icon Boxes</div></a></li>
<li><a href="gallery.html"><div><i class="icon-picture"></i>Galleries</div></a></li>
<li><a href="headings-dropcaps.html"><div><i class="icon-pencil2"></i>Heading Styles</div></a></li>
<li><a href="icon-lists.html"><div><i class="icon-list-alt"></i>Icon Lists</div></a></li>
<li><a href="labels-badges.html"><div><i class="icon-plus-sign"></i>Labels</div></a></li>
<li><a href="lightbox.html"><div><i class="icon-resize-full"></i>Lightbox</div></a></li>
<li><a href="component-editable.html"><div><i class="icon-edit"></i>Editable Fields</div></a></li>
<li><a href="component-uploads.html"><div><i class="icon-line-upload"></i>File Uploads</div></a></li>
</ul>
<ul class="mega-menu-column col-5">
<li><a href="lists-panels.html"><div><i class="icon-th-list"></i>Lists & Panels</div></a></li>
<li><a href="maps.html"><div><i class="icon-map-marker2"></i>Maps</div></a></li>
<li><a href="media-embeds.html"><div><i class="icon-play"></i>Media Embeds</div></a></li>
<li><a href="modal-popovers.html"><div><i class="icon-move"></i>Modal Boxes</div></a></li>
<li><a href="navigation.html"><div><i class="icon-align-justify2"></i>Navigations</div></a></li>
<li><a href="pagination-progress.html"><div><i class="icon-cogs"></i>Pagination</div></a></li>
<li><a href="pie-skills.html"><div><i class="icon-tasks"></i>Pies & Skills</div></a></li>
<li><a href="component-range-slider.html"><div><i class="icon-line-move"></i>Range Slider</div></a></li>
<li><a href="component-ratings.html"><div><i class="icon-star3"></i>Star Ratings</div></a></li>
</ul>
<ul class="mega-menu-column col-5">
<li><a href="pricing.html"><div><i class="icon-dollar"></i>Pricing Boxes</div></a></li>
<li><a href="process-steps.html"><div><i class="icon-thumbs-up"></i>Process Steps</div></a></li>
<li><a href="promo-boxes.html"><div><i class="icon-rocket"></i>Promo Boxes</div></a></li>
<li><a href="quotes-blockquotes.html"><div><i class="icon-quote-left"></i>Blockquotes</div></a></li>
<li><a href="responsive.html"><div><i class="icon-laptop2"></i>Responsive</div></a></li>
<li><a href="sections.html"><div><i class="icon-folder-open"></i>Sections</div></a></li>
<li><a href="social-icons.html"><div><i class="icon-facebook2"></i>Social Icons</div></a></li>
<li><a href="component-select-picker.html"><div><i class="icon-select"></i>Select Picker</div></a></li>
<li><a href="component-select-box.html"><div><i class="icon-line-columns"></i>Select Boxes</div></a></li>
</ul>
<ul class="mega-menu-column col-5">
<li><a href="style-boxes.html"><div><i class="icon-exclamation-sign"></i>Alert Boxes</div></a></li>
<li><a href="styled-icons.html"><div><i class="icon-flag2"></i>Styled Icons</div></a></li>
<li><a href="tables.html"><div><i class="icon-table"></i>Tables</div></a></li>
<li><a href="tabs.html"><div><i class="icon-star3"></i>Tabs</div></a></li>
<li><a href="testimonials-twitter.html"><div><i class="icon-user4"></i>Testimonials</div></a></li>
<li><a href="thumbnails-slider.html"><div><i class="icon-camera3"></i>Thumbnails</div></a></li>
<li><a href="toggles-accordions.html"><div><i class="icon-ok-circle"></i>Toggles</div></a></li>
<li><a href="component-radios-switches.html"><div><i class="icon-line-square-check"></i>Radios & Switches</div></a></li>
<li><a href="component-typeahead.html"><div><i class="icon-type"></i>Input Typeahead</div></a></li>
</ul>
</div>
</li>
</ul>
<!-- Top Cart
============================================= -->
<div id="top-cart">
<a href="#" id="top-cart-trigger"><i class="icon-shopping-cart"></i><span>5</span></a>
<div class="top-cart-content">
<div class="top-cart-title">
<h4>Shopping Cart</h4>
</div>
<div class="top-cart-items">
<div class="top-cart-item clearfix">
<div class="top-cart-item-image">
<a href="#"><img src="images/shop/small/1.jpg" alt="Blue Round-Neck Tshirt" /></a>
</div>
<div class="top-cart-item-desc">
<a href="#">Blue Round-Neck Tshirt</a>
<span class="top-cart-item-price">$19.99</span>
<span class="top-cart-item-quantity">x 2</span>
</div>
</div>
<div class="top-cart-item clearfix">
<div class="top-cart-item-image">
<a href="#"><img src="images/shop/small/6.jpg" alt="Light Blue Denim Dress" /></a>
</div>
<div class="top-cart-item-desc">
<a href="#">Light Blue Denim Dress</a>
<span class="top-cart-item-price">$24.99</span>
<span class="top-cart-item-quantity">x 3</span>
</div>
</div>
</div>
<div class="top-cart-action clearfix">
<span class="fleft top-checkout-price">$114.95</span>
<button class="button button-3d button-small nomargin fright">View Cart</button>
</div>
</div>
</div><!-- #top-cart end -->
<!-- Top Search
============================================= -->
<div id="top-search">
<a href="#" id="top-search-trigger"><i class="icon-search3"></i><i class="icon-line-cross"></i></a>
<form action="search.html" method="get">
<input type="text" name="q" class="form-control" value="" placeholder="Type & Hit Enter..">
</form>
</div><!-- #top-search end -->
</nav><!-- #primary-menu end -->
</div>
</div>
</header><!-- #header end -->
<!-- Page Title
============================================= -->
<section id="page-title">
<div class="container clearfix">
<h1>Page</h1>
<span>A Blank Page</span>
<ol class="breadcrumb">
<li><a href="#">Home</a></li>
<li><a href="#">Library</a></li>
<li class="active">Data</li>
</ol>
</div>
</section><!-- #page-title end -->
<!-- Content
============================================= -->
<section id="content">
<div class="content-wrap">
<div class="container clearfix">
</div>
</div>
</section><!-- #content end -->
<!-- Footer
============================================= -->
<footer id="footer" class="dark">
<div class="container">
<!-- Footer Widgets
============================================= -->
<div class="footer-widgets-wrap clearfix">
<div class="col_two_third">
<div class="col_one_third">
<div class="widget clearfix">
<img src="images/footer-widget-logo.png" alt="" class="footer-logo">
<p>We believe in <strong>Simple</strong>, <strong>Creative</strong> & <strong>Flexible</strong> Design Standards.</p>
<div style="background: url('images/world-map.png') no-repeat center center; background-size: 100%;">
<address>
<strong>Headquarters:</strong><br>
795 Folsom Ave, Suite 600<br>
San Francisco, CA 94107<br>
</address>
<abbr title="Phone Number"><strong>Phone:</strong></abbr> (91) 8547 632521<br>
<abbr title="Fax"><strong>Fax:</strong></abbr> (91) 11 4752 1433<br>
<abbr title="Email Address"><strong>Email:</strong></abbr> [email protected]
</div>
</div>
</div>
<div class="col_one_third">
<div class="widget widget_links clearfix">
<h4>Blogroll</h4>
<ul>
<li><a href="http://codex.wordpress.org/">Documentation</a></li>
<li><a href="http://wordpress.org/support/forum/requests-and-feedback">Feedback</a></li>
<li><a href="http://wordpress.org/extend/plugins/">Plugins</a></li>
<li><a href="http://wordpress.org/support/">Support Forums</a></li>
<li><a href="http://wordpress.org/extend/themes/">Themes</a></li>
<li><a href="http://wordpress.org/news/">WordPress Blog</a></li>
<li><a href="http://planet.wordpress.org/">WordPress Planet</a></li>
</ul>
</div>
</div>
<div class="col_one_third col_last">
<div class="widget clearfix">
<h4>Recent Posts</h4>
<div id="post-list-footer">
<div class="spost clearfix">
<div class="entry-c">
<div class="entry-title">
<h4><a href="#">Lorem ipsum dolor sit amet, consectetur</a></h4>
</div>
<ul class="entry-meta">
<li>10th July 2014</li>
</ul>
</div>
</div>
<div class="spost clearfix">
<div class="entry-c">
<div class="entry-title">
<h4><a href="#">Elit Assumenda vel amet dolorum quasi</a></h4>
</div>
<ul class="entry-meta">
<li>10th July 2014</li>
</ul>
</div>
</div>
<div class="spost clearfix">
<div class="entry-c">
<div class="entry-title">
<h4><a href="#">Debitis nihil placeat, illum est nisi</a></h4>
</div>
<ul class="entry-meta">
<li>10th July 2014</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col_one_third col_last">
<div class="widget clearfix" style="margin-bottom: -20px;">
<div class="row">
<div class="col-md-6 bottommargin-sm">
<div class="counter counter-small"><span data-from="50" data-to="15065421" data-refresh-interval="80" data-speed="3000" data-comma="true"></span></div>
<h5 class="nobottommargin">Total Downloads</h5>
</div>
<div class="col-md-6 bottommargin-sm">
<div class="counter counter-small"><span data-from="100" data-to="18465" data-refresh-interval="50" data-speed="2000" data-comma="true"></span></div>
<h5 class="nobottommargin">Clients</h5>
</div>
</div>
</div>
<div class="widget subscribe-widget customjs subscribe-form clearfix">
<h5><strong>Subscribe</strong> to Our Newsletter to get Important News, Amazing Offers & Inside Scoops:</h5>
<div class="widget-subscribe-form-result"></div>
<form action="http://audio-equipmentrental.com/include/subscribe.php" role="form" method="post" class="nobottommargin">
<div class="input-group divcenter">
<span class="input-group-addon"><i class="icon-email2"></i></span>
<input type="email" id="widget-subscribe-form-email" name="widget-subscribe-form-email" class="form-control required email" placeholder="Enter your Email">
<span class="input-group-btn">
<button class="btn btn-success" type="submit">Subscribe</button>
</span>
</div>
</form>
</div>
<div class="widget clearfix" style="margin-bottom: -20px;">
<div class="row">
<div class="col-md-6 clearfix bottommargin-sm">
<a href="#" class="social-icon si-dark si-colored si-facebook nobottommargin" style="margin-right: 10px;">
<i class="icon-facebook"></i>
<i class="icon-facebook"></i>
</a>
<a href="#"><small style="display: block; margin-top: 3px;"><strong>Like us</strong><br>on Facebook</small></a>
</div>
<div class="col-md-6 clearfix">
<a href="#" class="social-icon si-dark si-colored si-rss nobottommargin" style="margin-right: 10px;">
<i class="icon-rss"></i>
<i class="icon-rss"></i>
</a>
<a href="#"><small style="display: block; margin-top: 3px;"><strong>Subscribe</strong><br>to RSS Feeds</small></a>
</div>
</div>
</div>
</div>
</div><!-- .footer-widgets-wrap end -->
</div>
<!-- Copyrights
============================================= -->
<div id="copyrights">
<div class="container clearfix">
<div class="col_half">
Copyrights © 2014 All Rights Reserved by Canvas Inc.<br>
<div class="copyright-links"><a href="#">Terms of Use</a> / <a href="#">Privacy Policy</a></div>
</div>
<div class="col_half col_last tright">
<div class="fright clearfix">
<a href="#" class="social-icon si-small si-borderless si-facebook">
<i class="icon-facebook"></i>
<i class="icon-facebook"></i>
</a>
<a href="#" class="social-icon si-small si-borderless si-twitter">
<i class="icon-twitter"></i>
<i class="icon-twitter"></i>
</a>
<a href="#" class="social-icon si-small si-borderless si-gplus">
<i class="icon-gplus"></i>
<i class="icon-gplus"></i>
</a>
<a href="#" class="social-icon si-small si-borderless si-pinterest">
<i class="icon-pinterest"></i>
<i class="icon-pinterest"></i>
</a>
<a href="#" class="social-icon si-small si-borderless si-vimeo">
<i class="icon-vimeo"></i>
<i class="icon-vimeo"></i>
</a>
<a href="#" class="social-icon si-small si-borderless si-github">
<i class="icon-github"></i>
<i class="icon-github"></i>
</a>
<a href="#" class="social-icon si-small si-borderless si-yahoo">
<i class="icon-yahoo"></i>
<i class="icon-yahoo"></i>
</a>
<a href="#" class="social-icon si-small si-borderless si-linkedin">
<i class="icon-linkedin"></i>
<i class="icon-linkedin"></i>
</a>
</div>
<div class="clear"></div>
<i class="icon-envelope2"></i> [email protected] <span class="middot">·</span> <i class="icon-headphones"></i> +91-11-6541-6369 <span class="middot">·</span> <i class="icon-skype2"></i> CanvasOnSkype
</div>
</div>
</div><!-- #copyrights end -->
</footer><!-- #footer end -->
</div><!-- #wrapper end -->
<!-- Go To Top
============================================= -->
<div id="gotoTop" class="icon-angle-up"></div>
<!-- External JavaScripts
============================================= -->
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/plugins.js"></script>
<!-- Footer Scripts
============================================= -->
<script type="text/javascript" src="js/functions.js"></script>
</body>
</html> | borgees/we-solve | front/public/page.html | HTML | mit | 48,509 |
<?php
/*
* This file is part of the `src-run/arthur-doctrine-exception-library` project.
*
* (c) Rob Frawley 2nd <[email protected]>
*
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*/
namespace SR\Doctrine\Exception\Action;
class ActionPersistException extends ActionException
{
}
| scr-be/arthur-doctrine-utils-library | lib/Action/ActionPersistException.php | PHP | mit | 367 |
<?php
namespace Poll\PollBundle\Common;
/**
* Rozhrani povinne pro kazdy identifikovatelny objekt
*
* @author kadleto2
*/
interface Identified {
/**
* @return string identifikator objektu
*/
public function getId();
}
| ana-balica/anketa | src/Poll/PollBundle/Common/Identified.php | PHP | mit | 232 |
import { NgModule } from '@angular/core';
import { SharedModule } from '../../shared/shared.module';
import { CoursesHelpersModule } from './course-helpers/course-helpers.module';
import { CoursesFormHelpersModule } from './form-helpers/form-helpers.module';
import { AuthorsService } from './authors.service';
import { CoursesService } from './courses.service';
import { OrderByPipe } from './order-by.pipe';
@NgModule({
imports: [
SharedModule.forStupidMdIconModule(),
],
declarations: [
OrderByPipe,
],
providers: [
AuthorsService,
CoursesService,
],
exports: [
SharedModule,
CoursesHelpersModule,
CoursesFormHelpersModule,
OrderByPipe,
],
})
export class CoursesSharedModule { }
| mzolkiewski/ng-courses | src/app/courses/shared/shared.module.ts | TypeScript | mit | 734 |
<!--
- @file descriptorvalueordinallist.html
- @brief Template for a list of ordinal value of a type of descriptor (model)
- @author Frédéric SCHERMA (INRA UMR1095)
- @date 2016-10-28
- @copyright Copyright (c) 2016 INRA/CIRAD
- @license MIT (see LICENSE file)
- @details
-->
<div class="table-advanced-head">
<table class="table table-striped descriptor-table table-advanced">
<thead>
<tr scope="row">
<th class="unselectable">
<span class="action column-sort-id fa fa-sort column-action" column-name="id" column-type="alpha"></span><%- _t("Code") %>
</th>
<th class="unselectable">
<span class="action column-sort-ordinal fa fa-sort column-action" column-name="ordinal" column-type="numeric"></span><%- _t("Ordinal") %>
</th>
<th class="unselectable">
<span class="action column-sort-value0 fa fa-sort column-action" column-name="value0" column-type="alpha"></span><%- _t(format.fields[0]) || _t("Value0") %>
</th>
</tr>
</thead>
</table>
</div>
<div class="table-advanced-body">
<table class="table table-striped descriptor-table table-advanced">
<tbody class="descriptor-value-list"></tbody>
</table>
</div> | coll-gate/collgate | client/apps/descriptor/templates/descriptorvalueordinallist.html | HTML | mit | 1,342 |
/**
* ______ ___
* / ____/___ / | _____________ __________
* / / __/ __ \/ /| |/ ___/ ___/ _ \/ ___/ ___/
* / /_/ / /_/ / ___ / /__/ /__/ __(__ |__ )
* \____/\____/_/ |_\___/\___/\___/____/____/
*
* The MIT License (MIT)
* Copyright (c) 2009-2022 Gerardo Orellana <hello @ goaccess.io>
*
* 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.
*/
#ifndef BROWSERS_H_INCLUDED
#define BROWSERS_H_INCLUDED
#define BROWSER_TYPE_LEN 13
#define MAX_LINE_BROWSERS 128
#define MAX_CUSTOM_BROWSERS 256
/* Each Browser contains the number of hits and the Browser's type */
typedef struct GBrowser_ {
char browser_type[BROWSER_TYPE_LEN];
int hits;
} GBrowser;
char *verify_browser (char *str, char *browser_type);
int is_crawler (const char *agent);
void free_browsers_hash (void);
void parse_browsers_file (void);
#endif
| allinurl/goaccess | src/browsers.h | C | mit | 1,871 |
require_relative 'app'
require_relative 'networking'
require_relative 'paging_array'
module Hockey
# HockeyApp API Client for Application
class Client
#
def initialize(token, debug: false, network: nil)
@net = network || Networking.new(token, debug:debug)
@cached_apps = nil
end
# List all apps for the logged user, including owned apps, developer apps, member apps, and tester apps on HockeyApp.
#
# @return [Array<App>] an array of {App} objects.
# @param page [Fixnum] optional, used for pagination
def apps(page: 1)
@cached_apps ||= []
if @cached_apps.empty?
obj = @net.get_object '/api/2/apps'
obj['apps'].each do |hashobj|
@cached_apps << App.create_from(hashobj, @net)
end
end
PagingArray.paginate with: @cached_apps, page: page
end
# List all teams for an account.
#
# @return [Hockey::PagingArray<Team>] an array of {Team} objects
# @param page [Fixnum] optional, used for pagination
def teams(page: 1)
teams = PagingArray.new
obj = @net.get_object('/api/2/teams') do |req|
req.params[:page] = page
end
obj['teams'].each do |hashobj|
teams << Team.create_from(hashobj, @net)
end
teams.update_page(obj)
teams
end
# Create a new app without uploading a file on HockeyApp.
# return an App object.
def new_app(title: '', bundle_identifier: '', platform: 'iOS')
obj = @net.post_object '/api/2/apps/new', {:title=>title, :bundle_identifier=>bundle_identifier, :platform=>platform, :release_type=>0}
app = App.create_from(obj, @net)
app
end
end
end
| yagihiro/hockey | lib/hockeyhelper/client.rb | Ruby | mit | 1,694 |
package <%= app_id %>.ui;
public interface LoadingListener {
void onLoadingStarted();
void onLoadingFinished();
}
| agramian/generator-android | generators/app/templates/dynamic/ui/LoadingListener.java | Java | mit | 126 |
<?php
/**
* PHPUnit
*
* Copyright (c) 2002-2009, Sebastian Bergmann <[email protected]>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of Sebastian Bergmann nor the names of his
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* @category Testing
* @package PHPUnit
* @author Mike Lively <[email protected]>
* @copyright 2002-2009 Sebastian Bergmann <[email protected]>
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
* @version SVN: $Id: IDatabaseOperation.php 4403 2008-12-31 09:26:51Z sb $
* @link http://www.phpunit.de/
* @since File available since Release 3.2.0
*/
require_once 'PHPUnit/Framework.php';
require_once 'PHPUnit/Util/Filter.php';
PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT');
/**
* Provides a basic interface and functionality for executing database
* operations against a connection using a specific dataSet.
*
* @category Testing
* @package PHPUnit
* @author Mike Lively <[email protected]>
* @copyright 2009 Mike Lively <[email protected]>
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
* @version Release: 3.4.0RC3
* @link http://www.phpunit.de/
* @since Class available since Release 3.2.0
*/
interface PHPUnit_Extensions_Database_Operation_IDatabaseOperation
{
/**
* Executes the database operation against the given $connection for the
* given $dataSet.
*
* @param PHPUnit_Extensions_Database_DB_IDatabaseConnection $connection
* @param PHPUnit_Extensions_Database_DataSet_IDataSet $dataSet
* @throws PHPUnit_Extensions_Database_Operation_Exception
*/
public function execute(PHPUnit_Extensions_Database_DB_IDatabaseConnection $connection, PHPUnit_Extensions_Database_DataSet_IDataSet $dataSet);
}
?>
| olle/baseweb | lib/php/PHPUnit/Extensions/Database/Operation/IDatabaseOperation.php | PHP | mit | 3,270 |
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>base.py</title>
<link rel="stylesheet" href="../../pycco.css">
</head>
<body>
<div id="background"></div>
<div id='container'>
<div class='section'>
<div class='docs'><h1>base.py</h1></div>
</div>
<div class='clearall'>
<div class='section' id='section-0'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-0'>#</a>
</div>
<p>Copyright (C) 2010 Google Inc.</p>
<p>Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at</p>
<pre><code> http://www.apache.org/licenses/LICENSE-2.0
</code></pre>
<p>Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Basic abilities that all GoogleCL clients have.</p>
</div>
<div class='code'>
<div class="highlight"><pre></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-1'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-1'>#</a>
</div>
</div>
<div class='code'>
<div class="highlight"><pre><span class="kn">import</span> <span class="nn">googlecl</span>
<span class="kn">import</span> <span class="nn">logging</span>
<span class="kn">import</span> <span class="nn">re</span>
<span class="kn">import</span> <span class="nn">urllib</span>
<span class="kn">import</span> <span class="nn">time</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-2'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-2'>#</a>
</div>
<p>Renamed here to reduce verbosity in other sections</p>
</div>
<div class='code'>
<div class="highlight"><pre><span class="n">safe_encode</span> <span class="o">=</span> <span class="n">googlecl</span><span class="o">.</span><span class="n">safe_encode</span>
<span class="n">safe_decode</span> <span class="o">=</span> <span class="n">googlecl</span><span class="o">.</span><span class="n">safe_decode</span>
<span class="n">LOG</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="n">__name__</span><span class="p">)</span>
<span class="n">HTTP_ERROR_CODES_TO_RETRY_ON</span> <span class="o">=</span> <span class="p">[</span><span class="mi">302</span><span class="p">,</span> <span class="mi">500</span><span class="p">,</span> <span class="mi">503</span><span class="p">]</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-3'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-3'>#</a>
</div>
<p>Base error for GoogleCL exceptions.</p>
</div>
<div class='code'>
<div class="highlight"><pre><span class="k">class</span> <span class="nc">Error</span><span class="p">(</span><span class="ne">Exception</span><span class="p">):</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-4'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-4'>#</a>
</div>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="k">pass</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-5'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-5'>#</a>
</div>
<p>This class CANNOT be used unless an instance also inherits from
either gdata.client.GDClient or gdata.service.GDataService somehow.
TODO: pylint bugs out over the missing functions/attributes here,
but there are no run-time errors. Make pylint happy!
Extension of gdata.GDataService specific to GoogleCL.</p>
</div>
<div class='code'>
<div class="highlight"><pre><span class="k">class</span> <span class="nc">BaseCL</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-6'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-6'>#</a>
</div>
<p>Subclass of Exception to catch when there is a request error.
Should be one of gdata.service.RequestError or gdata.client.RequestError</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="n">request_error</span> <span class="o">=</span> <span class="bp">None</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-7'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-7'>#</a>
</div>
<p>Set some basic attributes common to all instances.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">section</span><span class="p">,</span> <span class="n">config</span><span class="p">,</span> <span class="n">request_error_class</span><span class="p">):</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-8'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-8'>#</a>
</div>
<p>Args:
section: Section of the config file that options will be found under.
config: Configuration parser.
request_error_class: Exception class raised when a request fails.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="bp">self</span><span class="o">.</span><span class="n">request_error</span> <span class="o">=</span> <span class="n">request_error_class</span>
<span class="n">large_max_results</span> <span class="o">=</span> <span class="mi">10000</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-9'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-9'>#</a>
</div>
<p>Because each new xxxServiceCL class should use the more specific
superclass's <strong>init</strong> function, don't define one here.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="bp">self</span><span class="o">.</span><span class="n">source</span> <span class="o">=</span> <span class="s">'GoogleCL'</span>
<span class="bp">self</span><span class="o">.</span><span class="n">client_id</span> <span class="o">=</span> <span class="s">'GoogleCL'</span>
<span class="bp">self</span><span class="o">.</span><span class="n">config</span> <span class="o">=</span> <span class="n">config</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-10'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-10'>#</a>
</div>
<p>Some new attributes, not inherited.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="bp">self</span><span class="o">.</span><span class="n">use_regex</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">config</span><span class="o">.</span><span class="n">lazy_get</span><span class="p">(</span><span class="n">section</span><span class="p">,</span>
<span class="s">'regex'</span><span class="p">,</span>
<span class="n">default</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span>
<span class="n">option_type</span><span class="o">=</span><span class="nb">bool</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">cap_results</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">config</span><span class="o">.</span><span class="n">lazy_get</span><span class="p">(</span><span class="n">section</span><span class="p">,</span>
<span class="s">'cap_results'</span><span class="p">,</span>
<span class="n">default</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span>
<span class="n">option_type</span><span class="o">=</span><span class="nb">bool</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">max_results</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">config</span><span class="o">.</span><span class="n">lazy_get</span><span class="p">(</span><span class="n">section</span><span class="p">,</span>
<span class="s">'max_results'</span><span class="p">,</span>
<span class="n">default</span><span class="o">=</span><span class="n">large_max_results</span><span class="p">,</span>
<span class="n">option_type</span><span class="o">=</span><span class="nb">int</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">max_retries</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">config</span><span class="o">.</span><span class="n">lazy_get</span><span class="p">(</span><span class="n">section</span><span class="p">,</span>
<span class="s">'max_retries'</span><span class="p">,</span>
<span class="n">default</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span>
<span class="n">option_type</span><span class="o">=</span><span class="nb">int</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">retry_delay</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">config</span><span class="o">.</span><span class="n">lazy_get</span><span class="p">(</span><span class="n">section</span><span class="p">,</span>
<span class="s">'retry_delay'</span><span class="p">,</span>
<span class="n">default</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span>
<span class="n">option_type</span><span class="o">=</span><span class="nb">float</span><span class="p">)</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">service_name</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">auth_service</span>
<span class="k">except</span> <span class="ne">AttributeError</span><span class="p">:</span>
<span class="n">service_name</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">service</span>
<span class="k">if</span> <span class="p">(</span><span class="n">service_name</span> <span class="o">!=</span> <span class="s">'youtube'</span> <span class="ow">and</span>
<span class="p">(</span><span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">cap_results</span> <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">max_results</span> <span class="o"><</span> <span class="n">large_max_results</span><span class="p">)):</span>
<span class="n">LOG</span><span class="o">.</span><span class="n">warning</span><span class="p">(</span><span class="s">'You are requesting only '</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">max_results</span><span class="p">)</span> <span class="o">+</span>
<span class="s">' results per query -- this may be slow'</span><span class="p">)</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-11'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-11'>#</a>
</div>
<p>Extends Delete to handle a list of entries.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="k">def</span> <span class="nf">delete_entry_list</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">entries</span><span class="p">,</span> <span class="n">entry_type</span><span class="p">,</span> <span class="n">prompt</span><span class="p">,</span>
<span class="n">callback</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-12'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-12'>#</a>
</div>
<p>Keyword arguments:
entries: List of entries to delete.
entry_type: String describing the thing being deleted (e.g. album, post).
prompt: Whether or not the user should be prompted to confirm deletion.
callback: function which takes entry as an argument and deletes it</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="k">if</span> <span class="n">prompt</span><span class="p">:</span>
<span class="n">prompt_message</span> <span class="o">=</span> <span class="p">(</span><span class="s">'Are you SURE you want to delete </span><span class="si">%s</span><span class="s"> "</span><span class="si">%s</span><span class="s">"? (y/N): '</span> <span class="o">%</span>
<span class="p">(</span><span class="n">entry_type</span><span class="p">,</span> <span class="s">'</span><span class="si">%s</span><span class="s">'</span><span class="p">))</span>
<span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="n">entries</span><span class="p">:</span>
<span class="k">if</span> <span class="n">prompt</span><span class="p">:</span>
<span class="n">delete_str</span> <span class="o">=</span> <span class="nb">raw_input</span><span class="p">(</span><span class="n">prompt_message</span> <span class="o">%</span> <span class="n">safe_encode</span><span class="p">(</span><span class="n">item</span><span class="o">.</span><span class="n">title</span><span class="o">.</span><span class="n">text</span><span class="p">))</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">delete_str</span><span class="p">:</span>
<span class="n">delete</span> <span class="o">=</span> <span class="bp">False</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">delete</span> <span class="o">=</span> <span class="n">delete_str</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span> <span class="o">==</span> <span class="s">'y'</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">delete</span> <span class="o">=</span> <span class="bp">True</span>
<span class="k">if</span> <span class="n">delete</span><span class="p">:</span>
<span class="k">try</span><span class="p">:</span>
<span class="k">if</span> <span class="n">callback</span><span class="p">:</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-13'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-13'>#</a>
</div>
<p>if callback is provided then deletion is done by calling it</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="n">callback</span><span class="p">(</span><span class="n">item</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-14'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-14'>#</a>
</div>
<p>Later versions are defined with lowercase function names.
These versions take GDataEntry objects, older takes the edit link.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="s">'delete'</span><span class="p">):</span>
<span class="bp">self</span><span class="o">.</span><span class="n">delete</span><span class="p">(</span><span class="n">item</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">Delete</span><span class="p">(</span><span class="n">item</span><span class="o">.</span><span class="n">GetEditLink</span><span class="p">()</span><span class="o">.</span><span class="n">href</span><span class="p">)</span>
<span class="k">except</span> <span class="bp">self</span><span class="o">.</span><span class="n">request_error</span><span class="p">,</span> <span class="n">err</span><span class="p">:</span>
<span class="n">LOG</span><span class="o">.</span><span class="n">warning</span><span class="p">(</span><span class="s">'Could not delete '</span> <span class="o">+</span> <span class="n">entry_type</span> <span class="o">+</span> <span class="s">': '</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">err</span><span class="p">))</span>
<span class="n">DeleteEntryList</span> <span class="o">=</span> <span class="n">delete_entry_list</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-15'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-15'>#</a>
</div>
<p>XXX: This should be shortened. test simpler version with client and service.
Get the email address that has the OAuth access token.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="k">def</span> <span class="nf">get_email</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">_uri</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">redirects_remaining</span><span class="o">=</span><span class="mi">4</span><span class="p">):</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-16'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-16'>#</a>
</div>
<p>Uses the "Email address" scope to return the email address the user
was logged in as when he/she authorized the OAuth request token.</p>
<p>Keyword arguments:
uri: Uri to get data from. Should only be used for redirects.</p>
<p>Returns:
Full email address ('[email protected]') of the account with access.</p>
<p>Use request instead of Get to avoid the attempts to parse from xml.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="n">server_response</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">request</span><span class="p">(</span><span class="s">'GET'</span><span class="p">,</span>
<span class="n">_uri</span> <span class="ow">or</span> <span class="s">'https://www.googleapis.com/userinfo/email'</span><span class="p">)</span>
<span class="n">result_body</span> <span class="o">=</span> <span class="n">server_response</span><span class="o">.</span><span class="n">read</span><span class="p">()</span>
<span class="k">if</span> <span class="n">server_response</span><span class="o">.</span><span class="n">status</span> <span class="o">==</span> <span class="mi">200</span><span class="p">:</span>
<span class="k">try</span><span class="p">:</span>
<span class="kn">from</span> <span class="nn">urlparse</span> <span class="kn">import</span> <span class="n">parse_qs</span>
<span class="n">parse_func</span> <span class="o">=</span> <span class="n">parse_qs</span>
<span class="k">except</span> <span class="ne">ImportError</span><span class="p">:</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-17'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-17'>#</a>
</div>
<p>parse_qs was moved to urlparse from cgi in python2.6</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="kn">import</span> <span class="nn">cgi</span>
<span class="n">parse_func</span> <span class="o">=</span> <span class="n">cgi</span><span class="o">.</span><span class="n">parse_qs</span>
<span class="n">param_dict</span> <span class="o">=</span> <span class="n">parse_func</span><span class="p">(</span><span class="n">result_body</span><span class="p">)</span>
<span class="n">email</span> <span class="o">=</span> <span class="n">param_dict</span><span class="p">[</span><span class="s">'email'</span><span class="p">][</span><span class="mi">0</span><span class="p">]</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-18'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-18'>#</a>
</div>
<p>This block copied (with some modification) from GDataService (2.0.10)</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="k">elif</span> <span class="n">server_response</span><span class="o">.</span><span class="n">status</span> <span class="o">==</span> <span class="mi">302</span><span class="p">:</span>
<span class="k">if</span> <span class="n">redirects_remaining</span> <span class="o">></span> <span class="mi">0</span><span class="p">:</span>
<span class="n">location</span> <span class="o">=</span> <span class="p">(</span><span class="n">server_response</span><span class="o">.</span><span class="n">getheader</span><span class="p">(</span><span class="s">'Location'</span><span class="p">)</span> <span class="ow">or</span>
<span class="n">server_response</span><span class="o">.</span><span class="n">getheader</span><span class="p">(</span><span class="s">'location'</span><span class="p">))</span>
<span class="k">if</span> <span class="n">location</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span>
<span class="k">return</span> <span class="n">BaseServiceCL</span><span class="o">.</span><span class="n">get_email</span><span class="p">(</span><span class="n">location</span><span class="p">,</span>
<span class="n">redirects_remaining</span><span class="o">=</span><span class="n">redirects_remaining</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">raise</span> <span class="bp">self</span><span class="o">.</span><span class="n">request_error</span><span class="p">,</span> <span class="p">{</span><span class="s">'status'</span><span class="p">:</span> <span class="n">server_response</span><span class="o">.</span><span class="n">status</span><span class="p">,</span>
<span class="s">'reason'</span><span class="p">:</span> <span class="s">'302 received without Location header'</span><span class="p">,</span>
<span class="s">'body'</span><span class="p">:</span> <span class="n">result_body</span><span class="p">}</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">raise</span> <span class="bp">self</span><span class="o">.</span><span class="n">request_error</span><span class="p">,</span> <span class="p">{</span><span class="s">'status'</span><span class="p">:</span> <span class="n">server_response</span><span class="o">.</span><span class="n">status</span><span class="p">,</span>
<span class="s">'reason'</span><span class="p">:</span> <span class="s">'Redirect received, but redirects_remaining <= 0'</span><span class="p">,</span>
<span class="s">'body'</span><span class="p">:</span> <span class="n">result_body</span><span class="p">}</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">raise</span> <span class="bp">self</span><span class="o">.</span><span class="n">request_error</span><span class="p">,</span> <span class="p">{</span><span class="s">'status'</span><span class="p">:</span> <span class="n">server_response</span><span class="o">.</span><span class="n">status</span><span class="p">,</span>
<span class="s">'reason'</span><span class="p">:</span> <span class="n">server_response</span><span class="o">.</span><span class="n">reason</span><span class="p">,</span> <span class="s">'body'</span><span class="p">:</span> <span class="n">result_body</span><span class="p">}</span>
<span class="k">return</span> <span class="n">email</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-19'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-19'>#</a>
</div>
<p>Get a list of entries from a feed uri.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="k">def</span> <span class="nf">get_entries</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">uri</span><span class="p">,</span> <span class="n">titles</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">converter</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">desired_class</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-20'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-20'>#</a>
</div>
<p>Keyword arguments:
uri: URI to get the feed from.
titles: string or list What to look for in entry.title.text.
Default None for all entries from feed.
converter: Converter to use on the feed. If specified, will be passed
into the GetFeed method. If both converter and
desired_class are None, GetFeed is called without those
arguments.
desired_class: class descended from atom.core.XmlElement to which a
successful response should be converted. If converter=None,
then the desired_class will be used in calling the
atom.core.parse function. If both converter and
desired_class are None, GetFeed is called without those
arguments.
Returns:
List of entries.</p>
<p>XXX: Should probably go through all code and make sure title can only be
NoneType or list, not also maybe a string.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">max_results</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span>
<span class="n">uri</span> <span class="o">=</span> <span class="n">set_max_results</span><span class="p">(</span><span class="n">uri</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">max_results</span><span class="p">)</span>
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">uri</span><span class="p">,</span> <span class="nb">unicode</span><span class="p">):</span>
<span class="n">uri</span> <span class="o">=</span> <span class="n">uri</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="s">'utf-8'</span><span class="p">)</span>
<span class="n">feed</span> <span class="o">=</span> <span class="bp">None</span>
<span class="k">try</span><span class="p">:</span>
<span class="k">if</span> <span class="n">converter</span> <span class="ow">or</span> <span class="n">desired_class</span><span class="p">:</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-21'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-21'>#</a>
</div>
<p>desired_class param not available for GDataService,
only GDClient.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="k">try</span><span class="p">:</span>
<span class="n">feed</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">GetFeed</span><span class="p">(</span><span class="n">uri</span><span class="p">,</span> <span class="n">converter</span><span class="o">=</span><span class="n">converter</span><span class="p">,</span>
<span class="n">desired_class</span><span class="o">=</span><span class="n">desired_class</span><span class="p">)</span>
<span class="k">except</span> <span class="ne">TypeError</span><span class="p">:</span>
<span class="k">if</span> <span class="n">converter</span><span class="p">:</span>
<span class="n">feed</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">GetFeed</span><span class="p">(</span><span class="n">uri</span><span class="p">,</span> <span class="n">converter</span><span class="o">=</span><span class="n">converter</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">feed</span><span class="p">:</span>
<span class="n">feed</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">GetFeed</span><span class="p">(</span><span class="n">uri</span><span class="p">)</span>
<span class="k">except</span> <span class="bp">self</span><span class="o">.</span><span class="n">request_error</span><span class="p">,</span> <span class="n">err</span><span class="p">:</span>
<span class="n">error_string</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">err</span><span class="p">)</span>
<span class="n">LOG</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s">'Failed to get entries: '</span> <span class="o">+</span> <span class="n">error_string</span><span class="p">)</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-22'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-22'>#</a>
</div>
<p>Attempt to catch older gdata users and warn them when they try to upload
unsupported file types</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="k">if</span> <span class="s">"403.4 SSL required"</span> <span class="ow">in</span> <span class="n">error_string</span><span class="p">:</span>
<span class="k">print</span> <span class="s">"</span><span class="se">\n\n</span><span class="s">If you are trying upload to Google Docs, your version of "</span>
<span class="k">print</span> <span class="s">"python-gdata may not support this action. Please see this wiki page "</span>
<span class="k">print</span> <span class="s">"for more details:"</span>
<span class="k">print</span> <span class="s">"http://code.google.com/p/googlecl/wiki/UploadingGoogleDocs</span><span class="se">\n\n</span><span class="s">"</span>
<span class="k">return</span> <span class="p">[]</span>
<span class="n">all_entries</span> <span class="o">=</span> <span class="n">feed</span><span class="o">.</span><span class="n">entry</span>
<span class="k">if</span> <span class="n">feed</span><span class="o">.</span><span class="n">GetNextLink</span><span class="p">():</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">cap_results</span><span class="p">:</span>
<span class="n">LOG</span><span class="o">.</span><span class="n">warning</span><span class="p">(</span><span class="s">'Leaving data that matches query on server.'</span> <span class="o">+</span>
<span class="s">' Increase max_results or set cap_results to False.'</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">while</span> <span class="n">feed</span> <span class="ow">and</span> <span class="n">feed</span><span class="o">.</span><span class="n">GetNextLink</span><span class="p">():</span>
<span class="n">feed</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">GetNext</span><span class="p">(</span><span class="n">feed</span><span class="p">)</span>
<span class="k">if</span> <span class="n">feed</span><span class="p">:</span>
<span class="n">all_entries</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="n">feed</span><span class="o">.</span><span class="n">entry</span><span class="p">)</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-23'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-23'>#</a>
</div>
<p>Check if title is NoneType, empty string, empty list, or a single-item
list containing any of the prior.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="k">if</span> <span class="ow">not</span> <span class="n">titles</span> <span class="ow">or</span> <span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">titles</span><span class="p">)</span> <span class="o">==</span> <span class="mi">1</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">titles</span><span class="p">[</span><span class="mi">0</span><span class="p">]):</span>
<span class="n">LOG</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">'Retrieved '</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">all_entries</span><span class="p">))</span> <span class="o">+</span>
<span class="s">' entries, returning them all'</span><span class="p">)</span>
<span class="k">return</span> <span class="n">all_entries</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">use_regex</span><span class="p">:</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-24'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-24'>#</a>
</div>
<p>Carefully build title regex.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">titles</span><span class="p">,</span> <span class="nb">basestring</span><span class="p">):</span>
<span class="n">title_regex</span> <span class="o">=</span> <span class="n">titles</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">title_regex</span> <span class="o">=</span> <span class="n">safe_decode</span><span class="p">(</span><span class="s">'|'</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">titles</span><span class="p">))</span>
<span class="n">LOG</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="n">safe_encode</span><span class="p">(</span><span class="s">'Using regex: '</span> <span class="o">+</span> <span class="n">title_regex</span><span class="p">))</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">entries</span> <span class="o">=</span> <span class="p">[</span><span class="n">entry</span> <span class="k">for</span> <span class="n">entry</span> <span class="ow">in</span> <span class="n">all_entries</span>
<span class="k">if</span> <span class="n">entry</span><span class="o">.</span><span class="n">title</span><span class="o">.</span><span class="n">text</span> <span class="ow">and</span>
<span class="n">re</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">title_regex</span><span class="p">,</span> <span class="n">safe_decode</span><span class="p">(</span><span class="n">entry</span><span class="o">.</span><span class="n">title</span><span class="o">.</span><span class="n">text</span><span class="p">))]</span>
<span class="k">except</span> <span class="n">re</span><span class="o">.</span><span class="n">error</span><span class="p">,</span> <span class="n">err</span><span class="p">:</span>
<span class="n">LOG</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s">'Regular expression error: '</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">err</span><span class="p">)</span> <span class="o">+</span> <span class="s">'!'</span><span class="p">)</span>
<span class="n">entries</span> <span class="o">=</span> <span class="p">[]</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">titles</span><span class="p">,</span> <span class="nb">list</span><span class="p">):</span>
<span class="n">title_list</span> <span class="o">=</span> <span class="n">titles</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">title_list</span> <span class="o">=</span> <span class="p">[</span><span class="n">titles</span><span class="p">]</span>
<span class="n">entries</span> <span class="o">=</span> <span class="p">[</span><span class="n">entry</span> <span class="k">for</span> <span class="n">entry</span> <span class="ow">in</span> <span class="n">all_entries</span>
<span class="k">if</span> <span class="n">safe_decode</span><span class="p">(</span><span class="n">entry</span><span class="o">.</span><span class="n">title</span><span class="o">.</span><span class="n">text</span><span class="p">)</span> <span class="ow">in</span> <span class="n">title_list</span><span class="p">]</span>
<span class="n">LOG</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">'Retrieved '</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">all_entries</span><span class="p">))</span> <span class="o">+</span>
<span class="s">' entries, returning '</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">entries</span><span class="p">))</span> <span class="o">+</span> <span class="s">' of them'</span><span class="p">)</span>
<span class="k">return</span> <span class="n">entries</span>
<span class="n">GetEntries</span> <span class="o">=</span> <span class="n">get_entries</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-25'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-25'>#</a>
</div>
<p>Return exactly one entry.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="k">def</span> <span class="nf">get_single_entry</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">uri_or_entry_list</span><span class="p">,</span> <span class="n">title</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">converter</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
<span class="n">desired_class</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-26'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-26'>#</a>
</div>
<p>Uses GetEntries to retrieve the entries, then asks the user to select one of
them by entering a number.</p>
<p>Keyword arguments:
uri_or_entry_list: URI to get feed from (See get_entries) or list of
entries to select from.
title: string Title to match on. See get_entries. Default None.
converter: Conversion function to apply to feed. See get_entries.
desired_class: class to which a successful response should be converted.
See get_entries.</p>
<p>Returns:
None if there were no matches, or one entry matching the given title.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="k">if</span> <span class="ow">not</span> <span class="n">uri_or_entry_list</span><span class="p">:</span>
<span class="k">return</span> <span class="bp">None</span>
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">uri_or_entry_list</span><span class="p">,</span> <span class="nb">basestring</span><span class="p">):</span>
<span class="n">entries</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_entries</span><span class="p">(</span><span class="n">uri_or_entry_list</span><span class="p">,</span> <span class="n">title</span><span class="p">,</span> <span class="n">converter</span><span class="p">,</span>
<span class="n">desired_class</span><span class="p">)</span>
<span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">uri_or_entry_list</span><span class="p">,</span> <span class="nb">list</span><span class="p">):</span>
<span class="n">entries</span> <span class="o">=</span> <span class="n">uri_or_entry_list</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">raise</span> <span class="n">Error</span><span class="p">(</span><span class="s">'Got unexpected type for uri_or_entry_list!'</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">entries</span><span class="p">:</span>
<span class="k">return</span> <span class="bp">None</span>
<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">entries</span><span class="p">)</span> <span class="o">==</span> <span class="mi">1</span><span class="p">:</span>
<span class="k">return</span> <span class="n">entries</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
<span class="k">elif</span> <span class="nb">len</span><span class="p">(</span><span class="n">entries</span><span class="p">)</span> <span class="o">></span> <span class="mi">1</span><span class="p">:</span>
<span class="k">print</span> <span class="s">'More than one match for title '</span> <span class="o">+</span> <span class="p">(</span><span class="n">title</span> <span class="ow">or</span> <span class="s">''</span><span class="p">)</span>
<span class="k">for</span> <span class="n">num</span><span class="p">,</span> <span class="n">entry</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">entries</span><span class="p">):</span>
<span class="k">print</span> <span class="s">'</span><span class="si">%i</span><span class="s">) </span><span class="si">%s</span><span class="s">'</span> <span class="o">%</span> <span class="p">(</span><span class="n">num</span><span class="p">,</span> <span class="n">safe_decode</span><span class="p">(</span><span class="n">entry</span><span class="o">.</span><span class="n">title</span><span class="o">.</span><span class="n">text</span><span class="p">))</span>
<span class="n">selection</span> <span class="o">=</span> <span class="o">-</span><span class="mi">1</span>
<span class="k">while</span> <span class="n">selection</span> <span class="o"><</span> <span class="mi">0</span> <span class="ow">or</span> <span class="n">selection</span> <span class="o">></span> <span class="nb">len</span><span class="p">(</span><span class="n">entries</span><span class="p">)</span><span class="o">-</span><span class="mi">1</span><span class="p">:</span>
<span class="n">selection</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="nb">raw_input</span><span class="p">(</span><span class="s">'Please select one of the items by number: '</span><span class="p">))</span>
<span class="k">return</span> <span class="n">entries</span><span class="p">[</span><span class="n">selection</span><span class="p">]</span>
<span class="n">GetSingleEntry</span> <span class="o">=</span> <span class="n">get_single_entry</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-27'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-27'>#</a>
</div>
<p>Check that the token being used is valid.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="k">def</span> <span class="nf">is_token_valid</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">test_uri</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-28'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-28'>#</a>
</div>
<p>Keyword arguments:
test_uri: URI to pass to self.Get(). Default None (raises error).</p>
<p>Returns:
True if Get was successful, False if Get raised an exception with the
string 'Token invalid' in its body, and raises any other exceptions.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="k">if</span> <span class="ow">not</span> <span class="n">test_uri</span><span class="p">:</span>
<span class="k">raise</span> <span class="n">Error</span><span class="p">(</span><span class="s">'No uri to test token with!'</span> <span class="o">+</span>
<span class="s">'(was is_token_valid extended?)'</span><span class="p">)</span>
<span class="n">test_uri</span> <span class="o">=</span> <span class="n">set_max_results</span><span class="p">(</span><span class="n">test_uri</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
<span class="k">try</span><span class="p">:</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-29'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-29'>#</a>
</div>
<p>Try to limit the number of results we get.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="bp">self</span><span class="o">.</span><span class="n">Get</span><span class="p">(</span><span class="n">test_uri</span><span class="p">)</span>
<span class="k">except</span> <span class="bp">self</span><span class="o">.</span><span class="n">request_error</span><span class="p">,</span> <span class="n">err</span><span class="p">:</span>
<span class="n">LOG</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">'Token invalid! '</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">err</span><span class="p">))</span>
<span class="k">return</span> <span class="bp">False</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">return</span> <span class="bp">True</span>
<span class="n">IsTokenValid</span> <span class="o">=</span> <span class="n">is_token_valid</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-30'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-30'>#</a>
</div>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="k">def</span> <span class="nf">request_access</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">domain</span><span class="p">,</span> <span class="n">display_name</span><span class="p">,</span> <span class="n">scopes</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">browser</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
<span class="k">raise</span> <span class="ne">NotImplementedError</span><span class="p">(</span><span class="s">'request_access must be defined!'</span><span class="p">)</span>
<span class="n">RequestAccess</span> <span class="o">=</span> <span class="n">request_access</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-31'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-31'>#</a>
</div>
<p>Retries an operation if certain status codes are returned.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="k">def</span> <span class="nf">retry_operation</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-32'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-32'>#</a>
</div>
<p>Wraps self.original_operation in a try block for catching request errors.
self.original_operation should be an alias to the original method being
attempted. See BaseServiceCL.retry_(get/post/delete).</p>
<p>Args:
<em>args: The </em>args passed to the operation being attempted.
<strong>kwargs: The </strong>kwargs passed to the operation being attempted.</p>
<p>Returns:
Results from original operation being attempted.</p>
<p>Raises:
Exception: On exception from original operation. Certain RequestErrors
will be caught, and the original operation attempted again, if enough
retries remain (set by self.max_retries)</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="n">try_forever</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">max_retries</span> <span class="o"><=</span> <span class="mi">0</span>
<span class="n">attempts_remaining</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">max_retries</span>
<span class="n">err</span> <span class="o">=</span> <span class="bp">None</span>
<span class="k">while</span> <span class="n">try_forever</span> <span class="ow">or</span> <span class="n">attempts_remaining</span><span class="p">:</span>
<span class="k">try</span><span class="p">:</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">original_operation</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
<span class="k">except</span> <span class="bp">self</span><span class="o">.</span><span class="n">request_error</span><span class="p">,</span> <span class="n">err</span><span class="p">:</span>
<span class="k">try</span><span class="p">:</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-33'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-33'>#</a>
</div>
<p>RequestError defined in gdata.client</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="n">status_code</span> <span class="o">=</span> <span class="n">err</span><span class="o">.</span><span class="n">status</span>
<span class="k">except</span> <span class="ne">AttributeError</span><span class="p">:</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-34'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-34'>#</a>
</div>
<p>RequestError defined in gdata.service (and raised by GDataService)</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="n">status_code</span> <span class="o">=</span> <span class="n">err</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="mi">0</span><span class="p">][</span><span class="s">'status'</span><span class="p">]</span>
<span class="k">if</span> <span class="n">status_code</span> <span class="ow">in</span> <span class="n">HTTP_ERROR_CODES_TO_RETRY_ON</span><span class="p">:</span>
<span class="n">attempts_remaining</span> <span class="o">-=</span> <span class="mi">1</span>
<span class="n">LOG</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">'Retrying when you would have failed otherwise!'</span><span class="p">)</span>
<span class="n">LOG</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">'Arguments: </span><span class="si">%s</span><span class="s">'</span> <span class="o">%</span> <span class="nb">str</span><span class="p">(</span><span class="n">args</span><span class="p">))</span>
<span class="n">LOG</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">'Keyword arguments: </span><span class="si">%s</span><span class="s">'</span> <span class="o">%</span> <span class="n">kwargs</span><span class="p">)</span>
<span class="n">LOG</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">'Error: </span><span class="si">%s</span><span class="s">'</span> <span class="o">%</span> <span class="n">err</span><span class="p">)</span>
<span class="k">if</span> <span class="n">try_forever</span> <span class="ow">or</span> <span class="n">attempts_remaining</span><span class="p">:</span>
<span class="n">time</span><span class="o">.</span><span class="n">sleep</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">retry_delay</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">raise</span> <span class="n">err</span>
<span class="k">except</span> <span class="ne">Exception</span><span class="p">,</span> <span class="n">unexpected</span><span class="p">:</span>
<span class="n">LOG</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">'unexpected exception: </span><span class="si">%s</span><span class="s">'</span> <span class="o">%</span> <span class="n">unexpected</span><span class="p">)</span>
<span class="n">LOG</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">'Arguments: </span><span class="si">%s</span><span class="s">'</span> <span class="o">%</span> <span class="nb">str</span><span class="p">(</span><span class="n">args</span><span class="p">))</span>
<span class="n">LOG</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">'Keyword arguments: </span><span class="si">%s</span><span class="s">'</span> <span class="o">%</span> <span class="n">kwargs</span><span class="p">)</span>
<span class="k">raise</span> <span class="n">unexpected</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-35'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-35'>#</a>
</div>
<p>Can only leave above loop if err is set at least once.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="k">raise</span> <span class="n">err</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-36'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-36'>#</a>
</div>
<p>Set max-results parameter if it is not set already.</p>
</div>
<div class='code'>
<div class="highlight"><pre><span class="k">def</span> <span class="nf">set_max_results</span><span class="p">(</span><span class="n">uri</span><span class="p">,</span> <span class="nb">max</span><span class="p">):</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-37'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-37'>#</a>
</div>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="n">max_str</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="nb">max</span><span class="p">)</span>
<span class="k">if</span> <span class="n">uri</span><span class="o">.</span><span class="n">find</span><span class="p">(</span><span class="s">'?'</span><span class="p">)</span> <span class="o">==</span> <span class="o">-</span><span class="mi">1</span><span class="p">:</span>
<span class="k">return</span> <span class="n">uri</span> <span class="o">+</span> <span class="s">'?max-results='</span> <span class="o">+</span> <span class="n">max_str</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">if</span> <span class="n">uri</span><span class="o">.</span><span class="n">find</span><span class="p">(</span><span class="s">'max-results'</span><span class="p">)</span> <span class="o">==</span> <span class="o">-</span><span class="mi">1</span><span class="p">:</span>
<span class="k">return</span> <span class="n">uri</span> <span class="o">+</span> <span class="s">'&max-results='</span> <span class="o">+</span> <span class="n">max_str</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">return</span> <span class="n">uri</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-38'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-38'>#</a>
</div>
<p>The use of login_required has been deprecated - all tasks now require
logging in, and google.py does not check whether or not a task
says otherwise.
A container of requirements.</p>
</div>
<div class='code'>
<div class="highlight"><pre><span class="k">class</span> <span class="nc">Task</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-39'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-39'>#</a>
</div>
<p>Each requirement matches up with one of the attributes of the option parser
used to parse command line arguments. Requirements are given as lists.
For example, if a task needs to have attr1 and attr2 and either attr3 or 4,
the list would look like ['attr1', 'attr2', ['attr3', 'attr4']]</p>
</div>
<div class='code'>
<div class="highlight"><pre></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-40'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-40'>#</a>
</div>
<p>Constructor.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">description</span><span class="p">,</span> <span class="n">callback</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">required</span><span class="o">=</span><span class="p">[],</span> <span class="n">optional</span><span class="o">=</span><span class="p">[],</span>
<span class="n">login_required</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span> <span class="n">args_desc</span><span class="o">=</span><span class="s">''</span><span class="p">):</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-41'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-41'>#</a>
</div>
<p>Keyword arguments:
description: Description of what the task does.
callback: Function to use to execute task.
(Default None, prints a message instead of running)
required: Required options for the task. (Default None)
optional: Optional options for the task. (Default None)
login_required: If logging in with a username is required to do this task.
If True, can typically ignore 'user' as a required attribute.
(Default True)
args_desc: Description of what the arguments should be.
(Default '', for no arguments necessary for this task)</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">required</span><span class="p">,</span> <span class="nb">basestring</span><span class="p">):</span>
<span class="n">required</span> <span class="o">=</span> <span class="p">[</span><span class="n">required</span><span class="p">]</span>
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">optional</span><span class="p">,</span> <span class="nb">basestring</span><span class="p">):</span>
<span class="n">optional</span> <span class="o">=</span> <span class="p">[</span><span class="n">optional</span><span class="p">]</span>
<span class="bp">self</span><span class="o">.</span><span class="n">description</span> <span class="o">=</span> <span class="n">description</span>
<span class="bp">self</span><span class="o">.</span><span class="n">run</span> <span class="o">=</span> <span class="n">callback</span> <span class="ow">or</span> <span class="bp">self</span><span class="o">.</span><span class="n">_not_impl</span>
<span class="bp">self</span><span class="o">.</span><span class="n">required</span> <span class="o">=</span> <span class="n">required</span>
<span class="bp">self</span><span class="o">.</span><span class="n">optional</span> <span class="o">=</span> <span class="n">optional</span>
<span class="bp">self</span><span class="o">.</span><span class="n">login_required</span> <span class="o">=</span> <span class="n">login_required</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-42'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-42'>#</a>
</div>
<p>Take the "required" list, join all the terms by the following rules:
1) if the term is a string, leave it.
2) if the term is a list, join it with the ' OR ' string.
Then join the resulting list with ' AND '.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">required</span><span class="p">:</span>
<span class="n">req_str</span> <span class="o">=</span> <span class="s">' AND '</span><span class="o">.</span><span class="n">join</span><span class="p">([</span><span class="s">'('</span><span class="o">+</span><span class="s">' OR '</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">a</span><span class="p">)</span><span class="o">+</span><span class="s">')'</span> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="nb">list</span><span class="p">)</span> \
<span class="k">else</span> <span class="n">a</span> <span class="k">for</span> <span class="n">a</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">required</span><span class="p">])</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">req_str</span> <span class="o">=</span> <span class="s">'none'</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">optional</span><span class="p">:</span>
<span class="n">opt_str</span> <span class="o">=</span> <span class="s">' Optional: '</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">optional</span><span class="p">)[</span><span class="mi">1</span><span class="p">:</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s">"'"</span><span class="p">,</span> <span class="s">''</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">opt_str</span> <span class="o">=</span> <span class="s">''</span>
<span class="k">if</span> <span class="n">args_desc</span><span class="p">:</span>
<span class="n">args_desc</span> <span class="o">=</span> <span class="s">' Arguments: '</span> <span class="o">+</span> <span class="n">args_desc</span>
<span class="bp">self</span><span class="o">.</span><span class="n">usage</span> <span class="o">=</span> <span class="s">'Requires: '</span> <span class="o">+</span> <span class="n">req_str</span> <span class="o">+</span> <span class="n">opt_str</span> <span class="o">+</span> <span class="n">args_desc</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-43'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-43'>#</a>
</div>
<p>Return a list of required options that are missing.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="k">def</span> <span class="nf">get_outstanding_requirements</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">options</span><span class="p">):</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-44'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-44'>#</a>
</div>
<p>The requirements that have been specified in <options> are removed
from self.required, and any sublists in self.required have been replaced
by the first item in that sublist if none of the requirements in the
sublist were given.</p>
<p>Args:
options: instance Has attributes with names corresponding to the
requirements specified by self.required and self.optional</p>
<p>Returns:
A subset of self.required containing only strings representing unmet
requirements.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="n">missing_options_set</span> <span class="o">=</span> <span class="nb">set</span><span class="p">(</span><span class="n">attr</span> <span class="k">for</span> <span class="n">attr</span> <span class="ow">in</span> <span class="nb">dir</span><span class="p">(</span><span class="n">options</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">attr</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s">'_'</span><span class="p">)</span> <span class="ow">and</span>
<span class="nb">getattr</span><span class="p">(</span><span class="n">options</span><span class="p">,</span> <span class="n">attr</span><span class="p">)</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">)</span>
<span class="n">missing_requirements</span> <span class="o">=</span> <span class="p">[]</span>
<span class="k">for</span> <span class="n">requirement</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">required</span><span class="p">:</span>
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">requirement</span><span class="p">,</span> <span class="nb">list</span><span class="p">):</span>
<span class="n">sub_req_set</span> <span class="o">=</span> <span class="nb">set</span><span class="p">(</span><span class="n">requirement</span><span class="p">)</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-45'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-45'>#</a>
</div>
<p>If every element in sub_req_set is in missing_options_set,
add the first element of the requirements list to the missing
requirements.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="k">if</span> <span class="n">sub_req_set</span> <span class="o"><=</span> <span class="n">missing_options_set</span><span class="p">:</span>
<span class="n">missing_requirements</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">requirement</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-46'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-46'>#</a>
</div>
<p>Otherwise, the user specified one of the elements of the list, so
we can use that one.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="k">elif</span> <span class="n">requirement</span> <span class="ow">in</span> <span class="n">missing_options_set</span><span class="p">:</span>
<span class="n">missing_requirements</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">requirement</span><span class="p">)</span>
<span class="k">return</span> <span class="n">missing_requirements</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-47'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-47'>#</a>
</div>
<p>See if an attribute is optional</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="k">def</span> <span class="nf">is_optional</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">attribute</span><span class="p">):</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-48'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-48'>#</a>
</div>
<p>No list of lists in the optional fields</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="k">if</span> <span class="n">attribute</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">optional</span><span class="p">:</span>
<span class="k">return</span> <span class="bp">True</span>
<span class="k">return</span> <span class="bp">False</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-49'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-49'>#</a>
</div>
<p>Just use this as a place-holder for Task callbacks.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="k">def</span> <span class="nf">_not_impl</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">):</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-50'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-50'>#</a>
</div>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="n">LOG</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s">'Sorry, this task is not yet implemented!'</span><span class="p">)</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-51'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-51'>#</a>
</div>
<p>Wraps GDataEntries to easily get human-readable data.</p>
</div>
<div class='code'>
<div class="highlight"><pre><span class="k">class</span> <span class="nc">BaseEntryToStringWrapper</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-52'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-52'>#</a>
</div>
<p>Constructor.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">gdata_entry</span><span class="p">,</span>
<span class="n">intra_property_delimiter</span><span class="o">=</span><span class="s">''</span><span class="p">,</span>
<span class="n">label_delimiter</span><span class="o">=</span><span class="s">' '</span><span class="p">,</span>
<span class="n">default_url_field</span><span class="o">=</span><span class="s">'site'</span><span class="p">):</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-53'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-53'>#</a>
</div>
<p>Keyword arguments:
gdata_entry: The GDataEntry to extract data from.
intra_property_delimiter: Delimiter to distinguish between multiple
values in a single property (e.g. multiple email addresses).
Default '' (there will always be at least one space).
label_delimiter: String to place in front of a label for intra-property
values. For example, for a contact with multiple phone
numbers, ':' would yield "Work:<number> Home:<number>"
Default ' ' (there is no whitespace between label and
value if it is not specified).
Set as NoneType to omit labels entirely.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="bp">self</span><span class="o">.</span><span class="n">entry</span> <span class="o">=</span> <span class="n">gdata_entry</span>
<span class="bp">self</span><span class="o">.</span><span class="n">intra_property_delimiter</span> <span class="o">=</span> <span class="n">intra_property_delimiter</span>
<span class="bp">self</span><span class="o">.</span><span class="n">label_delimiter</span> <span class="o">=</span> <span class="n">label_delimiter</span>
<span class="bp">self</span><span class="o">.</span><span class="n">default_url_field</span> <span class="o">=</span> <span class="n">default_url_field</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-54'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-54'>#</a>
</div>
<p>dir(self.entry).</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="nd">@property</span>
<span class="k">def</span> <span class="nf">debug</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-55'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-55'>#</a>
</div>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="k">return</span> <span class="nb">str</span><span class="p">(</span><span class="nb">dir</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">entry</span><span class="p">))</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-56'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-56'>#</a>
</div>
<p>Title or name. For Contacts v1, job title.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="nd">@property</span>
<span class="k">def</span> <span class="nf">title</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-57'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-57'>#</a>
</div>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">entry</span><span class="o">.</span><span class="n">title</span><span class="o">.</span><span class="n">text</span>
<span class="n">name</span> <span class="o">=</span> <span class="n">title</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-58'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-58'>#</a>
</div>
<p>url_direct or url_site, depending on url_field defined in config.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="nd">@property</span>
<span class="k">def</span> <span class="nf">url</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-59'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-59'>#</a>
</div>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_url</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">default_url_field</span><span class="p">)</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-60'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-60'>#</a>
</div>
<p>Url that leads directly to content.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="nd">@property</span>
<span class="k">def</span> <span class="nf">url_direct</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-61'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-61'>#</a>
</div>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_url</span><span class="p">(</span><span class="s">'direct'</span><span class="p">)</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-62'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-62'>#</a>
</div>
<p>Url that leads to site hosting content.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="nd">@property</span>
<span class="k">def</span> <span class="nf">url_site</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-63'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-63'>#</a>
</div>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_url</span><span class="p">(</span><span class="s">'site'</span><span class="p">)</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-64'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-64'>#</a>
</div>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="k">def</span> <span class="nf">_url</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">subfield</span><span class="p">):</span>
<span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">entry</span><span class="o">.</span><span class="n">GetHtmlLink</span><span class="p">():</span>
<span class="n">href</span> <span class="o">=</span> <span class="s">''</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">href</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">entry</span><span class="o">.</span><span class="n">GetHtmlLink</span><span class="p">()</span><span class="o">.</span><span class="n">href</span>
<span class="k">if</span> <span class="n">subfield</span> <span class="o">==</span> <span class="s">'direct'</span><span class="p">:</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">entry</span><span class="o">.</span><span class="n">content</span><span class="o">.</span><span class="n">src</span> <span class="ow">or</span> <span class="n">href</span>
<span class="k">return</span> <span class="n">href</span> <span class="ow">or</span> <span class="bp">self</span><span class="o">.</span><span class="n">entry</span><span class="o">.</span><span class="n">content</span><span class="o">.</span><span class="n">src</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-65'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-65'>#</a>
</div>
<p>Summary or description.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="nd">@property</span>
<span class="k">def</span> <span class="nf">summary</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-66'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-66'>#</a>
</div>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="k">try</span><span class="p">:</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-67'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-67'>#</a>
</div>
<p>Try to access the "default" description</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="n">value</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">entry</span><span class="o">.</span><span class="n">media</span><span class="o">.</span><span class="n">description</span><span class="o">.</span><span class="n">text</span>
<span class="k">except</span> <span class="ne">AttributeError</span><span class="p">:</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-68'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-68'>#</a>
</div>
<p>If it's not there, try the summary attribute</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="n">value</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">entry</span><span class="o">.</span><span class="n">summary</span><span class="o">.</span><span class="n">text</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">value</span><span class="p">:</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-69'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-69'>#</a>
</div>
<p>If the "default" description was there, but it was empty,
try the summary attribute.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="n">value</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">entry</span><span class="o">.</span><span class="n">summary</span><span class="o">.</span><span class="n">text</span>
<span class="k">return</span> <span class="n">value</span>
<span class="n">description</span> <span class="o">=</span> <span class="n">summary</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-70'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-70'>#</a>
</div>
<p>Raw XML.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="nd">@property</span>
<span class="k">def</span> <span class="nf">xml</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-71'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-71'>#</a>
</div>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="k">return</span> <span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">entry</span><span class="p">)</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-72'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-72'>#</a>
</div>
<p>Determine the human-readable label of the item.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="k">def</span> <span class="nf">_extract_label</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">entry_list_item</span><span class="p">,</span> <span class="n">label_attr</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-73'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-73'>#</a>
</div>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="k">if</span> <span class="n">label_attr</span> <span class="ow">and</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">entry_list_item</span><span class="p">,</span> <span class="n">label_attr</span><span class="p">):</span>
<span class="n">scheme_or_label</span> <span class="o">=</span> <span class="nb">getattr</span><span class="p">(</span><span class="n">entry_list_item</span><span class="p">,</span> <span class="n">label_attr</span><span class="p">)</span>
<span class="k">elif</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">entry_list_item</span><span class="p">,</span> <span class="s">'rel'</span><span class="p">):</span>
<span class="n">scheme_or_label</span> <span class="o">=</span> <span class="n">entry_list_item</span><span class="o">.</span><span class="n">rel</span>
<span class="k">elif</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">entry_list_item</span><span class="p">,</span> <span class="s">'label'</span><span class="p">):</span>
<span class="n">scheme_or_label</span> <span class="o">=</span> <span class="n">entry_list_item</span><span class="o">.</span><span class="n">label</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">return</span> <span class="bp">None</span>
<span class="k">if</span> <span class="n">scheme_or_label</span><span class="p">:</span>
<span class="k">return</span> <span class="n">scheme_or_label</span><span class="p">[</span><span class="n">scheme_or_label</span><span class="o">.</span><span class="n">find</span><span class="p">(</span><span class="s">'#'</span><span class="p">)</span><span class="o">+</span><span class="mi">1</span><span class="p">:]</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">return</span> <span class="bp">None</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-74'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-74'>#</a>
</div>
<p>Join a list of entries into a string.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="k">def</span> <span class="nf">_join</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">entry_list</span><span class="p">,</span> <span class="n">text_attribute</span><span class="o">=</span><span class="s">'text'</span><span class="p">,</span>
<span class="n">text_extractor</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">label_attribute</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-75'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-75'>#</a>
</div>
<p>Keyword arguments:
entry_list: List of entries to be joined.
text_attribute: String of the attribute that will give human readable
text for each entry in entry_list. Default 'text'.
text_extractor: Function that can be used to get desired text.
Default None. Use this if the readable data is buried
deeper than a single attribute.
label_attribute: If the attribute for the label is not 'rel' or 'label'
it can be specified here.</p>
<p>Returns:
String from joining the items in entry_list.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="k">if</span> <span class="ow">not</span> <span class="n">text_extractor</span><span class="p">:</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">text_attribute</span><span class="p">:</span>
<span class="k">raise</span> <span class="n">Error</span><span class="p">(</span><span class="s">'One of "text_extractor" or '</span> <span class="o">+</span>
<span class="s">'"text_attribute" must be defined!'</span><span class="p">)</span>
<span class="n">text_extractor</span> <span class="o">=</span> <span class="k">lambda</span> <span class="n">entry</span><span class="p">:</span> <span class="nb">getattr</span><span class="p">(</span><span class="n">entry</span><span class="p">,</span> <span class="n">text_attribute</span><span class="p">)</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-76'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-76'>#</a>
</div>
<p>It should be impossible to get a non-string from text_extractor.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">entry_list</span><span class="p">)</span> <span class="o">==</span> <span class="mi">1</span><span class="p">:</span>
<span class="k">return</span> <span class="n">text_extractor</span><span class="p">(</span><span class="n">entry_list</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">label_delimiter</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">intra_property_delimiter</span><span class="o">.</span><span class="n">join</span><span class="p">([</span><span class="n">text_extractor</span><span class="p">(</span><span class="n">e</span><span class="p">)</span>
<span class="k">for</span> <span class="n">e</span> <span class="ow">in</span> <span class="n">entry_list</span>
<span class="k">if</span> <span class="n">text_extractor</span><span class="p">(</span><span class="n">e</span><span class="p">)])</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">separating_string</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">intra_property_delimiter</span> <span class="o">+</span> <span class="s">' '</span>
<span class="n">joined_string</span> <span class="o">=</span> <span class="s">''</span>
<span class="k">for</span> <span class="n">entry</span> <span class="ow">in</span> <span class="n">entry_list</span><span class="p">:</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">label_delimiter</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span>
<span class="n">label</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_extract_label</span><span class="p">(</span><span class="n">entry</span><span class="p">,</span> <span class="n">label_attr</span><span class="o">=</span><span class="n">label_attribute</span><span class="p">)</span>
<span class="k">if</span> <span class="n">label</span><span class="p">:</span>
<span class="n">joined_string</span> <span class="o">+=</span> <span class="n">label</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">label_delimiter</span>
<span class="n">joined_string</span> <span class="o">+=</span> <span class="n">text_extractor</span><span class="p">(</span><span class="n">entry</span><span class="p">)</span> <span class="o">+</span> <span class="n">separating_string</span>
<span class="k">return</span> <span class="n">joined_string</span><span class="o">.</span><span class="n">rstrip</span><span class="p">(</span><span class="n">separating_string</span><span class="p">)</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-77'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-77'>#</a>
</div>
<p>Return a useful string describing a gdata.data.GDEntry.</p>
</div>
<div class='code'>
<div class="highlight"><pre><span class="k">def</span> <span class="nf">compile_entry_string</span><span class="p">(</span><span class="n">wrapped_entry</span><span class="p">,</span> <span class="n">attribute_list</span><span class="p">,</span> <span class="n">delimiter</span><span class="p">,</span>
<span class="n">missing_field_value</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">newline_replacer</span><span class="o">=</span><span class="s">' '</span><span class="p">):</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-78'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-78'>#</a>
</div>
<p>Keyword arguments:
wrapped_entry: BaseEntryToStringWrapper or subclass to display.
attribute_list: List of attributes to access
delimiter: String to use as the delimiter between attributes.
missing_field_value: If any of the fields for any of the entries are
invalid or undefined, put this in its place
(Default None to use "missing_field_value" config
option).
newline_replacer: String to replace newlines with. Default ' '. Set to
NoneType to leave newlines in place.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="n">return_string</span> <span class="o">=</span> <span class="s">''</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">delimiter</span><span class="p">:</span>
<span class="n">delimiter</span> <span class="o">=</span> <span class="s">','</span>
<span class="k">if</span> <span class="n">delimiter</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span> <span class="o">==</span> <span class="s">','</span><span class="p">:</span>
<span class="n">wrapped_entry</span><span class="o">.</span><span class="n">intra_property_delimiter</span> <span class="o">=</span> <span class="s">';'</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">wrapped_entry</span><span class="o">.</span><span class="n">intra_property_delimiter</span> <span class="o">=</span> <span class="s">','</span>
<span class="k">for</span> <span class="n">attr</span> <span class="ow">in</span> <span class="n">attribute_list</span><span class="p">:</span>
<span class="k">try</span><span class="p">:</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-79'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-79'>#</a>
</div>
<p>Get the value, replacing NoneTypes and empty strings
with the missing field value.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="n">val</span> <span class="o">=</span> <span class="nb">getattr</span><span class="p">(</span><span class="n">wrapped_entry</span><span class="p">,</span> <span class="n">attr</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s">'-'</span><span class="p">,</span><span class="s">'_'</span><span class="p">))</span> <span class="ow">or</span> <span class="n">missing_field_value</span>
<span class="k">except</span> <span class="ne">ValueError</span><span class="p">,</span> <span class="n">err</span><span class="p">:</span>
<span class="n">LOG</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="n">err</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">+</span> <span class="s">' (Did not add value for field '</span> <span class="o">+</span> <span class="n">attr</span> <span class="o">+</span> <span class="s">')'</span><span class="p">)</span>
<span class="k">except</span> <span class="ne">AttributeError</span><span class="p">,</span> <span class="n">err</span><span class="p">:</span>
<span class="n">LOG</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="n">err</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">+</span> <span class="s">' (value for field '</span> <span class="o">+</span> <span class="n">attr</span> <span class="o">+</span> <span class="s">')'</span><span class="p">)</span>
<span class="k">try</span><span class="p">:</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-80'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-80'>#</a>
</div>
<p>Last ditch effort to blindly grab the attribute</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="n">val</span> <span class="o">=</span> <span class="nb">getattr</span><span class="p">(</span><span class="n">wrapped_entry</span><span class="o">.</span><span class="n">entry</span><span class="p">,</span> <span class="n">attr</span><span class="p">)</span><span class="o">.</span><span class="n">text</span> <span class="ow">or</span> <span class="n">missing_field_value</span>
<span class="k">except</span> <span class="ne">AttributeError</span><span class="p">:</span>
<span class="n">LOG</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="n">err</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">+</span> <span class="s">' (value for field '</span> <span class="o">+</span> <span class="n">attr</span> <span class="o">+</span> <span class="s">')'</span><span class="p">)</span>
<span class="n">val</span> <span class="o">=</span> <span class="n">missing_field_value</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-81'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-81'>#</a>
</div>
<p>Apparently, atom(?) doesn't always return a Unicode type when there are
non-latin characters, so force everything to Unicode.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="n">val</span> <span class="o">=</span> <span class="n">safe_decode</span><span class="p">(</span><span class="n">val</span><span class="p">)</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-82'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-82'>#</a>
</div>
<p>Ensure the delimiter won't appear in a non-delineation role,
but let it slide if the raw xml is being dumped</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="k">if</span> <span class="n">attr</span> <span class="o">!=</span> <span class="s">'xml'</span><span class="p">:</span>
<span class="n">return_string</span> <span class="o">+=</span> <span class="n">val</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="n">delimiter</span><span class="p">,</span> <span class="s">' '</span><span class="p">)</span> <span class="o">+</span> <span class="n">delimiter</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">return_string</span> <span class="o">=</span> <span class="n">val</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-83'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-83'>#</a>
</div>
<p>Don't do processing if attribute is xml</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="k">if</span> <span class="n">attr</span> <span class="o">!=</span> <span class="s">'xml'</span><span class="p">:</span>
<span class="n">return_string</span> <span class="o">=</span> <span class="n">return_string</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s">'</span><span class="se">\n</span><span class="s">'</span><span class="p">,</span> <span class="n">newline_replacer</span><span class="p">)</span>
<span class="n">return_string</span> <span class="o">=</span> <span class="n">return_string</span><span class="o">.</span><span class="n">rstrip</span><span class="p">(</span><span class="n">delimiter</span><span class="p">)</span>
<span class="n">return_string</span> <span class="o">=</span> <span class="n">return_string</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="n">googlecl</span><span class="o">.</span><span class="n">TERMINAL_ENCODING</span><span class="p">,</span>
<span class="s">'backslashreplace'</span><span class="p">)</span>
<span class="k">return</span> <span class="n">return_string</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-84'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-84'>#</a>
</div>
<p>Generate sets of tags based on a string.</p>
</div>
<div class='code'>
<div class="highlight"><pre><span class="k">def</span> <span class="nf">generate_tag_sets</span><span class="p">(</span><span class="n">tags</span><span class="p">):</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-85'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-85'>#</a>
</div>
<p>Keyword arguments:
tags: Comma-separated list of tags. Tags with a '-' in front will be
removed from each photo. A tag of '--' will delete all tags.
A backslash in front of a '-' will keep the '-' in the tag.
Examples:
'tag1, tag2, tag3' Add tag1, tag2, and tag3
'-tag1, tag4, -tag5' Remove tag1, add tag4 and -tag5
'--, tag6' Remove all tags, then add tag6
Returns:
(remove_set, add_set, replace_tags) where...
remove_set: set object of the tags to remove
add_set: set object of the tags to add
replace_tags: boolean indicating if all the old tags are removed</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="n">tags</span> <span class="o">=</span> <span class="n">tags</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s">', '</span><span class="p">,</span> <span class="s">','</span><span class="p">)</span>
<span class="n">tagset</span> <span class="o">=</span> <span class="nb">set</span><span class="p">(</span><span class="n">tags</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s">','</span><span class="p">))</span>
<span class="n">remove_set</span> <span class="o">=</span> <span class="nb">set</span><span class="p">(</span><span class="n">tag</span><span class="p">[</span><span class="mi">1</span><span class="p">:]</span> <span class="k">for</span> <span class="n">tag</span> <span class="ow">in</span> <span class="n">tagset</span> <span class="k">if</span> <span class="n">tag</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">==</span> <span class="s">'-'</span><span class="p">)</span>
<span class="k">if</span> <span class="s">'-'</span> <span class="ow">in</span> <span class="n">remove_set</span><span class="p">:</span>
<span class="n">replace_tags</span> <span class="o">=</span> <span class="bp">True</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">replace_tags</span> <span class="o">=</span> <span class="bp">False</span>
<span class="n">add_set</span> <span class="o">=</span> <span class="nb">set</span><span class="p">()</span>
<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">remove_set</span><span class="p">)</span> <span class="o">!=</span> <span class="nb">len</span><span class="p">(</span><span class="n">tagset</span><span class="p">):</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-86'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-86'>#</a>
</div>
<p>TODO: Can do this more cleanly with regular expressions?</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="k">for</span> <span class="n">tag</span> <span class="ow">in</span> <span class="n">tagset</span><span class="p">:</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-87'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-87'>#</a>
</div>
<p>Remove the escape '\' for calculation of 'add' set</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="k">if</span> <span class="n">tag</span><span class="p">[:</span><span class="mi">1</span><span class="p">]</span> <span class="o">==</span> <span class="s">'\-'</span><span class="p">:</span>
<span class="n">add_set</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">tag</span><span class="p">[</span><span class="mi">1</span><span class="p">:])</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-88'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-88'>#</a>
</div>
<p>Don't add the tags that are being removed</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="k">elif</span> <span class="n">tag</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">!=</span> <span class="s">'-'</span><span class="p">:</span>
<span class="n">add_set</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">tag</span><span class="p">)</span>
<span class="k">return</span> <span class="p">(</span><span class="n">remove_set</span><span class="p">,</span> <span class="n">add_set</span><span class="p">,</span> <span class="n">replace_tags</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class='clearall'></div>
</div>
</body>
| charany1/googlecl | docs/src/googlecl/base.html | HTML | mit | 114,810 |
/*
* This file is part of Sponge, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* 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 org.spongepowered.common.data.util;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityTracker;
import net.minecraft.entity.EntityTrackerEntry;
import net.minecraft.entity.item.EntityPainting;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.network.play.server.S10PacketSpawnPainting;
import net.minecraft.network.play.server.S13PacketDestroyEntities;
import net.minecraft.world.WorldServer;
import org.spongepowered.api.entity.EntitySnapshot;
import org.spongepowered.common.SpongeImpl;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import javax.annotation.Nullable;
public final class EntityUtil {
private EntityUtil() {
}
public static boolean setPassenger(Entity vehicle, @Nullable Entity passenger) {
if (vehicle.riddenByEntity == null) { // no existing passenger
if (passenger == null) {
return true;
}
passenger.mountEntity(vehicle);
} else { // passenger already exists
vehicle.riddenByEntity.mountEntity(null); // eject current passenger
if (passenger != null) {
passenger.mountEntity(vehicle);
}
}
return true;
}
public static boolean setVehicle(Entity passenger, @Nullable Entity vehicle) {
if (!passenger.worldObj.isRemote) {
passenger.mountEntity(vehicle);
return true;
}
return false;
}
public static EntitySnapshot getBaseVehicle(Entity passenger) {
if (passenger.ridingEntity == null) {
return null;
}
Entity baseVehicle = passenger.ridingEntity;
while (baseVehicle.ridingEntity != null) {
baseVehicle = baseVehicle.ridingEntity;
}
return ((org.spongepowered.api.entity.Entity) baseVehicle).createSnapshot();
}
@SuppressWarnings("unchecked")
public static boolean refreshPainting(EntityPainting painting, EntityPainting.EnumArt art) {
final EntityTracker paintingTracker = ((WorldServer) painting.worldObj).getEntityTracker();
EntityTrackerEntry paintingEntry = (EntityTrackerEntry) paintingTracker.trackedEntityHashTable.lookup(painting.getEntityId());
List<EntityPlayerMP> playerMPs = new ArrayList<>();
for (EntityPlayerMP player : (Set<EntityPlayerMP>) paintingEntry.trackingPlayers) {
S13PacketDestroyEntities packet = new S13PacketDestroyEntities(painting.getEntityId());
player.playerNetServerHandler.sendPacket(packet);
playerMPs.add(player);
}
painting.art = art;
painting.updateFacingWithBoundingBox(painting.facingDirection);
for (EntityPlayerMP playerMP : playerMPs) {
SpongeImpl.getGame().getScheduler().createTaskBuilder()
.delayTicks(SpongeImpl.getGlobalConfig().getConfig().getEntity().getPaintingRespawnDelaly())
.execute(() -> {
final S10PacketSpawnPainting packet = new S10PacketSpawnPainting(painting);
playerMP.playerNetServerHandler.sendPacket(packet);
})
.submit(SpongeImpl.getPlugin());
}
return true;
}
public static boolean removeEntityFromPlayerTracking(Entity entity) {
final EntityTracker entityTracker = ((WorldServer) entity.worldObj).getEntityTracker();
EntityTrackerEntry entry = (EntityTrackerEntry) entityTracker.trackedEntityHashTable.lookup(entity.getEntityId());
for (EntityPlayerMP player : (Set<EntityPlayerMP>) entry.trackingPlayers) {
S13PacketDestroyEntities packet = new S13PacketDestroyEntities(entity.getEntityId());
player.playerNetServerHandler.sendPacket(packet);
}
return true;
}
}
| kamcio96/SpongeCommon | src/main/java/org/spongepowered/common/data/util/EntityUtil.java | Java | mit | 5,091 |
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {RouterModule} from '@angular/router';
import {BreadCrumbsComponent} from './breadcrumbs.component';
@NgModule({
imports: [
CommonModule,
RouterModule
],
declarations : [
BreadCrumbsComponent
],
providers : [
],
exports: [
BreadCrumbsComponent
]
})
export class BreadCrumbModule {}
| Hertox82/Lortom | angular-backend/src/app/backend-module/breadcrumbs/breadcrumbs.module.ts | TypeScript | mit | 442 |
/*
The MIT License (MIT)
Copyright (c) 2007 - 2020 Microting A/S
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.
*/
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microting.eForm.Infrastructure;
namespace Microting.eForm.Migrations
{
[DbContext(typeof(MicrotingDbContext))]
[Migration("20190318122928_FixingNamingOfSurveyConfigurationSites")]
partial class FixingNamingOfSurveyConfigurationSites
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618 //Setup for SQL Server Provider
string autoIDGenStrategy = "SqlServer:ValueGenerationStrategy";
object autoIDGenStrategyValue = MySqlValueGenerationStrategy.IdentityColumn;
if (DbConfig.IsMySQL)
{
autoIDGenStrategy = "MySql:ValueGenerationStrategy";
autoIDGenStrategyValue = MySqlValueGenerationStrategy.IdentityColumn;
}
modelBuilder
.HasAnnotation("ProductVersion", "2.2.2-servicing-10034")
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
modelBuilder.Entity("eFormSqlController.answer_value_versions", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
b.Property<int>("answerId");
b.Property<int>("answerValueId");
b.Property<DateTime?>("created_at");
b.Property<int>("optionsId");
b.Property<int>("questionId");
b.Property<DateTime?>("updated_at");
b.Property<int>("value");
b.Property<int?>("version");
b.Property<string>("workflow_state")
.HasMaxLength(255);
b.HasKey("id");
b.ToTable("answer_value_versions");
});
modelBuilder.Entity("eFormSqlController.answer_values", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
b.Property<int>("answerId");
b.Property<DateTime?>("created_at");
b.Property<int>("optionsId");
b.Property<int>("questionId");
b.Property<DateTime?>("updated_at");
b.Property<int>("value");
b.Property<int?>("version");
b.Property<string>("workflow_state")
.HasMaxLength(255);
b.HasKey("id");
b.ToTable("answer_values");
});
modelBuilder.Entity("eFormSqlController.answer_versions", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
b.Property<bool>("UTCAdjusted");
b.Property<int>("answerDuration");
b.Property<int>("answerId");
b.Property<DateTime?>("created_at");
b.Property<int>("finishedAt");
b.Property<int>("languageId");
b.Property<int>("questionSetId");
b.Property<int>("siteId");
b.Property<int>("surveyConfigurationId");
b.Property<string>("timeZone");
b.Property<int>("unitId");
b.Property<DateTime?>("updated_at");
b.Property<int?>("version");
b.Property<string>("workflow_state")
.HasMaxLength(255);
b.HasKey("id");
b.ToTable("answer_versions");
});
modelBuilder.Entity("eFormSqlController.answers", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
b.Property<bool>("UTCAdjusted");
b.Property<int>("answerDuration");
b.Property<DateTime?>("created_at");
b.Property<int>("finishedAt");
b.Property<int>("languageId");
b.Property<int>("questionSetId");
b.Property<int>("siteId");
b.Property<int>("surveyConfigurationId");
b.Property<string>("timeZone");
b.Property<int>("unitId");
b.Property<DateTime?>("updated_at");
b.Property<int?>("version");
b.Property<string>("workflow_state")
.HasMaxLength(255);
b.HasKey("id");
b.ToTable("answers");
});
modelBuilder.Entity("eFormSqlController.case_versions", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
b.Property<int?>("case_id");
b.Property<string>("case_uid")
.HasMaxLength(255);
b.Property<int?>("check_list_id");
b.Property<DateTime?>("created_at");
b.Property<string>("custom");
b.Property<DateTime?>("done_at");
b.Property<int?>("done_by_user_id");
b.Property<string>("field_value_1");
b.Property<string>("field_value_10");
b.Property<string>("field_value_2");
b.Property<string>("field_value_3");
b.Property<string>("field_value_4");
b.Property<string>("field_value_5");
b.Property<string>("field_value_6");
b.Property<string>("field_value_7");
b.Property<string>("field_value_8");
b.Property<string>("field_value_9");
b.Property<string>("microting_check_uid")
.HasMaxLength(255);
b.Property<string>("microting_uid")
.HasMaxLength(255);
b.Property<int?>("site_id");
b.Property<int?>("status");
b.Property<string>("type")
.HasMaxLength(255);
b.Property<int?>("unit_id");
b.Property<DateTime?>("updated_at");
b.Property<int?>("version");
b.Property<string>("workflow_state")
.HasMaxLength(255);
b.HasKey("id");
b.ToTable("case_versions");
});
modelBuilder.Entity("eFormSqlController.cases", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
b.Property<string>("case_uid")
.HasMaxLength(255);
b.Property<int?>("check_list_id");
b.Property<DateTime?>("created_at");
b.Property<string>("custom");
b.Property<DateTime?>("done_at");
b.Property<int?>("done_by_user_id");
b.Property<string>("field_value_1");
b.Property<string>("field_value_10");
b.Property<string>("field_value_2");
b.Property<string>("field_value_3");
b.Property<string>("field_value_4");
b.Property<string>("field_value_5");
b.Property<string>("field_value_6");
b.Property<string>("field_value_7");
b.Property<string>("field_value_8");
b.Property<string>("field_value_9");
b.Property<string>("microting_check_uid")
.HasMaxLength(255);
b.Property<string>("microting_uid")
.HasMaxLength(255);
b.Property<int?>("site_id");
b.Property<int?>("status");
b.Property<string>("type")
.HasMaxLength(255);
b.Property<int?>("unit_id");
b.Property<DateTime?>("updated_at");
b.Property<int?>("version");
b.Property<string>("workflow_state")
.HasMaxLength(255);
b.HasKey("id");
b.HasIndex("check_list_id");
b.HasIndex("done_by_user_id");
b.HasIndex("site_id");
b.HasIndex("unit_id");
b.ToTable("cases");
});
modelBuilder.Entity("eFormSqlController.check_list_site_versions", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
b.Property<int?>("check_list_id");
b.Property<int?>("check_list_site_id");
b.Property<DateTime?>("created_at");
b.Property<string>("last_check_id")
.HasMaxLength(255);
b.Property<string>("microting_uid")
.HasMaxLength(255);
b.Property<int?>("site_id");
b.Property<DateTime?>("updated_at");
b.Property<int?>("version");
b.Property<string>("workflow_state")
.HasMaxLength(255);
b.HasKey("id");
b.ToTable("check_list_site_versions");
});
modelBuilder.Entity("eFormSqlController.check_list_sites", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
b.Property<int?>("check_list_id");
b.Property<DateTime?>("created_at");
b.Property<string>("last_check_id")
.HasMaxLength(255);
b.Property<string>("microting_uid")
.HasMaxLength(255);
b.Property<int?>("site_id");
b.Property<DateTime?>("updated_at");
b.Property<int?>("version");
b.Property<string>("workflow_state")
.HasMaxLength(255);
b.HasKey("id");
b.HasIndex("check_list_id");
b.HasIndex("site_id");
b.ToTable("check_list_sites");
});
modelBuilder.Entity("eFormSqlController.check_list_value_versions", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
b.Property<int?>("case_id");
b.Property<int?>("check_list_duplicate_id");
b.Property<int?>("check_list_id");
b.Property<int?>("check_list_value_id");
b.Property<DateTime?>("created_at");
b.Property<string>("status")
.HasMaxLength(255);
b.Property<DateTime?>("updated_at");
b.Property<int?>("user_id");
b.Property<int?>("version");
b.Property<string>("workflow_state")
.HasMaxLength(255);
b.HasKey("id");
b.ToTable("check_list_value_versions");
});
modelBuilder.Entity("eFormSqlController.check_list_values", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
b.Property<int?>("case_id");
b.Property<int?>("check_list_duplicate_id");
b.Property<int?>("check_list_id");
b.Property<DateTime?>("created_at");
b.Property<string>("status")
.HasMaxLength(255);
b.Property<DateTime?>("updated_at");
b.Property<int?>("user_id");
b.Property<int?>("version");
b.Property<string>("workflow_state")
.HasMaxLength(255);
b.HasKey("id");
b.ToTable("check_list_values");
});
modelBuilder.Entity("eFormSqlController.check_list_versions", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
b.Property<short?>("approval_enabled");
b.Property<string>("case_type")
.HasMaxLength(255);
b.Property<int?>("check_list_id");
b.Property<DateTime?>("created_at");
b.Property<string>("custom");
b.Property<string>("description");
b.Property<int?>("display_index");
b.Property<short?>("done_button_enabled");
b.Property<short?>("download_entities");
b.Property<short?>("extra_fields_enabled");
b.Property<short?>("fast_navigation");
b.Property<int?>("field_1");
b.Property<int?>("field_10");
b.Property<int?>("field_2");
b.Property<int?>("field_3");
b.Property<int?>("field_4");
b.Property<int?>("field_5");
b.Property<int?>("field_6");
b.Property<int?>("field_7");
b.Property<int?>("field_8");
b.Property<int?>("field_9");
b.Property<string>("folder_name")
.HasMaxLength(255);
b.Property<string>("label");
b.Property<short?>("manual_sync");
b.Property<short?>("multi_approval");
b.Property<string>("original_id");
b.Property<int?>("parent_id");
b.Property<short?>("quick_sync_enabled");
b.Property<int?>("repeated");
b.Property<short?>("review_enabled");
b.Property<DateTime?>("updated_at");
b.Property<int?>("version");
b.Property<string>("workflow_state")
.HasMaxLength(255);
b.HasKey("id");
b.ToTable("check_list_versions");
});
modelBuilder.Entity("eFormSqlController.check_lists", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
b.Property<short?>("approval_enabled");
b.Property<string>("case_type")
.HasMaxLength(255);
b.Property<DateTime?>("created_at");
b.Property<string>("custom");
b.Property<string>("description");
b.Property<int?>("display_index");
b.Property<short?>("done_button_enabled");
b.Property<short?>("download_entities");
b.Property<short?>("extra_fields_enabled");
b.Property<short?>("fast_navigation");
b.Property<int?>("field_1");
b.Property<int?>("field_10");
b.Property<int?>("field_2");
b.Property<int?>("field_3");
b.Property<int?>("field_4");
b.Property<int?>("field_5");
b.Property<int?>("field_6");
b.Property<int?>("field_7");
b.Property<int?>("field_8");
b.Property<int?>("field_9");
b.Property<string>("folder_name")
.HasMaxLength(255);
b.Property<string>("label");
b.Property<short?>("manual_sync");
b.Property<short?>("multi_approval");
b.Property<string>("original_id");
b.Property<int?>("parent_id");
b.Property<short?>("quick_sync_enabled");
b.Property<int?>("repeated");
b.Property<short?>("review_enabled");
b.Property<DateTime?>("updated_at");
b.Property<int?>("version");
b.Property<string>("workflow_state")
.HasMaxLength(255);
b.HasKey("id");
b.HasIndex("parent_id");
b.ToTable("check_lists");
});
modelBuilder.Entity("eFormSqlController.entity_group_versions", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
b.Property<DateTime?>("created_at");
b.Property<int>("entity_group_id");
b.Property<string>("microting_uid");
b.Property<string>("name");
b.Property<string>("type")
.HasMaxLength(50);
b.Property<DateTime?>("updated_at");
b.Property<int?>("version");
b.Property<string>("workflow_state")
.HasMaxLength(255);
b.HasKey("id");
b.ToTable("entity_group_versions");
});
modelBuilder.Entity("eFormSqlController.entity_groups", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
b.Property<DateTime?>("created_at");
b.Property<string>("microting_uid");
b.Property<string>("name");
b.Property<string>("type")
.HasMaxLength(50);
b.Property<DateTime?>("updated_at");
b.Property<int?>("version");
b.Property<string>("workflow_state")
.HasMaxLength(255);
b.HasKey("id");
b.ToTable("entity_groups");
});
modelBuilder.Entity("eFormSqlController.entity_item_versions", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
b.Property<DateTime?>("created_at");
b.Property<string>("description");
b.Property<int>("display_index");
b.Property<int?>("entity_group_id");
b.Property<string>("entity_item_uid")
.HasMaxLength(50);
b.Property<int>("entity_items_id");
b.Property<string>("microting_uid");
b.Property<string>("name");
b.Property<short?>("synced");
b.Property<DateTime?>("updated_at");
b.Property<int?>("version");
b.Property<string>("workflow_state")
.HasMaxLength(255);
b.HasKey("id");
b.ToTable("entity_item_versions");
});
modelBuilder.Entity("eFormSqlController.entity_items", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
b.Property<DateTime?>("created_at");
b.Property<string>("description");
b.Property<int>("display_index");
b.Property<int>("entity_group_id");
b.Property<string>("entity_item_uid")
.HasMaxLength(50);
b.Property<string>("microting_uid");
b.Property<string>("name");
b.Property<short?>("synced");
b.Property<DateTime?>("updated_at");
b.Property<int?>("version");
b.Property<string>("workflow_state")
.HasMaxLength(255);
b.HasKey("id");
b.ToTable("entity_items");
});
modelBuilder.Entity("eFormSqlController.field_types", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
b.Property<string>("description")
.HasMaxLength(255);
b.Property<string>("field_type")
.HasMaxLength(255);
b.HasKey("id");
b.ToTable("field_types");
});
modelBuilder.Entity("eFormSqlController.field_value_versions", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
b.Property<string>("accuracy")
.HasMaxLength(255);
b.Property<string>("altitude")
.HasMaxLength(255);
b.Property<int?>("case_id");
b.Property<int?>("check_list_duplicate_id");
b.Property<int?>("check_list_id");
b.Property<DateTime?>("created_at");
b.Property<DateTime?>("date");
b.Property<DateTime?>("done_at");
b.Property<int?>("field_id");
b.Property<int?>("field_value_id");
b.Property<string>("heading")
.HasMaxLength(255);
b.Property<string>("latitude")
.HasMaxLength(255);
b.Property<string>("longitude")
.HasMaxLength(255);
b.Property<DateTime?>("updated_at");
b.Property<int?>("uploaded_data_id");
b.Property<int?>("user_id");
b.Property<string>("value");
b.Property<int?>("version");
b.Property<string>("workflow_state")
.HasMaxLength(255);
b.HasKey("id");
b.ToTable("field_value_versions");
});
modelBuilder.Entity("eFormSqlController.field_values", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
b.Property<string>("accuracy")
.HasMaxLength(255);
b.Property<string>("altitude")
.HasMaxLength(255);
b.Property<int?>("case_id");
b.Property<int?>("check_list_duplicate_id");
b.Property<int?>("check_list_id");
b.Property<DateTime?>("created_at");
b.Property<DateTime?>("date");
b.Property<DateTime?>("done_at");
b.Property<int?>("field_id");
b.Property<string>("heading")
.HasMaxLength(255);
b.Property<string>("latitude")
.HasMaxLength(255);
b.Property<string>("longitude")
.HasMaxLength(255);
b.Property<DateTime?>("updated_at");
b.Property<int?>("uploaded_data_id");
b.Property<int?>("user_id");
b.Property<string>("value");
b.Property<int?>("version");
b.Property<string>("workflow_state")
.HasMaxLength(255);
b.HasKey("id");
b.HasIndex("check_list_id");
b.HasIndex("field_id");
b.HasIndex("uploaded_data_id");
b.HasIndex("user_id");
b.ToTable("field_values");
});
modelBuilder.Entity("eFormSqlController.field_versions", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
b.Property<short?>("barcode_enabled");
b.Property<string>("barcode_type")
.HasMaxLength(255);
b.Property<int?>("check_list_id");
b.Property<string>("color")
.HasMaxLength(255);
b.Property<DateTime?>("created_at");
b.Property<string>("custom");
b.Property<int?>("decimal_count");
b.Property<string>("default_value");
b.Property<string>("description");
b.Property<int?>("display_index");
b.Property<short?>("dummy");
b.Property<int?>("entity_group_id");
b.Property<int?>("field_id");
b.Property<int?>("field_type_id");
b.Property<short?>("geolocation_enabled");
b.Property<short?>("geolocation_forced");
b.Property<short?>("geolocation_hidden");
b.Property<short?>("is_num");
b.Property<string>("key_value_pair_list");
b.Property<string>("label");
b.Property<short?>("mandatory");
b.Property<int?>("max_length");
b.Property<string>("max_value")
.HasMaxLength(255);
b.Property<string>("min_value")
.HasMaxLength(255);
b.Property<int?>("multi");
b.Property<short?>("optional");
b.Property<string>("original_id");
b.Property<int?>("parent_field_id");
b.Property<string>("query_type")
.HasMaxLength(255);
b.Property<short?>("read_only");
b.Property<short?>("selected");
b.Property<short?>("split_screen");
b.Property<short?>("stop_on_save");
b.Property<string>("unit_name")
.HasMaxLength(255);
b.Property<DateTime?>("updated_at");
b.Property<int?>("version");
b.Property<string>("workflow_state")
.HasMaxLength(255);
b.HasKey("id");
b.ToTable("field_versions");
});
modelBuilder.Entity("eFormSqlController.fields", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
b.Property<short?>("barcode_enabled");
b.Property<string>("barcode_type")
.HasMaxLength(255);
b.Property<int?>("check_list_id");
b.Property<string>("color")
.HasMaxLength(255);
b.Property<DateTime?>("created_at");
b.Property<string>("custom");
b.Property<int?>("decimal_count");
b.Property<string>("default_value");
b.Property<string>("description");
b.Property<int?>("display_index");
b.Property<short?>("dummy");
b.Property<int?>("entity_group_id");
b.Property<int?>("field_type_id");
b.Property<short?>("geolocation_enabled");
b.Property<short?>("geolocation_forced");
b.Property<short?>("geolocation_hidden");
b.Property<short?>("is_num");
b.Property<string>("key_value_pair_list");
b.Property<string>("label");
b.Property<short?>("mandatory");
b.Property<int?>("max_length");
b.Property<string>("max_value")
.HasMaxLength(255);
b.Property<string>("min_value")
.HasMaxLength(255);
b.Property<int?>("multi");
b.Property<short?>("optional");
b.Property<string>("original_id");
b.Property<int?>("parent_field_id");
b.Property<string>("query_type")
.HasMaxLength(255);
b.Property<short?>("read_only");
b.Property<short?>("selected");
b.Property<short?>("split_screen");
b.Property<short?>("stop_on_save");
b.Property<string>("unit_name")
.HasMaxLength(255);
b.Property<DateTime?>("updated_at");
b.Property<int?>("version");
b.Property<string>("workflow_state")
.HasMaxLength(255);
b.HasKey("id");
b.HasIndex("check_list_id");
b.HasIndex("field_type_id");
b.HasIndex("parent_field_id");
b.ToTable("fields");
});
modelBuilder.Entity("eFormSqlController.language_versions", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
b.Property<DateTime?>("created_at");
b.Property<string>("description");
b.Property<int>("languageId");
b.Property<string>("name");
b.Property<DateTime?>("updated_at");
b.Property<int?>("version");
b.Property<string>("workflow_state")
.HasMaxLength(255);
b.HasKey("id");
b.ToTable("language_versions");
});
modelBuilder.Entity("eFormSqlController.languages", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
b.Property<DateTime?>("created_at");
b.Property<string>("description");
b.Property<string>("name");
b.Property<DateTime?>("updated_at");
b.Property<int?>("version");
b.Property<string>("workflow_state")
.HasMaxLength(255);
b.HasKey("id");
b.ToTable("languages");
});
modelBuilder.Entity("eFormSqlController.log_exceptions", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
b.Property<DateTime>("created_at");
b.Property<int>("level");
b.Property<string>("message");
b.Property<string>("type");
b.HasKey("id");
b.ToTable("log_exceptions");
});
modelBuilder.Entity("eFormSqlController.logs", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
b.Property<DateTime>("created_at");
b.Property<int>("level");
b.Property<string>("message");
b.Property<string>("type");
b.HasKey("id");
b.ToTable("logs");
});
modelBuilder.Entity("eFormSqlController.notifications", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
b.Property<string>("activity");
b.Property<DateTime?>("created_at");
b.Property<string>("exception");
b.Property<string>("microting_uid")
.HasMaxLength(255);
b.Property<string>("notification_uid")
.HasMaxLength(255);
b.Property<string>("stacktrace");
b.Property<string>("transmission");
b.Property<DateTime?>("updated_at");
b.Property<string>("workflow_state")
.HasMaxLength(255);
b.HasKey("id");
b.ToTable("notifications");
});
modelBuilder.Entity("eFormSqlController.option_versions", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
b.Property<int>("continuousOptionId");
b.Property<DateTime?>("created_at");
b.Property<int>("nextQuestionId");
b.Property<int>("optionId");
b.Property<int>("optionsIndex");
b.Property<int>("questionId");
b.Property<DateTime?>("updated_at");
b.Property<int?>("version");
b.Property<int>("weight");
b.Property<int>("weightValue");
b.Property<string>("workflow_state")
.HasMaxLength(255);
b.HasKey("id");
b.ToTable("option_versions");
});
modelBuilder.Entity("eFormSqlController.options", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
b.Property<int>("continuousOptionId");
b.Property<DateTime?>("created_at");
b.Property<int>("nextQuestionId");
b.Property<int>("optionsIndex");
b.Property<int>("questionId");
b.Property<DateTime?>("updated_at");
b.Property<int?>("version");
b.Property<int>("weight");
b.Property<int>("weightValue");
b.Property<string>("workflow_state")
.HasMaxLength(255);
b.HasKey("id");
b.ToTable("options");
});
modelBuilder.Entity("eFormSqlController.question_set_versions", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
b.Property<DateTime?>("created_at");
b.Property<bool>("hasChild");
b.Property<string>("name");
b.Property<int>("parentId");
b.Property<bool>("posiblyDeployed");
b.Property<int>("questionSetId");
b.Property<bool>("share");
b.Property<DateTime?>("updated_at");
b.Property<int?>("version");
b.Property<string>("workflow_state")
.HasMaxLength(255);
b.HasKey("id");
b.ToTable("question_set_versions");
});
modelBuilder.Entity("eFormSqlController.question_sets", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
b.Property<DateTime?>("created_at");
b.Property<bool>("hasChild");
b.Property<string>("name");
b.Property<int>("parentId");
b.Property<bool>("posiblyDeployed");
b.Property<bool>("share");
b.Property<DateTime?>("updated_at");
b.Property<int?>("version");
b.Property<string>("workflow_state")
.HasMaxLength(255);
b.HasKey("id");
b.ToTable("question_sets");
});
modelBuilder.Entity("eFormSqlController.question_versions", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
b.Property<bool>("backButtonEnabled");
b.Property<int>("continuousQuestionId");
b.Property<DateTime?>("created_at");
b.Property<string>("fontSize");
b.Property<bool>("image");
b.Property<string>("imagePostion");
b.Property<int>("maxDuration");
b.Property<int>("maximum");
b.Property<int>("minDuration");
b.Property<int>("minimum");
b.Property<bool>("prioritised");
b.Property<int>("questionId");
b.Property<int>("questionIndex");
b.Property<int>("questionSetId");
b.Property<string>("questionType");
b.Property<int>("refId");
b.Property<string>("type");
b.Property<DateTime?>("updated_at");
b.Property<bool>("validDisplay");
b.Property<int?>("version");
b.Property<string>("workflow_state")
.HasMaxLength(255);
b.HasKey("id");
b.ToTable("question_versions");
});
modelBuilder.Entity("eFormSqlController.questions", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
b.Property<bool>("backButtonEnabled");
b.Property<int>("continuousQuestionId");
b.Property<DateTime?>("created_at");
b.Property<string>("fontSize");
b.Property<bool>("image");
b.Property<string>("imagePostion");
b.Property<int>("maxDuration");
b.Property<int>("maximum");
b.Property<int>("minDuration");
b.Property<int>("minimum");
b.Property<bool>("prioritised");
b.Property<int>("questionIndex");
b.Property<int>("questionSetId");
b.Property<string>("questionType");
b.Property<int>("refId");
b.Property<string>("type");
b.Property<DateTime?>("updated_at");
b.Property<bool>("validDisplay");
b.Property<int?>("version");
b.Property<string>("workflow_state")
.HasMaxLength(255);
b.HasKey("id");
b.ToTable("questions");
});
modelBuilder.Entity("eFormSqlController.settings", b =>
{
b.Property<int>("id");
b.Property<string>("name")
.IsRequired()
.HasMaxLength(50);
b.Property<string>("value");
b.HasKey("id");
b.ToTable("settings");
});
modelBuilder.Entity("eFormSqlController.site_survey_configuration_versions", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
b.Property<DateTime?>("created_at");
b.Property<int>("siteId");
b.Property<int>("siteSurveyConfigurationId");
b.Property<int>("surveyConfigurationId");
b.Property<DateTime?>("updated_at");
b.Property<int?>("version");
b.Property<string>("workflow_state")
.HasMaxLength(255);
b.HasKey("id");
b.ToTable("site_survey_configuration_versions");
});
modelBuilder.Entity("eFormSqlController.site_survey_configurations", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
b.Property<DateTime?>("created_at");
b.Property<int>("siteId");
b.Property<int>("surveyConfigurationId");
b.Property<DateTime?>("updated_at");
b.Property<int?>("version");
b.Property<string>("workflow_state")
.HasMaxLength(255);
b.HasKey("id");
b.ToTable("site_survey_configurations");
});
modelBuilder.Entity("eFormSqlController.site_versions", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
b.Property<DateTime?>("created_at");
b.Property<int?>("microting_uid");
b.Property<string>("name")
.HasMaxLength(255);
b.Property<int?>("site_id");
b.Property<DateTime?>("updated_at");
b.Property<int?>("version");
b.Property<string>("workflow_state")
.HasMaxLength(255);
b.HasKey("id");
b.ToTable("site_versions");
});
modelBuilder.Entity("eFormSqlController.site_worker_versions", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
b.Property<DateTime?>("created_at");
b.Property<int?>("microting_uid");
b.Property<int?>("site_id");
b.Property<int?>("site_worker_id");
b.Property<DateTime?>("updated_at");
b.Property<int?>("version");
b.Property<int?>("worker_id");
b.Property<string>("workflow_state")
.HasMaxLength(255);
b.HasKey("id");
b.ToTable("site_worker_versions");
});
modelBuilder.Entity("eFormSqlController.site_workers", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
b.Property<DateTime?>("created_at");
b.Property<int?>("microting_uid");
b.Property<int?>("site_id");
b.Property<DateTime?>("updated_at");
b.Property<int?>("version");
b.Property<int?>("worker_id");
b.Property<string>("workflow_state")
.HasMaxLength(255);
b.HasKey("id");
b.HasIndex("site_id");
b.HasIndex("worker_id");
b.ToTable("site_workers");
});
modelBuilder.Entity("eFormSqlController.sites", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
b.Property<DateTime?>("created_at");
b.Property<int?>("microting_uid");
b.Property<string>("name")
.HasMaxLength(255);
b.Property<DateTime?>("updated_at");
b.Property<int?>("version");
b.Property<string>("workflow_state")
.HasMaxLength(255);
b.HasKey("id");
b.ToTable("sites");
});
modelBuilder.Entity("eFormSqlController.survey_configuration_versions", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
b.Property<DateTime?>("created_at");
b.Property<string>("name");
b.Property<DateTime>("start");
b.Property<DateTime>("stop");
b.Property<int>("surveyConfigurationId");
b.Property<int>("timeOut");
b.Property<int>("timeToLive");
b.Property<DateTime?>("updated_at");
b.Property<int?>("version");
b.Property<string>("workflow_state")
.HasMaxLength(255);
b.HasKey("id");
b.ToTable("survey_configuration_versions");
});
modelBuilder.Entity("eFormSqlController.survey_configurations", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
b.Property<DateTime?>("created_at");
b.Property<string>("name");
b.Property<DateTime>("start");
b.Property<DateTime>("stop");
b.Property<int>("timeOut");
b.Property<int>("timeToLive");
b.Property<DateTime?>("updated_at");
b.Property<int?>("version");
b.Property<string>("workflow_state")
.HasMaxLength(255);
b.HasKey("id");
b.ToTable("survey_configurations");
});
modelBuilder.Entity("eFormSqlController.tag_versions", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
b.Property<DateTime?>("created_at");
b.Property<string>("name")
.HasMaxLength(255);
b.Property<int?>("tag_id");
b.Property<int?>("taggings_count");
b.Property<DateTime?>("updated_at");
b.Property<int?>("version");
b.Property<string>("workflow_state")
.HasMaxLength(255);
b.HasKey("id");
b.ToTable("tag_versions");
});
modelBuilder.Entity("eFormSqlController.tagging_versions", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
b.Property<int?>("check_list_id");
b.Property<DateTime?>("created_at");
b.Property<int?>("tag_id");
b.Property<int?>("tagger_id");
b.Property<int?>("tagging_id");
b.Property<DateTime?>("updated_at");
b.Property<int?>("version");
b.Property<string>("workflow_state")
.HasMaxLength(255);
b.HasKey("id");
b.ToTable("tagging_versions");
});
modelBuilder.Entity("eFormSqlController.taggings", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
b.Property<int?>("check_list_id");
b.Property<DateTime?>("created_at");
b.Property<int?>("tag_id");
b.Property<int?>("tagger_id");
b.Property<DateTime?>("updated_at");
b.Property<int?>("version");
b.Property<string>("workflow_state")
.HasMaxLength(255);
b.HasKey("id");
b.HasIndex("check_list_id");
b.HasIndex("tag_id");
b.ToTable("taggings");
});
modelBuilder.Entity("eFormSqlController.tags", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
b.Property<DateTime?>("created_at");
b.Property<string>("name")
.HasMaxLength(255);
b.Property<int?>("taggings_count");
b.Property<DateTime?>("updated_at");
b.Property<int?>("version");
b.Property<string>("workflow_state")
.HasMaxLength(255);
b.HasKey("id");
b.ToTable("tags");
});
modelBuilder.Entity("eFormSqlController.unit_versions", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
b.Property<DateTime?>("created_at");
b.Property<int?>("customer_no");
b.Property<int?>("microting_uid");
b.Property<int?>("otp_code");
b.Property<int?>("site_id");
b.Property<int?>("unit_id");
b.Property<DateTime?>("updated_at");
b.Property<int?>("version");
b.Property<string>("workflow_state")
.HasMaxLength(255);
b.HasKey("id");
b.ToTable("unit_versions");
});
modelBuilder.Entity("eFormSqlController.units", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
b.Property<DateTime?>("created_at");
b.Property<int?>("customer_no");
b.Property<int?>("microting_uid");
b.Property<int?>("otp_code");
b.Property<int?>("site_id");
b.Property<DateTime?>("updated_at");
b.Property<int?>("version");
b.Property<string>("workflow_state")
.HasMaxLength(255);
b.HasKey("id");
b.HasIndex("site_id");
b.ToTable("units");
});
modelBuilder.Entity("eFormSqlController.uploaded_data", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
b.Property<string>("checksum")
.HasMaxLength(255);
b.Property<DateTime?>("created_at");
b.Property<string>("current_file")
.HasMaxLength(255);
b.Property<DateTime?>("expiration_date");
b.Property<string>("extension")
.HasMaxLength(255);
b.Property<string>("file_location")
.HasMaxLength(255);
b.Property<string>("file_name")
.HasMaxLength(255);
b.Property<short?>("local");
b.Property<int?>("transcription_id");
b.Property<DateTime?>("updated_at");
b.Property<int?>("uploader_id");
b.Property<string>("uploader_type")
.HasMaxLength(255);
b.Property<int?>("version");
b.Property<string>("workflow_state")
.HasMaxLength(255);
b.HasKey("id");
b.ToTable("uploaded_data");
});
modelBuilder.Entity("eFormSqlController.uploaded_data_versions", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
b.Property<string>("checksum")
.HasMaxLength(255);
b.Property<DateTime?>("created_at");
b.Property<string>("current_file")
.HasMaxLength(255);
b.Property<int?>("data_uploaded_id");
b.Property<DateTime?>("expiration_date");
b.Property<string>("extension")
.HasMaxLength(255);
b.Property<string>("file_location")
.HasMaxLength(255);
b.Property<string>("file_name")
.HasMaxLength(255);
b.Property<short?>("local");
b.Property<int?>("transcription_id");
b.Property<DateTime?>("updated_at");
b.Property<int?>("uploader_id");
b.Property<string>("uploader_type")
.HasMaxLength(255);
b.Property<int?>("version");
b.Property<string>("workflow_state")
.HasMaxLength(255);
b.HasKey("id");
b.ToTable("uploaded_data_versions");
});
modelBuilder.Entity("eFormSqlController.worker_versions", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
b.Property<DateTime?>("created_at");
b.Property<string>("email")
.HasMaxLength(255);
b.Property<string>("first_name")
.HasMaxLength(255);
b.Property<string>("last_name")
.HasMaxLength(255);
b.Property<int>("microting_uid");
b.Property<DateTime?>("updated_at");
b.Property<int?>("version");
b.Property<int?>("worker_id");
b.Property<string>("workflow_state")
.HasMaxLength(255);
b.HasKey("id");
b.ToTable("worker_versions");
});
modelBuilder.Entity("eFormSqlController.workers", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
b.Property<DateTime?>("created_at");
b.Property<string>("email")
.HasMaxLength(255);
b.Property<string>("first_name")
.HasMaxLength(255);
b.Property<string>("last_name")
.HasMaxLength(255);
b.Property<int>("microting_uid");
b.Property<DateTime?>("updated_at");
b.Property<int?>("version");
b.Property<string>("workflow_state")
.HasMaxLength(255);
b.HasKey("id");
b.ToTable("workers");
});
modelBuilder.Entity("eFormSqlController.cases", b =>
{
b.HasOne("eFormSqlController.check_lists", "check_list")
.WithMany("cases")
.HasForeignKey("check_list_id");
b.HasOne("eFormSqlController.workers", "worker")
.WithMany()
.HasForeignKey("done_by_user_id");
b.HasOne("eFormSqlController.sites", "site")
.WithMany("cases")
.HasForeignKey("site_id");
b.HasOne("eFormSqlController.units", "unit")
.WithMany()
.HasForeignKey("unit_id");
});
modelBuilder.Entity("eFormSqlController.check_list_sites", b =>
{
b.HasOne("eFormSqlController.check_lists", "check_list")
.WithMany("check_list_sites")
.HasForeignKey("check_list_id");
b.HasOne("eFormSqlController.sites", "site")
.WithMany("check_list_sites")
.HasForeignKey("site_id");
});
modelBuilder.Entity("eFormSqlController.check_lists", b =>
{
b.HasOne("eFormSqlController.check_lists", "parent")
.WithMany("children")
.HasForeignKey("parent_id");
});
modelBuilder.Entity("eFormSqlController.field_values", b =>
{
b.HasOne("eFormSqlController.check_lists", "check_list")
.WithMany()
.HasForeignKey("check_list_id");
b.HasOne("eFormSqlController.fields", "field")
.WithMany("field_values")
.HasForeignKey("field_id");
b.HasOne("eFormSqlController.uploaded_data", "uploaded_data")
.WithMany()
.HasForeignKey("uploaded_data_id");
b.HasOne("eFormSqlController.workers", "worker")
.WithMany()
.HasForeignKey("user_id");
});
modelBuilder.Entity("eFormSqlController.fields", b =>
{
b.HasOne("eFormSqlController.check_lists", "check_list")
.WithMany("fields")
.HasForeignKey("check_list_id");
b.HasOne("eFormSqlController.field_types", "field_type")
.WithMany()
.HasForeignKey("field_type_id");
b.HasOne("eFormSqlController.fields", "parent")
.WithMany("children")
.HasForeignKey("parent_field_id");
});
modelBuilder.Entity("eFormSqlController.site_workers", b =>
{
b.HasOne("eFormSqlController.sites", "site")
.WithMany("site_workers")
.HasForeignKey("site_id");
b.HasOne("eFormSqlController.workers", "worker")
.WithMany("site_workers")
.HasForeignKey("worker_id");
});
modelBuilder.Entity("eFormSqlController.taggings", b =>
{
b.HasOne("eFormSqlController.check_lists", "check_list")
.WithMany("taggings")
.HasForeignKey("check_list_id");
b.HasOne("eFormSqlController.tags", "tag")
.WithMany("taggings")
.HasForeignKey("tag_id");
});
modelBuilder.Entity("eFormSqlController.units", b =>
{
b.HasOne("eFormSqlController.sites", "site")
.WithMany("units")
.HasForeignKey("site_id");
});
#pragma warning restore 612, 618
}
}
}
| microting/eform-sdk-dotnet | eFormCore/Migrations/20190318122928_FixingNamingOfSurveyConfigurationSites.Designer.cs | C# | mit | 64,895 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="favicon.ico">
<link rel="stylesheet" type="text/css" href="css/demo2.css" />
<link rel="stylesheet" type="text/css" href="css/style_common.css" />
<link rel="stylesheet" type="text/css" href="css/style10.css" />
<link rel = "stylesheet" type = "text/css" href="//fonts.googleapis.com/css?family=Comfortaa"/>
<link rel="stylesheet" type="text/css" href="css/Menu2.css">
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.4.0/css/font-awesome.min.css">
<title>DJ Bass Home</title>
<!-- Bootstrap core CSS -->
<link href="dist/css/bootstrap.min.css" rel="stylesheet">
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<link href="assets/css/ie10-viewport-bug-workaround.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="dashboard.css" rel="stylesheet">
<!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
<!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
<script src="../../assets/js/ie-emulation-modes-warning.js"></script>
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[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="menu">
<div class="title">MENU</div>
<ul class="nav">
<li><a href="Home.html">Home</a></li>
<li><a href="Inloggen.html">Inloggen</a></li>
<li><a href="ProfielDJ.html">Mijn profiel</a></li>
<li><a href="Zoeken.html">Zoeken</a></li>
<li><a href="Informatie.html">Informatie</a></li>
<li><a href="OverOns.html">Over ons</a></li>
<li><a href="FAQ.html">F.A.Q.</a></li>
<li><a href="Uitloggen.html">Uitloggen</a></li>
</ul>
</div>
<ul class="breadcrumb">
<li><a href="Home.html">Home</a></li>
<li>Over Ons</li>
</ul>
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
<h1 class="Titel">F.A.Q.</h1>
<h2 class = "Ondertitel">Veel gestelde vragen.</h2>
<p class = "box2">
Vraag1:
<br>
Antwoord1:
<br>
Vraag2:
<br>
Antwoord2:
</p>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="../../assets/js/vendor/jquery.min.js"><\/script>')</script>
<script src="../../dist/js/bootstrap.min.js"></script>
<!-- Just to make our placeholder images work. Don't actually copy the next line! -->
<script src="../../assets/js/vendor/holder.min.js"></script>
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="../../assets/js/ie10-viewport-bug-workaround.js"></script>
</body>
</html>
| Kommkommerman/DJBass | FAQ.html | HTML | mit | 3,504 |
/* jslint node: true */
'use strict'
var insecurity = require('../lib/insecurity')
module.exports = function (sequelize, DataTypes) {
var SecurityAnswer = sequelize.define('SecurityAnswer', {
answer: DataTypes.STRING,
UserId: {type: DataTypes.INTEGER, unique: true}
},
{
classMethods: {
associate: function (models) {
SecurityAnswer.belongsTo(models.User)
SecurityAnswer.belongsTo(models.SecurityQuestion, { constraints: true, foreignKeyConstraint: true })
}
},
hooks: {
beforeCreate: function (answer, fn) {
hmacAnswerHook(answer)
fn(null, answer)
},
beforeUpdate: function (answer, fn) { // Pitfall: Will hash the hashed answer again if answer was not updated!
hmacAnswerHook(answer)
fn(null, answer)
}
}
})
return SecurityAnswer
}
function hmacAnswerHook (answer) {
if (answer.answer) {
answer.answer = insecurity.hmac(answer.answer)
};
}
| oviroman/disertatieiap2017 | models/securityAnswer.js | JavaScript | mit | 1,007 |
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { HijoComponent } from './hijo/hijo.component';
import { ListaCompraComponent } from './lista-compra/lista-compra.component';
import { ElementoCompraComponent } from './elemento-compra/elemento-compra.component';
import {FormsModule} from '@angular/forms';
import {MiServicioService} from './mi-servicio/mi-servicio.service'
@NgModule({
declarations: [
AppComponent,
HijoComponent,
ListaCompraComponent,
ElementoCompraComponent
],
imports: [
BrowserModule, FormsModule
],
providers: [MiServicioService],
bootstrap: [AppComponent]
})
export class AppModule { }
| chalson/curso-angular-2 | ProyectoCinco/src/app/app.module.ts | TypeScript | mit | 749 |
<style>
td.spec { background: #EEFAFA !important; }
td.error { background: #FAF5EE !important; }
td.error_odd { background: #FAEEEE !important; }
td.error_even { background: #EAFAEF !important; }
td.coord { background: #FFF9FA !important; }
td.setup_odd { background: #FFFEF5 !important; }
td.setup_even { background: #F5FAFF !important; }
td.white { background: #FFFFFF !important; }
td.joystick_left { background: #FFF5F5 !important; }
td.joystick_right { background: #F5F5FF !important; }
td.throttle { background: #FFDDDD !important; }
td.rudder { background: #FFFFDD !important; }
td.elevator { background: #DDFFFF !important; }
td.aileron { background: #DDFFDD !important; }
td.lightgrey { background: #C9C9C9 !important; }
td.darkgrey { background: #909090 !important; }
</style>
**[E-DRONE](/documents/kr/products/e_drone/) User Manual**
Modified : 2021.4.13
---
<h3>E-DRONE 사용자 설명서</h3>
---
* Kramdown table of contents
{:toc .toc}
<br>
# 1. 드론
<div align="center">
<img src="./images/byrobot_drone_4.jpg" alt="E-DRONE" width="600" height="600">
<p>E-DRONE</p>
</div>
<br>
## 1.1. 사양
<br>
<div align="center">
<table>
<tr>
<td class="spec"><div align="center"><b>항목</b></div></td>
<td class="spec"><div align="center"><b>E-DRONE</b></div></td>
</tr>
<tr>
<td class="spec"><div align="center">모터 축간 대각선 길이</div></td>
<td class="white"><div align="center">135 mm</div></td>
</tr>
<tr>
<td class="spec"><div align="center">무게</div></td>
<td class="spec"><div align="center">113g<br>(배터리 포함)</div></td>
</tr>
<tr>
<td class="spec"><div align="center">배터리</div></td>
<td class="white"><div align="center">7.4V<br>1,000mAh<br>LiPo(Lithium polymer) battery</div></td>
</tr>
<tr>
<td class="spec"><div align="center">비행시간</div></td>
<td class="spec"><div align="center">7 ~ 10분</div></td>
</tr>
<tr>
<td class="spec"><div align="center">최대조종거리</div></td>
<td class="white"><div align="center">50m</div></td>
</tr>
<tr>
<td class="spec"><div align="center">통신방식</div></td>
<td class="spec"><div align="center">2.4Ghz RF</div></td>
</tr>
<tr>
<td class="spec"><div align="center">조종 모드</div></td>
<td class="white"><div align="center">Mode 1, 2, 3, 4</div></td>
</tr>
<tr>
<td class="spec" rowspan="4"><div align="center">센서</div></td>
<td class="spec"><div align="center">Optical flow</div></td>
</tr>
<tr>
<td class="white"><div align="center">6-Axis MEMS MotionTracking</div></td>
</tr>
<tr>
<td class="spec"><div align="center">IR Time of Flight</div></td>
</tr>
<tr>
<td class="white"><div align="center">Barometer</div></td>
</tr>
<tr>
<td class="spec" rowspan="3"><div align="center">확장</div></td>
<td class="spec"><div align="center">4핀 UART 포트(RX, TX, 5V, GND) x 2</div></td>
</tr>
<tr>
<td class="white"><div align="center">RGB LED 포트 x 1</div></td>
</tr>
<tr>
<td class="spec"><div align="center">단색 LED 포트 x 2</div></td>
</tr>
<tr>
<td class="spec" rowspan="3"><div align="center">주요기능</div></td>
<td class="white"><div align="center">실내 위치 인식</div></td>
</tr>
<tr>
<td class="spec"><div align="center">Return Home</div></td>
</tr>
<tr>
<td class="white"><div align="center">앱, 파이썬 코딩</div></td>
</tr>
</table>
</div>
<br>
<br>
<br>
## 1.2. 좌표계
E-DRONE은 오른손 좌표계를 사용하고 있습니다.
<div align="center">
<table>
<tr>
<td class="coord"><div align="center"><b>좌표축</b></div></td>
<td class="coord"><div align="center"><b>+</b></div></td>
<td class="coord"><div align="center"><b>-</b></div></td>
</tr>
<tr>
<td class="coord"><div align="center">X</div></td>
<td class="white"><div align="center">앞</div></td>
<td class="white"><div align="center">뒤</div></td>
</tr>
<tr>
<td class="coord"><div align="center">Y</div></td>
<td class="coord"><div align="center">왼쪽</div></td>
<td class="coord"><div align="center">오른쪽</div></td>
</tr>
<tr>
<td class="coord"><div align="center">Z</div></td>
<td class="white"><div align="center">위</div></td>
<td class="white"><div align="center">아래</div></td>
</tr>
<tr>
<td class="coord"><div align="center">Z 회전</div></td>
<td class="coord"><div align="center">반시계</div></td>
<td class="coord"><div align="center">시계</div></td>
</tr>
</table>
</div>
아래 문서의 Figure 6 이미지를 참고하시기 바랍니다.
[http://www.physics.brocku.ca/PPLATO/h-flap/math2_5.html#section_3](http://www.physics.brocku.ca/PPLATO/h-flap/math2_5.html#section_3)
<br>
<br>
# 2. 조종기
## 2.1 조종기 화면 구성
E-DRONE의 조종기는 크게 ***조종***과 ***설정*** 두 화면으로 구성되어 있습니다.
<div align="center">
<table>
<tr>
<td class="lightgrey">
<img src="./images/display_control.png" alt="control">
</td>
</tr>
</table>
〈조종 화면〉
</div>
조종 화면에서는 드론 조종, 트림 설정, 상태 확인 등을 할 수 있습니다.
<br>
<div align="center">
<table>
<tr>
<td class="lightgrey">
<img src="./images/display_setup.png" alt="setup">
</td>
</tr>
</table>
〈설정 화면〉
</div>
설정 화면에서는 드론 설정 변경, 상태 확인 등을 할 수 있습니다.
<br>
<br>
<br>
## 2.2 조종 화면 세부 구성
<br>
### 2.2.1. 높이-자세-RPM
<table>
<tr>
<td class="lightgrey">
<div align="center">
<a href="./images/drone4controller_1.png" target="_blank"><img src="./images/drone4controller_1.png"></a>
</div>
</td>
<td></td>
<td class="darkgrey">
<div align="center">
<a href="./images/drone4controller_1_desc.png" target="_blank"><img src="./images/drone4controller_1_desc.png"></a>
</div>
</td>
</tr>
</table>
<br>
### 2.2.2. 높이-방향-RPM-자세-고도-위치
<table>
<tr>
<td class="lightgrey">
<div align="center">
<a href="./images/drone4controller_2.png" target="_blank"><img src="./images/drone4controller_2.png"></a>
</div>
</td>
<td></td>
<td class="darkgrey">
<div align="center">
<a href="./images/drone4controller_2_desc.png" target="_blank"><img src="./images/drone4controller_2_desc.png"></a>
</div>
</td>
</tr>
</table>
<br>
### 2.2.3. 속도-위치-자세
<table>
<tr>
<td class="lightgrey">
<div align="center">
<a href="./images/drone4controller_3.png" target="_blank"><img src="./images/drone4controller_3.png"></a>
</div>
</td>
<td></td>
<td class="darkgrey">
<div align="center">
<a href="./images/drone4controller_3_desc.png" target="_blank"><img src="./images/drone4controller_3_desc.png"></a>
</div>
</td>
</tr>
</table>
<br>
### 2.2.4. 자세-높이
<table>
<tr>
<td class="lightgrey">
<div align="center">
<a href="./images/drone4controller_4.png" target="_blank"><img src="./images/drone4controller_4.png"></a>
</div>
</td>
<td></td>
<td class="darkgrey">
<div align="center">
<a href="./images/drone4controller_4_desc.png" target="_blank"><img src="./images/drone4controller_4_desc.png"></a>
</div>
</td>
</tr>
</table>
<br>
### 2.2.5. 위치-트림
<table>
<tr>
<td class="lightgrey">
<div align="center">
<a href="./images/drone4controller_5.png" target="_blank"><img src="./images/drone4controller_5.png"></a>
</div>
</td>
<td></td>
<td class="darkgrey">
<div align="center">
<a href="./images/drone4controller_5_desc.png" target="_blank"><img src="./images/drone4controller_5_desc.png"></a>
</div>
</td>
</tr>
</table>
<br>
### 2.2.6. RF 정보 및 상태
<table>
<tr>
<td class="lightgrey">
<div align="center">
<a href="./images/drone4controller_6.png" target="_blank"><img src="./images/drone4controller_6.png"></a>
</div>
</td>
<td></td>
<td class="darkgrey">
<div align="center">
<a href="./images/drone4controller_6_desc.png" target="_blank"><img src="./images/drone4controller_6_desc.png"></a>
</div>
</td>
</tr>
</table>
<br>
### 2.2.7. 조이스틱 입력 값
<table>
<tr>
<td class="lightgrey">
<div align="center">
<a href="./images/drone4controller_7.png" target="_blank"><img src="./images/drone4controller_7.png"></a>
</div>
</td>
<td></td>
<td class="darkgrey">
<div align="center">
<a href="./images/drone4controller_7_desc.png" target="_blank"><img src="./images/drone4controller_7_desc.png"></a>
</div>
</td>
</tr>
</table>
<br>
### 2.2.8. 버전
<table>
<tr>
<td class="lightgrey">
<div align="center">
<a href="./images/drone4controller_8.png" target="_blank"><img src="./images/drone4controller_8.png"></a>
</div>
</td>
<td></td>
<td class="darkgrey">
<div align="center">
<a href="./images/drone4controller_8_desc.png" target="_blank"><img src="./images/drone4controller_8_desc.png"></a>
</div>
</td>
</tr>
</table>
<br>
<br>
<br>
## 2.3. 버튼 구성 및 기능
<br>
### 2.3.1. 조종 화면
<div align="center">
<img src="./images/button_control_front.jpg" alt="조종기 전면">
<p>조종 화면에서 전면 버튼의 기능</p>
</div>
<br>
<div align="center">
<img src="./images/button_control_top.jpg" alt="조종기 상단">
<p>조종 화면에서 상단 버튼의 기능</p>
</div>
<br>
<br>
### 2.3.2. 설정 화면
<div align="center">
<img src="./images/button_setup_front.jpg" alt="조종기 전면">
<p>설정 화면에서 전면 버튼의 기능</p>
</div>
<br>
<div align="center">
<img src="./images/button_setup_top.jpg" alt="조종기 상단">
<p>설정 화면에서 상단 버튼의 기능</p>
</div>
<br>
<br>
<br>
<br>
## 2.4. 설정 화면 메뉴 구성
<div align="center">
<table>
<tr>
<td class="setup_even">
<div align="center">
1단계
</div>
</td>
<td class="setup_even">
<div align="center">
2단계
</div>
</td>
<td class="setup_even" colspan="4">
<div align="center">
설명
</div>
</td>
</tr>
<tr>
<td class="setup_odd" rowspan="7">
<div align="center">
DISPLAY
</div>
</td>
<td class="setup_odd">
<div align="center">
높이-자세-RPM
</div>
</td>
<td class="setup_odd" colspan="4">
<div align="left">
조종 화면에서 보여줄 것인지를 설정(SHOW / HIDE)
</div>
</td>
</tr>
<tr>
<td class="white">
<div align="center">
높이-방향-RPM-자세-고도-위치
</div>
</td>
<td class="white" colspan="4">
<div align="left">
조종 화면에서 보여줄 것인지를 설정(SHOW / HIDE)
</div>
</td>
</tr>
<tr>
<td class="setup_odd">
<div align="center">
속도-위치-자세
</div>
</td>
<td class="setup_odd" colspan="4">
<div align="left">
조종 화면에서 보여줄 것인지를 설정(SHOW / HIDE)
</div>
</td>
</tr>
<tr>
<td class="white">
<div align="center">
자세-높이
</div>
</td>
<td class="white" colspan="4">
<div align="left">
조종 화면에서 보여줄 것인지를 설정(SHOW / HIDE)
</div>
</td>
</tr>
<tr>
<td class="setup_odd">
<div align="center">
위치-트림
</div>
</td>
<td class="setup_odd" colspan="4">
<div align="left">
조종 화면에서 보여줄 것인지를 설정(SHOW / HIDE)
</div>
</td>
</tr>
<tr>
<td class="white">
<div align="center">
RF 정보 및 상태
</div>
</td>
<td class="white" colspan="4">
<div align="left">
조종 화면에서 보여줄 것인지를 설정(SHOW / HIDE)
</div>
</td>
</tr>
<tr>
<td class="setup_odd">
<div align="center">
조이스틱 입력 값
</div>
</td>
<td class="setup_odd" colspan="4">
<div align="left">
조종 화면에서 보여줄 것인지를 설정(SHOW / HIDE)
</div>
</td>
</tr>
<tr>
<td class="setup_even" rowspan="2">
<div align="center">
LIGHT
</div>
</td>
<td class="setup_even">
<div align="center">
DRONE
</div>
</td>
<td class="setup_even" colspan="4">
<div align="left">
드론 LED 기본 색 설정 변경
</div>
</td>
</tr>
<tr>
<td class="white">
<div align="center">
CONTROLLER
</div>
</td>
<td class="white" colspan="4">
<div align="left">
조종기 LED 기본 색 설정 변경
</div>
</td>
</tr>
<tr>
<td class="setup_odd" rowspan="2">
<div align="center">
CONTROL
</div>
</td>
<td class="setup_odd">
<div align="center">
ATTITUDE
</div>
</td>
<td class="setup_odd" colspan="4">
<div align="left">
자세 제어
</div>
</td>
</tr>
<tr>
<td class="white">
<div align="center">
POSITION
</div>
</td>
<td class="white" colspan="4">
<div align="left">
위치 제어
</div>
</td>
</tr>
<tr>
<td class="setup_even" rowspan="5">
<div align="center">
MODE
</div>
</td>
<td class="setup_even">
<div align="center">
MODE
</div>
</td>
<td class="joystick_left">
<div align="center">
Left ↕
</div>
</td>
<td class="joystick_left">
<div align="center">
Left ↔
</div>
</td>
<td class="joystick_right">
<div align="center">
Right ↕
</div>
</td>
<td class="joystick_right">
<div align="center">
Right ↔
</div>
</td>
</tr>
<tr>
<td class="white">
<div align="center">
MODE 1
</div>
</td>
<td class="elevator">
<div align="center">
앞뒤<br>(Elevator)
</div>
</td>
<td class="rudder">
<div align="center">
좌우 회전<br>(Rudder)
</div>
</td>
<td class="throttle">
<div align="center">
위아래<br>(Throttle)
</div>
</td>
<td class="aileron">
<div align="center">
좌우<br>(Aileron)
</div>
</td>
</tr>
<tr>
<td class="setup_even">
<div align="center">
MODE 2
</div>
</td>
<td class="throttle">
<div align="center">
위아래<br>(Throttle)
</div>
</td>
<td class="rudder">
<div align="center">
좌우 회전<br>(Rudder)
</div>
</td>
<td class="elevator">
<div align="center">
앞뒤<br>(Elevator)
</div>
</td>
<td class="aileron">
<div align="center">
좌우<br>(Aileron)
</div>
</td>
</tr>
<tr>
<td class="white">
<div align="center">
MODE 3
</div>
</td>
<td class="elevator">
<div align="center">
앞뒤<br>(Elevator)
</div>
</td>
<td class="aileron">
<div align="center">
좌우<br>(Aileron)
</div>
</td>
<td class="throttle">
<div align="center">
위아래<br>(Throttle)
</div>
</td>
<td class="rudder">
<div align="center">
좌우 회전<br>(Rudder)
</div>
</td>
</tr>
<tr>
<td class="setup_even">
<div align="center">
MODE 4
</div>
</td>
<td class="throttle">
<div align="center">
위아래<br>(Throttle)
</div>
</td>
<td class="aileron">
<div align="center">
좌우<br>(Aileron)
</div>
</td>
<td class="elevator">
<div align="center">
앞뒤<br>(Elevator)
</div>
</td>
<td class="rudder">
<div align="center">
좌우 회전<br>(Rudder)
</div>
</td>
</tr>
<tr>
<td class="setup_odd" rowspan="2">
<div align="center">
HEADLESS
</div>
</td>
<td class="setup_odd">
<div align="center">
HEADLESS
</div>
</td>
<td class="setup_odd" colspan="4">
<div align="left">
헤드리스(방향 고정)
</div>
</td>
</tr>
<tr>
<td class="white">
<div align="center">
NORMAL
</div>
</td>
<td class="white" colspan="4">
<div align="left">
일반(드론의 현재 방향 기준)
</div>
</td>
</tr>
<tr>
<td class="setup_even" rowspan="3">
<div align="center">
SPEED
</div>
</td>
<td class="setup_even">
<div align="center">
S1
</div>
</td>
<td class="setup_even" colspan="4">
<div align="left">
속도 1단계(느림)
</div>
</td>
</tr>
<tr>
<td class="white">
<div align="center">
S2
</div>
</td>
<td class="white" colspan="4">
<div align="left">
속도 2단계
</div>
</td>
</tr>
<tr>
<td class="setup_even">
<div align="center">
S3
</div>
</td>
<td class="setup_even" colspan="4">
<div align="left">
속도 3단계(빠름)
</div>
</td>
</tr>
<tr>
<td class="setup_odd" rowspan="2">
<div align="center">
FHSS
</div>
</td>
<td class="setup_odd">
<div align="center">
ON
</div>
</td>
<td class="setup_odd" colspan="4">
<div align="left">
채널 호핑
</div>
</td>
</tr>
<tr>
<td class="white">
<div align="center">
OFF
</div>
</td>
<td class="white" colspan="4">
<div align="left">
고정 채널
</div>
</td>
</tr>
<tr>
<td class="setup_even" rowspan="3">
<div align="center">
FUNCTION
</div>
</td>
<td class="setup_even">
<div align="center">
SENSOR RESET
</div>
</td>
<td class="setup_even" colspan="4">
<div align="left">
드론의 자이로 바이어스 리셋
</div>
</td>
</tr>
<tr>
<td class="white">
<div align="center">
PAIRING
</div>
</td>
<td class="white" colspan="4">
<div align="left">
페어링
</div>
</td>
</tr>
<tr>
<td class="setup_even">
<div align="center">
SET DEFAULT
</div>
</td>
<td class="setup_even" colspan="4">
<div align="left">
설정값 초기화(드론이 연결된 경우 드론 설정도 초기화 됨)
</div>
</td>
</tr>
<tr>
<td class="setup_odd" rowspan="10">
<div align="center">
INFORMATION
</div>
</td>
<td class="setup_odd">
<div align="center">
COUNT
</div>
</td>
<td class="setup_odd" colspan="4">
<div align="left">
비행 시간 및 이벤트 카운트 값 표시
</div>
</td>
</tr>
<tr>
<td class="white">
<div align="center">
BIAS
</div>
</td>
<td class="white" colspan="4">
<div align="left">
가속도, 자이로 바이어스 값 표시
</div>
</td>
</tr>
<tr>
<td class="setup_odd">
<div align="center">
TRIM
</div>
</td>
<td class="setup_odd" colspan="4">
<div align="left">
Trim 값 표시
</div>
</td>
</tr>
<tr>
<td class="white">
<div align="center">
MOTION
</div>
</td>
<td class="white" colspan="4">
<div align="left">
IMU 센서 데이터를 연산하여 변환한 결과 표시
</div>
</td>
</tr>
<tr>
<td class="setup_odd">
<div align="center">
ALTITUDE
</div>
</td>
<td class="setup_odd" colspan="4">
<div align="left">
높이-고도와 관련된 센서 데이터 표시
</div>
</td>
</tr>
<tr>
<td class="white">
<div align="center">
POSITION
</div>
</td>
<td class="white" colspan="4">
<div align="left">
위치 데이터 표시
</div>
</td>
</tr>
<tr>
<td class="setup_odd">
<div align="center">
RF
</div>
</td>
<td class="setup_odd" colspan="4">
<div align="left">
RF 설정 데이터 표시
</div>
</td>
</tr>
<tr>
<td class="white">
<div align="center">
ADDRESS
</div>
</td>
<td class="white" colspan="4">
<div align="left">
드론과 조종기의 고유번호 표시
</div>
</td>
</tr>
<tr>
<td class="setup_odd">
<div align="center">
BOOT
</div>
</td>
<td class="setup_odd" colspan="4">
<div align="left">
조종기의 부트 정보 및 장치 등록 여부 표시
</div>
</td>
</tr>
<tr>
<td class="white">
<div align="center">
CRC32
</div>
</td>
<td class="white" colspan="4">
<div align="left">
드론과 조종기의 부트로더 및 앱 영역 CRC32 값 표시
</div>
</td>
</tr>
</table>
</div>
<br>
<br>
<br>
## 2.5. MODE
### 2.5.1. MODE 1
<div align="center">
<img src="./images/mode1.png" alt="MODE 1" width="800">
<p>MODE 1</p>
</div>
<br>
<br>
### 2.5.2. MODE 2
<div align="center">
<img src="./images/mode2.png" alt="MODE 2" width="800">
<p>MODE 2</p>
</div>
<br>
<br>
<br>
## 2.6. 오류 메세지
E-DRONE의 오류 메세지는 여러 오류가 동시에 발생하는 경우 우선 순위가 가장 높은 오류 하나만 표시합니다.
<br>
<div align="center">
<table>
<tr>
<td class="error"><div align="center"><b>분류</b></div></td>
<td class="error"><div align="center"><b>우선 순위</b></div></td>
<td class="error"><div align="center"><b>오류 메세지</b></div></td>
<td class="error"><div align="center"><b>설명</b></div></td>
</tr>
<tr>
<td class="white" colspan="4"></td>
</tr>
<tr>
<td class="error_even"><div align="center">BATTERY</div></td>
<td class="error_even"><div align="center">1</div></td>
<td class="error_even"><div align="center">CONTROLLER<br>LOW BATTERY</div></td>
<td class="error_even"><div align="center">조종기 배터리 잔량 낮음</div></td>
</tr>
<tr>
<td class="white" colspan="4"></td>
</tr>
<tr>
<td class="error_odd"><div align="center">RF</div></td>
<td class="error_odd"><div align="center">2</div></td>
<td class="error_odd"><div align="center">DISCONNECTED</div></td>
<td class="error_odd"><div align="center">드론과의 RF연결이 끊어짐</div></td>
</tr>
<tr>
<td class="white" colspan="4"></td>
</tr>
<tr>
<td class="error_even" rowspan="3"><div align="center">MOTION</div></td>
<td class="error_even"><div align="center">3</div></td>
<td class="error_even"><div align="center">[MOTION]<br>NO ANSWER</div></td>
<td class="error_even"><div align="center">Motion 센서 응답 없음</div></td>
</tr>
<tr>
<td class="white"><div align="center">4</div></td>
<td class="white"><div align="center">[MOTION]<br>WRONG VALUE</div></td>
<td class="white"><div align="center">Motion 센서 값 오류</div></td>
</tr>
<tr>
<td class="error_even"><div align="center">5</div></td>
<td class="error_even"><div align="center">[MOTION]<br>CALIBRATING<br>PLACE ON A FLAT SURFACE</div></td>
<td class="error_even"><div align="center">Motion 센서 캘리브레이션 중</div></td>
</tr>
<tr>
<td class="white" colspan="4"></td>
</tr>
<tr>
<td class="error_odd" rowspan="2"><div align="center">PRESSURE</div></td>
<td class="error_odd"><div align="center">6</div></td>
<td class="error_odd"><div align="center">[PRESSURE]<br>NO ANSWER</div></td>
<td class="error_odd"><div align="center">압력 센서 응답 없음</div></td>
</tr>
<tr>
<td class="white"><div align="center">7</div></td>
<td class="white"><div align="center">[PRESSURE]<br>WRONG VALUE</div></td>
<td class="white"><div align="center">압력 센서 값 오류</div></td>
</tr>
<tr>
<td class="white" colspan="4"></td>
</tr>
<tr>
<td class="error_even" rowspan="2"><div align="center">RANGE GROUND</div></td>
<td class="error_even"><div align="center">8</div></td>
<td class="error_even"><div align="center">[RANGE GROUND]<br>NO ANSWER</div></td>
<td class="error_even"><div align="center">거리 센서 응답 없음</div></td>
</tr>
<tr>
<td class="white"><div align="center">9</div></td>
<td class="white"><div align="center">[RANGE GROUND]<br>WRONG VALUE</div></td>
<td class="white"><div align="center">거리 센서 값 오류</div></td>
</tr>
<tr>
<td class="white" colspan="4"></td>
</tr>
<tr>
<td class="error_odd" rowspan="3"><div align="center">FLOW</div></td>
<td class="error_odd"><div align="center">10</div></td>
<td class="error_odd"><div align="center">[FLOW]<br>NO ANSWER</div></td>
<td class="error_odd"><div align="center">Flow 센서 응답 없음</div></td>
</tr>
<tr>
<td class="white"><div align="center">11</div></td>
<td class="white"><div align="center">[FLOW]<br>WRONG VALUE</div></td>
<td class="white"><div align="center">Flow 센서 값 오류</div></td>
</tr>
<tr>
<td class="error_odd"><div align="center">12</div></td>
<td class="error_odd"><div align="center">[FLOW]<br>CANNOT RECOGNIZE<br>GROUND IMAGE</div></td>
<td class="error_odd"><div align="center">Flow 센서 바닥 이미지를 인식할 수 없음</div></td>
</tr>
<tr>
<td class="white" colspan="4"></td>
</tr>
<tr>
<td class="error_even"><div align="center">MOTOR</div></td>
<td class="error_even"><div align="center">13</div></td>
<td class="error_even"><div align="center">CHECK<br>PROPELLER<br>AND MOTOR</div></td>
<td class="error_even"><div align="center">프로펠러나 모터에 문제가 있음</div></td>
</tr>
<tr>
<td class="white" colspan="4"></td>
</tr>
<tr>
<td class="error_odd"><div align="center">PROPELLER</div></td>
<td class="error_odd"><div align="center">14</div></td>
<td class="error_odd"><div align="center">REPLACE<br>VIBRATION<br>PROPELLER</div></td>
<td class="error_odd"><div align="center">프로펠러를 교체하세요<br>(프로펠러 진동이 심함)</div></td>
</tr>
<tr>
<td class="white" colspan="4"></td>
</tr>
<tr>
<td class="error_even"><div align="center">BATTERY</div></td>
<td class="error_even"><div align="center">15</div></td>
<td class="error_even"><div align="center">DRONE<br>LOW BATTERY</div></td>
<td class="error_even"><div align="center">드론 배터리 잔량 낮음</div></td>
</tr>
<tr>
<td class="white" colspan="4"></td>
</tr>
<tr>
<td class="error_odd" rowspan="2"><div align="center">FLIP</div></td>
<td class="error_odd"><div align="center">16</div></td>
<td class="error_odd"><div align="center">CANNOT FLIP<br>BATTERY IS UNDER 50%</div></td>
<td class="error_odd"><div align="center">배터리 잔량이 낮아서 플립 불가능</div></td>
</tr>
<tr>
<td class="white"><div align="center">17</div></td>
<td class="white"><div align="center">CANNOT FLIP<br>TOO HEAVY</div></td>
<td class="white"><div align="center">기체가 무거워 플립 불가능</div></td>
</tr>
<tr>
<td class="white" colspan="4"></td>
</tr>
<tr>
<td class="error_even" rowspan="2"><div align="center">REGISTRATION</div></td>
<td class="error_even"><div align="center">18</div></td>
<td class="error_even"><div align="center">DRONE IS<br>NOT REGISTERED</div></td>
<td class="error_even"><div align="center">드론이 등록되지 않음</div></td>
</tr>
<tr>
<td class="white"><div align="center">19</div></td>
<td class="white"><div align="center">CONTROLLER IS<br>NOT REGISTERED</div></td>
<td class="white"><div align="center">조종기가 등록되지 않음</div></td>
</tr>
<tr>
<td class="white" colspan="4"></td>
</tr>
</table>
</div>
<br>
<br>
<br>
<br>
여기까지 E-DRONE 조종기와 드론에 대한 간략한 설명이었습니다.
| BYROBOT/byrobot.github.io | documents/kr/products/e_drone/manual/user/index.md | Markdown | mit | 36,430 |
PROPS = {
'ATC code': 'P267',
'Archive url': 'P1065',
'authority': 'P797',
'approved by': 'P790',
'CAS registry number': 'P231',
'CIViC Variant ID': 'P3329',
'CIViC variant ID': 'P3329',
'ChEBI ID': 'P683',
'ChEMBL ID': 'P592',
'ChemSpider ID': 'P661',
'DOI': 'P356',
'Disease Ontology ID': 'P699',
'Drugbank ID': 'P715',
'drug used for treatment': 'P2176',
'EC Number': 'P591',
'Encoded By': 'P702',
'Ensembl Gene ID': 'P594',
'Ensembl Protein ID': 'P705',
'Ensembl Transcript ID': 'P704',
'Entrez Gene ID': 'P351',
'Entrez Gene ID ': 'P351',
'GARD rare disease ID': 'P4317',
'Gene Ontology ID': 'P686',
'Genomic end position': 'P645',
'Genomic start position': 'P644',
'HGNC gene symbol': 'P353',
'HGNC symbol': 'P354',
'HGVS nomenclature': 'P3331',
'Human Gene symbol': 'P353',
'Human Phenotype Ontology ID': 'P3841',
'ICD-10': 'P494',
'ICD-10-CM': 'P4229',
'ICD-9': 'P493',
'ICD-9-CM': 'P1692',
'IUPHAR ID': 'P595',
'InChI': 'P234',
'InChIKey': 'P235',
'incidence': 'P2844',
'InterPro ID': 'P2926',
'Isomeric SMILES': 'P2017',
'KEGG ID': 'P665',
'MGI': 'P671',
'MeSH Code': 'P672',
'MeSH ID': 'P486',
'Mondo ID': 'P5270',
'NCBI Locus tag': 'P2393',
'NCBI Taxonomy ID': 'P685',
'NCI Thesaurus ID': 'P1748',
'NDF-RT NUI': 'P2115',
'National Cancer Thesaurus ID': 'P1395',
'OMIM': 'P492',
'OMIM ID': 'P492',
'Orphanet ID': 'P1550',
'PDB ID': 'P638',
'PMC ID': 'P932',
'Protein Structure Image': 'P18',
'PubChem ID (CID)': 'P662',
'PubMed ID': 'P698',
'RTECS Number': 'P657',
'Rat Genome Database ID': 'P3853',
'RefSeq RNA ID': 'P639',
'Refseq Genome ID': 'P2249',
'Refseq Protein ID': 'P637',
'RxNorm CUI': 'P3345',
'SMILES': 'P233',
'Saccharomyces Genome Database ID': 'P3406',
'Sequence Ontology ID': 'P3986',
'start time': 'P580',
'UBERON ID': 'P1554',
'UMLS CUI': 'P2892',
'UNII': 'P652',
'Uniprot ID': 'P352',
'WikiPathways ID': 'P2410',
'anatomical location': 'P927',
'biological process': 'P682',
'biological variant of': 'P3433',
'cell component': 'P681',
'chemical formula': 'P274',
'chromosome': 'P1057',
'curator': 'P1640',
'cytogenetic location': 'P4196',
'determination method': 'P459',
'develops from': 'P3094',
'encodes': 'P688',
'equivalent class': 'P1709',
'exact match': 'P2888',
'found in taxon': 'P703',
'genetic association': 'P2293',
'genomic assembly': 'P659',
'genomic end': 'P645',
'genomic start': 'P644',
'has cause': 'P828',
'has part': 'P527',
'has phenotype': 'P6532',
'homologene id': 'P593',
'instance of': 'P31',
'location': 'P276',
'medical condition treated': 'P2175',
'miRBase mature miRNA ID': 'P2871',
'miRBase pre-miRNA ID': 'P2870',
'mirTarBase ID': 'P2646',
'molecular function': 'P680',
'negative diagnostic predictor': 'P3357',
'negative prognostic predictor': 'P3359',
'negative therapeutic predictor': 'P3355',
'observed in': 'P6531',
'offical website': 'P856',
'ortholog': 'P684',
'pathogen transmission process': 'P1060',
'parent taxon': 'P171',
'part of': 'P361',
'positive diagnostic predictor': 'P3356',
'positive prognostic predictor': 'P3358',
'positive therapeutic predictor': 'P3354',
'rating': 'P4271',
'reference URL': 'P854',
'regulates (molecular biology)': 'P128',
'retrieved': 'P813',
'route of administration': 'P636',
'stated in': 'P248',
'statement disputed by': 'P1310',
'subclass of': 'P279',
'subject has role': 'P2868',
'symptoms': 'P780',
'taxon name': 'P225',
'uberon id': 'P1554',
'IEDB Epitope ID': 'P4168',
'ChEBI-ID': 'P683',
'encoded by': 'P702',
'RefSeq Protein ID': 'P637',
'UniProt ID': 'P352',
'strand orientation': 'P2548',
'HGNC ID': 'P354',
'HGNC Gene Symbol': 'P353',
'HomoloGene ID': 'P593',
'Mouse Genome Informatics ID': 'P671',
'MGI Gene Symbol': 'P2394',
'Wormbase Gene ID': 'P3860',
'FlyBase Gene ID': 'P3852',
'ZFIN Gene ID': 'P3870'
}
ITEMS = {
'Cancer Biomarkers database': 'Q38100115',
'Genome assembly GRCh37': 'Q21067546',
'sequence variant': 'Q15304597',
'Missense Variant': 'Q27429979',
'MyVariant.info': 'Q38104308',
'CGI Evidence Clinical Practice': 'Q38145055',
'CGI Evidence Clinical Trials III-IV': 'Q38145539',
'CGI Evidence Clinical Trials I-II': 'Q38145727',
'CGI Evidence Case Reports': 'Q38145865',
'CGI Evidence Pre-Clinical Data': 'Q38145925',
'combination therapy': 'Q1304270',
'CIViC database': 'Q27612411',
'Homo sapiens': 'Q15978631',
'Wikipathways': 'Q7999828',
'Food and Drug Administration': 'Q204711',
'Inxight: Drugs Database': 'Q57664317',
'MitoDB': 'Q58019775',
'Mitochondrial Disease Database': 'Q58019775',
'percentage': 'Q11229'
}
DEFAULT_CORE_PROPS = ['NCBI Taxonomy ID', 'National Cancer Thesaurus ID', 'UNII', 'MeSH Code', 'IUPHAR ID',
'Archive url', 'Uniprot ID', 'RefSeq RNA ID', 'Entrez Gene ID', 'DOI', 'Refseq Genome ID',
'Protein Structure Image', 'NCBI Locus tag', 'PMC ID', 'PubMed ID', 'NCI Thesaurus ID',
'InterPro ID', 'InChIKey', 'ChEBI ID', 'mirTarBase ID', 'ChemSpider ID', 'MGI',
'miRBase mature miRNA ID', 'OMIM', 'Disease Ontology ID', 'PubChem ID (CID)', 'HGNC symbol',
'RTECS Number', 'NDF-RT NUI', 'Gene Ontology ID', 'Drugbank ID', 'miRBase pre-miRNA ID',
'KEGG ID', 'InChI', 'MeSH ID', 'Human Gene symbol', 'ChEMBL ID', 'Orphanet ID',
'CIViC Variant ID', 'WikiPathways ID']
DEFAULT_CORE_PROPS_PIDS = set(PROPS[x] for x in DEFAULT_CORE_PROPS)
def get_default_core_props(sparql_endpoint_url='https://query.wikidata.org/sparql') -> set:
# get the distinct value props from wikidata, and merge that list with the default_core_props listed here
from wikidataintegrator import wdi_core, wdi_helpers
h = wdi_helpers.WikibaseHelper(sparql_endpoint_url)
pids = set(h.get_pid(x) for x in DEFAULT_CORE_PROPS_PIDS)
wdi_core.WDItemEngine.get_distinct_value_props(sparql_endpoint_url)
wdi_core.WDItemEngine.DISTINCT_VALUE_PROPS[sparql_endpoint_url].update(pids)
core_props = wdi_core.WDItemEngine.DISTINCT_VALUE_PROPS[sparql_endpoint_url]
return core_props
| SuLab/scheduled-bots | scheduled_bots/__init__.py | Python | mit | 6,618 |
<!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><a href=".">dev / contrib:generic-environments dev</a></li>
<li class="active"><a href="">2014-12-12 02:40:34</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:generic-environments
<small>
dev
<span class="label label-success">5 s</span>
</small>
</h1>
<p><em><script>document.write(moment("2014-12-12 02:40:34 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2014-12-12 02:40:34 UTC)</em><p>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>ruby lint.rb unstable ../unstable/packages/coq:contrib:generic-environments/coq:contrib:generic-environments.dev</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
<dt>Output</dt>
<dd><pre>The package is valid.
</pre></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 --dry-run coq:contrib:generic-environments.dev coq.dev</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>1 s</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is dev).
The following actions will be performed:
- install coq:contrib:generic-environments.dev
=== 1 to install ===
=-=- Synchronizing package archives -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
=-=- Installing packages =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Building coq:contrib:generic-environments.dev:
coq_makefile -f Make -o Makefile
make -j4
make install
Installing coq:contrib:generic-environments.dev.
</pre></dd>
</dl>
<p>Dry install without Coq, to test if the problem was incompatibility with the current Coq version:</p>
<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 dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --deps-only coq:contrib:generic-environments.dev</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>2 s</dd>
</dl>
<h2>Install</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --verbose coq:contrib:generic-environments.dev</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>5 s</dd>
<dt>Output</dt>
<dd><pre>The following actions will be performed:
- install coq:contrib:generic-environments.dev
=== 1 to install ===
=-=- Synchronizing package archives -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[coq:contrib:generic-environments] Fetching https://gforge.inria.fr/git/coq-contribs/generic-environments.git#trunk
Initialized empty Git repository in /home/bench/.opam/packages.dev/coq:contrib:generic-environments.dev/.git/
[master (root-commit) bd3c8f5] opam-git-init
From https://gforge.inria.fr/git/coq-contribs/generic-environments
* [new branch] trunk -> opam-ref
* [new branch] trunk -> origin/trunk
CoreGenericEnv.v
GenericEnv.v
GenericEnvList.v
Make
Makefile
description
HEAD is now at 022af91 Revert "Regenerating Makefiles." We will be able to do so when we have access
=-=- Installing packages =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Building coq:contrib:generic-environments.dev:
coq_makefile -f Make -o Makefile
make -j4
make install
"coqdep" -c -R "." GenericEnvironments "CoreGenericEnv.v" > "CoreGenericEnv.v.d" || ( RV=$?; rm -f "CoreGenericEnv.v.d"; exit ${RV} )
"coqdep" -c -R "." GenericEnvironments "GenericEnv.v" > "GenericEnv.v.d" || ( RV=$?; rm -f "GenericEnv.v.d"; exit ${RV} )
"coqdep" -c -R "." GenericEnvironments "GenericEnvList.v" > "GenericEnvList.v.d" || ( RV=$?; rm -f "GenericEnvList.v.d"; exit ${RV} )
"coqc" -q -R "." GenericEnvironments CoreGenericEnv
"coqc" -q -R "." GenericEnvironments GenericEnv
"coqc" -q -R "." GenericEnvironments GenericEnvList
cd "." && for i in GenericEnvList.vo GenericEnv.vo CoreGenericEnv.vo ; do \
install -d "`dirname """/home/bench/.opam/system/lib/coq/user-contrib"/GenericEnvironments/$i`"; \
install -m 0644 $i """/home/bench/.opam/system/lib/coq/user-contrib"/GenericEnvironments/$i; \
done
Installing coq:contrib:generic-environments.dev.
</pre></dd>
</dl>
<h2>Installation size</h2>
<p>Total: 636 K</p>
<ul>
<li>333 K <code>/home/bench/.opam/system/lib/coq/user-contrib/GenericEnvironments/GenericEnvList.vo</code></li>
<li>212 K <code>/home/bench/.opam/system/lib/coq/user-contrib/GenericEnvironments/GenericEnv.vo</code></li>
<li>90 K <code>/home/bench/.opam/system/lib/coq/user-contrib/GenericEnvironments/CoreGenericEnv.vo</code></li>
<li>1 K <code>/home/bench/.opam/system/lib/coq:contrib:generic-environments/opam.config</code></li>
<li>1 K <code>/home/bench/.opam/system/install/coq:contrib:generic-environments.install</code></li>
</ul>
<h2>Uninstall</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq:contrib:generic-environments.dev</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>2 s</dd>
<dt>Output</dt>
<dd><pre>The following actions will be performed:
- remove coq:contrib:generic-environments.dev
=== 1 to remove ===
=-=- Synchronizing package archives -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[coq:contrib:generic-environments] Fetching https://gforge.inria.fr/git/coq-contribs/generic-environments.git#trunk
=-=- Removing Packages =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Removing coq:contrib:generic-environments.dev.
rm -R /home/bench/.opam/system/lib/coq/user-contrib/GenericEnvironments
</pre></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">
<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/dev/contrib:generic-environments/dev/2014-12-12_02-40-34.html | HTML | mit | 9,507 |
package com.example.admin.vehicle;
import android.content.Intent;
import android.graphics.Bitmap;
import android.net.Uri;
import android.provider.MediaStore;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Base64;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import android.graphics.BitmapFactory;
import android.database.Cursor;
import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.util.Locale;
import android.os.Handler;
import org.json.JSONArray;
import org.json.JSONObject;
public class vehicle extends AppCompatActivity {
private TextView textView_result;
private ImageView imageView_car;
private Button button_take_photo;
private Button button_pick_picture;
private Handler handler=null;
private String content=null;
private static int RESULT_LOAD_IMAGE = 1;
private String TAG = "vehicle_detect";
private String base64 = null;
private String httpArg = null;
private String access_token = null;
public static final String APP_ID = "10123710";
public static final String API_KEY = "Gd9bxXsl7yyw8HWDkpnb8q0C";
public static final String SECRET_KEY = "xi8d3x9xsMXAuLnLznWsiv0CwZATBPHI";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_vehicle);
textView_result = (TextView)findViewById(R.id.car_result);
imageView_car = (ImageView) findViewById(R.id.image_car);
button_take_photo = (Button)findViewById(R.id.take_photo);
button_pick_picture = (Button)findViewById(R.id.pick_picture);
button_take_photo.setOnClickListener(takePhoto);
button_pick_picture.setOnClickListener(pickPicture);
imageView_car.setOnClickListener(imageCarDetect);
handler = new Handler();
}
Button.OnClickListener takePhoto = new Button.OnClickListener() {
public void onClick(View v){
try {
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
intent.setAction(MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(intent, 2);
} catch (Exception e) {
e.printStackTrace();
}
}
};
Button.OnClickListener pickPicture = new Button.OnClickListener() {
public void onClick(View v){
Intent i = new Intent(
Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
startActivityForResult(i, RESULT_LOAD_IMAGE);
}
};
ImageView.OnClickListener imageCarDetect = new ImageView.OnClickListener() {
public void onClick(View v){
if (httpArg != null)
sendRequestWithHttpURLConnection();
}
};
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
String picturePath = null;
Bitmap bitmap = null;
if (requestCode == RESULT_LOAD_IMAGE && resultCode == RESULT_OK && null != data) {
Uri selectedImage = data.getData();
String[] filePathColumn = {MediaStore.Images.Media.DATA};
Cursor cursor = getContentResolver().query(selectedImage,
filePathColumn, null, null, null);
cursor.moveToFirst();
int columnIndex = cursor.getColumnIndex(filePathColumn[0]);
picturePath = cursor.getString(columnIndex);
Log.d(TAG, picturePath);
cursor.close();
if (!picturePath.isEmpty())
imageView_car.setImageURI(selectedImage);
}
else if (requestCode == 2 && resultCode == RESULT_OK && null != data) {
Bundle bundle = data.getExtras();
bitmap = (Bitmap)bundle.get("data");
imageView_car.setImageBitmap(bitmap);
imgToBase64(null, bitmap);
}
if (bitmap != null || picturePath != null) {
base64 = imgToBase64(picturePath, bitmap);
base64 = base64.replace("\r\n", "");
try {
base64 = URLEncoder.encode(base64, "utf-8");
httpArg= "imagetype=1"+ "&image="+base64 +"&top_num=4";
sendRequestWithHttpURLConnection();
} catch (Exception e) {
return;
}
}
}
private void get_access_token() {
HttpURLConnection connection=null;
String uri = "https://aip.baidubce.com/oauth/2.0/token?" +
"grant_type=client_credentials" + "&client_id=" + API_KEY + "&client_secret=" + SECRET_KEY;
try {
URL url = new URL(uri);
connection =(HttpURLConnection) url.openConnection();
connection.setRequestMethod("POST");
connection.setConnectTimeout(8000);
connection.setReadTimeout(8000);
connection.connect();
InputStream in=connection.getInputStream();
BufferedReader reader=new BufferedReader(new InputStreamReader(in));
StringBuilder response=new StringBuilder();
String line;
while((line=reader.readLine())!=null){
response.append(line);
}
content = response.toString();
Log.e(TAG, "get_access_token: " + content);
JSONObject jsonObject=new JSONObject(content);
access_token = jsonObject.getString("access_token");
Log.e(TAG, "get_access_token: access_token: " + access_token);
} catch (Exception e) {
e.printStackTrace();
content = "网络连接超时,请点击图片重试...";
handler.post(runnableUi);
} finally{
if(connection!=null)
connection.disconnect();
}
}
private void sendRequestWithHttpURLConnection(){
//开启线程来发起网络请求
new Thread(new Runnable(){
public void run() {
if (access_token == null)
get_access_token();
HttpURLConnection connection=null;
content = "查询中...";
handler.post(runnableUi);
try {
String uri = "https://aip.baidubce.com/rest/2.0/image-classify/v1/car?access_token=" + access_token;
URL url=new URL(uri);
connection =(HttpURLConnection) url.openConnection();
connection.setRequestMethod("POST");
connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
connection.setDoOutput(true);
connection.getOutputStream().write(httpArg.getBytes("UTF-8"));
connection.setConnectTimeout(8000);
connection.setReadTimeout(8000);
connection.connect();
InputStream in=connection.getInputStream();
BufferedReader reader=new BufferedReader(new InputStreamReader(in));
StringBuilder response=new StringBuilder();
String line;
while((line=reader.readLine())!=null){
response.append(line);
}
content = response.toString();
Log.e(TAG, "run: " + content);
parseJSONWithJSONObject(content);
}catch (Exception e) {
e.printStackTrace();
content = "网络连接超时,请点击图片重试...";
handler.post(runnableUi);
}
finally{
if(connection!=null){
connection.disconnect();
}
}
}
}).start();
}
Runnable runnableUi=new Runnable(){
@Override
public void run() {
textView_result.setText(content);
}
};
Button.OnClickListener selectPicture = new Button.OnClickListener(){
public void onClick(View v){
Intent i = new Intent(
Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
startActivityForResult(i, RESULT_LOAD_IMAGE);
}
};
public static String imgToBase64(String imgPath, Bitmap bitmap) {
if (imgPath !=null && imgPath.length() > 0) {
bitmap = readBitmap(imgPath);
}
ByteArrayOutputStream out = null;
try {
out = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, out);
out.flush();
out.close();
byte[] imgBytes = out.toByteArray();
return Base64.encodeToString(imgBytes, Base64.DEFAULT);
} catch (Exception e) {
// TODO Auto-generated catch block
return null;
}
}
private static Bitmap readBitmap(String imgPath) {
try {
return BitmapFactory.decodeFile(imgPath);
} catch (Exception e) {
// TODO Auto-generated catch block
return null;
}
}
//方法一:使用JSONObject
private void parseJSONWithJSONObject(String jsonData) {
content = "";
try
{
JSONObject jsonObject=new JSONObject(jsonData);
JSONArray jsonArray=jsonObject.getJSONArray("result");
for (int i=0; i < jsonArray.length(); i++) {
JSONObject object = jsonArray.getJSONObject(i);
float score1 = Float.parseFloat(object.getString("score")) * 100;
String score = String.format("%.2f", score1);
String name = object.getString("name");
content += "\n 车型: " + name + " 可信度: " + score + "%";
}
handler.post(runnableUi);
}
catch (Exception e)
{
e.printStackTrace();
}
}
}
| zwqaoy/car-detect | main/java/com/example/admin/vehicle/vehicle.java | Java | mit | 10,631 |
using GhostRunner.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
namespace GhostRunner.ViewModels.Home
{
public class IndexModel : ViewModel
{
public IndexModel()
{
AllowAccountCreate = true;
}
[Required(ErrorMessage = " * Required")]
public String Password { get; set; }
public Boolean AllowAccountCreate { get; set; }
}
} | gmarland/GhostRunner | GhostRunner/ViewModels/Home/IndexModel.cs | C# | mit | 500 |
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for source/api/oauth/sign/index.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../../../prettify.css" />
<link rel="stylesheet" href="../../../../base.css" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../../../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1>
<a href="../../../../index.html">All files</a> / <a href="index.html">source/api/oauth/sign</a> index.js
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">39.29% </span>
<span class="quiet">Statements</span>
<span class='fraction'>11/28</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">58.33% </span>
<span class="quiet">Branches</span>
<span class='fraction'>7/12</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>0/0</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">39.29% </span>
<span class="quiet">Lines</span>
<span class='fraction'>11/28</span>
</div>
</div>
</div>
<div class='status-line low'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45</td><td class="line-coverage quiet"><span class="cline-any cline-yes">9x</span>
<span class="cline-any cline-yes">9x</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import jwt from 'jsonwebtoken';
import { User } from '../../../models';
export async function sign(ctx) {
const { email, password } = ctx.request.body;
if (!email || typeof email !== 'string') {
ctx.status = 400;
ctx.body = { error: 'invalid email' };
return;
}
<span class="missing-if-branch" title="else path not taken" >E</span>if (!password || typeof password !== 'string') {
ctx.status = 400;
ctx.body = { error: 'invalid password' };
return;
}
<span class="cstat-no" title="statement not covered" > try {</span>
c</span>onst unauthedUser = <span class="cstat-no" title="statement not covered" >await User.findOne({ email }, { password: true });
<span class="cstat-no" title="statement not covered" > if (unauthedUser) {</span>
c</span>onst authenticated = <span class="cstat-no" title="statement not covered" >unauthedUser.authenticate(password);
<span class="cstat-no" title="statement not covered" > if (authenticated) {</span>
c</span>onst expiresIn = <span class="cstat-no" title="statement not covered" >86400;
c</span>onst authedUser = <span class="cstat-no" title="statement not covered" >await User.findOne({ email });
c</span>onst token = <span class="cstat-no" title="statement not covered" >jwt.sign(authedUser, 'shhhhh', { expiresIn });
<span class="cstat-no" title="statement not covered" > ctx.status = 200;</span>
<span class="cstat-no" title="statement not covered" > ctx.body = { token, expiresIn };</span>
<span class="cstat-no" title="statement not covered" > return;</span>
}
<span class="cstat-no" title="statement not covered" > ctx.status = 401;</span>
<span class="cstat-no" title="statement not covered" > ctx.body = { error: 'invalid credentials' };</span>
<span class="cstat-no" title="statement not covered" > return;</span>
}
} catch (error) {
<span class="cstat-no" title="statement not covered" > ctx.status = 401;</span>
<span class="cstat-no" title="statement not covered" > ctx.body = { error: 'invalid credentials' };</span>
<span class="cstat-no" title="statement not covered" > return;</span>
}
}
export default sign;
</pre></td></tr>
</table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Fri Nov 18 2016 22:09:55 GMT+1000 (AEST)
</div>
</div>
<script src="../../../../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../../../../sorter.js"></script>
</body>
</html>
| qutseamless/api | docs/test/source/api/oauth/sign/index.js.html | HTML | mit | 6,772 |
/*
*
* LambdaRunnable
* ledger-core
*
* Created by Pierre Pollastri on 15/11/2016.
*
* The MIT License (MIT)
*
* Copyright (c) 2016 Ledger
*
* 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.
*
*/
#include "LambdaRunnable.hpp"
namespace ledger {
namespace core {
static std::function<void ()> NOOP = [] () {};
LambdaRunnable::LambdaRunnable(std::function<void()> func) {
_func = func;
}
void LambdaRunnable::run() {
_func();
_func = NOOP;
}
std::shared_ptr<api::Runnable> LambdaRunnable::make(std::function<void()> func) {
return std::make_shared<LambdaRunnable>(func);
}
std::shared_ptr<api::Runnable> make_runnable(std::function<void()> func) {
return std::make_shared<LambdaRunnable>(func);
}
}
} | LedgerHQ/lib-ledger-core | core/src/utils/LambdaRunnable.cpp | C++ | mit | 1,879 |
package durdinapps.rxfirebase2;
import androidx.annotation.NonNull;
import com.google.android.gms.tasks.OnFailureListener;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.firebase.database.ChildEventListener;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.MutableData;
import com.google.firebase.database.Query;
import com.google.firebase.database.Transaction;
import com.google.firebase.database.ValueEventListener;
import java.util.Iterator;
import java.util.Map;
import durdinapps.rxfirebase2.exceptions.RxFirebaseDataException;
import io.reactivex.BackpressureStrategy;
import io.reactivex.Completable;
import io.reactivex.CompletableEmitter;
import io.reactivex.CompletableOnSubscribe;
import io.reactivex.Flowable;
import io.reactivex.FlowableEmitter;
import io.reactivex.FlowableOnSubscribe;
import io.reactivex.Maybe;
import io.reactivex.MaybeEmitter;
import io.reactivex.MaybeOnSubscribe;
import io.reactivex.MaybeSource;
import io.reactivex.Single;
import io.reactivex.SingleEmitter;
import io.reactivex.SingleOnSubscribe;
import io.reactivex.functions.Cancellable;
import io.reactivex.functions.Function;
import static durdinapps.rxfirebase2.DataSnapshotMapper.DATA_SNAPSHOT_EXISTENCE_PREDICATE;
public class RxFirebaseDatabase {
/**
* Listener for changes in te data at the given query location.
*
* @param query reference represents a particular location in your Database and can be used for reading or writing data to that Database location.
* @param strategy {@link BackpressureStrategy} associated to this {@link Flowable}
* @return a {@link Flowable} which emits when a value of the database change in the given query.
*/
@NonNull
public static Flowable<DataSnapshot> observeValueEvent(@NonNull final Query query,
@NonNull BackpressureStrategy strategy) {
return Flowable.create(new FlowableOnSubscribe<DataSnapshot>() {
@Override
public void subscribe(final FlowableEmitter<DataSnapshot> emitter) throws Exception {
final ValueEventListener valueEventListener = new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
emitter.onNext(dataSnapshot);
}
@Override
public void onCancelled(final DatabaseError error) {
if (!emitter.isCancelled())
emitter.onError(new RxFirebaseDataException(error));
}
};
emitter.setCancellable(new Cancellable() {
@Override
public void cancel() throws Exception {
query.removeEventListener(valueEventListener);
}
});
query.addValueEventListener(valueEventListener);
}
}, strategy);
}
/**
* Listener for a single change in te data at the given query location.
*
* @param query reference represents a particular location in your Database and can be used for reading or writing data to that Database location.
* @return a {@link Maybe} which emits the actual state of the database for the given query. onSuccess will be only call when
* the given {@link DataSnapshot} exists onComplete will only called when the data doesn't exist.
*/
@NonNull
public static Maybe<DataSnapshot> observeSingleValueEvent(@NonNull final Query query) {
return Maybe.create(new MaybeOnSubscribe<DataSnapshot>() {
@Override
public void subscribe(final MaybeEmitter<DataSnapshot> emitter) throws Exception {
query.addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
if (dataSnapshot.exists()) {
emitter.onSuccess(dataSnapshot);
} else {
emitter.onComplete();
}
}
@Override
public void onCancelled(DatabaseError error) {
if (!emitter.isDisposed())
emitter.onError(new RxFirebaseDataException(error));
}
});
}
});
}
/**
* Run a transaction on the data at this location. For more information on running transactions, see
*
* @param ref reference represents a particular location in your database.
* @param fireLocalEvents boolean which allow to receive calls of your transaction in your local device.
* @param transactionValue value of the transaction.
* @return a {@link Single} which emits the final {@link DataSnapshot} value if the transaction success.
*/
@NonNull
public static Single<DataSnapshot> runTransaction(@NonNull final DatabaseReference ref,
@NonNull final boolean fireLocalEvents,
@NonNull final long transactionValue) {
return Single.create(new SingleOnSubscribe<DataSnapshot>() {
@Override
public void subscribe(final SingleEmitter emitter) throws Exception {
ref.runTransaction(new Transaction.Handler() {
@Override
public Transaction.Result doTransaction(MutableData mutableData) {
Integer currentValue = mutableData.getValue(Integer.class);
if (currentValue == null) {
mutableData.setValue(transactionValue);
} else {
mutableData.setValue(currentValue + transactionValue);
}
return Transaction.success(mutableData);
}
@Override
public void onComplete(DatabaseError databaseError, boolean b, DataSnapshot dataSnapshot) {
if (databaseError != null && !emitter.isDisposed()) {
emitter.onError(new RxFirebaseDataException(databaseError));
} else {
emitter.onSuccess(dataSnapshot);
}
}
}, fireLocalEvents);
}
});
}
/**
* Set the given value on the specified {@link DatabaseReference}.
*
* @param ref reference represents a particular location in your database.
* @param value value to update.
* @return a {@link Completable} which is complete when the set value call finish successfully.
*/
@NonNull
public static Completable setValue(@NonNull final DatabaseReference ref,
final Object value) {
return Completable.create(new CompletableOnSubscribe() {
@Override
public void subscribe(@NonNull final CompletableEmitter e) throws Exception {
ref.setValue(value).addOnSuccessListener(new OnSuccessListener<Void>() {
@Override
public void onSuccess(Void aVoid) {
e.onComplete();
}
}).addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception exception) {
if (!e.isDisposed())
e.onError(exception);
}
});
}
});
}
/**
* Update the specific child keys to the specified values.
*
* @param ref reference represents a particular location in your database.
* @param updateData The paths to update and their new values
* @return a {@link Completable} which is complete when the update children call finish successfully.
*/
@NonNull
public static Completable updateChildren(@NonNull final DatabaseReference ref,
@NonNull final Map<String, Object> updateData) {
return Completable.create(new CompletableOnSubscribe() {
@Override
public void subscribe(final CompletableEmitter emitter) throws Exception {
ref.updateChildren(updateData, new DatabaseReference.CompletionListener() {
@Override
public void onComplete(DatabaseError error, DatabaseReference databaseReference) {
if (error != null && !emitter.isDisposed()) {
emitter.onError(new RxFirebaseDataException(error));
} else {
emitter.onComplete();
}
}
});
}
});
}
/**
* Listener for for child events occurring at the given query location.
*
* @param query reference represents a particular location in your Database and can be used for reading or writing data to that Database location.
* @param strategy {@link BackpressureStrategy} associated to this {@link Flowable}
* @return a {@link Flowable} which emits when a value of a child int the database change on the given query.
*/
@NonNull
public static Flowable<RxFirebaseChildEvent<DataSnapshot>> observeChildEvent(
@NonNull final Query query, @NonNull BackpressureStrategy strategy) {
return Flowable.create(new FlowableOnSubscribe<RxFirebaseChildEvent<DataSnapshot>>() {
@Override
public void subscribe(final FlowableEmitter<RxFirebaseChildEvent<DataSnapshot>> emitter) throws Exception {
final ChildEventListener childEventListener = new ChildEventListener() {
@Override
public void onChildAdded(DataSnapshot dataSnapshot, String previousChildName) {
emitter.onNext(
new RxFirebaseChildEvent<>(dataSnapshot.getKey(), dataSnapshot, previousChildName,
RxFirebaseChildEvent.EventType.ADDED));
}
@Override
public void onChildChanged(DataSnapshot dataSnapshot, String previousChildName) {
emitter.onNext(
new RxFirebaseChildEvent<>(dataSnapshot.getKey(), dataSnapshot, previousChildName,
RxFirebaseChildEvent.EventType.CHANGED));
}
@Override
public void onChildRemoved(DataSnapshot dataSnapshot) {
emitter.onNext(new RxFirebaseChildEvent<>(dataSnapshot.getKey(), dataSnapshot,
RxFirebaseChildEvent.EventType.REMOVED));
}
@Override
public void onChildMoved(DataSnapshot dataSnapshot, String previousChildName) {
emitter.onNext(
new RxFirebaseChildEvent<>(dataSnapshot.getKey(), dataSnapshot, previousChildName,
RxFirebaseChildEvent.EventType.MOVED));
}
@Override
public void onCancelled(DatabaseError error) {
if (!emitter.isCancelled())
emitter.onError(new RxFirebaseDataException(error));
}
};
emitter.setCancellable(new Cancellable() {
@Override
public void cancel() throws Exception {
query.removeEventListener(childEventListener);
}
});
query.addChildEventListener(childEventListener);
}
}, strategy);
}
/**
* Method which retrieve a list of DataSnapshot from multiple {@link DatabaseReference}.
*
* @param whereRefs array of {@link DatabaseReference references.}
* @return a {@link Flowable} which emmit {@link DataSnapshot} from the given queries.
*/
@NonNull
public static Flowable<DataSnapshot> observeMultipleSingleValueEvent(@NonNull DatabaseReference... whereRefs) {
return Maybe.merge(Flowable.fromArray(whereRefs)
.map(new Function<DatabaseReference, MaybeSource<? extends DataSnapshot>>() {
@Override
public MaybeSource<? extends DataSnapshot> apply(@NonNull DatabaseReference databaseReference) throws
Exception {
return observeSingleValueEvent(databaseReference);
}
})
);
}
/**
* Retrieve the child {@link DatabaseReference references} from an specific parent which equals to the
* references retrieved from another query. Which allow to make a "where" clause on a no relational table.
* <p>
* Example:
* DatabaseReference from = reference.child("Tweets");
* Query where = reference.child("favorited").child(userA);
* requestFilteredReferenceKeys(from, where).subscribe...
* <p>
* This last method will return the key references(/tweets/tweetId) which the userA mark as favorited.
* With the given list we can work together with {@link RxFirebaseDatabase#observeMultipleSingleValueEvent(DatabaseReference...)}
* to retrieve the Datasnapshots from the desired {@link DatabaseReference} based on other {@link DatabaseReference} values.
*
* @param from base reference where you want to retrieve the original references.
* @param whereRef reference that you use as a filter to create your from references.
* @return a {@link Maybe} which contain the list of the given DatabaseReferences.
*/
@NonNull
public static Maybe<DatabaseReference[]> requestFilteredReferenceKeys(@NonNull final DatabaseReference from,
@NonNull Query whereRef) {
return observeSingleValueEvent(whereRef, new Function<DataSnapshot, DatabaseReference[]>() {
@Override
public DatabaseReference[] apply(@NonNull DataSnapshot dataSnapshot) throws Exception {
int childrenCount = (int) dataSnapshot.getChildrenCount();
DatabaseReference[] filterRefs = new DatabaseReference[childrenCount];
final Iterator<DataSnapshot> iterator = dataSnapshot.getChildren().iterator();
for (int i = 0; i < childrenCount; i++) {
filterRefs[i] = from.child(iterator.next().getKey());
}
return filterRefs;
}
});
}
/**
* Listener for changes in te data at the given query location.
*
* @param query reference represents a particular location in your Database and can be used for reading or writing data to that Database location.
* @param clazz class type for the {@link DataSnapshot} items.
* @param strategy {@link BackpressureStrategy} associated to this {@link Flowable}
* @return a {@link Flowable} which emits when a value of the database change in the given query.
*/
@NonNull
public static <T> Flowable<T> observeValueEvent(@NonNull final Query query,
@NonNull final Class<T> clazz,
@NonNull BackpressureStrategy strategy) {
return observeValueEvent(query, DataSnapshotMapper.of(clazz), strategy);
}
/**
* Listener for a single change in te data at the given query location.
*
* @param query reference represents a particular location in your Database and can be used for reading or writing data to that Database location.
* @param clazz class type for the {@link DataSnapshot} items.
* @return a {@link Maybe} which emits the actual state of the database for the given query.
*/
@NonNull
public static <T> Maybe<T> observeSingleValueEvent(@NonNull final Query query,
@NonNull final Class<T> clazz) {
return observeSingleValueEvent(query, DataSnapshotMapper.of(clazz));
}
/**
* Listener for for child events occurring at the given query location.
*
* @param query reference represents a particular location in your Database and can be used for reading or writing data to that Database location.
* @param clazz class type for the {@link DataSnapshot} items.
* @param strategy {@link BackpressureStrategy} associated to this {@link Flowable}
* @return a {@link Flowable} which emits when a value of a child int the database change on the given query.
*/
@NonNull
public static <T> Flowable<RxFirebaseChildEvent<T>> observeChildEvent(
@NonNull final Query query, @NonNull final Class<T> clazz,
@NonNull BackpressureStrategy strategy) {
return observeChildEvent(query, DataSnapshotMapper.ofChildEvent(clazz), strategy);
}
/**
* Listener for changes in te data at the given query location.
*
* @param query reference represents a particular location in your Database and can be used for reading or writing data to that Database location.
* @param mapper specific function to map the dispatched events.
* @param strategy {@link BackpressureStrategy} associated to this {@link Flowable}
* @return a {@link Flowable} which emits when a value of the database change in the given query.
*/
@NonNull
public static <T> Flowable<T> observeValueEvent(@NonNull final Query query,
@NonNull final Function<? super DataSnapshot, ? extends T> mapper,
@NonNull BackpressureStrategy strategy) {
return observeValueEvent(query, strategy).map(mapper);
}
/**
* Listener for a single change in te data at the given query location.
*
* @param query reference represents a particular location in your Database and can be used for reading or writing data to that Database location.
* @param mapper specific function to map the dispatched events.
* @return a {@link Maybe} which emits the actual state of the database for the given query.
*/
@NonNull
public static <T> Maybe<T> observeSingleValueEvent(@NonNull final Query query,
@NonNull final Function<? super DataSnapshot, ? extends T> mapper) {
return observeSingleValueEvent(query)
.filter(DATA_SNAPSHOT_EXISTENCE_PREDICATE)
.map(mapper);
}
/**
* Listener for for child events occurring at the given query location.
*
* @param query reference represents a particular location in your Database and can be used for reading or writing data to that Database location.
* @param mapper specific function to map the dispatched events.
* @param strategy {@link BackpressureStrategy} associated to this {@link Flowable}
* @return a {@link Flowable} which emits when a value of a child int the database change on the given query.
*/
@NonNull
public static <T> Flowable<RxFirebaseChildEvent<T>> observeChildEvent(
@NonNull final Query query, @NonNull final Function<? super RxFirebaseChildEvent<DataSnapshot>,
? extends RxFirebaseChildEvent<T>> mapper, @NonNull BackpressureStrategy strategy) {
return observeChildEvent(query, strategy).map(mapper);
}
/**
* Listener for changes in the data at the given query location.
*
* @param query reference represents a particular location in your Database and can be used for reading or writing data to that Database location.
* @return a {@link Flowable} which emits when a value of the database change in the given query.
*/
@NonNull
public static Flowable<DataSnapshot> observeValueEvent(@NonNull final Query query) {
return observeValueEvent(query, BackpressureStrategy.DROP);
}
/**
* Listener for for child events occurring at the given query location.
*
* @param query reference represents a particular location in your Database and can be used for reading or writing data to that Database location.
* @return a {@link Flowable} which emits when a value of a child int the database change on the given query.
*/
@NonNull
public static Flowable<RxFirebaseChildEvent<DataSnapshot>> observeChildEvent(
@NonNull final Query query) {
return observeChildEvent(query, BackpressureStrategy.DROP);
}
/**
* Run a transaction on the data at this location. For more information on running transactions, see
*
* @param ref reference represents a particular location in your database.
* @param transactionValue value of the transaction.
* @return a {@link Single} which emits the final {@link DataSnapshot} value if the transaction success.
*/
@NonNull
public static Single<DataSnapshot> runTransaction(@NonNull final DatabaseReference ref,
@NonNull final long transactionValue) {
return runTransaction(ref, true, transactionValue);
}
/**
* Listener for changes in te data at the given query location.
*
* @param query reference represents a particular location in your Database and can be used for reading or writing data to that Database location.
* @param clazz class type for the {@link DataSnapshot} items.
* @return a {@link Flowable} which emits when a value of the database change in the given query.
*/
@NonNull
public static <T> Flowable<T> observeValueEvent(@NonNull final Query query,
@NonNull final Class<T> clazz) {
return observeValueEvent(query, DataSnapshotMapper.of(clazz), BackpressureStrategy.DROP);
}
/**
* Listener for for child events occurring at the given query location.
*
* @param query reference represents a particular location in your Database and can be used for reading or writing data to that Database location.
* @param clazz class type for the {@link DataSnapshot} items.
* @return a {@link Flowable} which emits when a value of a child int the database change on the given query.
*/
@NonNull
public static <T> Flowable<RxFirebaseChildEvent<T>> observeChildEvent(
@NonNull final Query query, @NonNull final Class<T> clazz) {
return observeChildEvent(query, DataSnapshotMapper.ofChildEvent(clazz), BackpressureStrategy.DROP);
}
/**
* Listener for changes in te data at the given query location.
*
* @param query reference represents a particular location in your Database and can be used for reading or writing data to that Database location.
* @return a {@link Flowable} which emits when a value of the database change in the given query.
*/
@NonNull
public static <T> Flowable<T> observeValueEvent(@NonNull final Query query,
@NonNull final Function<? super DataSnapshot, ? extends T> mapper) {
return observeValueEvent(query, BackpressureStrategy.DROP).map(mapper);
}
/**
* Listener for for child events occurring at the given query location.
*
* @param query reference represents a particular location in your Database and can be used for reading or writing data to that Database location.
* @param mapper specific function to map the dispatched events.
* @return a {@link Flowable} which emits when a value of a child int the database change on the given query.
*/
@NonNull
public static <T> Flowable<RxFirebaseChildEvent<T>> observeChildEvent(
@NonNull final Query query, @NonNull final Function<? super RxFirebaseChildEvent<DataSnapshot>,
? extends RxFirebaseChildEvent<T>> mapper) {
return observeChildEvent(query, BackpressureStrategy.DROP).map(mapper);
}
} | FrangSierra/Rx2Firebase | app/src/main/java/durdinapps/rxfirebase2/RxFirebaseDatabase.java | Java | mit | 24,623 |
using System.Numerics;
using BenchmarkDotNet.Attributes;
namespace BenchmarkDotNet.IntegrationTests.DifferentRuntime
{
public class BenchmarksThatUseTypeThatRequiresDifferentRuntime
{
[Benchmark]
public bool Benchmark()
{
return Vector<int>.Zero.Equals(Vector<int>.One);
}
}
} | redknightlois/BenchmarkDotNet | BenchmarkDotNet.IntegrationTests.DifferentRuntime/BenchmarksThatUseTypeThatRequiresDifferentRuntime.cs | C# | mit | 336 |
package containerservice
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
// OchestratorTypes enumerates the values for ochestrator types.
type OchestratorTypes string
const (
// DCOS ...
DCOS OchestratorTypes = "DCOS"
// Mesos ...
Mesos OchestratorTypes = "Mesos"
// SwarmPreview ...
SwarmPreview OchestratorTypes = "SwarmPreview"
)
// PossibleOchestratorTypesValues returns an array of possible values for the OchestratorTypes const type.
func PossibleOchestratorTypesValues() []OchestratorTypes {
return []OchestratorTypes{DCOS, Mesos, SwarmPreview}
}
// VMSizeTypes enumerates the values for vm size types.
type VMSizeTypes string
const (
// StandardA0 ...
StandardA0 VMSizeTypes = "Standard_A0"
// StandardA1 ...
StandardA1 VMSizeTypes = "Standard_A1"
// StandardA10 ...
StandardA10 VMSizeTypes = "Standard_A10"
// StandardA11 ...
StandardA11 VMSizeTypes = "Standard_A11"
// StandardA2 ...
StandardA2 VMSizeTypes = "Standard_A2"
// StandardA3 ...
StandardA3 VMSizeTypes = "Standard_A3"
// StandardA4 ...
StandardA4 VMSizeTypes = "Standard_A4"
// StandardA5 ...
StandardA5 VMSizeTypes = "Standard_A5"
// StandardA6 ...
StandardA6 VMSizeTypes = "Standard_A6"
// StandardA7 ...
StandardA7 VMSizeTypes = "Standard_A7"
// StandardA8 ...
StandardA8 VMSizeTypes = "Standard_A8"
// StandardA9 ...
StandardA9 VMSizeTypes = "Standard_A9"
// StandardD1 ...
StandardD1 VMSizeTypes = "Standard_D1"
// StandardD11 ...
StandardD11 VMSizeTypes = "Standard_D11"
// StandardD11V2 ...
StandardD11V2 VMSizeTypes = "Standard_D11_v2"
// StandardD12 ...
StandardD12 VMSizeTypes = "Standard_D12"
// StandardD12V2 ...
StandardD12V2 VMSizeTypes = "Standard_D12_v2"
// StandardD13 ...
StandardD13 VMSizeTypes = "Standard_D13"
// StandardD13V2 ...
StandardD13V2 VMSizeTypes = "Standard_D13_v2"
// StandardD14 ...
StandardD14 VMSizeTypes = "Standard_D14"
// StandardD14V2 ...
StandardD14V2 VMSizeTypes = "Standard_D14_v2"
// StandardD1V2 ...
StandardD1V2 VMSizeTypes = "Standard_D1_v2"
// StandardD2 ...
StandardD2 VMSizeTypes = "Standard_D2"
// StandardD2V2 ...
StandardD2V2 VMSizeTypes = "Standard_D2_v2"
// StandardD3 ...
StandardD3 VMSizeTypes = "Standard_D3"
// StandardD3V2 ...
StandardD3V2 VMSizeTypes = "Standard_D3_v2"
// StandardD4 ...
StandardD4 VMSizeTypes = "Standard_D4"
// StandardD4V2 ...
StandardD4V2 VMSizeTypes = "Standard_D4_v2"
// StandardD5V2 ...
StandardD5V2 VMSizeTypes = "Standard_D5_v2"
// StandardDS1 ...
StandardDS1 VMSizeTypes = "Standard_DS1"
// StandardDS11 ...
StandardDS11 VMSizeTypes = "Standard_DS11"
// StandardDS12 ...
StandardDS12 VMSizeTypes = "Standard_DS12"
// StandardDS13 ...
StandardDS13 VMSizeTypes = "Standard_DS13"
// StandardDS14 ...
StandardDS14 VMSizeTypes = "Standard_DS14"
// StandardDS2 ...
StandardDS2 VMSizeTypes = "Standard_DS2"
// StandardDS3 ...
StandardDS3 VMSizeTypes = "Standard_DS3"
// StandardDS4 ...
StandardDS4 VMSizeTypes = "Standard_DS4"
// StandardG1 ...
StandardG1 VMSizeTypes = "Standard_G1"
// StandardG2 ...
StandardG2 VMSizeTypes = "Standard_G2"
// StandardG3 ...
StandardG3 VMSizeTypes = "Standard_G3"
// StandardG4 ...
StandardG4 VMSizeTypes = "Standard_G4"
// StandardG5 ...
StandardG5 VMSizeTypes = "Standard_G5"
// StandardGS1 ...
StandardGS1 VMSizeTypes = "Standard_GS1"
// StandardGS2 ...
StandardGS2 VMSizeTypes = "Standard_GS2"
// StandardGS3 ...
StandardGS3 VMSizeTypes = "Standard_GS3"
// StandardGS4 ...
StandardGS4 VMSizeTypes = "Standard_GS4"
// StandardGS5 ...
StandardGS5 VMSizeTypes = "Standard_GS5"
)
// PossibleVMSizeTypesValues returns an array of possible values for the VMSizeTypes const type.
func PossibleVMSizeTypesValues() []VMSizeTypes {
return []VMSizeTypes{StandardA0, StandardA1, StandardA10, StandardA11, StandardA2, StandardA3, StandardA4, StandardA5, StandardA6, StandardA7, StandardA8, StandardA9, StandardD1, StandardD11, StandardD11V2, StandardD12, StandardD12V2, StandardD13, StandardD13V2, StandardD14, StandardD14V2, StandardD1V2, StandardD2, StandardD2V2, StandardD3, StandardD3V2, StandardD4, StandardD4V2, StandardD5V2, StandardDS1, StandardDS11, StandardDS12, StandardDS13, StandardDS14, StandardDS2, StandardDS3, StandardDS4, StandardG1, StandardG2, StandardG3, StandardG4, StandardG5, StandardGS1, StandardGS2, StandardGS3, StandardGS4, StandardGS5}
}
| Azure/azure-sdk-for-go | services/preview/containerservice/mgmt/2015-11-01-preview/containerservice/enums.go | GO | mit | 4,611 |
Cordova Game plugin
====================
# Overview #
Show leaderboard and achievements (google play game and game center, SDK)
[android, ios] [cordova cli] [xdk]
Requires google play developer account https://play.google.com/apps/publish/<br>
Requires apple developer account https://developer.apple.com/devcenter/ios/index.action
This is open source cordova plugin.
You can see Plugins For Cordova in one page: http://cranberrygame.github.io?referrer=github
```c
cf)
Leaderboard game: Best score game
Limited life
ex) 1, 3
Limited time
ex) 30 seconds
Time is score
Achievement
Score
ex) Achievement1 (Score 10)
Achievement2 (Score 30)
Achievement3 (Score 60)
Achievement4 (Score 100)
Achievement5 (Score 150)
Level
ex) Achievement1 (Level 1)
Achievement2 (Level 2)
Achievement3 (Level 4)
Achievement4 (Level 6)
Achievement5 (Level 8)
Achievement6 (Level 10)
Category
ex) Achievement1 (Number)
Achievement1 (Fruit)
Achievement1 (Color)
Achievement1 (Other)
Achievement1 (Challenge (Limited time))
```
# Change log #
```c
```
# Install plugin #
## Cordova cli ##
https://cordova.apache.org/docs/en/edge/guide_cli_index.md.html#The%20Command-Line%20Interface - npm install -g [email protected]
```c
//caution: replace 1064334934918 with your google play game app id
cordova plugin add cordova-plugin-game --variable APP_ID="1064334934918"
```
## Xdk ##
//caution: replace 1064334934918 with your google play game app id
<img src="https://raw.githubusercontent.com/cranberrygame/cordova-plugin-game/master/doc/xdk_APP_ID.png"><br>
https://github.com/cranberrygame/cordova-plugin-game/blob/master/doc/intelxdk.config.additions.xml
```c
```
## Cocoon ##
https://cocoon.io - Create project - [specific project] - Setting - Plugins - Custom - Git Url: https://github.com/cranberrygame/cordova-plugin-game.git - INSTALL - Save<br>
//caution: replace 1064334934918 with your google play game app id<br>
https://cocoon.io - Create project - [specific project] - Setting - Plugins - Installed - Git Url https://github.com/cranberrygame/cordova-plugin-game.git - ADD PARAMETER - Name: APP_ID Value: 1064334934918 - Save<br>
<img src="https://raw.githubusercontent.com/cranberrygame/cordova-plugin-game/master/doc/cocoon_APP_ID1.png"><br>
<img src="https://raw.githubusercontent.com/cranberrygame/cordova-plugin-game/master/doc/cocoon_APP_ID2.png">
## Phonegap build service (config.xml) ##
https://build.phonegap.com/ - Apps - [specific project] - Update code - Zip file including config.xml
```c
//caution: replace 1064334934918 with your google play game app id
<gap:plugin name="cordova-plugin-game" source="npm" >
<param name="APP_ID" value="1064334934918" />
</gap:plugin>
```
## Construct2 ##
Download construct2 plugin: http://www.paywithapost.de/pay?id=4ef3f2be-26e8-4a04-b826-6680db13a8c8
<br>
Now all the native plugins are installed automatically: https://plus.google.com/102658703990850475314/posts/XS5jjEApJYV
# Server setting #
## android (Google Play Game) ##
<img src="https://raw.githubusercontent.com/cranberrygame/cordova-plugin-game/master/doc/1_YOUR_GOOGLE_PLAY_GAME_APP_ID.png"><br>
<img src="https://raw.githubusercontent.com/cranberrygame/cordova-plugin-game/master/doc/2_YOUR_GOOGLE_PLAY_GAME_APP_ID.png"><br>
<img src="https://raw.githubusercontent.com/cranberrygame/cordova-plugin-game/master/doc/3.png"><br>
If you migrate android app from one build system to another build system (e.g from xdk to cocoon), link Android step ~ again.<br>
<img src="https://raw.githubusercontent.com/cranberrygame/cordova-plugin-game/master/doc/4.png"><br>
<img src="https://raw.githubusercontent.com/cranberrygame/cordova-plugin-game/master/doc/5.png"><br>
<img src="https://raw.githubusercontent.com/cranberrygame/cordova-plugin-game/master/doc/6_if_Signing_certificate_fingerprint_(SHA1)_is_blank.png"><br>
<img src="https://raw.githubusercontent.com/cranberrygame/cordova-plugin-game/master/doc/7.png"><br>
<img src="https://raw.githubusercontent.com/cranberrygame/cordova-plugin-game/master/doc/8.png"><br>
```c
//add game
google play developer console - Game services - Add a new game - Enter the name of your game: Test App, Category: Puzzle
//get YOUR_GOOGLE_PLAY_GAME_APP_ID
google play developer console - Game services - [specific app] - get YOUR_GOOGLE_PLAY_GAME_APP_ID (the number that appears beside the game name in the header of the Developer Console, e.g. "Test App - 12345678",. The YOUR_GOOGLE_PLAY_GAME_APP_ID in this case is 12345678.)
//link app
google play developer console - Game services - [specific app] - Linked App - Android - Save and continue - Authorize your app now - Continue - Create Client (if Signing certificate fingerprint (SHA1) is blank, do it after publishing app in alpha, beta, or normal (after publishing, it will be filled automatically))
//add leaderboard, get YOUR_GOOGLE_PLAY_GAME_LEADERBOARD_ID
google play developer console - Game services - [specific app] - leaderboard - Add leaderboard - Name: Leaderboard - get YOUR_GOOGLE_PLAY_GAME_LEADERBOARD_ID
//add achievements (must minimum 5 achievements), get YOUR_GOOGLE_PLAY_GAME_ACHIEVEMENT_ID1, YOUR_GOOGLE_PLAY_GAME_ACHIEVEMENT_ID2, YOUR_GOOGLE_PLAY_GAME_ACHIEVEMENT_ID3, YOUR_GOOGLE_PLAY_GAME_ACHIEVEMENT_ID4, YOUR_GOOGLE_PLAY_GAME_ACHIEVEMENT_ID5
google play developer console - Game services - [specific app] - achievement - Add achievement - Name: Achievement1 (Score 10), Description: Achievement1 (Score 10) - get YOUR_GOOGLE_PLAY_GAME_ACHIEVEMENT_ID1
google play developer console - Game services - [specific app] - achievement - Add achievement - Name: Achievement2 (Score 30), Description: Achievement2 (Score 30) - get YOUR_GOOGLE_PLAY_GAME_ACHIEVEMENT_ID2
google play developer console - Game services - [specific app] - achievement - Add achievement - Name: Achievement3 (Score 60), Description: Achievement3 (Score 60) - get YOUR_GOOGLE_PLAY_GAME_ACHIEVEMENT_ID3
google play developer console - Game services - [specific app] - achievement - Add achievement - Name: Achievement4 (Score 100), Description: Achievement4 (Score 100) - get YOUR_GOOGLE_PLAY_GAME_ACHIEVEMENT_ID4
google play developer console - Game services - [specific app] - achievement - Add achievement - Name: Achievement5 (Score 150), Description: Achievement5 (Score 150) - get YOUR_GOOGLE_PLAY_GAME_ACHIEVEMENT_ID5
//publish game
google play developer console - Game services - [specific app] - prepare test - publish game
```
## ios (Game Center) ##
```c
itunesconnect - 나의 App - [specific app] - Game Center - Enable for Single Game
//leaderboard
itunesconnect - 나의 App - [specific app] - Game Center - Add Leaderboard -
단일 순위표 -
순위표 세트 식별 정보: testapp_leaderboard -
순위표 ID: testapp_leaderboard -
점수 형식 유형: Integer -
점수 제출 유형: 가장 높은 점수
정렬 순서: 높은 점수순 -
Add Language -
언어: English -
이름: Leaderboard -
점수 형식: Integer (100,000,122) -
Save
//achievement1
itunesconnect - 나의 App - [specific app] - Game Center - 목표 달성 추가 -
목표 달성 식별 정보: testapp_achievement1
목표 달성 ID: testapp_achievement1
점수 값: 20 (max 100)
숨김: No
여러 번 달성 가능: No
언어 추가 -
언어: English
제목: Achievement1 (Score 10)
사전 획득한 목표 달성 설명: Achievement1 (Score 10)
획득한 목표 달성 설명: Achievement1 (Score 10)
이미지: 512x512 png
//achievement2
itunesconnect - 나의 App - [specific app] - Game Center - 목표 달성 추가 -
목표 달성 식별 정보: testapp_achievement2
목표 달성 ID: testapp_achievement2
점수 값: 40 (max 100)
숨김: No
여러 번 달성 가능: No
언어 추가 -
언어: English
제목: Achievement2 (Score 30)
사전 획득한 목표 달성 설명: Achievement2 (Score 30)
획득한 목표 달성 설명: Achievement2 (Score 30)
이미지: 512x512 png
//achievement3
itunesconnect - 나의 App - [specific app] - Game Center - 목표 달성 추가 -
목표 달성 식별 정보: testapp_achievement3
목표 달성 ID: testapp_achievement3
점수 값: 60 (max 100)
숨김: No
여러 번 달성 가능: No
언어 추가 -
언어: English
제목: Achievement3 (Score 60)
사전 획득한 목표 달성 설명: Achievement3 (Score 60)
획득한 목표 달성 설명: Achievement3 (Score 60)
이미지: 512x512 png
//achievement4
itunesconnect - 나의 App - [specific app] - Game Center - 목표 달성 추가 -
목표 달성 식별 정보: testapp_achievement4
목표 달성 ID: testapp_achievement4
점수 값: 80 (max 100)
숨김: No
여러 번 달성 가능: No
언어 추가 -
언어: English
제목: Achievement4 (Score 100)
사전 획득한 목표 달성 설명: Achievement4 (Score 100)
획득한 목표 달성 설명: Achievement4 (Score 100)
이미지: 512x512 png
//achievement5
itunesconnect - 나의 App - [specific app] - Game Center - 목표 달성 추가 -
목표 달성 식별 정보: testapp_achievement5
목표 달성 ID: testapp_achievement5
점수 값: 100 (leave blank, max 100)
숨김: No
여러 번 달성 가능: No
언어 추가 -
언어: English
제목: Achievement5 (Score 150)
사전 획득한 목표 달성 설명: Achievement5 (Score 150)
획득한 목표 달성 설명: Achievement5 (Score 150)
이미지: 512x512 png
can test before publish
```
# API #
```javascript
//
var leaderboardId = "REPLACE_THIS_WITH_YOUR_LEADERBOARD_ID";
var achievementId1 = "REPLACE_THIS_WITH_YOUR_ACHIEVEMENT_ID1";
var achievementId2 = "REPLACE_THIS_WITH_YOUR_ACHIEVEMENT_ID2";
var achievementId3 = "REPLACE_THIS_WITH_YOUR_ACHIEVEMENT_ID3";
var achievementId4 = "REPLACE_THIS_WITH_YOUR_ACHIEVEMENT_ID4";
//
document.addEventListener("deviceready", function(){
window.game.setUp();
//callback
window.game.onLoginSucceeded = function(result) {
var playerDetail = result;
alert('onLoginSucceeded: ' + playerDetail['playerId'] + ' ' + playerDetail['playerDisplayName']);
};
window.game.onLoginFailed = function() {
alert('onLoginFailed');
};
window.game.onGetPlayerImageSucceeded = function(result) {
var playerImageUrl = result;
alert('onGetPlayerImageSucceeded: ' + playerImageUrl);
};
window.game.onGetPlayerImageFailed = function() {
alert('onGetPlayerImageFailed');
};
window.game.onGetPlayerScoreSucceeded = function(result) {
var playerScore = result;
alert('onGetPlayerScoreSucceeded: ' + playerScore);
};
window.game.onGetPlayerScoreFailed = function() {
alert('onGetPlayerScoreFailed');
};
//
window.game.onSubmitScoreSucceeded = function() {
alert('onSubmitScoreSucceeded');
};
window.game.onSubmitScoreFailed = function() {
alert('onSubmitScoreFailed');
};
//
window.game.onUnlockAchievementSucceeded = function() {
alert('onUnlockAchievementSucceeded');
};
window.game.onUnlockAchievementFailed = function() {
alert('onUnlockAchievementFailed');
};
window.game.onIncrementAchievementSucceeded = function() {
alert('onIncrementAchievementSucceeded');
};
window.game.onIncrementAchievementFailed = function() {
alert('onIncrementAchievementFailed');
};
window.game.onResetAchievementsSucceeded = function() {
alert('onResetAchievementsSucceeded');
};
window.game.onResetAchievementsFailed = function() {
alert('onResetAchievementsFailed');
};
}, false);
//
window.game.login();
window.game.logout();
alert(window.game.isLoggedIn());
window.game.getPlayerImage();
window.game.getPlayerScore(leaderboardId);
//
window.game.submitScore(leaderboardId, 5);//leaderboardId, score
window.game.showLeaderboard(leaderboardId);
//
window.game.unlockAchievement(achievementId1);
window.game.unlockAchievement(achievementId2);
window.game.unlockAchievement(achievementId3);
window.game.unlockAchievement(achievementId4);
window.game.incrementAchievement(achievementId1, 2); //achievementId, incrementalStepOrCurrentPercent: Incremental step (android) or current percent (ios) for incremental achievement.
window.game.incrementAchievement(achievementId2, 2);
window.game.incrementAchievement(achievementId3, 2);
window.game.incrementAchievement(achievementId4, 2);
window.game.showAchievements();
window.game.resetAchievements();//only supported on ios
```
# Examples #
<a href="https://github.com/cranberrygame/com.cranberrygame.phonegap.plugin.game/blob/master/example/basic/index.html">example/index.html</a>
# Test #
## android (Google Play Game) ##
```c
//publish as alpha test (recommend) or beta test instead of production.
google play developer console - [specific app] - APK - Alpha test - Upload as alpha test - Drag and drop apk and publish now as alpha test.
//add test user for game
google play developer console - Game services - [specific game] - test - add tester (google play account)
//add test community for alpha test or beta test download
google play developer console -
All applications -
[specific app] -
APK -
Alpha testers -
Manage list of testers -
Add Google groups or Google+ community: https://plus.google.com/communities/xxx (if you want make Google+ Community, go to this: https://plus.google.com/communities) -
Add -
Let test user download and install apk from this url: https://play.google.com/apps/testing/YOUR_PACKAGE (invite test user in your Google+ community, wait until this url is available, take hours)
```
## ios (Game Center) ##
<img src="https://raw.githubusercontent.com/cranberrygame/cordova-plugin-game/master/doc/iossandbox1.png"><br>
<img src="https://raw.githubusercontent.com/cranberrygame/cordova-plugin-game/master/doc/iossandbox2.png"><br>
<img src="https://raw.githubusercontent.com/cranberrygame/cordova-plugin-game/master/doc/iossandbox3.png">
```c
//itunes connect sand box (Caution!)
itunes connect - User and role - Sand box test - add tester (not real email but faked email)
//iphone sand box (Caution!)
iphone - Setting - Game Center - activate sand box mode - login with itunes connect sand box account in the app
```
# Useful links #
Plugins For Cordova<br>
http://cranberrygame.github.io?referrer=github
# Credits #
| sinmsinm/cordova-plugin-game | README.md | Markdown | mit | 14,240 |
using Microsoft.Extensions.DependencyModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
namespace DIAttributeRegistrar.AssemblyDiscovery
{
internal class DefaultAssemblyDiscoveryProvider : IAssemblyDiscoveryProvider
{
private static HashSet<string> ReferenceAssemblies { get; } = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
{
"DIAttributeRegistrar"
};
public IEnumerable<Assembly> GetCandidateAssemblies()
{
Assembly entryAssembly = Assembly.GetEntryAssembly();
DependencyContext context = DependencyContext.Load(entryAssembly);
CandidateResolver candidateResolver = new CandidateResolver(context.RuntimeLibraries, ReferenceAssemblies);
return candidateResolver
.GetCandidates()
.SelectMany(library => library.GetDefaultAssemblyNames(context))
.Select(Assembly.Load);
}
}
}
| IhnatKlimchuk/DIAttributeRegistrar | src/DIAttributeRegistrar/AssemblyDiscovery/DefaultAssemblyDiscoveryProvider.cs | C# | mit | 1,007 |
/*
The MIT License (MIT)
Copyright (c) 2015 Los Andes University
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 co.edu.uniandes.csw.book.dtos.minimum;
import co.edu.uniandes.csw.book.entities.EditorialEntity;
import javax.xml.bind.annotation.XmlRootElement;
import java.io.Serializable;
/**
* @generated
*/
@XmlRootElement
public class EditorialDTO implements Serializable{
private Long id;
private String name;
/**
* @generated
*/
public EditorialDTO() {
}
/**
* Crea un objeto EditorialDTO a partir de un objeto EditorialEntity.
*
* @param entity Entidad EditorialEntity desde la cual se va a crear el nuevo objeto.
* @generated
*/
public EditorialDTO(EditorialEntity entity) {
if (entity!=null){
this.id=entity.getId();
this.name=entity.getName();
}
}
/**
* Convierte un objeto EditorialDTO a EditorialEntity.
*
* @return Nueva objeto EditorialEntity.
* @generated
*/
public EditorialEntity toEntity() {
EditorialEntity entity = new EditorialEntity();
entity.setId(this.getId());
entity.setName(this.getName());
return entity;
}
/**
* Obtiene el atributo id.
*
* @return atributo id.
* @generated
*/
public Long getId() {
return id;
}
/**
* Establece el valor del atributo id.
*
* @param id nuevo valor del atributo
* @generated
*/
public void setId(Long id) {
this.id = id;
}
/**
* Obtiene el atributo name.
*
* @return atributo name.
* @generated
*/
public String getName() {
return name;
}
/**
* Establece el valor del atributo name.
*
* @param name nuevo valor del atributo
* @generated
*/
public void setName(String name) {
this.name = name;
}
}
| diegofruizs/book | book-api/src/main/java/co/edu/uniandes/csw/book/dtos/minimum/EditorialDTO.java | Java | mit | 2,898 |
#include "SDL_gpu_OpenGL_3.h"
#include "SDL_gpu_RendererImpl.h"
#if defined(SDL_GPU_DISABLE_OPENGL) || defined(SDL_GPU_DISABLE_OPENGL_3)
// Dummy implementations
GPU_Renderer* GPU_CreateRenderer_OpenGL_3(GPU_RendererID request) {return NULL;}
void GPU_FreeRenderer_OpenGL_3(GPU_Renderer* renderer) {}
#else
// Most of the code pulled in from here...
#define SDL_GPU_USE_OPENGL
#define SDL_GPU_USE_BUFFER_PIPELINE
#define SDL_GPU_ASSUME_CORE_FBO
#define SDL_GPU_ASSUME_SHADERS
#define SDL_GPU_SKIP_ENABLE_TEXTURE_2D
#define SDL_GPU_SKIP_LINE_WIDTH
#define SDL_GPU_GLSL_VERSION 130
#define SDL_GPU_GLSL_VERSION_CORE 150
#define SDL_GPU_GL_MAJOR_VERSION 3
#define SDL_GPU_ENABLE_CORE_SHADERS
#include "renderer_GL_common.inl"
#include "renderer_shapes_GL_common.inl"
GPU_Renderer* GPU_CreateRenderer_OpenGL_3(GPU_RendererID request)
{
GPU_Renderer* renderer = (GPU_Renderer*)SDL_malloc(sizeof(GPU_Renderer));
if(renderer == NULL)
return NULL;
memset(renderer, 0, sizeof(GPU_Renderer));
renderer->id = request;
renderer->id.renderer = GPU_RENDERER_OPENGL_3;
renderer->shader_language = GPU_LANGUAGE_GLSL;
renderer->min_shader_version = 110;
renderer->max_shader_version = SDL_GPU_GLSL_VERSION;
renderer->default_image_anchor_x = 0.5f;
renderer->default_image_anchor_y = 0.5f;
renderer->current_context_target = NULL;
renderer->impl = (GPU_RendererImpl*)SDL_malloc(sizeof(GPU_RendererImpl));
memset(renderer->impl, 0, sizeof(GPU_RendererImpl));
SET_COMMON_FUNCTIONS(renderer->impl);
return renderer;
}
void GPU_FreeRenderer_OpenGL_3(GPU_Renderer* renderer)
{
if(renderer == NULL)
return;
SDL_free(renderer->impl);
SDL_free(renderer);
}
#endif
| grimfang4/sdl-gpu | src/renderer_OpenGL_3.c | C | mit | 1,757 |
<?php
declare(strict_types=1);
/**
* Geometry Accessors
* http://postgis.net/docs/reference.html#Geometry_Accessors.
*/
return [
'GeometryType' => [
'required_arguments' => 1,
'total_arguments' => 1,
'tests' => [
'queries' => [
[
'sql' => "SELECT {function}(ST_GeomFromText('LINESTRING(77.29 29.07,77.42 29.26,77.27 29.31,77.29 29.07)')) AS value",
'result' => [
'value' => 'LINESTRING',
],
],
],
],
],
'ST_Boundary' => [
'required_arguments' => 1,
'total_arguments' => 1,
'tests' => [
'queries' => [
[
'sql' => "SELECT ST_AsText({function}(ST_GeomFromText('LINESTRING(1 1,0 0, -1 1)'))) AS value",
'result' => [
'value' => 'MULTIPOINT(1 1,-1 1)',
],
],
],
],
],
'ST_CoordDim' => [
'required_arguments' => 1,
'total_arguments' => 1,
'return_type' => 'numeric',
'tests' => [
'queries' => [
[
'sql' => "SELECT {function}(ST_GeomFromText('LINESTRING(1 1,0 0, -1 1)')) AS value",
'result' => [
'value' => 2,
],
],
],
],
],
'ST_Dimension' => [
'required_arguments' => 1,
'total_arguments' => 1,
'return_type' => 'numeric',
'tests' => [
'queries' => [
[
'sql' => "SELECT {function}('GEOMETRYCOLLECTION(LINESTRING(1 1,0 0),POINT(0 0))') AS value",
'result' => [
'value' => 1,
],
],
],
],
],
'ST_EndPoint' => [
'required_arguments' => 1,
'total_arguments' => 1,
'tests' => [
'queries' => [
[
'sql' => "SELECT ST_AsText({function}(ST_GeomFromText('LINESTRING(1 1, 2 2, 3 3)'))) AS value",
'result' => [
'value' => 'POINT(3 3)',
],
],
[
'sql' => "SELECT ST_AsText({function}(ST_GeomFromText('POINT(1 1)'))) AS value",
'result' => [
'value' => null,
],
],
],
],
],
'ST_Envelope' => [
'required_arguments' => 1,
'total_arguments' => 1,
'tests' => [
'queries' => [
[
'sql' => "SELECT ST_AsText({function}(ST_GeomFromText('LINESTRING(0 0, 1 3)'))) AS value",
'result' => [
'value' => 'POLYGON((0 0,0 3,1 3,1 0,0 0))',
],
],
],
],
],
'ST_ExteriorRing' => [
'required_arguments' => 1,
'total_arguments' => 1,
'tests' => [
'queries' => [
[
'sql' => "SELECT ST_AsEWKT({function}(ST_GeomFromText('POLYGON((0 0 1, 1 1 1, 1 2 1, 1 1 1, 0 0 1))'))) AS value",
'result' => [
'value' => 'LINESTRING(0 0 1,1 1 1,1 2 1,1 1 1,0 0 1)',
],
],
],
],
],
'ST_GeometryN' => [
'required_arguments' => 2,
'total_arguments' => 2,
'tests' => [
'queries' => [
[
'sql' => "SELECT ST_AsEWKT({function}(ST_GeomFromText('MULTILINESTRING((0 0 1, 1 1 1, 1 2 1, 1 1 1, 0 0 1))'), 1)) AS value",
'result' => [
'value' => 'LINESTRING(0 0 1,1 1 1,1 2 1,1 1 1,0 0 1)',
],
],
],
],
],
'ST_GeometryType' => [
'required_arguments' => 1,
'total_arguments' => 1,
'tests' => [
'queries' => [
[
'sql' => "SELECT {function}(ST_GeomFromText('LINESTRING(77.29 29.07,77.42 29.26,77.27 29.31,77.29 29.07)')) AS value",
'result' => [
'value' => 'ST_LineString',
],
],
],
],
],
'ST_InteriorRingN' => [
'required_arguments' => 2,
'total_arguments' => 2,
'tests' => [
'queries' => [
[
'sql' => "SELECT ST_AsEWKT({function}(ST_GeomFromText('POLYGON((0 0, 1 1, 1 2, 1 1, 0 0),(77.29 29.07,77.42 29.26,77.27 29.31,77.29 29.07))'), 1)) AS value",
'result' => [
'value' => 'LINESTRING(77.29 29.07,77.42 29.26,77.27 29.31,77.29 29.07)',
],
],
// Out of range
[
'sql' => "SELECT ST_AsEWKT({function}(ST_GeomFromText('POLYGON((0 0, 1 1, 1 2, 1 1, 0 0),(77.29 29.07,77.42 29.26,77.27 29.31,77.29 29.07))'), 3)) AS value",
'result' => [
'value' => null,
],
],
],
],
],
'ST_IsClosed' => [
'required_arguments' => 1,
'total_arguments' => 1,
'tests' => [
'queries' => [
[
'sql' => "SELECT {function}(ST_GeomFromText('LINESTRING(0 0, 1 1)')) AS value",
'result' => [
'value' => false,
],
],
[
'sql' => "SELECT {function}(ST_GeomFromText('LINESTRING(0 0, 0 1, 1 1, 0 0)')) AS value",
'result' => [
'value' => true,
],
],
],
],
],
'ST_IsCollection' => [
'required_arguments' => 1,
'total_arguments' => 1,
'tests' => [
'queries' => [
[
'sql' => "SELECT {function}(ST_GeomFromText('LINESTRING(0 0, 1 1)')) AS value",
'result' => [
'value' => false,
],
],
[
'sql' => "SELECT {function}(ST_GeomFromText('MULTIPOINT((0 0))')) AS value",
'result' => [
'value' => true,
],
],
],
],
],
'ST_IsEmpty' => [
'required_arguments' => 1,
'total_arguments' => 1,
'tests' => [
'queries' => [
[
'sql' => "SELECT {function}(ST_GeomFromText('GEOMETRYCOLLECTION EMPTY')) AS value",
'result' => [
'value' => true,
],
],
[
'sql' => "SELECT {function}(ST_GeomFromText('POLYGON((1 2, 3 4, 5 6, 1 2))')) AS value",
'result' => [
'value' => false,
],
],
],
],
],
'ST_IsRing' => [
'required_arguments' => 1,
'total_arguments' => 1,
'tests' => [
'queries' => [
[
'sql' => "SELECT {function}(ST_GeomFromText('LINESTRING(0 0, 1 1)')) AS value",
'result' => [
'value' => false,
],
],
[
'sql' => "SELECT {function}(ST_GeomFromText('LINESTRING(0 0, 0 1, 1 1, 1 0, 0 0)')) AS value",
'result' => [
'value' => true,
],
],
],
],
],
'ST_IsSimple' => [
'required_arguments' => 1,
'total_arguments' => 1,
'tests' => [
'queries' => [
[
'sql' => "SELECT {function}(ST_GeomFromText('LINESTRING(1 1,2 2,2 3.5,1 3,1 2,2 1)')) AS value",
'result' => [
'value' => false,
],
],
[
'sql' => "SELECT {function}(ST_GeomFromText('Point(1 2)')) AS value",
'result' => [
'value' => true,
],
],
],
],
],
'ST_IsValid' => [
'required_arguments' => 1,
'total_arguments' => 2,
'tests' => [
'queries' => [
[
'sql' => "SELECT {function}(ST_GeomFromText('POLYGON((0 0, 1 1, 1 2, 1 1, 0 0))')) AS value",
'result' => [
'value' => false,
],
],
[
'sql' => "SELECT {function}(ST_GeomFromText('LINESTRING(0 0, 1 1)')) AS value",
'result' => [
'value' => true,
],
],
[
'sql' => "SELECT {function}(ST_GeomFromText('LINESTRING(0 0, 1 1)'), 1) AS value",
'result' => [
'value' => true,
],
],
],
],
],
'ST_IsValidReason' => [
'required_arguments' => 1,
'total_arguments' => 2,
'tests' => [
'queries' => [
[
'sql' => "SELECT {function}(ST_GeomFromText('LINESTRING(220227 150406,2220227 150407,222020 150410)')) AS value",
'result' => [
'value' => 'Valid Geometry',
],
],
[
'sql' => "SELECT {function}(ST_GeomFromText('LINESTRING(220227 150406,2220227 150407,222020 150410)'), 1) AS value",
'result' => [
'value' => 'Valid Geometry',
],
],
],
],
],
'ST_IsValidDetail' => [
'required_arguments' => 1,
'total_arguments' => 2,
'tests' => [
'queries' => [
[
'sql' => "SELECT {function}(ST_GeomFromText('LINESTRING(1 1, 1 1)')) AS value",
'result' => [
'value' => '(f,"Too few points in geometry component",0101000000000000000000F03F000000000000F03F)',
],
],
[
'sql' => "SELECT {function}(ST_GeomFromText('LINESTRING(220227 150406,2220227 150407,222020 150410)'), 1) AS value",
'result' => [
'value' => '(t,,)',
],
],
],
],
],
'ST_M' => [
'required_arguments' => 1,
'total_arguments' => 1,
'return_type' => 'numeric',
'tests' => [
'queries' => [
[
'sql' => "SELECT {function}(ST_GeomFromEWKT('POINT(1 2 3 4)')) AS value",
'result' => [
'value' => 4,
],
],
],
],
],
'ST_NDims' => [
'required_arguments' => 1,
'total_arguments' => 1,
'return_type' => 'numeric',
'tests' => [
'queries' => [
[
'sql' => "SELECT {function}(ST_GeomFromText('POINT(1 1)')) AS value",
'result' => [
'value' => 2,
],
],
[
'sql' => "SELECT {function}(ST_GeomFromEWKT('POINTM(1 1 0.5)')) AS value",
'result' => [
'value' => 3,
],
],
],
],
],
'ST_NPoints' => [
'required_arguments' => 1,
'total_arguments' => 1,
'return_type' => 'numeric',
'tests' => [
'queries' => [
[
'sql' => "SELECT {function}(ST_GeomFromText('LINESTRING(77.29 29.07,77.42 29.26,77.27 29.31,77.29 29.07)')) AS value",
'result' => [
'value' => 4,
],
],
[
'sql' => "SELECT {function}(ST_GeomFromEWKT('LINESTRING(77.29 29.07 1,77.42 29.26 0,77.27 29.31 -1,77.29 29.07 3)')) AS value",
'result' => [
'value' => 4,
],
],
],
],
],
'ST_NRings' => [
'required_arguments' => 1,
'total_arguments' => 1,
'return_type' => 'numeric',
'tests' => [
'queries' => [
[
'sql' => "SELECT {function}(ST_GeomFromText('POLYGON((1 2, 3 4, 5 6, 1 2))')) AS value",
'result' => [
'value' => 1,
],
],
],
],
],
'ST_NumGeometries' => [
'required_arguments' => 1,
'total_arguments' => 1,
'return_type' => 'numeric',
'tests' => [
'queries' => [
[
'sql' => "SELECT {function}(ST_GeomFromText('LINESTRING(77.29 29.07,77.42 29.26,77.27 29.31,77.29 29.07)')) AS value",
'result' => [
'value' => 1,
],
],
[
'sql' => "SELECT {function}(ST_GeomFromText('GEOMETRYCOLLECTION(MULTIPOINT(-2 3 , -2 2),LINESTRING(5 5 ,10 10),POLYGON((-7 4.2,-7.1 5,-7.1 4.3,-7 4.2)))')) AS value",
'result' => [
'value' => 3,
],
],
],
],
],
'ST_NumInteriorRings' => [
'required_arguments' => 1,
'total_arguments' => 1,
'return_type' => 'numeric',
'tests' => [
'queries' => [
[
'sql' => "SELECT {function}(ST_GeomFromText('POLYGON((-7 4.2,-7.1 5,-7.1 4.3,-7 4.2),(77.29 29.07,77.42 29.26,77.27 29.31,77.29 29.07))')) AS value",
'result' => [
'value' => 1,
],
],
],
],
],
'ST_NumInteriorRing' => [
'alias_for' => 'ST_NumInteriorRings',
],
'ST_NumPatches' => [
'required_arguments' => 1,
'total_arguments' => 1,
'return_type' => 'numeric',
'tests' => [
'queries' => [
[
'sql' => "SELECT {function}(ST_GeomFromText('POLYHEDRALSURFACE( ((0 0 0, 0 0 1, 0 1 1, 0 1 0, 0 0 0)), ((0 0 0, 0 1 0, 1 1 0, 1 0 0, 0 0 0)), ((0 0 0, 1 0 0, 1 0 1, 0 0 1, 0 0 0)), ((1 1 0, 1 1 1, 1 0 1, 1 0 0, 1 1 0)), ((0 1 0, 0 1 1, 1 1 1, 1 1 0, 0 1 0)), ((0 0 1, 1 0 1, 1 1 1, 0 1 1, 0 0 1)) )')) AS value",
'result' => [
'value' => 6,
],
],
],
],
],
'ST_NumPoints' => [
'required_arguments' => 1,
'total_arguments' => 1,
'return_type' => 'numeric',
'tests' => [
'queries' => [
[
'sql' => "SELECT {function}(ST_GeomFromText('LINESTRING(77.29 29.07,77.42 29.26,77.27 29.31,77.29 29.07)')) AS value",
'result' => [
'value' => 4,
],
],
],
],
],
'ST_PatchN' => [
'required_arguments' => 2,
'total_arguments' => 2,
'tests' => [
'queries' => [
[
'sql' => "SELECT ST_AsEWKT({function}(ST_GeomFromText('POLYHEDRALSURFACE( ((0 0 0, 0 0 1, 0 1 1, 0 1 0, 0 0 0)), ((0 0 0, 0 1 0, 1 1 0, 1 0 0, 0 0 0)), ((0 0 0, 1 0 0, 1 0 1, 0 0 1, 0 0 0)), ((1 1 0, 1 1 1, 1 0 1, 1 0 0, 1 1 0)), ((0 1 0, 0 1 1, 1 1 1, 1 1 0, 0 1 0)), ((0 0 1, 1 0 1, 1 1 1, 0 1 1, 0 0 1)) )'), 2)) AS value",
'result' => [
'value' => 'POLYGON((0 0 0,0 1 0,1 1 0,1 0 0,0 0 0))',
],
],
],
],
],
'ST_PointN' => [
'required_arguments' => 2,
'total_arguments' => 2,
'tests' => [
'queries' => [
[
'sql' => "SELECT ST_AsEWKT({function}(ST_GeomFromText('LINESTRING(0 0, 1 1, 2 2)'), 2)) AS value",
'result' => [
'value' => 'POINT(1 1)',
],
],
],
],
],
'ST_SRID' => [
'required_arguments' => 1,
'total_arguments' => 1,
'return_type' => 'numeric',
'tests' => [
'queries' => [
[
'sql' => "SELECT {function}(ST_GeomFromText('POINT(-71.1043 42.315)',4326)) AS value",
'result' => [
'value' => 4326,
],
],
],
],
],
'ST_StartPoint' => [
'required_arguments' => 1,
'total_arguments' => 1,
'tests' => [
'queries' => [
[
'sql' => "SELECT ST_AsText({function}(ST_GeomFromText('LINESTRING(0 1, 0 2)'))) AS value",
'result' => [
'value' => 'POINT(0 1)',
],
],
],
],
],
'ST_Summary' => [
'required_arguments' => 1,
'total_arguments' => 1,
'tests' => [
'queries' => [
[
'sql' => "SELECT {function}(ST_GeomFromText('POLYGON((0 0, 1 1, 1 2, 1 1, 0 0))')) AS value",
'result' => [
'value' => 'Polygon[B] with 1 ring:
ring 0 has 5 points',
],
],
],
],
],
'ST_X' => [
'required_arguments' => 1,
'total_arguments' => 1,
'return_type' => 'numeric',
'tests' => [
'queries' => [
[
'sql' => "SELECT {function}(ST_GeomFromEWKT('POINT(1.5 2 3 4)')) AS value",
'result' => [
'value' => 1.5,
],
],
],
],
],
'ST_XMax' => [
'required_arguments' => 1,
'total_arguments' => 1,
'return_type' => 'numeric',
'tests' => [
'queries' => [
[
'sql' => "SELECT {function}('BOX3D(1 2 3, 4 5 6)') AS value",
'result' => [
'value' => 4,
],
],
],
],
],
'ST_XMin' => [
'required_arguments' => 1,
'total_arguments' => 1,
'return_type' => 'numeric',
'tests' => [
'queries' => [
[
'sql' => "SELECT {function}('BOX3D(1 2 3, 4 5 6)') AS value",
'result' => [
'value' => 1,
],
],
],
],
],
'ST_Y' => [
'required_arguments' => 1,
'total_arguments' => 1,
'return_type' => 'numeric',
'tests' => [
'queries' => [
[
'sql' => "SELECT {function}(ST_GeomFromEWKT('POINT(1.5 2 3 4)')) AS value",
'result' => [
'value' => 2,
],
],
],
],
],
'ST_YMax' => [
'required_arguments' => 1,
'total_arguments' => 1,
'return_type' => 'numeric',
'tests' => [
'queries' => [
[
'sql' => "SELECT {function}('BOX3D(1 2 3, 4 5 6)') AS value",
'result' => [
'value' => 5,
],
],
],
],
],
'ST_YMin' => [
'required_arguments' => 1,
'total_arguments' => 1,
'return_type' => 'numeric',
'tests' => [
'queries' => [
[
'sql' => "SELECT {function}('BOX3D(1 2 3, 4 5 6)') AS value",
'result' => [
'value' => 2,
],
],
],
],
],
'ST_Z' => [
'required_arguments' => 1,
'total_arguments' => 1,
'return_type' => 'numeric',
'tests' => [
'queries' => [
[
'sql' => "SELECT {function}(ST_GeomFromEWKT('POINT(1.5 2 3 4)')) AS value",
'result' => [
'value' => 3,
],
],
],
],
],
'ST_ZMax' => [
'required_arguments' => 1,
'total_arguments' => 1,
'return_type' => 'numeric',
'tests' => [
'queries' => [
[
'sql' => "SELECT {function}('BOX3D(1 2 3, 4 5 6)') AS value",
'result' => [
'value' => 6,
],
],
],
],
],
'ST_Zmflag' => [
'required_arguments' => 1,
'total_arguments' => 1,
'return_type' => 'numeric',
'tests' => [
'queries' => [
[
'sql' => "SELECT {function}(ST_GeomFromEWKT('LINESTRING(1 2, 3 4)')) AS value",
'result' => [
'value' => 0,
],
],
[
'sql' => "SELECT {function}(ST_GeomFromEWKT('POINT(1 2 3 4)')) AS value",
'result' => [
'value' => 3,
],
],
],
],
],
'ST_ZMin' => [
'required_arguments' => 1,
'total_arguments' => 1,
'return_type' => 'numeric',
'tests' => [
'queries' => [
[
'sql' => "SELECT {function}('BOX3D(1 2 3, 4 5 6)') AS value",
'result' => [
'value' => 3,
],
],
],
],
],
];
| jsor/doctrine-postgis | tools/functions/geometry-accessors.php | PHP | mit | 22,764 |
<form block="mde-video-edit" action="/master-data-edit/json2.json" method="GET">
<div elem="download">
<label elem="one-row">
<span elem="title">Ссылка на видео</span>
<b><input elem="title-input" type="text" name="/master-data-edit/json2.json" id="newVideoUpload"></b>
</label>
{{> master-data-edit/edit-btn/edit-btn edit-btn save-btn-text="Загрузить"}}
</div>
<div elem="wrapper">
<label elem="one-row">
<span elem="title">Название видео</span>
<b><input elem="title-input" type="text" name="name1"></b>
</label>
<div elem="column-1">
<div elem="img-cont" id="{{popup-id2}}-save">
<i elem="bg-ico"></i>
{{#if is-img-exist}}
<img elem="img" src="{{img.src}}" alt="{{img.alt}}">
{{/if}}
</div>
</div>
<div elem="column-2">
<label><span elem="title">Описание</span>
<textarea name="name2"></textarea>
</label>
<label elem="one-row" mod="tags">
<span elem="title">Теги</span>
<b><input elem="href-input" type="text" name="name3"></b>
</label>
</div>
<br elem="clear">
<div elem="btn-cont">
{{> master-data-edit/edit-btn/edit-btn edit-btn save-btn-text="Сохранить"}}
</div>
</div>
</form> | dumperize/fm-lk | markup/modules/master-data-edit/video/video-edit.html | HTML | mit | 1,506 |
/*
* 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.
*/
package chromastarserver;
/**
*
*
*
*
*
*/
public class HjertingComponents{
public static double[][] hjertingComponents() {
//Hjerting function components (expansion coefficients in Voigt fn "a" parameter):
// Observation and Analysis of Stellar Photospehres -, 3rd. Ed., Tab 11.5, p. 256
// David F. Gray
//Note: "u" is the Voigt fn "v" parameter
int numV = 81;
//Row 0 containt abscissae (Voigt fn "v" parameter)
double[][] hjertComp = new double[6][numV];
//u H_0(u) H_1(u) H_2(u) H_3(u) H_4(u)
hjertComp[0][0] = 0.0; hjertComp[1][0] = 1.000000 ; hjertComp[2][0] = -1.12838 ; hjertComp[3][0] = 1.0000 ; hjertComp[4][0] = -0.752 ; hjertComp[5][0] = 0.50;
hjertComp[0][1] = 0.1; hjertComp[1][1] = 0.990050 ; hjertComp[2][1] = -1.10596 ; hjertComp[3][1] = 0.9702 ; hjertComp[4][1] = -0.722 ; hjertComp[5][1] = 0.48;
hjertComp[0][2] = 0.2; hjertComp[1][2] = 0.960789 ; hjertComp[2][2] = -1.04048 ; hjertComp[3][2] = 0.8839 ; hjertComp[4][2] = -0.637 ; hjertComp[5][2] = 0.40;
hjertComp[0][3] = 0.3; hjertComp[1][3] = 0.913931 ; hjertComp[2][3] = -0.93703 ; hjertComp[3][3] = 0.7494 ; hjertComp[4][3] = -0.505 ; hjertComp[5][3] = 0.30;
hjertComp[0][4] = 0.4; hjertComp[1][4] = 0.852144 ; hjertComp[2][4] = -0.80346 ; hjertComp[3][4] = 0.5795 ; hjertComp[4][4] = -0.342 ; hjertComp[5][4] = 0.17;
hjertComp[0][5] = 0.5; hjertComp[1][5] = 0.778801 ; hjertComp[2][5] = -0.64945 ; hjertComp[3][5] = 0.3894 ; hjertComp[4][5] = -0.165 ; hjertComp[5][5] = 0.03;
hjertComp[0][6] = 0.6; hjertComp[1][6] = 0.697676 ; hjertComp[2][6] = -0.48582 ; hjertComp[3][6] = 0.1953 ; hjertComp[4][6] = 0.007 ; hjertComp[5][6] = -0.09;
hjertComp[0][7] = 0.7; hjertComp[1][7] = 0.612626 ; hjertComp[2][7] = -0.32192 ; hjertComp[3][7] = 0.0123 ; hjertComp[4][7] = 0.159 ; hjertComp[5][7] = -0.20;
hjertComp[0][8] = 0.8; hjertComp[1][8] = 0.527292 ; hjertComp[2][8] = -0.16772 ; hjertComp[3][8] = -0.1476 ; hjertComp[4][8] = 0.280 ; hjertComp[5][8] = -0.27;
hjertComp[0][9] = 0.9; hjertComp[1][9] = 0.444858 ; hjertComp[2][9] = -0.03012 ; hjertComp[3][9] = -0.2758 ; hjertComp[4][9] = 0.362 ; hjertComp[5][9] = -0.30;
hjertComp[0][10] = 1.0; hjertComp[1][10] = 0.367879 ; hjertComp[2][10] = 0.08594 ; hjertComp[3][10] = -0.3679 ; hjertComp[4][10] = 0.405 ; hjertComp[5][10] = -0.31;
hjertComp[0][11] = 1.1; hjertComp[1][11] = 0.298197 ; hjertComp[2][11] = 0.17789 ; hjertComp[3][11] = -0.4234 ; hjertComp[4][11] = 0.411 ; hjertComp[5][11] = -0.28;
hjertComp[0][12] = 1.2; hjertComp[1][12] = 0.236928 ; hjertComp[2][12] = 0.24537 ; hjertComp[3][12] = -0.4454 ; hjertComp[4][12] = 0.386 ; hjertComp[5][12] = -0.24;
hjertComp[0][13] = 1.3; hjertComp[1][13] = 0.184520 ; hjertComp[2][13] = 0.28981 ; hjertComp[3][13] = -0.4392 ; hjertComp[4][13] = 0.339 ; hjertComp[5][13] = -0.18;
hjertComp[0][14] = 1.4; hjertComp[1][14] = 0.140858 ; hjertComp[2][14] = 0.31394 ; hjertComp[3][14] = -0.4113 ; hjertComp[4][14] = 0.280 ; hjertComp[5][14] = -0.12;
hjertComp[0][15] = 1.5; hjertComp[1][15] = 0.105399 ; hjertComp[2][15] = 0.32130 ; hjertComp[3][15] = -0.3689 ; hjertComp[4][15] = 0.215 ; hjertComp[5][15] = -0.07;
hjertComp[0][16] = 1.6; hjertComp[1][16] = 0.077305 ; hjertComp[2][16] = 0.31573 ; hjertComp[3][16] = -0.3185 ; hjertComp[4][16] = 0.153 ; hjertComp[5][16] = -0.02;
hjertComp[0][17] = 1.7; hjertComp[1][17] = 0.055576 ; hjertComp[2][17] = 0.30094 ; hjertComp[3][17] = -0.2657 ; hjertComp[4][17] = 0.097 ; hjertComp[5][17] = 0.02;
hjertComp[0][18] = 1.8; hjertComp[1][18] = 0.039164 ; hjertComp[2][18] = 0.28027 ; hjertComp[3][18] = -0.2146 ; hjertComp[4][18] = 0.051 ; hjertComp[5][18] = 0.04;
hjertComp[0][19] = 1.9; hjertComp[1][19] = 0.027052 ; hjertComp[2][19] = 0.25648 ; hjertComp[3][19] = -0.1683 ; hjertComp[4][19] = 0.015 ; hjertComp[5][19] = 0.05;
hjertComp[0][20] = 2.0; hjertComp[1][20] = 0.0183156; hjertComp[2][20] = 0.231726; hjertComp[3][20] = -0.12821; hjertComp[4][20] = -0.0101; hjertComp[5][20] = 0.058;
hjertComp[0][21] = 2.1; hjertComp[1][21] = 0.0121552; hjertComp[2][21] = 0.207528; hjertComp[3][21] = -0.09505; hjertComp[4][21] = -0.0265; hjertComp[5][21] = 0.056;
hjertComp[0][22] = 2.2; hjertComp[1][22] = 0.0079071; hjertComp[2][22] = 0.184882; hjertComp[3][22] = -0.06863; hjertComp[4][22] = -0.0355; hjertComp[5][22] = 0.051;
hjertComp[0][23] = 2.3; hjertComp[1][23] = 0.0050418; hjertComp[2][23] = 0.164341; hjertComp[3][23] = -0.04830; hjertComp[4][23] = -0.0391; hjertComp[5][23] = 0.043;
hjertComp[0][24] = 2.4; hjertComp[1][24] = 0.0031511; hjertComp[2][24] = 0.146128; hjertComp[3][24] = -0.03315; hjertComp[4][24] = -0.0389; hjertComp[5][24] = 0.035;
hjertComp[0][25] = 2.5; hjertComp[1][25] = 0.0019305; hjertComp[2][25] = 0.130236; hjertComp[3][25] = -0.02220; hjertComp[4][25] = -0.0363; hjertComp[5][25] = 0.027;
hjertComp[0][26] = 2.6; hjertComp[1][26] = 0.0011592; hjertComp[2][26] = 0.116515; hjertComp[3][26] = -0.01451; hjertComp[4][26] = -0.0325; hjertComp[5][26] = 0.020;
hjertComp[0][27] = 2.7; hjertComp[1][27] = 0.0006823; hjertComp[2][27] = 0.104739; hjertComp[3][27] = -0.00927; hjertComp[4][27] = -0.0282; hjertComp[5][27] = 0.015;
hjertComp[0][28] = 2.8; hjertComp[1][28] = 0.0003937; hjertComp[2][28] = 0.094653; hjertComp[3][28] = -0.00578; hjertComp[4][28] = -0.0239; hjertComp[5][28] = 0.010;
hjertComp[0][29] = 2.9; hjertComp[1][29] = 0.0002226; hjertComp[2][29] = 0.086005; hjertComp[3][29] = -0.00352; hjertComp[4][29] = -0.0201; hjertComp[5][29] = 0.007;
hjertComp[0][30] = 3.0; hjertComp[1][30] = 0.0001234; hjertComp[2][30] = 0.078565; hjertComp[3][30] = -0.00210; hjertComp[4][30] = -0.0167; hjertComp[5][30] = 0.005;
hjertComp[0][31] = 3.1; hjertComp[1][31] = 0.0000671; hjertComp[2][31] = 0.072129; hjertComp[3][31] = -0.00122; hjertComp[4][31] = -0.0138; hjertComp[5][31] = 0.003;
hjertComp[0][32] = 3.2; hjertComp[1][32] = 0.0000357; hjertComp[2][32] = 0.066526; hjertComp[3][32] = -0.00070; hjertComp[4][32] = -0.0115; hjertComp[5][32] = 0.002;
hjertComp[0][33] = 3.3; hjertComp[1][33] = 0.0000186; hjertComp[2][33] = 0.061615; hjertComp[3][33] = -0.00039; hjertComp[4][33] = -0.0096; hjertComp[5][33] = 0.001;
hjertComp[0][34] = 3.4; hjertComp[1][34] = 0.0000095; hjertComp[2][34] = 0.057281; hjertComp[3][34] = -0.00021; hjertComp[4][34] = -0.0080; hjertComp[5][34] = 0.001;
hjertComp[0][35] = 3.5; hjertComp[1][35] = 0.0000048; hjertComp[2][35] = 0.053430; hjertComp[3][35] = -0.00011; hjertComp[4][35] = -0.0068; hjertComp[5][35] = 0.000;
hjertComp[0][36] = 3.6; hjertComp[1][36] = 0.0000024; hjertComp[2][36] = 0.049988; hjertComp[3][36] = -0.00006; hjertComp[4][36] = -0.0058; hjertComp[5][36] = 0.000;
hjertComp[0][37] = 3.7; hjertComp[1][37] = 0.0000011; hjertComp[2][37] = 0.046894; hjertComp[3][37] = -0.00003; hjertComp[4][37] = -0.0050; hjertComp[5][37] = 0.000;
hjertComp[0][38] = 3.8; hjertComp[1][38] = 0.0000005; hjertComp[2][38] = 0.044098; hjertComp[3][38] = -0.00001; hjertComp[4][38] = -0.0043; hjertComp[5][38] = 0.000;
hjertComp[0][39] = 3.9; hjertComp[1][39] = 0.0000002; hjertComp[2][39] = 0.041561; hjertComp[3][39] = -0.00001; hjertComp[4][39] = -0.0037; hjertComp[5][39] = 0.000;
hjertComp[0][40] = 4.0; hjertComp[1][40] = 0.0000000; hjertComp[2][40] = 0.039250; hjertComp[3][40] = 0.00000; hjertComp[4][40] = -0.00329; hjertComp[5][40] = 0.000;
hjertComp[0][41] = 4.2; hjertComp[1][41] = 0.0000000; hjertComp[2][41] = 0.035195; hjertComp[3][41] = 0.00000; hjertComp[4][41] = -0.00257; hjertComp[5][41] = 0.000;
hjertComp[0][42] = 4.4; hjertComp[1][42] = 0.0000000; hjertComp[2][42] = 0.031762; hjertComp[3][42] = 0.00000; hjertComp[4][42] = -0.00205; hjertComp[5][42] = 0.000;
hjertComp[0][43] = 4.6; hjertComp[1][43] = 0.0000000; hjertComp[2][43] = 0.028824; hjertComp[3][43] = 0.00000; hjertComp[4][43] = -0.00166; hjertComp[5][43] = 0.000;
hjertComp[0][44] = 4.8; hjertComp[1][44] = 0.0000000; hjertComp[2][44] = 0.026288; hjertComp[3][44] = 0.00000; hjertComp[4][44] = -0.00137; hjertComp[5][44] = 0.000;
hjertComp[0][45] = 5.0; hjertComp[1][45] = 0.0000000; hjertComp[2][45] = 0.024081; hjertComp[3][45] = 0.00000; hjertComp[4][45] = -0.00113; hjertComp[5][45] = 0.000;
hjertComp[0][46] = 5.2; hjertComp[1][46] = 0.0000000; hjertComp[2][46] = 0.022146; hjertComp[3][46] = 0.00000; hjertComp[4][46] = -0.00095; hjertComp[5][46] = 0.000;
hjertComp[0][47] = 5.4; hjertComp[1][47] = 0.0000000; hjertComp[2][47] = 0.020441; hjertComp[3][47] = 0.00000; hjertComp[4][47] = -0.00080; hjertComp[5][47] = 0.000;
hjertComp[0][48] = 5.6; hjertComp[1][48] = 0.0000000; hjertComp[2][48] = 0.018929; hjertComp[3][48] = 0.00000; hjertComp[4][48] = -0.00068; hjertComp[5][48] = 0.000;
hjertComp[0][49] = 5.8; hjertComp[1][49] = 0.0000000; hjertComp[2][49] = 0.017582; hjertComp[3][49] = 0.00000; hjertComp[4][49] = -0.00059; hjertComp[5][49] = 0.000;
hjertComp[0][50] = 6.0; hjertComp[1][50] = 0.0000000; hjertComp[2][50] = 0.016375; hjertComp[3][50] = 0.00000; hjertComp[4][50] = -0.00051; hjertComp[5][50] = 0.000;
hjertComp[0][51] = 6.2; hjertComp[1][51] = 0.0000000; hjertComp[2][51] = 0.015291; hjertComp[3][51] = 0.00000; hjertComp[4][51] = -0.00044; hjertComp[5][51] = 0.000;
hjertComp[0][52] = 6.4; hjertComp[1][52] = 0.0000000; hjertComp[2][52] = 0.014312; hjertComp[3][52] = 0.00000; hjertComp[4][52] = -0.00038; hjertComp[5][52] = 0.000;
hjertComp[0][53] = 6.6; hjertComp[1][53] = 0.0000000; hjertComp[2][53] = 0.013426; hjertComp[3][53] = 0.00000; hjertComp[4][53] = -0.00034; hjertComp[5][53] = 0.000;
hjertComp[0][54] = 6.8; hjertComp[1][54] = 0.0000000; hjertComp[2][54] = 0.012620; hjertComp[3][54] = 0.00000; hjertComp[4][54] = -0.00030; hjertComp[5][54] = 0.000;
hjertComp[0][55] = 7.0; hjertComp[1][55] = 0.0000000; hjertComp[2][55] = 0.0118860; hjertComp[3][55] = 0.00000; hjertComp[4][55] = -0.00026; hjertComp[5][55] = 0.000;
hjertComp[0][56] = 7.2; hjertComp[1][56] = 0.0000000; hjertComp[2][56] = 0.0112145; hjertComp[3][56] = 0.00000; hjertComp[4][56] = -0.00023; hjertComp[5][56] = 0.000;
hjertComp[0][57] = 7.4; hjertComp[1][57] = 0.0000000; hjertComp[2][57] = 0.0105990; hjertComp[3][57] = 0.00000; hjertComp[4][57] = -0.00021; hjertComp[5][57] = 0.000;
hjertComp[0][58] = 7.6; hjertComp[1][58] = 0.0000000; hjertComp[2][58] = 0.0100332; hjertComp[3][58] = 0.00000; hjertComp[4][58] = -0.00019; hjertComp[5][58] = 0.000;
hjertComp[0][59] = 7.8; hjertComp[1][59] = 0.0000000; hjertComp[2][59] = 0.0095119; hjertComp[3][59] = 0.00000; hjertComp[4][59] = -0.00017; hjertComp[5][59] = 0.000;
hjertComp[0][60] = 8.0; hjertComp[1][60] = 0.0000000; hjertComp[2][60] = 0.0090306; hjertComp[3][60] = 0.00000; hjertComp[4][60] = -0.00015; hjertComp[5][60] = 0.000;
hjertComp[0][61] = 8.2; hjertComp[1][61] = 0.0000000; hjertComp[2][61] = 0.0085852; hjertComp[3][61] = 0.00000; hjertComp[4][61] = -0.00013; hjertComp[5][61] = 0.000;
hjertComp[0][62] = 8.4; hjertComp[1][62] = 0.0000000; hjertComp[2][62] = 0.0081722; hjertComp[3][62] = 0.00000; hjertComp[4][62] = -0.00012; hjertComp[5][62] = 0.000;
hjertComp[0][63] = 8.6; hjertComp[1][63] = 0.0000000; hjertComp[2][63] = 0.0077885; hjertComp[3][63] = 0.00000; hjertComp[4][63] = -0.00011; hjertComp[5][63] = 0.000;
hjertComp[0][64] = 8.8; hjertComp[1][64] = 0.0000000; hjertComp[2][64] = 0.0074314; hjertComp[3][64] = 0.00000; hjertComp[4][64] = -0.00010; hjertComp[5][64] = 0.000;
hjertComp[0][65] = 9.0; hjertComp[1][65] = 0.0000000; hjertComp[2][65] = 0.0070985; hjertComp[3][65] = 0.00000; hjertComp[4][65] = -0.00009; hjertComp[5][65] = 0.000;
hjertComp[0][66] = 9.2; hjertComp[1][66] = 0.0000000; hjertComp[2][66] = 0.0067875; hjertComp[3][66] = 0.00000; hjertComp[4][66] = -0.00008; hjertComp[5][66] = 0.000;
hjertComp[0][67] = 9.4; hjertComp[1][67] = 0.0000000; hjertComp[2][67] = 0.0064967; hjertComp[3][67] = 0.00000; hjertComp[4][67] = -0.00008; hjertComp[5][67] = 0.000;
hjertComp[0][68] = 9.6; hjertComp[1][68] = 0.0000000; hjertComp[2][68] = 0.0062243; hjertComp[3][68] = 0.00000; hjertComp[4][68] = -0.00007; hjertComp[5][68] = 0.000;
hjertComp[0][69] = 9.8; hjertComp[1][69] = 0.0000000; hjertComp[2][69] = 0.0059688; hjertComp[3][69] = 0.00000; hjertComp[4][69] = -0.00007; hjertComp[5][69] = 0.000;
hjertComp[0][70] = 10.0; hjertComp[1][70] = 0.000000 ; hjertComp[2][70] = 0.0057287; hjertComp[3][70] = 0.00000; hjertComp[4][70] = -0.00006; hjertComp[5][70] = 0.000;
hjertComp[0][71] = 10.2; hjertComp[1][71] = 0.000000 ; hjertComp[2][71] = 0.0055030; hjertComp[3][71] = 0.00000; hjertComp[4][71] = -0.00006; hjertComp[5][71] = 0.000;
hjertComp[0][72] = 10.4; hjertComp[1][72] = 0.000000 ; hjertComp[2][72] = 0.0052903; hjertComp[3][72] = 0.00000; hjertComp[4][72] = -0.00005; hjertComp[5][72] = 0.000;
hjertComp[0][73] = 10.6; hjertComp[1][73] = 0.000000 ; hjertComp[2][73] = 0.0050898; hjertComp[3][73] = 0.00000; hjertComp[4][73] = -0.00005; hjertComp[5][73] = 0.000;
hjertComp[0][74] = 10.8; hjertComp[1][74] = 0.000000 ; hjertComp[2][74] = 0.0049006; hjertComp[3][74] = 0.00000; hjertComp[4][74] = -0.00004; hjertComp[5][74] = 0.000;
hjertComp[0][75] = 11.0; hjertComp[1][75] = 0.000000 ; hjertComp[2][75] = 0.0047217; hjertComp[3][75] = 0.00000; hjertComp[4][75] = -0.00004; hjertComp[5][75] = 0.000;
hjertComp[0][76] = 11.2; hjertComp[1][76] = 0.000000 ; hjertComp[2][76] = 0.0045526; hjertComp[3][76] = 0.00000; hjertComp[4][76] = -0.00004; hjertComp[5][76] = 0.000;
hjertComp[0][77] = 11.4; hjertComp[1][77] = 0.000000 ; hjertComp[2][77] = 0.0043924; hjertComp[3][77] = 0.00000; hjertComp[4][77] = -0.00003; hjertComp[5][77] = 0.000;
hjertComp[0][78] = 11.6; hjertComp[1][78] = 0.000000 ; hjertComp[2][78] = 0.0042405; hjertComp[3][78] = 0.00000; hjertComp[4][78] = -0.00003; hjertComp[5][78] = 0.000;
hjertComp[0][79] = 11.8; hjertComp[1][79] = 0.000000 ; hjertComp[2][79] = 0.0040964; hjertComp[3][79] = 0.00000; hjertComp[4][79] = -0.00003; hjertComp[5][79] = 0.000;
hjertComp[0][80] = 12.0; hjertComp[1][80] = 0.000000 ; hjertComp[2][80] = 0.0039595; hjertComp[3][80] = 0.00000; hjertComp[4][80] = -0.00003; hjertComp[5][80] = 0.000;
return hjertComp;
}
}
| sevenian3/GrayStar4Server | HjertingComponents.java | Java | mit | 14,916 |
/**
*
*/
package pcal;
import java.io.Serializable;
import java.util.Vector;
/**
* A MappingObject is an element in the mapping field of a TLAtoPCalMapping object.
* It describes either a region in the TLA+ translation or the start or end of a
* region in the PlusCal code. See the TLAToPCal.tla module for a TLA+ specification
* of what these objects mean. The correspondence between MappingObject classes and
* sets in the TLAToPCal spec is:
*
* LeftParen / RightParen :
* Elements of Paren with type field "begin" / "end"
*
* BeginTLAToken / EndTLAToken :
* Represent the beginning and end locations of elements of TLAToken with
* inExpr field FALSE. The line field of the TLAToken element is implicit
* in the location of the BeginTLAToken or EndTLAToken object in the mapping.
* Since the TLAToken's regions can span multiple lines, this requires that
* its Java representation be split into these two Java objects.
*
* SourceToken :
* Represents an element of TLAToken with inExpr field TRUE, together with
* the Parens that surround it. (The region
* of a TLAToken occupies a single line, so there is no need to split the
* Java object.) Again, the line of the TLAToken is implict in the position
* of the ExprToken object in the mapping, so only the token's position and
* length is needed in the object
*
* Break :
* Represents an element of Break.
*
* @author lamport
*
*/
public class MappingObject implements Serializable {
/**
* @see TLAtoPCalMapping#serialVersionUID
*/
private static final long serialVersionUID = 8620480075506527787L;
/*
* The type field tells what subclass the MappingObject belongs to
*/
private int type ;
/*
* The following are the types of MappingObjects.
*/
public static final int LEFT_PAREN = 0;
public static final int RIGHT_PAREN = 1;
public static final int BEGIN_TLATOKEN = 2 ;
public static final int END_TLATOKEN = 3 ;
public static final int SOURCE_TOKEN = 4 ;
public static final int BREAK = 5 ;
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
public MappingObject(int type) {
this.type = type ;
}
public static class LeftParen extends MappingObject {
/**
* @see TLAtoPCalMapping#serialVersionUID
*/
private static final long serialVersionUID = 5476753619018204229L;
// private int column ;
private PCalLocation location ;
public LeftParen(PCalLocation location) {
super(LEFT_PAREN) ;
// this.column = column;
this.location = location;
}
public String toString() {
return "((-" + this.location.toString();
}
// public int getColumn() {
// return column;
// }
public PCalLocation getLocation() {
return location;
}
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result
+ ((location == null) ? 0 : location.hashCode());
return result;
}
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
LeftParen other = (LeftParen) obj;
if (location == null) {
if (other.location != null)
return false;
} else if (!location.equals(other.location))
return false;
return true;
}
}
public static class RightParen extends MappingObject {
/**
* @see TLAtoPCalMapping#serialVersionUID
*/
private static final long serialVersionUID = 1313886393528667584L;
// private int column ;
private PCalLocation location ;
public RightParen(PCalLocation location) {
super(RIGHT_PAREN) ;
// this.column = column;
this.location = location;
}
public String toString() {
return this.location.toString() + "-))";
}
// public int getColumn() {
// return column;
// }
public PCalLocation getLocation() {
return location;
}
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result
+ ((location == null) ? 0 : location.hashCode());
return result;
}
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
RightParen other = (RightParen) obj;
if (location == null) {
if (other.location != null)
return false;
} else if (!location.equals(other.location))
return false;
return true;
}
}
public static class BeginTLAToken extends MappingObject {
/**
* @see TLAtoPCalMapping#serialVersionUID
*/
private static final long serialVersionUID = 3737867780161818714L;
private int column ;
public int getColumn() {
return column;
}
public void setColumn(int column) {
this.column = column ;
}
public BeginTLAToken(int column) {
super(BEGIN_TLATOKEN) ;
this.column = column ;
}
public String toString() {
return "[" + this.column;
}
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + column;
return result;
}
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
BeginTLAToken other = (BeginTLAToken) obj;
if (column != other.column)
return false;
return true;
}
}
public static class EndTLAToken extends MappingObject {
/**
* @see TLAtoPCalMapping#serialVersionUID
*/
private static final long serialVersionUID = -2173558662370032149L;
private int column ;
public int getColumn() {
return column;
}
public void setColumn(int column) {
this.column = column ;
}
public EndTLAToken(int column) {
super(END_TLATOKEN) ;
this.column = column ;
}
public String toString() {
return this.column + "]";
}
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + column;
return result;
}
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
EndTLAToken other = (EndTLAToken) obj;
if (column != other.column)
return false;
return true;
}
}
public static class SourceToken extends MappingObject {
/**
* @see TLAtoPCalMapping#serialVersionUID
*/
private static final long serialVersionUID = 6438346684127312114L;
private int beginColumn ;
private int endColumn ;
private Region origin ;
public int getBeginColumn() {
return beginColumn;
}
public void setBeginColumn(int beginColumn) {
this.beginColumn = beginColumn;
}
public int getEndColumn() {
return endColumn;
}
public void setEndColumn(int endColumn) {
this.endColumn = endColumn;
}
public Region getOrigin() {
return origin;
}
// public void setOrigin(Region origin) {
// this.origin = origin;
// }
public SourceToken(int beginCol, int endCol, Region origin) {
super(SOURCE_TOKEN) ;
this.setBeginColumn(beginCol) ;
this.setEndColumn(endCol) ;
this.origin = origin ;
}
public String toString() {
return "((-" + this.origin.getBegin().toString() +
"[" + this.beginColumn + "--" + this.endColumn + "]"
+ this.origin.getEnd().toString() + "-))";
}
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + beginColumn;
result = prime * result + endColumn;
result = prime * result
+ ((origin == null) ? 0 : origin.hashCode());
return result;
}
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
SourceToken other = (SourceToken) obj;
if (beginColumn != other.beginColumn)
return false;
if (endColumn != other.endColumn)
return false;
if (origin == null) {
if (other.origin != null)
return false;
} else if (!origin.equals(other.origin))
return false;
return true;
}
}
public static class Break extends MappingObject{
/**
* @see TLAtoPCalMapping#serialVersionUID
*/
private static final long serialVersionUID = 3197403974334483558L;
private int depth ;
public int getDepth() {
return depth;
}
public Break(int depth) {
super(BREAK) ;
this.depth = depth;
}
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + depth;
return result;
}
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
Break other = (Break) obj;
if (depth != other.depth)
return false;
return true;
}
}
/**
* A mapping vector is a vector of vectors of MappingObject
* objects. This transforms a mapping vector obtained from a
* TLAExpr object by a call of toMappingVector to produce the
* mapping vector that would have resulted from that call if the
* entire expression had been moved to the right by `shift'
* characters.
*
* @param mvec A mapping vector.
* @param shift The distance to shift to the right.
*/
public static void shiftMappingVector(Vector mvec, int shift) {
for (int i = 0; i < mvec.size(); i++) {
Vector line = (Vector) mvec.elementAt(i);
for (int j = 0; j < line.size(); j++) {
MappingObject mobj = (MappingObject) line.elementAt(j);
if (mobj.type == BEGIN_TLATOKEN) {
BeginTLAToken obj = (BeginTLAToken) mobj;
obj.setColumn(obj.getColumn()+shift) ;
} else if (mobj.type == END_TLATOKEN) {
EndTLAToken obj = (EndTLAToken) mobj;
obj.setColumn(obj.getColumn()+shift) ;
} else if (mobj.type == SOURCE_TOKEN) {
SourceToken obj = (SourceToken) mobj;
obj.setBeginColumn(obj.getBeginColumn()+shift) ;
obj.setEndColumn(obj.getEndColumn()+shift) ;
}
}
}
}
/**
* For debugging.
* @param mvec
*/
public static void printMappingVector(Vector mvec) {
for (int i = 0; i < mvec.size(); i++) {
Vector line = (Vector) mvec.elementAt(i);
System.out.print("line " + i + ":");
for (int j = 0; j < line.size(); j++) {
MappingObject mobj = (MappingObject) line.elementAt(j) ;
System.out.print(" " + mobj.toString());
}
System.out.println("");
}
}
public static void printMapping(MappingObject[][] mapping) {
for (int i = 0; i < mapping.length; i++) {
MappingObject[] line = mapping[i];
System.out.print("line " + i + ":");
for (int j = 0; j < line.length; j++) {
MappingObject mobj = line[j] ;
System.out.print(" " + mobj.toString());
}
System.out.println("");
}
}
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + type;
return result;
}
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
MappingObject other = (MappingObject) obj;
if (type != other.type)
return false;
return true;
}
}
| noranazmy/TLA2TeXConverter | src/pcal/MappingObject.java | Java | mit | 14,301 |
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <cctype>
#include <cmath>
using namespace std;
typedef long long ll;
const int MAX = 11;
ll dp[11][11];
int ar[11];
int Count;
ll dfs(int pos, int pre, int limit, int first);
ll solve(ll n);
int main()
{
int i, j, u, max, a, b;
ll n, m, k, res;
memset(dp, -1, sizeof(dp));
while (scanf("%d", &a) != EOF)
{
for (b = 1; b <= a; b++)
{
scanf("%lld %lld", &n, &m);
//printf("%lld %lld\n", solve(m), solve(n - 1));
printf("%lld\n", solve(m) - solve(n - 1));
}
}
return 0;
}
ll solve(ll n)
{
int i, j;
Count = 0;
while (n)
{
ar[++Count] = n % 10;
n /= 10;
}
return dfs(Count, 0, 1, 1);
}
ll dfs(int pos, int pre, int limit, int first)
{
int i, j, k, max;
ll res = 0;
if (pos == 0)
return 1;
if (!limit && dp[pos][pre] != -1)
return dp[pos][pre];
max = limit ? ar[pos] : 9;
for (i = 0; i <= max; i++)
{
if(first)
res += dfs(pos - 1, i, limit && i == ar[pos], first && i== 0);
else if(i == 0)
continue;
else if(i > pre || pre % i)
continue;
else
res += dfs(pos - 1, i, limit && i == ar[pos], first && i== 0);
}
if (!limit)
dp[pos][pre] = res;
return res;
} | Hyyyyyyyyyy/acm | uhk/acm5179.cpp | C++ | mit | 1,406 |
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>IcoMoon Demo</title>
<meta name="description" content="An Icon Font Generated By IcoMoon.io">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="demo-files/demo.css">
<link rel="stylesheet" href="style.css"></head>
<body>
<div class="bgc1 clearfix">
<h1 class="mhmm mvm"><span class="fgc1">Font Name:</span> Icons <small class="fgc1">(Glyphs: 4)</small></h1>
</div>
<div class="clearfix mhl ptl">
<h1 class="mvm mtn bshadow fgc1">Grid Size: 16</h1>
<div class="glyph fs1">
<div class="clearfix bshadow0 pbs">
<span class="icon-gameboy"></span><span class="mls"> icon-gameboy</span>
</div>
<fieldset class="fs0 size1of1 clearfix">
<input type="text" readonly value="e601" class="unit size1of2" />
<input type="text" maxlength="1" readonly value="" class="unitRight size1of2 talign-right" />
</fieldset>
<div class="fs0 bshadow0 clearfix noLiga-true">
<span class="unit pvs fgc1">liga: </span>
<input type="text" readonly value="" class="liga unitRight" />
</div>
</div>
<div class="glyph fs1">
<div class="clearfix bshadow0 pbs">
<span class="icon-ghost"></span><span class="mls"> icon-ghost</span>
</div>
<fieldset class="fs0 size1of1 clearfix">
<input type="text" readonly value="e600" class="unit size1of2" />
<input type="text" maxlength="1" readonly value="" class="unitRight size1of2 talign-right" />
</fieldset>
<div class="fs0 bshadow0 clearfix noLiga-true">
<span class="unit pvs fgc1">liga: </span>
<input type="text" readonly value="" class="liga unitRight" />
</div>
</div>
<div class="glyph fs1">
<div class="clearfix bshadow0 pbs">
<span class="icon-pacman"></span><span class="mls"> icon-pacman</span>
</div>
<fieldset class="fs0 size1of1 clearfix">
<input type="text" readonly value="e602" class="unit size1of2" />
<input type="text" maxlength="1" readonly value="" class="unitRight size1of2 talign-right" />
</fieldset>
<div class="fs0 bshadow0 clearfix noLiga-true">
<span class="unit pvs fgc1">liga: </span>
<input type="text" readonly value="" class="liga unitRight" />
</div>
</div>
<div class="glyph fs1">
<div class="clearfix bshadow0 pbs">
<span class="icon-oneup"></span><span class="mls"> icon-oneup</span>
</div>
<fieldset class="fs0 size1of1 clearfix">
<input type="text" readonly value="e603" class="unit size1of2" />
<input type="text" maxlength="1" readonly value="" class="unitRight size1of2 talign-right" />
</fieldset>
<div class="fs0 bshadow0 clearfix noLiga-true">
<span class="unit pvs fgc1">liga: </span>
<input type="text" readonly value="" class="liga unitRight" />
</div>
</div>
</div>
<!--[if gt IE 8]><!-->
<div class="mhl clearfix mbl">
<h1>Font Test Drive</h1>
<label>
Font Size: <input id="fontSize" type="number" class="textbox0 mbm"
min="8" value="48" />
px
</label>
<input id="testText" type="text" class="phl size1of1 mvl"
placeholder="Type some text to test..."/>
</label>
<div id="testDrive" class="icon-">
</div>
</div>
<!--<![endif]-->
<div class="bgc1 clearfix">
<p class="mhl">Generated by <a href="http://icomoon.io/app">IcoMoon</a></p>
</div>
<script src="demo-files/demo.js"></script>
</body>
</html> | digitaljohn/boilerplate | public/css/fonts/Icons/demo.html | HTML | mit | 3,409 |
import inspect, os
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(currentdir)
os.sys.path.insert(0,parentdir)
import doc2case
from doc2case import Tokenizer as Tk, ExampleParser as EP
import unittest
class BaseTest(unittest.TestCase):
def setUp(self):
self.maxDiff = None
class TestTokenizer(BaseTest):
def compare(self, text, expected):
actual = Tk(text).lines()
print(actual)
# actual = [[e for e in ln if not (isinstance(e, Tk.Space) and e.range[0] == e.range[1])] for ln in actual]
# for line, e in zip(text.split('\n'), expected):
# new_expected.append(e)
# if not(e and isinstance(e[-1], Tk.Space)):
# length = len(line) + line.count(Tk.TAB) * (Tk.TAB_WIDTH - 1)
# e.append(Tk.Space(length, length))
# self.assertEqual(actual, new_expected)
self.assertEqual(actual, expected)
# @unittest.skip('')
def test_general(self):
text = ' \n \n 123, tRue, 789, \'a\' \n 1 False, 3 4\n"a","b",Null,\n"asdf",\n,\n12 '
expected = [
[],
[],
[Tk.Space(0, 2), 123, Tk.Space(6, 11), 'tRue', 789, 'a'],
[Tk.Space(0, 4), 1, Tk.Space(5, 7), False, '3 4'],
['a', 'b', None],
['asdf'],
[],
[12]
]
self.compare(text, expected)
# @unittest.skip('')
def test_arrow(self):
text = '123=>4\n1 3 ⇒4a\n0 -> 7\n123 =>> 4\n123 -->> 4\n123 --- 4\n 123 >- 5\n'
expected = [
[123, Tk.Arrow(3, 5), 4, Tk.Space(6, 13)],
['1 3', Tk.Arrow(3, 5), '4a', Tk.Space(7, 13)],
[0, Tk.Arrow(1, 12), 7, Tk.Space(13, 13)],
[123, Tk.Arrow(3, 8), 4, Tk.Space(9, 13)],
[123, Tk.Arrow(3, 12), 4, Tk.Space(13, 13)],
['123 ---', Tk.Space(7, 9), 4, Tk.Space(10, 13)],
['123 >-', Tk.Space(7, 11), 5, Tk.Space(12, 13)],
[Tk.Space(0, 13)]
]
self.compare(text, expected)
# @unittest.skip('')
def test_brackets(self):
text = '[4\t\t], 2\n'
expected = [
[Tk.OpeningBracket(), 4, Tk.ClosingBracket(), 2],
]
# self.compare(text, expected)
class TestTypeParser(BaseTest):
def compare(self, strs_type, data, expected):
self.assertEqual(doc2case.TypeParser(strs_type).parse(','.join(map(str, data)).replace("'", '"')), expected)
# @unittest.skip('')
def test_general(self):
strs_type = ('int[][]', 'String', 'String')
data = [
[['1', '0', 2, 3], [], [2], ['3']],
False,
None
]
expected = [
[[1, 0, 2, 3], [], [2], [3]],
'False',
None
]
self.compare(strs_type, data, expected)
self.compare(strs_type, [data], expected)
class TestExampleParser(BaseTest):
# @unittest.skip('')
def test_find_margin(self):
def compare(expected, text, ileft, iright, iarrow=None):
if iarrow is None:
actual = EP.find_margins_one_way(Tk(text).lines(), ileft, iright)
else:
actual = EP.find_margins(Tk(text).lines(), iarrow, (ileft, iright))
self.assertEqual(list(actual), expected)
text = ("[[2, 3, 4], [[9, 1, 2],\n"
" [1, 5, 3], [0, 5, 3],\n"
" [9, 0, 1]],3,L => [1, 3, 4]]")
expected = [(11, 21), (11, 22), (15, 26)]
compare(expected, text, 15, 26, 2)
# "[[x, x, x], ==> [[x, x, x],\n"
text = (" [x, x, x, x], [x, x, x],\n"
" [x, x, x, x], [x, x, x],\n"
" [x, x, x]], x, x, x, x [x, x, x]]")
expected = [(14, 21), (14, 20), (23, 30)]
compare(expected, text, 11, 15)
# "[[], [], => [[], []\n"
text = (" [], [], [], [x, x]\n"
" [x, x], [x, x], [], [x]\n"
" [], []] [x, x], [x, x, x]]")
expected = [(11, 20), (19, 28), (11, 20)]
compare(expected, text, 11, 19)
@classmethod
def clean(cls, l):
if isinstance(l, str):
return l.replace('\n', '').replace(' ', '')
elif not isinstance(l, (list, tuple)):
return l
return [cls.clean(e) for e in l]
# @unittest.skip('')
def test_make_case(self):
def compare(expected, text, iarrow):
lines = Tk(text).lines()
actual = EP(text)._make_case(lines, 0, len(lines), iarrow)
self.assertEqual(self.clean(actual), self.clean(expected))
text = ("[[2, 3, 4], [[9, 1, 2],\n"
" [1, 5, 3], [0, 5, 3],\n"
" [9, 0, 1]],3,L => [1, 3, 4]]")
expected = [
'[[2, 3, 4], [1, 5, 3], [9, 0, 1]],3,L=>', # _make_case does not remove arrows or comments
'[[9, 1, 2], [0, 5, 3], [1, 3, 4]]'
]
compare(expected, text, 2)
# @unittest.skip('')
def test_parse_cases(self):
def compare(expected, text):
actual = EP(text)._parse_cases()
self.assertEqual(*map(self.clean, (actual, expected)))
text = ('90.7, 16, ‘B’ => true\n'
'97.6, 22, ‘F’ => false\n'
'140.6, 37, ‘A’ => true')
expected = [
(('90.7, 16, ‘B’', 'true'), []),
(('97.6, 22, ‘F’', 'false'), []),
(('140.6, 37, ‘A’', 'true'), [])
]
compare(expected, text)
# @unittest.skip('')
def test_general(self):
def compare(text, expected):
names = ('input', 'output', 'comments')
[actual] = EP(text).parse()
for a, e, name in zip(actual, expected, names):
self.assertEqual(a, e, 'incorrect {}'.format(name))
text = ("[[2, 3, 4], [[9, 1, 2],\n"
" [1, 5, 3], [0, 5, 3],\n"
" [5, 7, 6], [9, 8, 7],\n"
" [9, 0, 1]],3,L => [1, 3, 4]]")
expected = [
[[[2, 3, 4],
[1, 5, 3],
[5, 7, 6],
[9, 0, 1]], 3, 'L'],
[[[9, 1, 2],
[0, 5, 3],
[9, 8, 7],
[1, 3, 4]]],
[]
]
compare(text, expected)
if __name__ == '__main__':
unittest.main()
| ucsd-wic-bpc/doc2case | tests/test_parser.py | Python | mit | 6,642 |
import * as socketio from 'socket.io'
import * as redis from 'socket.io-redis'
import * as red from 'redis'
const socketioJwt = require('socketio-jwt');
import * as Rx from '@reactivex/rxjs'
import * as RxNode from 'rx-node'
const clientRedis = red.createClient();
interface JwtSocket extends SocketIO.Socket
{
decoded_token: any
}
export class IoApp {
constructor(private io: SocketIO.Server, private redisPort = 6379, private redisHost = "localhost") {
this.config()
}
public static bootstrap(io: SocketIO.Server, redisPort = 6379, redisHost = "localhost") {
return new IoApp(io,redisPort,redisHost)
}
private config() {
this.io.adapter(redis({ host: this.redisHost, port: this.redisPort }));
this.io.on('connection', socketioJwt.authorize({
secret: '123456',
timeout: 15000 // 15 seconds to send the authentication message
}));
this.io.on('authenticated', (socket: JwtSocket) => {
socket.join('lobby');
let games = JSON.stringify([{name:"qwe"},{name: "qwe2"}])
clientRedis.lpush("hosts",games,(err,res)=> {
console.log(res);
console.log(err);
});
socket.on('hi', () => {
clientRedis.get("hosts", (err,result) => {
console.log(result);
});
socket.emit('private', socket.id);
});
//this socket is authenticated, we are good to handle more events from it.
console.log('hello! ' + socket.id);
});
this.io.on('connection',(socket) =>{
socket.on('disconnect', function () {
console.log("disconnected")
});
});
/*
this.io.on('connection', (socket) => {
console.log(process.pid);
this.io.emit('this', { will: 'be received by everyone'});
socket.on('my other event', function (from, msg) {
console.log('I received a private message by ', from, ' saying ', msg);
});
socket.on('disconnect', function () {
this.io.emit('user disconnected');
});
});
*/
}
}
| Shadowfaxenator/SocketGameServer | src/io-app.ts | TypeScript | mit | 1,891 |
/*
* Copyright (C) 2013 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package ru.pvolan.strip1.view;
import android.R;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.view.View;
import android.widget.LinearLayout;
class SlidingTabStrip extends LinearLayout {
//private static final int DEFAULT_BOTTOM_BORDER_THICKNESS_DIPS = 2;
private static final int DEFAULT_BOTTOM_BORDER_THICKNESS_DIPS = 0;
private static final byte DEFAULT_BOTTOM_BORDER_COLOR_ALPHA = 0x26;
private static final int SELECTED_INDICATOR_THICKNESS_DIPS = 8;
private static final int DEFAULT_SELECTED_INDICATOR_COLOR = 0xFF33B5E5;
private static final int DEFAULT_DIVIDER_THICKNESS_DIPS = 1;
private static final byte DEFAULT_DIVIDER_COLOR_ALPHA = 0x20;
private static final float DEFAULT_DIVIDER_HEIGHT = 0.5f;
private final int mBottomBorderThickness;
private final Paint mBottomBorderPaint;
private final int mSelectedIndicatorThickness;
private final Paint mSelectedIndicatorPaint;
private final int mDefaultBottomBorderColor;
private final Paint mDividerPaint;
private final float mDividerHeight;
private int mSelectedPosition;
private float mSelectionOffset;
private SlidingTabLayout.TabColorizer mCustomTabColorizer;
private final SimpleTabColorizer mDefaultTabColorizer;
SlidingTabStrip(Context context) {
this(context, null);
}
SlidingTabStrip(Context context, AttributeSet attrs) {
super(context, attrs);
setWillNotDraw(false);
final float density = getResources().getDisplayMetrics().density;
TypedValue outValue = new TypedValue();
context.getTheme().resolveAttribute(R.attr.colorForeground, outValue, true);
final int themeForegroundColor = outValue.data;
mDefaultBottomBorderColor = setColorAlpha(themeForegroundColor,
DEFAULT_BOTTOM_BORDER_COLOR_ALPHA);
mDefaultTabColorizer = new SimpleTabColorizer();
mDefaultTabColorizer.setIndicatorColors(DEFAULT_SELECTED_INDICATOR_COLOR);
mDefaultTabColorizer.setDividerColors(setColorAlpha(themeForegroundColor,
DEFAULT_DIVIDER_COLOR_ALPHA));
mBottomBorderThickness = (int) (DEFAULT_BOTTOM_BORDER_THICKNESS_DIPS * density);
mBottomBorderPaint = new Paint();
mBottomBorderPaint.setColor(mDefaultBottomBorderColor);
mSelectedIndicatorThickness = (int) (SELECTED_INDICATOR_THICKNESS_DIPS * density);
mSelectedIndicatorPaint = new Paint();
mDividerHeight = DEFAULT_DIVIDER_HEIGHT;
mDividerPaint = new Paint();
mDividerPaint.setStrokeWidth((int) (DEFAULT_DIVIDER_THICKNESS_DIPS * density));
}
void setCustomTabColorizer(SlidingTabLayout.TabColorizer customTabColorizer) {
mCustomTabColorizer = customTabColorizer;
invalidate();
}
void setSelectedIndicatorColors(int... colors) {
// Make sure that the custom colorizer is removed
mCustomTabColorizer = null;
mDefaultTabColorizer.setIndicatorColors(colors);
invalidate();
}
void setDividerColors(int... colors) {
// Make sure that the custom colorizer is removed
mCustomTabColorizer = null;
mDefaultTabColorizer.setDividerColors(colors);
invalidate();
}
void onViewPagerPageChanged(int position, float positionOffset) {
mSelectedPosition = position;
mSelectionOffset = positionOffset;
invalidate();
}
@Override
protected void onDraw(Canvas canvas) {
final int height = getHeight();
final int childCount = getChildCount();
final int dividerHeightPx = (int) (Math.min(Math.max(0f, mDividerHeight), 1f) * height);
final SlidingTabLayout.TabColorizer tabColorizer = mCustomTabColorizer != null
? mCustomTabColorizer
: mDefaultTabColorizer;
// Thick colored underline below the current selection
if (childCount > 0) {
View selectedTitle = getChildAt(mSelectedPosition);
int left = selectedTitle.getLeft();
int right = selectedTitle.getRight();
int color = tabColorizer.getIndicatorColor(mSelectedPosition);
if (mSelectionOffset > 0f && mSelectedPosition < (getChildCount() - 1)) {
int nextColor = tabColorizer.getIndicatorColor(mSelectedPosition + 1);
if (color != nextColor) {
color = blendColors(nextColor, color, mSelectionOffset);
}
// Draw the selection partway between the tabs
View nextTitle = getChildAt(mSelectedPosition + 1);
left = (int) (mSelectionOffset * nextTitle.getLeft() +
(1.0f - mSelectionOffset) * left);
right = (int) (mSelectionOffset * nextTitle.getRight() +
(1.0f - mSelectionOffset) * right);
}
mSelectedIndicatorPaint.setColor(color);
canvas.drawRect(left, height - mSelectedIndicatorThickness, right,
height, mSelectedIndicatorPaint);
}
// Thin underline along the entire bottom edge
canvas.drawRect(0, height - mBottomBorderThickness, getWidth(), height, mBottomBorderPaint);
// Vertical separators between the titles
int separatorTop = (height - dividerHeightPx) / 2;
for (int i = 0; i < childCount - 1; i++) {
View child = getChildAt(i);
mDividerPaint.setColor(tabColorizer.getDividerColor(i));
canvas.drawLine(child.getRight(), separatorTop, child.getRight(),
separatorTop + dividerHeightPx, mDividerPaint);
}
}
/**
* Set the alpha value of the {@code color} to be the given {@code alpha} value.
*/
private static int setColorAlpha(int color, byte alpha) {
return Color.argb(alpha, Color.red(color), Color.green(color), Color.blue(color));
}
/**
* Blend {@code color1} and {@code color2} using the given ratio.
*
* @param ratio of which to blend. 1.0 will return {@code color1}, 0.5 will give an even blend,
* 0.0 will return {@code color2}.
*/
private static int blendColors(int color1, int color2, float ratio) {
final float inverseRation = 1f - ratio;
float r = (Color.red(color1) * ratio) + (Color.red(color2) * inverseRation);
float g = (Color.green(color1) * ratio) + (Color.green(color2) * inverseRation);
float b = (Color.blue(color1) * ratio) + (Color.blue(color2) * inverseRation);
return Color.rgb((int) r, (int) g, (int) b);
}
private static class SimpleTabColorizer implements SlidingTabLayout.TabColorizer {
private int[] mIndicatorColors;
private int[] mDividerColors;
@Override
public final int getIndicatorColor(int position) {
return mIndicatorColors[position % mIndicatorColors.length];
}
@Override
public final int getDividerColor(int position) {
return mDividerColors[position % mDividerColors.length];
}
void setIndicatorColors(int... colors) {
mIndicatorColors = colors;
}
void setDividerColors(int... colors) {
mDividerColors = colors;
}
}
} | JCacho/ModSense | AndroidAPP/app/src/main/java/ru/pvolan/strip1/view/SlidingTabStrip.java | Java | mit | 8,091 |
/*
* density.h
*
*/
#ifndef DENSITY_H
#define DENSITY_H
#include "compiled_plugin.h"
#include "compiled_plugin_base.h"
namespace himan
{
namespace plugin
{
/**
* @class DENSITY
*
* @brief Calculates density from pressure and temperature using the ideal gas law rho = P/(R*T)
*
*/
class density : public compiled_plugin, private compiled_plugin_base
{
public:
density();
inline virtual ~density()
{
}
density(const density& other) = delete;
density& operator=(const density& other) = delete;
virtual void Process(std::shared_ptr<const plugin_configuration> conf) override;
virtual std::string ClassName() const override
{
return "himan::plugin::density";
}
virtual HPPluginClass PluginClass() const override
{
return kCompiled;
}
private:
virtual void Calculate(std::shared_ptr<info<double>> theTargetInfo, unsigned short theThreadIndex);
};
// the class factory
extern "C" std::shared_ptr<himan_plugin> create()
{
return std::shared_ptr<density>(new density());
}
} // namespace plugin
} // namespace himan
#endif /* DENSITY_H */
| fmidev/himan | himan-plugins/include/density.h | C | mit | 1,076 |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("14.ModifyBitGivenPosition")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("14.ModifyBitGivenPosition")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("78923fab-0b00-426b-a828-386c06531fdd")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| MystFan/TelerikAcademy | C# part 1/OperatorsAndExpressions/14.ModifyBitGivenPosition/Properties/AssemblyInfo.cs | C# | mit | 1,426 |
package com.cinnamon.utils;
import com.cinnamon.system.MouseEvent;
/**
* <p>
* Listener to be triggered on a mouse click.
* </p>
*/
public interface OnClickListener
{
/**
* <p>Called when an object is clicked on.</p>
*
* @param event {@link MouseEvent}.
* @return true if the MouseEvent was used.
*/
boolean onClick(MouseEvent event);
}
| joltix/Cinnamon | com/cinnamon/utils/OnClickListener.java | Java | mit | 381 |
---
layout: post
title: "起点"
date: 2017-02-24 21:00
author: "107"
categories: 个人管理
tags: 习惯 认知
excerpt: 醒悟,认知的四个区域和认知的四个阶段
---
* content
{:toc}
## 一、醒悟
人类能将谁也无法说服他人改变,因为我们每个人都守着一扇只能从内开启的改变之门,不论动之以情或晓之以理,我们都不能替别人开门。
> 自己的思考作为思考对象,这个能力被称作“元认知能力”。
参考四象限工具,可以把自己的认知划分为四个区域:自己知道的,自己不知道的,别人知道的,别人不知道的。

认知的四个阶段:
不知不觉
后知后觉
当知当觉
先知先觉
| tomens/tomens.github.io | _posts/.Archive/2017-02-24-01.md/2017-02-25 08-33-00.md | Markdown | mit | 800 |
package schemas
import "github.com/graphql-go/graphql"
var userType = graphql.NewObject(graphql.ObjectConfig{
Name: "User",
Fields: graphql.Fields{
"id": &graphql.Field{Type: graphql.String},
"email": &graphql.Field{Type: graphql.String},
"username": &graphql.Field{Type: graphql.String},
"fullName": &graphql.Field{Type: graphql.String},
"gender": &graphql.Field{Type: graphql.String},
"status": &graphql.Field{Type: graphql.String},
"userType": &graphql.Field{Type: graphql.String},
"birthDate": &graphql.Field{Type: graphql.String},
"createdAt": &graphql.Field{Type: graphql.String},
"updatedAt": &graphql.Field{Type: graphql.String},
"address": &graphql.Field{
Type: graphql.NewObject(graphql.ObjectConfig{
Name: "UserAddress",
Fields: graphql.Fields{
"neighborhood": &graphql.Field{Type: graphql.String},
"zipCode": &graphql.Field{Type: graphql.String},
"addressLineOne": &graphql.Field{Type: graphql.String},
"addressLineTwo": &graphql.Field{Type: graphql.String},
"addressType": &graphql.Field{Type: graphql.String},
"number": &graphql.Field{Type: graphql.String},
"city": &graphql.Field{Type: graphql.String},
"state": &graphql.Field{Type: graphql.String},
"country": &graphql.Field{Type: graphql.String},
},
}),
},
},
})
| vsouza/democratic | schemas/user.go | GO | mit | 1,388 |
<?php
namespace Interactive\POIWebAppBundle\Tests\Controller;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
class JobControllerTest extends WebTestCase
{
/*
public function testCompleteScenario()
{
// Create a new client to browse the application
$client = static::createClient();
// Create a new entry in the database
$crawler = $client->request('GET', '/poi_job/');
$this->assertEquals(200, $client->getResponse()->getStatusCode(), "Unexpected HTTP status code for GET /poi_job/");
$crawler = $client->click($crawler->selectLink('Create a new entry')->link());
// Fill in the form and submit it
$form = $crawler->selectButton('Create')->form(array(
'interactive_poiwebappbundle_jobtype[field_name]' => 'Test',
// ... other fields to fill
));
$client->submit($form);
$crawler = $client->followRedirect();
// Check data in the show view
$this->assertGreaterThan(0, $crawler->filter('td:contains("Test")')->count(), 'Missing element td:contains("Test")');
// Edit the entity
$crawler = $client->click($crawler->selectLink('Edit')->link());
$form = $crawler->selectButton('Edit')->form(array(
'interactive_poiwebappbundle_jobtype[field_name]' => 'Foo',
// ... other fields to fill
));
$client->submit($form);
$crawler = $client->followRedirect();
// Check the element contains an attribute with value equals "Foo"
$this->assertGreaterThan(0, $crawler->filter('[value="Foo"]')->count(), 'Missing element [value="Foo"]');
// Delete the entity
$client->submit($crawler->selectButton('Delete')->form());
$crawler = $client->followRedirect();
// Check the entity has been delete on the list
$this->assertNotRegExp('/Foo/', $client->getResponse()->getContent());
}
*/
}
| drandx/POIWebApp | src/Interactive/POIWebAppBundle/Tests/Controller/JobControllerTest.php | PHP | mit | 1,961 |
<?php
namespace FrontCoding\EquasiaBundle\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;
/**
* Dashboard controller.
*
* @Route("/dashboard")
*/
class DashboardController extends Controller
{
/**
* Dashboard.
*
* @Route("/", name="dashboard")
* @Method("GET")
* @Template()
*/
public function indexAction()
{
return array(
);
}
} | harryqin1978/equaisa-tool | src/FrontCoding/EquasiaBundle/Controller/DashboardController.php | PHP | mit | 696 |
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using BrillionCore.Data.Model;
namespace BrillionCore.Migrations
{
[DbContext(typeof(BrillionDbContext))]
[Migration("20160820161353_AccountDetails")]
partial class AccountDetails
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
modelBuilder
.HasAnnotation("ProductVersion", "1.0.0-rtm-21431")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("BrillionCore.Data.Model.AccountLoginInformation", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("EmailAddress")
.IsRequired()
.HasAnnotation("MaxLength", 255);
b.Property<string>("PasswordAlgorithm")
.IsRequired()
.HasAnnotation("MaxLength", 64);
b.Property<byte[]>("PasswordHash")
.IsRequired()
.HasAnnotation("MaxLength", 2147483647);
b.Property<byte[]>("PasswordSalt")
.IsRequired()
.HasAnnotation("MaxLength", 2147483647);
b.Property<Guid>("UserAccountId");
b.HasKey("Id");
b.HasIndex("UserAccountId");
b.ToTable("AccountLoginInformations");
});
modelBuilder.Entity("BrillionCore.Data.Model.AccountRole", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<bool>("Enabled");
b.Property<string>("Name")
.IsRequired()
.HasAnnotation("MaxLength", 25);
b.Property<Guid?>("UserAccountId");
b.HasKey("Id");
b.HasIndex("UserAccountId");
b.ToTable("AccountRoles");
});
modelBuilder.Entity("BrillionCore.Data.Model.UserAccount", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("DisplayName")
.IsRequired()
.HasAnnotation("MaxLength", 24);
b.Property<string>("EmailAddress")
.IsRequired()
.HasAnnotation("MaxLength", 255);
b.HasKey("Id");
b.ToTable("UserAccounts");
});
modelBuilder.Entity("BrillionCore.Data.Model.AccountLoginInformation", b =>
{
b.HasOne("BrillionCore.Data.Model.UserAccount", "UserAccount")
.WithMany()
.HasForeignKey("UserAccountId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("BrillionCore.Data.Model.AccountRole", b =>
{
b.HasOne("BrillionCore.Data.Model.UserAccount")
.WithMany("AccountRoles")
.HasForeignKey("UserAccountId");
});
}
}
}
| willcodeforcoffee/BrillionCore | src/BrillionCore/Migrations/20160820161353_AccountDetails.Designer.cs | C# | mit | 3,596 |
using JsTestAdapter.Helpers;
using JsTestAdapter.Logging;
using JsTestAdapter.TestServerClient;
using Microsoft.VisualStudio.Shell.Interop;
using Microsoft.VisualStudio.TestPlatform.ObjectModel;
using Microsoft.VisualStudio.TestWindow.Extensibility;
using Microsoft.VisualStudio.TestWindow.Extensibility.Model;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using System.Web;
namespace JsTestAdapter.TestAdapter
{
public abstract class TestContainer : TestContainerBase
{
public TestContainer(TestContainerList containers, IVsProject project, string source)
: base(containers.Discoverer, source)
{
Project = project;
ProjectDirectory = project.GetProjectDir();
BaseDirectory = Discoverer.BaseDirectory;
Name = string.Join("/", new[] {
Project.GetProjectName(),
Path.GetDirectoryName(GetRelativePath(Source)).Replace('\\', '/')
}.Where(s => !string.IsNullOrWhiteSpace(s)));
Logger = new TestLogger(Discoverer.Logger, Name);
ServerLogger = CreateServerLogger();
Logger.Debug("Creating TestContainer for {0}", GetRelativePath(Source));
Containers = containers;
SourceSettings = Discoverer.TestSettings.AddSource(Name, Source);
try
{
Init();
}
catch (Exception ex)
{
Validate(false, "Error: " + ex.Message);
Logger.Error(ex, "Could not load tests");
}
FileWatchers = GetFileWatchers().Where(f => f != null).ToList();
if (IsValid)
{
SourceSettingsPersister.Save(Discoverer.TestAdapterInfo.SettingsFileDirectory, SourceSettings);
StartTestServer();
}
if (!IsValid)
{
Logger.Warn(InvalidReason);
}
else
{
Logger.Debug("TestContainer created");
}
}
protected abstract void Init();
protected abstract TestServerLogger CreateServerLogger();
protected abstract JsTestAdapter.TestServerClient.TestServer CreateTestServer();
public IVsProject Project { get; private set; }
public string ProjectDirectory { get; private set; }
public string Name { get; private set; }
public TestContainerList Containers { get; private set; }
public ITestLogger Logger { get; private set; }
public TestServerLogger ServerLogger { get; private set; }
public JsTestAdapter.TestServerClient.TestServer TestServer { get; private set; }
public EventCommand EventCommand { get; private set; }
public TestSourceSettings SourceSettings { get; private set; }
public Task EventsTask { get; private set; }
public int Port { get; private set; }
public string BaseDirectory { get; private set; }
public IEnumerable<FileWatcher> FileWatchers { get; private set; }
public IEnumerable<Guid> Tests { get; private set; }
public virtual bool AutoRun { get { return true; } }
private readonly Validator _validator = new Validator();
public bool IsValid { get { return _validator.IsValid; } }
public string InvalidReason { get { return _validator.InvalidReason; } }
public void Validate(bool isValid, string reasonFmt, params object[] args)
{
_validator.Validate(isValid, reasonFmt, args);
}
public void Validate(bool isValid, string reason = null)
{
_validator.Validate(isValid, reason);
}
public virtual int Priority { get { return Discoverer.TestAdapterInfo.GetContainerPriority(this.Source); } }
public virtual bool HasFile(string file)
{
return PathUtils.PathsEqual(file, Source);
}
public virtual bool IsDuplicate(TestContainer other)
{
if (other != this && this.HasFile(other.Source))
{
return this.Priority > other.Priority;
}
return false;
}
public virtual IEnumerable<string> GetFilesToWatch()
{
yield return Source;
}
private IEnumerable<FileWatcher> GetFileWatchers()
{
return GetFilesToWatch().Select(f => CreateFileWatcher(f)).ToList();
}
private FileWatcher CreateFileWatcher(string file)
{
if (!string.IsNullOrWhiteSpace(file))
{
return CreateFileWatcher(Path.GetDirectoryName(file), Path.GetFileName(file), false);
}
return null;
}
private FileWatcher CreateFileWatcher(string directory, string filter, bool includeSubdirectories)
{
if (Directory.Exists(directory))
{
var watcher = new FileWatcher(directory, filter, includeSubdirectories);
watcher.Changed += FileWatcherChanged;
Logger.Debug(@"Watching {0}", GetRelativePath(watcher.Watching));
return watcher;
}
return null;
}
private void FileWatcherChanged(object sender, FileChangedEventArgs e)
{
Logger.Debug("File {0}: {1}", e.ChangedReason, GetRelativePath(e.File));
switch (e.ChangedReason)
{
case FileChangedReason.Added:
Validate(false, "{0} has been added", GetRelativePath(e.File));
Discoverer.RefreshTestContainers("{0}/{1}", Name, InvalidReason);
Dispose();
break;
case FileChangedReason.Changed:
Validate(false, "{0} has changed", GetRelativePath(e.File));
Discoverer.RefreshTestContainers("{0}/{1}", Name, InvalidReason);
Dispose();
break;
case FileChangedReason.Removed:
Validate(false, "{0} has been removed", GetRelativePath(e.File));
Discoverer.RefreshTestContainers("{0}/{1}", Name, InvalidReason);
Dispose();
break;
}
}
private void StartTestServer()
{
try
{
TestServer = CreateTestServer();
TestServer.OutputReceived += line => ServerLogger.Log(line);
TestServer.ErrorReceived += line => ServerLogger.Error(line);
TestServer.Started += port => OnServerStarted(port);
TestServer.Stopped += (exitCode, ex) => OnServerStopped(exitCode, ex);
TestServer.StartServer(); // No timeout
}
catch (Exception ex)
{
Validate(false, "Could not start {0}: {1}", Discoverer.TestAdapterInfo.Name, ex.Message);
Logger.Error(ex, "Could not start {0}", Discoverer.TestAdapterInfo.Name);
}
}
private void StopTestServer(string reason, bool warn)
{
if (TestServer != null)
{
Validate(false, "Stopping {0}: {1}", Discoverer.TestAdapterInfo.Name, reason);
TestServer.Kill(reason, warn);
}
}
private void OnServerStarted(int port)
{
Logger.Debug("{0} started using port {1}", Discoverer.TestAdapterInfo.Name, port);
TestServer.Attempts = 0;
Port = port;
SourceSettings.Port = port;
EventCommand = new EventCommand(port);
EventsTask = EventCommand.Run(OnServerEvent);
RefreshContainer(string.Format("{0} started for {1}", Discoverer.TestAdapterInfo.Name, Name));
}
private void OnServerStopped(int? exitCode, Exception ex)
{
if (ex != null)
{
Logger.Error(ex, "{0} stopped", Discoverer.TestAdapterInfo.Name);
}
else if (IsValid)
{
Logger.Warn("{0} stopped - exit code: {1}", Discoverer.TestAdapterInfo.Name, exitCode);
if (TestServer.Attempts < 3)
{
Logger.Warn("Restarting {0}", Discoverer.TestAdapterInfo.Name);
Task.Delay(250).ContinueWith(t => StartTestServer());
}
else
{
Validate(false, "Could not start {0} after {1} attempts", Discoverer.TestAdapterInfo.Name, TestServer.Attempts);
Logger.Error(InvalidReason);
RefreshContainer(InvalidReason);
}
}
else
{
Logger.Debug("{0} stopped - exit code: {1}", Discoverer.TestAdapterInfo.Name, exitCode);
}
}
private bool _refreshing = false;
private void RefreshContainer(string reason)
{
_refreshing = true;
TimeStamp = DateTime.Now;
if (IsValid)
{
SourceSettingsPersister.Save(Discoverer.TestAdapterInfo.SettingsFileDirectory, SourceSettings);
}
Discoverer.RefreshTestContainers(reason);
}
private void OnServerEvent(ServerEvent evt)
{
switch (evt.Event)
{
case "Test run start":
RefreshContainer(string.Format("Test run started for {0}", Name));
break;
case "Test run requested":
if (IsValid && _refreshing)
{
_refreshing = false;
Tests = evt.Tests.ToList();
if (AutoRun)
{
Discoverer.RunTests();
}
}
break;
}
}
public string GetRelativePath(string path)
{
return PathUtils.GetRelativePath(Project.GetProjectDir(), path).Replace('\\', '/');
}
public override string ToString()
{
var str = IsValid ? "Valid" : "Invalid";
if (IsValid)
{
if (Port > 0)
{
str += string.Format(" (connected to {0})", Port);
}
else
{
str += " (not connected)";
}
}
else
{
str += " (" + InvalidReason + ")";
}
str += ": " + Source;
return str;
}
#region IDisposable
private bool _disposed = false;
protected override void Dispose(bool disposing)
{
if (_disposed) return;
_disposed = true;
Validate(false, "Disposing");
if (disposing)
{
Logger.Debug("Disposing of TestContainer");
if (FileWatchers != null)
{
foreach (var watcher in FileWatchers)
{
Logger.Debug(@"Stop watching {0}", GetRelativePath(watcher.Watching));
watcher.Dispose();
}
FileWatchers = null;
}
StopTestServer("Disposing", false);
SourceSettingsPersister.DeleteSettingsFile(Discoverer.TestAdapterInfo.SettingsFileDirectory, SourceSettings);
Containers.Remove(this);
Logger.Debug("TestContainer disposed");
}
}
#endregion
}
} | MortenHoustonLudvigsen/JsTestAdapter | JsTestAdapter/TestAdapter/TestContainer.cs | C# | mit | 11,840 |
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* xFrameworkPX_CodeGenerator_Php_Doc Class File
*
* PHP versions 5
*
* @category xFrameworkPX
* @package xFrameworkPX_CodeGenerator_Php
* @author Kazuhiro Kotsutsumi <[email protected]>
* @copyright Copyright (c) 2006-2010 Xenophy.CO.,LTD All rights Reserved.
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @version SVN $Id: Doc.php 1171 2010-01-05 13:58:12Z tamari $
*/
// {{{ xFrameworkPX_CodeGenerator_Php_Doc
/**
* xFrameworkPX_CodeGenerator_Php_Doc Class
*
* @category xFrameworkPX
* @package xFrameworkPX_CodeGenerator_Php
* @author Kazuhiro Kotsutsumi <[email protected]>
* @copyright Copyright (c) 2006-2010 Xenophy.CO.,LTD All rights Reserved.
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @version Release: 3.5.0
* @link http://www.xframeworkpx.com/api/?class=xFrameworkPX_CodeGenerator_Php_Doc
*/
abstract class xFrameworkPX_CodeGenerator_Php_Doc
extends xFrameworkPX_CodeGenerator_Php_Generator
{
// {{{ props
/**
* Short Description
*
* @var string
*/
protected $_shortDesc = '';
/**
* Long Description
*
* @var string
*/
protected $_longDesc = '';
/**
* タグ
*
* @var xFrameworkPX_Util_MixedCollection
*/
protected $_tags;
// }}}
// {{{ __construct
/**
* コンストラクタ
*
*/
public function __construct($conf)
{
// Short Description 設定
if ($conf->key_exists('shortDesc')) {
$this->_shortDesc = (string)$conf->shortDesc;
}
// Long Description 設定
if ($conf->key_exists('longDesc')) {
$this->_longDesc = (string)$conf->longDesc;
}
}
// }}}
// {{{ _getTags
/**
* タグコード取得
*
* @return string Tagコード
*/
abstract protected function _getTags();
// }}}
// {{{ render
/**
* レンダー
*
* @return string DockBlockソースコード
*/
public function render()
{
// DockBlock生成
$doc = '';
$doc .= $this->_getCode('/**');
// Short Description 生成
foreach (explode('\n', $this->_shortDesc) as $line) {
if ($line !== '') {
$doc .= $this->_getCode(sprintf(' * %s', $line));
} else {
$doc .= $this->_getCode(' *');
}
}
$doc .= $this->_getCode(' *');
// Long Description生成
if (!empty($this->_longDesc)) {
foreach (explode('\n', $this->_longDesc) as $line) {
if ($line !== '') {
$doc .= $this->_getCode(sprintf(' * %s', $line));
} else {
$doc .= $this->_getCode(' *');
}
}
$doc .= $this->_getCode(' *');
}
// タグ生成
$doc .= $this->_getTags();
$doc .= $this->_getCode(' */');
return $doc;
}
// }}}
}
// }}}
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* c-hanging-comment-ender-p: nil
* End:
*/
| xenophy/xFrameworkPX | library/xFrameworkPX/CodeGenerator/Php/Doc.php | PHP | mit | 3,287 |
<?php
class Modes_of_payment_model extends CI_Model{
private static $db;
function __construct(){
parent::__construct();
self::$db = get_instance()->db;
}
public static function get(){
$query = self::$db->get('mod_of_payment');
return $query->result();
}
public static function add($data){
self::$db->insert('mod_of_payment', $data);
return self::$db->affected_rows() > 0 ? true : false;
}
public static function edit($id, $data){
self::$db->where('pay_mode_id', $id)->update('mod_of_payment', $data);
return self::$db->affected_rows() > 0 ? true : false;
}
public static function update($data){
self::$db->insert('mod_of_payment', $data);
return self::$db->affected_rows() > 0 ? true : false;
}
} | raegerard/DocProRepo | application/models/Modes_of_payment_model.php | PHP | mit | 879 |
using System;
using System.Collections.Generic;
namespace Utilities.Extensions
{
public static class NumericExtension
{
public static bool ToBool(this int num)
{
return num == 0 ? false : true;
}
public static int ToInt(this bool num)
{
return num ? 0 : 1;
}
public static double ToDouble(this decimal num)
{
return Convert.ToDouble(num);
}
public static bool IsValidMonth(this int num)
{
return num > 0 && num <= 12;
}
public static double ToDouble(this decimal? num)
{
if (num == null)
return 0;
return Convert.ToDouble(num);
}
public static decimal ToDecimal(this double num)
{
return Convert.ToDecimal(num);
}
public static decimal ToPercent(this decimal value, decimal total)
{
return ((total - value)/total)*100;
}
public static IEnumerable<int> ToInts(this bool num)
{
return num == false ? new List<int> {0} : new List<int> {0, 1};
}
}
} | nbouilhol/bouilhol-lib | Utilities/Utilities/Extensions/NumericExtension.cs | C# | mit | 1,184 |
using System;
using System.Diagnostics;
using System.Runtime.Serialization;
using Hammock.Model;
using Newtonsoft.Json;
namespace TweetSharp
{
#if !SILVERLIGHT
[Serializable]
#endif
#if !Smartphone && !NET20
[DataContract]
[DebuggerDisplay("{User.ScreenName}: {Text}")]
#endif
[JsonObject(MemberSerialization.OptIn)]
public class TwitterStatus : PropertyChangedBase,
IComparable<TwitterStatus>,
IEquatable<TwitterStatus>,
ITwitterModel,
ITweetable
{
private DateTime _createdDate;
private long _id;
private string _inReplyToScreenName;
private long? _inReplyToStatusId;
private int? _inReplyToUserId;
private bool _isFavorited;
private bool _isTruncated;
private string _source;
private string _text;
private TwitterUser _user;
private TwitterStatus _retweetedStatus;
private TwitterGeoLocation _location;
private TwitterEntities _entities;
private bool? _isPossiblySensitive;
private TwitterPlace _place;
private int _retweetCount;
#if !Smartphone && !NET20
[DataMember]
#endif
public virtual long Id
{
get { return _id; }
set
{
if (_id == value)
{
return;
}
_id = value;
OnPropertyChanged("Id");
}
}
#if !Smartphone && !NET20
[DataMember]
#endif
public virtual int? InReplyToUserId
{
get { return _inReplyToUserId; }
set
{
if (_inReplyToUserId == value)
{
return;
}
_inReplyToUserId = value;
OnPropertyChanged("InReplyToUserId");
}
}
#if !Smartphone && !NET20
[DataMember]
#endif
public virtual long? InReplyToStatusId
{
get { return _inReplyToStatusId; }
set
{
if (_inReplyToStatusId == value)
{
return;
}
_inReplyToStatusId = value;
OnPropertyChanged("InReplyToStatusId");
}
}
#if !Smartphone && !NET20
[DataMember]
#endif
public virtual string InReplyToScreenName
{
get { return _inReplyToScreenName; }
set
{
if (_inReplyToScreenName == value)
{
return;
}
_inReplyToScreenName = value;
OnPropertyChanged("InReplyToScreenName");
}
}
[JsonProperty("truncated")]
#if !Smartphone && !NET20
[DataMember]
#endif
public virtual bool IsTruncated
{
get { return _isTruncated; }
set
{
if (_isTruncated == value)
{
return;
}
_isTruncated = value;
OnPropertyChanged("IsTruncated");
}
}
[JsonProperty("favorited")]
#if !Smartphone && !NET20
[DataMember]
#endif
public virtual bool IsFavorited
{
get { return _isFavorited; }
set
{
if (_isFavorited == value)
{
return;
}
_isFavorited = value;
OnPropertyChanged("IsFavorited");
}
}
[JsonProperty("retweet_count")]
#if !Smartphone && !NET20
[DataMember]
#endif
public virtual int RetweetCount
{
get
{
return _retweetCount;
}
set
{
if (_retweetCount == value)
{
return;
}
_retweetCount = value;
OnPropertyChanged("RetweetCount");
}
}
#if !Smartphone && !NET20
[DataMember]
#endif
public virtual string Text
{
get { return _text; }
set
{
if (_text == value)
{
return;
}
_text = value;
_textAsHtml = null;
_textDecoded = null;
OnPropertyChanged("Text");
}
}
private string _textAsHtml;
public virtual string TextAsHtml
{
get
{
return (_textAsHtml ?? (_textAsHtml = this.ParseTextWithEntities()));
}
set
{
_textAsHtml = value;
this.OnPropertyChanged("TextAsHtml");
}
}
private string _textDecoded;
public virtual string TextDecoded
{
get
{
if (string.IsNullOrEmpty(Text))
{
return Text;
}
#if !SILVERLIGHT && !WINDOWS_PHONE
return _textDecoded ?? (_textDecoded = System.Compat.Web.HttpUtility.HtmlDecode(Text));
#elif WINDOWS_PHONE
return _textDecoded ?? (_textDecoded = System.Net.HttpUtility.HtmlDecode(Text));
#else
return _textDecoded ?? (_textDecoded = System.Windows.Browser.HttpUtility.HtmlDecode(Text));
#endif
}
set
{
_textDecoded = value;
OnPropertyChanged("TextDecoded");
}
}
public ITweeter Author
{
get { return User; }
}
#if !Smartphone && !NET20
[DataMember]
#endif
public virtual string Source
{
get { return _source; }
set
{
if (_source == value)
{
return;
}
_source = value;
OnPropertyChanged("Source");
}
}
#if !Smartphone && !NET20
[DataMember]
#endif
public virtual TwitterUser User
{
get { return _user; }
set
{
if (_user == value)
{
return;
}
_user = value;
OnPropertyChanged("TwitterUser");
}
}
#if !Smartphone && !NET20
[DataMember]
#endif
public virtual TwitterStatus RetweetedStatus
{
get { return _retweetedStatus; }
set
{
if (_retweetedStatus == value)
{
return;
}
_retweetedStatus = value;
OnPropertyChanged("RetweetedStatus");
}
}
[JsonProperty("created_at")]
#if !Smartphone && !NET20
[DataMember]
#endif
public virtual DateTime CreatedDate
{
get { return _createdDate; }
set
{
if (_createdDate == value)
{
return;
}
_createdDate = value;
OnPropertyChanged("CreatedDate");
}
}
[JsonProperty("geo")]
#if !Smartphone && !NET20
[DataMember]
#endif
public virtual TwitterGeoLocation Location
{
get { return _location; }
set
{
if (_location == value)
{
return;
}
_location = value;
OnPropertyChanged("Location");
}
}
#if !Smartphone && !NET20
[DataMember]
#endif
public virtual TwitterEntities Entities
{
get { return _entities; }
set
{
if (_entities == value)
{
return;
}
_entities = value;
OnPropertyChanged("Entities");
}
}
[JsonProperty("possibly_sensitive")]
#if !Smartphone && !NET20
[DataMember]
#endif
public virtual bool? IsPossiblySensitive
{
get { return _isPossiblySensitive; }
set
{
if (_isPossiblySensitive == value)
{
return;
}
_isPossiblySensitive = value;
OnPropertyChanged("IsPossiblySensitive");
}
}
#if !Smartphone && !NET20
[DataMember]
#endif
public virtual TwitterPlace Place
{
get { return _place; }
set
{
if (_place == value)
{
return;
}
_place = value;
OnPropertyChanged("Place");
}
}
#if !Smartphone && !NET20
[DataMember]
#endif
public virtual string RawSource { get; set; }
#region IComparable<TwitterStatus> Members
public int CompareTo(TwitterStatus other)
{
return other.Id == Id ? 0 : other.Id > Id ? -1 : 1;
}
#endregion
#region IEquatable<TwitterStatus> Members
public bool Equals(TwitterStatus status)
{
if (ReferenceEquals(null, status))
{
return false;
}
if (ReferenceEquals(this, status))
{
return true;
}
return status.Id == Id;
}
#endregion
public override bool Equals(object status)
{
if (ReferenceEquals(null, status))
{
return false;
}
if (ReferenceEquals(this, status))
{
return true;
}
return status.GetType() == typeof (TwitterStatus) && Equals((TwitterStatus) status);
}
public override int GetHashCode()
{
return Id.GetHashCode();
}
public static bool operator ==(TwitterStatus left, TwitterStatus right)
{
return Equals(left, right);
}
public static bool operator !=(TwitterStatus left, TwitterStatus right)
{
return !Equals(left, right);
}
}
} | billyriantono/tweetsharp | src/TweetSharp/TwitterStatus.cs | C# | mit | 10,611 |
The Character Chart is one of the most powerful organizational tools in
openworldcrafter. It is like a mini spreadsheet in your project that keeps track
of statistics about each character. You can access the chart from the bottom of
the project overview.
## Character Sheets
To start adding information to your chart, you will need at least one character.
Go to their Character Sheet tab and enter Edit Mode. Click the Add Property
button, which will bring up a window to enter a new property.

In this window, add a name and a value for the new property. For example, if you
want to record that Mary Sue's favorite color is green, you would type "Favorite
Color" in "Name" and "green" in "value." Remember that every time you use a
property name, it must be spelled and capitalized the same way.
Click "Add" to finish adding the new property. It should now show up in the
character sheet.
## The Character Chart

Each character has a Character Sheet tab that shows all their properties.
However, there is also a Character Chart page near the bottom of your project
overview that collects all your character charts into one place. Characters are
listed as rows sorted in alphabetical order, and properties are listed as
columns sorted by frequency of use.
You can edit any property in the chart, just like in a spreadsheet, in Edit
Mode.
## Color Coding
To color code a value, enter Edit Mode and hover over a cell with the value you
would like to color. Choose a color from the dropdown menu that appears at the
right of the cell. Now that value will be that color anywhere it occurs for that
property. For example, if you had a "Has Magical Powers?" property, you could
color-code "Yes" as green and "No" as red.

| openworldfactory/openworldfactory | docs/userdocs/character_chart.md | Markdown | mit | 1,870 |
# Pathfinding
Pathfinder is a simple pathfinder framework which includes the A* and Dijkstra's algorithm. This framework is easy to integrate within your own application by inheriting the *INode* class onto your map placements.
## Requirements
* Make
* QMake or CMake
* GCC 4.8+
## How to compile:
E.g.
```
cd..
cmake pathfinding
make
```
## Contributions
Many thanks to Keiron
| huwdp/pathfinding | README.md | Markdown | mit | 386 |
######################################################################
# Motor_L298.py
#
# This program control speed and direction of motor DC with L298
# chip
# Run this program with python3. eg: sudo python3 Motor_L298.py
######################################################################
import RPi.GPIO as GPIO
import time
enablePin = 18
inPin1 = 23
inPin2 = 24
GPIO.setmode(GPIO.BCM)
GPIO.setup(enablePin, GPIO.OUT)
GPIO.setup(inPin1, GPIO.OUT)
GPIO.setup(inPin2, GPIO.OUT)
pwm = GPIO.PWM(enablePin, 500)
pwm.start(0)
def Clockwise():
GPIO.output(inPin1, True)
GPIO.output(inPin2, False)
def CounterClockwise():
GPIO.output(inPin1, False)
GPIO.output(inPin2, True)
while True:
cmd = input("command f/r 0..9 e.g. f5: ")
direction = cmd[0]
if (direction == "f"):
Clockwise()
else:
CounterClockwise()
speed = int(cmd[1]) * 10
pwm.ChangeDutyCycle(speed)
| reza-arjmandi/rpi-course | session3/Motor_L298.py | Python | mit | 931 |
# encoding: UTF-8
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# database schema. If you need to create the application database on another
# system, you should be using db:schema:load, not running all the migrations
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20150606131636) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
create_table "series", force: :cascade do |t|
t.string "title"
t.string "photo"
t.string "rating"
t.integer "length"
t.string "years"
t.string "recap"
t.string "category"
t.string "cast"
t.integer "like"
t.integer "dislike"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "category2"
t.string "category3"
t.string "link"
end
create_table "votes", force: :cascade do |t|
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "likes", default: [], array: true
t.integer "dislikes", default: [], array: true
end
end
| WDI-HK-7/findmetv | db/schema.rb | Ruby | mit | 1,656 |
var iNatAPI = angular.module( "iNatAPI", [ ]);
iNatAPI.factory( "shared", [ "$http", "$rootScope", "$filter",
function( $http, $rootScope, $filter ) {
var basicGet = function( url, options ) {
options = options || { };
if( options.cache !== true ) { options.cache = false; }
var config = {
cache: options.cache,
timeout: 20000 // 20 second timeout
};
var apiURL = $( "meta[name='config:inaturalist_api_url']" ).attr( "content" );
if ( apiURL && url.indexOf( apiURL ) >= 0 ) {
var apiToken = $( "meta[name='inaturalist-api-token']" ).attr( "content" );
if ( apiToken ) {
config.headers = {
Authorization: apiToken
}
}
}
return $http.get( url, config ).then(
function( response ) {
return response;
}, function( errorResponse ) {
// Handle error case
}
);
};
var numberWithCommas = function( num ) {
if( !_.isNumber( num ) ) { return num; }
return I18n.toNumber( num, { precision: 0 } );
};
var t = function( k, options ) {
options = options || { };
return I18n.t( k, options );
};
var taxonStatusTitle = function( taxon ) {
if( !taxon.conservation_status ) { return; }
var title = $filter( "capitalize" )( taxon.conservationStatus( ), "title" );
if( taxon.conservation_status && taxon.conservation_status.place ) {
title = t( "status_in_place", {
status: title, place: taxon.conservation_status.place.display_name });
} else {
title = t( "status_globally", { status: title });
}
return title;
};
var taxonMeansTitle = function( taxon ) {
if( !taxon.establishment_means ) { return; }
var title = $filter( "capitalize" )(
t( taxon.establishment_means.establishment_means ), "title" );
if( taxon.establishment_means && taxon.establishment_means.place ) {
title = t( "status_in_place", {
status: $filter( "capitalize" )(
t( taxon.establishment_means.establishment_means, { locale: "en" }), "title" ),
place: taxon.establishment_means.place.display_name });
}
return title;
};
var backgroundIf = function( url ) {
if( url ) {
return { "background-image": "url('" + url + "')" };
}
};
var offsetCenter = function( options, callback ) {
if( !options.map ) { return callback( ); }
var overlay = new google.maps.OverlayView( );
overlay.draw = function( ) { };
overlay.setMap( options.map );
var proj = overlay.getProjection( );
var currentCenter = options.map.getCenter( );
if( !proj ) {
options.attempts = options.attempts || 0;
options.attempts += 1;
if( options.attempts >= 10 ) { return callback( currentCenter ); }
setTimeout( function( ) {
offsetCenter( options, callback );
}, 5);
return;
}
var cPoint = proj.fromLatLngToDivPixel( currentCenter );
cPoint.x = cPoint.x + options.left; // left of center
cPoint.y = cPoint.y + options.up; // north of center
var newCenter = proj.fromDivPixelToLatLng( cPoint );
overlay.setMap( null );
overlay = null;
callback( newCenter );
};
var processPoints = function( geometry, callback, thisArg ) {
if( !geometry ) { return; }
if( geometry instanceof google.maps.LatLng ) {
callback.call( thisArg, geometry );
} else if( geometry instanceof google.maps.Data.Point ) {
callback.call( thisArg, geometry.get( ) );
} else {
geometry.getArray( ).forEach( function( g ) {
processPoints( g, callback, thisArg );
});
}
};
var stringStartsWith = function( str, pattern, position ) {
position = _.isNumber( position ) ? position : 0;
// We use `lastIndexOf` instead of `indexOf` to avoid tying execution
// time to string length when string doesn't start with pattern.
return str.toLowerCase( ).lastIndexOf( pattern.toLowerCase( ), position ) === position;
};
var pp = function( obj ) {
console.log( JSON.stringify( obj, null, " " ) );
};
return {
basicGet: basicGet,
numberWithCommas: numberWithCommas,
t: t,
taxonStatusTitle: taxonStatusTitle,
taxonMeansTitle: taxonMeansTitle,
backgroundIf: backgroundIf,
offsetCenter: offsetCenter,
processPoints: processPoints,
stringStartsWith: stringStartsWith,
pp: pp
}
}]);
// prints a date like "Today 12:34 PM" with some stylable wrapper elements
iNatAPI.directive('inatCalendarDate', ["shared", function(shared) {
return {
scope: {
time: "=",
date: "=",
timezone: "="
},
link: function(scope, elt, attr) {
scope.dateString = function() {
if( !scope.date ) {
return shared.t('unknown');
}
var date = moment(scope.date),
now = moment(new Date()),
dateString;
if (date.isSame(now, 'day')) {
dateString = I18n.t('today');
} else if (date.isSame(now.subtract(1, 'day'), 'day')) {
dateString = I18n.t('yesterday');
} else {
dateString = date.format('ll');
}
return dateString;
}
scope.timeString = function() {
if( !scope.time ) { return; }
scope.timezone = scope.timezone || "UTC";
return moment(scope.time).tz(scope.timezone).format("LT z");
}
},
template: '<span class="date">{{ dateString() }}</span><span class="time">{{ timeString() }}</span>'
}
}]);
// print a taxon with correctly formatted common and scientific names
iNatAPI.directive('inatTaxon', ["shared", function(shared) {
return {
scope: {
taxon: '=',
url: '@'
},
link: function(scope, elt, attr) {
scope.iconicTaxonNameForID = function(iconicTaxonID) {
var t = window.ICONIC_TAXA[iconicTaxonID]
if (t) {
return t.name;
} else {
return 'Unknown'
}
};
scope.shared = shared;
scope.user = CURRENT_USER;
scope.displayName = function() {
var name;
if ( !scope.taxon ) { return; }
if ( scope.user && scope.user.prefers_scientific_name_first ) {
name = scope.taxon.name;
} else if ( scope.taxon.preferred_common_name ) {
name = iNatModels.Taxon.titleCaseName( scope.taxon.preferred_common_name );
}
return name || scope.taxon.name;
}
scope.secondaryName = function() {
var name;
if ( !scope.taxon ) { return; }
if ( scope.user && scope.user.prefers_scientific_name_first ) {
name = iNatModels.Taxon.titleCaseName( scope.taxon.preferred_common_name );
} else if ( scope.taxon.preferred_common_name ) {
name = scope.taxon.name;
}
return name;
}
scope.showRank = function() {
return scope.taxon && scope.taxon.rank_level > 10;
}
},
templateUrl: 'ang/templates/shared/taxon.html'
}
}]);
iNatAPI.directive( "observationSnippet", [ "shared", function( shared ) {
return {
scope: { o: "=" },
link: function( scope ) {
scope.shared = shared;
},
templateUrl: "ang/templates/shared/observation.html"
};
}]);
iNatAPI.directive( "userIcon", [ "shared", function( shared ) {
return {
scope: { u: "=" },
link: function( scope ) {
scope.shared = shared;
},
templateUrl: "ang/templates/shared/user_icon.html"
};
}]);
iNatAPI.directive( "userLogin", [ function( ) {
return {
scope: { u: "=" },
templateUrl: "ang/templates/shared/user_login.html"
};
}]);
| calonso-conabio/inaturalist | app/assets/javascripts/ang/inaturalist_angular.js | JavaScript | mit | 7,569 |
@import url(https://fonts.googleapis.com/css?family=Roboto);
* {
font-family: Roboto, 'sans-serif';
}
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
font-family: Roboto, 'sans-serif';
}
h3 {
font-size: 22px;
}
body {
padding-top: 50px;
background: #fff;
}
a:hover {
text-decoration: none;
}
img {
padding: 5px;
}
.mainbody {
background: #fff;
position: relative;
z-index: 1;
margin-bottom: -25px;
padding-bottom: 20px;
}
.center {
margin-left: auto;
margin-right: auto;
}
.article_link {
color: #000;
}
.article_link:hover {
text-decoration: none;
}
code {
overflow: auto;
word-wrap: normal;
}
.video-container {
position: relative;
padding-bottom: 56.25%;
padding-top: 30px; height: 0; overflow: hidden;
}
.video-container iframe,
.video-container object,
.video-container embed {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
iframe {
overflow-x: hidden;
}
ul .pull-right {
margin-top: 4px;
}
header li a {
font-size: 10pt;
}
header img {
margin-top: 2px;
}
header .fa-rss {
position: absolute !important;
}
.navbar-default .navbar-collapse, .navbar-default .navbar-form {
border-color: #fff;
}
.navbar-brand b {
color: #f2f2f2 !important;
}
.navbar-brand {
color: #fff !important;
font-size: 12pt;
}
.page-header {
margin: 22px 0 21px !important;
}
.thumbnail {margin-bottom:6px;}
.modal-dialog .thumbnail {margin:auto;}
#links img{
padding: 3px;
margin: 3px;
border-radius: 10px;
border: 1px solid #e2e2e2;
}
a.frontlink {
text-decoration: none;
}
a.frontlink:hover {
text-decoration: none;
}
.container, .front{
max-width: 900px;
margin-right: auto;
margin-left: auto;
}
.caret-up {
/* Safari */
-webkit-transform: rotate(-180deg);
/* Firefox */
-moz-transform: rotate(-180deg);
/* IE */
-ms-transform: rotate(-180deg);
/* Opera */
-o-transform: rotate(-180deg);
/* Internet Explorer */
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=6);
}
.dropdown-menu {
padding-top: 0px !important;
padding-bottom: 0px !important;
margin-bottom: 10px;
margin-left: -1px;
border-radius: 2px;
-webkit-transition: all 0.5s ease-in-out;
-moz-transition: all 0.5s ease-in-out;
-ms-transition: all 0.5s ease-in-out;
-o-transition: all 0.5s ease-in-out;
transition: all 0.5s ease-in-out;
box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.26) !important;
}
.drop-up {
top: auto;
bottom: 100% !important;
width: 160px;
}
.drop-up li {
display: inline;
}
footer li:hover .fa {
color: #fff !important;
}
@-moz-document url-prefix() {
.drop-up .fa {
margin-top: -17px;
}
.skills li {
display: inline-block;
}
}
.container.front {
margin-top: -40px;
max-width: 850px;
}
.front p {
font-size: 12pt;
}
.front a small {
text-shadow: none;
}
.frontbomb {
margin-top: -40px;
}
.navbar-toggle {
border: none;
margin-left: 4px !important;
}
.navbar-toggle:hover {
background-color: transparent !important;
}
.navbar-default {
z-index: 2;
border-bottom: solid 2px white;
box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.26);
}
.navbar-default .navbar-nav>li>a {
font-size: 9pt !important;
text-transform: uppercase !important;
}
footer {
background: #fff;
margin-bottom: 0px;
}
footer .btn-primary {
margin-top: -6px;
padding-left: 10px;
padding-right: 10px;
}
footer button {
margin-right: 4px;
}
.bg {
background: url('images/guitarblur.jpg');
opacity: .95;
background-position: center;
background-size: cover;
background-repeat: no-repeat;
position: fixed;
width: 100%;
height: 550px; /*same height as jumbotron */
top:0;
left:0;
z-index: -1;
padding:0px;
}
.jumbotron {
background: transparent;
color: #fff;
text-shadow:1px 1px rgba(0, 0, 0, 0.26);
font-weight: 400;
position: fixed;
width: 100%;
height: 550px;
}
.main {
margin-top: 400px;
background: #fff;
}
.well {
border-radius: 2px;
padding: 15px;
}
.resume-top {
margin-right: 10px;
margin-left: 10px;
}
.resume-social-box {
font-size: 10pt;
}
.resume-social-box a {
color: #000;
}
.resume-social-box a:hover {
text-decoration: none;
color: #007fff;
}
.resume-social-box .fa {
font-size: 16pt;
}
.skills {
display: flex;
flex-wrap: wrap;
}
.skills .btn {
margin: 3px;
padding: 5px;
flex-grow: 1;
min-width: 25%;
}
.skills small {
font-size: 8pt;
}
.row.skills {
padding-left: 5px;
padding-right: 5px;
}
.indent {
margin-left: 20px;
margin-right: 20px;
}
@media screen and (min-width: 500px) {
footer .row {
width: 100%;
}
}
@media screen and (max-width: 480px) {
.main {
margin-top: 460px !important;
}
.front p {
font-size: 11pt !important;
}
.mainbody {
margin-top: -15px !important;
}
}
@media only screen and (max-device-width: 480px) and (orientation: landscape) {
.main {
margin-top: 300px !important;
}
.front p {
font-size: 9pt !important;
}
.jumbotron {
padding: 10px !important;
}
}
@media only screen and (max-device-width: 568px) and (orientation: landscape) {
.main {
margin-top: 300px !important;
}
.front p {
font-size: 9pt !important;
}
.jumbotron {
padding: 10px !important;
}
}
@media screen and (max-width: 767px) {
.navbar-header img {
margin-left: -16px !important;
margin-right: -10px !important;
}
.navbar-default .navbar-nav>li>a {
font-size: 10pt !important;
}
}
@media screen and (min-width: 768px) {
.footerCopyright {
display: inline !important;
}
}
@media screen and (max-width: 370px) {
.main {
margin-top: 480px !important;
}
.jumbotron {
padding: 8px;
}
}
@media screen and (orientation:landscape) {
.main {
margin-top: 300px !important;
}
.jumbotron {
font-size: 10pt !important;
}
}
.btn.btn-primary {
transition: background-color 0.5s ease;
border-radius: 2px;
//border-bottom: solid 2px #005CB8;
box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.26);
text-transform: uppercase;
font-size: 9pt;
}
.btn.btn-success {
transition: background-color 0.5s ease;
border-radius: 2px;
//border-bottom: solid 2px #397F22;
box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.26);
text-transform: uppercase;
font-size: 9pt;
}
.btn.btn-default {
transition: background-color 0.5s ease;
background-color: #252525;
border-radius: 2px;
//border-bottom: solid 2px #000;
box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.26);
text-transform: uppercase;
font-size: 9pt;
}
.btn.btn-danger {
transition: background-color 0.5s ease;
background-color: #cc181e;
border-radius: 2px;
box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.26);
text-transform: uppercase;
font-size: 9pt;
}
.btn:hover, .btn.btn-success:hover, .btn.btn-primary:hover, .btn.btn-warning:hover, .btn.btn-info:hover, .btn.btn-danger:hover, .fab:hover {
box-shadow: 0 8px 17px 0 rgba(0, 0, 0, 0.26) !important;
}
footer .fa.fa-youtube-play {
color: #cc181e !important;
}
.btn.btn-danger:hover {
background-color: #B8161B;
}
.skills>.btn-default {
text-transform: capitalize !important;
}
.btn.btn-info {
transition: background-color 0.5s ease;
border-radius: 2px;
//border-bottom: solid 2px #7A4396;
box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.26);
text-transform: uppercase;
font-size: 9pt;
}
.btn, .btn.btn-success, .btn.btn-primary, .btn.btn-warning, .btn.btn-info, .btn.btn-danger, .fab {
transition: box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s ease;
transition-delay: 0.2s;
box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.26);
}
.btn:active, .fab:active {
box-shadow: 0 8px 17px 0 rgba(0, 0, 0, 0.2);
transition-delay: 0s;
}
.fab:hover {
box-shadow: 0 8px 17px 0 rgba(0, 0, 0, 0.2);
}
.btn.btn-default:hover {
background-color: #000;
}
.pagination {
border-radius: 3px !important;
-webkit-border-radius: 3px !important;
-moz-border-radius: 3px !important;
border-radius: 3px !important;
-webkit-box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.26);
-moz-box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.26);
box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.26);
}
.pagination>li>a:hover {
background-color: #eee !important;
}
.pagination>.active>a {
background-color: #eee !important;
color: #646464 !important;
}
.fab {
position: fixed;
z-index: 1;
bottom: 22px;
right: 14px;
display: inline-block;
width: 56px;
height: 56px;
border-radius: 50%;
color: #fff;
overflow: hidden;
transition: box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
transition-delay: 0.2s;
box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.26);
}
.fab.blue {
background-color: #007fff;
}
.fab.purple {
background-color: #9954bb;
}
.fab.red {
background-color: #cc181e;
}
.fab.green {
/*background-color: #3fb618;*/
background-color: #259b24;
}
.fab.black {
background-color: #252525;
}
.fab.blue:hover {
background-color: #007fff;
}
.fab:active {
box-shadow: 0 8px 17px 0 rgba(0, 0, 0, 0.2);
transition-delay: 0s;
}
.hideme {
visibility: hidden;
opacity: 0;
-webkit-transition: all 0.5s ease-in-out;
-moz-transition: all 0.5s ease-in-out;
-ms-transition: all 0.5s ease-in-out;
-o-transition: all 0.5s ease-in-out;
transition: all 0.5s ease-in-out;
}
.hideme.show {
visibility:visible;
opacity: 1.0;
}
.fab > i.fa.fa-angle-up {
margin-left: 16.5px !important;
}
/*
* Slide-out Menu
*/
#topHeader {
height: 45px;
background: #3F51B5;
}
@media screen and (min-width: 767px) {
#openMenu {
display: none;
}
}
@media only screen and (min-device-width: 320px) and (max-device-width: 568px) {
#sideMenu {
width: 260px !important;
}
}
#sideMenu {
transition: all 0.5s ease;
background: #fff;
width: 300px;
height: 100%;
z-index: 200;
position: fixed;
overflow-y:auto;
top: 0px;
left:-300px;
-webkit-box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.26);
-moz-box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.26);
box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.26);
}
.overlay {
background-color: #000;
bottom: 0;
display: none;
left: 0;
opacity: 0.4;
filter: alpha(opacity = 50); /* IE7 & 8 */
position: fixed;
right: 0;
top: 0;
z-index: 199;
}
#menuHeader {
//background: url(images/menuBack.png);
//background: #536DFE;
background: #222;
background-size: cover;
padding: 5px;
height: 120px;
border-bottom: solid 1px #353535;
margin-bottom: 10px;
}
#titleName {
color: #fff;
position: relative;
margin-top: 60px;
margin-left: 6px;
white-space: nowrap;
}
#openMenu {
border: none;
position: relative;
background: transparent;
margin-left: 5px !important;
margin-right: 15px;
margin-top: 1.5px;
width: 50px;
}
.closeMenu {
border: none;
position: relative;
background: transparent;
font-size: 12pt;
float: right;
top: 0px;
right: 0px;
}
.fa.fa-bars, .fa.fa-times {
color: #fff;
}
#sideMenu a {
color: #353535;
}
#sideMenu a:hover {
text-decoration: none;
}
#sideMenu li {
padding: 15px;
}
#sideMenu li:hover {
background-color: #f0f0f0;
}
#sideMenu a img {
margin-right: 25px !important;
}
.sideActive {
background-color: #f0f0f0 !important;
}
.sideActive a {
color: #007fff !important;
}
#sideMenu ul {
list-style-type: none;
padding:0;
margin:0;
white-space: nowrap;
}
| detonation0/detonation0.github.io | style.css | CSS | mit | 12,092 |
## Chapter 3
### Virtual memory
**_1. The Georgian alphabet has 33 letters. How many bit are needed to specify a letter?_**
6 bits are needed to specify a letter.
**_2. In the UTF-16 character encoding, the binary representation of a character can take up to 32 bits.
Ignoring the details of the encoding scheme, how many different characters can be represented?_**
2^32 characters
**_3. What is the difference between "memory" and "storage" as defined in Think OS?_**
Memory is volatile and storage is not.
**_4. What is the difference between a GiB and a GB? What is the percentage difference in their sizes?_**
A GiB is 2^30 and a GB is 10^9. A GiB is 1.07% larger.
**_5. How does the virtual memory system help isolate processes from each other?_**
Virtual memory is abstracted from programs so they do not need to know a physical location in memory to store variables.
**_6. Why do you think the stack and the heap are usually located at opposite ends of the address space?_**
The stack and heap can grow towards each other without having to move.
**_7. What Python data structure would you use to represent a sparse array?_**
A list.
**_8. What is a context switch?_**
A context switch is when the operating system pauses a program, saves its state, and switches to running a different process.
[aspace.c](aspace.c)
**_In this directory, you should find a subdirectory named `aspace` that contains `aspace.c`. Run it on your computer and compare your results to mine._**
**_1. Add a second call to `malloc` and check whether the heap on your system grows up (toward larger addresses)._**
The heap grows up.
**_2. Add a function that prints the address of a local variable, and check whether the stack grows down._**
The stack grows down.
**_3. Choose a random number between 1 and 32, and allocate two chunks with that size.
How much space is there between them? Hint: Google knows how to subtract hexadecimal numbers._**
The space between them is 32. | cmoser96/ExercisesInC | reading_answers/chapter3.md | Markdown | mit | 1,994 |
import 'babel-polyfill'
import React from 'react'
import { render } from 'react-dom'
import { Provider } from 'react-redux'
import { Router, browserHistory } from 'react-router'
import { syncHistoryWithStore } from 'react-router-redux'
import configureStore from './store/configureStore'
import routes from './routes'
const store = configureStore()
const history = syncHistoryWithStore(browserHistory, store)
render(
<Provider store={store}>
<Router history={history} routes={routes} />
</Provider>,
document.getElementById('app')
)
| dhorelik/my-locations | src/index.js | JavaScript | mit | 556 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>zsearch-trees: 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.15.0 / zsearch-trees - 8.7.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
zsearch-trees
<small>
8.7.0
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-01-17 08:28:11 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-01-17 08:28:11 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 3 Virtual package relying on a GMP lib system installation
coq 8.15.0 Formal proof management system
dune 2.9.1 Fast, portable, and opinionated build system
ocaml 4.05.0 The OCaml compiler (virtual package)
ocaml-base-compiler 4.05.0 Official 4.05.0 release
ocaml-config 1 OCaml Switch Configuration
ocaml-secondary-compiler 4.08.1-1 OCaml 4.08.1 Secondary Switch Compiler
ocamlfind 1.9.1 A library manager for OCaml
ocamlfind-secondary 1.9.1 Adds support for ocaml-secondary-compiler to ocamlfind
zarith 1.12 Implements arithmetic and logical operations over arbitrary-precision integers
# opam file:
opam-version: "2.0"
maintainer: "[email protected]"
homepage: "https://github.com/coq-contribs/zsearch-trees"
license: "LGPL 2.1"
build: [make "-j%{jobs}%"]
install: [make "install"]
remove: ["rm" "-R" "%{lib}%/coq/user-contrib/ZSearchTrees"]
depends: [
"ocaml"
"coq" {>= "8.7" & < "8.8~"}
]
tags: [ "keyword: binary search trees" "category: Computer Science/Data Types and Data Structures" "category: Miscellaneous/Extracted Programs/Data structures" ]
authors: [ "Pierre Castéran" ]
bug-reports: "https://github.com/coq-contribs/zsearch-trees/issues"
dev-repo: "git+https://github.com/coq-contribs/zsearch-trees.git"
synopsis: "Binary Search Trees"
description:
"Algorithms for collecting, searching, inserting and deleting elements in binary search trees on Z"
flags: light-uninstall
url {
src: "https://github.com/coq-contribs/zsearch-trees/archive/v8.7.0.tar.gz"
checksum: "md5=f0d7981cbb1518bc18e851ac351c95a0"
}
</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-zsearch-trees.8.7.0 coq.8.15.0</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.15.0).
The following dependencies couldn't be met:
- coq-zsearch-trees -> coq < 8.8~ -> ocaml < 4.03.0
base of this switch (use `--unlock-base' to force)
Your request can't be satisfied:
- No available version of coq satisfies the constraints
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-zsearch-trees.8.7.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
| coq-bench/coq-bench.github.io | clean/Linux-x86_64-4.05.0-2.0.1/released/8.15.0/zsearch-trees/8.7.0.html | HTML | mit | 7,254 |
version https://git-lfs.github.com/spec/v1
oid sha256:622ea3be3ecdb7c4365efa684dd2814b2b5eda5aca18e62a5086dd1c94b715ff
size 513
| yogeshsaroya/new-cdnjs | ajax/libs/angular-strap/2.1.2/modules/tooltip.tpl.js | JavaScript | mit | 128 |
Subsets and Splits