text
stringlengths 2
1.04M
| meta
dict |
---|---|
package org.apache.struts2.interceptor;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;
import com.opensymphony.xwork2.security.AcceptedPatternsChecker;
import com.opensymphony.xwork2.security.ExcludedPatternsChecker;
import com.opensymphony.xwork2.util.TextParseUtil;
import com.opensymphony.xwork2.util.ValueStack;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
import org.apache.struts2.ServletActionContext;
import javax.servlet.http.Cookie;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;
/**
* <!-- START SNIPPET: description -->
*
* The aim of this intercepter is to set values in the stack/action based on cookie name/value
* of interest. <p/>
*
* If an asterisk is present in cookiesName parameter, it will be assume that
* all cookies name are to be injected into struts' action, even though
* cookiesName is comma-separated by other values, e.g. (cookie1,*,cookie2). <p/>
*
* If cookiesName is left empty it will assume that no cookie will be injected
* into Struts' action. <p/>
*
* If an asterisk is present in cookiesValue parameter, it will assume that all
* cookies name irrespective of its value will be injected into Struts' action so
* long as the cookie name matches those specified in cookiesName parameter.<p/>
*
* If cookiesValue is left empty it will assume that all cookie that match the cookieName
* parameter will be injected into Struts' action.<p/>
*
* The action could implement {@link CookiesAware} in order to have a {@link Map}
* of filtered cookies set into it. <p/>
*
* <!-- END SNIPPET: description -->
*
*
* <!-- START SNIPPET: parameters -->
*
* <ul>
* <li>cookiesName (mandatory) - Name of cookies to be injected into the action. If more
* than one cookie name is desired it could be comma-separated.
* If all cookies name is desired, it could simply be *, an asterik.
* When many cookies name are comma-separated either of the cookie
* that match the name in the comma-separated list will be qualified.</li>
* <li>cookiesValue (mandatory) - Value of cookies that if its name matches cookieName attribute
* and its value matched this, will be injected into Struts'
* action. If more than one cookie name is desired it could be
* comma-separated. If left empty, it will assume any value would
* be ok. If more than one value is specified (comma-separated)
* it will assume a match if either value is matched.</li>
* <li>acceptCookieNames (optional) - Pattern used to check if name of cookie matches the provided patter, to </li>
* </ul>
*
* <!-- END SNIPPET: parameters -->
*
*
* <!-- START SNIPPET: extending -->
*
* <ul>
* <li>
* populateCookieValueIntoStack - this method will decide if this cookie value is qualified
* to be populated into the value stack (hence into the action itself)
* </li>
* <li>
* injectIntoCookiesAwareAction - this method will inject selected cookies (as a java.util.Map)
* into action that implements {@link CookiesAware}.
* </li>
* </ul>
*
* <!-- END SNIPPET: extending -->
*
* <pre>
* <!-- START SNIPPET: example -->
*
* <!--
* This example will inject cookies named either 'cookie1' or 'cookie2' whose
* value could be either 'cookie1value' or 'cookie2value' into Struts' action.
* -->
* <action ... >
* <interceptor-ref name="cookie">
* <param name="cookiesName">cookie1, cookie2</param>
* <param name="cookiesValue">cookie1value, cookie2value</param>
* </interceptor-ref>
* ....
* </action>
*
*
* <!--
* This example will inject cookies named either 'cookie1' or 'cookie2'
* regardless of their value into Struts' action.
* -->
* <action ... >
* <interceptor-ref name="cookie">
* <param name="cookiesName">cookie1, cookie2</param>
* <param name="cookiesValue">*</param>
* <interceptor-ref>
* ...
* </action>
*
*
* <!--
* This example will inject cookies named either 'cookie1' with value
* 'cookie1value' or 'cookie2' with value 'cookie2value' into Struts'
* action.
* -->
* <action ... >
* <interceptor-ref name="cookie">
* <param name="cookiesName">cookie1</param>
* <param name="cookiesValue">cookie1value</param>
* </interceptor-ref>
* <interceptor-ref name="cookie">
* <param name="cookiesName"<cookie2</param>
* <param name="cookiesValue">cookie2value</param>
* </interceptor-ref>
* ....
* </action>
*
* <!--
* This example will inject any cookies regardless of its value into
* Struts' action.
* -->
* <action ... >
* <interceptor-ref name="cookie">
* <param name="cookiesName">*</param>
* <param name="cookiesValue">*</param>
* </interceptor-ref>
* ...
* </action>
*
* <!-- END SNIPPET: example -->
* </pre>
*
* @see CookiesAware
*/
public class CookieInterceptor extends AbstractInterceptor {
private static final long serialVersionUID = 4153142432948747305L;
private static final Logger LOG = LoggerFactory.getLogger(CookieInterceptor.class);
private static final String ACCEPTED_PATTERN = "[a-zA-Z0-9\\.\\]\\[_'\\s]+";
private Set<String> cookiesNameSet = Collections.emptySet();
private Set<String> cookiesValueSet = Collections.emptySet();
private ExcludedPatternsChecker excludedPatternsChecker;
private AcceptedPatternsChecker acceptedPatternsChecker;
@Inject
public void setExcludedPatternsChecker(ExcludedPatternsChecker excludedPatternsChecker) {
this.excludedPatternsChecker = excludedPatternsChecker;
}
@Inject
public void setAcceptedPatternsChecker(AcceptedPatternsChecker acceptedPatternsChecker) {
this.acceptedPatternsChecker = acceptedPatternsChecker;
this.acceptedPatternsChecker.setAcceptedPatterns(ACCEPTED_PATTERN);
}
/**
* Set the <code>cookiesName</code> which if matched will allow the cookie
* to be injected into action, could be comma-separated string.
*
* @param cookiesName
*/
public void setCookiesName(String cookiesName) {
if (cookiesName != null)
this.cookiesNameSet = TextParseUtil.commaDelimitedStringToSet(cookiesName);
}
/**
* Set the <code>cookiesValue</code> which if matched (together with matching
* cookiesName) will caused the cookie to be injected into action, could be
* comma-separated string.
*
* @param cookiesValue
*/
public void setCookiesValue(String cookiesValue) {
if (cookiesValue != null)
this.cookiesValueSet = TextParseUtil.commaDelimitedStringToSet(cookiesValue);
}
/**
* Set the <code>acceptCookieNames</code> pattern of allowed names of cookies
* to protect against remote command execution vulnerability.
*
* @param commaDelimitedPattern is used to check cookie name against, can set of comma delimited patterns
*/
public void setAcceptCookieNames(String commaDelimitedPattern) {
acceptedPatternsChecker.setAcceptedPatterns(commaDelimitedPattern);
}
public String intercept(ActionInvocation invocation) throws Exception {
if (LOG.isDebugEnabled()) {
LOG.debug("start interception");
}
// contains selected cookies
final Map<String, String> cookiesMap = new LinkedHashMap<String, String>();
Cookie[] cookies = ServletActionContext.getRequest().getCookies();
if (cookies != null) {
final ValueStack stack = ActionContext.getContext().getValueStack();
for (Cookie cookie : cookies) {
String name = cookie.getName();
String value = cookie.getValue();
if (isAcceptableName(name) && isAcceptableValue(value)) {
if (cookiesNameSet.contains("*")) {
if (LOG.isDebugEnabled()) {
LOG.debug("contains cookie name [*] in configured cookies name set, cookie with name [" + name + "] with value [" + value + "] will be injected");
}
populateCookieValueIntoStack(name, value, cookiesMap, stack);
} else if (cookiesNameSet.contains(cookie.getName())) {
populateCookieValueIntoStack(name, value, cookiesMap, stack);
}
} else {
LOG.warn("Cookie name [#0] with value [#1] was rejected!", name, value);
}
}
}
// inject the cookiesMap, even if we don't have any cookies
injectIntoCookiesAwareAction(invocation.getAction(), cookiesMap);
return invocation.invoke();
}
/**
* Checks if value of Cookie doesn't contain vulnerable code
*
* @param value of Cookie
* @return true|false
*/
protected boolean isAcceptableValue(String value) {
return !isExcluded(value) && isAccepted(value);
}
/**
* Checks if name of Cookie doesn't contain vulnerable code
*
* @param name of Cookie
* @return true|false
*/
protected boolean isAcceptableName(String name) {
return !isExcluded(name) && isAccepted(name);
}
/**
* Checks if name/value of Cookie is acceptable
*
* @param name of Cookie
* @return true|false
*/
protected boolean isAccepted(String name) {
AcceptedPatternsChecker.IsAccepted accepted = acceptedPatternsChecker.isAccepted(name);
if (accepted.isAccepted()) {
if (LOG.isTraceEnabled()) {
LOG.trace("Cookie [#0] matches acceptedPattern [#1]", name, accepted.getAcceptedPattern());
}
return true;
}
if (LOG.isTraceEnabled()) {
LOG.trace("Cookie [#0] doesn't match acceptedPattern [#1]", name, accepted.getAcceptedPattern());
}
return false;
}
/**
* Checks if name/value of Cookie is excluded
*
* @param name of Cookie
* @return true|false
*/
protected boolean isExcluded(String name) {
ExcludedPatternsChecker.IsExcluded excluded = excludedPatternsChecker.isExcluded(name);
if (excluded.isExcluded()) {
if (LOG.isTraceEnabled()) {
LOG.trace("Cookie [#0] matches excludedPattern [#1]", name, excluded.getExcludedPattern());
}
return true;
}
if (LOG.isTraceEnabled()) {
LOG.trace("Cookie [#0] doesn't match excludedPattern [#1]", name, excluded.getExcludedPattern());
}
return false;
}
/**
* Hook that populate cookie value into value stack (hence the action)
* if the criteria is satisfied (if the cookie value matches with those configured).
*
* @param cookieName
* @param cookieValue
* @param cookiesMap
* @param stack
*/
protected void populateCookieValueIntoStack(String cookieName, String cookieValue, Map<String, String> cookiesMap, ValueStack stack) {
if (cookiesValueSet.isEmpty() || cookiesValueSet.contains("*")) {
// If the interceptor is configured to accept any cookie value
// OR
// no cookiesValue is defined, so as long as the cookie name match
// we'll inject it into Struts' action
if (LOG.isDebugEnabled()) {
if (cookiesValueSet.isEmpty())
LOG.debug("no cookie value is configured, cookie with name ["+cookieName+"] with value ["+cookieValue+"] will be injected");
else if (cookiesValueSet.contains("*"))
LOG.debug("interceptor is configured to accept any value, cookie with name ["+cookieName+"] with value ["+cookieValue+"] will be injected");
}
cookiesMap.put(cookieName, cookieValue);
stack.setValue(cookieName, cookieValue);
}
else {
// if cookiesValues is specified, the cookie's value must match before we
// inject them into Struts' action
if (cookiesValueSet.contains(cookieValue)) {
if (LOG.isDebugEnabled()) {
LOG.debug("both configured cookie name and value matched, cookie ["+cookieName+"] with value ["+cookieValue+"] will be injected");
}
cookiesMap.put(cookieName, cookieValue);
stack.setValue(cookieName, cookieValue);
}
}
}
/**
* Hook that set the <code>cookiesMap</code> into action that implements
* {@link CookiesAware}.
*
* @param action
* @param cookiesMap
*/
protected void injectIntoCookiesAwareAction(Object action, Map<String, String> cookiesMap) {
if (action instanceof CookiesAware) {
if (LOG.isDebugEnabled()) {
LOG.debug("action ["+action+"] implements CookiesAware, injecting cookies map ["+cookiesMap+"]");
}
((CookiesAware)action).setCookiesMap(cookiesMap);
}
}
}
| {
"content_hash": "6746230257ae41f8ef80003e7b7c7bab",
"timestamp": "",
"source": "github",
"line_count": 355,
"max_line_length": 174,
"avg_line_length": 39.61408450704225,
"alnum_prop": 0.6204223849818673,
"repo_name": "TheTypoMaster/struts-2.3.24",
"id": "06c4c30ed79755cb8dc44660c60c4cbd58129087",
"size": "14880",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/core/src/main/java/org/apache/struts2/interceptor/CookieInterceptor.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ActionScript",
"bytes": "22970"
},
{
"name": "CSS",
"bytes": "73781"
},
{
"name": "HTML",
"bytes": "1055902"
},
{
"name": "Java",
"bytes": "10166736"
},
{
"name": "JavaScript",
"bytes": "3966249"
},
{
"name": "XSLT",
"bytes": "8112"
}
],
"symlink_target": ""
} |
package apple.systemconfiguration.enums;
import org.moe.natj.general.ann.Generated;
/**
* [@enum] SCPreferencesNotification
* <p>
* Used with the SCPreferencesCallBack callback
* to describe the type of notification.
* [@constant] kSCPreferencesNotificationCommit Indicates when new
* preferences have been saved.
* [@constant] kSCPreferencesNotificationApply Key Indicates when a
* request has been made to apply the currently saved
* preferences to the active system configuration.
*/
@Generated
public final class SCPreferencesNotification {
@Generated
private SCPreferencesNotification() {
}
}
| {
"content_hash": "7dd386ecc4310df024b7b57e728c94b4",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 67,
"avg_line_length": 27.130434782608695,
"alnum_prop": 0.7724358974358975,
"repo_name": "multi-os-engine/moe-core",
"id": "0a26df6566ca70abd0fe5c55768410ae15c102ec",
"size": "1192",
"binary": false,
"copies": "1",
"ref": "refs/heads/moe-master",
"path": "moe.apple/moe.platform.ios/src/main/java/apple/systemconfiguration/enums/SCPreferencesNotification.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "892337"
},
{
"name": "C++",
"bytes": "155476"
},
{
"name": "HTML",
"bytes": "42061"
},
{
"name": "Java",
"bytes": "46670080"
},
{
"name": "Objective-C",
"bytes": "94699"
},
{
"name": "Objective-C++",
"bytes": "9128"
},
{
"name": "Perl",
"bytes": "35206"
},
{
"name": "Python",
"bytes": "15418"
},
{
"name": "Shell",
"bytes": "10932"
}
],
"symlink_target": ""
} |
using System;
using NUnit.Framework;
using Qi4CS.Core.API.Model;
using Qi4CS.Core.Bootstrap.Assembling;
namespace Qi4CS.Tests.Core.Instance.Composite
{
[Serializable]
[Category( "Qi4CS.Core" )]
public class PrivateCompositeTest : AbstractSingletonInstanceTest
{
private static Boolean _privateMethodInvoked = false;
protected override void Assemble( Qi4CS.Core.Bootstrap.Assembling.Assembler assembler )
{
assembler
.NewPlainComposite()
.OfTypes( typeof( PublicComposite ) )
.WithMixins( typeof( PublicCompositeMixin ), typeof( PrivateCompositeMixin ) );
}
[Test]
public void TestPrivateCompositeTypeResolving()
{
this.PerformTestInAppDomain( () =>
{
PublicComposite composite = this.NewPlainComposite<PublicComposite>();
Assert.IsInstanceOf<PrivateCompositeSub>( composite.Private );
_privateMethodInvoked = false;
( (PrivateCompositeSub) composite.Private ).SubMethod();
Assert.IsTrue( _privateMethodInvoked );
} );
}
public interface PublicComposite
{
PrivateComposite Private { get; }
}
public interface PrivateComposite
{
}
public interface PrivateCompositeSub : PrivateComposite
{
void SubMethod();
}
public class PublicCompositeMixin : PublicComposite
{
#pragma warning disable 649
[This]
private PrivateComposite _private;
#pragma warning restore 649
#region PublicComposite Members
public virtual PrivateComposite Private
{
get
{
return this._private;
}
}
#endregion
}
public class PrivateCompositeMixin : PrivateCompositeSub
{
#region PrivateCompositeSub Members
public virtual void SubMethod()
{
_privateMethodInvoked = true;
}
#endregion
}
}
}
| {
"content_hash": "cdd22d971134232a4b786800e186a2cc",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 93,
"avg_line_length": 24.306818181818183,
"alnum_prop": 0.5839177185600748,
"repo_name": "CometaSolutions/Qi4CS",
"id": "889a0aa71c9f4c1a08699382e7d6718f9be2eb41",
"size": "2800",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "Source/Qi4CS.Tests/Core/Instance/Composite/PrivateCompositeTest.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C#",
"bytes": "2307526"
}
],
"symlink_target": ""
} |
/* @group Base */
.chosen-container {
position: relative;
display: inline-block;
vertical-align: middle;
font-size: 13px;
zoom: 1;
*display: inline;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}
.chosen-container * {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.chosen-container .chosen-drop {
position: absolute;
top: 100%;
left: -9999px;
z-index: 1010;
width: 100%;
border: 1px solid #aaa;
border-top: 0;
background: #fff;
box-shadow: 0 4px 5px rgba(0, 0, 0, 0.15);
}
.chosen-container.chosen-with-drop .chosen-drop {
left: 0;
}
.chosen-container a {
cursor: pointer;
}
.chosen-container .search-choice .group-name, .chosen-container .chosen-single .group-name {
margin-right: 4px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
font-weight: normal;
color: #999999;
}
.chosen-container .search-choice .group-name:after, .chosen-container .chosen-single .group-name:after {
content: ":";
padding-left: 2px;
vertical-align: top;
}
/* @end */
/* @group Single Chosen */
.chosen-container-single .chosen-single {
position: relative;
display: block;
overflow: hidden;
padding: 0 0 0 8px;
height: 25px;
border: 1px solid #aaa;
border-radius: 5px;
background-color: #fff;
background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #ffffff), color-stop(50%, #f6f6f6), color-stop(52%, #eeeeee), color-stop(100%, #f4f4f4));
background: -webkit-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
background: -moz-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
background: -o-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
background: linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
background-clip: padding-box;
box-shadow: 0 0 3px white inset, 0 1px 1px rgba(0, 0, 0, 0.1);
color: #444;
text-decoration: none;
white-space: nowrap;
line-height: 24px;
}
.chosen-container-single .chosen-default {
color: #999;
}
.chosen-container-single .chosen-single span {
display: block;
overflow: hidden;
margin-right: 26px;
text-overflow: ellipsis;
white-space: nowrap;
}
.chosen-container-single .chosen-single-with-deselect span {
margin-right: 38px;
}
.chosen-container-single .chosen-single abbr {
position: absolute;
top: 6px;
right: 26px;
display: block;
width: 12px;
height: 12px;
background: url('../uploads/images/chosen-sprite.png') -42px 1px no-repeat;
font-size: 1px;
}
.chosen-container-single .chosen-single abbr:hover {
background-position: -42px -10px;
}
.chosen-container-single.chosen-disabled .chosen-single abbr:hover {
background-position: -42px -10px;
}
.chosen-container-single .chosen-single div {
position: absolute;
top: 0;
right: 0;
display: block;
width: 18px;
height: 100%;
}
.chosen-container-single .chosen-single div b {
display: block;
width: 100%;
height: 100%;
background: url('../uploads/images/chosen-sprite.png') no-repeat 0px 2px;
}
.chosen-container-single .chosen-search {
position: relative;
z-index: 1010;
margin: 0;
padding: 3px 4px;
white-space: nowrap;
}
.chosen-container-single .chosen-search input[type="text"] {
margin: 1px 0;
padding: 4px 20px 4px 5px;
width: 100%;
height: auto;
outline: 0;
border: 1px solid #aaa;
background: white url('chosen-sprite.png') no-repeat 100% -20px;
background: url('../uploads/images/chosen-sprite.png') no-repeat 100% -20px;
font-size: 1em;
font-family: sans-serif;
line-height: normal;
border-radius: 0;
}
.chosen-container-single .chosen-drop {
margin-top: -1px;
border-radius: 0 0 4px 4px;
background-clip: padding-box;
}
.chosen-container-single.chosen-container-single-nosearch .chosen-search {
position: absolute;
left: -9999px;
}
/* @end */
/* @group Results */
.chosen-container .chosen-results {
color: #444;
position: relative;
overflow-x: hidden;
overflow-y: auto;
margin: 0 4px 4px 0;
padding: 0 0 0 4px;
max-height: 240px;
-webkit-overflow-scrolling: touch;
}
.chosen-container .chosen-results li {
display: none;
margin: 0;
padding: 5px 6px;
list-style: none;
line-height: 15px;
word-wrap: break-word;
-webkit-touch-callout: none;
}
.chosen-container .chosen-results li.active-result {
display: list-item;
cursor: pointer;
}
.chosen-container .chosen-results li.disabled-result {
display: list-item;
color: #ccc;
cursor: default;
}
.chosen-container .chosen-results li.highlighted {
background-color: #3875d7;
background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #3875d7), color-stop(90%, #2a62bc));
background-image: -webkit-linear-gradient(#3875d7 20%, #2a62bc 90%);
background-image: -moz-linear-gradient(#3875d7 20%, #2a62bc 90%);
background-image: -o-linear-gradient(#3875d7 20%, #2a62bc 90%);
background-image: linear-gradient(#3875d7 20%, #2a62bc 90%);
color: #fff;
}
.chosen-container .chosen-results li.no-results {
color: #777;
display: list-item;
background: #f4f4f4;
}
.chosen-container .chosen-results li.group-result {
display: list-item;
font-weight: bold;
cursor: default;
}
.chosen-container .chosen-results li.group-option {
padding-left: 15px;
}
.chosen-container .chosen-results li em {
font-style: normal;
text-decoration: underline;
}
/* @end */
/* @group Multi Chosen */
.chosen-container-multi .chosen-choices {
position: relative;
overflow: hidden;
margin: 0;
padding: 0 5px;
width: 100%;
height: auto !important;
height: 1%;
border: 1px solid #aaa;
background-color: #fff;
background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff));
background-image: -webkit-linear-gradient(#eeeeee 1%, #ffffff 15%);
background-image: -moz-linear-gradient(#eeeeee 1%, #ffffff 15%);
background-image: -o-linear-gradient(#eeeeee 1%, #ffffff 15%);
background-image: linear-gradient(#eeeeee 1%, #ffffff 15%);
cursor: text;
}
.chosen-container-multi .chosen-choices li {
float: left;
list-style: none;
}
.chosen-container-multi .chosen-choices li.search-field {
margin: 0;
padding: 0;
white-space: nowrap;
}
.chosen-container-multi .chosen-choices li.search-field input[type="text"] {
margin: 1px 0;
padding: 0;
height: 25px;
outline: 0;
border: 0 !important;
background: transparent !important;
box-shadow: none;
color: #999;
font-size: 100%;
font-family: sans-serif;
line-height: normal;
border-radius: 0;
}
.chosen-container-multi .chosen-choices li.search-choice {
position: relative;
margin: 3px 5px 3px 0;
padding: 3px 20px 3px 5px;
border: 1px solid #aaa;
max-width: 100%;
border-radius: 3px;
background-color: #eeeeee;
background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee));
background-image: -webkit-linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
background-image: -moz-linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
background-image: -o-linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
background-image: linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
background-size: 100% 19px;
background-repeat: repeat-x;
background-clip: padding-box;
box-shadow: 0 0 2px white inset, 0 1px 0 rgba(0, 0, 0, 0.05);
color: #333;
line-height: 13px;
cursor: default;
}
.chosen-container-multi .chosen-choices li.search-choice span {
word-wrap: break-word;
}
.chosen-container-multi .chosen-choices li.search-choice .search-choice-close {
position: absolute;
top: 4px;
right: 3px;
display: block;
width: 12px;
height: 12px;
background: url('../uploads/images/chosen-sprite.png') -42px 1px no-repeat;
font-size: 1px;
}
.chosen-container-multi .chosen-choices li.search-choice .search-choice-close:hover {
background-position: -42px -10px;
}
.chosen-container-multi .chosen-choices li.search-choice-disabled {
padding-right: 5px;
border: 1px solid #ccc;
background-color: #e4e4e4;
background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee));
background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
background-image: -o-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
background-image: linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
color: #666;
}
.chosen-container-multi .chosen-choices li.search-choice-focus {
background: #d4d4d4;
}
.chosen-container-multi .chosen-choices li.search-choice-focus .search-choice-close {
background-position: -42px -10px;
}
.chosen-container-multi .chosen-results {
margin: 0;
padding: 0;
}
.chosen-container-multi .chosen-drop .result-selected {
display: list-item;
color: #ccc;
cursor: default;
}
/* @end */
/* @group Active */
.chosen-container-active .chosen-single {
border: 1px solid #5897fb;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}
.chosen-container-active.chosen-with-drop .chosen-single {
border: 1px solid #aaa;
-moz-border-radius-bottomright: 0;
border-bottom-right-radius: 0;
-moz-border-radius-bottomleft: 0;
border-bottom-left-radius: 0;
background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #eeeeee), color-stop(80%, #ffffff));
background-image: -webkit-linear-gradient(#eeeeee 20%, #ffffff 80%);
background-image: -moz-linear-gradient(#eeeeee 20%, #ffffff 80%);
background-image: -o-linear-gradient(#eeeeee 20%, #ffffff 80%);
background-image: linear-gradient(#eeeeee 20%, #ffffff 80%);
box-shadow: 0 1px 0 #fff inset;
}
.chosen-container-active.chosen-with-drop .chosen-single div {
border-left: none;
background: transparent;
}
.chosen-container-active.chosen-with-drop .chosen-single div b {
background-position: -18px 2px;
}
.chosen-container-active .chosen-choices {
border: 1px solid #5897fb;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}
.chosen-container-active .chosen-choices li.search-field input[type="text"] {
color: #222 !important;
}
/* @end */
/* @group Disabled Support */
.chosen-disabled {
opacity: 0.5 !important;
cursor: default;
}
.chosen-disabled .chosen-single {
cursor: default;
}
.chosen-disabled .chosen-choices .search-choice .search-choice-close {
cursor: default;
}
/* @end */
/* @group Right to Left */
.chosen-rtl {
text-align: right;
}
.chosen-rtl .chosen-single {
overflow: visible;
padding: 0 8px 0 0;
}
.chosen-rtl .chosen-single span {
margin-right: 0;
margin-left: 26px;
direction: rtl;
}
.chosen-rtl .chosen-single-with-deselect span {
margin-left: 38px;
}
.chosen-rtl .chosen-single div {
right: auto;
left: 3px;
}
.chosen-rtl .chosen-single abbr {
right: auto;
left: 26px;
}
.chosen-rtl .chosen-choices li {
float: right;
}
.chosen-rtl .chosen-choices li.search-field input[type="text"] {
direction: rtl;
}
.chosen-rtl .chosen-choices li.search-choice {
margin: 3px 5px 3px 0;
padding: 3px 5px 3px 19px;
}
.chosen-rtl .chosen-choices li.search-choice .search-choice-close {
right: auto;
left: 4px;
}
.chosen-rtl.chosen-container-single-nosearch .chosen-search,
.chosen-rtl .chosen-drop {
left: 9999px;
}
.chosen-rtl.chosen-container-single .chosen-results {
margin: 0 0 4px 4px;
padding: 0 4px 0 0;
}
.chosen-rtl .chosen-results li.group-option {
padding-right: 15px;
padding-left: 0;
}
.chosen-rtl.chosen-container-active.chosen-with-drop .chosen-single div {
border-right: none;
}
.chosen-rtl .chosen-search input[type="text"] {
padding: 4px 5px 4px 20px;
background: white url('../uploads/images/chosen-sprite.png') no-repeat -30px -20px;
background: url('../uploads/images/chosen-sprite.png') no-repeat -30px -20px;
direction: rtl;
}
.chosen-rtl.chosen-container-single .chosen-single div b {
background-position: 6px 2px;
}
.chosen-rtl.chosen-container-single.chosen-with-drop .chosen-single div b {
background-position: -12px 2px;
}
/* @end */
/* @group Retina compatibility */
@media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-resolution: 144dpi), only screen and (min-resolution: 1.5dppx) {
.chosen-rtl .chosen-search input[type="text"],
.chosen-container-single .chosen-single abbr,
.chosen-container-single .chosen-single div b,
.chosen-container-single .chosen-search input[type="text"],
.chosen-container-multi .chosen-choices .search-choice .search-choice-close,
.chosen-container .chosen-results-scroll-down span,
.chosen-container .chosen-results-scroll-up span {
background-image: url('../uploads/images/[email protected]') !important;
background-size: 52px 37px !important;
background-repeat: no-repeat !important;
}
}
/* @end */
| {
"content_hash": "0547f7065820e00c514d5455a81cbe43",
"timestamp": "",
"source": "github",
"line_count": 440,
"max_line_length": 168,
"avg_line_length": 29.818181818181817,
"alnum_prop": 0.6934451219512195,
"repo_name": "artemkramov/jenadin-test",
"id": "94e7554dd8873bb855dd14f91f77f2389a636003",
"size": "13492",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "backend/web/css/chosen.css",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "ActionScript",
"bytes": "97871"
},
{
"name": "Batchfile",
"bytes": "7198"
},
{
"name": "CSS",
"bytes": "1000770"
},
{
"name": "HTML",
"bytes": "1158107"
},
{
"name": "Java",
"bytes": "305368"
},
{
"name": "JavaScript",
"bytes": "2597149"
},
{
"name": "Makefile",
"bytes": "5575"
},
{
"name": "PHP",
"bytes": "9139957"
},
{
"name": "Python",
"bytes": "16043"
},
{
"name": "Roff",
"bytes": "251"
},
{
"name": "Shell",
"bytes": "6632"
}
],
"symlink_target": ""
} |
/***************************************************//**
* @file OOI2KSpectrumExchange.h
* @date February 2009
* @author Ocean Optics, Inc.
*
* This is a protocol exchange that can be used for the
* HR2000 (as well as some other early OOI spectrometers).
*
* LICENSE:
*
* SeaBreeze Copyright (C) 2014, Ocean Optics Inc
*
* 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 SEABREEZE_OOI2KSPECTRUMEXCHANGE_H
#define SEABREEZE_OOI2KSPECTRUMEXCHANGE_H
#include "vendors/OceanOptics/protocols/ooi/exchanges/ReadSpectrumExchange.h"
#include "common/Data.h"
namespace seabreeze {
namespace ooiProtocol {
class OOI2KSpectrumExchange : public ReadSpectrumExchange {
public:
OOI2KSpectrumExchange(unsigned int readoutLength, unsigned int numberOfPixels);
virtual ~OOI2KSpectrumExchange();
/* Inherited */
virtual Data *transfer(TransferHelper *helper);
};
}
}
#endif
| {
"content_hash": "0b3fb52045d322f1e8d50dac5e37aca2",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 87,
"avg_line_length": 38.80769230769231,
"alnum_prop": 0.7056491575817642,
"repo_name": "ap--/python-seabreeze",
"id": "3a98ef31f06c19d3bdc11bbacb4cf230c4b99b8f",
"size": "2018",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/libseabreeze/include/vendors/OceanOptics/protocols/ooi/exchanges/OOI2KSpectrumExchange.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "139445"
},
{
"name": "C++",
"bytes": "792990"
},
{
"name": "Cython",
"bytes": "167272"
},
{
"name": "Python",
"bytes": "220055"
}
],
"symlink_target": ""
} |
window.google = {
maps: {
Animation: { BOUNCE: true, DROP: false },
event: { addListener: function() {} },
LatLng: function() {},
LatLngBounds: function() {},
Map: function() {},
Marker: function() {},
OverlayView: function() {},
Size: function() {},
ControlPosition: function() {}
},
visualization: {
DataTable: function() {},
AreaChart: function() {},
DateFormat: function() {}
}
};
| {
"content_hash": "081a90430cd3ab4bf5f013f9420faba9",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 45,
"avg_line_length": 24.5,
"alnum_prop": 0.5578231292517006,
"repo_name": "charitywater/dispatch-monitor",
"id": "afb0b73541be3611d4360267bd28c3dbe7ae78e5",
"size": "441",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "spec/javascripts/support/google.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "102823"
},
{
"name": "CoffeeScript",
"bytes": "211"
},
{
"name": "JavaScript",
"bytes": "66853"
},
{
"name": "Ruby",
"bytes": "769171"
},
{
"name": "Shell",
"bytes": "1277"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_45) on Thu Nov 13 21:22:01 UTC 2014 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
Uses of Class org.apache.hadoop.service.LoggingStateChangeListener (Apache Hadoop Main 2.6.0 API)
</TITLE>
<META NAME="date" CONTENT="2014-11-13">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class org.apache.hadoop.service.LoggingStateChangeListener (Apache Hadoop Main 2.6.0 API)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../org/apache/hadoop/service/LoggingStateChangeListener.html" title="class in org.apache.hadoop.service"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV
NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html?org/apache/hadoop/service//class-useLoggingStateChangeListener.html" target="_top"><B>FRAMES</B></A>
<A HREF="LoggingStateChangeListener.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<CENTER>
<H2>
<B>Uses of Class<br>org.apache.hadoop.service.LoggingStateChangeListener</B></H2>
</CENTER>
No usage of org.apache.hadoop.service.LoggingStateChangeListener
<P>
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../org/apache/hadoop/service/LoggingStateChangeListener.html" title="class in org.apache.hadoop.service"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV
NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html?org/apache/hadoop/service//class-useLoggingStateChangeListener.html" target="_top"><B>FRAMES</B></A>
<A HREF="LoggingStateChangeListener.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
Copyright © 2014 <a href="http://www.apache.org">Apache Software Foundation</a>. All Rights Reserved.
</BODY>
</HTML>
| {
"content_hash": "5efdbe625f846e6effb1a80035326297",
"timestamp": "",
"source": "github",
"line_count": 145,
"max_line_length": 234,
"avg_line_length": 43.310344827586206,
"alnum_prop": 0.6273885350318471,
"repo_name": "SAT-Hadoop/hadoop-2.6.0",
"id": "256c1d6bd947c5caf2c2c07d019683129d4b6f24",
"size": "6280",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "share/doc/hadoop/api/org/apache/hadoop/service/class-use/LoggingStateChangeListener.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "119024"
},
{
"name": "C",
"bytes": "29572"
},
{
"name": "C++",
"bytes": "16604"
},
{
"name": "CSS",
"bytes": "452213"
},
{
"name": "HTML",
"bytes": "72854691"
},
{
"name": "JavaScript",
"bytes": "18210"
},
{
"name": "Shell",
"bytes": "203634"
},
{
"name": "XSLT",
"bytes": "20437"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
{% include head.html %}
<body>
<div id="preloader" class="preloader">
<div class="loader-gplus"></div>
</div>
<div id="st-container" class="st-container disable-scrolling">
<div class="st-pusher">
<div class="st-content">
{{ content }}
{% include footer.html %}
</div>
</div>
</div>
{% if page.permalink == '/team/' %}
{% include team-modals.html %}
{% endif %}
{% include analytics.html %}
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script>
window.jQuery || document.write('<script src="{{ "/js/jquery-2.1.1.min.js" | prepend: site.baseurl }}><\/script>')
</script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script>
if (typeof($.fn.modal) === 'undefined') {
document.write('<script src="{{ "/js/bootstrap.min.js" | prepend: site.baseurl }}><\/script>')
}
</script>
<script src="{{ "/js/default.js" | prepend: site.baseurl }}"></script>
{% if page.permalink == '/' or page.permalink == '/hackathon/' %}
<script>
if ($(window).width() > 767) {
document.write('<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"><\/script>')
}
</script>
{% elsif page.permalink == '/logistics/' %}
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&libraries=places,geometry"></script>
{% endif %}
<script>
Waves.displayEffect();
{% if page.permalink == '/' %}
if ($(window).width() > 767) {
var googleMaps = 'index',
eventPlace = new google.maps.LatLng({{ site.eventPlaceCoordinates | replace:' ','' }}),
centerMap = new google.maps.LatLng({{ site.mapCenterCoordinates | replace:' ','' }}),
mobileCenterMap = new google.maps.LatLng({{ site.mapMobileCenterCoordinates | replace:' ','' }}),
icon = '{{ site.baseurl }}/img/other/map-marker.svg';
} else {
var staticGoogleMaps = true,
eventPlaceCoordinates = '{{ site.eventPlaceCoordinates | replace:' ','' }}',
centerMapCoordinates = '{{ site.mapCenterCoordinates | replace:' ','' }}',
mobileCenterMapCoordinates = '{{ site.mapMobileCenterCoordinates | replace:' ','' }}',
icon = '{{ site.baseurl | prepend: site.url }}/img/other/map-marker.png';
}
var twitterFeedUrl = '{{ site.twitterFeed }}';
$(document).ready(function () {
$(function () {
if ($(window).width() > 767) {
$("#typeout-text").typed({
strings: [{{site.typeoutTextValues}}],
typeSpeed: 150,
backDelay: 900,
loop: true
});
}
});
});
{% elsif page.permalink == '/logistics/' %}
var googleMaps = 'logistics',
eventPlace = new google.maps.LatLng({{ site.eventPlaceCoordinates }}),
centerMap = new google.maps.LatLng({{ site.logisticsMapCenterCoordinates }}),
mobileCenterMap = new google.maps.LatLng({{ site.logisticsMapMobileCenterCoordinates }}),
icon = '{{ site.baseurl }}/img/other/map-marker.svg';
{% elsif page.permalink == '/hackathon/' %}
if ($(window).width() > 767) {
var googleMaps = 'hackathon',
eventPlace = new google.maps.LatLng({{ site.hackathonPlaceCoordinates }}),
centerMap = new google.maps.LatLng({{ site.hackathonMapCenterCoordinates }}),
mobileCenterMap = new google.maps.LatLng({{ site.hackathonMapMobileCenterCoordinates }}),
icon = '{{ site.baseurl }}/img/other/map-marker.svg';
} else {
var staticGoogleMaps = true,
eventPlaceCoordinates = '{{ site.hackathonPlaceCoordinates | replace:' ','' }}',
centerMapCoordinates = '{{ site.hackathonMapCenterCoordinates | replace:' ','' }}',
mobileCenterMapCoordinates = '{{ site.hackathonMapMobileCenterCoordinates | replace:' ','' }}',
icon = '{{ site.baseurl | prepend: site.url }}/img/other/map-marker.png';
}
{% endif %}
</script>
<script src="{{ "/js/scripts.min.js" | prepend: site.baseurl }}"></script>
{% if page.permalink == '/schedule/' %}
<script type="text/javascript">
$(document).ready(function () {
var navHeight = $('#top-header').height();
var headerHeight = $('.track-header').first().height();
$('.stick-header').stick_in_parent({sticky_class: 'sticky', offset_top: navHeight});
$('.stick-label').stick_in_parent({offset_top: navHeight + headerHeight});
});
</script>
{% endif %}
{% include schema-event.html %}
</body>
</html>
| {
"content_hash": "38109ac45d7a2e76c30b987c4d9ade0b",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 122,
"avg_line_length": 45.678260869565214,
"alnum_prop": 0.5214163335237008,
"repo_name": "GDG-Dusseldorf/gdg-dusseldorf.github.io",
"id": "f9f3d772df25fccc4b03b95bf5c8491995261798",
"size": "5253",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "_layouts/default.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "3678"
},
{
"name": "CSS",
"bytes": "55702"
},
{
"name": "HTML",
"bytes": "75397"
},
{
"name": "JavaScript",
"bytes": "24663"
},
{
"name": "Ruby",
"bytes": "1236"
}
],
"symlink_target": ""
} |
<?php
use Immortal\Support\Str;
use Immortal\Support\HtmlString;
use Immortal\Container\Container;
use Immortal\Contracts\Bus\Dispatcher;
use Immortal\Contracts\Auth\Access\Gate;
use Immortal\Contracts\Routing\UrlGenerator;
use Immortal\Contracts\Routing\ResponseFactory;
use Immortal\Contracts\Auth\Factory as AuthFactory;
use Immortal\Contracts\View\Factory as ViewFactory;
use Immortal\Contracts\Cookie\Factory as CookieFactory;
use Immortal\Database\Eloquent\Factory as EloquentFactory;
use Immortal\Contracts\Validation\Factory as ValidationFactory;
use Immortal\Contracts\Broadcasting\Factory as BroadcastFactory;
if (! function_exists('abort')) {
/**
* Throw an HttpException with the given data.
*
* @param int $code
* @param string $message
* @param array $headers
* @return void
*
* @throws \Symfony\Component\HttpKernel\Exception\HttpException
* @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
*/
function abort($code, $message = '', array $headers = [])
{
app()->abort($code, $message, $headers);
}
}
if (! function_exists('abort_if')) {
/**
* Throw an HttpException with the given data if the given condition is true.
*
* @param bool $boolean
* @param int $code
* @param string $message
* @param array $headers
* @return void
*
* @throws \Symfony\Component\HttpKernel\Exception\HttpException
* @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
*/
function abort_if($boolean, $code, $message = '', array $headers = [])
{
if ($boolean) {
abort($code, $message, $headers);
}
}
}
if (! function_exists('abort_unless')) {
/**
* Throw an HttpException with the given data unless the given condition is true.
*
* @param bool $boolean
* @param int $code
* @param string $message
* @param array $headers
* @return void
*
* @throws \Symfony\Component\HttpKernel\Exception\HttpException
* @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
*/
function abort_unless($boolean, $code, $message = '', array $headers = [])
{
if (! $boolean) {
abort($code, $message, $headers);
}
}
}
if (! function_exists('action')) {
/**
* Generate the URL to a controller action.
*
* @param string $name
* @param array $parameters
* @param bool $absolute
* @return string
*/
function action($name, $parameters = [], $absolute = true)
{
return app('url')->action($name, $parameters, $absolute);
}
}
if (! function_exists('app')) {
/**
* Get the available container instance.
*
* @param string $make
* @param array $parameters
* @return mixed|\Immortal\Foundation\Application
*/
function app($make = null, $parameters = [])
{
if (is_null($make)) {
return Container::getInstance();
}
return Container::getInstance()->make($make, $parameters);
}
}
if (! function_exists('app_path')) {
/**
* Get the path to the application folder.
*
* @param string $path
* @return string
*/
function app_path($path = '')
{
return app('path').($path ? DIRECTORY_SEPARATOR.$path : $path);
}
}
if (! function_exists('asset')) {
/**
* Generate an asset path for the application.
*
* @param string $path
* @param bool $secure
* @return string
*/
function asset($path, $secure = null)
{
return app('url')->asset($path, $secure);
}
}
if (! function_exists('auth')) {
/**
* Get the available auth instance.
*
* @param string|null $guard
* @return \Immortal\Contracts\Auth\Factory|\Immortal\Contracts\Auth\Guard|\Immortal\Contracts\Auth\StatefulGuard
*/
function auth($guard = null)
{
if (is_null($guard)) {
return app(AuthFactory::class);
} else {
return app(AuthFactory::class)->guard($guard);
}
}
}
if (! function_exists('back')) {
/**
* Create a new redirect response to the previous location.
*
* @param int $status
* @param array $headers
* @param string $fallback
* @return \Immortal\Http\RedirectResponse
*/
function back($status = 302, $headers = [], $fallback = false)
{
return app('redirect')->back($status, $headers, $fallback);
}
}
if (! function_exists('base_path')) {
/**
* Get the path to the base of the install.
*
* @param string $path
* @return string
*/
function base_path($path = '')
{
return app()->basePath().($path ? DIRECTORY_SEPARATOR.$path : $path);
}
}
if (! function_exists('bcrypt')) {
/**
* Hash the given value.
*
* @param string $value
* @param array $options
* @return string
*/
function bcrypt($value, $options = [])
{
return app('hash')->make($value, $options);
}
}
if (! function_exists('broadcast')) {
/**
* Begin broadcasting an event.
*
* @param mixed|null $event
* @return \Immortal\Broadcasting\PendingBroadcast|void
*/
function broadcast($event = null)
{
return app(BroadcastFactory::class)->event($event);
}
}
if (! function_exists('cache')) {
/**
* Get / set the specified cache value.
*
* If an array is passed, we'll assume you want to put to the cache.
*
* @param dynamic key|key,default|data,expiration|null
* @return mixed
*
* @throws \Exception
*/
function cache()
{
$arguments = func_get_args();
if (empty($arguments)) {
return app('cache');
}
if (is_string($arguments[0])) {
return app('cache')->get($arguments[0], isset($arguments[1]) ? $arguments[1] : null);
}
if (is_array($arguments[0])) {
if (! isset($arguments[1])) {
throw new Exception(
'You must set an expiration time when putting to the cache.'
);
}
return app('cache')->put(key($arguments[0]), reset($arguments[0]), $arguments[1]);
}
}
}
if (! function_exists('config')) {
/**
* Get / set the specified configuration value.
*
* If an array is passed as the key, we will assume you want to set an array of values.
*
* @param array|string $key
* @param mixed $default
* @return mixed
*/
function config($key = null, $default = null)
{
if (is_null($key)) {
return app('config');
}
if (is_array($key)) {
return app('config')->set($key);
}
return app('config')->get($key, $default);
}
}
if (! function_exists('config_path')) {
/**
* Get the configuration path.
*
* @param string $path
* @return string
*/
function config_path($path = '')
{
return app()->make('path.config').($path ? DIRECTORY_SEPARATOR.$path : $path);
}
}
if (! function_exists('cookie')) {
/**
* Create a new cookie instance.
*
* @param string $name
* @param string $value
* @param int $minutes
* @param string $path
* @param string $domain
* @param bool $secure
* @param bool $httpOnly
* @return \Symfony\Component\HttpFoundation\Cookie
*/
function cookie($name = null, $value = null, $minutes = 0, $path = null, $domain = null, $secure = false, $httpOnly = true)
{
$cookie = app(CookieFactory::class);
if (is_null($name)) {
return $cookie;
}
return $cookie->make($name, $value, $minutes, $path, $domain, $secure, $httpOnly);
}
}
if (! function_exists('csrf_field')) {
/**
* Generate a CSRF token form field.
*
* @return \Immortal\Support\HtmlString
*/
function csrf_field()
{
return new HtmlString('<input type="hidden" name="_token" value="'.csrf_token().'">');
}
}
if (! function_exists('csrf_token')) {
/**
* Get the CSRF token value.
*
* @return string
*
* @throws \RuntimeException
*/
function csrf_token()
{
$session = app('session');
if (isset($session)) {
return $session->getToken();
}
throw new RuntimeException('Application session store not set.');
}
}
if (! function_exists('database_path')) {
/**
* Get the database path.
*
* @param string $path
* @return string
*/
function database_path($path = '')
{
return app()->databasePath().($path ? DIRECTORY_SEPARATOR.$path : $path);
}
}
if (! function_exists('decrypt')) {
/**
* Decrypt the given value.
*
* @param string $value
* @return string
*/
function decrypt($value)
{
return app('encrypter')->decrypt($value);
}
}
if (! function_exists('dispatch')) {
/**
* Dispatch a job to its appropriate handler.
*
* @param mixed $job
* @return mixed
*/
function dispatch($job)
{
return app(Dispatcher::class)->dispatch($job);
}
}
if (! function_exists('elixir')) {
/**
* Get the path to a versioned Elixir file.
*
* @param string $file
* @param string $buildDirectory
* @return string
*
* @throws \InvalidArgumentException
*/
function elixir($file, $buildDirectory = 'build')
{
static $manifest = [];
static $manifestPath;
if (empty($manifest) || $manifestPath !== $buildDirectory) {
$path = public_path($buildDirectory.'/rev-manifest.json');
if (file_exists($path)) {
$manifest = json_decode(file_get_contents($path), true);
$manifestPath = $buildDirectory;
}
}
$file = ltrim($file, '/');
if (isset($manifest[$file])) {
return '/'.trim($buildDirectory.'/'.$manifest[$file], '/');
}
$unversioned = public_path($file);
if (file_exists($unversioned)) {
return '/'.trim($file, '/');
}
throw new InvalidArgumentException("File {$file} not defined in asset manifest.");
}
}
if (! function_exists('encrypt')) {
/**
* Encrypt the given value.
*
* @param string $value
* @return string
*/
function encrypt($value)
{
return app('encrypter')->encrypt($value);
}
}
if (! function_exists('env')) {
/**
* Gets the value of an environment variable. Supports boolean, empty and null.
*
* @param string $key
* @param mixed $default
* @return mixed
*/
function env($key, $default = null)
{
$value = getenv($key);
if ($value === false) {
return value($default);
}
switch (strtolower($value)) {
case 'true':
case '(true)':
return true;
case 'false':
case '(false)':
return false;
case 'empty':
case '(empty)':
return '';
case 'null':
case '(null)':
return;
}
if (strlen($value) > 1 && Str::startsWith($value, '"') && Str::endsWith($value, '"')) {
return substr($value, 1, -1);
}
return $value;
}
}
if (! function_exists('event')) {
/**
* Fire an event and call the listeners.
*
* @param string|object $event
* @param mixed $payload
* @param bool $halt
* @return array|null
*/
function event(...$args)
{
return app('events')->fire(...$args);
}
}
if (! function_exists('factory')) {
/**
* Create a model factory builder for a given class, name, and amount.
*
* @param dynamic class|class,name|class,amount|class,name,amount
* @return \Immortal\Database\Eloquent\FactoryBuilder
*/
function factory()
{
$factory = app(EloquentFactory::class);
$arguments = func_get_args();
if (isset($arguments[1]) && is_string($arguments[1])) {
return $factory->of($arguments[0], $arguments[1])->times(isset($arguments[2]) ? $arguments[2] : 1);
} elseif (isset($arguments[1])) {
return $factory->of($arguments[0])->times($arguments[1]);
} else {
return $factory->of($arguments[0]);
}
}
}
if (! function_exists('info')) {
/**
* Write some information to the log.
*
* @param string $message
* @param array $context
* @return void
*/
function info($message, $context = [])
{
return app('log')->info($message, $context);
}
}
if (! function_exists('logger')) {
/**
* Log a debug message to the logs.
*
* @param string $message
* @param array $context
* @return \Immortal\Contracts\Logging\Log|null
*/
function logger($message = null, array $context = [])
{
if (is_null($message)) {
return app('log');
}
return app('log')->debug($message, $context);
}
}
if (! function_exists('method_field')) {
/**
* Generate a form field to spoof the HTTP verb used by forms.
*
* @param string $method
* @return \Immortal\Support\HtmlString
*/
function method_field($method)
{
return new HtmlString('<input type="hidden" name="_method" value="'.$method.'">');
}
}
if (! function_exists('old')) {
/**
* Retrieve an old input item.
*
* @param string $key
* @param mixed $default
* @return mixed
*/
function old($key = null, $default = null)
{
return app('request')->old($key, $default);
}
}
if (! function_exists('policy')) {
/**
* Get a policy instance for a given class.
*
* @param object|string $class
* @return mixed
*
* @throws \InvalidArgumentException
*/
function policy($class)
{
return app(Gate::class)->getPolicyFor($class);
}
}
if (! function_exists('public_path')) {
/**
* Get the path to the public folder.
*
* @param string $path
* @return string
*/
function public_path($path = '')
{
return app()->make('path.public').($path ? DIRECTORY_SEPARATOR.$path : $path);
}
}
if (! function_exists('redirect')) {
/**
* Get an instance of the redirector.
*
* @param string|null $to
* @param int $status
* @param array $headers
* @param bool $secure
* @return \Immortal\Routing\Redirector|\Immortal\Http\RedirectResponse
*/
function redirect($to = null, $status = 302, $headers = [], $secure = null)
{
if (is_null($to)) {
return app('redirect');
}
return app('redirect')->to($to, $status, $headers, $secure);
}
}
if (! function_exists('request')) {
/**
* Get an instance of the current request or an input item from the request.
*
* @param array|string $key
* @param mixed $default
* @return \Immortal\Http\Request|string|array
*/
function request($key = null, $default = null)
{
if (is_null($key)) {
return app('request');
}
if (is_array($key)) {
return app('request')->only($key);
}
return app('request')->input($key, $default);
}
}
if (! function_exists('resolve')) {
/**
* Resolve a service from the container.
*
* @param string $name
* @param array $parameters
* @return mixed
*/
function resolve($name, $parameters = [])
{
return app($name, $parameters);
}
}
if (! function_exists('resource_path')) {
/**
* Get the path to the resources folder.
*
* @param string $path
* @return string
*/
function resource_path($path = '')
{
return app()->resourcePath().($path ? DIRECTORY_SEPARATOR.$path : $path);
}
}
if (! function_exists('response')) {
/**
* Return a new response from the application.
*
* @param string $content
* @param int $status
* @param array $headers
* @return \Symfony\Component\HttpFoundation\Response|\Immortal\Contracts\Routing\ResponseFactory
*/
function response($content = '', $status = 200, array $headers = [])
{
$factory = app(ResponseFactory::class);
if (func_num_args() === 0) {
return $factory;
}
return $factory->make($content, $status, $headers);
}
}
if (! function_exists('route')) {
/**
* Generate the URL to a named route.
*
* @param string $name
* @param array $parameters
* @param bool $absolute
* @return string
*/
function route($name, $parameters = [], $absolute = true)
{
return app('url')->route($name, $parameters, $absolute);
}
}
if (! function_exists('secure_asset')) {
/**
* Generate an asset path for the application.
*
* @param string $path
* @return string
*/
function secure_asset($path)
{
return asset($path, true);
}
}
if (! function_exists('secure_url')) {
/**
* Generate a HTTPS url for the application.
*
* @param string $path
* @param mixed $parameters
* @return string
*/
function secure_url($path, $parameters = [])
{
return url($path, $parameters, true);
}
}
if (! function_exists('session')) {
/**
* Get / set the specified session value.
*
* If an array is passed as the key, we will assume you want to set an array of values.
*
* @param array|string $key
* @param mixed $default
* @return mixed
*/
function session($key = null, $default = null)
{
if (is_null($key)) {
return app('session');
}
if (is_array($key)) {
return app('session')->put($key);
}
return app('session')->get($key, $default);
}
}
if (! function_exists('storage_path')) {
/**
* Get the path to the storage folder.
*
* @param string $path
* @return string
*/
function storage_path($path = '')
{
return app('path.storage').($path ? DIRECTORY_SEPARATOR.$path : $path);
}
}
if (! function_exists('trans')) {
/**
* Translate the given message.
*
* @param string $id
* @param array $parameters
* @param string $domain
* @param string $locale
* @return \Symfony\Component\Translation\TranslatorInterface|string
*/
function trans($id = null, $parameters = [], $domain = 'messages', $locale = null)
{
if (is_null($id)) {
return app('translator');
}
return app('translator')->trans($id, $parameters, $domain, $locale);
}
}
if (! function_exists('trans_choice')) {
/**
* Translates the given message based on a count.
*
* @param string $id
* @param int|array|\Countable $number
* @param array $parameters
* @param string $domain
* @param string $locale
* @return string
*/
function trans_choice($id, $number, array $parameters = [], $domain = 'messages', $locale = null)
{
return app('translator')->transChoice($id, $number, $parameters, $domain, $locale);
}
}
if (! function_exists('url')) {
/**
* Generate a url for the application.
*
* @param string $path
* @param mixed $parameters
* @param bool $secure
* @return \Immortal\Contracts\Routing\UrlGenerator|string
*/
function url($path = null, $parameters = [], $secure = null)
{
if (is_null($path)) {
return app(UrlGenerator::class);
}
return app(UrlGenerator::class)->to($path, $parameters, $secure);
}
}
if (! function_exists('validator')) {
/**
* Create a new Validator instance.
*
* @param array $data
* @param array $rules
* @param array $messages
* @param array $customAttributes
* @return \Immortal\Contracts\Validation\Validator
*/
function validator(array $data = [], array $rules = [], array $messages = [], array $customAttributes = [])
{
$factory = app(ValidationFactory::class);
if (func_num_args() === 0) {
return $factory;
}
return $factory->make($data, $rules, $messages, $customAttributes);
}
}
if (! function_exists('view')) {
/**
* Get the evaluated view contents for the given view.
*
* @param string $view
* @param array $data
* @param array $mergeData
* @return \Immortal\View\View|\Immortal\Contracts\View\Factory
*/
function view($view = null, $data = [], $mergeData = [])
{
$factory = app(ViewFactory::class);
if (func_num_args() === 0) {
return $factory;
}
return $factory->make($view, $data, $mergeData);
}
}
| {
"content_hash": "ce8b14e1c00dcde2e7084c846c73c1de",
"timestamp": "",
"source": "github",
"line_count": 860,
"max_line_length": 127,
"avg_line_length": 24.92325581395349,
"alnum_prop": 0.5415694690678361,
"repo_name": "zatxm120/framework",
"id": "9b04c03a2258842b9f0ad8f1984c354ae2c10f0b",
"size": "21434",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Immortal/Foundation/helpers.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "14569"
},
{
"name": "PHP",
"bytes": "2384697"
}
],
"symlink_target": ""
} |
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE121_Stack_Based_Buffer_Overflow__CWE806_wchar_t_declare_ncpy_81_bad.cpp
Label Definition File: CWE121_Stack_Based_Buffer_Overflow__CWE806.label.xml
Template File: sources-sink-81_bad.tmpl.cpp
*/
/*
* @description
* CWE: 121 Stack Based Buffer Overflow
* BadSource: Initialize data as a large string
* GoodSource: Initialize data as a small string
* Sinks: ncpy
* BadSink : Copy data to string using wcsncpy
* Flow Variant: 81 Data flow: data passed in a parameter to an virtual method called via a reference
*
* */
#ifndef OMITBAD
#include "std_testcase.h"
#include "CWE121_Stack_Based_Buffer_Overflow__CWE806_wchar_t_declare_ncpy_81.h"
namespace CWE121_Stack_Based_Buffer_Overflow__CWE806_wchar_t_declare_ncpy_81
{
void CWE121_Stack_Based_Buffer_Overflow__CWE806_wchar_t_declare_ncpy_81_bad::action(wchar_t * data) const
{
{
wchar_t dest[50] = L"";
/* POTENTIAL FLAW: Possible buffer overflow if data is larger than dest */
wcsncpy(dest, data, wcslen(data));
dest[50-1] = L'\0'; /* Ensure the destination buffer is null terminated */
printWLine(data);
}
}
}
#endif /* OMITBAD */
| {
"content_hash": "cdf95e0bcada18c4f2433b0551753d0c",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 105,
"avg_line_length": 34.166666666666664,
"alnum_prop": 0.6902439024390243,
"repo_name": "maurer/tiamat",
"id": "c89e646b24cf2d456bb954f2f651375f1feb5144",
"size": "1230",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "samples/Juliet/testcases/CWE121_Stack_Based_Buffer_Overflow/s07/CWE121_Stack_Based_Buffer_Overflow__CWE806_wchar_t_declare_ncpy_81_bad.cpp",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
package us.kbase.expanalysismultiple;
import com.fasterxml.jackson.core.type.TypeReference;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import us.kbase.auth.AuthToken;
import us.kbase.common.service.JsonClientCaller;
import us.kbase.common.service.JsonClientException;
import us.kbase.common.service.RpcContext;
import us.kbase.common.service.UnauthorizedException;
/**
* <p>Original spec-file module name: exp_analysis_multiple</p>
* <pre>
* A KBase module: exp_analysis_multiple
* This module compare multiple_pathway analysis_objects
* </pre>
*/
public class ExpAnalysisMultipleClient {
private JsonClientCaller caller;
/** Constructs a client with a custom URL and no user credentials.
* @param url the URL of the service.
*/
public ExpAnalysisMultipleClient(URL url) {
caller = new JsonClientCaller(url);
}
/** Constructs a client with a custom URL.
* @param url the URL of the service.
* @param token the user's authorization token.
* @throws UnauthorizedException if the token is not valid.
* @throws IOException if an IOException occurs when checking the token's
* validity.
*/
public ExpAnalysisMultipleClient(URL url, AuthToken token) throws UnauthorizedException, IOException {
caller = new JsonClientCaller(url, token);
}
/** Constructs a client with a custom URL.
* @param url the URL of the service.
* @param user the user name.
* @param password the password for the user name.
* @throws UnauthorizedException if the credentials are not valid.
* @throws IOException if an IOException occurs when checking the user's
* credentials.
*/
public ExpAnalysisMultipleClient(URL url, String user, String password) throws UnauthorizedException, IOException {
caller = new JsonClientCaller(url, user, password);
}
/** Get the token this client uses to communicate with the server.
* @return the authorization token.
*/
public AuthToken getToken() {
return caller.getToken();
}
/** Get the URL of the service with which this client communicates.
* @return the service URL.
*/
public URL getURL() {
return caller.getURL();
}
/** Set the timeout between establishing a connection to a server and
* receiving a response. A value of zero or null implies no timeout.
* @param milliseconds the milliseconds to wait before timing out when
* attempting to read from a server.
*/
public void setConnectionReadTimeOut(Integer milliseconds) {
this.caller.setConnectionReadTimeOut(milliseconds);
}
/** Check if this client allows insecure http (vs https) connections.
* @return true if insecure connections are allowed.
*/
public boolean isInsecureHttpConnectionAllowed() {
return caller.isInsecureHttpConnectionAllowed();
}
/** Deprecated. Use isInsecureHttpConnectionAllowed().
* @deprecated
*/
public boolean isAuthAllowedForHttp() {
return caller.isAuthAllowedForHttp();
}
/** Set whether insecure http (vs https) connections should be allowed by
* this client.
* @param allowed true to allow insecure connections. Default false
*/
public void setIsInsecureHttpConnectionAllowed(boolean allowed) {
caller.setInsecureHttpConnectionAllowed(allowed);
}
/** Deprecated. Use setIsInsecureHttpConnectionAllowed().
* @deprecated
*/
public void setAuthAllowedForHttp(boolean isAuthAllowedForHttp) {
caller.setAuthAllowedForHttp(isAuthAllowedForHttp);
}
/** Set whether all SSL certificates, including self-signed certificates,
* should be trusted.
* @param trustAll true to trust all certificates. Default false.
*/
public void setAllSSLCertificatesTrusted(final boolean trustAll) {
caller.setAllSSLCertificatesTrusted(trustAll);
}
/** Check if this client trusts all SSL certificates, including
* self-signed certificates.
* @return true if all certificates are trusted.
*/
public boolean isAllSSLCertificatesTrusted() {
return caller.isAllSSLCertificatesTrusted();
}
/** Sets streaming mode on. In this case, the data will be streamed to
* the server in chunks as it is read from disk rather than buffered in
* memory. Many servers are not compatible with this feature.
* @param streamRequest true to set streaming mode on, false otherwise.
*/
public void setStreamingModeOn(boolean streamRequest) {
caller.setStreamingModeOn(streamRequest);
}
/** Returns true if streaming mode is on.
* @return true if streaming mode is on.
*/
public boolean isStreamingModeOn() {
return caller.isStreamingModeOn();
}
public void _setFileForNextRpcResponse(File f) {
caller.setFileForNextRpcResponse(f);
}
/**
* <p>Original spec-file function name: exp_analysis_multiple</p>
* <pre>
* </pre>
* @param arg1 instance of original type "workspace_name" (A string representing a workspace name.)
* @param arg2 instance of original type "pathwayAnalysis" → list of original type "pathwayAnalysis" (A string representing a list of pathwayAnalysis.)
* @param arg3 instance of original type "output_PathwayAnalysisMultiple" (A string representing a multiple pathwayAnalysis objects.)
* @return instance of type {@link us.kbase.expanalysismultiple.FBAPathwayAnalysisMultiple FBAPathwayAnalysisMultiple}
* @throws IOException if an IO exception occurs
* @throws JsonClientException if a JSON RPC exception occurs
*/
public FBAPathwayAnalysisMultiple expAnalysisMultiple(String arg1, List<String> arg2, String arg3, RpcContext... jsonRpcContext) throws IOException, JsonClientException {
List<Object> args = new ArrayList<Object>();
args.add(arg1);
args.add(arg2);
args.add(arg3);
TypeReference<List<FBAPathwayAnalysisMultiple>> retType = new TypeReference<List<FBAPathwayAnalysisMultiple>>() {};
List<FBAPathwayAnalysisMultiple> res = caller.jsonrpcCall("exp_analysis_multiple.exp_analysis_multiple", args, retType, true, true, jsonRpcContext);
return res.get(0);
}
}
| {
"content_hash": "32e36c8c3483d00950c24594ed9aadba",
"timestamp": "",
"source": "github",
"line_count": 162,
"max_line_length": 174,
"avg_line_length": 39.46296296296296,
"alnum_prop": 0.7056155169716878,
"repo_name": "janakagithub/ExpAnalysisMultiple",
"id": "4dfd81c11ac4fa4db28e24486b9d03b1bf17152e",
"size": "6393",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/src/us/kbase/expanalysismultiple/ExpAnalysisMultipleClient.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "27621"
},
{
"name": "JavaScript",
"bytes": "4124"
},
{
"name": "Makefile",
"bytes": "2856"
},
{
"name": "Perl",
"bytes": "61021"
},
{
"name": "Python",
"bytes": "8023"
},
{
"name": "Shell",
"bytes": "1447"
}
],
"symlink_target": ""
} |
package com.intellij.lang.ant.config.impl.artifacts;
import com.intellij.lang.ant.config.AntBuildTarget;
import com.intellij.lang.ant.config.AntConfiguration;
import com.intellij.lang.ant.config.impl.artifacts.AntArtifactProperties;
import com.intellij.lang.ant.config.impl.TargetChooserDialog;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.FixedSizeButton;
import com.intellij.openapi.util.Comparing;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.packaging.ui.ArtifactPropertiesEditor;
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/**
* @author nik
*/
public class AntArtifactPropertiesEditor extends ArtifactPropertiesEditor {
private final AntArtifactProperties myProperties;
private final Project myProject;
private JPanel myMainPanel;
private JCheckBox myRunTargetCheckBox;
private FixedSizeButton mySelectTargetButton;
private AntBuildTarget myTarget;
private final boolean myPostProcessing;
public AntArtifactPropertiesEditor(AntArtifactProperties properties, Project project, boolean postProcessing) {
myProperties = properties;
myProject = project;
myPostProcessing = postProcessing;
mySelectTargetButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
selectTarget();
}
});
myRunTargetCheckBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
mySelectTargetButton.setEnabled(myRunTargetCheckBox.isSelected());
if (myRunTargetCheckBox.isSelected() && myTarget == null) {
selectTarget();
}
}
});
}
private void selectTarget() {
final TargetChooserDialog dialog = new TargetChooserDialog(myProject, myTarget);
dialog.show();
if (dialog.isOK()) {
myTarget = dialog.getSelectedTarget();
updateLabel();
}
}
private void updateLabel() {
if (myTarget != null) {
myRunTargetCheckBox.setText("Run Ant target '" + myTarget.getName() + "'");
}
else {
myRunTargetCheckBox.setText("Run Ant target <none>");
}
}
public String getTabName() {
return myPostProcessing ? POST_PROCESSING_TAB : PRE_PROCESSING_TAB;
}
public void apply() {
myProperties.setEnabled(myRunTargetCheckBox.isSelected());
if (myTarget != null) {
final VirtualFile file = myTarget.getModel().getBuildFile().getVirtualFile();
if (file != null) {
myProperties.setFileUrl(file.getUrl());
myProperties.setTargetName(myTarget.getName());
return;
}
}
myProperties.setFileUrl(null);
myProperties.setTargetName(null);
}
public JComponent createComponent() {
return myMainPanel;
}
public boolean isModified() {
if (myProperties.isEnabled() != myRunTargetCheckBox.isSelected()) return true;
if (myTarget == null) {
return myProperties.getFileUrl() != null;
}
if (!Comparing.equal(myTarget.getName(), myProperties.getTargetName())) return true;
final VirtualFile file = myTarget.getModel().getBuildFile().getVirtualFile();
return file != null && !Comparing.equal(file.getUrl(), myProperties.getFileUrl());
}
public void reset() {
myRunTargetCheckBox.setSelected(myProperties.isEnabled());
myTarget = myProperties.findTarget(AntConfiguration.getInstance(myProject));
updateLabel();
}
public void disposeUIResources() {
}
}
| {
"content_hash": "7457a17cc11169e2a8edf4374529b45c",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 113,
"avg_line_length": 32.48598130841121,
"alnum_prop": 0.7235327963176065,
"repo_name": "joewalnes/idea-community",
"id": "6b601e91b773714f815bd8afd6fb8c9998973a36",
"size": "4076",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "plugins/ant/src/com/intellij/lang/ant/config/impl/artifacts/AntArtifactPropertiesEditor.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ActionScript",
"bytes": "387"
},
{
"name": "C",
"bytes": "136045"
},
{
"name": "C#",
"bytes": "103"
},
{
"name": "C++",
"bytes": "40449"
},
{
"name": "Emacs Lisp",
"bytes": "2507"
},
{
"name": "Erlang",
"bytes": "10"
},
{
"name": "Groovy",
"bytes": "361320"
},
{
"name": "Java",
"bytes": "89694599"
},
{
"name": "JavaScript",
"bytes": "978"
},
{
"name": "Objective-C",
"bytes": "1877"
},
{
"name": "PHP",
"bytes": "145"
},
{
"name": "Perl",
"bytes": "6523"
},
{
"name": "Python",
"bytes": "1699274"
},
{
"name": "Shell",
"bytes": "6965"
},
{
"name": "VimL",
"bytes": "5950"
}
],
"symlink_target": ""
} |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.15"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>0.9.9 API documenation: Integer functions</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><img alt="Logo" src="logo-mini.png"/></td>
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">0.9.9 API documenation
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.15 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="summary">
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">Integer functions<div class="ingroups"><a class="el" href="a00709.html">Core features</a></div></div> </div>
</div><!--header-->
<div class="contents">
<p>Provides GLSL functions on integer types.
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga44abfe3379e11cbd29425a843420d0d6"><td class="memTemplParams" colspan="2">template<typename genType > </td></tr>
<tr class="memitem:ga44abfe3379e11cbd29425a843420d0d6"><td class="memTemplItemLeft" align="right" valign="top">GLM_FUNC_DECL int </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00798.html#ga44abfe3379e11cbd29425a843420d0d6">bitCount</a> (genType v)</td></tr>
<tr class="memdesc:ga44abfe3379e11cbd29425a843420d0d6"><td class="mdescLeft"> </td><td class="mdescRight">Returns the number of bits set to 1 in the binary representation of value. <a href="a00798.html#ga44abfe3379e11cbd29425a843420d0d6">More...</a><br /></td></tr>
<tr class="separator:ga44abfe3379e11cbd29425a843420d0d6"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gaac7b15e40bdea8d9aa4c4cb34049f7b5"><td class="memTemplParams" colspan="2">template<length_t L, typename T , qualifier Q> </td></tr>
<tr class="memitem:gaac7b15e40bdea8d9aa4c4cb34049f7b5"><td class="memTemplItemLeft" align="right" valign="top">GLM_FUNC_DECL vec< L, int, Q > </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00798.html#gaac7b15e40bdea8d9aa4c4cb34049f7b5">bitCount</a> (vec< L, T, Q > const &v)</td></tr>
<tr class="memdesc:gaac7b15e40bdea8d9aa4c4cb34049f7b5"><td class="mdescLeft"> </td><td class="mdescRight">Returns the number of bits set to 1 in the binary representation of value. <a href="a00798.html#gaac7b15e40bdea8d9aa4c4cb34049f7b5">More...</a><br /></td></tr>
<tr class="separator:gaac7b15e40bdea8d9aa4c4cb34049f7b5"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga346b25ab11e793e91a4a69c8aa6819f2"><td class="memTemplParams" colspan="2">template<length_t L, typename T , qualifier Q> </td></tr>
<tr class="memitem:ga346b25ab11e793e91a4a69c8aa6819f2"><td class="memTemplItemLeft" align="right" valign="top">GLM_FUNC_DECL vec< L, T, Q > </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00798.html#ga346b25ab11e793e91a4a69c8aa6819f2">bitfieldExtract</a> (vec< L, T, Q > const &Value, int Offset, int Bits)</td></tr>
<tr class="memdesc:ga346b25ab11e793e91a4a69c8aa6819f2"><td class="mdescLeft"> </td><td class="mdescRight">Extracts bits [offset, offset + bits - 1] from value, returning them in the least significant bits of the result. <a href="a00798.html#ga346b25ab11e793e91a4a69c8aa6819f2">More...</a><br /></td></tr>
<tr class="separator:ga346b25ab11e793e91a4a69c8aa6819f2"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga2e82992340d421fadb61a473df699b20"><td class="memTemplParams" colspan="2">template<length_t L, typename T , qualifier Q> </td></tr>
<tr class="memitem:ga2e82992340d421fadb61a473df699b20"><td class="memTemplItemLeft" align="right" valign="top">GLM_FUNC_DECL vec< L, T, Q > </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00798.html#ga2e82992340d421fadb61a473df699b20">bitfieldInsert</a> (vec< L, T, Q > const &Base, vec< L, T, Q > const &Insert, int Offset, int Bits)</td></tr>
<tr class="memdesc:ga2e82992340d421fadb61a473df699b20"><td class="mdescLeft"> </td><td class="mdescRight">Returns the insertion the bits least-significant bits of insert into base. <a href="a00798.html#ga2e82992340d421fadb61a473df699b20">More...</a><br /></td></tr>
<tr class="separator:ga2e82992340d421fadb61a473df699b20"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga750a1d92464489b7711dee67aa3441b6"><td class="memTemplParams" colspan="2">template<length_t L, typename T , qualifier Q> </td></tr>
<tr class="memitem:ga750a1d92464489b7711dee67aa3441b6"><td class="memTemplItemLeft" align="right" valign="top">GLM_FUNC_DECL vec< L, T, Q > </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00798.html#ga750a1d92464489b7711dee67aa3441b6">bitfieldReverse</a> (vec< L, T, Q > const &v)</td></tr>
<tr class="memdesc:ga750a1d92464489b7711dee67aa3441b6"><td class="mdescLeft"> </td><td class="mdescRight">Returns the reversal of the bits of value. <a href="a00798.html#ga750a1d92464489b7711dee67aa3441b6">More...</a><br /></td></tr>
<tr class="separator:ga750a1d92464489b7711dee67aa3441b6"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gaf74c4d969fa34ab8acb9d390f5ca5274"><td class="memTemplParams" colspan="2">template<typename genIUType > </td></tr>
<tr class="memitem:gaf74c4d969fa34ab8acb9d390f5ca5274"><td class="memTemplItemLeft" align="right" valign="top">GLM_FUNC_DECL int </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00798.html#gaf74c4d969fa34ab8acb9d390f5ca5274">findLSB</a> (genIUType x)</td></tr>
<tr class="memdesc:gaf74c4d969fa34ab8acb9d390f5ca5274"><td class="mdescLeft"> </td><td class="mdescRight">Returns the bit number of the least significant bit set to 1 in the binary representation of value. <a href="a00798.html#gaf74c4d969fa34ab8acb9d390f5ca5274">More...</a><br /></td></tr>
<tr class="separator:gaf74c4d969fa34ab8acb9d390f5ca5274"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga4454c0331d6369888c28ab677f4810c7"><td class="memTemplParams" colspan="2">template<length_t L, typename T , qualifier Q> </td></tr>
<tr class="memitem:ga4454c0331d6369888c28ab677f4810c7"><td class="memTemplItemLeft" align="right" valign="top">GLM_FUNC_DECL vec< L, int, Q > </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00798.html#ga4454c0331d6369888c28ab677f4810c7">findLSB</a> (vec< L, T, Q > const &v)</td></tr>
<tr class="memdesc:ga4454c0331d6369888c28ab677f4810c7"><td class="mdescLeft"> </td><td class="mdescRight">Returns the bit number of the least significant bit set to 1 in the binary representation of value. <a href="a00798.html#ga4454c0331d6369888c28ab677f4810c7">More...</a><br /></td></tr>
<tr class="separator:ga4454c0331d6369888c28ab677f4810c7"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga7e4a794d766861c70bc961630f8ef621"><td class="memTemplParams" colspan="2">template<typename genIUType > </td></tr>
<tr class="memitem:ga7e4a794d766861c70bc961630f8ef621"><td class="memTemplItemLeft" align="right" valign="top">GLM_FUNC_DECL int </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00798.html#ga7e4a794d766861c70bc961630f8ef621">findMSB</a> (genIUType x)</td></tr>
<tr class="memdesc:ga7e4a794d766861c70bc961630f8ef621"><td class="mdescLeft"> </td><td class="mdescRight">Returns the bit number of the most significant bit in the binary representation of value. <a href="a00798.html#ga7e4a794d766861c70bc961630f8ef621">More...</a><br /></td></tr>
<tr class="separator:ga7e4a794d766861c70bc961630f8ef621"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga39ac4d52028bb6ab08db5ad6562c2872"><td class="memTemplParams" colspan="2">template<length_t L, typename T , qualifier Q> </td></tr>
<tr class="memitem:ga39ac4d52028bb6ab08db5ad6562c2872"><td class="memTemplItemLeft" align="right" valign="top">GLM_FUNC_DECL vec< L, int, Q > </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00798.html#ga39ac4d52028bb6ab08db5ad6562c2872">findMSB</a> (vec< L, T, Q > const &v)</td></tr>
<tr class="memdesc:ga39ac4d52028bb6ab08db5ad6562c2872"><td class="mdescLeft"> </td><td class="mdescRight">Returns the bit number of the most significant bit in the binary representation of value. <a href="a00798.html#ga39ac4d52028bb6ab08db5ad6562c2872">More...</a><br /></td></tr>
<tr class="separator:ga39ac4d52028bb6ab08db5ad6562c2872"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gac0c510a70e852f57594a9141848642e3"><td class="memTemplParams" colspan="2">template<length_t L, qualifier Q> </td></tr>
<tr class="memitem:gac0c510a70e852f57594a9141848642e3"><td class="memTemplItemLeft" align="right" valign="top">GLM_FUNC_DECL void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00798.html#gac0c510a70e852f57594a9141848642e3">imulExtended</a> (vec< L, int, Q > const &x, vec< L, int, Q > const &y, vec< L, int, Q > &msb, vec< L, int, Q > &lsb)</td></tr>
<tr class="memdesc:gac0c510a70e852f57594a9141848642e3"><td class="mdescLeft"> </td><td class="mdescRight">Multiplies 32-bit integers x and y, producing a 64-bit result. <a href="a00798.html#gac0c510a70e852f57594a9141848642e3">More...</a><br /></td></tr>
<tr class="separator:gac0c510a70e852f57594a9141848642e3"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gaedcec48743632dff6786bcc492074b1b"><td class="memTemplParams" colspan="2">template<length_t L, qualifier Q> </td></tr>
<tr class="memitem:gaedcec48743632dff6786bcc492074b1b"><td class="memTemplItemLeft" align="right" valign="top">GLM_FUNC_DECL vec< L, uint, Q > </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00798.html#gaedcec48743632dff6786bcc492074b1b">uaddCarry</a> (vec< L, uint, Q > const &x, vec< L, uint, Q > const &y, vec< L, uint, Q > &carry)</td></tr>
<tr class="memdesc:gaedcec48743632dff6786bcc492074b1b"><td class="mdescLeft"> </td><td class="mdescRight">Adds 32-bit unsigned integer x and y, returning the sum modulo pow(2, 32). <a href="a00798.html#gaedcec48743632dff6786bcc492074b1b">More...</a><br /></td></tr>
<tr class="separator:gaedcec48743632dff6786bcc492074b1b"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga732e2fb56db57ea541c7e5c92b7121be"><td class="memTemplParams" colspan="2">template<length_t L, qualifier Q> </td></tr>
<tr class="memitem:ga732e2fb56db57ea541c7e5c92b7121be"><td class="memTemplItemLeft" align="right" valign="top">GLM_FUNC_DECL void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00798.html#ga732e2fb56db57ea541c7e5c92b7121be">umulExtended</a> (vec< L, uint, Q > const &x, vec< L, uint, Q > const &y, vec< L, uint, Q > &msb, vec< L, uint, Q > &lsb)</td></tr>
<tr class="memdesc:ga732e2fb56db57ea541c7e5c92b7121be"><td class="mdescLeft"> </td><td class="mdescRight">Multiplies 32-bit integers x and y, producing a 64-bit result. <a href="a00798.html#ga732e2fb56db57ea541c7e5c92b7121be">More...</a><br /></td></tr>
<tr class="separator:ga732e2fb56db57ea541c7e5c92b7121be"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gae3316ba1229ad9b9f09480833321b053"><td class="memTemplParams" colspan="2">template<length_t L, qualifier Q> </td></tr>
<tr class="memitem:gae3316ba1229ad9b9f09480833321b053"><td class="memTemplItemLeft" align="right" valign="top">GLM_FUNC_DECL vec< L, uint, Q > </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00798.html#gae3316ba1229ad9b9f09480833321b053">usubBorrow</a> (vec< L, uint, Q > const &x, vec< L, uint, Q > const &y, vec< L, uint, Q > &borrow)</td></tr>
<tr class="memdesc:gae3316ba1229ad9b9f09480833321b053"><td class="mdescLeft"> </td><td class="mdescRight">Subtracts the 32-bit unsigned integer y from x, returning the difference if non-negative, or pow(2, 32) plus the difference otherwise. <a href="a00798.html#gae3316ba1229ad9b9f09480833321b053">More...</a><br /></td></tr>
<tr class="separator:gae3316ba1229ad9b9f09480833321b053"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>Provides GLSL functions on integer types. </p>
<p>These all operate component-wise. The description is per component. The notation [a, b] means the set of bits from bit-number a through bit-number b, inclusive. The lowest-order bit is bit 0.</p>
<p>Include <<a class="el" href="a00410.html" title="Core features">glm/integer.hpp</a>> to use these core features. </p>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga44abfe3379e11cbd29425a843420d0d6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga44abfe3379e11cbd29425a843420d0d6">◆ </a></span>bitCount() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">GLM_FUNC_DECL int glm::bitCount </td>
<td>(</td>
<td class="paramtype">genType </td>
<td class="paramname"><em>v</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the number of bits set to 1 in the binary representation of value. </p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
<table class="tparams">
<tr><td class="paramname">genType</td><td>Signed or unsigned integer scalar or vector types.</td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitCount.xml">GLSL bitCount man page</a> </dd>
<dd>
<a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a> </dd></dl>
</div>
</div>
<a id="gaac7b15e40bdea8d9aa4c4cb34049f7b5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaac7b15e40bdea8d9aa4c4cb34049f7b5">◆ </a></span>bitCount() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">GLM_FUNC_DECL vec<L, int, Q> glm::bitCount </td>
<td>(</td>
<td class="paramtype">vec< L, T, Q > const & </td>
<td class="paramname"><em>v</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the number of bits set to 1 in the binary representation of value. </p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
<table class="tparams">
<tr><td class="paramname">L</td><td>An integer between 1 and 4 included that qualify the dimension of the vector. </td></tr>
<tr><td class="paramname">T</td><td>Signed or unsigned integer scalar or vector types.</td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitCount.xml">GLSL bitCount man page</a> </dd>
<dd>
<a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a> </dd></dl>
</div>
</div>
<a id="ga346b25ab11e793e91a4a69c8aa6819f2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga346b25ab11e793e91a4a69c8aa6819f2">◆ </a></span>bitfieldExtract()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">GLM_FUNC_DECL vec<L, T, Q> glm::bitfieldExtract </td>
<td>(</td>
<td class="paramtype">vec< L, T, Q > const & </td>
<td class="paramname"><em>Value</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>Offset</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>Bits</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Extracts bits [offset, offset + bits - 1] from value, returning them in the least significant bits of the result. </p>
<p>For unsigned data types, the most significant bits of the result will be set to zero. For signed data types, the most significant bits will be set to the value of bit offset + base - 1.</p>
<p>If bits is zero, the result will be zero. The result will be undefined if offset or bits is negative, or if the sum of offset and bits is greater than the number of bits used to store the operand.</p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
<table class="tparams">
<tr><td class="paramname">L</td><td>An integer between 1 and 4 included that qualify the dimension of the vector. </td></tr>
<tr><td class="paramname">T</td><td>Signed or unsigned integer scalar types.</td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitfieldExtract.xml">GLSL bitfieldExtract man page</a> </dd>
<dd>
<a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a> </dd></dl>
</div>
</div>
<a id="ga2e82992340d421fadb61a473df699b20"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga2e82992340d421fadb61a473df699b20">◆ </a></span>bitfieldInsert()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">GLM_FUNC_DECL vec<L, T, Q> glm::bitfieldInsert </td>
<td>(</td>
<td class="paramtype">vec< L, T, Q > const & </td>
<td class="paramname"><em>Base</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">vec< L, T, Q > const & </td>
<td class="paramname"><em>Insert</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>Offset</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>Bits</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the insertion the bits least-significant bits of insert into base. </p>
<p>The result will have bits [offset, offset + bits - 1] taken from bits [0, bits - 1] of insert, and all other bits taken directly from the corresponding bits of base. If bits is zero, the result will simply be base. The result will be undefined if offset or bits is negative, or if the sum of offset and bits is greater than the number of bits used to store the operand.</p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
<table class="tparams">
<tr><td class="paramname">L</td><td>An integer between 1 and 4 included that qualify the dimension of the vector. </td></tr>
<tr><td class="paramname">T</td><td>Signed or unsigned integer scalar or vector types.</td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitfieldInsert.xml">GLSL bitfieldInsert man page</a> </dd>
<dd>
<a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a> </dd></dl>
</div>
</div>
<a id="ga750a1d92464489b7711dee67aa3441b6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga750a1d92464489b7711dee67aa3441b6">◆ </a></span>bitfieldReverse()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">GLM_FUNC_DECL vec<L, T, Q> glm::bitfieldReverse </td>
<td>(</td>
<td class="paramtype">vec< L, T, Q > const & </td>
<td class="paramname"><em>v</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the reversal of the bits of value. </p>
<p>The bit numbered n of the result will be taken from bit (bits - 1) - n of value, where bits is the total number of bits used to represent value.</p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
<table class="tparams">
<tr><td class="paramname">L</td><td>An integer between 1 and 4 included that qualify the dimension of the vector. </td></tr>
<tr><td class="paramname">T</td><td>Signed or unsigned integer scalar or vector types.</td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitfieldReverse.xml">GLSL bitfieldReverse man page</a> </dd>
<dd>
<a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a> </dd></dl>
</div>
</div>
<a id="gaf74c4d969fa34ab8acb9d390f5ca5274"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf74c4d969fa34ab8acb9d390f5ca5274">◆ </a></span>findLSB() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">GLM_FUNC_DECL int glm::findLSB </td>
<td>(</td>
<td class="paramtype">genIUType </td>
<td class="paramname"><em>x</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the bit number of the least significant bit set to 1 in the binary representation of value. </p>
<p>If value is zero, -1 will be returned.</p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
<table class="tparams">
<tr><td class="paramname">genIUType</td><td>Signed or unsigned integer scalar types.</td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/findLSB.xml">GLSL findLSB man page</a> </dd>
<dd>
<a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a> </dd></dl>
</div>
</div>
<a id="ga4454c0331d6369888c28ab677f4810c7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga4454c0331d6369888c28ab677f4810c7">◆ </a></span>findLSB() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">GLM_FUNC_DECL vec<L, int, Q> glm::findLSB </td>
<td>(</td>
<td class="paramtype">vec< L, T, Q > const & </td>
<td class="paramname"><em>v</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the bit number of the least significant bit set to 1 in the binary representation of value. </p>
<p>If value is zero, -1 will be returned.</p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
<table class="tparams">
<tr><td class="paramname">L</td><td>An integer between 1 and 4 included that qualify the dimension of the vector. </td></tr>
<tr><td class="paramname">T</td><td>Signed or unsigned integer scalar types.</td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/findLSB.xml">GLSL findLSB man page</a> </dd>
<dd>
<a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a> </dd></dl>
</div>
</div>
<a id="ga7e4a794d766861c70bc961630f8ef621"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga7e4a794d766861c70bc961630f8ef621">◆ </a></span>findMSB() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">GLM_FUNC_DECL int glm::findMSB </td>
<td>(</td>
<td class="paramtype">genIUType </td>
<td class="paramname"><em>x</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the bit number of the most significant bit in the binary representation of value. </p>
<p>For positive integers, the result will be the bit number of the most significant bit set to 1. For negative integers, the result will be the bit number of the most significant bit set to 0. For a value of zero or negative one, -1 will be returned.</p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
<table class="tparams">
<tr><td class="paramname">genIUType</td><td>Signed or unsigned integer scalar types.</td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/findMSB.xml">GLSL findMSB man page</a> </dd>
<dd>
<a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a> </dd></dl>
</div>
</div>
<a id="ga39ac4d52028bb6ab08db5ad6562c2872"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga39ac4d52028bb6ab08db5ad6562c2872">◆ </a></span>findMSB() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">GLM_FUNC_DECL vec<L, int, Q> glm::findMSB </td>
<td>(</td>
<td class="paramtype">vec< L, T, Q > const & </td>
<td class="paramname"><em>v</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the bit number of the most significant bit in the binary representation of value. </p>
<p>For positive integers, the result will be the bit number of the most significant bit set to 1. For negative integers, the result will be the bit number of the most significant bit set to 0. For a value of zero or negative one, -1 will be returned.</p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
<table class="tparams">
<tr><td class="paramname">L</td><td>An integer between 1 and 4 included that qualify the dimension of the vector. </td></tr>
<tr><td class="paramname">T</td><td>Signed or unsigned integer scalar types.</td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/findMSB.xml">GLSL findMSB man page</a> </dd>
<dd>
<a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a> </dd></dl>
</div>
</div>
<a id="gac0c510a70e852f57594a9141848642e3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gac0c510a70e852f57594a9141848642e3">◆ </a></span>imulExtended()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">GLM_FUNC_DECL void glm::imulExtended </td>
<td>(</td>
<td class="paramtype">vec< L, int, Q > const & </td>
<td class="paramname"><em>x</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">vec< L, int, Q > const & </td>
<td class="paramname"><em>y</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">vec< L, int, Q > & </td>
<td class="paramname"><em>msb</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">vec< L, int, Q > & </td>
<td class="paramname"><em>lsb</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Multiplies 32-bit integers x and y, producing a 64-bit result. </p>
<p>The 32 least-significant bits are returned in lsb. The 32 most-significant bits are returned in msb.</p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
<table class="tparams">
<tr><td class="paramname">L</td><td>An integer between 1 and 4 included that qualify the dimension of the vector.</td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/imulExtended.xml">GLSL imulExtended man page</a> </dd>
<dd>
<a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a> </dd></dl>
</div>
</div>
<a id="gaedcec48743632dff6786bcc492074b1b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaedcec48743632dff6786bcc492074b1b">◆ </a></span>uaddCarry()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">GLM_FUNC_DECL vec<L, uint, Q> glm::uaddCarry </td>
<td>(</td>
<td class="paramtype">vec< L, uint, Q > const & </td>
<td class="paramname"><em>x</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">vec< L, uint, Q > const & </td>
<td class="paramname"><em>y</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">vec< L, uint, Q > & </td>
<td class="paramname"><em>carry</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Adds 32-bit unsigned integer x and y, returning the sum modulo pow(2, 32). </p>
<p>The value carry is set to 0 if the sum was less than pow(2, 32), or to 1 otherwise.</p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
<table class="tparams">
<tr><td class="paramname">L</td><td>An integer between 1 and 4 included that qualify the dimension of the vector.</td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/uaddCarry.xml">GLSL uaddCarry man page</a> </dd>
<dd>
<a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a> </dd></dl>
</div>
</div>
<a id="ga732e2fb56db57ea541c7e5c92b7121be"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga732e2fb56db57ea541c7e5c92b7121be">◆ </a></span>umulExtended()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">GLM_FUNC_DECL void glm::umulExtended </td>
<td>(</td>
<td class="paramtype">vec< L, uint, Q > const & </td>
<td class="paramname"><em>x</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">vec< L, uint, Q > const & </td>
<td class="paramname"><em>y</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">vec< L, uint, Q > & </td>
<td class="paramname"><em>msb</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">vec< L, uint, Q > & </td>
<td class="paramname"><em>lsb</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Multiplies 32-bit integers x and y, producing a 64-bit result. </p>
<p>The 32 least-significant bits are returned in lsb. The 32 most-significant bits are returned in msb.</p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
<table class="tparams">
<tr><td class="paramname">L</td><td>An integer between 1 and 4 included that qualify the dimension of the vector.</td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/umulExtended.xml">GLSL umulExtended man page</a> </dd>
<dd>
<a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a> </dd></dl>
</div>
</div>
<a id="gae3316ba1229ad9b9f09480833321b053"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae3316ba1229ad9b9f09480833321b053">◆ </a></span>usubBorrow()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">GLM_FUNC_DECL vec<L, uint, Q> glm::usubBorrow </td>
<td>(</td>
<td class="paramtype">vec< L, uint, Q > const & </td>
<td class="paramname"><em>x</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">vec< L, uint, Q > const & </td>
<td class="paramname"><em>y</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">vec< L, uint, Q > & </td>
<td class="paramname"><em>borrow</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Subtracts the 32-bit unsigned integer y from x, returning the difference if non-negative, or pow(2, 32) plus the difference otherwise. </p>
<p>The value borrow is set to 0 if x >= y, or to 1 otherwise.</p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
<table class="tparams">
<tr><td class="paramname">L</td><td>An integer between 1 and 4 included that qualify the dimension of the vector.</td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/usubBorrow.xml">GLSL usubBorrow man page</a> </dd>
<dd>
<a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a> </dd></dl>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.15
</small></address>
</body>
</html>
| {
"content_hash": "c7d703322fe9a8e821ee4716c69f1d99",
"timestamp": "",
"source": "github",
"line_count": 652,
"max_line_length": 425,
"avg_line_length": 57.34355828220859,
"alnum_prop": 0.6587675189900503,
"repo_name": "kumakoko/KumaGL",
"id": "ce5ce2ad1ec6617f3bdd36193d89c6eb11fd008c",
"size": "37388",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "third_lib/glm/0.9.9.5/share/man/html/a00798.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "763"
},
{
"name": "Batchfile",
"bytes": "1610"
},
{
"name": "C",
"bytes": "10066221"
},
{
"name": "C++",
"bytes": "122279207"
},
{
"name": "CMake",
"bytes": "32438"
},
{
"name": "CSS",
"bytes": "97842"
},
{
"name": "GLSL",
"bytes": "288465"
},
{
"name": "HTML",
"bytes": "28003047"
},
{
"name": "JavaScript",
"bytes": "512828"
},
{
"name": "M4",
"bytes": "10000"
},
{
"name": "Makefile",
"bytes": "12990"
},
{
"name": "Objective-C",
"bytes": "100340"
},
{
"name": "Objective-C++",
"bytes": "2520"
},
{
"name": "Perl",
"bytes": "6275"
},
{
"name": "Roff",
"bytes": "332021"
},
{
"name": "Ruby",
"bytes": "9186"
},
{
"name": "Shell",
"bytes": "37826"
}
],
"symlink_target": ""
} |
package view;
import model.Password;
import org.jasypt.util.text.BasicTextEncryptor;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;
import javax.swing.border.Border;
import javax.swing.border.EmptyBorder;
public class AddNewPassword {
JPanel contentPanel;
private JPanel panel;
private JTextField txtWebpage;
private JTextField txtUsername;
private JPasswordField txtPassword2;
private JPasswordField txtPassword1;
private PasswordManagerGUI gui;
public AddNewPassword(PasswordManagerGUI gui) {
panel = new JPanel();
contentPanel = new JPanel();
panel.setLayout(new BorderLayout());
panel.add(contentPanel, BorderLayout.CENTER);
this.gui = gui;
contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
contentPanel.setLayout(new BorderLayout(0, 0));
{
JPanel panelTitle = new JPanel();
contentPanel.add(panelTitle, BorderLayout.NORTH);
{
JLabel lblAddNewPassword = new JLabel("Add New Password");
lblAddNewPassword.setFont(new Font("Tahoma", Font.PLAIN, 25));
panelTitle.add(lblAddNewPassword);
}
}
{
JPanel panel = new JPanel();
contentPanel.add(panel, BorderLayout.CENTER);
GridBagLayout gbl_panel = new GridBagLayout();
gbl_panel.columnWidths = new int[]{125, 38, 236, 0, 0};
gbl_panel.rowHeights = new int[]{0, 27, 10, 27, 0, 0, 0, 0, 0, 0};
gbl_panel.columnWeights = new double[]{0.0, 0.0, 1.0, 0.0, Double.MIN_VALUE};
gbl_panel.rowWeights = new double[]{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE};
panel.setLayout(gbl_panel);
{
Component verticalStrut = Box.createVerticalStrut(20);
GridBagConstraints gbc_verticalStrut = new GridBagConstraints();
gbc_verticalStrut.insets = new Insets(0, 0, 5, 5);
gbc_verticalStrut.gridx = 2;
gbc_verticalStrut.gridy = 0;
panel.add(verticalStrut, gbc_verticalStrut);
}
{
JLabel lblWebpage = new JLabel("Webpage");
GridBagConstraints gbc_lblWebpage = new GridBagConstraints();
gbc_lblWebpage.anchor = GridBagConstraints.EAST;
gbc_lblWebpage.insets = new Insets(0, 0, 5, 5);
gbc_lblWebpage.gridx = 0;
gbc_lblWebpage.gridy = 1;
panel.add(lblWebpage, gbc_lblWebpage);
}
{
txtWebpage = new JTextField();
GridBagConstraints gbc_txtWebpage = new GridBagConstraints();
gbc_txtWebpage.insets = new Insets(0, 0, 5, 5);
gbc_txtWebpage.fill = GridBagConstraints.BOTH;
gbc_txtWebpage.gridx = 2;
gbc_txtWebpage.gridy = 1;
panel.add(txtWebpage, gbc_txtWebpage);
txtWebpage.setColumns(10);
}
{
Component horizontalStrut = Box.createHorizontalStrut(20);
GridBagConstraints gbc_horizontalStrut = new GridBagConstraints();
gbc_horizontalStrut.insets = new Insets(0, 0, 5, 0);
gbc_horizontalStrut.gridx = 3;
gbc_horizontalStrut.gridy = 1;
panel.add(horizontalStrut, gbc_horizontalStrut);
}
{
Component verticalStrut = Box.createVerticalStrut(20);
GridBagConstraints gbc_verticalStrut = new GridBagConstraints();
gbc_verticalStrut.insets = new Insets(0, 0, 5, 5);
gbc_verticalStrut.gridx = 0;
gbc_verticalStrut.gridy = 2;
panel.add(verticalStrut, gbc_verticalStrut);
}
{
JLabel lblUsername = new JLabel("Username");
GridBagConstraints gbc_lblUsername = new GridBagConstraints();
gbc_lblUsername.anchor = GridBagConstraints.EAST;
gbc_lblUsername.insets = new Insets(0, 0, 5, 5);
gbc_lblUsername.gridx = 0;
gbc_lblUsername.gridy = 3;
panel.add(lblUsername, gbc_lblUsername);
}
{
Component horizontalStrut = Box.createHorizontalStrut(20);
GridBagConstraints gbc_horizontalStrut = new GridBagConstraints();
gbc_horizontalStrut.insets = new Insets(0, 0, 5, 5);
gbc_horizontalStrut.gridx = 1;
gbc_horizontalStrut.gridy = 3;
panel.add(horizontalStrut, gbc_horizontalStrut);
}
{
txtUsername = new JTextField();
GridBagConstraints gbc_txtUsername = new GridBagConstraints();
gbc_txtUsername.insets = new Insets(0, 0, 5, 5);
gbc_txtUsername.fill = GridBagConstraints.HORIZONTAL;
gbc_txtUsername.gridx = 2;
gbc_txtUsername.gridy = 3;
panel.add(txtUsername, gbc_txtUsername);
txtUsername.setColumns(10);
}
{
Component verticalStrut = Box.createVerticalStrut(20);
GridBagConstraints gbc_verticalStrut = new GridBagConstraints();
gbc_verticalStrut.insets = new Insets(0, 0, 5, 5);
gbc_verticalStrut.gridx = 0;
gbc_verticalStrut.gridy = 4;
panel.add(verticalStrut, gbc_verticalStrut);
}
{
JLabel lblPassword = new JLabel("Password");
GridBagConstraints gbc_lblPassword = new GridBagConstraints();
gbc_lblPassword.anchor = GridBagConstraints.EAST;
gbc_lblPassword.insets = new Insets(0, 0, 5, 5);
gbc_lblPassword.gridx = 0;
gbc_lblPassword.gridy = 5;
panel.add(lblPassword, gbc_lblPassword);
}
{
txtPassword1 = new JPasswordField();
GridBagConstraints gbc_txtPassword1 = new GridBagConstraints();
gbc_txtPassword1.insets = new Insets(0, 0, 5, 5);
gbc_txtPassword1.fill = GridBagConstraints.HORIZONTAL;
gbc_txtPassword1.gridx = 2;
gbc_txtPassword1.gridy = 5;
panel.add(txtPassword1, gbc_txtPassword1);
}
{
Component verticalStrut = Box.createVerticalStrut(20);
GridBagConstraints gbc_verticalStrut = new GridBagConstraints();
gbc_verticalStrut.insets = new Insets(0, 0, 5, 5);
gbc_verticalStrut.gridx = 0;
gbc_verticalStrut.gridy = 6;
panel.add(verticalStrut, gbc_verticalStrut);
}
{
JLabel lblPasswordAgain = new JLabel("Password again");
GridBagConstraints gbc_lblPasswordAgain = new GridBagConstraints();
gbc_lblPasswordAgain.anchor = GridBagConstraints.EAST;
gbc_lblPasswordAgain.insets = new Insets(0, 0, 5, 5);
gbc_lblPasswordAgain.gridx = 0;
gbc_lblPasswordAgain.gridy = 7;
panel.add(lblPasswordAgain, gbc_lblPasswordAgain);
}
{
txtPassword2 = new JPasswordField();
GridBagConstraints gbc_txtPassword2 = new GridBagConstraints();
gbc_txtPassword2.anchor = GridBagConstraints.NORTH;
gbc_txtPassword2.insets = new Insets(0, 0, 5, 5);
gbc_txtPassword2.fill = GridBagConstraints.HORIZONTAL;
gbc_txtPassword2.gridx = 2;
gbc_txtPassword2.gridy = 7;
panel.add(txtPassword2, gbc_txtPassword2);
}
}
{
JPanel buttonPane = new JPanel();
buttonPane.setBackground(UIManager.getColor("CheckBox.light"));
buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
contentPanel.add(buttonPane, BorderLayout.SOUTH);
{
JButton okButton = new JButton("OK");
okButton.addActionListener(arg0 ->
{
if(txtPassword1.getText().equals(txtPassword2.getText()) && txtPassword1.getText().length() != 0){
Password pass = new Password();
BasicTextEncryptor encryptor = new BasicTextEncryptor();
encryptor.setPassword(gui.getSessionPassword());
pass.setUsername(gui.getSessionUsername());
pass.setWebpage(encryptor.encrypt(txtWebpage.getText()));
pass.setP_username(encryptor.encrypt(txtUsername.getText()));
pass.setP_password(encryptor.encrypt(txtPassword1.getText()));
try{
gui.getController().addNewPassword(pass);
JOptionPane.showMessageDialog(gui.getPanel(),
"Password added successfully!",
"Password added", JOptionPane.PLAIN_MESSAGE);
} catch (Exception x){
x.printStackTrace();
JOptionPane.showMessageDialog(gui.getPanel(),
"Something went wrong!",
"Error", JOptionPane.ERROR_MESSAGE);
}
} else {
JOptionPane.showMessageDialog(gui.getPanel(),
"Passwords do not match or empty!",
"Password", JOptionPane.ERROR_MESSAGE);
}
txtWebpage.setText(null);
txtPassword1.setText(null);
txtPassword2.setText(null);
txtUsername.setText(null);
});
okButton.setActionCommand("OK");
buttonPane.add(okButton);
}
{
JButton cancelButton = new JButton("Cancel");
cancelButton.addActionListener(e ->
{
gui.switchToPass();
});
cancelButton.setActionCommand("Cancel");
buttonPane.add(cancelButton);
}
}
}
}
| {
"content_hash": "7961716b1ce93c56031eba0141314402",
"timestamp": "",
"source": "github",
"line_count": 235,
"max_line_length": 118,
"avg_line_length": 45.0468085106383,
"alnum_prop": 0.5382580767050822,
"repo_name": "zoltanvi/password-manager",
"id": "5ae59b98742ca04385431858f2f920a81a90d9fa",
"size": "10586",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/view/AddNewPassword.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "57513"
}
],
"symlink_target": ""
} |
/*
----> https://github.com/adafruit/Adafruit_DRV2605_Library
----> http://www.adafruit.com/products/2305
Module for the Adafruit DRV2605L Haptic Driver IC.
Only I2C is supported.
Parts of the module is based on the driver written by Limor Fried/Ladyada for Adafruit Industries:
MIT license, all text above must be included in any redistribution
I2Cdev device library code is placed under the MIT license
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.
*/
```
/* ==== example code - basic - ==== */
var i2c = I2C1; // hardware I2C on supported pins
//var i2c = new I2C(); // software I2C on any pin
i2c.setup({ scl : B6, sda: B7 });
var drv = require("DRV2605").connect(i2c);
Serial.println("DRV test");
drv.begin();
drv.selectLibrary(1);
// I2C trigger by sending 'go' command
// default, internal trigger when sending GO command
drv.setMode(DRV2605.MODE_INTTRIG);
var effect = 1; // uint8_t
effect = 0; // quick hack to have a tinier loop ;)
var timer = setTimeout(function(){
effect++;
if (effect > 117) effect = 1;
Serial.print("Effect #"); Serial.println(effect);
// set the effect to play
drv.setWaveform(0, effect); // play effect
drv.setWaveform(1, 0); // end waveform
// play the effect!
drv.go();
}, 500); // wait a bit
```
/* Module constants*/
var C = {
ADDR: 0x5A,
MODE_INTTRIG: 0x00,
MODE_EXTTRIGEDGE: 0x01,
MODE_EXTTRIGLVL: 0x02,
MODE_PWMANALOG: 0x03,
MODE_AUDIOVIBE: 0x04,
MODE_REALTIME: 0x05,
MODE_DIAGNOS: 0x06,
MODE_AUTOCAL: 0x07,
};
/* Register addresses*/
var R = {
REG_STATUS: 0x00,
REG_MODE: 0x01,
REG_RTPIN: 0x02,
REG_LIBRARY: 0x03,
REG_WAVESEQ1: 0x04,
REG_WAVESEQ2: 0x05,
REG_WAVESEQ3: 0x06,
REG_WAVESEQ4: 0x07,
REG_WAVESEQ5: 0x08,
REG_WAVESEQ6: 0x09,
REG_WAVESEQ7: 0x0A,
REG_WAVESEQ8: 0x0B,
REG_GO: 0x0C,
REG_OVERDRIVE: 0x0D,
REG_SUSTAINPOS: 0x0E,
REG_SUSTAINNEG: 0x0F,
REG_BREAK: 0x10,
REG_AUDIOCTRL: 0x11,
REG_AUDIOLVL: 0x12,
REG_AUDIOMAX: 0x13,
REG_RATEDV: 0x16,
REG_CLAMPV: 0x17,
REG_AUTOCALCOMP: 0x18,
REG_AUTOCALEMP: 0x19,
REG_FEEDBACK: 0x1A,
REG_CONTROL1: 0x1B,
REG_CONTROL2: 0x1C,
REG_CONTROL3: 0x1D,
REG_CONTROL4: 0x1E,
REG_VBAT: 0x21,
REG_LRARESON: 0x22
};
exports.DRV2605 = C;
exports.connect = function (_i2c,_addr) {
return new DRV2605(_i2c,_addr);
};
/* MPU6050 Object - not yet sure about the _addr part, so for now, it'll stay as is whatever arg passed => TODO: digg the datasheet ! */
function DRV2605(_i2c, _addr) {
this.i2c = _i2c;
this.addr =
(undefined===_addr || false===_addr) ? C.ADDR : //C.ADDRESS_AD0_LOW :
(true===_addr) ? C.ADDR : //C.ADDRESS_AD0_HIGH :
_addr;
this.initialize();
}
/* Initialize the chip */
DRV2605.prototype.initialize = function() {
//this.begin();
};
/* () -> boolean */
DRV2605.prototype.begin = function(){
//Wire.begin();
var id = this.readRegister8(R.REG_STATUS); //uint8_t id = this.readRegister8(C.REG_STATUS);
//Serial.print("Status 0x"); Serial.println(id, HEX);
this.writeRegister8(R.REG_MODE, 0x00); // out of standby
this.writeRegister8(R.REG_RTPIN, 0x00); // no real-time-playback
this.writeRegister8(R.REG_WAVESEQ1, 1); // strong click
this.writeRegister8(R.REG_WAVESEQ2, 0);
this.writeRegister8(R.REG_OVERDRIVE, 0); // no overdrive
this.writeRegister8(R.REG_SUSTAINPOS, 0);
this.writeRegister8(R.REG_SUSTAINNEG, 0);
this.writeRegister8(R.REG_BREAK, 0);
this.writeRegister8(R.REG_AUDIOMAX, 0x64);
// ERM open loop
// turn off N_ERM_LRA
this.writeRegister8(R.REG_FEEDBACK, this.readRegister8(R.REG_FEEDBACK) & 0x7F);
// turn on ERM_OPEN_LOOP
this.writeRegister8(R.REG_CONTROL3, this.readRegister8(R.REG_CONTROL3) | 0x20);
return true;
};
/* (uint8_t reg, uint8_t val); -> void */
DRV2605.prototype.writeRegister8(reg, val){
// use i2c
//Wire.beginTransmission(DRV2605.ADDR);
this.i2c.writeTo(this.addr, reg); // Wire.write((byte)reg)
this.i2c.writeTo(this.addr, val); // Wire.write((byte)val);
//Wire.endTransmission();
};
/* (uint8_t reg) -> uint8_t */
DRV2605.prototype.readRegister8 = function(reg){
//var x; // uint8_t
// use i2c
//Wire.beginTransmission(DRV2605.ADDR);
this.i2c.writeTo(this.addr, reg); // Wire.write((byte)reg);
//Wire.endTransmission();
var x = this.i2c.readFrom(this.addr, 1); //Wire.requestFrom((byte)DRV2605.ADDR, (byte)1); /*--*/ x = Wire.read();
// Serial.print("$"); Serial.print(reg, HEX);
// Serial.print(": 0x"); Serial.println(x, HEX);
return x;
};
/* (uint8_t slot, uint8_t w) -> void */
DRV2605.prototype.setWaveform = function(slot, w){
this.writeRegister8(R.REG_WAVESEQ1+slot, w);
};
/* (uint8_t lib) -> void */
DRV2605.prototype.selectLibrary = function(lib){
this.writeRegister8(R.REG_LIBRARY, lib);
};
/* () -> void */
DRV2605.prototype.go = function(){
this.writeRegister8(R.REG_GO, 1);
};
/* () -> void */
DRV2605.prototype.stop = function(){
this.writeRegister8(R.REG_GO, 0);
};
/* (uint8_t mode) -> void */
DRV2605.prototype.setMode = function(mode){
this.writeRegister8(R.REG_MODE, mode);
};
/* (uint8_t rtp) -> void */
DRV2605.prototype.setRealtimeValue = function(rtp){
this.writeRegister8(R.REG_RTPIN, rtp);
};
// Select ERM (Eccentric Rotating Mass) or LRA (Linear Resonant Actuator) vibration motor
// The default is ERM, which is more common
/* () -> void */
DRV2605.prototype.useERM = function(){
this.writeRegister8(R.REG_FEEDBACK, this.readRegister8(R.REG_FEEDBACK) & 0x7F);
};
/* () -> void */
DRV2605.prototype.useLRA = function(){
this.writeRegister8(R.REG_FEEDBACK, this.readRegister8(R.REG_FEEDBACK) | 0x80);
};
| {
"content_hash": "d6129d93334b4acec83ebd0a26ba0321",
"timestamp": "",
"source": "github",
"line_count": 226,
"max_line_length": 136,
"avg_line_length": 28.02654867256637,
"alnum_prop": 0.6599305336280391,
"repo_name": "stephaneAG/Espruino_tests",
"id": "4effebf83a83cc58b0ac7fbd71b2d061c2d14582",
"size": "6427",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Adafruit_DRV2605_Library/DRV2605L.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "1454"
},
{
"name": "JavaScript",
"bytes": "166316"
},
{
"name": "Python",
"bytes": "873"
},
{
"name": "Shell",
"bytes": "1407"
}
],
"symlink_target": ""
} |
using System;
using UsingCustomMVVM.Helpers;
namespace UsingCustomMVVM.ViewModels
{
public class MainViewModel : Observable
{
public MainViewModel()
{
}
}
}
| {
"content_hash": "f1a7a8cbbaa691ff791b406f433e318c",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 43,
"avg_line_length": 15,
"alnum_prop": 0.6410256410256411,
"repo_name": "CNinnovation/powercampwindows10",
"id": "8fcb79e00c58e5a7f78381c5e7f8ebcf790e4c65",
"size": "195",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "custommvvm/UsingCustomMVVM/UsingCustomMVVM/ViewModels/MainViewModel.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "694683"
},
{
"name": "CSS",
"bytes": "718"
},
{
"name": "JavaScript",
"bytes": "34"
}
],
"symlink_target": ""
} |
namespace FetchOBotApi
{
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
[JsonConverter(typeof(StringEnumConverter), true)]
public enum Player
{
Me,
Opponent
}
}
| {
"content_hash": "fc561f043def3f6b6a3bd5d57dddc888",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 54,
"avg_line_length": 17.75,
"alnum_prop": 0.6431924882629108,
"repo_name": "HearthCoder/FetchOBot",
"id": "47b31e762ac91b36fa41ea5f200a768b3968c377",
"size": "215",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "FetchOBot/Enums/Player.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "36225"
}
],
"symlink_target": ""
} |
package org.apache.hadoop.yarn.webapp;
import org.apache.hadoop.classification.InterfaceAudience;
@InterfaceAudience.LimitedPrivate({"YARN", "MapReduce"})
public interface MimeType {
public static final String TEXT = "text/plain; charset=UTF-8";
public static final String HTML = "text/html; charset=UTF-8";
public static final String XML = "text/xml; charset=UTF-8";
public static final String HTTP = "message/http; charset=UTF-8";
public static final String JSON = "application/json; charset=UTF-8";
}
| {
"content_hash": "e1e6e793af1c23c0bca7010d4eff1878",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 70,
"avg_line_length": 34.6,
"alnum_prop": 0.7514450867052023,
"repo_name": "srijeyanthan/hops",
"id": "9fe63b26d65dea168b3d8ae1af37737d718bca3a",
"size": "1325",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/webapp/MimeType.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "AspectJ",
"bytes": "31146"
},
{
"name": "Batchfile",
"bytes": "49561"
},
{
"name": "C",
"bytes": "1065087"
},
{
"name": "C++",
"bytes": "81364"
},
{
"name": "CMake",
"bytes": "32686"
},
{
"name": "CSS",
"bytes": "42221"
},
{
"name": "HTML",
"bytes": "2031435"
},
{
"name": "Java",
"bytes": "36323051"
},
{
"name": "JavaScript",
"bytes": "4688"
},
{
"name": "Perl",
"bytes": "18992"
},
{
"name": "Protocol Buffer",
"bytes": "147182"
},
{
"name": "Python",
"bytes": "11309"
},
{
"name": "Shell",
"bytes": "159501"
},
{
"name": "TeX",
"bytes": "19322"
},
{
"name": "XSLT",
"bytes": "36114"
}
],
"symlink_target": ""
} |
missing_ingredients
===================
tracker to figure out what ingredients are missing for a given recipe
goal: teach myself rails
| {
"content_hash": "a45edfc5480c6465c688653fff39c647",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 69,
"avg_line_length": 27.2,
"alnum_prop": 0.7058823529411765,
"repo_name": "winter991/missing_ingredients",
"id": "7ab426a3884b7800e022f2ee304f28f35247a1ca",
"size": "136",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "1755"
},
{
"name": "CoffeeScript",
"bytes": "211"
},
{
"name": "JavaScript",
"bytes": "664"
},
{
"name": "Ruby",
"bytes": "18523"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="018aba74-9b48-4fc5-ac7f-bf488723d52e" name="Default" comment="">
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/main/java/com/drillmap/saml/contollers/AppEmbeddedServletContainer.java" />
<change type="MOVED" beforePath="$PROJECT_DIR$/src/main/java/com/vdenotaris/spring/boot/security/saml/web/Application.java" afterPath="$PROJECT_DIR$/src/main/java/com/drillmap/saml/Application.java" />
<change type="MOVED" beforePath="$PROJECT_DIR$/src/main/java/com/vdenotaris/spring/boot/security/saml/web/config/MvcConfig.java" afterPath="$PROJECT_DIR$/src/main/java/com/drillmap/saml/config/MvcConfig.java" />
<change type="MOVED" beforePath="$PROJECT_DIR$/src/main/java/com/vdenotaris/spring/boot/security/saml/web/config/WebSecurityConfig.java" afterPath="$PROJECT_DIR$/src/main/java/com/drillmap/saml/config/WebSecurityConfig.java" />
<change type="MOVED" beforePath="$PROJECT_DIR$/src/main/java/com/vdenotaris/spring/boot/security/saml/web/contollers/LandingController.java" afterPath="$PROJECT_DIR$/src/main/java/com/drillmap/saml/contollers/LandingController.java" />
<change type="MOVED" beforePath="$PROJECT_DIR$/src/main/java/com/vdenotaris/spring/boot/security/saml/web/contollers/SSOController.java" afterPath="$PROJECT_DIR$/src/main/java/com/drillmap/saml/contollers/SSOController.java" />
<change type="MOVED" beforePath="$PROJECT_DIR$/src/main/java/com/vdenotaris/spring/boot/security/saml/web/core/CurrentUserHandlerMethodArgumentResolver.java" afterPath="$PROJECT_DIR$/src/main/java/com/drillmap/saml/core/CurrentUserHandlerMethodArgumentResolver.java" />
<change type="MOVED" beforePath="$PROJECT_DIR$/src/main/java/com/vdenotaris/spring/boot/security/saml/web/core/SAMLUserDetailsServiceImpl.java" afterPath="$PROJECT_DIR$/src/main/java/com/drillmap/saml/core/SAMLUserDetailsServiceImpl.java" />
<change type="MOVED" beforePath="$PROJECT_DIR$/src/main/java/com/vdenotaris/spring/boot/security/saml/web/stereotypes/CurrentUser.java" afterPath="$PROJECT_DIR$/src/main/java/com/drillmap/saml/stereotypes/CurrentUser.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/pom.xml" afterPath="$PROJECT_DIR$/pom.xml" />
</list>
<ignored path="spring-boot-security-saml-sample.iws" />
<ignored path=".idea/workspace.xml" />
<option name="TRACKING_ENABLED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
<component name="CreatePatchCommitExecutor">
<option name="PATCH_PATH" value="" />
</component>
<component name="DaemonCodeAnalyzer">
<disable_hints />
</component>
<component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
<component name="FavoritesManager">
<favorites_list name="spring-boot-security-saml-sample" />
</component>
<component name="FileEditorManager">
<leaf>
<file leaf-file-name="Application.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/main/java/com/drillmap/saml/Application.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="315">
<caret line="20" column="1" selection-start-line="20" selection-start-column="1" selection-end-line="20" selection-end-column="1" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="WebSecurityConfig.java" pinned="false" current="true" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/main/java/com/drillmap/saml/config/WebSecurityConfig.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="4.327044" vertical-offset="1191" max-vertical-offset="5670">
<caret line="243" column="65" selection-start-line="243" selection-start-column="39" selection-end-line="243" selection-end-column="65" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
</leaf>
</component>
<component name="FindManager">
<FindUsagesManager>
<setting name="OPEN_NEW_TAB" value="true" />
</FindUsagesManager>
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="GradleLocalSettings">
<option name="modificationStamps">
<map>
<entry key="$PROJECT_DIR$/../spring-security-saml/gradle" value="2817879954000" />
</map>
</option>
</component>
<component name="IdeDocumentHistory">
<option name="changedFiles">
<list>
<option value="$PROJECT_DIR$/src/main/java/com/vdenotaris/spring/boot/security/saml/web/contollers/AppembeddedServletContainer.java" />
<option value="$PROJECT_DIR$/src/main/java/com/vdenotaris/spring/boot/security/saml/web/contollers/AppEmbeddedServletContainer.java" />
<option value="$PROJECT_DIR$/src/main/resources/metadata/idp.xml" />
<option value="$PROJECT_DIR$/src/main/resources/metadata/httplocalhost8080samlsamplesamlmetadata_sp.xml" />
<option value="$PROJECT_DIR$/src/main/resources/application.properties" />
<option value="$PROJECT_DIR$/src/main/resources/metadata/localhost_9091_samlgate.xml" />
<option value="$PROJECT_DIR$/pom.xml" />
<option value="$PROJECT_DIR$/src/main/java/com/vdenotaris/spring/boot/security/saml/web/config/WebSecurityConfig.java" />
<option value="$PROJECT_DIR$/src/main/java/com/drillmap/saml/config/MvcConfig.java" />
<option value="$PROJECT_DIR$/src/main/java/com/drillmap/saml/contollers/LandingController.java" />
<option value="$PROJECT_DIR$/src/main/java/com/drillmap/saml/contollers/SSOController.java" />
<option value="$PROJECT_DIR$/src/main/java/com/drillmap/saml/core/CurrentUserHandlerMethodArgumentResolver.java" />
<option value="$PROJECT_DIR$/src/main/java/com/drillmap/saml/core/SAMLUserDetailsServiceImpl.java" />
<option value="$PROJECT_DIR$/src/main/java/com/drillmap/saml/stereotypes/CurrentUser.java" />
<option value="$PROJECT_DIR$/src/main/java/com/drillmap/saml/Application.java" />
<option value="$PROJECT_DIR$/src/main/java/com/drillmap/saml/config/WebSecurityConfig.java" />
</list>
</option>
</component>
<component name="MavenImportPreferences">
<option name="generalSettings">
<MavenGeneralSettings>
<option name="mavenHome" value="$USER_HOME$/tools/apache-maven-3.2.1" />
</MavenGeneralSettings>
</option>
</component>
<component name="MavenProjectNavigator">
<treeState>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="" />
<option name="myItemType" value="org.jetbrains.idea.maven.navigator.MavenProjectsStructure$RootNode" />
</PATH_ELEMENT>
</PATH>
</treeState>
</component>
<component name="ProjectFrameBounds">
<option name="x" value="1440" />
<option name="width" value="1920" />
<option name="height" value="1080" />
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
<OptionsSetting value="true" id="Add" />
<OptionsSetting value="true" id="Remove" />
<OptionsSetting value="true" id="Checkout" />
<OptionsSetting value="true" id="Update" />
<OptionsSetting value="true" id="Status" />
<OptionsSetting value="true" id="Edit" />
<OptionsSetting value="true" id="Undo Check Out" />
<OptionsSetting value="true" id="Get Latest Version" />
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectReloadState">
<option name="STATE" value="2" />
</component>
<component name="ProjectView">
<navigator currentView="ProjectPane" proportions="" version="1">
<flattenPackages />
<showMembers />
<showModules />
<showLibraryContents />
<hideEmptyPackages ProjectPane="false" />
<abbreviatePackageNames />
<autoscrollToSource />
<autoscrollFromSource />
<sortByType />
</navigator>
<panes>
<pane id="PackagesPane" />
<pane id="Scope" />
<pane id="ProjectPane">
<subPane>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="security-saml-webapp" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="security-saml-webapp" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="security-saml-webapp" />
<option name="myItemType" value="com.android.tools.idea.gradle.projectView.AndroidPsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="security-saml-webapp" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="security-saml-webapp" />
<option name="myItemType" value="com.android.tools.idea.gradle.projectView.AndroidPsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="src" />
<option name="myItemType" value="com.android.tools.idea.gradle.projectView.AndroidPsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="main" />
<option name="myItemType" value="com.android.tools.idea.gradle.projectView.AndroidPsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="resources" />
<option name="myItemType" value="com.android.tools.idea.gradle.projectView.AndroidPsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="security-saml-webapp" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="security-saml-webapp" />
<option name="myItemType" value="com.android.tools.idea.gradle.projectView.AndroidPsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="src" />
<option name="myItemType" value="com.android.tools.idea.gradle.projectView.AndroidPsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="main" />
<option name="myItemType" value="com.android.tools.idea.gradle.projectView.AndroidPsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="resources" />
<option name="myItemType" value="com.android.tools.idea.gradle.projectView.AndroidPsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="saml" />
<option name="myItemType" value="com.android.tools.idea.gradle.projectView.AndroidPsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="security-saml-webapp" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="security-saml-webapp" />
<option name="myItemType" value="com.android.tools.idea.gradle.projectView.AndroidPsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="src" />
<option name="myItemType" value="com.android.tools.idea.gradle.projectView.AndroidPsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="main" />
<option name="myItemType" value="com.android.tools.idea.gradle.projectView.AndroidPsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="java" />
<option name="myItemType" value="com.android.tools.idea.gradle.projectView.AndroidPsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="com" />
<option name="myItemType" value="com.android.tools.idea.gradle.projectView.AndroidPsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="drillmap" />
<option name="myItemType" value="com.android.tools.idea.gradle.projectView.AndroidPsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="saml" />
<option name="myItemType" value="com.android.tools.idea.gradle.projectView.AndroidPsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="security-saml-webapp" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="security-saml-webapp" />
<option name="myItemType" value="com.android.tools.idea.gradle.projectView.AndroidPsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="src" />
<option name="myItemType" value="com.android.tools.idea.gradle.projectView.AndroidPsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="main" />
<option name="myItemType" value="com.android.tools.idea.gradle.projectView.AndroidPsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="java" />
<option name="myItemType" value="com.android.tools.idea.gradle.projectView.AndroidPsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="com" />
<option name="myItemType" value="com.android.tools.idea.gradle.projectView.AndroidPsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="drillmap" />
<option name="myItemType" value="com.android.tools.idea.gradle.projectView.AndroidPsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="saml" />
<option name="myItemType" value="com.android.tools.idea.gradle.projectView.AndroidPsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="stereotypes" />
<option name="myItemType" value="com.android.tools.idea.gradle.projectView.AndroidPsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="security-saml-webapp" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="security-saml-webapp" />
<option name="myItemType" value="com.android.tools.idea.gradle.projectView.AndroidPsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="src" />
<option name="myItemType" value="com.android.tools.idea.gradle.projectView.AndroidPsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="main" />
<option name="myItemType" value="com.android.tools.idea.gradle.projectView.AndroidPsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="java" />
<option name="myItemType" value="com.android.tools.idea.gradle.projectView.AndroidPsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="com" />
<option name="myItemType" value="com.android.tools.idea.gradle.projectView.AndroidPsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="drillmap" />
<option name="myItemType" value="com.android.tools.idea.gradle.projectView.AndroidPsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="saml" />
<option name="myItemType" value="com.android.tools.idea.gradle.projectView.AndroidPsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="contollers" />
<option name="myItemType" value="com.android.tools.idea.gradle.projectView.AndroidPsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="security-saml-webapp" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="security-saml-webapp" />
<option name="myItemType" value="com.android.tools.idea.gradle.projectView.AndroidPsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="src" />
<option name="myItemType" value="com.android.tools.idea.gradle.projectView.AndroidPsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="main" />
<option name="myItemType" value="com.android.tools.idea.gradle.projectView.AndroidPsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="java" />
<option name="myItemType" value="com.android.tools.idea.gradle.projectView.AndroidPsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="com" />
<option name="myItemType" value="com.android.tools.idea.gradle.projectView.AndroidPsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="drillmap" />
<option name="myItemType" value="com.android.tools.idea.gradle.projectView.AndroidPsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="saml" />
<option name="myItemType" value="com.android.tools.idea.gradle.projectView.AndroidPsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="config" />
<option name="myItemType" value="com.android.tools.idea.gradle.projectView.AndroidPsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
</subPane>
</pane>
</panes>
</component>
<component name="PropertiesComponent">
<property name="GoToClass.includeLibraries" value="false" />
<property name="GoToClass.toSaveIncludeLibraries" value="false" />
<property name="GoToFile.includeJavaFiles" value="false" />
<property name="MemberChooser.sorted" value="false" />
<property name="MemberChooser.showClasses" value="true" />
<property name="MemberChooser.copyJavadoc" value="false" />
<property name="options.lastSelected" value="MavenSettings" />
<property name="options.splitter.main.proportions" value="0.3" />
<property name="options.splitter.details.proportions" value="0.2" />
<property name="options.searchVisible" value="true" />
<property name="recentsLimit" value="5" />
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="FullScreen" value="true" />
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
<property name="dynamic.classpath" value="false" />
</component>
<component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/src/main/resources/saml" />
<recent name="$PROJECT_DIR$/src/main/resources/metadata" />
</key>
</component>
<component name="RunManager" selected="Application.Application">
<configuration default="false" name="Application" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea">
<pattern>
<option name="PATTERN" value="com.vdenotaris.spring.boot.security.saml.web.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<option name="MAIN_CLASS_NAME" value="com.drillmap.saml.Application" />
<option name="VM_PARAMETERS" />
<option name="PROGRAM_PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<module name="security-saml-webapp" />
<envs />
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Run" />
<method />
</configuration>
<configuration default="true" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
<module name="" />
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
<option name="PROGRAM_PARAMETERS" />
<method />
</configuration>
<configuration default="true" type="GrailsRunConfigurationType" factoryName="Grails">
<module name="" />
<setting name="vmparams" value="" />
<setting name="cmdLine" value="run-app" />
<setting name="depsClasspath" value="false" />
<setting name="passParentEnv" value="true" />
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<setting name="launchBrowser" value="false" />
<method />
</configuration>
<configuration default="true" type="MavenRunConfiguration" factoryName="Maven">
<MavenSettings>
<option name="myGeneralSettings" />
<option name="myRunnerSettings" />
<option name="myRunnerParameters">
<MavenRunnerParameters>
<option name="profiles">
<set />
</option>
<option name="goals">
<list />
</option>
<option name="profilesMap">
<map />
</option>
<option name="resolveToWorkspace" value="false" />
<option name="workingDirPath" value="" />
</MavenRunnerParameters>
</option>
</MavenSettings>
<method />
</configuration>
<configuration default="true" type="Remote" factoryName="Remote">
<option name="USE_SOCKET_TRANSPORT" value="true" />
<option name="SERVER_MODE" value="false" />
<option name="SHMEM_ADDRESS" value="javadebug" />
<option name="HOST" value="localhost" />
<option name="PORT" value="5005" />
<method />
</configuration>
<configuration default="true" type="JavascriptDebugType" factoryName="JavaScript Debug">
<method />
</configuration>
<configuration default="true" type="Applet" factoryName="Applet">
<module name="" />
<option name="MAIN_CLASS_NAME" />
<option name="HTML_FILE_NAME" />
<option name="HTML_USED" value="false" />
<option name="WIDTH" value="400" />
<option name="HEIGHT" value="300" />
<option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
<option name="VM_PARAMETERS" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<method />
</configuration>
<configuration default="true" type="TestNG" factoryName="TestNG">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<module name="" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="SUITE_NAME" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="GROUP_NAME" />
<option name="TEST_OBJECT" value="CLASS" />
<option name="VM_PARAMETERS" value="-ea" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="OUTPUT_DIRECTORY" />
<option name="ANNOTATION_TYPE" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="moduleWithDependencies" />
</option>
<option name="USE_DEFAULT_REPORTERS" value="false" />
<option name="PROPERTIES_FILE" />
<envs />
<properties />
<listeners />
<method />
</configuration>
<configuration default="true" type="NodeJSConfigurationType" factoryName="Node.js" working-dir="">
<method />
</configuration>
<configuration default="true" type="JUnit" factoryName="JUnit">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<module name="" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="TEST_OBJECT" value="class" />
<option name="VM_PARAMETERS" value="-ea" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="moduleWithDependencies" />
</option>
<envs />
<patterns />
<method />
</configuration>
<configuration default="true" type="FlashRunConfigurationType" factoryName="Flash App">
<option name="BCName" value="" />
<option name="IOSSimulatorSdkPath" value="" />
<option name="adlOptions" value="" />
<option name="airProgramParameters" value="" />
<option name="appDescriptorForEmulator" value="Android" />
<option name="debugTransport" value="USB" />
<option name="debuggerSdkRaw" value="BC SDK" />
<option name="emulator" value="NexusOne" />
<option name="emulatorAdlOptions" value="" />
<option name="fastPackaging" value="true" />
<option name="fullScreenHeight" value="0" />
<option name="fullScreenWidth" value="0" />
<option name="launchUrl" value="false" />
<option name="launcherParameters">
<LauncherParameters>
<option name="browser" value="a7bb68e0-33c0-4d6f-a81a-aac1fdb870c8" />
<option name="launcherType" value="OSDefault" />
<option name="newPlayerInstance" value="false" />
<option name="playerPath" value="/Applications/Flash Player Debugger.app" />
</LauncherParameters>
</option>
<option name="mobileRunTarget" value="Emulator" />
<option name="moduleName" value="" />
<option name="overriddenMainClass" value="" />
<option name="overriddenOutputFileName" value="" />
<option name="overrideMainClass" value="false" />
<option name="runTrusted" value="true" />
<option name="screenDpi" value="0" />
<option name="screenHeight" value="0" />
<option name="screenWidth" value="0" />
<option name="url" value="http://" />
<option name="usbDebugPort" value="7936" />
<method />
</configuration>
<configuration default="true" type="AndroidTestRunConfigurationType" factoryName="Android Tests">
<module name="" />
<option name="TESTING_TYPE" value="0" />
<option name="INSTRUMENTATION_RUNNER_CLASS" value="" />
<option name="METHOD_NAME" value="" />
<option name="CLASS_NAME" value="" />
<option name="PACKAGE_NAME" value="" />
<option name="TARGET_SELECTION_MODE" value="EMULATOR" />
<option name="USE_LAST_SELECTED_DEVICE" value="false" />
<option name="PREFERRED_AVD" value="" />
<option name="USE_COMMAND_LINE" value="true" />
<option name="COMMAND_LINE" value="" />
<option name="WIPE_USER_DATA" value="false" />
<option name="DISABLE_BOOT_ANIMATION" value="false" />
<option name="NETWORK_SPEED" value="full" />
<option name="NETWORK_LATENCY" value="none" />
<option name="CLEAR_LOGCAT" value="false" />
<option name="SHOW_LOGCAT_AUTOMATICALLY" value="true" />
<option name="FILTER_LOGCAT_AUTOMATICALLY" value="true" />
<method />
</configuration>
<configuration default="true" type="FlexUnitRunConfigurationType" factoryName="FlexUnit" appDescriptorForEmulator="Android" class_name="" emulatorAdlOptions="" method_name="" package_name="" scope="Class">
<option name="BCName" value="" />
<option name="launcherParameters">
<LauncherParameters>
<option name="browser" value="a7bb68e0-33c0-4d6f-a81a-aac1fdb870c8" />
<option name="launcherType" value="OSDefault" />
<option name="newPlayerInstance" value="false" />
<option name="playerPath" value="/Applications/Flash Player Debugger.app" />
</LauncherParameters>
</option>
<option name="moduleName" value="" />
<option name="trusted" value="true" />
<method />
</configuration>
<configuration default="true" type="CucumberJavaRunConfigurationType" factoryName="Cucumber java">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<option name="myFilePath" />
<option name="GLUE" />
<option name="myNameFilter" />
<option name="myGeneratedName" />
<option name="MAIN_CLASS_NAME" />
<option name="VM_PARAMETERS" />
<option name="PROGRAM_PARAMETERS" />
<option name="WORKING_DIRECTORY" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<module name="" />
<envs />
<method />
</configuration>
<configuration default="true" type="Application" factoryName="Application">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<option name="MAIN_CLASS_NAME" />
<option name="VM_PARAMETERS" />
<option name="PROGRAM_PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<module name="" />
<envs />
<method />
</configuration>
<configuration default="true" type="AndroidRunConfigurationType" factoryName="Android Application">
<module name="" />
<option name="ACTIVITY_CLASS" value="" />
<option name="MODE" value="default_activity" />
<option name="DEPLOY" value="true" />
<option name="ARTIFACT_NAME" value="" />
<option name="TARGET_SELECTION_MODE" value="EMULATOR" />
<option name="USE_LAST_SELECTED_DEVICE" value="false" />
<option name="PREFERRED_AVD" value="" />
<option name="USE_COMMAND_LINE" value="true" />
<option name="COMMAND_LINE" value="" />
<option name="WIPE_USER_DATA" value="false" />
<option name="DISABLE_BOOT_ANIMATION" value="false" />
<option name="NETWORK_SPEED" value="full" />
<option name="NETWORK_LATENCY" value="none" />
<option name="CLEAR_LOGCAT" value="false" />
<option name="SHOW_LOGCAT_AUTOMATICALLY" value="true" />
<option name="FILTER_LOGCAT_AUTOMATICALLY" value="true" />
<method />
</configuration>
<list size="1">
<item index="0" class="java.lang.String" itemvalue="Application.Application" />
</list>
<recent_temporary>
<list size="1">
<item index="0" class="java.lang.String" itemvalue="Application.Application" />
</list>
</recent_temporary>
<configuration name="<template>" type="WebApp" default="true" selected="false">
<Host>localhost</Host>
<Port>5050</Port>
</configuration>
</component>
<component name="ShelveChangesManager" show_recycled="false" />
<component name="Talios.JiraConfigurationComponent" enableIssueTracking="false" autoRefresh="false" useExternalBrowser="false" refreshTimeout="0" annotateissues="false">
<servers />
<columns>
<column id="created" position="0" width="-1" />
<column id="key" position="1" width="-1" />
<column id="component" position="2" width="-1" />
<column id="title" position="3" width="-1" />
<column id="type" position="4" width="-1" />
<column id="priority" position="5" width="-1" />
<column id="status" position="6" width="-1" />
<column id="resolution" position="7" width="-1" />
<column id="assignee" position="8" width="-1" />
<column id="reporter" position="9" width="-1" />
<column id="updated" position="10" width="-1" />
<column id="dueDate" position="11" width="-1" />
<column id="version" position="12" width="-1" />
<column id="fixVersion" position="13" width="-1" />
</columns>
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="018aba74-9b48-4fc5-ac7f-bf488723d52e" name="Default" comment="" />
<created>1409021905478</created>
<updated>1409021905478</updated>
<workItem from="1409021909002" duration="12000" />
<workItem from="1409021923316" duration="10917000" />
<workItem from="1409088206703" duration="8000" />
<workItem from="1409088216449" duration="2833000" />
</task>
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="13770000" />
</component>
<component name="TodoView" selected-index="0">
<todo-panel id="selected-file">
<are-packages-shown value="false" />
<are-modules-shown value="false" />
<flatten-packages value="false" />
<is-autoscroll-to-source value="true" />
</todo-panel>
<todo-panel id="all">
<are-packages-shown value="true" />
<are-modules-shown value="false" />
<flatten-packages value="false" />
<is-autoscroll-to-source value="true" />
</todo-panel>
<todo-panel id="default-changelist">
<are-packages-shown value="false" />
<are-modules-shown value="false" />
<flatten-packages value="false" />
<is-autoscroll-to-source value="false" />
</todo-panel>
</component>
<component name="ToolWindowManager">
<frame x="1440" y="0" width="1920" height="1080" extended-state="0" />
<editor active="true" />
<layout>
<window_info id="Palette	" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="17" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="JRebel Executor" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="11" side_tool="true" content_ui="tabs" />
<window_info id="IDEtalk Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="10" side_tool="false" content_ui="tabs" />
<window_info id="IDEtalk" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="9" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="12" side_tool="false" content_ui="tabs" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3292683" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Application Servers" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="13" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.2518637" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="Jenkins" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.46036586" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Designer" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
<window_info id="Atlassian " active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="14" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="15" side_tool="false" content_ui="tabs" />
<window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Bean Validation" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="5" side_tool="true" content_ui="tabs" />
<window_info id="JRebel" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="true" content_ui="tabs" />
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3292683" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32960597" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="SonarQube" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="16" side_tool="false" content_ui="tabs" />
<window_info id="Java Enterprise" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="9" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3292683" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Web" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="4" side_tool="true" content_ui="tabs" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
</layout>
</component>
<component name="Vcs.Log.UiProperties">
<option name="RECENTLY_FILTERED_USER_GROUPS">
<collection />
</option>
<option name="RECENTLY_FILTERED_BRANCH_GROUPS">
<collection />
</option>
</component>
<component name="VcsContentAnnotationSettings">
<option name="myLimit" value="2678400000" />
</component>
<component name="VcsManagerConfiguration">
<option name="myTodoPanelSettings">
<TodoPanelSettings />
</option>
</component>
<component name="XDebuggerManager">
<breakpoint-manager />
</component>
<component name="antWorkspaceConfiguration">
<option name="IS_AUTOSCROLL_TO_SOURCE" value="false" />
<option name="FILTER_TARGETS" value="false" />
</component>
<component name="atlassian-ide-plugin-workspace">
<option name="bambooConfiguration">
<BambooWorkspaceConfiguration>
<option name="view">
<BambooViewConfigurationBean />
</option>
</BambooWorkspaceConfiguration>
</option>
<option name="defaultCredentials">
<UserCfgBean />
</option>
</component>
<component name="atlassian-ide-plugin-workspace-issues">
<option name="view">
<JiraViewConfigurationBean>
<option name="viewFilterId" value="" />
</JiraViewConfigurationBean>
</option>
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/pom.xml">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="1110" max-vertical-offset="1410">
<caret line="74" column="17" selection-start-line="74" selection-start-column="17" selection-end-line="74" selection-end-column="17" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/com/drillmap/saml/config/WebSecurityConfig.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="1103" max-vertical-offset="5745">
<caret line="101" column="41" selection-start-line="101" selection-start-column="37" selection-end-line="101" selection-end-column="41" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="jar://$MAVEN_REPOSITORY$/org/opensaml/opensaml/2.5.3/opensaml-2.5.3-sources.jar!/org/opensaml/saml2/metadata/provider/HTTPMetadataProvider.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="1620" max-vertical-offset="5445">
<caret line="108" column="11" selection-start-line="108" selection-start-column="11" selection-end-line="108" selection-end-column="11" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/com/drillmap/saml/core/SAMLUserDetailsServiceImpl.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="480" max-vertical-offset="1020">
<caret line="32" column="13" selection-start-line="32" selection-start-column="13" selection-end-line="32" selection-end-column="13" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/com/drillmap/saml/config/MvcConfig.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="435" max-vertical-offset="765">
<caret line="29" column="13" selection-start-line="29" selection-start-column="13" selection-end-line="29" selection-end-column="13" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/pom.xml">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="1410">
<caret line="74" column="17" selection-start-line="74" selection-start-column="17" selection-end-line="74" selection-end-column="17" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/com/drillmap/saml/config/WebSecurityConfig.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="1103" max-vertical-offset="5775">
<caret line="101" column="41" selection-start-line="101" selection-start-column="37" selection-end-line="101" selection-end-column="41" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="jar://$MAVEN_REPOSITORY$/org/opensaml/opensaml/2.5.3/opensaml-2.5.3-sources.jar!/org/opensaml/saml2/metadata/provider/HTTPMetadataProvider.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="1620" max-vertical-offset="5445">
<caret line="108" column="11" selection-start-line="108" selection-start-column="11" selection-end-line="108" selection-end-column="11" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/com/drillmap/saml/core/SAMLUserDetailsServiceImpl.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="480" max-vertical-offset="1020">
<caret line="32" column="13" selection-start-line="32" selection-start-column="13" selection-end-line="32" selection-end-column="13" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/com/drillmap/saml/config/MvcConfig.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="435" max-vertical-offset="765">
<caret line="29" column="13" selection-start-line="29" selection-start-column="13" selection-end-line="29" selection-end-column="13" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/resources/saml/samlBindings.xml">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="1170">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
</state>
</provider>
</entry>
<entry file="jar://$MAVEN_REPOSITORY$/org/opensaml/openws/1.4.4/openws-1.4.4-sources.jar!/org/opensaml/util/resource/ClasspathResource.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.3322785" vertical-offset="195" max-vertical-offset="1740">
<caret line="47" column="11" selection-start-line="47" selection-start-column="11" selection-end-line="47" selection-end-column="11" />
<folding />
</state>
</provider>
</entry>
<entry file="jar://$MAVEN_REPOSITORY$/org/opensaml/opensaml/2.5.3/opensaml-2.5.3-sources.jar!/org/opensaml/saml2/metadata/provider/ResourceBackedMetadataProvider.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.3322785" vertical-offset="300" max-vertical-offset="1800">
<caret line="55" column="11" selection-start-line="55" selection-start-column="11" selection-end-line="55" selection-end-column="11" />
<folding />
</state>
</provider>
</entry>
<entry file="jar:///Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/src.zip!/java/util/List.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.3322785" vertical-offset="1065" max-vertical-offset="8745">
<caret line="108" column="17" selection-start-line="108" selection-start-column="17" selection-end-line="108" selection-end-column="17" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/resources/application.properties">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.023734177" vertical-offset="0" max-vertical-offset="632">
<caret line="1" column="31" selection-start-line="1" selection-start-column="26" selection-end-line="1" selection-end-column="31" />
</state>
</provider>
</entry>
<entry file="jar://$MAVEN_REPOSITORY$/org/springframework/security/spring-security-config/3.2.4.RELEASE/spring-security-config-3.2.4.RELEASE.jar!/org/springframework/security/config/annotation/web/configuration/WebSecurityConfigurerAdapter.class">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.34680134" vertical-offset="229" max-vertical-offset="1320">
<caret line="30" column="77" selection-start-line="30" selection-start-column="77" selection-end-line="30" selection-end-column="77" />
</state>
</provider>
</entry>
<entry file="jar://$MAVEN_REPOSITORY$/org/springframework/security/extensions/spring-security-saml2-core/1.0.0.RC2/spring-security-saml2-core-1.0.0.RC2.jar!/org/springframework/security/saml/metadata/ExtendedMetadata.class">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.3322785" vertical-offset="180" max-vertical-offset="1365">
<caret line="27" column="16" selection-start-line="27" selection-start-column="16" selection-end-line="27" selection-end-column="16" />
</state>
</provider>
</entry>
<entry file="jar://$MAVEN_REPOSITORY$/org/springframework/security/extensions/spring-security-saml2-core/1.0.0.RC2/spring-security-saml2-core-1.0.0.RC2-sources.jar!/org/springframework/security/saml/metadata/ExtendedMetadata.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.28481013" vertical-offset="0" max-vertical-offset="5250">
<caret line="26" column="13" selection-start-line="26" selection-start-column="13" selection-end-line="26" selection-end-column="13" />
<folding />
</state>
</provider>
</entry>
<entry file="jar:///Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/src.zip!/java/lang/String.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.3322785" vertical-offset="900" max-vertical-offset="45075">
<caret line="107" column="19" selection-start-line="107" selection-start-column="19" selection-end-line="107" selection-end-column="19" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/pom.xml">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.5548961" vertical-offset="736" max-vertical-offset="1410">
<caret line="74" column="17" selection-start-line="74" selection-start-column="17" selection-end-line="74" selection-end-column="17" />
<folding />
</state>
</provider>
</entry>
<entry file="jar://$MAVEN_REPOSITORY$/org/opensaml/opensaml/2.5.3/opensaml-2.5.3-sources.jar!/org/opensaml/saml2/metadata/provider/HTTPMetadataProvider.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="660" max-vertical-offset="4740">
<caret line="108" column="11" selection-start-line="108" selection-start-column="11" selection-end-line="108" selection-end-column="11" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/com/drillmap/saml/config/MvcConfig.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="503">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/com/drillmap/saml/contollers/SSOController.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="956">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/com/drillmap/saml/contollers/LandingController.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="632">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/com/drillmap/saml/core/CurrentUserHandlerMethodArgumentResolver.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="956">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/com/drillmap/saml/core/SAMLUserDetailsServiceImpl.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="956">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/com/drillmap/saml/Application.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="315">
<caret line="20" column="1" selection-start-line="20" selection-start-column="1" selection-end-line="20" selection-end-column="1" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/com/drillmap/saml/stereotypes/CurrentUser.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.20874752" vertical-offset="0" max-vertical-offset="503">
<caret line="11" column="18" selection-start-line="11" selection-start-column="18" selection-end-line="11" selection-end-column="18" />
<folding />
</state>
</provider>
</entry>
<entry file="jar:///Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib/rt.jar!/sun/security/provider/JavaKeyStore.class">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="2.2959185" vertical-offset="0" max-vertical-offset="1215">
<caret line="76" column="0" selection-start-line="76" selection-start-column="0" selection-end-line="76" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/resources/saml/samlKeystore.jks">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="1035">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/com/drillmap/saml/contollers/AppEmbeddedServletContainer.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.5666004" vertical-offset="0" max-vertical-offset="503">
<caret line="19" column="37" selection-start-line="19" selection-start-column="37" selection-end-line="19" selection-end-column="37" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/com/drillmap/saml/config/WebSecurityConfig.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="4.327044" vertical-offset="1191" max-vertical-offset="5670">
<caret line="243" column="65" selection-start-line="243" selection-start-column="39" selection-end-line="243" selection-end-column="65" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</component>
<component name="mavenExecuteGoalHistory">
<option value="$PROJECT_DIR$" />
<option value="clean install" />
</component>
</project>
| {
"content_hash": "71356f0b6d6e0a264b09df018c5a0954",
"timestamp": "",
"source": "github",
"line_count": 1069,
"max_line_length": 275,
"avg_line_length": 58.05706267539757,
"alnum_prop": 0.6452636836762644,
"repo_name": "Haybu/security_saml_webapp",
"id": "7ce1045dbb9b6e3c7e92aa4affb106904c8f7789",
"size": "62063",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": ".idea/workspace.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "25142"
}
],
"symlink_target": ""
} |
package org.codinjustu.tools.jenkins.view;
import org.codinjustu.tools.jenkins.action.ThreadFunctor;
import org.codinjustu.tools.jenkins.model.Build;
import org.codinjustu.tools.jenkins.model.BuildStatusEnum;
import org.codinjustu.tools.jenkins.util.GuiUtil;
import org.codinjustu.tools.jenkins.util.SwingUtils;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Map;
import java.util.Map.Entry;
import static org.codinjustu.tools.jenkins.model.BuildStatusEnum.SUCCESS;
public class RssLatestJobPanel implements RssLatestJobView {
private JPanel rssContentPanel;
private JPanel rootPanel;
public RssLatestJobPanel() {
rssContentPanel.setLayout(new BoxLayout(rssContentPanel, BoxLayout.Y_AXIS));
}
public void cleanRssEntries() {
SwingUtils.runInSwingThread(new ThreadFunctor() {
public void run() {
rssContentPanel.invalidate();
Component[] components = rssContentPanel.getComponents();
for (Component component : components) {
if (component instanceof BuildResultPanel) {
rssContentPanel.remove(component);
}
}
rssContentPanel.validate();
rssContentPanel.repaint();
}
});
}
public void addFinishedBuild(final Map<String, Build> stringBuildMap) {
SwingUtils.runInSwingThread(new ThreadFunctor() {
public void run() {
for (Entry<String, Build> entry : stringBuildMap.entrySet()) {
addFinishedBuild(entry.getKey(), entry.getValue());
}
rssContentPanel.repaint();
}
});
}
private void addFinishedBuild(String jobName, Build build) {
String buildMessage = createLinkLabel(build);
Icon icon = setIcon(build);
BuildResultPanel buildResultPanel = new BuildResultPanel(jobName, buildMessage, icon, build.getUrl());
buildResultPanel.getCloseButton()
.addActionListener(new ClosePanelAction(rssContentPanel, buildResultPanel));
rssContentPanel.add(buildResultPanel);
}
private static String createLinkLabel(Build build) {
return "Build #" + build.getNumber() + " " + build.getStatusValue();
}
private static Icon setIcon(Build build) {
if (SUCCESS.equals(build.getStatus())) {
return GuiUtil.loadIcon("accept.png");
} else if (BuildStatusEnum.ABORTED.equals(build.getStatus())) {
return GuiUtil.loadIcon("aborted.png");
}
return GuiUtil.loadIcon("cancel.png");
}
private class ClosePanelAction implements ActionListener {
private final JPanel parentPanel;
private final JPanel childPanel;
private ClosePanelAction(JPanel parentPanel, JPanel childPanel) {
this.parentPanel = parentPanel;
this.childPanel = childPanel;
}
public void actionPerformed(ActionEvent e) {
parentPanel.getRootPane().invalidate();
parentPanel.remove(childPanel);
parentPanel.getRootPane().validate();
parentPanel.repaint();
}
}
}
| {
"content_hash": "e87d83a649e823c2894498d5a2840eb7",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 110,
"avg_line_length": 31.91346153846154,
"alnum_prop": 0.6447725218439289,
"repo_name": "jenkinsci/intellij-jenkins-control-plugin",
"id": "08efa18508d291229f3b7d0699a854fc13f3c339",
"size": "3319",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/org/codinjustu/tools/jenkins/view/RssLatestJobPanel.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "98180"
}
],
"symlink_target": ""
} |
using Chloe.DbExpressions;
using Chloe.RDBMS;
namespace Chloe.SQLite.MethodHandlers
{
class DiffYears_Handler : IMethodHandler
{
public bool CanProcess(DbMethodCallExpression exp)
{
if (exp.Method.DeclaringType != PublicConstants.TypeOfSql)
return false;
return true;
}
public void Process(DbMethodCallExpression exp, SqlGeneratorBase generator)
{
SqlGenerator.Append_DiffYears(generator, exp.Arguments[0], exp.Arguments[1]);
}
}
}
| {
"content_hash": "6b7066def0191bfef36b8afae03a63e0",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 89,
"avg_line_length": 27.35,
"alnum_prop": 0.6398537477148081,
"repo_name": "shuxinqin/Chloe",
"id": "4b91a7cdbda7b77fdc1b893bfbf370a3bbd28b3d",
"size": "549",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Chloe.SQLite/MethodHandlers/DiffYears_Handler.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "485"
},
{
"name": "C#",
"bytes": "2203199"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "2302edf339e32a7494ee562993ae0b9e",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 31,
"avg_line_length": 9.692307692307692,
"alnum_prop": 0.7063492063492064,
"repo_name": "mdoering/backbone",
"id": "b45ac2eb32ca618a492aa79f9cfaf656c2585704",
"size": "173",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Pteridophyta/Polypodiopsida/Polypodiales/Athyriaceae/Callipteris/Callipteris ovata/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Microsoft.AspNet.Identity;
using System.Data.SqlClient;
using System.Configuration;
using System.Data;
namespace TechProFantasySoccer {
public partial class FantasyPointsDetails : System.Web.UI.Page {
public string UserName;
protected void Page_Load(object sender, EventArgs e) {
if(!HttpContext.Current.User.Identity.IsAuthenticated) {
//Server.Transfer("Default.aspx", true);
Response.Redirect("/Account/Login");
} else {
if(!IsPostBack) {
//Response.Write(@"<script language='javascript'>alert('" + HttpContext.Current.User.Identity.Name + "|" +
//User.Identity.GetUserId() + "|');</script>");
}
UserName = HttpContext.Current.User.Identity.Name;
}
String strConnString = ConfigurationManager.ConnectionStrings["FantasySoccerConnectionString"].ConnectionString;
SqlConnection con = new SqlConnection(strConnString);
SqlCommand cmd = new SqlCommand();
//Populate the grid with all fantasy points earned including each month
cmd.CommandText =
"SELECT " +
"FirstName AS First, " +
"LastName AS Last, " +
"PlayerStats.Month, " +
"Positions.PositionName AS Position, " +
"([PlayerStats].Goals) AS Goals, " +
"([PlayerStats].Shots) AS Shots, " +
"([PlayerStats].Assists) AS Assists, " +
"([PlayerStats].MinPlayed) AS 'Min Played', " +
"([PlayerStats].Fouls) AS Fouls, " +
"([PlayerStats].YellowCards) AS YC, " +
"([PlayerStats].RedCards) AS RC, " +
"([PlayerStats].GoalsAllowed) AS GA, " +
"([PlayerStats].SavesMade) AS Saves, " +
"([PlayerStats].CleanSheets) AS CS, " +
"dbo.CalculateTotalFantasyPoints(([PlayerStats].Goals), " +
" ([PlayerStats].Shots), " +
" ([PlayerStats].Assists), " +
" ([PlayerStats].MinPlayed), " +
" ([PlayerStats].Fouls), " +
" ([PlayerStats].YellowCards), " +
" ([PlayerStats].RedCards), " +
" ([PlayerStats].GoalsAllowed), " +
" ([PlayerStats].SavesMade), " +
" ([PlayerStats].CleanSheets), " +
" Players.PositionRef) AS 'Total Fantasy Pts' " +
"FROM LineupHistory " +
"INNER JOIN Players ON LineupHistory.PlayerId = Players.PlayerId " +
"INNER JOIN PlayerStats ON PlayerStats.PlayerId = LineupHistory.PlayerId AND PlayerStats.Month = LineupHistory.Month " +
"INNER JOIN [Positions] ON [Positions].[PositionRef] = Players.PositionRef " +
"WHERE LineupHistory.UserId = '" + User.Identity.GetUserId() + "' " +
"ORDER BY Month, LastName";
cmd.Connection = con;
try {
DataTable temp = new DataTable();
con.Open();
FantasyDetailsGridView.EmptyDataText = "No Records Found";
temp.Load(cmd.ExecuteReader());
FantasyDetailsGridView.DataSource = temp;
FantasyDetailsGridView.DataBind();
} catch(System.Data.SqlClient.SqlException ex) {
} finally {
con.Close();
}
//Calculate and populate the total fantasy points earned.
cmd.CommandText =
"SELECT " +
"SUM(dbo.CalculateTotalFantasyPoints(([PlayerStats].Goals), " +
" ([PlayerStats].Shots), " +
" ([PlayerStats].Assists), " +
" ([PlayerStats].MinPlayed), " +
" ([PlayerStats].Fouls), " +
" ([PlayerStats].YellowCards), " +
" ([PlayerStats].RedCards), " +
" ([PlayerStats].GoalsAllowed), " +
" ([PlayerStats].SavesMade), " +
" ([PlayerStats].CleanSheets), " +
" Players.PositionRef)) AS 'Total Fantasy Pts' " +
"FROM LineupHistory " +
"INNER JOIN Players ON LineupHistory.PlayerId = Players.PlayerId " +
"INNER JOIN PlayerStats ON PlayerStats.PlayerId = LineupHistory.PlayerId AND PlayerStats.Month = LineupHistory.Month " +
"WHERE LineupHistory.UserId = '" + User.Identity.GetUserId() + "'";
cmd.Connection = con;
try {
con.Open();
/*DataRow[] row = (DataRow[])cmd.ExecuteScalar();
double points = (double)row[0]["Total Fantasy Pts"];*/
var result = cmd.ExecuteScalar();
if(result.ToString() != "") {
decimal points = (decimal)result;
FantasyPointsLabel.Text = points + " pts";
}
} catch(System.Data.SqlClient.SqlException ex) {
} catch(System.InvalidCastException ex) {
Response.Write(ex);
} finally {
con.Close();
}
}
protected void FantasyDetailsGridView_Sorting(object sender, GridViewSortEventArgs e) {
DataTable temp = (DataTable)FantasyDetailsGridView.DataSource;
temp.DefaultView.Sort = e.SortExpression + " " + GetSortDirection(e.SortExpression);
FantasyDetailsGridView.DataSource = temp;
FantasyDetailsGridView.DataBind();
}
private string GetSortDirection(string column) {
// By default, set the sort direction to ascending.
string sortDirection = "ASC";
// Retrieve the last column that was sorted.
string sortExpression = ViewState["SortExpression"] as string;
if(sortExpression != null) {
// Check if the same column is being sorted.
// Otherwise, the default value can be returned.
if(sortExpression == column) {
string lastDirection = ViewState["SortDirection"] as string;
if((lastDirection != null) && (lastDirection == "ASC")) {
sortDirection = "DESC";
}
}
}
// Save new values in ViewState.
ViewState["SortDirection"] = sortDirection;
ViewState["SortExpression"] = column;
return sortDirection;
}
}
} | {
"content_hash": "f31cfebd5874cc59dafd20d4e441eca0",
"timestamp": "",
"source": "github",
"line_count": 162,
"max_line_length": 136,
"avg_line_length": 42.7037037037037,
"alnum_prop": 0.5196588609424689,
"repo_name": "GeraldBecker/TechProFantasySoccer",
"id": "68e238f27f71d7495a94332a352ee31ff5769ee1",
"size": "6920",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "TechProFantasySoccer/TechProFantasySoccer/Team/FantasyPointsDetails.aspx.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "74745"
},
{
"name": "C#",
"bytes": "92429"
},
{
"name": "CSS",
"bytes": "156081"
},
{
"name": "HTML",
"bytes": "5125"
},
{
"name": "JavaScript",
"bytes": "170489"
}
],
"symlink_target": ""
} |
package com.sslproxy.api;
/**
* Response - decrypted message
*
*/
public class Message {
String message;
public Message(String message){
this.message = message;
}
public String getMessage(){
return message;
}
@Override
public String toString() {
return "Message [message=" + message + "]";
}
}
| {
"content_hash": "efbfd4d07800b511f80d5d7b18de6d7e",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 45,
"avg_line_length": 16.42105263157895,
"alnum_prop": 0.6730769230769231,
"repo_name": "gaurav1710/SSLAcceleration",
"id": "a1e3c5e73650792f062b67a9603113d529e7405e",
"size": "312",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/com/sslproxy/api/Message.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "2866"
},
{
"name": "Cuda",
"bytes": "28854"
},
{
"name": "Java",
"bytes": "31753"
},
{
"name": "Makefile",
"bytes": "1059"
}
],
"symlink_target": ""
} |
//
// YWHttpTool.h
// 通信录
//
// Created by yellow on 16/7/12.
// Copyright © 2016年 yellow. All rights reserved.
//
#import <Foundation/Foundation.h>
@class YWUploadParam;
@interface YWHttpTool : NSObject
/**
* 发送get请求
*
* @param URLString 请求的基本的url
* @param parameters 请求的参数字典
* @param success 请求成功的回调
* @param failure 请求失败的回调
*/
+ (void)GET:(NSString *)URLString
parameters:(id)parameters
success:(void (^)(id responseObject))success
failure:(void (^)(NSError *error))failure;
/**
* 发送post请求
*
* @param URLString 请求的基本的url
* @param parameters 请求的参数字典
* @param success 请求成功的回调
* @param failure 请求失败的回调
*/
+ (void)Post:(NSString *)URLString
parameters:(id)parameters
success:(void (^)(id responseObject))success
failure:(void (^)(NSError *error))failure;
/**
* 上传请求
*
* @param URLString 请求的基本的url
* @param parameters 请求的参数字典
* @param success 请求成功的回调
* @param failure 请求失败的回调
*/
+ (void)Upload:(NSString *)URLString
parameters:(id)parameters
uploadParam:(YWUploadParam *)uploadParam
success:(void (^)(id responseObject))success
failure:(void (^)(NSError *error))failure;
@end
| {
"content_hash": "119eac9541a65be9aa7e169d19a44df8",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 51,
"avg_line_length": 21.527272727272727,
"alnum_prop": 0.6630067567567568,
"repo_name": "yellowwing/yueshenglicai",
"id": "bdae792bfb07df28d820bd90a15989393b4b056b",
"size": "1379",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "YueSheng/YueSheng/Tool(工具)/HttpTool/YWHttpTool.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Objective-C",
"bytes": "1288918"
}
],
"symlink_target": ""
} |
package org.apache.hadoop.hive.ql.exec.vector;
/**
* The representation of a vectorized column of struct objects.
*
* Each field is represented by a separate inner ColumnVector. Since this
* ColumnVector doesn't own any per row data other that the isNull flag, the
* isRepeating only covers the isNull array.
*/
public class StructColumnVector extends ColumnVector {
public ColumnVector[] fields;
public StructColumnVector() {
this(VectorizedRowBatch.DEFAULT_SIZE);
}
/**
* Constructor for StructColumnVector
*
* @param len Vector length
* @param fields the field column vectors
*/
public StructColumnVector(int len, ColumnVector... fields) {
super(len);
this.fields = fields;
}
@Override
public void flatten(boolean selectedInUse, int[] sel, int size) {
flattenPush();
for(int i=0; i < fields.length; ++i) {
fields[i].flatten(selectedInUse, sel, size);
}
flattenNoNulls(selectedInUse, sel, size);
}
@Override
public void setElement(int outElementNum, int inputElementNum,
ColumnVector inputVector) {
if (inputVector.isRepeating) {
inputElementNum = 0;
}
if (inputVector.noNulls || !inputVector.isNull[inputElementNum]) {
isNull[outElementNum] = false;
ColumnVector[] inputFields = ((StructColumnVector) inputVector).fields;
for (int i = 0; i < inputFields.length; ++i) {
fields[i].setElement(outElementNum, inputElementNum, inputFields[i]);
}
} else {
noNulls = false;
isNull[outElementNum] = true;
}
}
@Override
public void stringifyValue(StringBuilder buffer, int row) {
if (isRepeating) {
row = 0;
}
if (noNulls || !isNull[row]) {
buffer.append('[');
for(int i=0; i < fields.length; ++i) {
if (i != 0) {
buffer.append(", ");
}
fields[i].stringifyValue(buffer, row);
}
buffer.append(']');
} else {
buffer.append("null");
}
}
@Override
public void ensureSize(int size, boolean preserveData) {
super.ensureSize(size, preserveData);
for(int i=0; i < fields.length; ++i) {
fields[i].ensureSize(size, preserveData);
}
}
@Override
public void reset() {
super.reset();
for(int i =0; i < fields.length; ++i) {
fields[i].reset();
}
}
@Override
public void init() {
super.init();
for(int i =0; i < fields.length; ++i) {
fields[i].init();
}
}
@Override
public void unFlatten() {
super.unFlatten();
for(int i=0; i < fields.length; ++i) {
fields[i].unFlatten();
}
}
@Override
public void setRepeating(boolean isRepeating) {
super.setRepeating(isRepeating);
for(int i=0; i < fields.length; ++i) {
fields[i].setRepeating(isRepeating);
}
}
@Override
public void shallowCopyTo(ColumnVector otherCv) {
throw new UnsupportedOperationException(); // Implement if needed.
}
}
| {
"content_hash": "f7739dacf55e833a0f897a6d6bd28f91",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 77,
"avg_line_length": 24.570247933884296,
"alnum_prop": 0.6236125126135217,
"repo_name": "vergilchiu/hive",
"id": "a3618991c7caef11fb240e3fbf86f6b88a81a0e9",
"size": "3779",
"binary": false,
"copies": "1",
"ref": "refs/heads/branch-2.3-htdc",
"path": "storage-api/src/java/org/apache/hadoop/hive/ql/exec/vector/StructColumnVector.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "54494"
},
{
"name": "Batchfile",
"bytes": "845"
},
{
"name": "C",
"bytes": "28218"
},
{
"name": "C++",
"bytes": "76808"
},
{
"name": "CSS",
"bytes": "4263"
},
{
"name": "GAP",
"bytes": "155326"
},
{
"name": "HTML",
"bytes": "50822"
},
{
"name": "Java",
"bytes": "39751326"
},
{
"name": "JavaScript",
"bytes": "25851"
},
{
"name": "M4",
"bytes": "2276"
},
{
"name": "PHP",
"bytes": "148097"
},
{
"name": "PLSQL",
"bytes": "8797"
},
{
"name": "PLpgSQL",
"bytes": "339745"
},
{
"name": "Perl",
"bytes": "319842"
},
{
"name": "PigLatin",
"bytes": "12333"
},
{
"name": "Protocol Buffer",
"bytes": "8769"
},
{
"name": "Python",
"bytes": "386664"
},
{
"name": "Roff",
"bytes": "5379"
},
{
"name": "SQLPL",
"bytes": "20290"
},
{
"name": "Shell",
"bytes": "313510"
},
{
"name": "Thrift",
"bytes": "107584"
},
{
"name": "XSLT",
"bytes": "7619"
}
],
"symlink_target": ""
} |
.myColorPreview {
display:block;
padding: 8px;
}
.myColorPreviewBorder {
border-width:1px;
border-style: solid;
}
.alignment .sapMListTblHeader th{
vertical-align: middle;
}
.padding .sapMPanelContent {
padding: 0rem;
} | {
"content_hash": "3bccd446dbba325014fd6fb83d3b0a6b",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 33,
"avg_line_length": 16.071428571428573,
"alnum_prop": 0.7422222222222222,
"repo_name": "olirogers/openui5",
"id": "d6ff45502330340f9b7c08db48a3b23b7e325176",
"size": "225",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/sap.m/test/sap/m/demokit/theming/webapp/css/style.css",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "3013495"
},
{
"name": "Gherkin",
"bytes": "16431"
},
{
"name": "HTML",
"bytes": "16645544"
},
{
"name": "Java",
"bytes": "82129"
},
{
"name": "JavaScript",
"bytes": "39340810"
}
],
"symlink_target": ""
} |
using NUnit.Framework;
namespace Rocks.IntegrationTests;
public interface IHaveParams
{
void Foo(int a, params string[] b);
int this[int a, params string[] b] { get; }
}
public static class ParamsTests
{
[Test]
public static void CreateMembersWithParamsArgumentsSpecified()
{
var returnValue = 3;
var expectations = Rock.Create<IHaveParams>();
expectations.Methods().Foo(1, new[] { "b" });
expectations.Indexers().Getters().This(1, new[] { "b" }).Returns(returnValue);
var mock = expectations.Instance();
mock.Foo(1, "b");
var value = mock[1, "b"];
expectations.Verify();
Assert.That(value, Is.EqualTo(returnValue));
}
[Test]
public static void MakeMembersWithParamsArgumentsSpecified()
{
var mock = Rock.Make<IHaveParams>().Instance();
var value = mock[1, "b"];
Assert.Multiple(() =>
{
Assert.That(value, Is.EqualTo(default(int)));
Assert.That(() => mock.Foo(1, "b"), Throws.Nothing);
});
}
[Test]
public static void CreateMembersWithParamsArgumentsNotSpecified()
{
var returnValue = 3;
var expectations = Rock.Create<IHaveParams>();
expectations.Methods().Foo(1, Array.Empty<string>());
expectations.Indexers().Getters().This(1, Array.Empty<string>()).Returns(returnValue);
var mock = expectations.Instance();
mock.Foo(1);
var value = mock[1];
expectations.Verify();
Assert.That(value, Is.EqualTo(returnValue));
}
[Test]
public static void MakeMembersWithParamsArgumentsNotSpecified()
{
var mock = Rock.Make<IHaveParams>().Instance();
var value = mock[1];
Assert.Multiple(() =>
{
Assert.That(value, Is.EqualTo(default(int)));
Assert.That(() => mock.Foo(1), Throws.Nothing);
});
}
} | {
"content_hash": "5ad44d4b17002555d2973baff1b26c75",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 88,
"avg_line_length": 23.38888888888889,
"alnum_prop": 0.6805225653206651,
"repo_name": "JasonBock/Rocks",
"id": "a1e8883ee21921d7170f14e9c59db0d929773cba",
"size": "1686",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "src/Rocks.IntegrationTests/ParamsTests.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "1386390"
},
{
"name": "Smalltalk",
"bytes": "3"
}
],
"symlink_target": ""
} |
var
gulp = require('gulp'),
coffee = require('gulp-coffee'),
concat = require('gulp-concat'),
sass = require('gulp-sass'),
gutil = require('gulp-util'),
uglify = require('gulp-uglify'),
minify = require('gulp-minify-css'),
path = require('path'),
express = require('express'),
build = gutil.env.gh ? './gh-pages/' : './build/';
function onError(err) {
gutil.log(err);
gutil.beep();
this.emit('end');
}
gulp.task('coffee', function () {
return gulp.src('src/**/*.coffee')
.pipe(coffee())
.on('error', onError)
.pipe(concat('app.js'))
.pipe(gulp.dest(build));
});
gulp.task('sass', function () {
return gulp.src('src/styles/style.scss')
.pipe(sass())
.on('error', onError)
.pipe(concat('style.css'))
.pipe(gulp.dest(build));
});
gulp.task('images', function () {
return gulp.src('src/images/*')
.pipe(gulp.dest(build));
});
gulp.task('index', function () {
return gulp.src('src/index.html')
.pipe(gulp.dest(build));
});
gulp.task('build', [
'index',
'coffee',
'sass',
'images'
]);
gulp.task('default', ['build'], function () {
if (!gutil.env.gh) {
gulp.watch(['src/**'], ['build']);
var
app = express(),
port = 8888;
app.use(express.static(path.resolve(build)));
app.listen(port, function() {
gutil.log('Listening on', port);
});
}
});
| {
"content_hash": "4f6fab1093d969cab7c6e577a1f8846f",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 50,
"avg_line_length": 20.661538461538463,
"alnum_prop": 0.5860014892032762,
"repo_name": "brandly/moire",
"id": "882d252e7ada8834e24d5bb7a7a06e8f0537024c",
"size": "1343",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "gulpfile.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "2746"
},
{
"name": "CoffeeScript",
"bytes": "3232"
},
{
"name": "JavaScript",
"bytes": "1343"
}
],
"symlink_target": ""
} |
include(FindPackageHandleStandardArgs)
if (WIN32)
# Find include files
find_path(
ASSIMP_INCLUDE_DIR
NAMES assimp/config.h
PATHS
$ENV{PROGRAMFILES}/include
${ASSIMP_ROOT_DIR}/include
DOC "The directory where GL/glew.h resides")
# Use glew32s.lib for static library
# Define additional compiler definitions
if (ASSIMP_USE_STATIC_LIBS)
set(ASSIMP_LIBRARY_NAME glew32s)
set(ASSIMP_DEFINITIONS -DASSIMP_STATIC)
else()
set(ASSIMP_LIBRARY_NAME glew32)
endif()
# Find library files
find_library(
ASSIMP_LIBRARY
NAMES ${ASSIMP_LIBRARY_NAME}
PATHS
$ENV{PROGRAMFILES}/ASSIMP/lib
${ASSIMP_ROOT_DIR}/lib
DOC "The ASSIMP library")
unset(ASSIMP_LIBRARY_NAME)
else()
# Find include files
find_path(
ASSIMP_INCLUDE_DIR
NAMES assimp/config.h
PATHS
/usr/include
/usr/local/include
/sw/include
/opt/local/include
${ASSIMP_ROOT_DIR}/include
DOC "The directory where GL/glew.h resides")
# Find library files
# Try to use static libraries
find_library(
ASSIMP_LIBRARY
NAMES assimp ASSIMP
PATHS
/usr/lib64
/usr/lib
/usr/local/lib64
/usr/local/lib
/sw/lib
/opt/local/lib
${ASSIMP_ROOT_DIR}/lib
DOC "The ASSIMP library")
endif()
# Handle REQUIRD argument, define *_FOUND variable
find_package_handle_standard_args(ASSIMP DEFAULT_MSG ASSIMP_INCLUDE_DIR ASSIMP_LIBRARY)
# Define ASSIMP_LIBRARIES and ASSIMP_INCLUDE_DIRS
if (ASSIMP_FOUND)
set(ASSIMP_LIBRARIES ${ASSIMP_LIBRARY})
set(ASSIMP_INCLUDE_DIRS ${ASSIMP_INCLUDE_DIR})
endif()
# Hide some variables
mark_as_advanced(ASSIMP_INCLUDE_DIR ASSIMP_LIBRARY)
| {
"content_hash": "c84de39cc39828a9faa7d7544045d640",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 87,
"avg_line_length": 22.183098591549296,
"alnum_prop": 0.7358730158730159,
"repo_name": "danem/SimpleGL",
"id": "512c7baf75d236d6b063192ae12e6af007690150",
"size": "1575",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "cmake/FindASSIMP.cmake",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "251068"
},
{
"name": "C++",
"bytes": "182096"
},
{
"name": "CMake",
"bytes": "17703"
},
{
"name": "GLSL",
"bytes": "12670"
}
],
"symlink_target": ""
} |
package org.eclipse.m2m.atl.engine.emfvm.lib;
/**
* OCL simple type.
*
* @author <a href="mailto:[email protected]">Frederic Jouault</a>
* @author <a href="mailto:[email protected]">William Piers</a>
*/
public class OclSimpleType extends OclType {
/**
* Constructor.
*
* @param name
* the type name
*/
public OclSimpleType(String name) {
super();
setName(name);
}
/**
* Constructor.
*/
public OclSimpleType() {
super();
}
/**
* {@inheritDoc}
*
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (obj instanceof OclSimpleType) {
return ((OclSimpleType)obj).getName().equals(getName());
}
return super.equals(obj);
}
/**
* {@inheritDoc}
*
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
return super.hashCode();
}
/**
* {@inheritDoc}
*
* @see org.eclipse.m2m.atl.engine.emfvm.lib.OclType#conformsTo(org.eclipse.m2m.atl.engine.emfvm.lib.OclType)
*/
@Override
public boolean conformsTo(OclType other) {
boolean ret = equals(other);
if (!ret && other != null) {
Class<? extends Object> currentClass = getNativeClassfromOclTypeName(getName());
Class<? extends Object> otherClass = getNativeClassfromOclTypeName(other.getName());
ret = otherClass.isAssignableFrom(currentClass);
}
return ret;
}
}
| {
"content_hash": "3eac9f2cf829afae15284ae93c0f50e9",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 110,
"avg_line_length": 20.02857142857143,
"alnum_prop": 0.6554921540656206,
"repo_name": "valeriocos/jbrex",
"id": "1e721519e897dbb652b25037ef4e2fe3033c02ad",
"size": "1971",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "org.eclipse.m2m.atl.engine.emfvm/src/org/eclipse/m2m/atl/engine/emfvm/lib/OclSimpleType.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "715345"
},
{
"name": "HTML",
"bytes": "2726"
},
{
"name": "Java",
"bytes": "406419"
}
],
"symlink_target": ""
} |
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { UsersService, IUser } from '../../../services';
@Component({
selector: 'source-form',
templateUrl: './form.component.html',
styleUrls: ['./form.component.scss'],
viewProviders: [ UsersService ],
})
export class UsersFormComponent implements OnInit {
display_name: string;
email: string;
id: string;
admin: boolean;
user: IUser;
action: string;
constructor(private _usersService: UsersService, private _route: ActivatedRoute) {}
goBack(): void {
window.history.back();
}
ngOnInit(): void {
this._route.url.subscribe(url => {
this.action = (url.length > 1 ? url[1].path : 'add');
});
this._route.params.subscribe((params: {id: string}) => {
let userId: string = params.id;
this._usersService.get(userId).subscribe((user: any) => {
this.display_name = user.display_name;
this.email = user.email;
this.admin = (user.site_admin === 1 ? true : false);
this.id = user.id;
});
});
}
save(): void {
let site_admin: number = (this.admin ? 1 : 0);
let now: Date = new Date();
this.user = {
display_name: this.display_name,
email: this.email,
site_admin: site_admin,
id: this.id || this.display_name.replace(/\s+/g, '.'),
created: now,
last_access: now,
};
if (this.action === 'add') {
this._usersService.create(this.user).subscribe(() => {
this.goBack();
});
} else {
this._usersService.update(this.id, this.user).subscribe(() => {
this.goBack();
});
}
}
}
| {
"content_hash": "1d54ae3fbf42593f4b7d4ecd1251e14d",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 85,
"avg_line_length": 26.234375,
"alnum_prop": 0.5848719475878499,
"repo_name": "hifiguy/covalent",
"id": "98f748cd18e40d9582a067843b643da23d73207b",
"size": "1679",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/app/users/+form/form.component.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "7327"
},
{
"name": "HTML",
"bytes": "100537"
},
{
"name": "JavaScript",
"bytes": "2123"
},
{
"name": "Shell",
"bytes": "615"
},
{
"name": "TypeScript",
"bytes": "71005"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_45) on Fri Mar 06 22:15:03 CST 2015 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
Uses of Package org.apache.hadoop.yarn.server.api.protocolrecords.impl.pb (hadoop-yarn-server-common 2.3.0 API)
</TITLE>
<META NAME="date" CONTENT="2015-03-06">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Package org.apache.hadoop.yarn.server.api.protocolrecords.impl.pb (hadoop-yarn-server-common 2.3.0 API)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV
NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../../../../index.html?org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/package-use.html" target="_top"><B>FRAMES</B></A>
<A HREF="package-use.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<CENTER>
<H2>
<B>Uses of Package<br>org.apache.hadoop.yarn.server.api.protocolrecords.impl.pb</B></H2>
</CENTER>
No usage of org.apache.hadoop.yarn.server.api.protocolrecords.impl.pb
<P>
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV
NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../../../../index.html?org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/package-use.html" target="_top"><B>FRAMES</B></A>
<A HREF="package-use.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
Copyright © 2015 <a href="http://www.apache.org">Apache Software Foundation</a>. All Rights Reserved.
</BODY>
</HTML>
| {
"content_hash": "c58180eeb262b801e4dc87d65c77ed3a",
"timestamp": "",
"source": "github",
"line_count": 145,
"max_line_length": 171,
"avg_line_length": 42.744827586206895,
"alnum_prop": 0.6047111971603744,
"repo_name": "jsrudani/HadoopHDFSProject",
"id": "e9af840b4b405b8a0a8c27ca591430a6ed9f13ee",
"size": "6198",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/target/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/package-use.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "AspectJ",
"bytes": "31146"
},
{
"name": "C",
"bytes": "1198902"
},
{
"name": "C++",
"bytes": "164551"
},
{
"name": "CMake",
"bytes": "131069"
},
{
"name": "CSS",
"bytes": "131494"
},
{
"name": "Erlang",
"bytes": "464"
},
{
"name": "HTML",
"bytes": "485534855"
},
{
"name": "Java",
"bytes": "37974886"
},
{
"name": "JavaScript",
"bytes": "80446"
},
{
"name": "Makefile",
"bytes": "104088"
},
{
"name": "Perl",
"bytes": "18992"
},
{
"name": "Protocol Buffer",
"bytes": "159216"
},
{
"name": "Python",
"bytes": "11309"
},
{
"name": "Shell",
"bytes": "724779"
},
{
"name": "TeX",
"bytes": "19322"
},
{
"name": "XSLT",
"bytes": "91404"
}
],
"symlink_target": ""
} |
import GeoJSON from '../src/ol/format/GeoJSON.js';
import Graticule from '../src/ol/layer/Graticule.js';
import Map from '../src/ol/Map.js';
import Projection from '../src/ol/proj/Projection.js';
import VectorLayer from '../src/ol/layer/Vector.js';
import VectorSource from '../src/ol/source/Vector.js';
import View from '../src/ol/View.js';
import proj4 from 'proj4';
import {Fill, Style} from '../src/ol/style.js';
import {register} from '../src/ol/proj/proj4.js';
proj4.defs(
'ESRI:53009',
'+proj=moll +lon_0=0 +x_0=0 +y_0=0 +a=6371000 ' +
'+b=6371000 +units=m +no_defs'
);
register(proj4);
// Configure the Sphere Mollweide projection object with an extent,
// and a world extent. These are required for the Graticule.
const sphereMollweideProjection = new Projection({
code: 'ESRI:53009',
extent: [
-18019909.21177587, -9009954.605703328, 18019909.21177587,
9009954.605703328,
],
worldExtent: [-179, -89.99, 179, 89.99],
});
const style = new Style({
fill: new Fill({
color: '#eeeeee',
}),
});
const map = new Map({
keyboardEventTarget: document,
layers: [
new VectorLayer({
source: new VectorSource({
url: 'https://openlayers.org/data/vector/ecoregions.json',
format: new GeoJSON(),
}),
style: function (feature) {
const color = feature.get('COLOR_BIO') || '#eeeeee';
style.getFill().setColor(color);
return style;
},
}),
new Graticule(),
],
target: 'map',
view: new View({
center: [0, 0],
projection: sphereMollweideProjection,
zoom: 2,
}),
});
| {
"content_hash": "440d22977994fa49bb3ac55cb960149e",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 67,
"avg_line_length": 27.379310344827587,
"alnum_prop": 0.6385390428211587,
"repo_name": "oterral/ol3",
"id": "b8d18612c73ea4b97271665fa651cc4d4ce63e29",
"size": "1588",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "examples/sphere-mollweide.js",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "CSS",
"bytes": "19353"
},
{
"name": "HTML",
"bytes": "3701"
},
{
"name": "JavaScript",
"bytes": "5270815"
},
{
"name": "Shell",
"bytes": "3952"
}
],
"symlink_target": ""
} |
package com.eharmony.services.swagger.resource;
import com.eharmony.services.swagger.model.Dashboard;
import com.eharmony.services.swagger.persistence.DashboardRepository;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.apache.commons.lang.Validate;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.util.List;
@Component
@Path("/1.0/dashboards")
@Produces({MediaType.APPLICATION_JSON})
@Consumes({MediaType.APPLICATION_JSON})
@Api(value = "Dashboard Repository Resource")
public class DashboardRepositoryResource {
private static final Log LOG = LogFactory.getLog(DashboardRepositoryResource.class);
@Autowired
DashboardRepository repository;
/**
* Returns a list of dashboards, sorted by dashboard name.
*/
@GET
@ApiOperation(value = "Get All Dashboards",
notes = "Returns a list of dashboards, sorted by dashboard name")
@ApiResponses({
@ApiResponse(code = 200, message = "The list of all dashboards sorted by dashboard name",
response = Dashboard.class,
responseContainer = "List"),
@ApiResponse(code = 500, message = "An error occurred when retrieving the list of dashboards")
})
public Response getAllDashboards() {
try {
List<Dashboard> dashboards = repository.getAllDashboards();
return Response.ok().entity(dashboards).build();
} catch (Exception ex) {
LOG.error("Unable to retrieve dashboards", ex);
return Response.serverError().build();
}
}
/**
* Saves a services dashboard. Validates all required fields. If the same service name and
* environment is found, it is overwritten.
*
* @param dashboard The unique dashboard id.
*/
@PUT
@Path(value = "/{id}")
@ApiOperation(value = "Save dashboard",
notes = "Saves a services dashboard. Validates all required fields. If the same service name and " +
"environment is found, it is overwritten.")
@ApiResponses({
@ApiResponse(code = 200, message = "The dashboard was overwritten successfully."),
@ApiResponse(code = 201, message = "The dashboard was created successfully."),
@ApiResponse(code = 400, message = "A required field is missing."),
@ApiResponse(code = 500, message = "An error occurred when attempting to save the dashboard.")
})
public Response saveDashboard(
@PathParam(value = "id") @ApiParam(value = "The unique dashboard id.") String dashboardId,
@ApiParam(value = "A dashboard object") Dashboard dashboard) {
try {
validateDashboard(dashboard);
repository.saveDashboard(dashboard);
return Response.ok(dashboard).build();
} catch (IllegalArgumentException iae) {
return Response.status(400).entity(iae.getMessage()).build();
} catch (Exception ex) {
LOG.error("Unable to save dashboard", ex);
return Response.serverError().build();
}
}
/**
* Retrieves a services dashboard by id.
*
* @param dashboardId The unique dashboard id.
*/
@GET
@Path(value = "/{id}")
@ApiOperation(value = "Find dashboard by id",
notes = "Retrieves a services dashboard by id.")
@ApiResponses({
@ApiResponse(code = 200, message = "The dashboard was found for the given id.",
response = Dashboard.class),
@ApiResponse(code = 404, message = "The dashboard was not found for that id."),
@ApiResponse(code = 500, message = "An error occurred when attempting to retrieve the dashboard.")
})
public Response getDashboardById(
@PathParam(value = "id") @ApiParam(value = "The unique dashboard id.") String dashboardId) {
try {
Dashboard dashboard = repository.getDashboardById(dashboardId);
if (dashboard == null) {
return Response.status(404).build();
}
return Response.ok().entity(dashboard).build();
} catch (Exception ex) {
LOG.error("Unable to retrieve dashboard", ex);
return Response.serverError().build();
}
}
/**
* Remove dashboard by id.
*
* @param dashboardId The unique dashboard id.
*/
@DELETE
@Path(value = "/{id}")
@ApiOperation(value = "Remove dashboard",
notes = "Removes a services dashboard by id.")
@ApiResponses({
@ApiResponse(code = 200, message = "The dashboard was removed successfully."),
@ApiResponse(code = 404, message = "The dashboard was not found for that id."),
@ApiResponse(code = 500, message = "An error occurred when attempting to remove the dashboard.")
})
public Response removeDashboardById(
@PathParam(value = "id") @ApiParam(value = "The unique dashboard id.") String dashboardId) {
try {
if (repository.getDashboardById(dashboardId) == null) {
return Response.status(404).build();
}
repository.removeDashboardById(dashboardId);
return Response.ok().build();
} catch (Exception ex) {
LOG.error("Unable to remove dashboard", ex);
return Response.serverError().build();
}
}
/**
* Validates required fields on the dashboard instance.
*
* @param dashboard dashboard to validate
*/
private void validateDashboard(Dashboard dashboard) {
Validate.notEmpty(dashboard.getName(), "Name is required");
Validate.notEmpty(dashboard.getId(), "ID is required");
Validate.notEmpty(dashboard.getDescription(), "Description is required");
Validate.notEmpty(dashboard.getDocumentationIds(), "At least one documentation ID is required");
}
}
| {
"content_hash": "e90d73b6166e0b2d2f3b98f09d01fa65",
"timestamp": "",
"source": "github",
"line_count": 164,
"max_line_length": 112,
"avg_line_length": 39.792682926829265,
"alnum_prop": 0.6397486975176219,
"repo_name": "eHarmony/eh-swagger-repository",
"id": "a714a1ddc9dc707c81a8b6818b7169fcf680d42c",
"size": "7118",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/com/eharmony/services/swagger/resource/DashboardRepositoryResource.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "1692"
},
{
"name": "HTML",
"bytes": "20734"
},
{
"name": "Java",
"bytes": "72480"
},
{
"name": "JavaScript",
"bytes": "17475"
}
],
"symlink_target": ""
} |
#include "kernel.h"
#include <iostream>
#include <string>
#include <fstream>
#include <algorithm>
#include <limits>
namespace vm
{
Kernel::Kernel(Scheduler scheduler, std::vector<std::string> executables_paths)
: machine(), processes(), priorities(), scheduler(scheduler),
_last_issued_process_id(0),
_current_process_index(0),
_cycles_passed_after_preemption(0)
{
// Memory
machine.mmu.ram[0] = _free_physical_memory_index = 0; //freep in K&R
machine.mmu.ram[1] = machine.mmu.ram.size() - 2;
// Process page faults (find an empty frame)
machine.pic.isr_4 = [&]() {
std::cout << "Kernel: page fault." << std::endl;
MMU::page_entry_type page = machine.cpu.registers.a;
MMU::page_entry_type frame = machine.mmu.AcquireFrame();
if(frame != MMU::INVALID_PAGE)
{
(*(machine.mmu.page_table))[page] = frame;
}
else
{
machine.Stop();
}
};
// Process Management
std::for_each(executables_paths.begin(), executables_paths.end(), [&](const std::string &path) {
CreateProcess(path);
});
if (!processes.empty()) {
std::cout << "Kernel: setting the first process: " << processes[_current_process_index].id << " for execution." << std::endl;
machine.cpu.registers = processes[_current_process_index].registers;
machine.mmu.page_table = processes[_current_process_index].page_table;
processes[_current_process_index].state = Process::Running;
}
if (scheduler == FirstComeFirstServed || scheduler == ShortestJob) {
machine.pic.isr_0 = [&]() {};
machine.pic.isr_3 = [&]() {};
} else if (scheduler == RoundRobin) {
machine.pic.isr_0 = [&]() {
std::cout << "Kernel: processing the timer interrupt." << std::endl;
if (!processes.empty()) {
if (_cycles_passed_after_preemption <= Kernel::_MAX_CYCLES_BEFORE_PREEMPTION)
{
std::cout << "Kernel: allowing the current process " << processes[_current_process_index].id << " to run." << std::endl;
++_cycles_passed_after_preemption;
std::cout << "Kernel: the current cycle is " << _cycles_passed_after_preemption << std::endl;
} else {
if (processes.size() > 1) {
std::cout << "Kernel: switching the context from process " << processes[_current_process_index].id;
processes[_current_process_index].registers = machine.cpu.registers;
processes[_current_process_index].state = Process::Ready;
_current_process_index = (_current_process_index + 1) % processes.size();
std::cout << " to process " << processes[_current_process_index].id << std::endl;
machine.cpu.registers = processes[_current_process_index].registers;
machine.mmu.page_table = processes[_current_process_index].page_table;
processes[_current_process_index].state = Process::Running;
}
_cycles_passed_after_preemption = 0;
}
}
std::cout << std::endl;
};
//251 stroka machine.mmu.page_table posle znaka ravno u Rema
machine.pic.isr_3 = [&]() {
std::cout << "Kernel: processing the first software interrupt." << std::endl;
if (!processes.empty()) {
std::cout << "Kernel: unloading the process " << processes[_current_process_index].id << std::endl;
// TODO: free process memory with FreePhysicalMemory
processes.erase(processes.begin() + _current_process_index);
if (processes.empty()) {
_current_process_index = 0;
std::cout << "Kernel: no more processes. Stopping the machine." << std::endl;
machine.Stop();
} else {
if (_current_process_index >= processes.size()) {
_current_process_index %= processes.size();
}
std::cout << "Kernel: switching the context to process " << processes[_current_process_index].id << std::endl;
machine.cpu.registers = processes[_current_process_index].registers;
machine.mmu.page_table = processes[_current_process_index].page_table;
processes[_current_process_index].state = Process::Running;
_cycles_passed_after_preemption = 0;
}
}
std::cout << std::endl;
};
} else if (scheduler == Priority) {
machine.pic.isr_0 = [&]() {};
machine.pic.isr_3 = [&]() {};
}
machine.Start();
}
Kernel::~Kernel() {}
void Kernel::CreateProcess(const std::string &name)
{
if (_last_issued_process_id == std::numeric_limits<Process::process_id_type>::max()) {
std::cerr << "Kernel: failed to create a new process. The maximum number of processes has been reached." << std::endl;
} else {
std::ifstream input_stream(name, std::ios::in | std::ios::binary);
if (!input_stream) {
std::cerr << "Kernel: failed to open the program file." << std::endl;
} else {
MMU::ram_type ops;
input_stream.seekg(0, std::ios::end);
auto file_size = input_stream.tellg();
input_stream.seekg(0, std::ios::beg);
ops.resize(static_cast<MMU::ram_size_type>(file_size) / 4);
input_stream.read(reinterpret_cast<char *>(&ops[0]), file_size);
if (input_stream.bad()) {
std::cerr << "Kernel: failed to read the program file." << std::endl;
} else {
MMU::ram_size_type new_memory_position = -1; // TODO: allocate memory for the process (AllocateMemory)
if (new_memory_position == -1) {
std::cerr << "Kernel: failed to allocate memory." << std::endl;
} else {
std::copy(ops.begin(), ops.end(), (machine.mmu.ram.begin() + new_memory_position));
Process process(_last_issued_process_id++, new_memory_position,
new_memory_position + ops.size());
// Old sequential allocation
//
// std::copy(ops.begin(), ops.end(), (machine.memory.ram.begin() + _last_ram_position));
//
// Process process(_last_issued_process_id++, _last_ram_position,
// _last_ram_position + ops.size());
//
// _last_ram_position += ops.size();
}
}
}
}
}
MMU::ram_size_type Kernel::AllocateMemory(MMU::ram_size_type units)
{
/*
TODO:
Task 1: allocate physical memory by using a free list with the next fit
approach.
You can adapt the algorithm from the book
The C Programming Language (Second Edition)
by Brian W. Kernighan and Dennis M. Ritchie
(8.7 Example - A Storage Allocator).
Task 2: adapt the algorithm to work with your virtual memory subsystem.
*/
return -1;
}
void Kernel::FreeMemory(MMU::ram_size_type physical_memory_index)
{
/*
TODO:
Task 1: free physical memory
You can adapt the algorithm from the book
The C Programming Language (Second Edition)
by Brian W. Kernighan and Dennis M. Ritchie
(8.7 Example - A Storage Allocator).
Task 2: adapt the algorithm to work with your virtual memory subsystem
*/
}
}
| {
"content_hash": "29e0f10f562a72c530682d608ba130a7",
"timestamp": "",
"source": "github",
"line_count": 215,
"max_line_length": 144,
"avg_line_length": 39.17674418604651,
"alnum_prop": 0.5040959278166924,
"repo_name": "ChipaKraken/vm",
"id": "d89f65e2987cc7df8acb9f0f9169faf14713819f",
"size": "8423",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": ".fr-sLUnau/Part 2/SVM/SVM/kernel.cpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C++",
"bytes": "52171"
}
],
"symlink_target": ""
} |
* Heat Water
* Determine Temperature
* MeltIce
* Add Coffee and Sugar
* Mix Ingredients Fork
* Add Milk
* Stir Mug
* DrinkCoffee
* GetFireExtinguisher | {
"content_hash": "b14e0b1cba68d98f950150571c84a7ed",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 23,
"avg_line_length": 16.666666666666668,
"alnum_prop": 0.7666666666666667,
"repo_name": "golang-devops/easy-workflow-manager",
"id": "e2bbd8ba114373e6fc527ecacc0d23997f19d361",
"size": "168",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "examples/coffee/README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Go",
"bytes": "32728"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="de">
<head>
<!-- Generated by javadoc (1.8.0_20) on Thu Jul 23 10:45:45 CEST 2015 -->
<title>FXWorkbenchLayout</title>
<meta name="date" content="2015-07-23">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="FXWorkbenchLayout";
}
}
catch(err) {
}
//-->
var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/FXWorkbenchLayout.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/jacpfx/rcp/componentLayout/FXPerspectiveLayout.html" title="class in org.jacpfx.rcp.componentLayout"><span class="typeNameLink">Prev Class</span></a></li>
<li><a href="../../../../org/jacpfx/rcp/componentLayout/PerspectiveLayout.html" title="class in org.jacpfx.rcp.componentLayout"><span class="typeNameLink">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/jacpfx/rcp/componentLayout/FXWorkbenchLayout.html" target="_top">Frames</a></li>
<li><a href="FXWorkbenchLayout.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li><a href="#constructor.summary">Constr</a> | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li><a href="#constructor.detail">Constr</a> | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.jacpfx.rcp.componentLayout</div>
<h2 title="Class FXWorkbenchLayout" class="title">Class FXWorkbenchLayout</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>org.jacpfx.rcp.componentLayout.FXWorkbenchLayout</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd>org.jacpfx.api.componentLayout.BaseLayout<javafx.scene.Node>, org.jacpfx.api.componentLayout.WorkbenchLayout<javafx.scene.Node></dd>
</dl>
<hr>
<br>
<pre>public class <span class="typeNameLabel">FXWorkbenchLayout</span>
extends java.lang.Object
implements org.jacpfx.api.componentLayout.WorkbenchLayout<javafx.scene.Node></pre>
<div class="block">defines basic layout of workbench; define if menus are enabled; declare tool
bars; set workbench size</div>
<dl>
<dt><span class="simpleTagLabel">Author:</span></dt>
<dd>Andy Moncsek</dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../org/jacpfx/rcp/componentLayout/FXWorkbenchLayout.html#FXWorkbenchLayout--">FXWorkbenchLayout</a></span>()</code> </td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>javafx.scene.layout.Pane</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/jacpfx/rcp/componentLayout/FXWorkbenchLayout.html#getGlassPane--">getGlassPane</a></span>()</code>
<div class="block">Gets the glass pane.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code><a href="../../../../org/jacpfx/rcp/components/menuBar/JACPMenuBar.html" title="class in org.jacpfx.rcp.components.menuBar">JACPMenuBar</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/jacpfx/rcp/componentLayout/FXWorkbenchLayout.html#getMenu--">getMenu</a></span>()</code>
<div class="block">Returns the application menu instance.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code><a href="../../../../org/jacpfx/rcp/components/toolBar/JACPToolBar.html" title="class in org.jacpfx.rcp.components.toolBar">JACPToolBar</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/jacpfx/rcp/componentLayout/FXWorkbenchLayout.html#getRegisteredToolBar-org.jacpfx.api.util.ToolbarPosition-">getRegisteredToolBar</a></span>(org.jacpfx.api.util.ToolbarPosition position)</code>
<div class="block">Gets the registered tool bar.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>java.util.Map<org.jacpfx.api.util.ToolbarPosition,<a href="../../../../org/jacpfx/rcp/components/toolBar/JACPToolBar.html" title="class in org.jacpfx.rcp.components.toolBar">JACPToolBar</a>></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/jacpfx/rcp/componentLayout/FXWorkbenchLayout.html#getRegisteredToolBars--">getRegisteredToolBars</a></span>()</code>
<div class="block">Gets all registered tool bars.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code><S extends java.lang.Enum><br>S</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/jacpfx/rcp/componentLayout/FXWorkbenchLayout.html#getStyle--">getStyle</a></span>()</code>
<div class="block">Returns the workbench style.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>org.jacpfx.api.util.Tupel<java.lang.Integer,java.lang.Integer></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/jacpfx/rcp/componentLayout/FXWorkbenchLayout.html#getWorkbenchSize--">getWorkbenchSize</a></span>()</code>
<div class="block">Returns a tuple defining the workbench size.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/jacpfx/rcp/componentLayout/FXWorkbenchLayout.html#isMenuEnabled--">isMenuEnabled</a></span>()</code>
<div class="block">Check if menus are enabled.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/jacpfx/rcp/componentLayout/FXWorkbenchLayout.html#registerToolBar-org.jacpfx.api.util.ToolbarPosition-">registerToolBar</a></span>(org.jacpfx.api.util.ToolbarPosition position)</code>
<div class="block">Register a toolbar for the workbench
All toolbars are added with the same priority, thus the priority is given
by the order of registration.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/jacpfx/rcp/componentLayout/FXWorkbenchLayout.html#registerToolBars-org.jacpfx.api.util.ToolbarPosition...-">registerToolBars</a></span>(org.jacpfx.api.util.ToolbarPosition... positions)</code>
<div class="block">Register multiple toolbars for the workbench
All toolbars are added with the same priority, thus the priority is given
by the order of registration.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/jacpfx/rcp/componentLayout/FXWorkbenchLayout.html#setMenuEnabled-boolean-">setMenuEnabled</a></span>(boolean enabled)</code>
<div class="block">Set menus to enabled state.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code><S extends java.lang.Enum><br>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/jacpfx/rcp/componentLayout/FXWorkbenchLayout.html#setStyle-S-">setStyle</a></span>(S style)</code>
<div class="block">Set the workbench style.</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/jacpfx/rcp/componentLayout/FXWorkbenchLayout.html#setWorkbenchXYSize-int-int-">setWorkbenchXYSize</a></span>(int x,
int y)</code>
<div class="block">Set the size of the workbench.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="FXWorkbenchLayout--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>FXWorkbenchLayout</h4>
<pre>public FXWorkbenchLayout()</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="isMenuEnabled--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isMenuEnabled</h4>
<pre>public boolean isMenuEnabled()</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code>org.jacpfx.api.componentLayout.WorkbenchLayout</code></span></div>
<div class="block">Check if menus are enabled.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code>isMenuEnabled</code> in interface <code>org.jacpfx.api.componentLayout.WorkbenchLayout<javafx.scene.Node></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>if menu is enable/disable</dd>
</dl>
</li>
</ul>
<a name="setMenuEnabled-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setMenuEnabled</h4>
<pre>public void setMenuEnabled(boolean enabled)</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code>org.jacpfx.api.componentLayout.WorkbenchLayout</code></span></div>
<div class="block">Set menus to enabled state.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code>setMenuEnabled</code> in interface <code>org.jacpfx.api.componentLayout.WorkbenchLayout<javafx.scene.Node></code></dd>
</dl>
</li>
</ul>
<a name="setWorkbenchXYSize-int-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setWorkbenchXYSize</h4>
<pre>public void setWorkbenchXYSize(int x,
int y)</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code>org.jacpfx.api.componentLayout.WorkbenchLayout</code></span></div>
<div class="block">Set the size of the workbench.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code>setWorkbenchXYSize</code> in interface <code>org.jacpfx.api.componentLayout.WorkbenchLayout<javafx.scene.Node></code></dd>
</dl>
</li>
</ul>
<a name="getWorkbenchSize--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getWorkbenchSize</h4>
<pre>public org.jacpfx.api.util.Tupel<java.lang.Integer,java.lang.Integer> getWorkbenchSize()</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code>org.jacpfx.api.componentLayout.WorkbenchLayout</code></span></div>
<div class="block">Returns a tuple defining the workbench size.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code>getWorkbenchSize</code> in interface <code>org.jacpfx.api.componentLayout.WorkbenchLayout<javafx.scene.Node></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the tuple containing the workbench size</dd>
</dl>
</li>
</ul>
<a name="registerToolBars-org.jacpfx.api.util.ToolbarPosition...-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>registerToolBars</h4>
<pre>public void registerToolBars(org.jacpfx.api.util.ToolbarPosition... positions)</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code>org.jacpfx.api.componentLayout.WorkbenchLayout</code></span></div>
<div class="block">Register multiple toolbars for the workbench
<p>
All toolbars are added with the same priority, thus the priority is given
by the order of registration.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code>registerToolBars</code> in interface <code>org.jacpfx.api.componentLayout.WorkbenchLayout<javafx.scene.Node></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>positions</code> - - NORTH, WEST, EAST, SOUTH</dd>
</dl>
</li>
</ul>
<a name="registerToolBar-org.jacpfx.api.util.ToolbarPosition-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>registerToolBar</h4>
<pre>public void registerToolBar(org.jacpfx.api.util.ToolbarPosition position)</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code>org.jacpfx.api.componentLayout.WorkbenchLayout</code></span></div>
<div class="block">Register a toolbar for the workbench
<p>
All toolbars are added with the same priority, thus the priority is given
by the order of registration.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code>registerToolBar</code> in interface <code>org.jacpfx.api.componentLayout.WorkbenchLayout<javafx.scene.Node></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>position</code> - - NORTH, WEST, EAST, SOUTH</dd>
</dl>
</li>
</ul>
<a name="getStyle--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getStyle</h4>
<pre>public <S extends java.lang.Enum> S getStyle()</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code>org.jacpfx.api.componentLayout.WorkbenchLayout</code></span></div>
<div class="block">Returns the workbench style.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code>getStyle</code> in interface <code>org.jacpfx.api.componentLayout.WorkbenchLayout<javafx.scene.Node></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>style</dd>
</dl>
</li>
</ul>
<a name="setStyle-java.lang.Enum-">
<!-- -->
</a><a name="setStyle-S-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setStyle</h4>
<pre>public <S extends java.lang.Enum> void setStyle(S style)</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code>org.jacpfx.api.componentLayout.WorkbenchLayout</code></span></div>
<div class="block">Set the workbench style.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code>setStyle</code> in interface <code>org.jacpfx.api.componentLayout.WorkbenchLayout<javafx.scene.Node></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>style</code> - , the style of workbench</dd>
</dl>
</li>
</ul>
<a name="getMenu--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMenu</h4>
<pre>public <a href="../../../../org/jacpfx/rcp/components/menuBar/JACPMenuBar.html" title="class in org.jacpfx.rcp.components.menuBar">JACPMenuBar</a> getMenu()</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code>org.jacpfx.api.componentLayout.BaseLayout</code></span></div>
<div class="block">Returns the application menu instance.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code>getMenu</code> in interface <code>org.jacpfx.api.componentLayout.BaseLayout<javafx.scene.Node></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the menu instance</dd>
</dl>
</li>
</ul>
<a name="getRegisteredToolBar-org.jacpfx.api.util.ToolbarPosition-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getRegisteredToolBar</h4>
<pre>public <a href="../../../../org/jacpfx/rcp/components/toolBar/JACPToolBar.html" title="class in org.jacpfx.rcp.components.toolBar">JACPToolBar</a> getRegisteredToolBar(org.jacpfx.api.util.ToolbarPosition position)</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code>org.jacpfx.api.componentLayout.BaseLayout</code></span></div>
<div class="block">Gets the registered tool bar.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code>getRegisteredToolBar</code> in interface <code>org.jacpfx.api.componentLayout.BaseLayout<javafx.scene.Node></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>position</code> - the position</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the registered tool bar</dd>
</dl>
</li>
</ul>
<a name="getRegisteredToolBars--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getRegisteredToolBars</h4>
<pre>public java.util.Map<org.jacpfx.api.util.ToolbarPosition,<a href="../../../../org/jacpfx/rcp/components/toolBar/JACPToolBar.html" title="class in org.jacpfx.rcp.components.toolBar">JACPToolBar</a>> getRegisteredToolBars()</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code>org.jacpfx.api.componentLayout.BaseLayout</code></span></div>
<div class="block">Gets all registered tool bars.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code>getRegisteredToolBars</code> in interface <code>org.jacpfx.api.componentLayout.BaseLayout<javafx.scene.Node></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>all registered tool bars</dd>
</dl>
</li>
</ul>
<a name="getGlassPane--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getGlassPane</h4>
<pre>public javafx.scene.layout.Pane getGlassPane()</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code>org.jacpfx.api.componentLayout.BaseLayout</code></span></div>
<div class="block">Gets the glass pane.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code>getGlassPane</code> in interface <code>org.jacpfx.api.componentLayout.BaseLayout<javafx.scene.Node></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the glass pane</dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/FXWorkbenchLayout.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/jacpfx/rcp/componentLayout/FXPerspectiveLayout.html" title="class in org.jacpfx.rcp.componentLayout"><span class="typeNameLink">Prev Class</span></a></li>
<li><a href="../../../../org/jacpfx/rcp/componentLayout/PerspectiveLayout.html" title="class in org.jacpfx.rcp.componentLayout"><span class="typeNameLink">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/jacpfx/rcp/componentLayout/FXWorkbenchLayout.html" target="_top">Frames</a></li>
<li><a href="FXWorkbenchLayout.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li><a href="#constructor.summary">Constr</a> | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li><a href="#constructor.detail">Constr</a> | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
| {
"content_hash": "a70b6f8e947d95f9711cd10bbcc6d04e",
"timestamp": "",
"source": "github",
"line_count": 559,
"max_line_length": 391,
"avg_line_length": 43.29695885509839,
"alnum_prop": 0.689790521836136,
"repo_name": "JacpFX/JacpFX",
"id": "ce28cb7c444ac8462291203a0a6eee37b4ffffc2",
"size": "24203",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "JACP.JavaFX/doc/org/jacpfx/rcp/componentLayout/FXWorkbenchLayout.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "96312"
},
{
"name": "HTML",
"bytes": "6383285"
},
{
"name": "Java",
"bytes": "1549854"
},
{
"name": "JavaScript",
"bytes": "6715"
}
],
"symlink_target": ""
} |
package com.o2d.pkayjava.editor.data;
import com.badlogic.gdx.files.FileHandle;
import com.badlogic.gdx.graphics.g2d.TextureAtlas;
/**
* Created by azakhary on 7/3/2014.
*/
public class SpineAnimData {
public TextureAtlas atlas;
public FileHandle jsonFile;
public String animName;
}
| {
"content_hash": "d03676b2bef1aa4c5acd4a903aeae1b6",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 50,
"avg_line_length": 20.066666666666666,
"alnum_prop": 0.7475083056478405,
"repo_name": "PkayJava/overlap2d-dev",
"id": "5d2a8463721d72bc3b5330aa27779f6be03bb7e0",
"size": "1102",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/com/o2d/pkayjava/editor/data/SpineAnimData.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "1586685"
},
{
"name": "PHP",
"bytes": "32674"
},
{
"name": "Shell",
"bytes": "2063"
}
],
"symlink_target": ""
} |
/**
* Examines each element in a `collection`, returning the first that the `callback`
* returns truthy for. The `callback` is bound to `thisArg` and invoked with three
* arguments; (value, index|key, collection).
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is passed for `callback`, the created "_.where" style callback
* will return `true` for elements that have the properties of the given object,
* else `false`.
*
* @method first
* @static
* @memberOf _
* @alias detect
* @category Collections
* @param {Array|Object|String} collection The collection to iterate over.
* @param {Function|Object|String} [callback=identity] The function called per
* iteration. If a property name or object is passed, it will be used to create
* a "_.pluck" or "_.where" style callback, respectively.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Mixed} Returns the found element, else `undefined`.
*/
function first(array, callback, thisArg) {
if (array) {
var n = 0, length = array.length;
if ("number" != typeof callback && null != callback) {
var index = -1;
for (callback = lodash.createCallback(callback, thisArg); length > ++index && callback(array[index], index, array); ) n++;
} else if (n = callback, null == n || thisArg) return array[0];
return slice(array, 0, nativeMin(nativeMax(0, n), length));
}
} | {
"content_hash": "ebcf7ab93bba27da125d6f1257b10dab",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 134,
"avg_line_length": 44.970588235294116,
"alnum_prop": 0.6697187704381949,
"repo_name": "bahmutov/xplain",
"id": "df2cd8f11c8cae8f79089bcb2b26d3c71abdabf2",
"size": "1529",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/extract-jsdocs/test/data/lodash.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "12400"
},
{
"name": "CoffeeScript",
"bytes": "2517"
},
{
"name": "JavaScript",
"bytes": "147051"
}
],
"symlink_target": ""
} |
cask "activedock" do
version "2.106,2216"
sha256 :no_check
url "https://macplus-software.com/downloads/ActiveDock.zip",
verified: "macplus-software.com/"
name "ActiveDock"
desc "Customizable dock, application launcher, dock replacement"
homepage "https://www.noteifyapp.com/activedock/"
livecheck do
url "https://macplus-software.com/downloads/ActiveDock.xml"
strategy :sparkle
end
depends_on macos: ">= :sierra"
app "ActiveDock #{version.before_comma.major}.app"
end
| {
"content_hash": "5a76640932e67f06761de66713cc33b9",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 66,
"avg_line_length": 26.63157894736842,
"alnum_prop": 0.7193675889328063,
"repo_name": "malob/homebrew-cask",
"id": "e443f641ca07d6b19f4a5c74a3626823334a4563",
"size": "506",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Casks/activedock.rb",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "Dockerfile",
"bytes": "249"
},
{
"name": "Python",
"bytes": "3630"
},
{
"name": "Ruby",
"bytes": "2864635"
},
{
"name": "Shell",
"bytes": "32035"
}
],
"symlink_target": ""
} |
/* expected input format for non-batch
var batch = [];//batch objects look like {id:"ID",symbolID:"SFGPU----------",modifiers:{ModifiersUnits.T_UNIQUE_DESIGNATION_1:"T",MilStdAttributes.PixelSize:50}};
var e.data = {base64:true, batch:batch};
e.data.batch[].id = "ID";
e.data.batch[].symbolID = "SFGPU----------";//A 15 character symbolID corresponding to one of the graphics in the MIL-STD-2525C
e.data.batch[].modifiers = {ModifiersUnits.T_UNIQUE_DESIGNATION_1:"T",MilStdAttributes.PixelSize:50};
e.data.format = "svg", "base64", "both"
if(format === "svg"), return object will have a .svg property with the svg string
if(format === "base64"), return object will have a .base64 property with the svg string like:
"data:image/svg+xml;base64,[SVG string after run through btoa()]
if(format === "both"), return object will have both properties.
*/
/* return object for non-batch
{
id:e.data.id,//same as what was passed in
symbolID:e.data.SymbolID,//resultant kml,json or error message
svg:svg string
anchorPoint:
symbolBounds:
imageBounds:
base64:svg string like: "data:image/svg+xml;base64,[SVG string after run through btoa()]".
}
*/
/* expected input format for batch
var e.data = {};
e.data.batch = {fontInfo:fontInfo,batch:[{id:"ID",symbolID:"SFGPU----------",modifiers:{ModifiersUnits.T_UNIQUE_DESIGNATION_1:"T",MilStdAttributes.PixelSize:50}}]}
*/
/* return object for batch
{
[{id:batch.id,symbolID:batch.symbolID,svg:si.getSVG(),anchorPoint:si.getAnchorPoint(),symbolBounds:si.getSymbolBounds(),bounds:si.getSVGBounds()}]
}
*/
importScripts('sv-c.js');
armyc2.c2sd.renderer.utilities.ErrorLogger = {};
armyc2.c2sd.renderer.utilities.ErrorLogger.LogMessage = function(sourceClass, sourceMethod, message){throw {message:(sourceClass + "-" + sourceMethod + ": " + message)}};
armyc2.c2sd.renderer.utilities.ErrorLogger.LogWarning = function(sourceClass, sourceMethod, message, level){throw {message:(sourceClass + "-" + sourceMethod + ": " + message)}};
armyc2.c2sd.renderer.utilities.ErrorLogger.LogException = function(sourceClass, sourceMethod, err, level)
{
var strMessage = (sourceClass + "." + sourceMethod + "(): " + err.message);
var myStack = "";
if(err.stack !== undefined)
{
myStack = err.stack;
}
if(!(myStack))
{
if(err.filename && err.lineno)
{
myStack = err.filename + " @ line# " + err.lineno;
}
}
strMessage += "\n" + myStack;
err.message += "\n" + myStack;
throw strMessage;
//throw {message:strMessage,error:err, stack:myStack};
};
var window = {};
var console = {};
console.log = console.log || function(){};
console.info = console.info || function(){};
console.warn = console.warn || function(){};
console.error = console.error || function(){};
window.console = console;
var document = {};
onmessage = function(e)
{
var si = null;
var batch = null;
if(e.data !== null)
{
try
{
var returnVal = null;
if(e.data.batch && e.data.batch.length > 0)
{
var batch = e.data.batch;
var returnBatch = [];
var len = e.data.batch.length;
var item = null;
for(var i = 0; i < len; i++)
{
item = batch[i];
si = armyc2.c2sd.renderer.MilStdSVGRenderer.Render(item.symbolID,item.modifiers,e.data.fontInfo);
returnVal = {id:batch.id,symbolID:batch.symbolID,anchorPoint:si.getAnchorPoint(),symbolBounds:si.getSymbolBounds(),bounds:si.getSVGBounds()};
if(e.data.format === "base64")
returnVal.base64 = si.getSVGDataURI();
else if(e.data.format === "both")
{
returnVal.base64 = si.getSVGDataURI();
returnVal.svg = si.getSVG();
}
else
returnVal.svg = si.getSVG();
returnBatch.push(returnVal);
}
if(si !== null)
{
postMessage(returnBatch);
}
else
{
postMessage({error:"no results"});
}
}
else if(e.data.id && e.data.symbolID)
{
si = armyc2.c2sd.renderer.MilStdSVGRenderer.Render(e.data.symbolID,e.data.modifiers,e.data.fontInfo);
if(si !== null)
{
//return results
returnVal = {id:e.data.id,symbolID:e.data.symbolID,svg:si.getSVG(),anchorPoint:si.getAnchorPoint(),symbolBounds:si.getSymbolBounds(),bounds:si.getSVGBounds()};
if(e.data.format === "base64")
returnVal.base64 = si.getSVGDataURI();
else if(e.data.format === "both")
{
returnVal.base64 = si.getSVGDataURI();
returnVal.svg = si.getSVG();
}
else
returnVal.svg = si.getSVG();
postMessage(returnVal);
}
else
{
postMessage({error:"no results"});
}
}
else
{
JSON.stringify(e.data);
postMessage({error:"no batch object or symbol information" + JSON.stringify(e.data)});
}
}
catch(err)
{
armyc2.c2sd.renderer.utilities.ErrorLogger.LogException("SPWorker","onmessage",err);
}
}
}
| {
"content_hash": "ba9a0a1e4f1c46b6d7b62d259b507280",
"timestamp": "",
"source": "github",
"line_count": 165,
"max_line_length": 179,
"avg_line_length": 35.775757575757574,
"alnum_prop": 0.5348128070472641,
"repo_name": "missioncommand/mil-sym-js",
"id": "7ddb951c8534ddae3f0fcf49c8d318fccc7d14a0",
"size": "5903",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "web/js/src/SPWorker.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "14742"
},
{
"name": "HTML",
"bytes": "385198"
},
{
"name": "JavaScript",
"bytes": "6174159"
}
],
"symlink_target": ""
} |
/**
@module ember
@submodule ember-metal
*/
// BEGIN IMPORTS
import Ember from 'ember-metal/core';
import isEnabled, { FEATURES } from 'ember-metal/features';
import merge from 'ember-metal/merge';
import {
instrument,
reset as instrumentationReset,
subscribe as instrumentationSubscribe,
unsubscribe as instrumentationUnsubscribe
} from 'ember-metal/instrumentation';
import {
EMPTY_META,
GUID_KEY,
META_DESC,
apply,
applyStr,
canInvoke,
generateGuid,
guidFor,
inspect,
makeArray,
meta,
deprecatedTryCatchFinally,
tryInvoke,
uuid,
wrap
} from 'ember-metal/utils';
import EmberError from 'ember-metal/error';
import Cache from 'ember-metal/cache';
import Logger from 'ember-metal/logger';
import {
_getPath,
get,
getWithDefault,
normalizeTuple
} from 'ember-metal/property_get';
import {
accumulateListeners,
addListener,
hasListeners,
listenersFor,
on,
removeListener,
sendEvent,
suspendListener,
suspendListeners,
watchedEvents
} from 'ember-metal/events';
import ObserverSet from 'ember-metal/observer_set';
import {
beginPropertyChanges,
changeProperties,
endPropertyChanges,
overrideChains,
propertyDidChange,
propertyWillChange
} from 'ember-metal/property_events';
import {
defineProperty
} from 'ember-metal/properties';
import {
set,
trySet
} from 'ember-metal/property_set';
import {
Map,
MapWithDefault,
OrderedSet
} from 'ember-metal/map';
import getProperties from 'ember-metal/get_properties';
import setProperties from 'ember-metal/set_properties';
import {
watchKey,
unwatchKey
} from 'ember-metal/watch_key';
import {
ChainNode,
finishChains,
flushPendingChains,
removeChainWatcher
} from 'ember-metal/chains';
import {
watchPath,
unwatchPath
} from 'ember-metal/watch_path';
import {
destroy,
isWatching,
rewatch,
unwatch,
watch
} from 'ember-metal/watching';
import expandProperties from 'ember-metal/expand_properties';
import {
ComputedProperty,
computed,
cacheFor
} from 'ember-metal/computed';
import alias from 'ember-metal/alias';
import {
empty,
notEmpty,
none,
not,
bool,
match,
equal,
gt,
gte,
lt,
lte,
oneWay as computedOneWay,
readOnly,
defaultTo,
deprecatingAlias,
and,
or,
any,
collect
} from 'ember-metal/computed_macros';
computed.empty = empty;
computed.notEmpty = notEmpty;
computed.none = none;
computed.not = not;
computed.bool = bool;
computed.match = match;
computed.equal = equal;
computed.gt = gt;
computed.gte = gte;
computed.lt = lt;
computed.lte = lte;
computed.alias = alias;
computed.oneWay = computedOneWay;
computed.reads = computedOneWay;
computed.readOnly = readOnly;
computed.defaultTo = defaultTo;
computed.deprecatingAlias = deprecatingAlias;
computed.and = and;
computed.or = or;
computed.any = any;
computed.collect = collect;
import {
_suspendObserver,
_suspendObservers,
addObserver,
observersFor,
removeObserver
} from 'ember-metal/observer';
import {
IS_BINDING,
Mixin,
aliasMethod,
_immediateObserver,
mixin,
observer,
required
} from 'ember-metal/mixin';
import {
Binding,
bind,
isGlobalPath,
oneWay
} from 'ember-metal/binding';
import run from 'ember-metal/run_loop';
import Libraries from 'ember-metal/libraries';
import isNone from 'ember-metal/is_none';
import isEmpty from 'ember-metal/is_empty';
import isBlank from 'ember-metal/is_blank';
import isPresent from 'ember-metal/is_present';
import Backburner from 'backburner';
import {
isStream,
subscribe,
unsubscribe,
read,
readHash,
readArray,
scanArray,
scanHash,
concat,
chain
} from 'ember-metal/streams/utils';
import Stream from 'ember-metal/streams/stream';
// END IMPORTS
// BEGIN EXPORTS
var EmberInstrumentation = Ember.Instrumentation = {};
EmberInstrumentation.instrument = instrument;
EmberInstrumentation.subscribe = instrumentationSubscribe;
EmberInstrumentation.unsubscribe = instrumentationUnsubscribe;
EmberInstrumentation.reset = instrumentationReset;
Ember.instrument = instrument;
Ember.subscribe = instrumentationSubscribe;
Ember._Cache = Cache;
Ember.generateGuid = generateGuid;
Ember.GUID_KEY = GUID_KEY;
Ember.platform = {
defineProperty: true,
hasPropertyAccessors: true
};
Ember.Error = EmberError;
Ember.guidFor = guidFor;
Ember.META_DESC = META_DESC;
Ember.EMPTY_META = EMPTY_META;
Ember.meta = meta;
Ember.inspect = inspect;
Ember.tryCatchFinally = deprecatedTryCatchFinally;
Ember.makeArray = makeArray;
Ember.canInvoke = canInvoke;
Ember.tryInvoke = tryInvoke;
Ember.wrap = wrap;
Ember.apply = apply;
Ember.applyStr = applyStr;
Ember.uuid = uuid;
Ember.Logger = Logger;
Ember.get = get;
Ember.getWithDefault = getWithDefault;
Ember.normalizeTuple = normalizeTuple;
Ember._getPath = _getPath;
Ember.on = on;
Ember.addListener = addListener;
Ember.removeListener = removeListener;
Ember._suspendListener = suspendListener;
Ember._suspendListeners = suspendListeners;
Ember.sendEvent = sendEvent;
Ember.hasListeners = hasListeners;
Ember.watchedEvents = watchedEvents;
Ember.listenersFor = listenersFor;
Ember.accumulateListeners = accumulateListeners;
Ember._ObserverSet = ObserverSet;
Ember.propertyWillChange = propertyWillChange;
Ember.propertyDidChange = propertyDidChange;
Ember.overrideChains = overrideChains;
Ember.beginPropertyChanges = beginPropertyChanges;
Ember.endPropertyChanges = endPropertyChanges;
Ember.changeProperties = changeProperties;
Ember.defineProperty = defineProperty;
Ember.set = set;
Ember.trySet = trySet;
Ember.OrderedSet = OrderedSet;
Ember.Map = Map;
Ember.MapWithDefault = MapWithDefault;
Ember.getProperties = getProperties;
Ember.setProperties = setProperties;
Ember.watchKey = watchKey;
Ember.unwatchKey = unwatchKey;
Ember.flushPendingChains = flushPendingChains;
Ember.removeChainWatcher = removeChainWatcher;
Ember._ChainNode = ChainNode;
Ember.finishChains = finishChains;
Ember.watchPath = watchPath;
Ember.unwatchPath = unwatchPath;
Ember.watch = watch;
Ember.isWatching = isWatching;
Ember.unwatch = unwatch;
Ember.rewatch = rewatch;
Ember.destroy = destroy;
Ember.expandProperties = expandProperties;
Ember.ComputedProperty = ComputedProperty;
Ember.computed = computed;
Ember.cacheFor = cacheFor;
Ember.addObserver = addObserver;
Ember.observersFor = observersFor;
Ember.removeObserver = removeObserver;
Ember._suspendObserver = _suspendObserver;
Ember._suspendObservers = _suspendObservers;
Ember.IS_BINDING = IS_BINDING;
Ember.required = required;
Ember.aliasMethod = aliasMethod;
Ember.observer = observer;
Ember.immediateObserver = _immediateObserver;
Ember.mixin = mixin;
Ember.Mixin = Mixin;
Ember.oneWay = oneWay;
Ember.bind = bind;
Ember.Binding = Binding;
Ember.isGlobalPath = isGlobalPath;
Ember.run = run;
/**
@class Backburner
@for Ember
@private
*/
Ember.Backburner = Backburner;
// this is the new go forward, once Ember Data updates to using `_Backburner` we
// can remove the non-underscored version.
Ember._Backburner = Backburner;
Ember.libraries = new Libraries();
Ember.libraries.registerCoreLibrary('Ember', Ember.VERSION);
Ember.isNone = isNone;
Ember.isEmpty = isEmpty;
Ember.isBlank = isBlank;
Ember.isPresent = isPresent;
Ember.merge = merge;
if (isEnabled('ember-metal-stream')) {
Ember.stream = {
Stream: Stream,
isStream: isStream,
subscribe: subscribe,
unsubscribe: unsubscribe,
read: read,
readHash: readHash,
readArray: readArray,
scanArray: scanArray,
scanHash: scanHash,
concat: concat,
chain: chain
};
}
Ember.FEATURES = FEATURES;
Ember.FEATURES.isEnabled = isEnabled;
/**
A function may be assigned to `Ember.onerror` to be called when Ember
internals encounter an error. This is useful for specialized error handling
and reporting code.
```javascript
Ember.onerror = function(error) {
Em.$.ajax('/report-error', 'POST', {
stack: error.stack,
otherInformation: 'whatever app state you want to provide'
});
};
```
Internally, `Ember.onerror` is used as Backburner's error handler.
@event onerror
@for Ember
@param {Exception} error the error object
@public
*/
Ember.onerror = null;
// END EXPORTS
import {
assert,
warn,
debug,
deprecate,
deprecateFunc,
runInDebug
} from 'ember-metal/assert';
Ember.assert = assert;
Ember.warn = warn;
Ember.debug = debug;
Ember.deprecate = deprecate;
Ember.deprecateFunc = deprecateFunc;
Ember.runInDebug = runInDebug;
// do this for side-effects of updating Ember.assert, warn, etc when
// ember-debug is present
// This needs to be called before any deprecateFunc
if (Ember.__loader.registry['ember-debug']) {
requireModule('ember-debug');
} else {
Ember.Debug = { };
if (isEnabled('ember-debug-handlers')) {
Ember.Debug.registerDeprecationHandler = function() { };
Ember.Debug.registerWarnHandler = function() { };
}
}
Ember.create = Ember.deprecateFunc('Ember.create is deprecated in favor of Object.create', { id: 'ember-metal.ember-create', until: '3.0.0' }, Object.create);
Ember.keys = Ember.deprecateFunc('Ember.keys is deprecated in favor of Object.keys', { id: 'ember-metal.ember.keys', until: '3.0.0' }, Object.keys);
export default Ember;
| {
"content_hash": "2db9b6d610333a9cee86545695ad9798",
"timestamp": "",
"source": "github",
"line_count": 416,
"max_line_length": 158,
"avg_line_length": 22.634615384615383,
"alnum_prop": 0.7315208156329651,
"repo_name": "eliotsykes/ember.js",
"id": "dc9466af4e29951fbfbe780d8b38652faa002a25",
"size": "9416",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "packages/ember-metal/lib/main.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "6440"
},
{
"name": "Handlebars",
"bytes": "1873"
},
{
"name": "JavaScript",
"bytes": "3126147"
},
{
"name": "Ruby",
"bytes": "6190"
},
{
"name": "Shell",
"bytes": "2469"
}
],
"symlink_target": ""
} |
#include "joynr/MqttMulticastAddressCalculator.h"
#include <memory>
#include <tuple>
#include "joynr/ImmutableMessage.h"
#include "joynr/exceptions/JoynrException.h"
#include "joynr/system/RoutingTypes/Address.h"
#include "joynr/system/RoutingTypes/MqttAddress.h"
namespace joynr
{
MqttMulticastAddressCalculator::MqttMulticastAddressCalculator(
std::shared_ptr<const system::RoutingTypes::MqttAddress> globalAddress,
const std::string& mqttMulticastTopicPrefix)
: globalAddress(globalAddress), mqttMulticastTopicPrefix(mqttMulticastTopicPrefix)
{
}
std::shared_ptr<const system::RoutingTypes::Address> MqttMulticastAddressCalculator::compute(
const ImmutableMessage& message)
{
if (!globalAddress) {
return std::shared_ptr<const system::RoutingTypes::MqttAddress>();
}
return std::make_shared<const system::RoutingTypes::MqttAddress>(
globalAddress->getBrokerUri(), mqttMulticastTopicPrefix + message.getRecipient());
}
}
| {
"content_hash": "9ea21fcabd2f9c071c550e892b63f337",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 94,
"avg_line_length": 32.03225806451613,
"alnum_prop": 0.7593152064451159,
"repo_name": "clive-jevons/joynr",
"id": "b79470ccfa504f15e52adca3512765c6ce55f50c",
"size": "1628",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "cpp/libjoynr/joynr-messaging/MqttMulticastAddressCalculator.cpp",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "1953"
},
{
"name": "C++",
"bytes": "2702245"
},
{
"name": "CMake",
"bytes": "125551"
},
{
"name": "CSS",
"bytes": "3152"
},
{
"name": "HTML",
"bytes": "43209"
},
{
"name": "Java",
"bytes": "3236663"
},
{
"name": "JavaScript",
"bytes": "2478252"
},
{
"name": "Shell",
"bytes": "57216"
},
{
"name": "Xtend",
"bytes": "1534"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "3c057917e36c279b3e005443ffc0cbb6",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.307692307692308,
"alnum_prop": 0.6940298507462687,
"repo_name": "mdoering/backbone",
"id": "065b6ede081ac75a34e3f0880e6ebddbb38638d1",
"size": "186",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Myrtales/Myrtaceae/Calyptranthes/Calyptranthes lepida/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
namespace keyboard {
ShapedWindowTargeter::ShapedWindowTargeter(
std::vector<gfx::Rect> hit_test_rects)
: hit_test_rects_(std::move(hit_test_rects)) {}
ShapedWindowTargeter::~ShapedWindowTargeter() = default;
std::unique_ptr<aura::WindowTargeter::HitTestRects>
ShapedWindowTargeter::GetExtraHitTestShapeRects(aura::Window* target) const {
return std::make_unique<aura::WindowTargeter::HitTestRects>(hit_test_rects_);
}
} // namespace keyboard
| {
"content_hash": "ef9fbf8f77e2ed5d4a578603df08a655",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 79,
"avg_line_length": 32.714285714285715,
"alnum_prop": 0.7620087336244541,
"repo_name": "nwjs/chromium.src",
"id": "202e14e2bc5853736a0a0c771149886c0dee885b",
"size": "710",
"binary": false,
"copies": "6",
"ref": "refs/heads/nw70",
"path": "ash/keyboard/ui/shaped_window_targeter.cc",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
<?php
/**
* @param array() $mustache_vars is the array containing the names of the variable that must be proccessed by mustache in the template. The array must be in this form:
* array( array( 'name' => '', 'type' => '' ) ... ), and for loop tags it also contains a 'children' element which contains other mustache_vars array( array( 'name' => 'users', 'type' => 'loop_tag', 'children' => $merge_tags )
* @param string $template the template that needs to be procesed
* @param array $extra_values in this array we can pass any variables that are required for that specific implementation of the mustache processing system
*
*/
class PB_Mustache_Generate_Template{
var $mustache_vars = array( );
var $template = '';
var $extra_values = array( );
/**
* constructor for the class
*
* @param array $mustache_vars the array of variables
* @param string $template the html template
* @param $extra_values in this array we can pass any variables that are required for that specific implementation of the mustache processing system
*
* @since 2.0.0
*
*/
function __construct( $mustache_vars, $template, $extra_values ){
// Include Mustache Templates
if( !class_exists( 'Mustache_Autoloader' ) )
require_once( WPPB_PLUGIN_DIR.'/assets/lib/Mustache/Autoloader.php' );
Mustache_Autoloader::register();
$this->mustache_vars = $mustache_vars;
$this->template = $template;
$this->extra_values = $extra_values;
$this->process_mustache_vars();
}
/**
* construct the mustache_vars_array from $mustache_vars through filters
*
* @since 2.0.0
*
*/
function process_mustache_vars(){
if( !empty( $this->mustache_vars ) ){
foreach( $this->mustache_vars as $var ){
foreach( $var['variables'] as $variables ){
if( empty( $variables['children'] ) )
$variables['children'] = array();
$this->mustache_vars_array[ $variables['name'] ] = apply_filters( 'mustache_variable_'. $variables['type'], '', $variables['name'], $variables['children'], $this->extra_values );
}
}
}
}
/**
* Process the mustache template from the html template and the processed mustache variable array.
*
* @since 2.0.0
*
* @return $content the proccessed template ready for output.
*/
function process_template(){
$m = new Mustache_Engine;
try {
$content = do_shortcode( $m->render( $this->template, $this->mustache_vars_array ) );
} catch (Exception $e) {
$content = $e->getMessage();
}
return apply_filters( 'wppb_mustache_template', $content );
}
/**
* Handle toString method
*
* @since 2.0.0
*
* @return string $html html for the template.
*/
public function __toString() {
$html = $this->process_template();
return "{$html}";
}
}
class PB_Mustache_Generate_Admin_Box{
var $id; // string meta box id
var $title; // string title
var $page; // string|array post type to add meta box to
var $priority;
var $mustache_vars;
var $default_value;
/**
* constructor for the class
*
* @param string $id the meta box id
* @param string $title the title of the metabox
* @param string|array $page post type to add meta box to
* @param string $priority the priority within the context where the boxes should show ('high', 'core', 'default' or 'low')
* @param array $mustache_vars is the array containing the names of the variable that must be proccessed by mustache in the template. The array must be in this form:
* array( array( 'name' => '', 'type' => '' ) ... ), and for loop tags it also contains a 'children' element which contains other mustache_vars array( array( 'name' => 'users', 'type' => 'loop_tag', 'children' => $merge_tags )
* @param string $default_value the default template that populates the codemirror box.
*
* @since 2.0.0
*
*/
function __construct( $id, $title, $page, $priority, $mustache_vars, $default_value = '', $fields = array() ){
$this->mustache_vars = $mustache_vars;
$this->id = $id;
$this->title = $title;
$this->page = $page;
$this->priority = $priority;
$this->default_value = $default_value;
if(!is_array($this->page)) {
$this->page = array($this->page);
}
if( empty( $fields ) ){
$this->fields = array(
array( // Textarea
'label' => '', // <label>
'desc' => '', // description
'id' => $id, // field id and name
'type' => 'textarea', // type of field
'default' => $default_value, // type of field
)
);
}
else{
$this->fields = $fields;
}
$this->save_default_values();
if( defined( 'DOING_AJAX' ) && DOING_AJAX )
return;
add_action( 'admin_menu', array( $this, 'add_box' ) );
add_action( 'save_post', array( $this, 'save_box' ), 10, 2);
add_action( 'wp_insert_post', array( $this, 'save_box' ), 10, 2);
add_action( 'admin_enqueue_scripts', array( $this, 'wppb_print_mustache_script' ) );
add_action( 'admin_head', array( $this, 'wppb_print_codemirror_script' ) );
add_action( 'wck_before_meta_boxes', array( $this, 'wppb_mustache_page_before' ) );
add_action( 'wck_after_meta_boxes', array( $this, 'wppb_mustache_page_after' ) );
}
/**
* Function that print the required scripts for the mustache templates
*
* @param string $hook the page hook
*
* @since 2.0.0
*
*/
function wppb_print_mustache_script( $hook ){
if ( isset( $_GET['post_type'] ) || isset( $_GET['post'] ) || isset( $_GET['page'] ) ){
if ( isset( $_GET['post_type'] ) )
$post_type = $_GET['post_type'];
elseif ( isset( $_GET['post'] ) )
$post_type = get_post_type( $_GET['post'] );
else if( isset( $_GET['page'] ) ){
$screen = get_current_screen();
$post_type = $screen->id;
}
if ( ( $this->page[0] == $post_type ) ){
wp_enqueue_style( 'codemirror-style', WPPB_PLUGIN_URL . 'assets/lib/codemirror/lib/codemirror.css', false, PROFILE_BUILDER_VERSION );
if( !wp_script_is( 'codemirror', 'registered' ) && !wp_script_is( 'codemirror', 'enqueued' ) ) {
wp_enqueue_script('codemirror', WPPB_PLUGIN_URL . 'assets/lib/codemirror/lib/codemirror.js', array(), PROFILE_BUILDER_VERSION);
wp_enqueue_script('codemirror-mode-overlay-js', WPPB_PLUGIN_URL . 'assets/lib/codemirror/addon/mode/overlay.js', array(), '1.0');
wp_enqueue_script('codemirror-mode-xml-js', WPPB_PLUGIN_URL . 'assets/lib/codemirror/mode/xml/xml.js', array(), '1.0');
wp_enqueue_script('codemirror-fullscreen-js', WPPB_PLUGIN_URL . 'assets/lib/codemirror/addon/display/fullscreen.js', array(), '1.0');
}
wp_enqueue_script('jquery-ui-accordion');
}
}
}
/**
* Function that prints the codemirror initialization and the css
*
* @param string $hook the page hook
*
* @since 2.0.0
*
*/
function wppb_print_codemirror_script(){
global $printed_codemirror_scripts;
if( $printed_codemirror_scripts )
return;
if ( isset( $_GET['post_type'] ) || isset( $_GET['post'] ) || isset( $_GET['page'] ) ){
if ( isset( $_GET['post_type'] ) )
$post_type = $_GET['post_type'];
elseif ( isset( $_GET['post'] ) )
$post_type = get_post_type( $_GET['post'] );
else if( isset( $_GET['page'] ) ){
$screen = get_current_screen();
$post_type = $screen->id;
}
if ( ( $this->page[0] == $post_type ) ){
wp_enqueue_style( 'class-mustache-css', WPPB_PLUGIN_URL . 'modules/class-mustache-templates/class-mustache-templates.css', false, PROFILE_BUILDER_VERSION );
if( wp_script_is( 'codemirror-mode-overlay-js', 'enqueued' ) ) {
wp_enqueue_script('class-mustache-js', WPPB_PLUGIN_URL . 'modules/class-mustache-templates/class-mustache-templates.js', array("jquery"), PROFILE_BUILDER_VERSION);
}
$printed_codemirror_scripts = true;
}
}
}
/**
* Function that adds the mustache metabox
*
* @since 2.0.0
*
*/
function add_box() {
foreach ( $this->page as $page ) {
add_meta_box( $this->id, $this->title, array( $this, 'meta_box_callback' ), $page, 'normal', $this->priority );
/* if it's not a post type add a side metabox with a save button */
if( isset( $_GET['page'] ) )
add_meta_box( 'page-save-metabox', __( 'Save' ), array( $this, 'page_save_meta_box' ), $page, 'side' );
}
}
/**
* Function output the content for the metabox
*
*
* @since 2.0.0
*
*/
function meta_box_callback() {
global $post, $post_type;
/* save default values in the database as post meta for post types */
if( !empty( $this->fields ) && !empty( $post->ID ) ){
foreach( $this->fields as $field ){
if( !empty( $field['default'] ) ){
/* see if we have an option with this name, if we have don't do anything */
$field_saved_value = get_post_meta( $post->ID, $field['id'], true );
if( empty( $field_saved_value ) ){
add_post_meta( $post->ID, $field['id'], $field['default'], true );
}
}
}
}
// Use nonce for verification
echo '<input type="hidden" name="' . $post_type . '_meta_box_nonce" value="' . wp_create_nonce( basename( __FILE__) ) . '" />';
// Begin the field table and loop
echo '<table class="form-table meta_box mustache-box">';
foreach ( $this->fields as $field ) {
// get data for this field
extract( $field );
if ( !empty( $desc ) )
$desc = '<span class="description">' . $desc . '</span>';
// get value of this field if it exists for this post
if( isset( $_GET['page'] ) ){
$meta = get_option( $id );
}
else{
$meta = get_post_meta( $post->ID, $id, true );
}
//try to set a default value
if( empty( $meta ) && !empty( $default ) ){
$meta = $default;
}
// begin a table row with
echo '<tr>
<td class="' . $id . ' ' .$type . '">';
if( $type != 'header' && !empty( $label ) ){
echo '<label for="' . $id . '" class="wppb_mustache_label">' . esc_html( $label ) . '</label>';
}
switch( $type ) {
// text
case 'text':
echo '<input type="text" name="' . $id . '" id="' . $id . '" value="' . esc_attr( $meta ) . '" size="30" />
<br />' . $desc ;
break;
// textarea
case 'textarea':
echo '<textarea name="' . $id . '" id="' . $id . '" cols="220" rows="4" class="wppb_mustache_template">' . esc_textarea( $meta ) . '</textarea>';
echo $desc ;
break;
// checkbox
case 'checkbox':
echo '<input type="checkbox" name="' . $id . '" id="' . $id . '"' . checked( esc_attr( $meta ), true, false ) . ' value="1" />
<label for="' . $id . '">' . $desc . '</label>';
break;
// select
case 'select':
echo '<select name="' . $id . '" id="' . $id . '">';
foreach ( $options as $option )
echo '<option' . selected( esc_attr( $meta ), $option['value'], false ) . ' value="' . $option['value'] . '">' . esc_html( $option['label'] ) . '</option>';
echo '</select><br />' . $desc;
break;
// radio
case 'radio':
foreach ( $options as $option )
echo '<input type="radio" name="' . $id . '" id="' . $id . '-' . $option['value'] . '" value="' . $option['value'] . '"' . checked( esc_attr( $meta ), $option['value'], false ) . ' />
<label for="' . $id . '-' . $option['value'] . '">' . $option['label'] . '</label><br />';
echo '' . esc_html( $desc );
break;
// checkbox_group
case 'checkbox_group':
foreach ( $options as $option )
echo '<input type="checkbox" value="' . $option['value'] . '" name="' . $id . '[]" id="' . $id . '-' . $option['value'] . '"' , is_array( $meta ) && in_array( $option['value'], $meta ) ? ' checked="checked"' : '' , ' />
<label for="' . $id . '-' . $option['value'] . '">' . $option['label'] . '</label><br />';
echo '' . esc_html( $desc );
break;
// text
case 'header':
echo '<h4>'. $default .'</h4>';
break;
} //end switch
if( $type == 'textarea' ){
?>
<div class="stp-extra">
<?php
if( !empty( $this->mustache_vars ) ){
foreach( $this->mustache_vars as $mustache_var_group ){
?>
<h4><?php echo $mustache_var_group['group-title']; ?></h4>
<pre><?php $this->display_mustache_available_vars( $mustache_var_group['variables'], 0 ); ?></pre>
<?php
}
}
?>
</div>
<?php
}
echo '</td></tr>';
} // end foreach
echo '</table>'; // end table
}
/**
* Function that ads a side metabox on pages ( not post types ) with a save button
*
*
* @since 2.0.0
*
*/
function page_save_meta_box() {
?>
<input type="submit" value="<?php _e( 'Save Settings', 'profilebuilder' ); ?>" class="button button-primary button-large mustache-save">
<?php
}
/**
* Function that ads a form start on pages ( not post types ) and also the 'save_post' action
*
*
* @since 2.0.0
*
*/
function wppb_mustache_page_before( $hook ){
global $started_mustache_form;
if( $started_mustache_form )
return;
if( isset( $_GET['page'] ) && $hook == $this->page[0] ){
/* if we are saving do the action 'save_post' */
if( isset( $_GET['mustache_action'] ) && $_GET['mustache_action'] == 'save' )
do_action( 'save_post', $this->id, $this->page[0] );
echo '<form action="'. add_query_arg( array('mustache_action' => 'save') ) .'" method="post">';
$started_mustache_form = true;
}
}
/**
* Function that ads a form end on pages ( not post types )
*
*
* @since 2.0.0
*
*/
function wppb_mustache_page_after( $hook ){
global $ended_mustache_form;
if( $ended_mustache_form )
return;
if( isset( $_GET['page'] ) && $hook == $this->page[0] ){
echo '</form>';
$ended_mustache_form = true;
}
}
/**
* Function that transforms and echoes the $mustache_vars into despayable forms. It takes care of nested levels and adds {{}} as well
*
* @param array $mustache_vars is the array containing the names of the variable that must be proccessed by mustache in the template. The array must be in this form:
* array( array( 'name' => '', 'type' => '' ) ... ), and for loop tags it also contains a 'children' element which contains other mustache_vars array( array( 'name' => 'users', 'type' => 'loop_tag', 'children' => $merge_tags )
* @param int $level the current level of the nested variables.
*
* @since 2.0.0
*
*/
function display_mustache_available_vars( $mustache_vars, $level ){
if( !empty( $mustache_vars ) ){
foreach( $mustache_vars as $var ){
if( empty( $var['children'] ) ){
echo str_repeat( " " ,$level);
if( !empty( $var['label'] ) )
echo apply_filters( 'wppb_variable_label', $var['label'].':' );
if( !empty( $var['unescaped'] ) && $var['unescaped'] === true )
echo '{{{';
else
echo '{{';
echo $var['name'];
if( !empty( $var['unescaped'] ) && $var['unescaped'] === true )
echo '}}}';
else
echo '}}';
echo PHP_EOL;
}
else{
$level++ ;
echo '{{#'. $var['name'] . '}}' . PHP_EOL;
$this->display_mustache_available_vars( $var['children'], $level );
echo '{{/'. $var['name'] . '}}' . PHP_EOL;
$level-- ;
}
}
}
}
/**
* Function that saves the values from the metabox
*
* @param int $post_id the post id
* @param post object $post
*
* @since 2.0.0
*
*/
function save_box( $post_id, $post ){
global $post_type;
/* addition to save as option if we are not on a post type */
if( !is_numeric( $post_id ) && @wp_verify_nonce( $_POST['_meta_box_nonce'], basename( __FILE__ ) ) ){
foreach ( $this->fields as $field ){
if ( isset( $_POST[$field['id']] ) ) {
update_option( $field['id'], wp_unslash( $_POST[$field['id']] ) );
}
}
}
// verify nonce
if ( ! ( in_array( $post_type, $this->page ) && @wp_verify_nonce( $_POST[$post_type . '_meta_box_nonce'], basename( __FILE__ ) ) ) )
return $post_id;
// check autosave
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
return $post_id;
// check permissions
if ( !current_user_can( 'edit_page', $post_id ) )
return $post_id;
// loop through fields and save the data
foreach ( $this->fields as $field ) {
if( $field['type'] == 'tax_select' ) {
// save taxonomies
if ( isset( $_POST[$field['id']] ) )
$term = $_POST[$field['id']];
wp_set_object_terms( $post_id, $term, $field['id'] );
}
else {
// save the rest
$old = get_post_meta( $post_id, $field['id'], true );
if ( isset( $_POST[$field['id']] ) ) {
$new = $_POST[$field['id']];
} else {
$new = '';
}
if ( $new && $new != $old ) {
if ( is_array( $new ) ) {
foreach ( $new as &$item ) {
//$item = esc_attr( $item );
}
unset( $item );
} else {
//$new = esc_attr( $new );
}
update_post_meta( $post_id, $field['id'], $new );
} elseif ( '' == $new && $old ) {
delete_post_meta( $post_id, $field['id'], $old );
}
}
} // end foreach
}
/**
* Function that saves the default values for each field in the database for options
*
*
* @since 2.0.0
*
*/
function save_default_values(){
/* only do it on pages where we save as options and we have fields */
if( !empty( $this->fields ) && !post_type_exists($this->page[0]) ){
foreach( $this->fields as $field ){
if( !empty( $field['default'] ) ){
/* see if we have an option with this name, if we have don't do anything */
$field_saved_value = get_option( $field['id'] );
if( empty( $field_saved_value ) ){
update_option( $field['id'], $field['default'] );
}
}
}
}
}
} | {
"content_hash": "36c2b66c53910f7b558b5ae6074adf04",
"timestamp": "",
"source": "github",
"line_count": 546,
"max_line_length": 229,
"avg_line_length": 34.527472527472526,
"alnum_prop": 0.5358052196053469,
"repo_name": "scossar/bookswithwings",
"id": "2450b12ad8dc18bf23f348fbcdf179286e78a8ab",
"size": "18852",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "web/app/plugins/profile-builder-pro/modules/class-mustache-templates/class-mustache-templates.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "461109"
},
{
"name": "HTML",
"bytes": "184"
},
{
"name": "JavaScript",
"bytes": "876144"
},
{
"name": "PHP",
"bytes": "4116842"
},
{
"name": "Ruby",
"bytes": "4489"
},
{
"name": "Shell",
"bytes": "1490"
}
],
"symlink_target": ""
} |
{% extends path+"/scenario_04a/_layout-case-full-width.html" %}
{% block citizen_content %}
{{ data.nuggets | log }}
<p class="no-kdBar"><a href="javascript: history.go(-1)" class="link-back">Back</a></p>
<p class="caption-large" class="mb0">Assessment preparation</p>
<h1 class="heading-large mt0">Medical conditions</h1>
<div class="grid-row">
<div class="column-two-thirds">
<form method="post" action="med_conds_grouping">
<div class="form-group">
<label class="form-label" for="consulted">Name of medical condition</label>
<textarea class="form-control form-control-3-4" name="consultedPractitioner" id="consultedPractitioner" rows="1"></textarea>
</div>
<div class="form-group">
<label class="form-label" for="consulted">Who gave this diagnosis?</label>
<textarea class="form-control form-control-3-4" name="consultedPractitioner" id="consultedPractitioner" rows="1"></textarea>
</div>
<div class="form-group">
<fieldset>
<legend>
<span class="form-label">Date of diagnosis</span>
<span class="form-hint">For example, 11 2017</span>
</legend>
<div class="form-date">
<div class="form-group form-group-month">
<label class="form-label" for="dob-month">Month</label>
<input class="form-control" id="dob-month" name="dob-month" type="number" pattern="[0-9]*">
</div>
<div class="form-group form-group-year">
<label class="form-label" for="dob-year">Year</label>
<input class="form-control" id="dob-year" name="dob-year" type="number" pattern="[0-9]*">
</div>
</div>
</fieldset>
</div>
<!-- section end -->
<p><input type="submit" class="button secondary mb20" value="Add another" id="submitButton"></p>
<p><input type="submit" class="button" value="Save and continue" id="submitButton"></p>
</form>
</div><!-- column -->
</div><!-- row -->
{% endblock %}
| {
"content_hash": "31ba2c67045ce5ea7555d16865021498",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 127,
"avg_line_length": 29.542857142857144,
"alnum_prop": 0.5923597678916828,
"repo_name": "dwpdigitaltech/healthanddisability",
"id": "24880b68695649b3a358310cfa96b743b501ddfb",
"size": "2068",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "app/views/fha/assessment-scenarios/scenario_04b/assessment_preparation/enter_med_conds_3.html",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "58296"
},
{
"name": "HTML",
"bytes": "934977"
},
{
"name": "JavaScript",
"bytes": "66322"
},
{
"name": "Shell",
"bytes": "1495"
}
],
"symlink_target": ""
} |
UNIX_DynamicForwardingEntryFixture::UNIX_DynamicForwardingEntryFixture()
{
}
UNIX_DynamicForwardingEntryFixture::~UNIX_DynamicForwardingEntryFixture()
{
}
void UNIX_DynamicForwardingEntryFixture::Run()
{
CIMName className("UNIX_DynamicForwardingEntry");
CIMNamespaceName nameSpace("root/cimv2");
UNIX_DynamicForwardingEntry _p;
UNIX_DynamicForwardingEntryProvider _provider;
Uint32 propertyCount;
CIMOMHandle omHandle;
_provider.initialize(omHandle);
_p.initialize();
for(int pIndex = 0; _p.load(pIndex); pIndex++)
{
CIMInstance instance = _provider.constructInstance(className,
nameSpace,
_p);
CIMObjectPath path = instance.getPath();
cout << path.toString() << endl;
propertyCount = instance.getPropertyCount();
for(Uint32 i = 0; i < propertyCount; i++)
{
CIMProperty propertyItem = instance.getProperty(i);
cout << " Name: " << propertyItem.getName().getString() << " - Value: " << propertyItem.getValue().toString() << endl;
}
cout << "------------------------------------" << endl;
cout << endl;
}
_p.finalize();
}
| {
"content_hash": "ba0ebde77fdce89bc9987baa470444b7",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 121,
"avg_line_length": 26.170731707317074,
"alnum_prop": 0.6905871388630009,
"repo_name": "brunolauze/openpegasus-providers-old",
"id": "4d669faa69abc139a09376741a9ca143e4ee004f",
"size": "2884",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/Providers/UNIXProviders/tests/UNIXProviders.Tests/UNIX_DynamicForwardingEntryFixture.cpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "2631164"
},
{
"name": "C++",
"bytes": "120884401"
},
{
"name": "Objective-C",
"bytes": "64"
},
{
"name": "Shell",
"bytes": "17094"
}
],
"symlink_target": ""
} |
<topic>
<head>
<title>UPPER</title>
<keywords>
<keyword term="functions, UPPER" />
<keyword term="string functions, UPPER" />
<keyword term="UPPER function" />
</keywords>
<links>
<link href="Functions.html">Functions</link>
<link href="String Functions.html">String Functions</link>
</links>
</head>
<body>
<summary>
<p>
Returns a string with lowercase characters converted to uppercase.
</p>
</summary>
<syntax>
<code xml:space="preserve">UPPER(text AS string) RETURNS string</code>
</syntax>
<parameters>
<params>
<param name="text">
<p>
A string containing lowercase characters.
</p>
</param>
</params>
</parameters>
<returns>
<p>
A string in uppercase.
</p>
</returns>
</body>
</topic>
| {
"content_hash": "5c2e0c9adfe2408c15136c4cbc9babad",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 73,
"avg_line_length": 20.317073170731707,
"alnum_prop": 0.5858343337334934,
"repo_name": "terrajobst/nquery",
"id": "058691cec91ef4672bbc8c7119c084de0a924d19",
"size": "833",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Help/Additional Content/Language Reference/Functions/Upper.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "1431825"
},
{
"name": "Shell",
"bytes": "1025"
},
{
"name": "XSLT",
"bytes": "10936"
}
],
"symlink_target": ""
} |
<?php
namespace Cvuorinen\RaspiPHPant;
use Aura\Cli\Stdio;
use Cvuorinen\Raspicam\Raspistill;
use Twitter;
use TwitterException;
class RaspiPHPantCommand
{
/**
* Twitter char limit when tweet includes image
*/
const CHAR_LIMIT = 116;
/**
* @var Stdio
*/
private $stdio;
/**
* @var Twitter
*/
private $twitter;
/**
* @var Raspistill
*/
private $camera;
/**
* @var string
*/
private $picsDirectory;
/**
* @var null|string
*/
private $hashtag;
/**
* @var int ID of the last tweet that has been handled
*/
private $lastTweetId;
/**
* @var string Username of the account the API tokens belong to
*/
private $twitterUsername;
/**
* @param Stdio $stdio
* @param Twitter $twitter
* @param Raspistill $camera
* @param string $picsDirectory
* @param string|null $hashtag
*/
public function __construct(
Stdio $stdio,
Twitter $twitter,
Raspistill $camera,
$picsDirectory,
$hashtag = null
) {
$this->stdio = $stdio;
$this->twitter = $twitter;
$this->camera = $camera;
$this->picsDirectory = $picsDirectory;
if (!empty($hashtag) && $hashtag{0} !== '#') {
throw new \InvalidArgumentException(
'Invalid hashtag "' . $hashtag . '". Hashtag must begin with # character.'
);
}
$this->hashtag = $hashtag;
}
/**
* @param int $interval
*/
public function run($interval)
{
$this->verifyAccount();
$this->checkLastReply();
while (true) {
sleep($interval);
// load 20 latest replies sorted by newest first
try {
$replies = $this->twitter->load(Twitter::REPLIES);
} catch (TwitterException $e) {
$this->stdio->outln('Can\'t fetch new tweets at this time!');
$this->stdio->outln('Error: ' . $e->getMessage());
continue;
}
if (empty($replies)) {
$this->stdio->outln("No new tweets to reply to");
continue;
}
// reverse array to start with the ones that were sent earlier
foreach (array_reverse($replies) as $tweet) {
if ($this->shouldNotReplyTo($tweet)) {
continue;
}
$filename = $this->takePicture($tweet);
$this->sendReply(
$tweet,
$filename
);
$this->lastTweetId = $tweet->id;
}
}
}
/**
* Verify Twitter credentials and store our username
*/
private function verifyAccount()
{
$account = $this->twitter->request('account/verify_credentials', 'GET');
$this->twitterUsername = $account->screen_name;
$this->stdio->outln('Account verified, running as "@' . $this->twitterUsername . '"');
}
/**
* Store id of last reply so that we'll only handle tweets newer than this
*/
private function checkLastReply()
{
$lastReply = $this->twitter->load(Twitter::REPLIES, 1);
$this->lastTweetId = $lastReply[0]->id;
$this->stdio->outln('Last reply ID "' . $this->lastTweetId . '"');
}
/**
* @param \stdClass $tweet
*
* @return bool
*/
private function shouldNotReplyTo(\stdClass $tweet)
{
// skip the ones already handled
if ($tweet->id <= $this->lastTweetId) {
return true;
}
// don't reply to ourself
if ($tweet->user->screen_name == $this->twitterUsername) {
return true;
}
// don't reply to replies (someone might comment on the pics etc.)
if ($tweet->in_reply_to_status_id) {
return true;
}
return false;
}
/**
* @param \stdClass $tweet
*
* @return string
*/
private function takePicture(\stdClass $tweet)
{
$filename = $this->picsDirectory . '/'
. $tweet->id . '-' . $tweet->user->screen_name . '.jpg';
// this call might throw exceptions but generally in that case it's ok to explode and dump stacktrace
// since there's not much point to continue without the ability to take pictures
$this->camera->takePicture($filename);
$this->stdio->outln('Took picture with filename "' . $filename . '"');
return $filename;
}
/**
* @param \stdClass $tweet
* @param string $filename
*/
private function sendReply(\stdClass $tweet, $filename)
{
try {
$message = $this->createReplyMessage($tweet);
$this->stdio->outln('Replying with message "' . $message . '"');
$this->twitter->send(
$message,
$filename
);
$this->stdio->outln('Tweet sent!');
} catch (TwitterException $e) {
$this->stdio->outln('Failed to send tweet!');
$this->stdio->outln('Error: ' . $e->getMessage());
}
}
/**
* @param \stdClass $tweet
*
* @return string
*/
private function createReplyMessage(\stdClass $tweet)
{
$replyMessage = '.@' . $tweet->user->screen_name . ': ';
// remove our own username
$tweetText = trim(str_replace('@' . $this->twitterUsername, '', $tweet->text));
// truncate original tweet text if our reply doesn't fit in char limit
if (mb_strlen($replyMessage) + mb_strlen('"' . $tweetText . '"') > self::CHAR_LIMIT) {
$length = self::CHAR_LIMIT - mb_strlen($replyMessage . '""...');
$split = wordwrap($tweetText, $length, "\n");
$tweetText = explode("\n", $split)[0] . '...';
}
$replyMessage .= '"' . $tweetText . '"';
// add hashtag to message (if provided and not in the message already and fits within char limit)
if (!empty($this->hashtag)
&& false === mb_stripos($replyMessage, $this->hashtag)
&& mb_strlen($replyMessage . ' ' . $this->hashtag) <= self::CHAR_LIMIT
) {
$replyMessage .= ' ' . $this->hashtag;
}
return $replyMessage;
}
}
| {
"content_hash": "77410e977ad2521310cba35eb3d76f92",
"timestamp": "",
"source": "github",
"line_count": 247,
"max_line_length": 109,
"avg_line_length": 26.024291497975707,
"alnum_prop": 0.5161792159303049,
"repo_name": "cvuorinen/raspiphpant",
"id": "20e644e12fe46d2fb8ec6e6ddf45ea02fb8ec6f3",
"size": "6428",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/RaspiPHPantCommand.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "12068"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--
Licensed to Jasig under one or more contributor license
agreements. See the NOTICE file distributed with this work
for additional information regarding copyright ownership.
Jasig licenses this file to you 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.
-->
<user xmlns='https://source.jasig.org/schemas/uportal/io/user' xmlns:ns2='https://source.jasig.org/schemas/uportal/io/permission-owner' xmlns:ns3='https://source.jasig.org/schemas/uportal/io/portlet-definition' xmlns:ns5='https://source.jasig.org/schemas/uportal/io/subscribed-fragment' xmlns:ns6='https://source.jasig.org/schemas/uportal/io/event-aggregation' xmlns:ns7='https://source.jasig.org/schemas/uportal/io/stylesheet-descriptor' xmlns:ns8='https://source.jasig.org/schemas/uportal/io/portlet-type' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' username='psimth52' version='4.0' xsi:schemaLocation='https://source.jasig.org/schemas/uportal/io/user https://source.jasig.org/schemas/uportal/io/user/user-4.0.xsd'>
<default-user>defaultTemplateUser</default-user>
<password>(SHA256)zWMUqUYhgT2qyvBaL85R8cRASb9LMrl93EJ6DAMYG26HWuo204tAJA==</password>
<attribute>
<name>givenName</name>
<value>Simth</value>
</attribute>
<attribute>
<name>sn</name>
<value>Patricia</value>
</attribute>
<attribute>
<name>mail</name>
<value>[email protected]</value>
</attribute>
<attribute>
<name>telephoneNumber</name>
<value>480-775-7894</value>
</attribute>
<attribute>
<name>SSP_ROLES</name>
<value>SSP_STUDENT</value>
</attribute>
</user> | {
"content_hash": "34ecadbffc4060fa29159d75893c3d0e",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 728,
"avg_line_length": 47.46666666666667,
"alnum_prop": 0.7359550561797753,
"repo_name": "GTCC/nc-ssp-platform-nc-ssp-platform",
"id": "13ef6076044cade3ae87888dcd6cce3839d3cd4d",
"size": "2136",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "uportal-war/src/main/data/ssp_demo_entities/user/psimth52.user.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "702514"
},
{
"name": "Groovy",
"bytes": "8658"
},
{
"name": "Java",
"bytes": "7168791"
},
{
"name": "JavaScript",
"bytes": "210719"
},
{
"name": "Perl",
"bytes": "1740"
},
{
"name": "Shell",
"bytes": "5698"
},
{
"name": "Smalltalk",
"bytes": "572"
},
{
"name": "XSLT",
"bytes": "296389"
}
],
"symlink_target": ""
} |
package de.plushnikov.intellij.plugin.processor.method;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.psi.PsiAnnotation;
import com.intellij.psi.PsiClass;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiMethod;
import de.plushnikov.intellij.plugin.LombokClassNames;
import de.plushnikov.intellij.plugin.problem.ProblemBuilder;
import de.plushnikov.intellij.plugin.processor.handler.BuilderHandler;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.List;
import java.util.Objects;
/**
* Inspect and validate @Builder lombok annotation on a method
* Creates inner class for a builder pattern
*
* @author Tomasz Kalkosiński
* @author Michail Plushnikov
*/
public class BuilderClassMethodProcessor extends AbstractMethodProcessor {
private static final String BUILDER_SHORT_NAME = StringUtil.getShortName(LombokClassNames.BUILDER);
public BuilderClassMethodProcessor() {
super(PsiClass.class, LombokClassNames.BUILDER);
}
@Override
public boolean notNameHintIsEqualToSupportedAnnotation(@Nullable String nameHint) {
return !"lombok".equals(nameHint) && !BUILDER_SHORT_NAME.equals(nameHint);
}
@Override
protected boolean possibleToGenerateElementNamed(@Nullable String nameHint, @NotNull PsiClass psiClass,
@NotNull PsiAnnotation psiAnnotation, @NotNull PsiMethod psiMethod) {
if (null == nameHint) {
return true;
}
final String innerBuilderClassName = getHandler().getBuilderClassName(psiClass, psiAnnotation, psiMethod);
return Objects.equals(nameHint, innerBuilderClassName);
}
@Override
protected boolean validate(@NotNull PsiAnnotation psiAnnotation, @NotNull PsiMethod psiMethod, @NotNull ProblemBuilder builder) {
return getHandler().validate(psiMethod, psiAnnotation, builder);
}
@Override
protected void processIntern(@NotNull PsiMethod psiMethod, @NotNull PsiAnnotation psiAnnotation, @NotNull List<? super PsiElement> target) {
final PsiClass psiClass = psiMethod.getContainingClass();
if (null != psiClass) {
final BuilderHandler builderHandler = getHandler();
builderHandler.createBuilderClassIfNotExist(psiClass, psiMethod, psiAnnotation).ifPresent(target::add);
}
}
private BuilderHandler getHandler() {
return ApplicationManager.getApplication().getService(BuilderHandler.class);
}
}
| {
"content_hash": "a7cc03c1c5b7ad4a54aabe7368edbf4c",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 142,
"avg_line_length": 38.04545454545455,
"alnum_prop": 0.7733970529669454,
"repo_name": "allotria/intellij-community",
"id": "93469836b92ad015eaafb65da35962f1c3b1ec76",
"size": "2512",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "plugins/lombok/src/main/java/de/plushnikov/intellij/plugin/processor/method/BuilderClassMethodProcessor.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "AMPL",
"bytes": "20665"
},
{
"name": "AspectJ",
"bytes": "182"
},
{
"name": "Batchfile",
"bytes": "60580"
},
{
"name": "C",
"bytes": "195249"
},
{
"name": "C#",
"bytes": "1264"
},
{
"name": "C++",
"bytes": "195810"
},
{
"name": "CMake",
"bytes": "1675"
},
{
"name": "CSS",
"bytes": "201445"
},
{
"name": "CoffeeScript",
"bytes": "1759"
},
{
"name": "Erlang",
"bytes": "10"
},
{
"name": "Groovy",
"bytes": "3197810"
},
{
"name": "HLSL",
"bytes": "57"
},
{
"name": "HTML",
"bytes": "1891055"
},
{
"name": "J",
"bytes": "5050"
},
{
"name": "Java",
"bytes": "164463076"
},
{
"name": "JavaScript",
"bytes": "570364"
},
{
"name": "Jupyter Notebook",
"bytes": "93222"
},
{
"name": "Kotlin",
"bytes": "4240307"
},
{
"name": "Lex",
"bytes": "147047"
},
{
"name": "Makefile",
"bytes": "2352"
},
{
"name": "NSIS",
"bytes": "51270"
},
{
"name": "Objective-C",
"bytes": "27941"
},
{
"name": "Perl",
"bytes": "903"
},
{
"name": "Perl6",
"bytes": "26"
},
{
"name": "Protocol Buffer",
"bytes": "6680"
},
{
"name": "Python",
"bytes": "25385564"
},
{
"name": "Roff",
"bytes": "37534"
},
{
"name": "Ruby",
"bytes": "1217"
},
{
"name": "Scala",
"bytes": "11698"
},
{
"name": "Shell",
"bytes": "65705"
},
{
"name": "Smalltalk",
"bytes": "338"
},
{
"name": "TeX",
"bytes": "25473"
},
{
"name": "Thrift",
"bytes": "1846"
},
{
"name": "TypeScript",
"bytes": "9469"
},
{
"name": "Visual Basic",
"bytes": "77"
},
{
"name": "XSLT",
"bytes": "113040"
}
],
"symlink_target": ""
} |
By Adrien Touboul and Pierre-Alain Langlois
# Dependency
* Qt5 : http://www.qt.io/download/
| {
"content_hash": "72f764d0efd757f938e23b5bd43f8a3c",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 43,
"avg_line_length": 18.8,
"alnum_prop": 0.7340425531914894,
"repo_name": "palanglois/SimulatedAnnealing",
"id": "277a66678faae65ad06aba95e45d9a913bcd3692",
"size": "116",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "C++",
"bytes": "119893"
},
{
"name": "CMake",
"bytes": "1147"
}
],
"symlink_target": ""
} |
package config
import (
"fmt"
"io/ioutil"
"path/filepath"
"regexp"
"strings"
log "github.com/sirupsen/logrus"
yaml "gopkg.in/yaml.v2"
)
// ApplicationServiceNamespace is the namespace that a specific application
// service has management over.
type ApplicationServiceNamespace struct {
// Whether or not the namespace is managed solely by this application service
Exclusive bool `yaml:"exclusive"`
// A regex pattern that represents the namespace
Regex string `yaml:"regex"`
// The ID of an existing group that all users of this application service will
// be added to. This field is only relevant to the `users` namespace.
// Note that users who are joined to this group through an application service
// are not to be listed when querying for the group's members, however the
// group should be listed when querying an application service user's groups.
// This is to prevent making spamming all users of an application service
// trivial.
GroupID string `yaml:"group_id"`
// Regex object representing our pattern. Saves having to recompile every time
RegexpObject *regexp.Regexp
}
// ApplicationService represents a Matrix application service.
// https://matrix.org/docs/spec/application_service/unstable.html
type ApplicationService struct {
// User-defined, unique, persistent ID of the application service
ID string `yaml:"id"`
// Base URL of the application service
URL string `yaml:"url"`
// Application service token provided in requests to a homeserver
ASToken string `yaml:"as_token"`
// Homeserver token provided in requests to an application service
HSToken string `yaml:"hs_token"`
// Localpart of application service user
SenderLocalpart string `yaml:"sender_localpart"`
// Information about an application service's namespaces. Key is either
// "users", "aliases" or "rooms"
NamespaceMap map[string][]ApplicationServiceNamespace `yaml:"namespaces"`
// Whether rate limiting is applied to each application service user
RateLimited bool `yaml:"rate_limited"`
// Any custom protocols that this application service provides (e.g. IRC)
Protocols []string `yaml:"protocols"`
}
// IsInterestedInRoomID returns a bool on whether an application service's
// namespace includes the given room ID
func (a *ApplicationService) IsInterestedInRoomID(
roomID string,
) bool {
if namespaceSlice, ok := a.NamespaceMap["rooms"]; ok {
for _, namespace := range namespaceSlice {
if namespace.RegexpObject.MatchString(roomID) {
return true
}
}
}
return false
}
// IsInterestedInUserID returns a bool on whether an application service's
// namespace includes the given user ID
func (a *ApplicationService) IsInterestedInUserID(
userID string,
) bool {
if namespaceSlice, ok := a.NamespaceMap["users"]; ok {
for _, namespace := range namespaceSlice {
if namespace.RegexpObject.MatchString(userID) {
return true
}
}
}
return false
}
// IsInterestedInRoomAlias returns a bool on whether an application service's
// namespace includes the given room alias
func (a *ApplicationService) IsInterestedInRoomAlias(
roomAlias string,
) bool {
if namespaceSlice, ok := a.NamespaceMap["aliases"]; ok {
for _, namespace := range namespaceSlice {
if namespace.RegexpObject.MatchString(roomAlias) {
return true
}
}
}
return false
}
// loadAppServices iterates through all application service config files
// and loads their data into the config object for later access.
func loadAppServices(config *Dendrite) error {
for _, configPath := range config.ApplicationServices.ConfigFiles {
// Create a new application service with default options
appservice := ApplicationService{
RateLimited: true,
}
// Create an absolute path from a potentially relative path
absPath, err := filepath.Abs(configPath)
if err != nil {
return err
}
// Read the application service's config file
configData, err := ioutil.ReadFile(absPath)
if err != nil {
return err
}
// Load the config data into our struct
if err = yaml.UnmarshalStrict(configData, &appservice); err != nil {
return err
}
// Append the parsed application service to the global config
config.Derived.ApplicationServices = append(
config.Derived.ApplicationServices, appservice,
)
}
// Check for any errors in the loaded application services
return checkErrors(config)
}
// setupRegexps will create regex objects for exclusive and non-exclusive
// usernames, aliases and rooms of all application services, so that other
// methods can quickly check if a particular string matches any of them.
func setupRegexps(cfg *Dendrite) (err error) {
// Combine all exclusive namespaces for later string checking
var exclusiveUsernameStrings, exclusiveAliasStrings []string
// If an application service's regex is marked as exclusive, add
// its contents to the overall exlusive regex string. Room regex
// not necessary as we aren't denying exclusive room ID creation
for _, appservice := range cfg.Derived.ApplicationServices {
for key, namespaceSlice := range appservice.NamespaceMap {
switch key {
case "users":
appendExclusiveNamespaceRegexs(&exclusiveUsernameStrings, namespaceSlice)
case "aliases":
appendExclusiveNamespaceRegexs(&exclusiveAliasStrings, namespaceSlice)
}
}
}
// Join the regexes together into one big regex.
// i.e. "app1.*", "app2.*" -> "(app1.*)|(app2.*)"
// Later we can check if a username or alias matches any exclusive regex and
// deny access if it isn't from an application service
exclusiveUsernames := strings.Join(exclusiveUsernameStrings, "|")
exclusiveAliases := strings.Join(exclusiveAliasStrings, "|")
// If there are no exclusive regexes, compile string so that it will not match
// any valid usernames/aliases/roomIDs
if exclusiveUsernames == "" {
exclusiveUsernames = "^$"
}
if exclusiveAliases == "" {
exclusiveAliases = "^$"
}
// Store compiled Regex
if cfg.Derived.ExclusiveApplicationServicesUsernameRegexp, err = regexp.Compile(exclusiveUsernames); err != nil {
return err
}
if cfg.Derived.ExclusiveApplicationServicesAliasRegexp, err = regexp.Compile(exclusiveAliases); err != nil {
return err
}
return nil
}
// appendExclusiveNamespaceRegexs takes a slice of strings and a slice of
// namespaces and will append the regexes of only the exclusive namespaces
// into the string slice
func appendExclusiveNamespaceRegexs(
exclusiveStrings *[]string, namespaces []ApplicationServiceNamespace,
) {
for index, namespace := range namespaces {
if namespace.Exclusive {
// We append parenthesis to later separate each regex when we compile
// i.e. "app1.*", "app2.*" -> "(app1.*)|(app2.*)"
*exclusiveStrings = append(*exclusiveStrings, "("+namespace.Regex+")")
}
// Compile this regex into a Regexp object for later use
namespaces[index].RegexpObject, _ = regexp.Compile(namespace.Regex)
}
}
// checkErrors checks for any configuration errors amongst the loaded
// application services according to the application service spec.
func checkErrors(config *Dendrite) (err error) {
var idMap = make(map[string]bool)
var tokenMap = make(map[string]bool)
// Compile regexp object for checking groupIDs
groupIDRegexp := regexp.MustCompile(`\+.*:.*`)
// Check each application service for any config errors
for _, appservice := range config.Derived.ApplicationServices {
// Namespace-related checks
for key, namespaceSlice := range appservice.NamespaceMap {
for _, namespace := range namespaceSlice {
if err := validateNamespace(&appservice, key, &namespace, groupIDRegexp); err != nil {
return err
}
}
}
// Check if the url has trailing /'s. If so, remove them
appservice.URL = strings.TrimRight(appservice.URL, "/")
// Check if we've already seen this ID. No two application services
// can have the same ID or token.
if idMap[appservice.ID] {
return configErrors([]string{fmt.Sprintf(
"Application service ID %s must be unique", appservice.ID,
)})
}
// Check if we've already seen this token
if tokenMap[appservice.ASToken] {
return configErrors([]string{fmt.Sprintf(
"Application service Token %s must be unique", appservice.ASToken,
)})
}
// Add the id/token to their respective maps if we haven't already
// seen them.
idMap[appservice.ID] = true
tokenMap[appservice.ASToken] = true
// TODO: Remove once rate_limited is implemented
if appservice.RateLimited {
log.Warn("WARNING: Application service option rate_limited is currently unimplemented")
}
// TODO: Remove once protocols is implemented
if len(appservice.Protocols) > 0 {
log.Warn("WARNING: Application service option protocols is currently unimplemented")
}
}
return setupRegexps(config)
}
// validateNamespace returns nil or an error based on whether a given
// application service namespace is valid. A namespace is valid if it has the
// required fields, and its regex is correct.
func validateNamespace(
appservice *ApplicationService,
key string,
namespace *ApplicationServiceNamespace,
groupIDRegexp *regexp.Regexp,
) error {
// Check that namespace(s) are valid regex
if !IsValidRegex(namespace.Regex) {
return configErrors([]string{fmt.Sprintf(
"Invalid regex string for Application Service %s", appservice.ID,
)})
}
// Check if GroupID for the users namespace is in the correct format
if key == "users" && namespace.GroupID != "" {
// TODO: Remove once group_id is implemented
log.Warn("WARNING: Application service option group_id is currently unimplemented")
correctFormat := groupIDRegexp.MatchString(namespace.GroupID)
if !correctFormat {
return configErrors([]string{fmt.Sprintf(
"Invalid user group_id field for application service %s.",
appservice.ID,
)})
}
}
return nil
}
// IsValidRegex returns true or false based on whether the
// given string is valid regex or not
func IsValidRegex(regexString string) bool {
_, err := regexp.Compile(regexString)
return err == nil
}
| {
"content_hash": "f7ec6b9c2440833f989c759ff5b23901",
"timestamp": "",
"source": "github",
"line_count": 299,
"max_line_length": 114,
"avg_line_length": 33.44481605351171,
"alnum_prop": 0.7401,
"repo_name": "gperdomor/dendrite",
"id": "7a43d48fbe2250fcaebc889b538be334e8fc64fc",
"size": "10612",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/github.com/matrix-org/dendrite/common/config/appservice.go",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Dockerfile",
"bytes": "186"
},
{
"name": "Go",
"bytes": "1095179"
},
{
"name": "Shell",
"bytes": "10124"
}
],
"symlink_target": ""
} |
namespace BWSAL
{
std::map< std::string, BuildType > buildTypeMap;
std::set< BuildType > buildTypeSet;
std::map< BWAPI::Race, std::set< BuildType > > buildTypeSetByRace;
std::set< BuildType > requiredBuildTypeSet;
std::map< BWAPI::Race, std::set< BuildType > > requiredBuildTypeSetByRace;
std::map< BWAPI::TechType, BuildType > techTypeToBuildTypeMap;
std::map< BWAPI::UnitType, BuildType > unitTypeToBuildTypeMap;
std::map< BWAPI::UpgradeType, BuildType > upgradeTypeToBuildTypeMap;
bool initializingBuildType = true;
class BuildTypeInternal
{
public:
BuildTypeInternal()
{
techType = BWAPI::TechTypes::None;
unitType = BWAPI::UnitTypes::None;
upgradeType = BWAPI::UpgradeTypes::None;
upgradeLevel = 0;
buildUnitTime = 0;
prepTime = 0;
createsUnit = false;
morphsBuilder = false;
needsBuildLocation = false;
supplyRequired = 0;
supplyProvided = 0;
requiresPsi = false;
requiresLarva = false;
requiredAddon = BuildTypes::None;
valid = false;
mask = 0;
requiredMask = 0;
}
void set( BWAPI::TechType type )
{
if ( initializingBuildType )
{
this->techType = type;
this->name = type.getName();
this->race = type.getRace();
this->mineralPrice = type.mineralPrice();
this->gasPrice = type.gasPrice();
this->builderTime = this->buildUnitTime = type.researchTime();
this->valid = true;
}
}
void set( BWAPI::UnitType type )
{
if ( initializingBuildType )
{
this->unitType = type;
this->name = type.getName();
this->race = type.getRace();
this->mineralPrice = type.mineralPrice();
this->gasPrice = type.gasPrice();
this->builderTime = type.buildTime() + 24;
this->buildUnitTime = type.buildTime() + 24;
if ( this->race == BWAPI::Races::Protoss && type.isBuilding() )
{
this->builderTime = 4*24; // protoss buildings only consume a small amount of worker time
this->buildUnitTime += 4*24;
}
this->requiresPsi = type.requiresPsi();
this->needsBuildLocation = ( type.isBuilding() && !type.whatBuilds().first.isBuilding() );
this->prepTime = 0;
if ( this->needsBuildLocation )
{
this->prepTime = 4*24; // Need 4 seconds to move to build location
}
if ( this->race == BWAPI::Races::Zerg )
{
this->morphsBuilder = true;
this->createsUnit = type.isTwoUnitsInOneEgg();
if ( type == BWAPI::UnitTypes::Zerg_Infested_Terran )
{
this->morphsBuilder = false;
this->createsUnit = true;
}
}
else
{
this->morphsBuilder = false;
this->createsUnit = true;
if ( type == BWAPI::UnitTypes::Protoss_Archon || type == BWAPI::UnitTypes::Protoss_Dark_Archon )
{
this->morphsBuilder = true;
this->createsUnit = false;
}
}
this->supplyRequired = type.supplyRequired();
this->supplyProvided = type.supplyProvided();
this->valid = true;
}
}
void set( BWAPI::UpgradeType type, int level = 1 )
{
if ( initializingBuildType )
{
this->upgradeType = type;
this->upgradeLevel = level;
if ( type.maxRepeats() == 1 )
{
this->name = type.getName();
}
else
{
if ( level == 1 )
{
this->name = type.getName() + " 1";
}
else if ( level == 2 )
{
this->name = type.getName() + " 2";
}
else
{
this->name = type.getName() + " 3";
}
}
this->race = type.getRace();
this->mineralPrice = type.mineralPrice( level );
this->gasPrice = type.gasPrice( level );
this->builderTime = this->buildUnitTime = type.upgradeTime( level );
this->valid = true;
}
}
void setDependencies()
{
if ( initializingBuildType )
{
if ( this->techType != BWAPI::TechTypes::None )
{
this->whatBuilds.first = BuildType( this->techType.whatResearches() );
this->whatBuilds.second = 1;
this->requiredBuildTypes.insert( this->whatBuilds );
if ( this->techType == BWAPI::TechTypes::Lurker_Aspect )
{
this->requiredBuildTypes.insert( std::make_pair( BuildTypes::Zerg_Lair, 1 ) );
}
}
else if ( this->unitType != BWAPI::UnitTypes::None )
{
if ( this->unitType.whatBuilds().first == BWAPI::UnitTypes::Zerg_Larva )
{
this->whatBuilds.first = BuildTypes::Zerg_Hatchery;
this->whatBuilds.second = 1;
}
else
{
this->whatBuilds = this->unitType.whatBuilds();
}
for ( std::map< BWAPI::UnitType, int >::const_iterator r = this->unitType.requiredUnits().begin(); r != this->unitType.requiredUnits().end(); r++ )
{
if ( r->first == BWAPI::UnitTypes::Zerg_Larva )
{
this->requiresLarva = true;
this->requiredBuildTypes.insert( std::make_pair( BuildTypes::Zerg_Hatchery, r->second ) );
}
else
{
if ( r->first.isAddon() && r->first.whatBuilds().first == this->unitType.whatBuilds().first )
{
this->requiredAddon = BuildType( r->first );
}
this->requiredBuildTypes.insert( std::make_pair( BuildType( r->first ), r->second ) );
}
}
if ( this->unitType.requiredTech() != BWAPI::TechTypes::None )
{
this->requiredBuildTypes.insert( std::make_pair( BuildType( this->unitType.requiredTech() ), 1 ) );
}
if ( this->unitType.requiresPsi() )
{
this->requiredBuildTypes.insert( std::make_pair( BuildTypes::Protoss_Pylon, 1 ) );
}
}
else if ( this->upgradeType != BWAPI::UpgradeTypes::None )
{
this->whatBuilds.first = BuildType( this->upgradeType.whatUpgrades() );
this->whatBuilds.second = 1;
this->requiredBuildTypes.insert( this->whatBuilds );
this->requiredBuildTypes.insert( std::make_pair( BuildType( this->upgradeType.whatsRequired() ), 1) );
if ( this->upgradeLevel > 1 )
{
this->requiredBuildTypes.insert( std::make_pair( BuildType( this->upgradeType, this->upgradeLevel - 1 ), 1 ) );
}
}
}
}
BWAPI::TechType techType;
BWAPI::UnitType unitType;
BWAPI::UpgradeType upgradeType;
int upgradeLevel;
std::string name;
BWAPI::Race race;
std::pair< BuildType, int > whatBuilds;
std::map< BuildType, int > requiredBuildTypes;
bool requiresPsi;
bool requiresLarva;
BuildType requiredAddon;
int mineralPrice;
int gasPrice;
int executionTime;
int builderTime;
int buildUnitTime;
int prepTime;
bool createsUnit;
bool morphsBuilder;
bool needsBuildLocation;
int supplyRequired;
int supplyProvided;
unsigned int mask;
unsigned int requiredMask;
bool valid;
};
BuildTypeInternal buildTypeData[203];
namespace BuildTypes
{
unsigned int WorkerMask = 1 << 0;
unsigned int RefineryMask = 1 << 1;
unsigned int SupplyMask = 1 << 2;
unsigned int CenterMask = 1 << 3;
const BuildType Terran_Marine( 0 );
const BuildType Terran_Ghost( 1 );
const BuildType Terran_Vulture( 2 );
const BuildType Terran_Goliath( 3 );
const BuildType Terran_Siege_Tank_Tank_Mode( 4 );
const BuildType Terran_SCV( 5 );
const BuildType Terran_Wraith( 6 );
const BuildType Terran_Science_Vessel( 7 );
const BuildType Terran_Dropship( 8 );
const BuildType Terran_Battlecruiser( 9 );
const BuildType Terran_Nuclear_Missile( 10 );
const BuildType Terran_Siege_Tank_Siege_Mode( 11 );
const BuildType Terran_Firebat( 12 );
const BuildType Terran_Medic( 13 );
const BuildType Zerg_Larva( 14 );
const BuildType Zerg_Zergling( 15 );
const BuildType Zerg_Hydralisk( 16 );
const BuildType Zerg_Ultralisk( 17 );
const BuildType Zerg_Drone( 18 );
const BuildType Zerg_Overlord( 19 );
const BuildType Zerg_Mutalisk( 20 );
const BuildType Zerg_Guardian( 21 );
const BuildType Zerg_Queen( 22 );
const BuildType Zerg_Defiler( 23 );
const BuildType Zerg_Scourge( 24 );
const BuildType Zerg_Infested_Terran( 25 );
const BuildType Terran_Valkyrie( 26 );
const BuildType Zerg_Cocoon( 27 );
const BuildType Protoss_Corsair( 28 );
const BuildType Protoss_Dark_Templar( 29 );
const BuildType Zerg_Devourer( 30 );
const BuildType Protoss_Dark_Archon( 31 );
const BuildType Protoss_Probe( 32 );
const BuildType Protoss_Zealot( 33 );
const BuildType Protoss_Dragoon( 34 );
const BuildType Protoss_High_Templar( 35 );
const BuildType Protoss_Archon( 36 );
const BuildType Protoss_Shuttle( 37 );
const BuildType Protoss_Scout( 38 );
const BuildType Protoss_Arbiter( 39 );
const BuildType Protoss_Carrier( 40 );
const BuildType Protoss_Interceptor( 41 );
const BuildType Protoss_Reaver( 42 );
const BuildType Protoss_Observer( 43 );
const BuildType Protoss_Scarab( 44 );
const BuildType Zerg_Lurker( 45 );
const BuildType Terran_Command_Center( 46 );
const BuildType Terran_Comsat_Station( 47 );
const BuildType Terran_Nuclear_Silo( 48 );
const BuildType Terran_Supply_Depot( 49 );
const BuildType Terran_Refinery( 50 );
const BuildType Terran_Barracks( 51 );
const BuildType Terran_Academy( 52 );
const BuildType Terran_Factory( 53 );
const BuildType Terran_Starport( 54 );
const BuildType Terran_Control_Tower( 55 );
const BuildType Terran_Science_Facility( 56 );
const BuildType Terran_Covert_Ops( 57 );
const BuildType Terran_Physics_Lab( 58 );
const BuildType Terran_Machine_Shop( 59 );
const BuildType Terran_Engineering_Bay( 60 );
const BuildType Terran_Armory( 61 );
const BuildType Terran_Missile_Turret( 62 );
const BuildType Terran_Bunker( 63 );
const BuildType Zerg_Hatchery( 64 );
const BuildType Zerg_Lair( 65 );
const BuildType Zerg_Hive( 66 );
const BuildType Zerg_Nydus_Canal( 67 );
const BuildType Zerg_Hydralisk_Den( 68 );
const BuildType Zerg_Defiler_Mound( 69 );
const BuildType Zerg_Greater_Spire( 70 );
const BuildType Zerg_Queens_Nest( 71 );
const BuildType Zerg_Evolution_Chamber( 72 );
const BuildType Zerg_Ultralisk_Cavern( 73 );
const BuildType Zerg_Spire( 74 );
const BuildType Zerg_Spawning_Pool( 75 );
const BuildType Zerg_Creep_Colony( 76 );
const BuildType Zerg_Spore_Colony( 77 );
const BuildType Zerg_Sunken_Colony( 78 );
const BuildType Zerg_Extractor( 79 );
const BuildType Protoss_Nexus( 80 );
const BuildType Protoss_Robotics_Facility( 81 );
const BuildType Protoss_Pylon( 82 );
const BuildType Protoss_Assimilator( 83 );
const BuildType Protoss_Observatory( 84 );
const BuildType Protoss_Gateway( 85 );
const BuildType Protoss_Photon_Cannon( 86 );
const BuildType Protoss_Citadel_of_Adun( 87 );
const BuildType Protoss_Cybernetics_Core( 88 );
const BuildType Protoss_Templar_Archives( 89 );
const BuildType Protoss_Forge( 90 );
const BuildType Protoss_Stargate( 91 );
const BuildType Protoss_Fleet_Beacon( 92 );
const BuildType Protoss_Arbiter_Tribunal( 93 );
const BuildType Protoss_Robotics_Support_Bay( 94 );
const BuildType Protoss_Shield_Battery( 95 );
const BuildType Stim_Packs( 96 );
const BuildType Lockdown( 97 );
const BuildType EMP_Shockwave( 98 );
const BuildType Spider_Mines( 99 );
const BuildType Tank_Siege_Mode( 100 );
const BuildType Irradiate( 101 );
const BuildType Yamato_Gun( 102 );
const BuildType Cloaking_Field( 103 );
const BuildType Personnel_Cloaking( 104 );
const BuildType Burrowing( 105 );
const BuildType Spawn_Broodlings( 106 );
const BuildType Plague( 107 );
const BuildType Consume( 108 );
const BuildType Ensnare( 109 );
const BuildType Psionic_Storm( 110 );
const BuildType Hallucination( 111 );
const BuildType Recall( 112 );
const BuildType Stasis_Field( 113 );
const BuildType Restoration( 114 );
const BuildType Disruption_Web( 115 );
const BuildType Mind_Control( 116 );
const BuildType Optical_Flare( 117 );
const BuildType Maelstrom( 118 );
const BuildType Lurker_Aspect( 119 );
const BuildType Terran_Infantry_Armor_1( 120 );
const BuildType Terran_Infantry_Armor_2( 121 );
const BuildType Terran_Infantry_Armor_3( 122 );
const BuildType Terran_Vehicle_Plating_1( 123 );
const BuildType Terran_Vehicle_Plating_2( 124 );
const BuildType Terran_Vehicle_Plating_3( 125 );
const BuildType Terran_Ship_Plating_1( 126 );
const BuildType Terran_Ship_Plating_2( 127 );
const BuildType Terran_Ship_Plating_3( 128 );
const BuildType Zerg_Carapace_1( 129 );
const BuildType Zerg_Carapace_2( 130 );
const BuildType Zerg_Carapace_3( 131 );
const BuildType Zerg_Flyer_Carapace_1( 132 );
const BuildType Zerg_Flyer_Carapace_2( 133 );
const BuildType Zerg_Flyer_Carapace_3( 134 );
const BuildType Protoss_Ground_Armor_1( 135 );
const BuildType Protoss_Ground_Armor_2( 136 );
const BuildType Protoss_Ground_Armor_3( 137 );
const BuildType Protoss_Air_Armor_1( 138 );
const BuildType Protoss_Air_Armor_2( 139 );
const BuildType Protoss_Air_Armor_3( 140 );
const BuildType Terran_Infantry_Weapons_1( 141 );
const BuildType Terran_Infantry_Weapons_2( 142 );
const BuildType Terran_Infantry_Weapons_3( 143 );
const BuildType Terran_Vehicle_Weapons_1( 144 );
const BuildType Terran_Vehicle_Weapons_2( 145 );
const BuildType Terran_Vehicle_Weapons_3( 146 );
const BuildType Terran_Ship_Weapons_1( 147 );
const BuildType Terran_Ship_Weapons_2( 148 );
const BuildType Terran_Ship_Weapons_3( 149 );
const BuildType Zerg_Melee_Attacks_1( 150 );
const BuildType Zerg_Melee_Attacks_2( 151 );
const BuildType Zerg_Melee_Attacks_3( 152 );
const BuildType Zerg_Missile_Attacks_1( 153 );
const BuildType Zerg_Missile_Attacks_2( 154 );
const BuildType Zerg_Missile_Attacks_3( 155 );
const BuildType Zerg_Flyer_Attacks_1( 156 );
const BuildType Zerg_Flyer_Attacks_2( 157 );
const BuildType Zerg_Flyer_Attacks_3( 158 );
const BuildType Protoss_Ground_Weapons_1( 159 );
const BuildType Protoss_Ground_Weapons_2( 160 );
const BuildType Protoss_Ground_Weapons_3( 161 );
const BuildType Protoss_Air_Weapons_1( 162 );
const BuildType Protoss_Air_Weapons_2( 163 );
const BuildType Protoss_Air_Weapons_3( 164 );
const BuildType Protoss_Plasma_Shields_1( 165 );
const BuildType Protoss_Plasma_Shields_2( 166 );
const BuildType Protoss_Plasma_Shields_3( 167 );
const BuildType U_238_Shells( 168 );
const BuildType Ion_Thrusters( 169 );
const BuildType Titan_Reactor( 170 );
const BuildType Ocular_Implants( 171 );
const BuildType Moebius_Reactor( 172 );
const BuildType Apollo_Reactor( 173 );
const BuildType Colossus_Reactor( 174 );
const BuildType Ventral_Sacs( 175 );
const BuildType Antennae( 176 );
const BuildType Pneumatized_Carapace( 177 );
const BuildType Metabolic_Boost( 178 );
const BuildType Adrenal_Glands( 179 );
const BuildType Muscular_Augments( 180 );
const BuildType Grooved_Spines( 181 );
const BuildType Gamete_Meiosis( 182 );
const BuildType Metasynaptic_Node( 183 );
const BuildType Singularity_Charge( 184 );
const BuildType Leg_Enhancements( 185 );
const BuildType Scarab_Damage( 186 );
const BuildType Reaver_Capacity( 187 );
const BuildType Gravitic_Drive( 188 );
const BuildType Sensor_Array( 189 );
const BuildType Gravitic_Boosters( 190 );
const BuildType Khaydarin_Amulet( 191 );
const BuildType Apial_Sensors( 192 );
const BuildType Gravitic_Thrusters( 193 );
const BuildType Carrier_Capacity( 194 );
const BuildType Khaydarin_Core( 195 );
const BuildType Argus_Jewel( 196 );
const BuildType Argus_Talisman( 197 );
const BuildType Caduceus_Reactor( 198 );
const BuildType Chitinous_Plating( 199 );
const BuildType Anabolic_Synthesis( 200 );
const BuildType Charon_Boosters( 201 );
const BuildType None( 202 );
void set( BuildType buildType, BWAPI::TechType type )
{
buildTypeSet.insert( buildType );
buildTypeData[buildType.getID()].set( type );
techTypeToBuildTypeMap[type] = buildType;
}
void set( BuildType buildType, BWAPI::UnitType type )
{
buildTypeSet.insert( buildType );
buildTypeData[buildType.getID()].set( type );
unitTypeToBuildTypeMap[type] = buildType;
}
void set( BuildType buildType, BWAPI::UpgradeType type, int level = 1 )
{
buildTypeSet.insert( buildType );
buildTypeData[buildType.getID()].set( type, level );
if ( level == 1 )
{
upgradeTypeToBuildTypeMap[type] = buildType;
}
}
void init()
{
set( Terran_Marine, BWAPI::UnitTypes::Terran_Marine );
set( Terran_Ghost, BWAPI::UnitTypes::Terran_Ghost );
set( Terran_Vulture, BWAPI::UnitTypes::Terran_Vulture );
set( Terran_Goliath, BWAPI::UnitTypes::Terran_Goliath );
set( Terran_Siege_Tank_Tank_Mode, BWAPI::UnitTypes::Terran_Siege_Tank_Tank_Mode );
set( Terran_SCV, BWAPI::UnitTypes::Terran_SCV );
set( Terran_Wraith, BWAPI::UnitTypes::Terran_Wraith );
set( Terran_Science_Vessel, BWAPI::UnitTypes::Terran_Science_Vessel );
set( Terran_Dropship, BWAPI::UnitTypes::Terran_Dropship );
set( Terran_Battlecruiser, BWAPI::UnitTypes::Terran_Battlecruiser );
set( Terran_Nuclear_Missile, BWAPI::UnitTypes::Terran_Nuclear_Missile );
set( Terran_Siege_Tank_Siege_Mode, BWAPI::UnitTypes::Terran_Siege_Tank_Siege_Mode );
set( Terran_Firebat, BWAPI::UnitTypes::Terran_Firebat );
set( Terran_Medic, BWAPI::UnitTypes::Terran_Medic );
set( Zerg_Larva, BWAPI::UnitTypes::Zerg_Larva );
set( Zerg_Zergling, BWAPI::UnitTypes::Zerg_Zergling );
set( Zerg_Hydralisk, BWAPI::UnitTypes::Zerg_Hydralisk );
set( Zerg_Ultralisk, BWAPI::UnitTypes::Zerg_Ultralisk );
set( Zerg_Drone, BWAPI::UnitTypes::Zerg_Drone );
set( Zerg_Overlord, BWAPI::UnitTypes::Zerg_Overlord );
set( Zerg_Mutalisk, BWAPI::UnitTypes::Zerg_Mutalisk );
set( Zerg_Guardian, BWAPI::UnitTypes::Zerg_Guardian );
set( Zerg_Queen, BWAPI::UnitTypes::Zerg_Queen );
set( Zerg_Defiler, BWAPI::UnitTypes::Zerg_Defiler );
set( Zerg_Scourge, BWAPI::UnitTypes::Zerg_Scourge );
set( Zerg_Infested_Terran, BWAPI::UnitTypes::Zerg_Infested_Terran );
set( Terran_Valkyrie, BWAPI::UnitTypes::Terran_Valkyrie );
set( Zerg_Cocoon, BWAPI::UnitTypes::Zerg_Cocoon );
set( Protoss_Corsair, BWAPI::UnitTypes::Protoss_Corsair );
set( Protoss_Dark_Templar, BWAPI::UnitTypes::Protoss_Dark_Templar );
set( Zerg_Devourer, BWAPI::UnitTypes::Zerg_Devourer );
set( Protoss_Dark_Archon, BWAPI::UnitTypes::Protoss_Dark_Archon );
set( Protoss_Probe, BWAPI::UnitTypes::Protoss_Probe );
set( Protoss_Zealot, BWAPI::UnitTypes::Protoss_Zealot );
set( Protoss_Dragoon, BWAPI::UnitTypes::Protoss_Dragoon );
set( Protoss_High_Templar, BWAPI::UnitTypes::Protoss_High_Templar );
set( Protoss_Archon, BWAPI::UnitTypes::Protoss_Archon );
set( Protoss_Shuttle, BWAPI::UnitTypes::Protoss_Shuttle );
set( Protoss_Scout, BWAPI::UnitTypes::Protoss_Scout );
set( Protoss_Arbiter, BWAPI::UnitTypes::Protoss_Arbiter );
set( Protoss_Carrier, BWAPI::UnitTypes::Protoss_Carrier );
set( Protoss_Interceptor, BWAPI::UnitTypes::Protoss_Interceptor );
set( Protoss_Reaver, BWAPI::UnitTypes::Protoss_Reaver );
set( Protoss_Observer, BWAPI::UnitTypes::Protoss_Observer );
set( Protoss_Scarab, BWAPI::UnitTypes::Protoss_Scarab );
set( Zerg_Lurker, BWAPI::UnitTypes::Zerg_Lurker );
set( Terran_Command_Center, BWAPI::UnitTypes::Terran_Command_Center );
set( Terran_Comsat_Station, BWAPI::UnitTypes::Terran_Comsat_Station );
set( Terran_Nuclear_Silo, BWAPI::UnitTypes::Terran_Nuclear_Silo );
set( Terran_Supply_Depot, BWAPI::UnitTypes::Terran_Supply_Depot );
set( Terran_Refinery, BWAPI::UnitTypes::Terran_Refinery );
set( Terran_Barracks, BWAPI::UnitTypes::Terran_Barracks );
set( Terran_Academy, BWAPI::UnitTypes::Terran_Academy );
set( Terran_Factory, BWAPI::UnitTypes::Terran_Factory );
set( Terran_Starport, BWAPI::UnitTypes::Terran_Starport );
set( Terran_Control_Tower, BWAPI::UnitTypes::Terran_Control_Tower );
set( Terran_Science_Facility, BWAPI::UnitTypes::Terran_Science_Facility );
set( Terran_Covert_Ops, BWAPI::UnitTypes::Terran_Covert_Ops );
set( Terran_Physics_Lab, BWAPI::UnitTypes::Terran_Physics_Lab );
set( Terran_Machine_Shop, BWAPI::UnitTypes::Terran_Machine_Shop );
set( Terran_Engineering_Bay, BWAPI::UnitTypes::Terran_Engineering_Bay );
set( Terran_Armory, BWAPI::UnitTypes::Terran_Armory );
set( Terran_Missile_Turret, BWAPI::UnitTypes::Terran_Missile_Turret );
set( Terran_Bunker, BWAPI::UnitTypes::Terran_Bunker );
set( Zerg_Hatchery, BWAPI::UnitTypes::Zerg_Hatchery );
set( Zerg_Lair, BWAPI::UnitTypes::Zerg_Lair );
set( Zerg_Hive, BWAPI::UnitTypes::Zerg_Hive );
set( Zerg_Nydus_Canal, BWAPI::UnitTypes::Zerg_Nydus_Canal );
set( Zerg_Hydralisk_Den, BWAPI::UnitTypes::Zerg_Hydralisk_Den );
set( Zerg_Defiler_Mound, BWAPI::UnitTypes::Zerg_Defiler_Mound );
set( Zerg_Greater_Spire, BWAPI::UnitTypes::Zerg_Greater_Spire );
set( Zerg_Queens_Nest, BWAPI::UnitTypes::Zerg_Queens_Nest );
set( Zerg_Evolution_Chamber, BWAPI::UnitTypes::Zerg_Evolution_Chamber );
set( Zerg_Ultralisk_Cavern, BWAPI::UnitTypes::Zerg_Ultralisk_Cavern );
set( Zerg_Spire, BWAPI::UnitTypes::Zerg_Spire );
set( Zerg_Spawning_Pool, BWAPI::UnitTypes::Zerg_Spawning_Pool );
set( Zerg_Creep_Colony, BWAPI::UnitTypes::Zerg_Creep_Colony );
set( Zerg_Spore_Colony, BWAPI::UnitTypes::Zerg_Spore_Colony );
set( Zerg_Sunken_Colony, BWAPI::UnitTypes::Zerg_Sunken_Colony );
set( Zerg_Extractor, BWAPI::UnitTypes::Zerg_Extractor );
set( Protoss_Nexus, BWAPI::UnitTypes::Protoss_Nexus );
set( Protoss_Robotics_Facility, BWAPI::UnitTypes::Protoss_Robotics_Facility );
set( Protoss_Pylon, BWAPI::UnitTypes::Protoss_Pylon );
set( Protoss_Assimilator, BWAPI::UnitTypes::Protoss_Assimilator );
set( Protoss_Observatory, BWAPI::UnitTypes::Protoss_Observatory );
set( Protoss_Gateway, BWAPI::UnitTypes::Protoss_Gateway );
set( Protoss_Photon_Cannon, BWAPI::UnitTypes::Protoss_Photon_Cannon );
set( Protoss_Citadel_of_Adun, BWAPI::UnitTypes::Protoss_Citadel_of_Adun );
set( Protoss_Cybernetics_Core, BWAPI::UnitTypes::Protoss_Cybernetics_Core );
set( Protoss_Templar_Archives, BWAPI::UnitTypes::Protoss_Templar_Archives );
set( Protoss_Forge, BWAPI::UnitTypes::Protoss_Forge );
set( Protoss_Stargate, BWAPI::UnitTypes::Protoss_Stargate );
set( Protoss_Fleet_Beacon, BWAPI::UnitTypes::Protoss_Fleet_Beacon );
set( Protoss_Arbiter_Tribunal, BWAPI::UnitTypes::Protoss_Arbiter_Tribunal );
set( Protoss_Robotics_Support_Bay, BWAPI::UnitTypes::Protoss_Robotics_Support_Bay );
set( Protoss_Shield_Battery, BWAPI::UnitTypes::Protoss_Shield_Battery );
set( Stim_Packs, BWAPI::TechTypes::Stim_Packs );
set( Lockdown, BWAPI::TechTypes::Lockdown );
set( EMP_Shockwave, BWAPI::TechTypes::EMP_Shockwave );
set( Spider_Mines, BWAPI::TechTypes::Spider_Mines );
set( Tank_Siege_Mode, BWAPI::TechTypes::Tank_Siege_Mode );
set( Irradiate, BWAPI::TechTypes::Irradiate );
set( Yamato_Gun, BWAPI::TechTypes::Yamato_Gun );
set( Cloaking_Field, BWAPI::TechTypes::Cloaking_Field );
set( Personnel_Cloaking, BWAPI::TechTypes::Personnel_Cloaking );
set( Burrowing, BWAPI::TechTypes::Burrowing );
set( Spawn_Broodlings, BWAPI::TechTypes::Spawn_Broodlings );
set( Plague, BWAPI::TechTypes::Plague );
set( Consume, BWAPI::TechTypes::Consume );
set( Ensnare, BWAPI::TechTypes::Ensnare );
set( Psionic_Storm, BWAPI::TechTypes::Psionic_Storm );
set( Hallucination, BWAPI::TechTypes::Hallucination );
set( Recall, BWAPI::TechTypes::Recall );
set( Stasis_Field, BWAPI::TechTypes::Stasis_Field );
set( Restoration, BWAPI::TechTypes::Restoration );
set( Disruption_Web, BWAPI::TechTypes::Disruption_Web );
set( Mind_Control, BWAPI::TechTypes::Mind_Control );
set( Optical_Flare, BWAPI::TechTypes::Optical_Flare );
set( Maelstrom, BWAPI::TechTypes::Maelstrom );
set( Lurker_Aspect, BWAPI::TechTypes::Lurker_Aspect );
set( Terran_Infantry_Armor_1, BWAPI::UpgradeTypes::Terran_Infantry_Armor, 1 );
set( Terran_Infantry_Armor_2, BWAPI::UpgradeTypes::Terran_Infantry_Armor, 2 );
set( Terran_Infantry_Armor_3, BWAPI::UpgradeTypes::Terran_Infantry_Armor, 3 );
set( Terran_Vehicle_Plating_1, BWAPI::UpgradeTypes::Terran_Vehicle_Plating, 1 );
set( Terran_Vehicle_Plating_2, BWAPI::UpgradeTypes::Terran_Vehicle_Plating, 2 );
set( Terran_Vehicle_Plating_3, BWAPI::UpgradeTypes::Terran_Vehicle_Plating, 3 );
set( Terran_Ship_Plating_1, BWAPI::UpgradeTypes::Terran_Ship_Plating, 1 );
set( Terran_Ship_Plating_2, BWAPI::UpgradeTypes::Terran_Ship_Plating, 2 );
set( Terran_Ship_Plating_3, BWAPI::UpgradeTypes::Terran_Ship_Plating, 3 );
set( Zerg_Carapace_1, BWAPI::UpgradeTypes::Zerg_Carapace, 1 );
set( Zerg_Carapace_2, BWAPI::UpgradeTypes::Zerg_Carapace, 2 );
set( Zerg_Carapace_3, BWAPI::UpgradeTypes::Zerg_Carapace, 3 );
set( Zerg_Flyer_Carapace_1, BWAPI::UpgradeTypes::Zerg_Flyer_Carapace, 1 );
set( Zerg_Flyer_Carapace_2, BWAPI::UpgradeTypes::Zerg_Flyer_Carapace, 2 );
set( Zerg_Flyer_Carapace_3, BWAPI::UpgradeTypes::Zerg_Flyer_Carapace, 3 );
set( Protoss_Ground_Armor_1, BWAPI::UpgradeTypes::Protoss_Ground_Armor, 1 );
set( Protoss_Ground_Armor_2, BWAPI::UpgradeTypes::Protoss_Ground_Armor, 2 );
set( Protoss_Ground_Armor_3, BWAPI::UpgradeTypes::Protoss_Ground_Armor, 3 );
set( Protoss_Air_Armor_1, BWAPI::UpgradeTypes::Protoss_Air_Armor, 1 );
set( Protoss_Air_Armor_2, BWAPI::UpgradeTypes::Protoss_Air_Armor, 2 );
set( Protoss_Air_Armor_3, BWAPI::UpgradeTypes::Protoss_Air_Armor, 3 );
set( Terran_Infantry_Weapons_1, BWAPI::UpgradeTypes::Terran_Infantry_Weapons, 1 );
set( Terran_Infantry_Weapons_2, BWAPI::UpgradeTypes::Terran_Infantry_Weapons, 2 );
set( Terran_Infantry_Weapons_3, BWAPI::UpgradeTypes::Terran_Infantry_Weapons, 3 );
set( Terran_Vehicle_Weapons_1, BWAPI::UpgradeTypes::Terran_Vehicle_Weapons, 1 );
set( Terran_Vehicle_Weapons_2, BWAPI::UpgradeTypes::Terran_Vehicle_Weapons, 2 );
set( Terran_Vehicle_Weapons_3, BWAPI::UpgradeTypes::Terran_Vehicle_Weapons, 3 );
set( Terran_Ship_Weapons_1, BWAPI::UpgradeTypes::Terran_Ship_Weapons, 1 );
set( Terran_Ship_Weapons_2, BWAPI::UpgradeTypes::Terran_Ship_Weapons, 2 );
set( Terran_Ship_Weapons_3, BWAPI::UpgradeTypes::Terran_Ship_Weapons, 3 );
set( Zerg_Melee_Attacks_1, BWAPI::UpgradeTypes::Zerg_Melee_Attacks, 1 );
set( Zerg_Melee_Attacks_2, BWAPI::UpgradeTypes::Zerg_Melee_Attacks, 2 );
set( Zerg_Melee_Attacks_3, BWAPI::UpgradeTypes::Zerg_Melee_Attacks, 3 );
set( Zerg_Missile_Attacks_1, BWAPI::UpgradeTypes::Zerg_Missile_Attacks, 1 );
set( Zerg_Missile_Attacks_2, BWAPI::UpgradeTypes::Zerg_Missile_Attacks, 2 );
set( Zerg_Missile_Attacks_3, BWAPI::UpgradeTypes::Zerg_Missile_Attacks, 3 );
set( Zerg_Flyer_Attacks_1, BWAPI::UpgradeTypes::Zerg_Flyer_Attacks, 1 );
set( Zerg_Flyer_Attacks_2, BWAPI::UpgradeTypes::Zerg_Flyer_Attacks, 2 );
set( Zerg_Flyer_Attacks_3, BWAPI::UpgradeTypes::Zerg_Flyer_Attacks, 3 );
set( Protoss_Ground_Weapons_1, BWAPI::UpgradeTypes::Protoss_Ground_Weapons, 1 );
set( Protoss_Ground_Weapons_2, BWAPI::UpgradeTypes::Protoss_Ground_Weapons, 2 );
set( Protoss_Ground_Weapons_3, BWAPI::UpgradeTypes::Protoss_Ground_Weapons, 3 );
set( Protoss_Air_Weapons_1, BWAPI::UpgradeTypes::Protoss_Air_Weapons, 1 );
set( Protoss_Air_Weapons_2, BWAPI::UpgradeTypes::Protoss_Air_Weapons, 2 );
set( Protoss_Air_Weapons_3, BWAPI::UpgradeTypes::Protoss_Air_Weapons, 3 );
set( Protoss_Plasma_Shields_1, BWAPI::UpgradeTypes::Protoss_Plasma_Shields, 1 );
set( Protoss_Plasma_Shields_2, BWAPI::UpgradeTypes::Protoss_Plasma_Shields, 2 );
set( Protoss_Plasma_Shields_3, BWAPI::UpgradeTypes::Protoss_Plasma_Shields, 3 );
set( U_238_Shells, BWAPI::UpgradeTypes::U_238_Shells );
set( Ion_Thrusters, BWAPI::UpgradeTypes::Ion_Thrusters );
set( Titan_Reactor, BWAPI::UpgradeTypes::Titan_Reactor );
set( Ocular_Implants, BWAPI::UpgradeTypes::Ocular_Implants );
set( Moebius_Reactor, BWAPI::UpgradeTypes::Moebius_Reactor );
set( Apollo_Reactor, BWAPI::UpgradeTypes::Apollo_Reactor );
set( Colossus_Reactor, BWAPI::UpgradeTypes::Colossus_Reactor );
set( Ventral_Sacs, BWAPI::UpgradeTypes::Ventral_Sacs );
set( Antennae, BWAPI::UpgradeTypes::Antennae );
set( Pneumatized_Carapace, BWAPI::UpgradeTypes::Pneumatized_Carapace );
set( Metabolic_Boost, BWAPI::UpgradeTypes::Metabolic_Boost );
set( Adrenal_Glands, BWAPI::UpgradeTypes::Adrenal_Glands );
set( Muscular_Augments, BWAPI::UpgradeTypes::Muscular_Augments );
set( Grooved_Spines, BWAPI::UpgradeTypes::Grooved_Spines );
set( Gamete_Meiosis, BWAPI::UpgradeTypes::Gamete_Meiosis );
set( Metasynaptic_Node, BWAPI::UpgradeTypes::Metasynaptic_Node );
set( Singularity_Charge, BWAPI::UpgradeTypes::Singularity_Charge );
set( Leg_Enhancements, BWAPI::UpgradeTypes::Leg_Enhancements );
set( Scarab_Damage, BWAPI::UpgradeTypes::Scarab_Damage );
set( Reaver_Capacity, BWAPI::UpgradeTypes::Reaver_Capacity );
set( Gravitic_Drive, BWAPI::UpgradeTypes::Gravitic_Drive );
set( Sensor_Array, BWAPI::UpgradeTypes::Sensor_Array );
set( Gravitic_Boosters, BWAPI::UpgradeTypes::Gravitic_Boosters );
set( Khaydarin_Amulet, BWAPI::UpgradeTypes::Khaydarin_Amulet );
set( Apial_Sensors, BWAPI::UpgradeTypes::Apial_Sensors );
set( Gravitic_Thrusters, BWAPI::UpgradeTypes::Gravitic_Thrusters );
set( Carrier_Capacity, BWAPI::UpgradeTypes::Carrier_Capacity );
set( Khaydarin_Core, BWAPI::UpgradeTypes::Khaydarin_Core );
set( Argus_Jewel, BWAPI::UpgradeTypes::Argus_Jewel );
set( Argus_Talisman, BWAPI::UpgradeTypes::Argus_Talisman );
set( Caduceus_Reactor, BWAPI::UpgradeTypes::Caduceus_Reactor );
set( Chitinous_Plating, BWAPI::UpgradeTypes::Chitinous_Plating );
set( Anabolic_Synthesis, BWAPI::UpgradeTypes::Anabolic_Synthesis );
set( Charon_Boosters, BWAPI::UpgradeTypes::Charon_Boosters );
set( None, BWAPI::UnitTypes::None );
for( BuildType i : buildTypeSet )
{
if ( i != BuildTypes::None )
{
buildTypeSetByRace[i.getRace()].insert( i );
}
buildTypeData[i.getID()].setDependencies();
std::string name = i.getName();
fixName( name );
buildTypeMap.insert( std::make_pair( name, i ) );
}
// Contstruct required build type set
for( BuildType i : buildTypeSet )
{
if ( i != BuildTypes::None )
{
for ( std::map< BuildType, int >::const_iterator j = i.requiredBuildTypes().begin(); j != i.requiredBuildTypes().end(); j++ )
{
requiredBuildTypeSet.insert( j->first );
}
}
}
std::set< BWAPI::Race > races;
races.insert( BWAPI::Races::Terran );
races.insert( BWAPI::Races::Protoss );
races.insert( BWAPI::Races::Zerg );
// Give workers and refineries of different races the same bit masks
for( BWAPI::Race r : races )
{
requiredBuildTypeSet.insert( BuildType( r.getWorker() ) );
requiredBuildTypeSet.insert( BuildType( r.getRefinery() ) );
requiredBuildTypeSet.insert( BuildType( r.getSupplyProvider() ) );
requiredBuildTypeSet.insert( BuildType( r.getCenter() ) );
requiredBuildTypeSetByRace[r].insert( BuildType( r.getWorker() ) );
requiredBuildTypeSetByRace[r].insert( BuildType( r.getRefinery() ) );
requiredBuildTypeSetByRace[r].insert( BuildType( r.getSupplyProvider() ) );
requiredBuildTypeSetByRace[r].insert( BuildType( r.getCenter() ) );
buildTypeData[BuildType( r.getWorker() )].mask = WorkerMask;
buildTypeData[BuildType( r.getRefinery() )].mask = RefineryMask;
buildTypeData[BuildType( r.getSupplyProvider() )].mask = SupplyMask;
buildTypeData[BuildType( r.getCenter() )].mask = CenterMask;
}
// Set masks for required build types, and generate required build type set by race
for( BuildType i : requiredBuildTypeSet )
{
if ( buildTypeData[i.getID()].mask > 0 )
{
continue;
}
buildTypeData[i.getID()].mask = 1 << requiredBuildTypeSetByRace[i.getRace()].size();
requiredBuildTypeSetByRace[i.getRace()].insert( i );
}
// Generate required mask for each build type
for( BuildType i : buildTypeSet )
{
if ( i != BuildTypes::None )
{
for ( std::map< BuildType, int >::const_iterator j = i.requiredBuildTypes().begin(); j != i.requiredBuildTypes().end(); j++ )
{
buildTypeData[i.getID()].requiredMask |= j->first.getMask();
}
}
}
initializingBuildType = false;
}
}
BuildType::BuildType()
{
this->id = BuildTypes::None.id;
}
BuildType::BuildType( int id )
{
this->id = id;
if ( !initializingBuildType && ( id < 0 || id >= 203 || !buildTypeData[id].valid ) )
{
this->id = BuildTypes::None.id;
}
}
BuildType::BuildType( const BuildType& other )
{
this->id = other.id;
}
BuildType::BuildType( const BWAPI::TechType& other )
{
std::map< BWAPI::TechType, BuildType >::iterator i = techTypeToBuildTypeMap.find( other );
if ( i == techTypeToBuildTypeMap.end() )
{
this->id = BuildTypes::None.id;
}
else
{
this->id = i->second.id;
}
}
BuildType::BuildType( const BWAPI::UnitType& other )
{
std::map< BWAPI::UnitType, BuildType >::iterator i = unitTypeToBuildTypeMap.find( other );
if ( i == unitTypeToBuildTypeMap.end() )
{
this->id = BuildTypes::None.id;
}
else
{
this->id = i->second.id;
}
}
BuildType::BuildType( const BWAPI::UpgradeType& other, int level )
{
std::map< BWAPI::UpgradeType, BuildType >::iterator i = upgradeTypeToBuildTypeMap.find( other );
if ( i == upgradeTypeToBuildTypeMap.end() )
{
this->id = BuildTypes::None.id;
}
else
{
this->id = ( i->second.id ) + level - 1;
}
}
BuildType& BuildType::operator=( const BuildType& other )
{
this->id = other.id;
return *this;
}
BuildType& BuildType::operator=( const BWAPI::TechType& other )
{
std::map< BWAPI::TechType, BuildType >::iterator i = techTypeToBuildTypeMap.find( other );
if ( i == techTypeToBuildTypeMap.end() )
{
this->id = BuildTypes::None.id;
}
else
{
this->id = i->second.id;
}
return *this;
}
BuildType& BuildType::operator=( const BWAPI::UnitType& other )
{
std::map< BWAPI::UnitType, BuildType >::iterator i = unitTypeToBuildTypeMap.find( other );
if ( i == unitTypeToBuildTypeMap.end() )
{
this->id = BuildTypes::None.id;
}
else
{
this->id = i->second.id;
}
return *this;
}
BuildType& BuildType::operator=( const BWAPI::UpgradeType& other )
{
std::map< BWAPI::UpgradeType, BuildType >::iterator i = upgradeTypeToBuildTypeMap.find( other );
if ( i == upgradeTypeToBuildTypeMap.end() )
{
this->id = BuildTypes::None.id;
}
else
{
this->id = i->second.id;
}
return *this;
}
bool BuildType::operator==( const BuildType& other ) const
{
return this->id == other.id;
}
bool BuildType::operator==( const BWAPI::TechType& other ) const
{
return this->id == BuildType( other ).id;
}
bool BuildType::operator==( const BWAPI::UnitType& other ) const
{
return this->id == BuildType( other ).id;
}
bool BuildType::operator==( const BWAPI::UpgradeType& other ) const
{
return this->id == BuildType( other ).id;
}
bool BuildType::operator<( const BuildType& other ) const
{
return this->id < other.id;
}
BuildType::operator int() const
{
return this->id;
}
int BuildType::getID() const
{
return this->id;
}
const std::string& BuildType::getName() const
{
return buildTypeData[this->id].name;
}
BWAPI::Race BuildType::getRace() const
{
return buildTypeData[this->id].race;
}
bool BuildType::isTechType() const
{
return buildTypeData[this->id].techType != BWAPI::TechTypes::None;
}
bool BuildType::isUnitType() const
{
return buildTypeData[this->id].unitType != BWAPI::UnitTypes::None;
}
bool BuildType::isUpgradeType() const
{
return buildTypeData[this->id].upgradeType != BWAPI::UpgradeTypes::None;
}
BWAPI::TechType BuildType::getTechType() const
{
return buildTypeData[this->id].techType;
}
BWAPI::UnitType BuildType::getUnitType() const
{
return buildTypeData[this->id].unitType;
}
BWAPI::UpgradeType BuildType::getUpgradeType() const
{
return buildTypeData[this->id].upgradeType;
}
int BuildType::getUpgradeLevel() const
{
return buildTypeData[this->id].upgradeLevel;
}
unsigned int BuildType::getMask() const
{
return buildTypeData[this->id].mask;
}
unsigned int BuildType::getRequiredMask() const
{
return buildTypeData[this->id].requiredMask;
}
const std::pair< BuildType, int > BuildType::whatBuilds() const
{
return buildTypeData[this->id].whatBuilds;
}
const std::map< BuildType, int >& BuildType::requiredBuildTypes() const
{
return buildTypeData[this->id].requiredBuildTypes;
}
bool BuildType::requiresPsi() const
{
return buildTypeData[this->id].requiresPsi;
}
bool BuildType::requiresLarva() const
{
return buildTypeData[this->id].requiresLarva;
}
BuildType BuildType::requiredAddon() const
{
return buildTypeData[this->id].requiredAddon;
}
int BuildType::mineralPrice() const
{
return buildTypeData[this->id].mineralPrice;
}
int BuildType::gasPrice() const
{
return buildTypeData[this->id].gasPrice;
}
int BuildType::builderTime() const
{
return buildTypeData[this->id].builderTime;
}
int BuildType::buildUnitTime() const
{
return buildTypeData[this->id].buildUnitTime;
}
int BuildType::prepTime() const
{
return buildTypeData[this->id].prepTime;
}
bool BuildType::createsUnit() const
{
return buildTypeData[this->id].createsUnit;
}
bool BuildType::morphsBuilder() const
{
return buildTypeData[this->id].morphsBuilder;
}
bool BuildType::needsBuildLocation() const
{
return buildTypeData[this->id].needsBuildLocation;
}
int BuildType::supplyRequired() const
{
return buildTypeData[this->id].supplyRequired;
}
int BuildType::supplyProvided() const
{
return buildTypeData[this->id].supplyProvided;
}
bool BuildType::build( BWAPI::Unit builder, BWAPI::Unit secondBuilder, BWAPI::TilePosition buildLocation ) const
{
// Sanity check
if ( builder == NULL )
{
return false;
}
if ( buildTypeData[this->id].techType != BWAPI::TechTypes::None )
{
return builder->research( buildTypeData[this->id].techType );
}
if ( buildTypeData[this->id].upgradeType != BWAPI::UpgradeTypes::None )
{
return builder->upgrade( buildTypeData[this->id].upgradeType );
}
if ( buildTypeData[this->id].unitType != BWAPI::UnitTypes::None )
{
if ( buildTypeData[this->id].unitType == BWAPI::UnitTypes::Protoss_Archon )
{
return builder->useTech( BWAPI::TechTypes::Archon_Warp, secondBuilder );
}
if ( buildTypeData[this->id].unitType == BWAPI::UnitTypes::Protoss_Dark_Archon )
{
return builder->useTech( BWAPI::TechTypes::Dark_Archon_Meld, secondBuilder );
}
if ( buildTypeData[this->id].unitType.isAddon() )
{
return builder->buildAddon( buildTypeData[this->id].unitType );
}
if ( buildTypeData[this->id].unitType.isBuilding() == buildTypeData[this->id].unitType.whatBuilds().first.isBuilding() )
{
return builder->morph( buildTypeData[this->id].unitType );
}
if ( buildTypeData[this->id].unitType.isBuilding() )
{
return builder->build(buildTypeData[this->id].unitType, buildLocation);
}
return builder->train( buildTypeData[this->id].unitType );
}
return false;
}
bool BuildType::isPreparing( BWAPI::Unit builder, BWAPI::Unit secondBuilder ) const
{
// Sanity check
if ( builder == NULL )
{
return false;
}
if ( buildTypeData[this->id].techType != BWAPI::TechTypes::None )
{
return builder->isResearching() && builder->getTech() == buildTypeData[this->id].techType;
}
if ( buildTypeData[this->id].upgradeType != BWAPI::UpgradeTypes::None )
{
return builder->isUpgrading() && builder->getUpgrade() == buildTypeData[this->id].upgradeType;
}
if ( buildTypeData[this->id].unitType != BWAPI::UnitTypes::None )
{
return builder->isConstructing() ||
builder->isBeingConstructed() ||
builder->isMorphing() ||
builder->isTraining() ||
builder->getOrder() == BWAPI::Orders::ArchonWarp ||
builder->getOrder() == BWAPI::Orders::DarkArchonMeld;
}
return false;
}
bool BuildType::isBuilding( BWAPI::Unit builder, BWAPI::Unit secondBuilder, BWAPI::Unit createdUnit ) const
{
// Sanity check
if ( builder == NULL )
{
return false;
}
if ( buildTypeData[this->id].techType != BWAPI::TechTypes::None )
{
return builder->isResearching() && builder->getTech() == buildTypeData[this->id].techType;
}
if ( buildTypeData[this->id].upgradeType != BWAPI::UpgradeTypes::None )
{
return builder->isUpgrading() && builder->getUpgrade() == buildTypeData[this->id].upgradeType;
}
if ( buildTypeData[this->id].unitType != BWAPI::UnitTypes::None )
{
if ( buildTypeData[this->id].unitType == BWAPI::UnitTypes::Protoss_Archon )
{
return builder->getBuildType() == BWAPI::UnitTypes::Protoss_Archon ||
secondBuilder->getBuildType() == BWAPI::UnitTypes::Protoss_Archon;
}
if ( buildTypeData[this->id].unitType == BWAPI::UnitTypes::Protoss_Dark_Archon )
{
return builder->getBuildType() == BWAPI::UnitTypes::Protoss_Dark_Archon ||
secondBuilder->getBuildType() == BWAPI::UnitTypes::Protoss_Dark_Archon;
}
if ( buildTypeData[this->id].unitType.isAddon() )
{
return createdUnit != NULL &&
createdUnit->exists() &&
createdUnit->isConstructing() &&
createdUnit->getType() == buildTypeData[this->id].unitType;
}
if ( buildTypeData[this->id].morphsBuilder )
{
return ( builder->isConstructing() || builder->isMorphing() );
}
if ( buildTypeData[this->id].unitType.isBuilding() )
{
return createdUnit != NULL &&
createdUnit->exists() &&
createdUnit->isConstructing() &&
createdUnit->getType() == buildTypeData[this->id].unitType;
}
return builder->isTraining() &&
builder->getTrainingQueue().size() > 0 &&
( *builder->getTrainingQueue().begin() ) == buildTypeData[this->id].unitType;
}
return false;
}
bool BuildType::isCompleted( BWAPI::Unit builder, BWAPI::Unit secondBuilder, BWAPI::Unit createdUnit, BWAPI::Unit secondCreatedUnit ) const
{
if ( buildTypeData[this->id].techType != BWAPI::TechTypes::None )
{
return BWAPI::Broodwar->self()->hasResearched( buildTypeData[this->id].techType );
}
if ( buildTypeData[this->id].upgradeType != BWAPI::UpgradeTypes::None )
{
return BWAPI::Broodwar->self()->getUpgradeLevel( buildTypeData[this->id].upgradeType ) >= buildTypeData[this->id].upgradeLevel;
}
if ( buildTypeData[this->id].unitType != BWAPI::UnitTypes::None )
{
if ( ( buildTypeData[this->id].createsUnit || buildTypeData[this->id].requiresLarva ) &&
!( createdUnit != NULL &&
createdUnit->exists() &&
createdUnit->isCompleted() &&
createdUnit->getType() == buildTypeData[this->id].unitType ) )
{
return false;
}
if ( ( buildTypeData[this->id].createsUnit && buildTypeData[this->id].requiresLarva ) &&
!( secondCreatedUnit != NULL &&
secondCreatedUnit->exists() &&
secondCreatedUnit->isCompleted() &&
secondCreatedUnit->getType() == buildTypeData[this->id].unitType ) )
{
return false;
}
if ( buildTypeData[this->id].morphsBuilder )
{
bool builderMorphed = ( builder != NULL && builder->exists() && builder->isCompleted() && builder->getType() == buildTypeData[this->id].unitType );
bool secondBuilderMorphed = ( secondBuilder != NULL && secondBuilder->exists() && secondBuilder->isCompleted() && secondBuilder->getType() == buildTypeData[this->id].unitType );
if ( builderMorphed == false && secondBuilderMorphed == false )
{
return false;
}
}
if ( buildTypeData[this->id].unitType.isAddon() && builder->getAddon() != createdUnit )
{
return false;
}
return true;
}
return false;
}
int BuildType::remainingTime( BWAPI::Unit builder, BWAPI::Unit secondBuilder, BWAPI::Unit createdUnit ) const
{
// Sanity check
if ( builder == NULL )
{
return buildTypeData[this->id].buildUnitTime;
}
if ( buildTypeData[this->id].techType != BWAPI::TechTypes::None )
{
return builder->getRemainingResearchTime();
}
if ( buildTypeData[this->id].upgradeType != BWAPI::UpgradeTypes::None )
{
return builder->getRemainingUpgradeTime();
}
if ( buildTypeData[this->id].unitType != BWAPI::UnitTypes::None )
{
int t = 0;
if ( buildTypeData[this->id].createsUnit )
{
if ( createdUnit != NULL && createdUnit->exists() )
{
return createdUnit->getRemainingBuildTime();
}
else
{
return buildTypeData[this->id].buildUnitTime;
}
}
else
{
int t = 0;
if ( builder != NULL && builder->exists() )
{
t = max( builder->getRemainingBuildTime(), builder->getRemainingTrainTime() );
}
if ( secondBuilder != NULL && secondBuilder->exists() )
{
t = max( t, max( secondBuilder->getRemainingBuildTime(), secondBuilder->getRemainingTrainTime() ) );
}
}
return t;
}
return 0;
}
BuildType BuildTypes::getBuildType( std::string name )
{
fixName( name );
std::map< std::string, BuildType >::iterator i = buildTypeMap.find( name );
if ( i == buildTypeMap.end() )
{
return BuildTypes::None;
}
return ( *i ).second;
}
std::set< BuildType >& BuildTypes::allBuildTypes()
{
return buildTypeSet;
}
std::set< BuildType >& BuildTypes::allBuildTypes( BWAPI::Race r )
{
return buildTypeSetByRace[r];
}
std::set< BuildType >& BuildTypes::allRequiredBuildTypes()
{
return requiredBuildTypeSet;
}
std::set< BuildType >& BuildTypes::allRequiredBuildTypes( BWAPI::Race r )
{
return requiredBuildTypeSetByRace[r];
}
} | {
"content_hash": "8a81411bf7e7afe01cb096084a390c5f",
"timestamp": "",
"source": "github",
"line_count": 1258,
"max_line_length": 185,
"avg_line_length": 39.15818759936407,
"alnum_prop": 0.6378270843060433,
"repo_name": "Fobbah/bwsal",
"id": "1f7e19f784688fd6d3d17c53e5dd745af2d7fc76",
"size": "49354",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "BWSAL/Source/BuildType.cpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "2392"
},
{
"name": "C",
"bytes": "50"
},
{
"name": "C++",
"bytes": "459387"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="lang:clipboard.copy" content="Copy to clipboard">
<meta name="lang:clipboard.copied" content="Copied to clipboard">
<meta name="lang:search.language" content="en">
<meta name="lang:search.pipeline.stopwords" content="True">
<meta name="lang:search.pipeline.trimmer" content="True">
<meta name="lang:search.result.none" content="No matching documents">
<meta name="lang:search.result.one" content="1 matching document">
<meta name="lang:search.result.other" content="# matching documents">
<meta name="lang:search.tokenizer" content="[\s\-]+">
<link href="https://fonts.gstatic.com/" rel="preconnect" crossorigin>
<link href="https://fonts.googleapis.com/css?family=Roboto+Mono:400,500,700|Roboto:300,400,400i,700&display=fallback" rel="stylesheet">
<style>
body,
input {
font-family: "Roboto", "Helvetica Neue", Helvetica, Arial, sans-serif
}
code,
kbd,
pre {
font-family: "Roboto Mono", "Courier New", Courier, monospace
}
</style>
<link rel="stylesheet" href="../_static/stylesheets/application.css"/>
<link rel="stylesheet" href="../_static/stylesheets/application-palette.css"/>
<link rel="stylesheet" href="../_static/stylesheets/application-fixes.css"/>
<link rel="stylesheet" href="../_static/fonts/material-icons.css"/>
<meta name="theme-color" content="#3f51b5">
<script src="../_static/javascripts/modernizr.js"></script>
<title>statsmodels.tsa.statespace.dynamic_factor_mq.DynamicFactorMQResults.mse — statsmodels</title>
<link rel="icon" type="image/png" sizes="32x32" href="../_static/icons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="../_static/icons/favicon-16x16.png">
<link rel="manifest" href="../_static/icons/site.webmanifest">
<link rel="mask-icon" href="../_static/icons/safari-pinned-tab.svg" color="#919191">
<meta name="msapplication-TileColor" content="#2b5797">
<meta name="msapplication-config" content="../_static/icons/browserconfig.xml">
<link rel="stylesheet" href="../_static/stylesheets/examples.css">
<link rel="stylesheet" href="../_static/stylesheets/deprecation.css">
<link rel="stylesheet" href="../_static/material.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="../_static/graphviz.css" />
<script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
<script src="../_static/jquery.js"></script>
<script src="../_static/underscore.js"></script>
<script src="../_static/doctools.js"></script>
<script src="../_static/language_data.js"></script>
<script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>
<script async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true, "ignoreClass": "document", "processClass": "math|output_area"}})</script>
<link rel="shortcut icon" href="../_static/favicon.ico"/>
<link rel="author" title="About these documents" href="../about.html" />
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="statsmodels.tsa.statespace.dynamic_factor_mq.DynamicFactorMQResults.pvalues" href="statsmodels.tsa.statespace.dynamic_factor_mq.DynamicFactorMQResults.pvalues.html" />
<link rel="prev" title="statsmodels.tsa.statespace.dynamic_factor_mq.DynamicFactorMQResults.mae" href="statsmodels.tsa.statespace.dynamic_factor_mq.DynamicFactorMQResults.mae.html" />
</head>
<body dir=ltr
data-md-color-primary=indigo data-md-color-accent=blue>
<svg class="md-svg">
<defs data-children-count="0">
<svg xmlns="http://www.w3.org/2000/svg" width="416" height="448" viewBox="0 0 416 448" id="__github"><path fill="currentColor" d="M160 304q0 10-3.125 20.5t-10.75 19T128 352t-18.125-8.5-10.75-19T96 304t3.125-20.5 10.75-19T128 256t18.125 8.5 10.75 19T160 304zm160 0q0 10-3.125 20.5t-10.75 19T288 352t-18.125-8.5-10.75-19T256 304t3.125-20.5 10.75-19T288 256t18.125 8.5 10.75 19T320 304zm40 0q0-30-17.25-51T296 232q-10.25 0-48.75 5.25Q229.5 240 208 240t-39.25-2.75Q130.75 232 120 232q-29.5 0-46.75 21T56 304q0 22 8 38.375t20.25 25.75 30.5 15 35 7.375 37.25 1.75h42q20.5 0 37.25-1.75t35-7.375 30.5-15 20.25-25.75T360 304zm56-44q0 51.75-15.25 82.75-9.5 19.25-26.375 33.25t-35.25 21.5-42.5 11.875-42.875 5.5T212 416q-19.5 0-35.5-.75t-36.875-3.125-38.125-7.5-34.25-12.875T37 371.5t-21.5-28.75Q0 312 0 260q0-59.25 34-99-6.75-20.5-6.75-42.5 0-29 12.75-54.5 27 0 47.5 9.875t47.25 30.875Q171.5 96 212 96q37 0 70 8 26.25-20.5 46.75-30.25T376 64q12.75 25.5 12.75 54.5 0 21.75-6.75 42 34 40 34 99.5z"/></svg>
</defs>
</svg>
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer">
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#generated/statsmodels.tsa.statespace.dynamic_factor_mq.DynamicFactorMQResults.mse" tabindex="1" class="md-skip"> Skip to content </a>
<header class="md-header" data-md-component="header">
<nav class="md-header-nav md-grid">
<div class="md-flex navheader">
<div class="md-flex__cell md-flex__cell--shrink">
<a href="../index.html" title="statsmodels"
class="md-header-nav__button md-logo">
<img src="../_static/statsmodels-logo-v2-bw.svg" height="26"
alt="statsmodels logo">
</a>
</div>
<div class="md-flex__cell md-flex__cell--shrink">
<label class="md-icon md-icon--menu md-header-nav__button" for="__drawer"></label>
</div>
<div class="md-flex__cell md-flex__cell--stretch">
<div class="md-flex__ellipsis md-header-nav__title" data-md-component="title">
<span class="md-header-nav__topic">statsmodels v0.12.1</span>
<span class="md-header-nav__topic"> statsmodels.tsa.statespace.dynamic_factor_mq.DynamicFactorMQResults.mse </span>
</div>
</div>
<div class="md-flex__cell md-flex__cell--shrink">
<label class="md-icon md-icon--search md-header-nav__button" for="__search"></label>
<div class="md-search" data-md-component="search" role="dialog">
<label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search">
<form class="md-search__form" action="../search.html" method="GET" name="search">
<input type="text" class="md-search__input" name="q" placeholder="Search"
autocapitalize="off" autocomplete="off" spellcheck="false"
data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">

</button>
</form>
<div class="md-search__output">
<div class="md-search__scrollwrap" data-md-scrollfix>
<div class="md-search-result" data-md-component="result">
<div class="md-search-result__meta">
Type to start searching
</div>
<ol class="md-search-result__list"></ol>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="md-flex__cell md-flex__cell--shrink">
<div class="md-header-nav__source">
<a href="https://github.com/statsmodels/statsmodels" title="Go to repository" class="md-source" data-md-source="github">
<div class="md-source__icon">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24" width="28" height="28">
<use xlink:href="#__github" width="24" height="24"></use>
</svg>
</div>
<div class="md-source__repository">
statsmodels
</div>
</a>
</div>
</div>
<script src="../_static/javascripts/version_dropdown.js"></script>
<script>
var json_loc = "../_static/versions.json",
target_loc = "../../",
text = "Versions";
$( document ).ready( add_version_dropdown(json_loc, target_loc, text));
</script>
</div>
</nav>
</header>
<div class="md-container">
<nav class="md-tabs" data-md-component="tabs">
<div class="md-tabs__inner md-grid">
<ul class="md-tabs__list">
<li class="md-tabs__item"><a href="../user-guide.html" class="md-tabs__link">User Guide</a></li>
<li class="md-tabs__item"><a href="../statespace.html" class="md-tabs__link">Time Series Analysis by State Space Methods <code class="xref py py-mod docutils literal notranslate"><span class="pre">statespace</span></code></a></li>
<li class="md-tabs__item"><a href="statsmodels.tsa.statespace.dynamic_factor_mq.DynamicFactorMQResults.html" class="md-tabs__link">statsmodels.tsa.statespace.dynamic_factor_mq.DynamicFactorMQResults</a></li>
</ul>
</div>
</nav>
<main class="md-main">
<div class="md-main__inner md-grid" data-md-component="container">
<div class="md-sidebar md-sidebar--primary" data-md-component="navigation">
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--primary" data-md-level="0">
<label class="md-nav__title md-nav__title--site" for="__drawer">
<a href="../index.html" title="statsmodels" class="md-nav__button md-logo">
<img src="../_static/statsmodels-logo-v2-bw.svg" alt=" logo" width="48" height="48">
</a>
<a href="../index.html"
title="statsmodels">statsmodels v0.12.1</a>
</label>
<div class="md-nav__source">
<a href="https://github.com/statsmodels/statsmodels" title="Go to repository" class="md-source" data-md-source="github">
<div class="md-source__icon">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24" width="28" height="28">
<use xlink:href="#__github" width="24" height="24"></use>
</svg>
</div>
<div class="md-source__repository">
statsmodels
</div>
</a>
</div>
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="../install.html" class="md-nav__link">Installing statsmodels</a>
</li>
<li class="md-nav__item">
<a href="../gettingstarted.html" class="md-nav__link">Getting started</a>
</li>
<li class="md-nav__item">
<a href="../user-guide.html" class="md-nav__link">User Guide</a>
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="../user-guide.html#background" class="md-nav__link">Background</a>
</li>
<li class="md-nav__item">
<a href="../user-guide.html#regression-and-linear-models" class="md-nav__link">Regression and Linear Models</a>
</li>
<li class="md-nav__item">
<a href="../user-guide.html#time-series-analysis" class="md-nav__link">Time Series Analysis</a>
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="../tsa.html" class="md-nav__link">Time Series analysis <code class="xref py py-mod docutils literal notranslate"><span class="pre">tsa</span></code></a>
</li>
<li class="md-nav__item">
<a href="../statespace.html" class="md-nav__link">Time Series Analysis by State Space Methods <code class="xref py py-mod docutils literal notranslate"><span class="pre">statespace</span></code></a>
</li>
<li class="md-nav__item">
<a href="../vector_ar.html" class="md-nav__link">Vector Autoregressions <code class="xref py py-mod docutils literal notranslate"><span class="pre">tsa.vector_ar</span></code></a>
</li></ul>
</li>
<li class="md-nav__item">
<a href="../user-guide.html#other-models" class="md-nav__link">Other Models</a>
</li>
<li class="md-nav__item">
<a href="../user-guide.html#statistics-and-tools" class="md-nav__link">Statistics and Tools</a>
</li>
<li class="md-nav__item">
<a href="../user-guide.html#data-sets" class="md-nav__link">Data Sets</a>
</li>
<li class="md-nav__item">
<a href="../user-guide.html#sandbox" class="md-nav__link">Sandbox</a>
</li></ul>
</li>
<li class="md-nav__item">
<a href="../examples/index.html" class="md-nav__link">Examples</a>
</li>
<li class="md-nav__item">
<a href="../api.html" class="md-nav__link">API Reference</a>
</li>
<li class="md-nav__item">
<a href="../about.html" class="md-nav__link">About statsmodels</a>
</li>
<li class="md-nav__item">
<a href="../dev/index.html" class="md-nav__link">Developer Page</a>
</li>
<li class="md-nav__item">
<a href="../release/index.html" class="md-nav__link">Release Notes</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-sidebar md-sidebar--secondary" data-md-component="toc">
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--secondary">
<ul class="md-nav__list" data-md-scrollfix="">
<li class="md-nav__item"><a class="md-nav__extra_link" href="../_sources/generated/statsmodels.tsa.statespace.dynamic_factor_mq.DynamicFactorMQResults.mse.rst.txt">Show Source</a> </li>
<li id="searchbox" class="md-nav__item"></li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-content">
<article class="md-content__inner md-typeset" role="main">
<h1 id="generated-statsmodels-tsa-statespace-dynamic-factor-mq-dynamicfactormqresults-mse--page-root">statsmodels.tsa.statespace.dynamic_factor_mq.DynamicFactorMQResults.mse<a class="headerlink" href="#generated-statsmodels-tsa-statespace-dynamic-factor-mq-dynamicfactormqresults-mse--page-root" title="Permalink to this headline">¶</a></h1>
<dl class="py attribute">
<dt id="statsmodels.tsa.statespace.dynamic_factor_mq.DynamicFactorMQResults.mse">
<code class="sig-prename descclassname">DynamicFactorMQResults.</code><code class="sig-name descname">mse</code><a class="headerlink" href="#statsmodels.tsa.statespace.dynamic_factor_mq.DynamicFactorMQResults.mse" title="Permalink to this definition">¶</a></dt>
<dd><p>(float) Mean squared error</p>
</dd></dl>
</article>
</div>
</div>
</main>
</div>
<footer class="md-footer">
<div class="md-footer-nav">
<nav class="md-footer-nav__inner md-grid">
<a href="statsmodels.tsa.statespace.dynamic_factor_mq.DynamicFactorMQResults.mae.html" title="statsmodels.tsa.statespace.dynamic_factor_mq.DynamicFactorMQResults.mae"
class="md-flex md-footer-nav__link md-footer-nav__link--prev"
rel="prev">
<div class="md-flex__cell md-flex__cell--shrink">
<i class="md-icon md-icon--arrow-back md-footer-nav__button"></i>
</div>
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
<span class="md-flex__ellipsis">
<span
class="md-footer-nav__direction"> Previous </span> statsmodels.tsa.statespace.dynamic_factor_mq.DynamicFactorMQResults.mae </span>
</div>
</a>
<a href="statsmodels.tsa.statespace.dynamic_factor_mq.DynamicFactorMQResults.pvalues.html" title="statsmodels.tsa.statespace.dynamic_factor_mq.DynamicFactorMQResults.pvalues"
class="md-flex md-footer-nav__link md-footer-nav__link--next"
rel="next">
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title"><span
class="md-flex__ellipsis"> <span
class="md-footer-nav__direction"> Next </span> statsmodels.tsa.statespace.dynamic_factor_mq.DynamicFactorMQResults.pvalues </span>
</div>
<div class="md-flex__cell md-flex__cell--shrink"><i
class="md-icon md-icon--arrow-forward md-footer-nav__button"></i>
</div>
</a>
</nav>
</div>
<div class="md-footer-meta md-typeset">
<div class="md-footer-meta__inner md-grid">
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
© Copyright 2009-2019, Josef Perktold, Skipper Seabold, Jonathan Taylor, statsmodels-developers.
</div>
Last updated on
Oct 29, 2020.
<br/>
Created using
<a href="http://www.sphinx-doc.org/">Sphinx</a> 3.2.1.
and
<a href="https://github.com/bashtage/sphinx-material/">Material for
Sphinx</a>
</div>
</div>
</div>
</footer>
<script src="../_static/javascripts/application.js"></script>
<script>app.initialize({version: "1.0.4", url: {base: ".."}})</script>
</body>
</html> | {
"content_hash": "047a1443851bd1d8667a3de7c22ce38c",
"timestamp": "",
"source": "github",
"line_count": 449,
"max_line_length": 999,
"avg_line_length": 40.45657015590201,
"alnum_prop": 0.6091384530690889,
"repo_name": "statsmodels/statsmodels.github.io",
"id": "02e08d51f44edda602f5ed2903b31d7214914cc1",
"size": "18169",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "v0.12.1/generated/statsmodels.tsa.statespace.dynamic_factor_mq.DynamicFactorMQResults.mse.html",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
SIGCTRL_SOURCES = sigctrl_agent.c
SOURCES += $(SIGCTRL_SOURCES:%.c=signal/sigctrl/%.c)
| {
"content_hash": "ca8fb9f31182470a0048751649d565b8",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 52,
"avg_line_length": 18,
"alnum_prop": 0.7,
"repo_name": "levenkov/olver",
"id": "3e01dc34ec9ce712d7b7e250c4f9dd3583199a1b",
"size": "90",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/agent/signal/sigctrl/Makefile",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Assembly",
"bytes": "603"
},
{
"name": "C",
"bytes": "2083994"
},
{
"name": "C++",
"bytes": "129137"
},
{
"name": "GAP",
"bytes": "8091"
},
{
"name": "Objective-C",
"bytes": "6840"
},
{
"name": "Shell",
"bytes": "28776"
}
],
"symlink_target": ""
} |
<?php
/**
* Declare the Project Classification Taxonomy
* This is the taxonomy used to classify each project by either
* geographic region, type of project, or any other form of
* classification needed to best organize the projects on the page.
*/
add_action( 'init', 'project_classification_tax', 1 );
function project_classification_tax() {
// Add new taxonomy, make it hierarchical (like categories)
$labels = array(
'name' => _x( 'Classification', 'taxonomy general name' ),
'singular_name' => _x( 'Classification', 'taxonomy singular name' ),
'search_items' => __( 'Search Classifications' ),
'all_items' => __( 'All Classifications' ),
'parent_item' => __( 'Parent Classification' ),
'parent_item_colon' => __( 'Parent Classification:' ),
'edit_item' => __( 'Edit Classification' ),
'update_item' => __( 'Update Classification' ),
'add_new_item' => __( 'Add New Classification' ),
'new_item_name' => __( 'New Classification Name' ),
'menu_name' => __( 'Classification' ),
);
$args = array(
'hierarchical' => true,
'labels' => $labels,
'show_ui' => true,
'show_admin_column' => true,
'show_in_quick_edit'=> false,
'query_var' => true,
'rewrite' => array( 'slug' => 'project-classifications' ),
);
register_taxonomy( 'project_classification', array( 'project' ), $args );
}
/**
* Replace Checkboxes with Radio Buttons
* Doing this allows us to restrict the user to only one selection,
* which prevents a project from being classified twice.
*/
class WordPress_Radio_Taxonomy {
static $taxonomy = 'project_classification';
static $taxonomy_metabox_id = 'project_classificationdiv';
static $post_type= 'project';
public static function load(){
//Remove old taxonomy meta box
add_action( 'admin_menu', array(__CLASS__,'remove_meta_box'));
//Add new taxonomy meta box
add_action( 'add_meta_boxes', array(__CLASS__,'add_meta_box'));
//Load admin scripts
add_action('admin_enqueue_scripts',array(__CLASS__,'admin_script'));
//Load admin scripts
add_action('wp_ajax_radio_tax_add_taxterm',array(__CLASS__,'ajax_add_term'));
}
public static function remove_meta_box(){
remove_meta_box(static::$taxonomy_metabox_id, static::$post_type, 'normal');
}
public static function add_meta_box() {
add_meta_box( 'project_classification', 'Classification',array(__CLASS__,'metabox'), static::$post_type ,'side','core');
}
//Callback to set up the metabox
public static function metabox( $post ) {
//Get taxonomy and terms
$taxonomy = self::$taxonomy;
//Set up the taxonomy object and get terms
$tax = get_taxonomy($taxonomy);
$terms = get_terms($taxonomy,array('hide_empty' => 0));
//Name of the form
$name = 'tax_input[' . $taxonomy . ']';
//Get current and popular terms
$popular = get_terms( $taxonomy, array( 'orderby' => 'count', 'order' => 'DESC', 'number' => 10, 'hierarchical' => false ) );
$postterms = get_the_terms( $post->ID,$taxonomy );
$current = ($postterms ? array_pop($postterms) : false);
$current = ($current ? $current->term_id : 0);
?>
<div id="taxonomy-<?php echo $taxonomy; ?>" class="categorydiv">
<!-- Display tabs-->
<ul id="<?php echo $taxonomy; ?>-tabs" class="category-tabs">
<li class="tabs"><a href="#<?php echo $taxonomy; ?>-all" tabindex="3"><?php echo $tax->labels->all_items; ?></a></li>
<li class="hide-if-no-js"><a href="#<?php echo $taxonomy; ?>-pop" tabindex="3"><?php _e( 'Most Used' ); ?></a></li>
</ul>
<!-- Display taxonomy terms -->
<div id="<?php echo $taxonomy; ?>-all" class="tabs-panel">
<ul id="<?php echo $taxonomy; ?>checklist" class="list:<?php echo $taxonomy?> categorychecklist form-no-clear">
<?php foreach($terms as $term){
$id = $taxonomy.'-'.$term->term_id;
$value= (is_taxonomy_hierarchical($taxonomy) ? "value='{$term->term_id}'" : "value='{$term->term_slug}'");
echo "<li id='$id'><label class='selectit'>";
echo "<input type='radio' id='in-$id' name='{$name}'".checked($current,$term->term_id,false)." {$value} />$term->name<br />";
echo "</label></li>";
}?>
</ul>
</div>
<!-- Display popular taxonomy terms -->
<div id="<?php echo $taxonomy; ?>-pop" class="tabs-panel" style="display: none;">
<ul id="<?php echo $taxonomy; ?>checklist-pop" class="categorychecklist form-no-clear" >
<?php foreach($popular as $term){
$id = 'popular-'.$taxonomy.'-'.$term->term_id;
$value= (is_taxonomy_hierarchical($taxonomy) ? "value='{$term->term_id}'" : "value='{$term->term_slug}'");
echo "<li id='$id'><label class='selectit'>";
echo "<input type='radio' id='in-$id'".checked($current,$term->term_id,false)." {$value} />$term->name<br />";
echo "</label></li>";
}?>
</ul>
</div>
<p id="<?php echo $taxonomy; ?>-add" class="">
<label class="screen-reader-text" for="new<?php echo $taxonomy; ?>"><?php echo $tax->labels->add_new_item; ?></label>
<input type="text" name="new<?php echo $taxonomy; ?>" id="new<?php echo $taxonomy; ?>" class="form-required form-input-tip" value="<?php echo esc_attr( $tax->labels->new_item_name ); ?>" tabindex="3" aria-required="true"/>
<input type="button" id="" class="radio-tax-add button" value="<?php echo esc_attr( $tax->labels->add_new_item ); ?>" tabindex="3" />
<?php wp_nonce_field( 'radio-tax-add-'.$taxonomy, '_wpnonce_radio-add-tag', false ); ?>
</p>
</div>
<?php
}
public static function admin_script(){
wp_register_script( 'radiotax', get_template_directory_uri() . '/js/radiotax.js', array('jquery'), null, true );
wp_localize_script( 'radiotax', 'radio_tax', array('slug'=>self::$taxonomy));
wp_enqueue_script( 'radiotax' );
}
public function ajax_add_term(){
$taxonomy = !empty($_POST['taxonomy']) ? $_POST['taxonomy'] : '';
$term = !empty($_POST['term']) ? $_POST['term'] : '';
$tax = get_taxonomy($taxonomy);
check_ajax_referer('radio-tax-add-'.$taxonomy, '_wpnonce_radio-add-tag');
if(!$tax || empty($term))
exit();
if ( !current_user_can( $tax->cap->edit_terms ) )
die('-1');
$tag = wp_insert_term($term, $taxonomy);
if ( !$tag || is_wp_error($tag) || (!$tag = get_term( $tag['term_id'], $taxonomy )) ) {
//TODO Error handling
exit();
}
$id = $taxonomy.'-'.$tag->term_id;
$name = 'tax_input[' . $taxonomy . ']';
$value= (is_taxonomy_hierarchical($taxonomy) ? "value='{$tag->term_id}'" : "value='{$term->tag_slug}'");
$html ='<li id="'.$id.'"><label class="selectit"><input type="radio" id="in-'.$id.'" name="'.$name.'" '.$value.' />'. $tag->name.'</label></li>';
echo json_encode(array('term'=>$tag->term_id,'html'=>$html));
exit();
}
}
WordPress_Radio_Taxonomy::load();
?> | {
"content_hash": "3f4b2b70ad749afcaf08e89cfdcedf0a",
"timestamp": "",
"source": "github",
"line_count": 162,
"max_line_length": 226,
"avg_line_length": 44.333333333333336,
"alnum_prop": 0.5756056808688388,
"repo_name": "josh-rathke/100foldstudio",
"id": "1837256164a7ba1a7cf915d2250775208987c351",
"size": "7182",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "library/custom-taxonomies/project_classification_tax.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "157462"
},
{
"name": "JavaScript",
"bytes": "69943"
},
{
"name": "PHP",
"bytes": "297403"
}
],
"symlink_target": ""
} |
/* Includes ------------------------------------------------------------------*/
#include "stm32l4xx_hal.h"
/** @addtogroup STM32L4xx_HAL_Driver
* @{
*/
/** @defgroup RCCEx RCCEx
* @brief RCC Extended HAL module driver
* @{
*/
#ifdef HAL_RCC_MODULE_ENABLED
/* Private typedef -----------------------------------------------------------*/
/* Private defines -----------------------------------------------------------*/
/** @defgroup RCCEx_Private_Constants RCCEx Private Constants
* @{
*/
#define PLLSAI1_TIMEOUT_VALUE 1000U /* Timeout value fixed to 100 ms */
#define PLLSAI2_TIMEOUT_VALUE 1000U /* Timeout value fixed to 100 ms */
#define PLL_TIMEOUT_VALUE 100U /* Timeout value fixed to 100 ms */
#define __LSCO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
#define LSCO_GPIO_PORT GPIOA
#define LSCO_PIN GPIO_PIN_2
/**
* @}
*/
/* Private macros ------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
/** @defgroup RCCEx_Private_Functions RCCEx Private Functions
* @{
*/
static HAL_StatusTypeDef RCCEx_PLLSAI1_ConfigNP(RCC_PLLSAI1InitTypeDef *PllSai1);
static HAL_StatusTypeDef RCCEx_PLLSAI1_ConfigNQ(RCC_PLLSAI1InitTypeDef *PllSai1);
static HAL_StatusTypeDef RCCEx_PLLSAI1_ConfigNR(RCC_PLLSAI1InitTypeDef *PllSai1);
static HAL_StatusTypeDef RCCEx_PLLSAI2_ConfigNP(RCC_PLLSAI2InitTypeDef *PllSai2);
static HAL_StatusTypeDef RCCEx_PLLSAI2_ConfigNR(RCC_PLLSAI2InitTypeDef *PllSai2);
/**
* @}
*/
/* Exported functions --------------------------------------------------------*/
/** @defgroup RCCEx_Exported_Functions RCCEx Exported Functions
* @{
*/
/** @defgroup RCCEx_Exported_Functions_Group1 Extended Peripheral Control functions
* @brief Extended Peripheral Control functions
*
@verbatim
===============================================================================
##### Extended Peripheral Control functions #####
===============================================================================
[..]
This subsection provides a set of functions allowing to control the RCC Clocks
frequencies.
[..]
(@) Important note: Care must be taken when HAL_RCCEx_PeriphCLKConfig() is used to
select the RTC clock source; in this case the Backup domain will be reset in
order to modify the RTC Clock source, as consequence RTC registers (including
the backup registers) and RCC_BDCR register are set to their reset values.
@endverbatim
* @{
*/
/**
* @brief Initialize the RCC extended peripherals clocks according to the specified
* parameters in the RCC_PeriphCLKInitTypeDef.
* @param PeriphClkInit pointer to an RCC_PeriphCLKInitTypeDef structure that
* contains a field PeriphClockSelection which can be a combination of the following values:
* @arg @ref RCC_PERIPHCLK_RTC RTC peripheral clock
* @arg @ref RCC_PERIPHCLK_ADC ADC peripheral clock
* @arg @ref RCC_PERIPHCLK_DFSDM DFSDM peripheral clock
* @arg @ref RCC_PERIPHCLK_I2C1 I2C1 peripheral clock
* @arg @ref RCC_PERIPHCLK_I2C2 I2C2 peripheral clock
* @arg @ref RCC_PERIPHCLK_I2C3 I2C3 peripheral clock
* @arg @ref RCC_PERIPHCLK_LPTIM1 LPTIM1 peripheral clock
* @arg @ref RCC_PERIPHCLK_LPTIM2 LPTIM2 peripheral clock
* @arg @ref RCC_PERIPHCLK_LPUART1 LPUART1 peripheral clock
* @arg @ref RCC_PERIPHCLK_RNG RNG peripheral clock
* @arg @ref RCC_PERIPHCLK_SAI1 SAI1 peripheral clock
* @arg @ref RCC_PERIPHCLK_SAI2 SAI2 peripheral clock
* @arg @ref RCC_PERIPHCLK_SDMMC1 SDMMC1 peripheral clock
* @arg @ref RCC_PERIPHCLK_SWPMI1 SWPMI1 peripheral clock
* @arg @ref RCC_PERIPHCLK_USART1 USART1 peripheral clock
* @arg @ref RCC_PERIPHCLK_USART2 USART1 peripheral clock
* @arg @ref RCC_PERIPHCLK_USART3 USART1 peripheral clock
* @arg @ref RCC_PERIPHCLK_UART4 USART1 peripheral clock
* @arg @ref RCC_PERIPHCLK_UART5 USART1 peripheral clock
* @arg @ref RCC_PERIPHCLK_USB USB peripheral clock (only for devices with USB)
*
* @note Care must be taken when HAL_RCCEx_PeriphCLKConfig() is used to select
* the RTC clock source: in this case the access to Backup domain is enabled.
*
* @retval HAL status
*/
HAL_StatusTypeDef HAL_RCCEx_PeriphCLKConfig(RCC_PeriphCLKInitTypeDef *PeriphClkInit)
{
uint32_t tmpregister = 0;
uint32_t tickstart = 0;
HAL_StatusTypeDef ret = HAL_OK; /* Intermediate status */
HAL_StatusTypeDef status = HAL_OK; /* Final status */
/* Check the parameters */
assert_param(IS_RCC_PERIPHCLOCK(PeriphClkInit->PeriphClockSelection));
/*-------------------------- SAI1 clock source configuration ---------------------*/
if((((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_SAI1) == RCC_PERIPHCLK_SAI1))
{
/* Check the parameters */
assert_param(IS_RCC_SAI1CLK(PeriphClkInit->Sai1ClockSelection));
switch(PeriphClkInit->Sai1ClockSelection)
{
case RCC_SAI1CLKSOURCE_PLL: /* PLL is used as clock source for SAI1*/
/* Enable SAI Clock output generated form System PLL . */
__HAL_RCC_PLLCLKOUT_ENABLE(RCC_PLL_SAI3CLK);
/* SAI1 clock source config set later after clock selection check */
break;
case RCC_SAI1CLKSOURCE_PLLSAI1: /* PLLSAI1 is used as clock source for SAI1*/
/* PLLSAI1 parameters N & P configuration and clock output (PLLSAI1ClockOut) */
ret = RCCEx_PLLSAI1_ConfigNP(&(PeriphClkInit->PLLSAI1));
/* SAI1 clock source config set later after clock selection check */
break;
case RCC_SAI1CLKSOURCE_PLLSAI2: /* PLLSAI2 is used as clock source for SAI1*/
/* PLLSAI2 parameters N & P configuration and clock output (PLLSAI2ClockOut) */
ret = RCCEx_PLLSAI2_ConfigNP(&(PeriphClkInit->PLLSAI2));
/* SAI1 clock source config set later after clock selection check */
break;
case RCC_SAI1CLKSOURCE_PIN: /* External clock is used as source of SAI1 clock*/
/* SAI1 clock source config set later after clock selection check */
break;
default:
ret = HAL_ERROR;
break;
}
if(ret == HAL_OK)
{
/* Set the source of SAI1 clock*/
__HAL_RCC_SAI1_CONFIG(PeriphClkInit->Sai1ClockSelection);
}
else
{
/* set overall return value */
status = ret;
}
}
/*-------------------------- SAI2 clock source configuration ---------------------*/
if((((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_SAI2) == RCC_PERIPHCLK_SAI2))
{
/* Check the parameters */
assert_param(IS_RCC_SAI2CLK(PeriphClkInit->Sai2ClockSelection));
switch(PeriphClkInit->Sai2ClockSelection)
{
case RCC_SAI2CLKSOURCE_PLL: /* PLL is used as clock source for SAI2*/
/* Enable SAI Clock output generated form System PLL . */
__HAL_RCC_PLLCLKOUT_ENABLE(RCC_PLL_SAI3CLK);
/* SAI2 clock source config set later after clock selection check */
break;
case RCC_SAI2CLKSOURCE_PLLSAI1: /* PLLSAI1 is used as clock source for SAI2*/
/* PLLSAI1 parameters N & P configuration and clock output (PLLSAI1ClockOut) */
ret = RCCEx_PLLSAI1_ConfigNP(&(PeriphClkInit->PLLSAI1));
/* SAI2 clock source config set later after clock selection check */
break;
case RCC_SAI2CLKSOURCE_PLLSAI2: /* PLLSAI2 is used as clock source for SAI2*/
/* PLLSAI2 parameters N & P configuration and clock output (PLLSAI2ClockOut) */
ret = RCCEx_PLLSAI2_ConfigNP(&(PeriphClkInit->PLLSAI2));
/* SAI2 clock source config set later after clock selection check */
break;
case RCC_SAI2CLKSOURCE_PIN: /* External clock is used as source of SAI2 clock*/
/* SAI2 clock source config set later after clock selection check */
break;
default:
ret = HAL_ERROR;
break;
}
if(ret == HAL_OK)
{
/* Set the source of SAI2 clock*/
__HAL_RCC_SAI2_CONFIG(PeriphClkInit->Sai2ClockSelection);
}
else
{
/* set overall return value */
status = ret;
}
}
/*-------------------------- RTC clock source configuration ----------------------*/
if((PeriphClkInit->PeriphClockSelection & RCC_PERIPHCLK_RTC) == RCC_PERIPHCLK_RTC)
{
FlagStatus pwrclkchanged = RESET;
/* Check for RTC Parameters used to output RTCCLK */
assert_param(IS_RCC_RTCCLKSOURCE(PeriphClkInit->RTCClockSelection));
/* Enable Power Clock */
if(__HAL_RCC_PWR_IS_CLK_DISABLED())
{
__HAL_RCC_PWR_CLK_ENABLE();
pwrclkchanged = SET;
}
/* Enable write access to Backup domain */
SET_BIT(PWR->CR1, PWR_CR1_DBP);
/* Wait for Backup domain Write protection disable */
tickstart = HAL_GetTick();
while((PWR->CR1 & PWR_CR1_DBP) == RESET)
{
if((HAL_GetTick() - tickstart) > RCC_DBP_TIMEOUT_VALUE)
{
ret = HAL_TIMEOUT;
break;
}
}
if(ret == HAL_OK)
{
/* Reset the Backup domain only if the RTC Clock source selection is modified */
if(READ_BIT(RCC->BDCR, RCC_BDCR_RTCSEL) != PeriphClkInit->RTCClockSelection)
{
/* Store the content of BDCR register before the reset of Backup Domain */
tmpregister = READ_BIT(RCC->BDCR, ~(RCC_BDCR_RTCSEL));
/* RTC Clock selection can be changed only if the Backup Domain is reset */
__HAL_RCC_BACKUPRESET_FORCE();
__HAL_RCC_BACKUPRESET_RELEASE();
/* Restore the Content of BDCR register */
RCC->BDCR = tmpregister;
}
/* Wait for LSE reactivation if LSE was enable prior to Backup Domain reset */
if (HAL_IS_BIT_SET(tmpregister, RCC_BDCR_LSERDY))
{
/* Get Start Tick*/
tickstart = HAL_GetTick();
/* Wait till LSE is ready */
while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSERDY) == RESET)
{
if((HAL_GetTick() - tickstart) > RCC_LSE_TIMEOUT_VALUE)
{
ret = HAL_TIMEOUT;
break;
}
}
}
if(ret == HAL_OK)
{
/* Apply new RTC clock source selection */
__HAL_RCC_RTC_CONFIG(PeriphClkInit->RTCClockSelection);
}
else
{
/* set overall return value */
status = ret;
}
}
else
{
/* set overall return value */
status = ret;
}
/* Restore clock configuration if changed */
if(pwrclkchanged == SET)
{
__HAL_RCC_PWR_CLK_DISABLE();
}
}
/*-------------------------- USART1 clock source configuration -------------------*/
if(((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_USART1) == RCC_PERIPHCLK_USART1)
{
/* Check the parameters */
assert_param(IS_RCC_USART1CLKSOURCE(PeriphClkInit->Usart1ClockSelection));
/* Configure the USART1 clock source */
__HAL_RCC_USART1_CONFIG(PeriphClkInit->Usart1ClockSelection);
}
/*-------------------------- USART2 clock source configuration -------------------*/
if(((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_USART2) == RCC_PERIPHCLK_USART2)
{
/* Check the parameters */
assert_param(IS_RCC_USART2CLKSOURCE(PeriphClkInit->Usart2ClockSelection));
/* Configure the USART2 clock source */
__HAL_RCC_USART2_CONFIG(PeriphClkInit->Usart2ClockSelection);
}
/*-------------------------- USART3 clock source configuration -------------------*/
if(((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_USART3) == RCC_PERIPHCLK_USART3)
{
/* Check the parameters */
assert_param(IS_RCC_USART3CLKSOURCE(PeriphClkInit->Usart3ClockSelection));
/* Configure the USART3 clock source */
__HAL_RCC_USART3_CONFIG(PeriphClkInit->Usart3ClockSelection);
}
/*-------------------------- UART4 clock source configuration --------------------*/
if(((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_UART4) == RCC_PERIPHCLK_UART4)
{
/* Check the parameters */
assert_param(IS_RCC_UART4CLKSOURCE(PeriphClkInit->Uart4ClockSelection));
/* Configure the UART4 clock source */
__HAL_RCC_UART4_CONFIG(PeriphClkInit->Uart4ClockSelection);
}
/*-------------------------- UART5 clock source configuration --------------------*/
if(((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_UART5) == RCC_PERIPHCLK_UART5)
{
/* Check the parameters */
assert_param(IS_RCC_UART5CLKSOURCE(PeriphClkInit->Uart5ClockSelection));
/* Configure the UART5 clock source */
__HAL_RCC_UART5_CONFIG(PeriphClkInit->Uart5ClockSelection);
}
/*-------------------------- LPUART1 clock source configuration ------------------*/
if(((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_LPUART1) == RCC_PERIPHCLK_LPUART1)
{
/* Check the parameters */
assert_param(IS_RCC_LPUART1CLKSOURCE(PeriphClkInit->Lpuart1ClockSelection));
/* Configure the LPUAR1 clock source */
__HAL_RCC_LPUART1_CONFIG(PeriphClkInit->Lpuart1ClockSelection);
}
/*-------------------------- LPTIM1 clock source configuration -------------------*/
if(((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_LPTIM1) == (RCC_PERIPHCLK_LPTIM1))
{
assert_param(IS_RCC_LPTIM1CLK(PeriphClkInit->Lptim1ClockSelection));
__HAL_RCC_LPTIM1_CONFIG(PeriphClkInit->Lptim1ClockSelection);
}
/*-------------------------- LPTIM2 clock source configuration -------------------*/
if(((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_LPTIM2) == (RCC_PERIPHCLK_LPTIM2))
{
assert_param(IS_RCC_LPTIM2CLK(PeriphClkInit->Lptim2ClockSelection));
__HAL_RCC_LPTIM2_CONFIG(PeriphClkInit->Lptim2ClockSelection);
}
/*-------------------------- I2C1 clock source configuration ---------------------*/
if(((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_I2C1) == RCC_PERIPHCLK_I2C1)
{
/* Check the parameters */
assert_param(IS_RCC_I2C1CLKSOURCE(PeriphClkInit->I2c1ClockSelection));
/* Configure the I2C1 clock source */
__HAL_RCC_I2C1_CONFIG(PeriphClkInit->I2c1ClockSelection);
}
/*-------------------------- I2C2 clock source configuration ---------------------*/
if(((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_I2C2) == RCC_PERIPHCLK_I2C2)
{
/* Check the parameters */
assert_param(IS_RCC_I2C2CLKSOURCE(PeriphClkInit->I2c2ClockSelection));
/* Configure the I2C2 clock source */
__HAL_RCC_I2C2_CONFIG(PeriphClkInit->I2c2ClockSelection);
}
/*-------------------------- I2C3 clock source configuration ---------------------*/
if(((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_I2C3) == RCC_PERIPHCLK_I2C3)
{
/* Check the parameters */
assert_param(IS_RCC_I2C3CLKSOURCE(PeriphClkInit->I2c3ClockSelection));
/* Configure the I2C3 clock source */
__HAL_RCC_I2C3_CONFIG(PeriphClkInit->I2c3ClockSelection);
}
#if defined(STM32L475xx) || defined(STM32L476xx) || defined(STM32L485xx) || defined(STM32L486xx)
/*-------------------------- USB clock source configuration ----------------------*/
if(((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_USB) == (RCC_PERIPHCLK_USB))
{
assert_param(IS_RCC_USBCLKSOURCE(PeriphClkInit->UsbClockSelection));
__HAL_RCC_USB_CONFIG(PeriphClkInit->UsbClockSelection);
if(PeriphClkInit->UsbClockSelection == RCC_USBCLKSOURCE_PLL)
{
/* Enable PLL48M1CLK output */
__HAL_RCC_PLLCLKOUT_ENABLE(RCC_PLL_48M1CLK);
}
else if(PeriphClkInit->UsbClockSelection == RCC_USBCLKSOURCE_PLLSAI1)
{
/* PLLSAI1 parameters N & Q configuration and clock output (PLLSAI1ClockOut) */
ret = RCCEx_PLLSAI1_ConfigNQ(&(PeriphClkInit->PLLSAI1));
if(ret != HAL_OK)
{
/* set overall return value */
status = ret;
}
}
}
#endif /* STM32L475xx || STM32L476xx || STM32L485xx || STM32L486xx */
/*-------------------------- SDMMC1 clock source configuration -------------------*/
if(((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_SDMMC1) == (RCC_PERIPHCLK_SDMMC1))
{
assert_param(IS_RCC_SDMMC1CLKSOURCE(PeriphClkInit->Sdmmc1ClockSelection));
__HAL_RCC_SDMMC1_CONFIG(PeriphClkInit->Sdmmc1ClockSelection);
if(PeriphClkInit->Sdmmc1ClockSelection == RCC_SDMMC1CLKSOURCE_PLL)
{
/* Enable PLL48M1CLK output */
__HAL_RCC_PLLCLKOUT_ENABLE(RCC_PLL_48M1CLK);
}
else if(PeriphClkInit->Sdmmc1ClockSelection == RCC_SDMMC1CLKSOURCE_PLLSAI1)
{
/* PLLSAI1 parameters N & Q configuration and clock output (PLLSAI1ClockOut) */
ret = RCCEx_PLLSAI1_ConfigNQ(&(PeriphClkInit->PLLSAI1));
if(ret != HAL_OK)
{
/* set overall return value */
status = ret;
}
}
}
/*-------------------------- RNG clock source configuration ----------------------*/
if(((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_RNG) == (RCC_PERIPHCLK_RNG))
{
assert_param(IS_RCC_RNGCLKSOURCE(PeriphClkInit->RngClockSelection));
__HAL_RCC_RNG_CONFIG(PeriphClkInit->RngClockSelection);
if(PeriphClkInit->RngClockSelection == RCC_RNGCLKSOURCE_PLL)
{
/* Enable PLL48M1CLK output */
__HAL_RCC_PLLCLKOUT_ENABLE(RCC_PLL_48M1CLK);
}
else if(PeriphClkInit->RngClockSelection == RCC_RNGCLKSOURCE_PLLSAI1)
{
/* PLLSAI1 parameters N & Q configuration and clock output (PLLSAI1ClockOut) */
ret = RCCEx_PLLSAI1_ConfigNQ(&(PeriphClkInit->PLLSAI1));
if(ret != HAL_OK)
{
/* set overall return value */
status = ret;
}
}
}
/*-------------------------- ADC clock source configuration ----------------------*/
if(((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_ADC) == RCC_PERIPHCLK_ADC)
{
/* Check the parameters */
assert_param(IS_RCC_ADCCLKSOURCE(PeriphClkInit->AdcClockSelection));
/* Configure the ADC interface clock source */
__HAL_RCC_ADC_CONFIG(PeriphClkInit->AdcClockSelection);
if(PeriphClkInit->AdcClockSelection == RCC_ADCCLKSOURCE_PLLSAI1)
{
/* PLLSAI1 parameters N & R configuration and clock output (PLLSAI1ClockOut) */
ret = RCCEx_PLLSAI1_ConfigNR(&(PeriphClkInit->PLLSAI1));
if(ret != HAL_OK)
{
/* set overall return value */
status = ret;
}
}
else if(PeriphClkInit->AdcClockSelection == RCC_ADCCLKSOURCE_PLLSAI2)
{
/* PLLSAI2 parameters N & R configuration and clock output (PLLSAI2ClockOut) */
ret = RCCEx_PLLSAI2_ConfigNR(&(PeriphClkInit->PLLSAI2));
if(ret != HAL_OK)
{
/* set overall return value */
status = ret;
}
}
}
/*-------------------------- SWPMI1 clock source configuration -------------------*/
if(((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_SWPMI1) == RCC_PERIPHCLK_SWPMI1)
{
/* Check the parameters */
assert_param(IS_RCC_SWPMI1CLKSOURCE(PeriphClkInit->Swpmi1ClockSelection));
/* Configure the SWPMI1 clock source */
__HAL_RCC_SWPMI1_CONFIG(PeriphClkInit->Swpmi1ClockSelection);
}
/*-------------------------- DFSDM clock source configuration --------------------*/
if(((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_DFSDM) == RCC_PERIPHCLK_DFSDM)
{
/* Check the parameters */
assert_param(IS_RCC_DFSDMCLKSOURCE(PeriphClkInit->DfsdmClockSelection));
/* Configure the DFSDM interface clock source */
__HAL_RCC_DFSDM_CONFIG(PeriphClkInit->DfsdmClockSelection);
}
return status;
}
/**
* @brief Get the RCC_ClkInitStruct according to the internal RCC configuration registers.
* @param PeriphClkInit pointer to an RCC_PeriphCLKInitTypeDef structure that
* returns the configuration information for the Extended Peripherals
* clocks(SAI1, SAI2, LPTIM1, LPTIM2, I2C1, I2C2, I2C3, LPUART,
* USART1, USART2, USART3, UART4, UART5, RTC, ADCx, DFSDMx, SWPMI1, USB, SDMMC1 and RNG).
* @retval None
*/
void HAL_RCCEx_GetPeriphCLKConfig(RCC_PeriphCLKInitTypeDef *PeriphClkInit)
{
/* Set all possible values for the extended clock type parameter------------*/
#if defined(STM32L471xx)
PeriphClkInit->PeriphClockSelection = RCC_PERIPHCLK_USART1 | RCC_PERIPHCLK_USART2 | RCC_PERIPHCLK_USART3 | RCC_PERIPHCLK_UART4 | RCC_PERIPHCLK_UART5 | \
RCC_PERIPHCLK_LPUART1 | RCC_PERIPHCLK_I2C1 | RCC_PERIPHCLK_I2C2 | RCC_PERIPHCLK_I2C3 | RCC_PERIPHCLK_LPTIM1 | \
RCC_PERIPHCLK_LPTIM2 | RCC_PERIPHCLK_SAI1 | RCC_PERIPHCLK_SAI2 | RCC_PERIPHCLK_SDMMC1 | \
RCC_PERIPHCLK_RNG | RCC_PERIPHCLK_ADC | RCC_PERIPHCLK_SWPMI1 | RCC_PERIPHCLK_DFSDM | RCC_PERIPHCLK_RTC ;
#else /* defined(STM32L475xx) || defined(STM32L476xx) || defined(STM32L485xx) || defined(STM32L486xx) */
PeriphClkInit->PeriphClockSelection = RCC_PERIPHCLK_USART1 | RCC_PERIPHCLK_USART2 | RCC_PERIPHCLK_USART3 | RCC_PERIPHCLK_UART4 | RCC_PERIPHCLK_UART5 | \
RCC_PERIPHCLK_LPUART1 | RCC_PERIPHCLK_I2C1 | RCC_PERIPHCLK_I2C2 | RCC_PERIPHCLK_I2C3 | RCC_PERIPHCLK_LPTIM1 | \
RCC_PERIPHCLK_LPTIM2 | RCC_PERIPHCLK_SAI1 | RCC_PERIPHCLK_SAI2 | RCC_PERIPHCLK_USB | RCC_PERIPHCLK_SDMMC1 | \
RCC_PERIPHCLK_RNG | RCC_PERIPHCLK_ADC | RCC_PERIPHCLK_SWPMI1 | RCC_PERIPHCLK_DFSDM | RCC_PERIPHCLK_RTC ;
#endif /* STM32L471xx */
/* Get the PLLSAI1 Clock configuration -----------------------------------------------*/
PeriphClkInit->PLLSAI1.PLLSAI1N = (uint32_t)((RCC->PLLSAI1CFGR & RCC_PLLSAI1CFGR_PLLSAI1N) >> POSITION_VAL(RCC_PLLSAI1CFGR_PLLSAI1N));
PeriphClkInit->PLLSAI1.PLLSAI1P = (uint32_t)(((RCC->PLLSAI1CFGR & RCC_PLLSAI1CFGR_PLLSAI1P) >> POSITION_VAL(RCC_PLLSAI1CFGR_PLLSAI1P)) << 4)+7;
PeriphClkInit->PLLSAI1.PLLSAI1R = (uint32_t)(((RCC->PLLSAI1CFGR & RCC_PLLSAI1CFGR_PLLSAI1R) >> POSITION_VAL(RCC_PLLSAI1CFGR_PLLSAI1R))+1)* 2;
PeriphClkInit->PLLSAI1.PLLSAI1Q = (uint32_t)(((RCC->PLLSAI1CFGR & RCC_PLLSAI1CFGR_PLLSAI1Q) >> POSITION_VAL(RCC_PLLSAI1CFGR_PLLSAI1Q))+1)* 2;
/* Get the PLLSAI2 Clock configuration -----------------------------------------------*/
PeriphClkInit->PLLSAI2.PLLSAI2N = (uint32_t)((RCC->PLLSAI2CFGR & RCC_PLLSAI2CFGR_PLLSAI2N) >> POSITION_VAL(RCC_PLLSAI2CFGR_PLLSAI2N));
PeriphClkInit->PLLSAI2.PLLSAI2P = (uint32_t)(((RCC->PLLSAI2CFGR & RCC_PLLSAI2CFGR_PLLSAI2P) >> POSITION_VAL(RCC_PLLSAI2CFGR_PLLSAI2P)) << 4)+7;
PeriphClkInit->PLLSAI2.PLLSAI2R = (uint32_t)(((RCC->PLLSAI2CFGR & RCC_PLLSAI2CFGR_PLLSAI2R)>> POSITION_VAL(RCC_PLLSAI2CFGR_PLLSAI2R))+1)* 2;
/* Get the USART1 clock source ---------------------------------------------*/
PeriphClkInit->Usart1ClockSelection = __HAL_RCC_GET_USART1_SOURCE();
/* Get the USART2 clock source ---------------------------------------------*/
PeriphClkInit->Usart2ClockSelection = __HAL_RCC_GET_USART2_SOURCE();
/* Get the USART3 clock source ---------------------------------------------*/
PeriphClkInit->Usart3ClockSelection = __HAL_RCC_GET_USART3_SOURCE();
/* Get the UART4 clock source ----------------------------------------------*/
PeriphClkInit->Uart4ClockSelection = __HAL_RCC_GET_UART4_SOURCE();
/* Get the UART5 clock source ----------------------------------------------*/
PeriphClkInit->Uart5ClockSelection = __HAL_RCC_GET_UART5_SOURCE();
/* Get the LPUART1 clock source --------------------------------------------*/
PeriphClkInit->Lpuart1ClockSelection = __HAL_RCC_GET_LPUART1_SOURCE();
/* Get the I2C1 clock source -----------------------------------------------*/
PeriphClkInit->I2c1ClockSelection = __HAL_RCC_GET_I2C1_SOURCE();
/* Get the I2C2 clock source ----------------------------------------------*/
PeriphClkInit->I2c2ClockSelection = __HAL_RCC_GET_I2C2_SOURCE();
/* Get the I2C3 clock source -----------------------------------------------*/
PeriphClkInit->I2c3ClockSelection = __HAL_RCC_GET_I2C3_SOURCE();
/* Get the LPTIM1 clock source ---------------------------------------------*/
PeriphClkInit->Lptim1ClockSelection = __HAL_RCC_GET_LPTIM1_SOURCE();
/* Get the LPTIM2 clock source ---------------------------------------------*/
PeriphClkInit->Lptim2ClockSelection = __HAL_RCC_GET_LPTIM2_SOURCE();
/* Get the SAI1 clock source -----------------------------------------------*/
PeriphClkInit->Sai1ClockSelection = __HAL_RCC_GET_SAI1_SOURCE();
/* Get the SAI2 clock source -----------------------------------------------*/
PeriphClkInit->Sai2ClockSelection = __HAL_RCC_GET_SAI2_SOURCE();
/* Get the RTC clock source ------------------------------------------------*/
PeriphClkInit->RTCClockSelection = __HAL_RCC_GET_RTC_SOURCE();
#if defined(STM32L475xx) || defined(STM32L476xx) || defined(STM32L485xx) || defined(STM32L486xx)
/* Get the USB clock source ------------------------------------------------*/
PeriphClkInit->UsbClockSelection = __HAL_RCC_GET_USB_SOURCE();
#endif /* STM32L475xx || STM32L476xx || STM32L485xx || STM32L486xx */
/* Get the SDMMC1 clock source ---------------------------------------------*/
PeriphClkInit->Sdmmc1ClockSelection = __HAL_RCC_GET_SDMMC1_SOURCE();
/* Get the RNG clock source ------------------------------------------------*/
PeriphClkInit->RngClockSelection = __HAL_RCC_GET_RNG_SOURCE();
/* Get the ADC clock source -----------------------------------------------*/
PeriphClkInit->AdcClockSelection = __HAL_RCC_GET_ADC_SOURCE();
/* Get the SWPMI1 clock source ----------------------------------------------*/
PeriphClkInit->Swpmi1ClockSelection = __HAL_RCC_GET_SWPMI1_SOURCE();
/* Get the DFSDM clock source -------------------------------------------*/
PeriphClkInit->DfsdmClockSelection = __HAL_RCC_GET_DFSDM_SOURCE();
}
/**
* @brief Return the peripheral clock frequency for peripherals with clock source from PLLSAIs
* @note Return 0 if peripheral clock identifier not managed by this API
* @param PeriphClk Peripheral clock identifier
* This parameter can be one of the following values:
* @arg @ref RCC_PERIPHCLK_RTC RTC peripheral clock
* @arg @ref RCC_PERIPHCLK_ADC ADC peripheral clock
* @arg @ref RCC_PERIPHCLK_DFSDM DFSDM peripheral clock
* @arg @ref RCC_PERIPHCLK_I2C1 I2C1 peripheral clock
* @arg @ref RCC_PERIPHCLK_I2C2 I2C2 peripheral clock
* @arg @ref RCC_PERIPHCLK_I2C3 I2C3 peripheral clock
* @arg @ref RCC_PERIPHCLK_LPTIM1 LPTIM1 peripheral clock
* @arg @ref RCC_PERIPHCLK_LPTIM2 LPTIM2 peripheral clock
* @arg @ref RCC_PERIPHCLK_LPUART1 LPUART1 peripheral clock
* @arg @ref RCC_PERIPHCLK_RNG RNG peripheral clock
* @arg @ref RCC_PERIPHCLK_SAI1 SAI1 peripheral clock
* @arg @ref RCC_PERIPHCLK_SAI2 SAI2 peripheral clock
* @arg @ref RCC_PERIPHCLK_SDMMC1 SDMMC1 peripheral clock
* @arg @ref RCC_PERIPHCLK_SWPMI1 SWPMI1 peripheral clock
* @arg @ref RCC_PERIPHCLK_USART1 USART1 peripheral clock
* @arg @ref RCC_PERIPHCLK_USART2 USART1 peripheral clock
* @arg @ref RCC_PERIPHCLK_USART3 USART1 peripheral clock
* @arg @ref RCC_PERIPHCLK_UART4 USART1 peripheral clock
* @arg @ref RCC_PERIPHCLK_UART5 USART1 peripheral clock
* @arg @ref RCC_PERIPHCLK_USB USB peripheral clock (only for devices with USB)
* @retval Frequency in Hz
*/
uint32_t HAL_RCCEx_GetPeriphCLKFreq(uint32_t PeriphClk)
{
uint32_t frequency = 0;
uint32_t srcclk = 0;
uint32_t pllvco = 0, plln = 0, pllp = 0;
/* Check the parameters */
assert_param(IS_RCC_PERIPHCLOCK(PeriphClk));
if(PeriphClk == RCC_PERIPHCLK_RTC)
{
/* Get the current RTC source */
srcclk = __HAL_RCC_GET_RTC_SOURCE();
/* Check if LSE is ready and if RTC clock selection is LSE */
if ((srcclk == RCC_RTCCLKSOURCE_LSE) && (HAL_IS_BIT_SET(RCC->BDCR, RCC_BDCR_LSERDY)))
{
frequency = LSE_VALUE;
}
/* Check if LSI is ready and if RTC clock selection is LSI */
else if ((srcclk == RCC_RTCCLKSOURCE_LSI) && (HAL_IS_BIT_SET(RCC->CSR, RCC_CSR_LSIRDY)))
{
frequency = LSI_VALUE;
}
/* Check if HSE is ready and if RTC clock selection is HSI_DIV32*/
else if ((srcclk == RCC_RTCCLKSOURCE_HSE_DIV32) && (HAL_IS_BIT_SET(RCC->CR, RCC_CR_HSERDY)))
{
frequency = HSE_VALUE / 32;
}
/* Clock not enabled for RTC*/
else
{
frequency = 0;
}
}
else
{
/* Other external peripheral clock source than RTC */
/* Compute PLL clock input */
if(__HAL_RCC_GET_PLL_OSCSOURCE() == RCC_PLLSOURCE_MSI) /* MSI ? */
{
pllvco = (1 << ((__HAL_RCC_GET_MSI_RANGE() >> 4) - 4)) * 1000000;
}
else if(__HAL_RCC_GET_PLL_OSCSOURCE() == RCC_PLLSOURCE_HSI) /* HSI ? */
{
pllvco = HSI_VALUE;
}
else if(__HAL_RCC_GET_PLL_OSCSOURCE() == RCC_PLLSOURCE_HSE) /* HSE ? */
{
pllvco = HSE_VALUE;
}
else /* No source */
{
pllvco = 0;
}
/* f(PLL Source) / PLLM */
pllvco = (pllvco / ((READ_BIT(RCC->PLLCFGR, RCC_PLLCFGR_PLLM) >> 4) + 1));
switch(PeriphClk)
{
case RCC_PERIPHCLK_SAI1:
case RCC_PERIPHCLK_SAI2:
if(PeriphClk == RCC_PERIPHCLK_SAI1)
{
srcclk = READ_BIT(RCC->CCIPR, RCC_CCIPR_SAI1SEL);
if(srcclk == RCC_SAI1CLKSOURCE_PIN)
{
frequency = EXTERNAL_SAI1_CLOCK_VALUE;
}
/* Else, PLL clock output to check below */
}
else /* RCC_PERIPHCLK_SAI2 */
{
srcclk = READ_BIT(RCC->CCIPR, RCC_CCIPR_SAI2SEL);
if(srcclk == RCC_SAI2CLKSOURCE_PIN)
{
frequency = EXTERNAL_SAI2_CLOCK_VALUE;
}
/* Else, PLL clock output to check below */
}
if(frequency == 0)
{
if((srcclk == RCC_SAI1CLKSOURCE_PLL) || (srcclk == RCC_SAI2CLKSOURCE_PLL))
{
if(__HAL_RCC_GET_PLLCLKOUT_CONFIG(RCC_PLL_SAI3CLK) != RESET)
{
/* f(PLLSAI3CLK) = f(VCO input) * PLLN / PLLP */
plln = READ_BIT(RCC->PLLCFGR, RCC_PLLCFGR_PLLN) >> 8;
if(READ_BIT(RCC->PLLCFGR, RCC_PLLCFGR_PLLP) != RESET)
{
pllp = 17;
}
else
{
pllp = 7;
}
frequency = (pllvco * plln) / pllp;
}
}
else if(srcclk == 0) /* RCC_SAI1CLKSOURCE_PLLSAI1 || RCC_SAI2CLKSOURCE_PLLSAI1 */
{
if(__HAL_RCC_GET_PLLSAI1CLKOUT_CONFIG(RCC_PLLSAI1_SAI1CLK) != RESET)
{
/* f(PLLSAI1CLK) = f(VCOSAI1 input) * PLLSAI1N / PLLSAI1P */
plln = READ_BIT(RCC->PLLSAI1CFGR, RCC_PLLSAI1CFGR_PLLSAI1N) >> 8;
if(READ_BIT(RCC->PLLSAI1CFGR, RCC_PLLSAI1CFGR_PLLSAI1P) != RESET)
{
pllp = 17;
}
else
{
pllp = 7;
}
frequency = (pllvco * plln) / pllp;
}
}
else if((srcclk == RCC_SAI1CLKSOURCE_PLLSAI2) || (srcclk == RCC_SAI2CLKSOURCE_PLLSAI2))
{
if(__HAL_RCC_GET_PLLSAI2CLKOUT_CONFIG(RCC_PLLSAI2_SAI2CLK) != RESET)
{
/* f(PLLSAI2CLK) = f(VCOSAI2 input) * PLLSAI2N / PLLSAI2P */
plln = READ_BIT(RCC->PLLSAI2CFGR, RCC_PLLSAI2CFGR_PLLSAI2N) >> 8;
if(READ_BIT(RCC->PLLSAI2CFGR, RCC_PLLSAI2CFGR_PLLSAI2P) != RESET)
{
pllp = 17;
}
else
{
pllp = 7;
}
frequency = (pllvco * plln) / pllp;
}
}
else
{
/* No clock source */
frequency = 0;
}
}
break;
#if defined(STM32L475xx) || defined(STM32L476xx) || defined(STM32L485xx) || defined(STM32L486xx)
case RCC_PERIPHCLK_USB:
#endif /* STM32L475xx || STM32L476xx || STM32L485xx || STM32L486xx */
case RCC_PERIPHCLK_RNG:
case RCC_PERIPHCLK_SDMMC1:
srcclk = READ_BIT(RCC->CCIPR, RCC_CCIPR_CLK48SEL);
if(srcclk == RCC_CCIPR_CLK48SEL) /* MSI ? */
{
frequency = (1 << ((__HAL_RCC_GET_MSI_RANGE() >> 4) - 4)) * 1000000;
}
else if(srcclk == RCC_CCIPR_CLK48SEL_1) /* PLL ? */
{
/* f(PLL48M1CLK) = f(VCO input) * PLLN / PLLQ */
plln = READ_BIT(RCC->PLLCFGR, RCC_PLLCFGR_PLLN) >> 8;
frequency = (pllvco * plln) / (((READ_BIT(RCC->PLLCFGR, RCC_PLLCFGR_PLLQ) >> 21) + 1) << 1);
}
else if(srcclk == RCC_CCIPR_CLK48SEL_0) /* PLLSAI1 ? */
{
/* f(PLL48M2CLK) = f(VCOSAI1 input) * PLLSAI1N / PLLSAI1Q */
plln = READ_BIT(RCC->PLLSAI1CFGR, RCC_PLLSAI1CFGR_PLLSAI1N) >> 8;
frequency = (pllvco * plln) / (((READ_BIT(RCC->PLLSAI1CFGR, RCC_PLLSAI1CFGR_PLLSAI1Q) >> 21) + 1) << 1);
}
else /* No clock source */
{
frequency = 0;
}
break;
case RCC_PERIPHCLK_USART1:
/* Get the current USART1 source */
srcclk = __HAL_RCC_GET_USART1_SOURCE();
if(srcclk == RCC_USART1CLKSOURCE_PCLK2)
{
frequency = HAL_RCC_GetPCLK2Freq();
}
else if(srcclk == RCC_USART1CLKSOURCE_SYSCLK)
{
frequency = HAL_RCC_GetSysClockFreq();
}
else if((srcclk == RCC_USART1CLKSOURCE_HSI) && (HAL_IS_BIT_SET(RCC->CR, RCC_CR_HSIRDY)))
{
frequency = HSI_VALUE;
}
else if((srcclk == RCC_USART1CLKSOURCE_LSE) && (HAL_IS_BIT_SET(RCC->BDCR, RCC_BDCR_LSERDY)))
{
frequency = LSE_VALUE;
}
/* Clock not enabled for USART1 */
else
{
frequency = 0;
}
break;
case RCC_PERIPHCLK_USART2:
/* Get the current USART2 source */
srcclk = __HAL_RCC_GET_USART2_SOURCE();
if(srcclk == RCC_USART2CLKSOURCE_PCLK1)
{
frequency = HAL_RCC_GetPCLK1Freq();
}
else if(srcclk == RCC_USART2CLKSOURCE_SYSCLK)
{
frequency = HAL_RCC_GetSysClockFreq();
}
else if((srcclk == RCC_USART2CLKSOURCE_HSI) && (HAL_IS_BIT_SET(RCC->CR, RCC_CR_HSIRDY)))
{
frequency = HSI_VALUE;
}
else if((srcclk == RCC_USART2CLKSOURCE_LSE) && (HAL_IS_BIT_SET(RCC->BDCR, RCC_BDCR_LSERDY)))
{
frequency = LSE_VALUE;
}
/* Clock not enabled for USART2 */
else
{
frequency = 0;
}
break;
case RCC_PERIPHCLK_USART3:
/* Get the current USART3 source */
srcclk = __HAL_RCC_GET_USART3_SOURCE();
if(srcclk == RCC_USART3CLKSOURCE_PCLK1)
{
frequency = HAL_RCC_GetPCLK1Freq();
}
else if(srcclk == RCC_USART3CLKSOURCE_SYSCLK)
{
frequency = HAL_RCC_GetSysClockFreq();
}
else if((srcclk == RCC_USART3CLKSOURCE_HSI) && (HAL_IS_BIT_SET(RCC->CR, RCC_CR_HSIRDY)))
{
frequency = HSI_VALUE;
}
else if((srcclk == RCC_USART3CLKSOURCE_LSE) && (HAL_IS_BIT_SET(RCC->BDCR, RCC_BDCR_LSERDY)))
{
frequency = LSE_VALUE;
}
/* Clock not enabled for USART3 */
else
{
frequency = 0;
}
break;
case RCC_PERIPHCLK_UART4:
/* Get the current UART4 source */
srcclk = __HAL_RCC_GET_UART4_SOURCE();
if(srcclk == RCC_UART4CLKSOURCE_PCLK1)
{
frequency = HAL_RCC_GetPCLK1Freq();
}
else if(srcclk == RCC_UART4CLKSOURCE_SYSCLK)
{
frequency = HAL_RCC_GetSysClockFreq();
}
else if((srcclk == RCC_UART4CLKSOURCE_HSI) && (HAL_IS_BIT_SET(RCC->CR, RCC_CR_HSIRDY)))
{
frequency = HSI_VALUE;
}
else if((srcclk == RCC_UART4CLKSOURCE_LSE) && (HAL_IS_BIT_SET(RCC->BDCR, RCC_BDCR_LSERDY)))
{
frequency = LSE_VALUE;
}
/* Clock not enabled for UART4 */
else
{
frequency = 0;
}
break;
case RCC_PERIPHCLK_UART5:
/* Get the current UART5 source */
srcclk = __HAL_RCC_GET_UART5_SOURCE();
if(srcclk == RCC_UART5CLKSOURCE_PCLK1)
{
frequency = HAL_RCC_GetPCLK1Freq();
}
else if(srcclk == RCC_UART5CLKSOURCE_SYSCLK)
{
frequency = HAL_RCC_GetSysClockFreq();
}
else if((srcclk == RCC_UART5CLKSOURCE_HSI) && (HAL_IS_BIT_SET(RCC->CR, RCC_CR_HSIRDY)))
{
frequency = HSI_VALUE;
}
else if((srcclk == RCC_UART5CLKSOURCE_LSE) && (HAL_IS_BIT_SET(RCC->BDCR, RCC_BDCR_LSERDY)))
{
frequency = LSE_VALUE;
}
/* Clock not enabled for UART5 */
else
{
frequency = 0;
}
break;
case RCC_PERIPHCLK_LPUART1:
/* Get the current LPUART1 source */
srcclk = __HAL_RCC_GET_LPUART1_SOURCE();
if(srcclk == RCC_LPUART1CLKSOURCE_PCLK1)
{
frequency = HAL_RCC_GetPCLK1Freq();
}
else if(srcclk == RCC_LPUART1CLKSOURCE_SYSCLK)
{
frequency = HAL_RCC_GetSysClockFreq();
}
else if((srcclk == RCC_LPUART1CLKSOURCE_HSI) && (HAL_IS_BIT_SET(RCC->CR, RCC_CR_HSIRDY)))
{
frequency = HSI_VALUE;
}
else if((srcclk == RCC_LPUART1CLKSOURCE_LSE) && (HAL_IS_BIT_SET(RCC->BDCR, RCC_BDCR_LSERDY)))
{
frequency = LSE_VALUE;
}
/* Clock not enabled for LPUART1 */
else
{
frequency = 0;
}
break;
case RCC_PERIPHCLK_ADC:
srcclk = __HAL_RCC_GET_ADC_SOURCE();
if(srcclk == RCC_ADCCLKSOURCE_SYSCLK)
{
frequency = HAL_RCC_GetSysClockFreq();
}
else if(srcclk == RCC_ADCCLKSOURCE_PLLSAI1)
{
if(__HAL_RCC_GET_PLLSAI1CLKOUT_CONFIG(RCC_PLLSAI1_ADC1CLK) != RESET)
{
/* f(PLLADC1CLK) = f(VCOSAI1 input) * PLLSAI1N / PLLSAI1R */
plln = READ_BIT(RCC->PLLSAI1CFGR, RCC_PLLSAI1CFGR_PLLSAI1N) >> 8;
frequency = (pllvco * plln) / (((READ_BIT(RCC->PLLSAI1CFGR, RCC_PLLSAI1CFGR_PLLSAI1R) >> 24) + 1) << 1);
}
}
else if(srcclk == RCC_ADCCLKSOURCE_PLLSAI2)
{
if(__HAL_RCC_GET_PLLSAI2CLKOUT_CONFIG(RCC_PLLSAI2_ADC2CLK) != RESET)
{
/* f(PLLADC2CLK) = f(VCOSAI2 input) * PLLSAI2N / PLLSAI2R */
plln = READ_BIT(RCC->PLLSAI2CFGR, RCC_PLLSAI2CFGR_PLLSAI2N) >> 8;
frequency = (pllvco * plln) / (((READ_BIT(RCC->PLLSAI2CFGR, RCC_PLLSAI2CFGR_PLLSAI2R) >> 24) + 1) << 1);
}
}
/* Clock not enabled for ADC */
else
{
frequency = 0;
}
break;
case RCC_PERIPHCLK_DFSDM:
/* Get the current DFSDM source */
srcclk = __HAL_RCC_GET_DFSDM_SOURCE();
if(srcclk == RCC_DFSDMCLKSOURCE_PCLK)
{
frequency = HAL_RCC_GetPCLK1Freq();
}
else
{
frequency = HAL_RCC_GetSysClockFreq();
}
break;
case RCC_PERIPHCLK_I2C1:
/* Get the current I2C1 source */
srcclk = __HAL_RCC_GET_I2C1_SOURCE();
if(srcclk == RCC_I2C1CLKSOURCE_PCLK1)
{
frequency = HAL_RCC_GetPCLK1Freq();
}
else if(srcclk == RCC_I2C1CLKSOURCE_SYSCLK)
{
frequency = HAL_RCC_GetSysClockFreq();
}
else if((srcclk == RCC_I2C1CLKSOURCE_HSI) && (HAL_IS_BIT_SET(RCC->CR, RCC_CR_HSIRDY)))
{
frequency = HSI_VALUE;
}
/* Clock not enabled for I2C1 */
else
{
frequency = 0;
}
break;
case RCC_PERIPHCLK_I2C2:
/* Get the current I2C2 source */
srcclk = __HAL_RCC_GET_I2C2_SOURCE();
if(srcclk == RCC_I2C2CLKSOURCE_PCLK1)
{
frequency = HAL_RCC_GetPCLK1Freq();
}
else if(srcclk == RCC_I2C2CLKSOURCE_SYSCLK)
{
frequency = HAL_RCC_GetSysClockFreq();
}
else if((srcclk == RCC_I2C2CLKSOURCE_HSI) && (HAL_IS_BIT_SET(RCC->CR, RCC_CR_HSIRDY)))
{
frequency = HSI_VALUE;
}
/* Clock not enabled for I2C2 */
else
{
frequency = 0;
}
break;
case RCC_PERIPHCLK_I2C3:
/* Get the current I2C3 source */
srcclk = __HAL_RCC_GET_I2C3_SOURCE();
if(srcclk == RCC_I2C3CLKSOURCE_PCLK1)
{
frequency = HAL_RCC_GetPCLK1Freq();
}
else if(srcclk == RCC_I2C3CLKSOURCE_SYSCLK)
{
frequency = HAL_RCC_GetSysClockFreq();
}
else if((srcclk == RCC_I2C3CLKSOURCE_HSI) && (HAL_IS_BIT_SET(RCC->CR, RCC_CR_HSIRDY)))
{
frequency = HSI_VALUE;
}
/* Clock not enabled for I2C3 */
else
{
frequency = 0;
}
break;
case RCC_PERIPHCLK_LPTIM1:
/* Get the current LPTIM1 source */
srcclk = __HAL_RCC_GET_LPTIM1_SOURCE();
if(srcclk == RCC_LPTIM1CLKSOURCE_PCLK)
{
frequency = HAL_RCC_GetPCLK1Freq();
}
else if((srcclk == RCC_LPTIM1CLKSOURCE_LSI) && (HAL_IS_BIT_SET(RCC->CSR, RCC_CSR_LSIRDY)))
{
frequency = LSI_VALUE;
}
else if((srcclk == RCC_LPTIM1CLKSOURCE_HSI) && (HAL_IS_BIT_SET(RCC->CR, RCC_CR_HSIRDY)))
{
frequency = HSI_VALUE;
}
else if ((srcclk == RCC_LPTIM1CLKSOURCE_LSE) && (HAL_IS_BIT_SET(RCC->BDCR, RCC_BDCR_LSERDY)))
{
frequency = LSE_VALUE;
}
/* Clock not enabled for LPTIM1 */
else
{
frequency = 0;
}
break;
case RCC_PERIPHCLK_LPTIM2:
/* Get the current LPTIM2 source */
srcclk = __HAL_RCC_GET_LPTIM2_SOURCE();
if(srcclk == RCC_LPTIM2CLKSOURCE_PCLK)
{
frequency = HAL_RCC_GetPCLK1Freq();
}
else if((srcclk == RCC_LPTIM2CLKSOURCE_LSI) && (HAL_IS_BIT_SET(RCC->CSR, RCC_CSR_LSIRDY)))
{
frequency = LSI_VALUE;
}
else if((srcclk == RCC_LPTIM2CLKSOURCE_HSI) && (HAL_IS_BIT_SET(RCC->CR, RCC_CR_HSIRDY)))
{
frequency = HSI_VALUE;
}
else if ((srcclk == RCC_LPTIM2CLKSOURCE_LSE) && (HAL_IS_BIT_SET(RCC->BDCR, RCC_BDCR_LSERDY)))
{
frequency = LSE_VALUE;
}
/* Clock not enabled for LPTIM2 */
else
{
frequency = 0;
}
break;
case RCC_PERIPHCLK_SWPMI1:
/* Get the current SWPMI1 source */
srcclk = __HAL_RCC_GET_SWPMI1_SOURCE();
if(srcclk == RCC_SWPMI1CLKSOURCE_PCLK)
{
frequency = HAL_RCC_GetPCLK1Freq();
}
else if((srcclk == RCC_SWPMI1CLKSOURCE_HSI) && (HAL_IS_BIT_SET(RCC->CR, RCC_CR_HSIRDY)))
{
frequency = HSI_VALUE;
}
/* Clock not enabled for SWPMI1 */
else
{
frequency = 0;
}
break;
default:
break;
}
}
return(frequency);
}
/**
* @}
*/
/** @defgroup RCCEx_Exported_Functions_Group2 Extended clock management functions
* @brief Extended clock management functions
*
@verbatim
===============================================================================
##### Extended clock management functions #####
===============================================================================
[..]
This subsection provides a set of functions allowing to control the
activation or deactivation of MSI PLL-mode, PLLSAI1, PLLSAI2, LSE CSS,
Low speed clock output and clock after wake-up from STOP mode.
@endverbatim
* @{
*/
/**
* @brief Enable PLLSAI1.
* @param PLLSAI1Init pointer to an RCC_PLLSAI1InitTypeDef structure that
* contains the configuration information for the PLLSAI1
* @retval HAL status
*/
HAL_StatusTypeDef HAL_RCCEx_EnablePLLSAI1(RCC_PLLSAI1InitTypeDef *PLLSAI1Init)
{
uint32_t tickstart = 0;
HAL_StatusTypeDef status = HAL_OK;
/* check for PLLSAI1 Parameters used to output PLLSAI1CLK */
assert_param(IS_RCC_PLLSAI1N_VALUE(PLLSAI1Init->PLLSAI1N));
assert_param(IS_RCC_PLLSAI1P_VALUE(PLLSAI1Init->PLLSAI1P));
assert_param(IS_RCC_PLLSAI1Q_VALUE(PLLSAI1Init->PLLSAI1Q));
assert_param(IS_RCC_PLLSAI1R_VALUE(PLLSAI1Init->PLLSAI1R));
assert_param(IS_RCC_PLLSAI1CLOCKOUT_VALUE(PLLSAI1Init->PLLSAI1ClockOut));
/* Disable the PLLSAI1 */
__HAL_RCC_PLLSAI1_DISABLE();
/* Get Start Tick*/
tickstart = HAL_GetTick();
/* Wait till PLLSAI1 is ready to be updated */
while(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLSAI1RDY) != RESET)
{
if((HAL_GetTick() - tickstart) > PLLSAI1_TIMEOUT_VALUE)
{
status = HAL_TIMEOUT;
break;
}
}
if(status == HAL_OK)
{
/* Configure the PLLSAI1 Multiplication factor N */
/* Configure the PLLSAI1 Division factors P, Q and R */
__HAL_RCC_PLLSAI1_CONFIG(PLLSAI1Init->PLLSAI1N, PLLSAI1Init->PLLSAI1P, PLLSAI1Init->PLLSAI1Q, PLLSAI1Init->PLLSAI1R);
/* Configure the PLLSAI1 Clock output(s) */
__HAL_RCC_PLLSAI1CLKOUT_ENABLE(PLLSAI1Init->PLLSAI1ClockOut);
/* Enable the PLLSAI1 again by setting PLLSAI1ON to 1*/
__HAL_RCC_PLLSAI1_ENABLE();
/* Get Start Tick*/
tickstart = HAL_GetTick();
/* Wait till PLLSAI1 is ready */
while(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLSAI1RDY) == RESET)
{
if((HAL_GetTick() - tickstart) > PLLSAI1_TIMEOUT_VALUE)
{
status = HAL_TIMEOUT;
break;
}
}
}
return status;
}
/**
* @brief Disable PLLSAI1.
* @retval HAL status
*/
HAL_StatusTypeDef HAL_RCCEx_DisablePLLSAI1(void)
{
uint32_t tickstart = 0;
HAL_StatusTypeDef status = HAL_OK;
/* Disable the PLLSAI1 */
__HAL_RCC_PLLSAI1_DISABLE();
/* Get Start Tick*/
tickstart = HAL_GetTick();
/* Wait till PLLSAI1 is ready */
while(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLSAI1RDY) != RESET)
{
if((HAL_GetTick() - tickstart) > PLLSAI1_TIMEOUT_VALUE)
{
status = HAL_TIMEOUT;
break;
}
}
/* Disable the PLLSAI1 Clock outputs */
__HAL_RCC_PLLSAI1CLKOUT_DISABLE(RCC_PLLSAI1_SAI1CLK|RCC_PLLSAI1_48M2CLK|RCC_PLLSAI1_ADC1CLK);
return status;
}
/**
* @brief Enable PLLSAI2.
* @param PLLSAI2Init pointer to an RCC_PLLSAI2InitTypeDef structure that
* contains the configuration information for the PLLSAI2
* @retval HAL status
*/
HAL_StatusTypeDef HAL_RCCEx_EnablePLLSAI2(RCC_PLLSAI2InitTypeDef *PLLSAI2Init)
{
uint32_t tickstart = 0;
HAL_StatusTypeDef status = HAL_OK;
/* check for PLLSAI2 Parameters used to output PLLSAI2CLK */
assert_param(IS_RCC_PLLSAI2N_VALUE(PLLSAI2Init->PLLSAI2N));
assert_param(IS_RCC_PLLSAI2P_VALUE(PLLSAI2Init->PLLSAI2P));
assert_param(IS_RCC_PLLSAI2R_VALUE(PLLSAI2Init->PLLSAI2R));
assert_param(IS_RCC_PLLSAI2CLOCKOUT_VALUE(PLLSAI2Init->PLLSAI2ClockOut));
/* Disable the PLLSAI2 */
__HAL_RCC_PLLSAI2_DISABLE();
/* Get Start Tick*/
tickstart = HAL_GetTick();
/* Wait till PLLSAI2 is ready to be updated */
while(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLSAI2RDY) != RESET)
{
if((HAL_GetTick() - tickstart) > PLLSAI2_TIMEOUT_VALUE)
{
status = HAL_TIMEOUT;
break;
}
}
if(status == HAL_OK)
{
/* Configure the PLLSAI2 Multiplication factor N */
/* Configure the PLLSAI2 Division factors P and R */
__HAL_RCC_PLLSAI2_CONFIG(PLLSAI2Init->PLLSAI2N, PLLSAI2Init->PLLSAI2P, PLLSAI2Init->PLLSAI2R);
/* Configure the PLLSAI2 Clock output(s) */
__HAL_RCC_PLLSAI2CLKOUT_ENABLE(PLLSAI2Init->PLLSAI2ClockOut);
/* Enable the PLLSAI2 again by setting PLLSAI2ON to 1*/
__HAL_RCC_PLLSAI2_ENABLE();
/* Get Start Tick*/
tickstart = HAL_GetTick();
/* Wait till PLLSAI2 is ready */
while(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLSAI2RDY) == RESET)
{
if((HAL_GetTick() - tickstart) > PLLSAI2_TIMEOUT_VALUE)
{
status = HAL_TIMEOUT;
break;
}
}
}
return status;
}
/**
* @brief Disable PLLISAI2.
* @retval HAL status
*/
HAL_StatusTypeDef HAL_RCCEx_DisablePLLSAI2(void)
{
uint32_t tickstart = 0;
HAL_StatusTypeDef status = HAL_OK;
/* Disable the PLLSAI2 */
__HAL_RCC_PLLSAI2_DISABLE();
/* Get Start Tick*/
tickstart = HAL_GetTick();
/* Wait till PLLSAI2 is ready */
while(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLSAI2RDY) != RESET)
{
if((HAL_GetTick() - tickstart) > PLLSAI2_TIMEOUT_VALUE)
{
status = HAL_TIMEOUT;
break;
}
}
/* Disable the PLLSAI2 Clock outputs */
__HAL_RCC_PLLSAI2CLKOUT_DISABLE(RCC_PLLSAI2_SAI2CLK|RCC_PLLSAI2_ADC2CLK);
return status;
}
/**
* @brief Configure the oscillator clock source for wakeup from Stop and CSS backup clock.
* @param WakeUpClk Wakeup clock
* This parameter can be one of the following values:
* @arg @ref RCC_STOP_WAKEUPCLOCK_MSI MSI oscillator selection
* @arg @ref RCC_STOP_WAKEUPCLOCK_HSI HSI oscillator selection
* @note This function shall not be called after the Clock Security System on HSE has been
* enabled.
* @retval None
*/
void HAL_RCCEx_WakeUpStopCLKConfig(uint32_t WakeUpClk)
{
assert_param(IS_RCC_STOP_WAKEUPCLOCK(WakeUpClk));
__HAL_RCC_WAKEUPSTOP_CLK_CONFIG(WakeUpClk);
}
/**
* @brief Configure the MSI range after standby mode.
* @note After Standby its frequency can be selected between 4 possible values (1, 2, 4 or 8 MHz).
* @param MSIRange MSI range
* This parameter can be one of the following values:
* @arg @ref RCC_MSIRANGE_4 Range 4 around 1 MHz
* @arg @ref RCC_MSIRANGE_5 Range 5 around 2 MHz
* @arg @ref RCC_MSIRANGE_6 Range 6 around 4 MHz (reset value)
* @arg @ref RCC_MSIRANGE_7 Range 7 around 8 MHz
* @retval None
*/
void HAL_RCCEx_StandbyMSIRangeConfig(uint32_t MSIRange)
{
assert_param(IS_RCC_MSI_STANDBY_CLOCK_RANGE(MSIRange));
__HAL_RCC_MSI_STANDBY_RANGE_CONFIG(MSIRange);
}
/**
* @brief Enable the LSE Clock Security System.
* @note Prior to enable the LSE Clock Security System, LSE oscillator is to be enabled
* with HAL_RCC_OscConfig() and the LSE oscillator clock is to be selected as RTC
* clock with HAL_RCCEx_PeriphCLKConfig().
* @retval None
*/
void HAL_RCCEx_EnableLSECSS(void)
{
SET_BIT(RCC->BDCR, RCC_BDCR_LSECSSON) ;
}
/**
* @brief Disable the LSE Clock Security System.
* @note LSE Clock Security System can only be disabled after a LSE failure detection.
* @retval None
*/
void HAL_RCCEx_DisableLSECSS(void)
{
CLEAR_BIT(RCC->BDCR, RCC_BDCR_LSECSSON) ;
/* Disable LSE CSS IT if any */
__HAL_RCC_DISABLE_IT(RCC_IT_LSECSS);
}
/**
* @brief Enable the LSE Clock Security System Interrupt & corresponding EXTI line.
* @note LSE Clock Security System Interrupt is mapped on RTC EXTI line 19
* @retval None
*/
void HAL_RCCEx_EnableLSECSS_IT(void)
{
/* Enable LSE CSS */
SET_BIT(RCC->BDCR, RCC_BDCR_LSECSSON) ;
/* Enable LSE CSS IT */
__HAL_RCC_ENABLE_IT(RCC_IT_LSECSS);
/* Enable IT on EXTI Line 19 */
__HAL_RCC_LSECSS_EXTI_ENABLE_IT();
__HAL_RCC_LSECSS_EXTI_ENABLE_RISING_EDGE();
}
/**
* @brief Handle the RCC LSE Clock Security System interrupt request.
* @retval None
*/
void HAL_RCCEx_LSECSS_IRQHandler(void)
{
/* Check RCC LSE CSSF flag */
if(__HAL_RCC_GET_IT(RCC_IT_LSECSS))
{
/* RCC LSE Clock Security System interrupt user callback */
HAL_RCCEx_LSECSS_Callback();
/* Clear RCC LSE CSS pending bit */
__HAL_RCC_CLEAR_IT(RCC_IT_LSECSS);
}
}
/**
* @brief RCCEx LSE Clock Security System interrupt callback.
* @retval none
*/
__weak void HAL_RCCEx_LSECSS_Callback(void)
{
/* NOTE : This function should not be modified, when the callback is needed,
the @ref HAL_RCCEx_LSECSS_Callback should be implemented in the user file
*/
}
/**
* @brief Select the Low Speed clock source to output on LSCO pin (PA2).
* @param LSCOSource specifies the Low Speed clock source to output.
* This parameter can be one of the following values:
* @arg @ref RCC_LSCOSOURCE_LSI LSI clock selected as LSCO source
* @arg @ref RCC_LSCOSOURCE_LSE LSE clock selected as LSCO source
* @retval None
*/
void HAL_RCCEx_EnableLSCO(uint32_t LSCOSource)
{
GPIO_InitTypeDef GPIO_InitStruct;
FlagStatus pwrclkchanged = RESET;
FlagStatus backupchanged = RESET;
/* Check the parameters */
assert_param(IS_RCC_LSCOSOURCE(LSCOSource));
/* LSCO Pin Clock Enable */
__LSCO_CLK_ENABLE();
/* Configue the LSCO pin in analog mode */
GPIO_InitStruct.Pin = LSCO_PIN;
GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(LSCO_GPIO_PORT, &GPIO_InitStruct);
/* Update LSCOSEL clock source in Backup Domain control register */
if(__HAL_RCC_PWR_IS_CLK_DISABLED())
{
__HAL_RCC_PWR_CLK_ENABLE();
pwrclkchanged = SET;
}
if(HAL_IS_BIT_CLR(PWR->CR1, PWR_CR1_DBP))
{
HAL_PWR_EnableBkUpAccess();
backupchanged = SET;
}
MODIFY_REG(RCC->BDCR, RCC_BDCR_LSCOSEL | RCC_BDCR_LSCOEN, LSCOSource | RCC_BDCR_LSCOEN);
if(backupchanged == SET)
{
HAL_PWR_DisableBkUpAccess();
}
if(pwrclkchanged == SET)
{
__HAL_RCC_PWR_CLK_DISABLE();
}
}
/**
* @brief Disable the Low Speed clock output.
* @retval None
*/
void HAL_RCCEx_DisableLSCO(void)
{
FlagStatus pwrclkchanged = RESET;
FlagStatus backupchanged = RESET;
/* Update LSCOEN bit in Backup Domain control register */
if(__HAL_RCC_PWR_IS_CLK_DISABLED())
{
__HAL_RCC_PWR_CLK_ENABLE();
pwrclkchanged = SET;
}
if(HAL_IS_BIT_CLR(PWR->CR1, PWR_CR1_DBP))
{
/* Enable access to the backup domain */
HAL_PWR_EnableBkUpAccess();
backupchanged = SET;
}
CLEAR_BIT(RCC->BDCR, RCC_BDCR_LSCOEN);
/* Restore previous configuration */
if(backupchanged == SET)
{
/* Disable access to the backup domain */
HAL_PWR_DisableBkUpAccess();
}
if(pwrclkchanged == SET)
{
__HAL_RCC_PWR_CLK_DISABLE();
}
}
/**
* @brief Enable the PLL-mode of the MSI.
* @note Prior to enable the PLL-mode of the MSI for automatic hardware
* calibration LSE oscillator is to be enabled with HAL_RCC_OscConfig().
* @retval None
*/
void HAL_RCCEx_EnableMSIPLLMode(void)
{
SET_BIT(RCC->CR, RCC_CR_MSIPLLEN) ;
}
/**
* @brief Disable the PLL-mode of the MSI.
* @note PLL-mode of the MSI is automatically reset when LSE oscillator is disabled.
* @retval None
*/
void HAL_RCCEx_DisableMSIPLLMode(void)
{
CLEAR_BIT(RCC->CR, RCC_CR_MSIPLLEN) ;
}
/**
* @}
*/
/**
* @}
*/
/** @addtogroup RCCEx_Private_Functions
* @{
*/
/**
* @brief Configure the parameters N & P of PLLSAI1 and enable PLLSAI1 output clock(s).
* @param PllSai1 pointer to an RCC_PLLSAI1InitTypeDef structure that
* contains the configuration parameters N & P as well as PLLSAI1 output clock(s)
*
* @note PLLSAI1 is temporary disable to apply new parameters
*
* @retval HAL status
*/
static HAL_StatusTypeDef RCCEx_PLLSAI1_ConfigNP(RCC_PLLSAI1InitTypeDef *PllSai1)
{
uint32_t tickstart = 0;
HAL_StatusTypeDef status = HAL_OK;
/* check for PLLSAI1 Parameters used to output PLLSAI1CLK */
assert_param(IS_RCC_PLLSAI1N_VALUE(PllSai1->PLLSAI1N));
assert_param(IS_RCC_PLLSAI1P_VALUE(PllSai1->PLLSAI1P));
assert_param(IS_RCC_PLLSAI1CLOCKOUT_VALUE(PllSai1->PLLSAI1ClockOut));
/* Disable the PLLSAI1 */
__HAL_RCC_PLLSAI1_DISABLE();
/* Get Start Tick*/
tickstart = HAL_GetTick();
/* Wait till PLLSAI1 is ready to be updated */
while(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLSAI1RDY) != RESET)
{
if((HAL_GetTick() - tickstart) > PLLSAI1_TIMEOUT_VALUE)
{
status = HAL_TIMEOUT;
break;
}
}
if(status == HAL_OK)
{
/* Configure the PLLSAI1 Multiplication factor N */
__HAL_RCC_PLLSAI1_MULN_CONFIG(PllSai1->PLLSAI1N);
/* Configure the PLLSAI1 Division factor P */
__HAL_RCC_PLLSAI1_DIVP_CONFIG(PllSai1->PLLSAI1P);
/* Enable the PLLSAI1 again by setting PLLSAI1ON to 1*/
__HAL_RCC_PLLSAI1_ENABLE();
/* Get Start Tick*/
tickstart = HAL_GetTick();
/* Wait till PLLSAI1 is ready */
while(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLSAI1RDY) == RESET)
{
if((HAL_GetTick() - tickstart) > PLLSAI1_TIMEOUT_VALUE)
{
status = HAL_TIMEOUT;
break;
}
}
if(status == HAL_OK)
{
/* Configure the PLLSAI1 Clock output(s) */
__HAL_RCC_PLLSAI1CLKOUT_ENABLE(PllSai1->PLLSAI1ClockOut);
}
}
return status;
}
/**
* @brief Configure the parameters N & Q of PLLSAI1 and enable PLLSAI1 output clock(s).
* @param PllSai1 pointer to an RCC_PLLSAI1InitTypeDef structure that
* contains the configuration parameters N & Q as well as PLLSAI1 output clock(s)
*
* @note PLLSAI1 is temporary disable to apply new parameters
*
* @retval HAL status
*/
static HAL_StatusTypeDef RCCEx_PLLSAI1_ConfigNQ(RCC_PLLSAI1InitTypeDef *PllSai1)
{
uint32_t tickstart = 0;
HAL_StatusTypeDef status = HAL_OK;
/* check for PLLSAI1 Parameters used to output PLLSAI1CLK */
assert_param(IS_RCC_PLLSAI1N_VALUE(PllSai1->PLLSAI1N));
assert_param(IS_RCC_PLLSAI1Q_VALUE(PllSai1->PLLSAI1Q));
assert_param(IS_RCC_PLLSAI1CLOCKOUT_VALUE(PllSai1->PLLSAI1ClockOut));
/* Disable the PLLSAI1 */
__HAL_RCC_PLLSAI1_DISABLE();
/* Get Start Tick*/
tickstart = HAL_GetTick();
/* Wait till PLLSAI1 is ready to be updated */
while(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLSAI1RDY) != RESET)
{
if((HAL_GetTick() - tickstart) > PLLSAI1_TIMEOUT_VALUE)
{
status = HAL_TIMEOUT;
break;
}
}
if(status == HAL_OK)
{
/* Configure the PLLSAI1 Multiplication factor N */
__HAL_RCC_PLLSAI1_MULN_CONFIG(PllSai1->PLLSAI1N);
/* Configure the PLLSAI1 Division factor Q */
__HAL_RCC_PLLSAI1_DIVQ_CONFIG(PllSai1->PLLSAI1Q);
/* Enable the PLLSAI1 again by setting PLLSAI1ON to 1*/
__HAL_RCC_PLLSAI1_ENABLE();
/* Get Start Tick*/
tickstart = HAL_GetTick();
/* Wait till PLLSAI1 is ready */
while(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLSAI1RDY) == RESET)
{
if((HAL_GetTick() - tickstart) > PLLSAI1_TIMEOUT_VALUE)
{
status = HAL_TIMEOUT;
break;
}
}
if(status == HAL_OK)
{
/* Configure the PLLSAI1 Clock output(s) */
__HAL_RCC_PLLSAI1CLKOUT_ENABLE(PllSai1->PLLSAI1ClockOut);
}
}
return status;
}
/**
* @brief Configure the parameters N & R of PLLSAI1 and enable PLLSAI1 output clock(s).
* @param PllSai1 pointer to an RCC_PLLSAI1InitTypeDef structure that
* contains the configuration parameters N & R as well as PLLSAI1 output clock(s)
*
* @note PLLSAI1 is temporary disable to apply new parameters
*
* @retval HAL status
*/
static HAL_StatusTypeDef RCCEx_PLLSAI1_ConfigNR(RCC_PLLSAI1InitTypeDef *PllSai1)
{
uint32_t tickstart = 0;
HAL_StatusTypeDef status = HAL_OK;
/* check for PLLSAI1 Parameters used to output PLLSAI1CLK */
assert_param(IS_RCC_PLLSAI1N_VALUE(PllSai1->PLLSAI1N));
assert_param(IS_RCC_PLLSAI1R_VALUE(PllSai1->PLLSAI1R));
assert_param(IS_RCC_PLLSAI1CLOCKOUT_VALUE(PllSai1->PLLSAI1ClockOut));
/* Disable the PLLSAI1 */
__HAL_RCC_PLLSAI1_DISABLE();
/* Get Start Tick*/
tickstart = HAL_GetTick();
/* Wait till PLLSAI1 is ready to be updated */
while(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLSAI1RDY) != RESET)
{
if((HAL_GetTick() - tickstart) > PLLSAI1_TIMEOUT_VALUE)
{
status = HAL_TIMEOUT;
break;
}
}
if(status == HAL_OK)
{
/* Configure the PLLSAI1 Multiplication factor N */
__HAL_RCC_PLLSAI1_MULN_CONFIG(PllSai1->PLLSAI1N);
/* Configure the PLLSAI1 Division factor R */
__HAL_RCC_PLLSAI1_DIVR_CONFIG(PllSai1->PLLSAI1R);
/* Enable the PLLSAI1 again by setting PLLSAI1ON to 1*/
__HAL_RCC_PLLSAI1_ENABLE();
/* Get Start Tick*/
tickstart = HAL_GetTick();
/* Wait till PLLSAI1 is ready */
while(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLSAI1RDY) == RESET)
{
if((HAL_GetTick() - tickstart) > PLLSAI1_TIMEOUT_VALUE)
{
status = HAL_TIMEOUT;
break;
}
}
if(status == HAL_OK)
{
/* Configure the PLLSAI1 Clock output(s) */
__HAL_RCC_PLLSAI1CLKOUT_ENABLE(PllSai1->PLLSAI1ClockOut);
}
}
return status;
}
/**
* @brief Configure the parameters N & P of PLLSAI2 and enable PLLSAI2 output clock(s).
* @param PllSai2 pointer to an RCC_PLLSAI2InitTypeDef structure that
* contains the configuration parameters N & P as well as PLLSAI2 output clock(s)
*
* @note PLLSAI2 is temporary disable to apply new parameters
*
* @retval HAL status
*/
static HAL_StatusTypeDef RCCEx_PLLSAI2_ConfigNP(RCC_PLLSAI2InitTypeDef *PllSai2)
{
uint32_t tickstart = 0;
HAL_StatusTypeDef status = HAL_OK;
/* check for PLLSAI2 Parameters */
assert_param(IS_RCC_PLLSAI2N_VALUE(PllSai2->PLLSAI2N));
assert_param(IS_RCC_PLLSAI2P_VALUE(PllSai2->PLLSAI2P));
assert_param(IS_RCC_PLLSAI2CLOCKOUT_VALUE(PllSai2->PLLSAI2ClockOut));
/* Disable the PLLSAI2 */
__HAL_RCC_PLLSAI2_DISABLE();
/* Get Start Tick*/
tickstart = HAL_GetTick();
/* Wait till PLLSAI2 is ready */
while(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLSAI2RDY) != RESET)
{
if((HAL_GetTick() - tickstart) > PLLSAI2_TIMEOUT_VALUE)
{
status = HAL_TIMEOUT;
break;
}
}
if(status == HAL_OK)
{
/* Configure the PLLSAI2 Multiplication factor N */
__HAL_RCC_PLLSAI2_MULN_CONFIG(PllSai2->PLLSAI2N);
/* Configure the PLLSAI2 Division factor P */
__HAL_RCC_PLLSAI2_DIVP_CONFIG(PllSai2->PLLSAI2P);
/* Enable the PLLSAI2 again by setting PLLSAI2ON to 1*/
__HAL_RCC_PLLSAI2_ENABLE();
/* Get Start Tick*/
tickstart = HAL_GetTick();
/* Wait till PLLSAI2 is ready */
while(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLSAI2RDY) == RESET)
{
if((HAL_GetTick() - tickstart) > PLLSAI2_TIMEOUT_VALUE)
{
status = HAL_TIMEOUT;
break;
}
}
if(status == HAL_OK)
{
/* Configure the PLLSAI2 Clock output(s) */
__HAL_RCC_PLLSAI2CLKOUT_ENABLE(PllSai2->PLLSAI2ClockOut);
}
}
return status;
}
/**
* @brief Configure the parameters N & R of PLLSAI2 and enable PLLSAI2 output clock(s).
* @param PllSai2 pointer to an RCC_PLLSAI2InitTypeDef structure that
* contains the configuration parameters N & R as well as PLLSAI2 output clock(s)
*
* @note PLLSAI2 is temporary disable to apply new parameters
*
* @retval HAL status
*/
static HAL_StatusTypeDef RCCEx_PLLSAI2_ConfigNR(RCC_PLLSAI2InitTypeDef *PllSai2)
{
uint32_t tickstart = 0;
HAL_StatusTypeDef status = HAL_OK;
/* check for PLLSAI2 Parameters */
assert_param(IS_RCC_PLLSAI2N_VALUE(PllSai2->PLLSAI2N));
assert_param(IS_RCC_PLLSAI2R_VALUE(PllSai2->PLLSAI2R));
assert_param(IS_RCC_PLLSAI2CLOCKOUT_VALUE(PllSai2->PLLSAI2ClockOut));
/* Disable the PLLSAI2 */
__HAL_RCC_PLLSAI2_DISABLE();
/* Get Start Tick*/
tickstart = HAL_GetTick();
/* Wait till PLLSAI2 is ready */
while(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLSAI2RDY) != RESET)
{
if((HAL_GetTick() - tickstart) > PLLSAI2_TIMEOUT_VALUE)
{
status = HAL_TIMEOUT;
break;
}
}
if(status == HAL_OK)
{
/* Configure the PLLSAI2 Multiplication factor N */
__HAL_RCC_PLLSAI2_MULN_CONFIG(PllSai2->PLLSAI2N);
/* Configure the PLLSAI2 Division factor R */
__HAL_RCC_PLLSAI2_DIVR_CONFIG(PllSai2->PLLSAI2R);
/* Enable the PLLSAI2 again by setting PLLSAI2ON to 1*/
__HAL_RCC_PLLSAI2_ENABLE();
/* Get Start Tick*/
tickstart = HAL_GetTick();
/* Wait till PLLSAI2 is ready */
while(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLSAI2RDY) == RESET)
{
if((HAL_GetTick() - tickstart) > PLLSAI2_TIMEOUT_VALUE)
{
status = HAL_TIMEOUT;
break;
}
}
if(status == HAL_OK)
{
/* Configure the PLLSAI2 Clock output(s) */
__HAL_RCC_PLLSAI2CLKOUT_ENABLE(PllSai2->PLLSAI2ClockOut);
}
}
return status;
}
/**
* @}
*/
/**
* @}
*/
#endif /* HAL_RCC_MODULE_ENABLED */
/**
* @}
*/
/**
* @}
*/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
| {
"content_hash": "b84687abec17bad5cfd11484bbad2de9",
"timestamp": "",
"source": "github",
"line_count": 1965,
"max_line_length": 156,
"avg_line_length": 32.85190839694656,
"alnum_prop": 0.5993586764569198,
"repo_name": "rebelbot/OptimizerLesson",
"id": "c7a019c95189f9c2a454d739a599dfa2dadc8cf2",
"size": "66796",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rcc_ex.c",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "330287"
},
{
"name": "C",
"bytes": "13383413"
},
{
"name": "C++",
"bytes": "427453"
},
{
"name": "HTML",
"bytes": "408183"
}
],
"symlink_target": ""
} |
FROM gadelkareem/php7-gearman
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get -y install mysql-client \
&& apt-get clean
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin
WORKDIR /var/www/application
RUN echo 'alias dtests="/var/www/application/vendor/phpunit/phpunit/phpunit -c /var/mysql.docker.xml"' >> ~/.bashrc
ADD ./config/mysql.docker.xml /var/mysql.docker.xml
ADD ./start.sh /start.sh
RUN chmod +x /start.sh
ENTRYPOINT /start.sh && /bin/bash
| {
"content_hash": "ff4e511ac9377a756922a20c475a9311",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 115,
"avg_line_length": 28.444444444444443,
"alnum_prop": 0.724609375,
"repo_name": "gadelkareem/Doctrine2-docker",
"id": "04948d34c77af08ea3da0e7e72417b9ee7e66a7c",
"size": "512",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "container/doctrine/Dockerfile",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Shell",
"bytes": "2470"
}
],
"symlink_target": ""
} |
set -e
USER=`whoami`
echo "Fetching instance metadata..."
# Parse cluster information out of user-data
USERDATA=`wget -q -O - http://169.254.169.254/latest/user-data`
echo "USERDATA: $USERDATA"
# Userdata is a json dict, so treat it as such.
CLUSTER_ID=`echo $USERDATA | python -c "import json,sys; d=json.load(sys.stdin); print d[\"cluster_ID\"]"`
CLUSTER_NAME=`echo $USERDATA | python -c "import json,sys; d=json.load(sys.stdin); print d[\"cluster_name\"]"`
NODE_TYPE=`echo $USERDATA | python -c "import json,sys; d=json.load(sys.stdin); print d[\"node_type\"]"`
AWS_ACCESS_KEY_ID=`echo $USERDATA | python -c "import json,sys; d=json.load(sys.stdin); print d[\"aws_access_key_id\"]"`
AWS_SECRET_ACCESS_KEY=`echo $USERDATA | python -c "import json,sys; d=json.load(sys.stdin); print d[\"aws_secret_access_key\"]"`
S3_BUCKET=`echo $USERDATA | python -c "import json,sys; d=json.load(sys.stdin); print d[\"s3_bucket\"]"`
DEVICES=`echo $USERDATA | python -c "import json,sys; d=json.load(sys.stdin); print d[\"devices\"]"`
# Get other instance metadata
AVAILABILITY_ZONE=`wget -q -O - http://169.254.169.254/latest/meta-data/placement/availability-zone`
REGION=`echo $AVAILABILITY_ZONE | sed 's/\([0-9]\)[a-z]/\1/'`
INSTANCE_ID=`wget -q -O - http://169.254.169.254/latest/meta-data/instance-id`
INTERNAL_DNS=`wget -q -O - http://169.254.169.254/latest/meta-data/local-hostname`
EXTERNAL_DNS=`wget -q -O - http://169.254.169.254/latest/meta-data/public-hostname`
INTERNAL_IP=`wget -q -O - http://169.254.169.254/latest/meta-data/local-ipv4`
EXTERNAL_IP=`wget -q -O - http://169.254.169.254/latest/meta-data/public-ipv4`
INSTANCE_TYPE=`wget -q -O - http://169.254.169.254/latest/meta-data/instance-type`
echo "Configuring AWS CLI..."
# Set up AWS CLI config
AWS_CONFIG=~/.aws/config
if [ -f $AWS_CONFIG ]
then
rm $AWS_CONFIG
fi
mkdir -p ~/.aws
echo "[default]" >> $AWS_CONFIG
echo "aws_access_key_id = $AWS_ACCESS_KEY_ID" >> $AWS_CONFIG
echo "aws_secret_access_key = $AWS_SECRET_ACCESS_KEY" >> $AWS_CONFIG
echo "region = $REGION" >> $AWS_CONFIG
echo "[profile themis]" >> $AWS_CONFIG
echo "aws_access_key_id = $AWS_ACCESS_KEY_ID" >> $AWS_CONFIG
echo "aws_secret_access_key = $AWS_SECRET_ACCESS_KEY" >> $AWS_CONFIG
echo "region = $REGION" >> $AWS_CONFIG
sudo chown $USER:$USER $AWS_CONFIG
chmod 600 $AWS_CONFIG
# Set up tags
aws ec2 create-tags --resources $INSTANCE_ID --tags Key=CLUSTER_ID,Value="${CLUSTER_ID}" Key=CLUSTER_NAME,Value="${CLUSTER_NAME}" Key=NODE_TYPE,Value="${NODE_TYPE}" Key=STATUS,Value=Booting
echo "Fetching configuration information from S3..."
# Fetch the remaining configuration information from S3.
aws s3api get-object --bucket "$S3_BUCKET" --key "cluster_${CLUSTER_ID}/cluster.conf" ~/cluster.conf
aws s3api get-object --bucket "$S3_BUCKET" --key "cluster_${CLUSTER_ID}/amazon.conf" ~/amazon.conf
CONFIG_DIRECTORY=`grep config_directory ~/cluster.conf | awk -F= '{print $2}' | tr -d " "`
CONFIG_DIRECTORY=`python -c "import os; print os.path.expanduser(\"$CONFIG_DIRECTORY\")"`
THEMIS_DIRECTORY=`grep themis_directory ~/cluster.conf | awk -F= '{print $2}' | tr -d " "`
THEMIS_DIRECTORY=`python -c "import os; print os.path.expanduser(\"$THEMIS_DIRECTORY\")"`
# sync is **really** dumb and sets its exit status to the number of files synced instead of 0
set +e
aws s3 sync s3://${S3_BUCKET}/cluster_${CLUSTER_ID}/themis_config/ $CONFIG_DIRECTORY
set -e
# Build node config
NODE_CONF=~/node.conf
echo "[node]" > $NODE_CONF
echo "node_type = ${NODE_TYPE}" >> $NODE_CONF
echo "internal_ip = ${INTERNAL_IP}" >> $NODE_CONF
echo "external_ip = ${EXTERNAL_IP}" >> $NODE_CONF
echo "internal_dns = ${INTERNAL_DNS}" >> $NODE_CONF
echo "external_dns = ${EXTERNAL_DNS}" >> $NODE_CONF
echo "devices = ${DEVICES}" >> $NODE_CONF
echo "" >> $NODE_CONF
echo "[amazon]" >> $NODE_CONF
echo "instance_id = ${INSTANCE_ID}" >> $NODE_CONF
# Use ls/for semantics to get all keys because the sync command appears to be asynchronous....
KEYS_LS=`aws s3api list-objects --bucket "${S3_BUCKET}" --prefix "cluster_${CLUSTER_ID}/keys/"`
echo $KEYS_LS
KEYS=`echo $KEYS_LS | python -c "import json,sys; d=json.load(sys.stdin); contents = d[\"Contents\"]; print \",\".join([x[\"Key\"] for x in contents])"`
echo $KEYS
mkdir -p ~/keys
while IFS="," read -ra KEY_LIST
do
for KEY in "${KEY_LIST[@]}"
do
echo $KEY
BASE=`basename "$KEY"`
echo $BASE
aws s3api get-object --bucket "${S3_BUCKET}" --key "$KEY" ~/keys/${BASE}
done
done <<< "$KEYS"
for key in ~/keys/*
do
chmod 600 $key
mv "$key" ~/.ssh/
done
rmdir ~/keys
eval `ssh-agent -s`
sleep 2
ssh-add
PUBLIC_KEY=`grep public_key ~/cluster.conf | awk -F= '{print $2}' | tr -d " "`
cat ~/.ssh/${PUBLIC_KEY} >> ~/.ssh/authorized_keys
echo "Configuring local environment"
# Start netserver if not already running
NETSERVER_RUNNING=`ps aux | grep netserver | grep -v grep | wc -l`
if [[ "$NETSERVER_RUNNING" == "0" ]]
then
echo "Starting netserver..."
/usr/local/bin/netserver netserver
fi
# Raise max socket backlog to 1024
sudo bash -c "echo 1024 > /proc/sys/net/core/somaxconn"
sudo bash -c "echo 1024 > /proc/sys/net/ipv4/tcp_max_syn_backlog"
# Set hostname manually
sudo hostname $INTERNAL_DNS
# Download and build themis
echo "Buliding themis from HEAD..."
if [ ! -d $THEMIS_DIRECTORY ]
then
echo "Cloning repo..."
cd ~
git clone ${GITHUB_URL} $THEMIS_DIRECTORY
cd ${THEMIS_DIRECTORY}/src
cmake -D CMAKE_BUILD_TYPE:str=Release .
make clean
make -j`nproc`
fi
# Start redis if master node
if [[ "$NODE_TYPE" == "master" ]]
then
# Start redis
sudo /usr/local/bin/redis-server --daemonize yes
# Set master hostname on this node only.
$THEMIS_DIRECTORY/src/scripts/themis/cloud/set_master_hostname.py
# Start cluster monitor
tmux new-session -d -s cluster_monitor "tmux new-window '${THEMIS_DIRECTORY}/src/scripts/themis/cluster/cluster_monitor.py'"
fi
# Make log directory
LOG_DIRECTORY=`grep log_directory ~/cluster.conf | awk -F= '{print $2}' | tr -d " "`
eval mkdir -p $LOG_DIRECTORY
# Mount the disks but don't format, but don't throw an error if we can't
# mount them (for example if the disks aren't yet formatted)
set +e
$THEMIS_DIRECTORY/src/scripts/themis/cluster/mount_disks.py
set -e
# Update tags for this instance, which signals we are ready
aws ec2 create-tags --resources $INSTANCE_ID --tags Key=STATUS,Value=Online
| {
"content_hash": "1b6de1fabcbb6c03e036947a9ac9e9ca",
"timestamp": "",
"source": "github",
"line_count": 166,
"max_line_length": 189,
"avg_line_length": 38.602409638554214,
"alnum_prop": 0.6844569288389513,
"repo_name": "mconley99/themis_tritonsort",
"id": "5fd1511cf7eb0c6ab2588bf36df8c7f488639425",
"size": "6421",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/scripts/themis/cloud/amazon/image/on_startup.sh",
"mode": "33261",
"license": "bsd-3-clause",
"language": [
{
"name": "Awk",
"bytes": "84"
},
{
"name": "C",
"bytes": "186435"
},
{
"name": "C++",
"bytes": "1759436"
},
{
"name": "CMake",
"bytes": "19466"
},
{
"name": "HTML",
"bytes": "1125"
},
{
"name": "JavaScript",
"bytes": "33834"
},
{
"name": "Makefile",
"bytes": "1036"
},
{
"name": "Python",
"bytes": "504453"
},
{
"name": "Ruby",
"bytes": "3031"
},
{
"name": "Shell",
"bytes": "39208"
}
],
"symlink_target": ""
} |
In the [v0.10.6](https://github.com/dotnet/BenchmarkDotNet/issues?q=milestone:v0.10.6) scope,
3 issues were resolved and 1 pull requests where merged.
This release includes 11 commits by 3 contributors.
## Resolved issues (3)
* [#438](https://github.com/dotnet/BenchmarkDotNet/issues/438) Need to Update Autogenerated csproj file (assignee: [@adamsitnik](https://github.com/adamsitnik))
* [#439](https://github.com/dotnet/BenchmarkDotNet/issues/439) Question - This benchmark apparently allocates, but why? (assignee: [@adamsitnik](https://github.com/adamsitnik))
* [#446](https://github.com/dotnet/BenchmarkDotNet/issues/446) ArgumentNullException if RPlotExporter is used (assignee: [@AndreyAkinshin](https://github.com/AndreyAkinshin))
## Merged pull requests (1)
* [#444](https://github.com/dotnet/BenchmarkDotNet/pull/444) Added line separator at the end in JsonExporters (by [@alinasmirnova](https://github.com/alinasmirnova))
## Commits (11)
* [3c1f09](https://github.com/dotnet/BenchmarkDotNet/commit/3c1f099aa6c1d90bb063309cea04a173266ac8b8) copy the PackageTargetFallback setting if present in csproj to support older ... (by [@adamsitnik](https://github.com/adamsitnik))
* [ffab7d](https://github.com/dotnet/BenchmarkDotNet/commit/ffab7de2c5fda0ff4947b714bbbb0c3d626d2bbd) remove allocation from Engine, make sure tests detect breaking change in the ... (by [@adamsitnik](https://github.com/adamsitnik))
* [7c9a0f](https://github.com/dotnet/BenchmarkDotNet/commit/7c9a0ff04751311c8434252127ab4b694c2b7665) consider Allocation Quantum side effects to have correct results for micro be... (by [@adamsitnik](https://github.com/adamsitnik))
* [4af5f3](https://github.com/dotnet/BenchmarkDotNet/commit/4af5f346b49b8704652cfe3268a9fe02c649c227) Added line separator in JsonExporters (by [@alinasmirnova](https://github.com/alinasmirnova))
* [8ac913](https://github.com/dotnet/BenchmarkDotNet/commit/8ac9137063ec89639674fac98d8e8a17f7635243) added Instruction Retired per Cycle (IPC) to the predefined columns for Pmc D... (by [@adamsitnik](https://github.com/adamsitnik))
* [0898c3](https://github.com/dotnet/BenchmarkDotNet/commit/0898c3fd2c371dc6d24a8e2933014ca63e8051d8) post code review changes (by [@adamsitnik](https://github.com/adamsitnik))
* [b4d68e](https://github.com/dotnet/BenchmarkDotNet/commit/b4d68e933562bd86eb8147f39c4bfcdce83e2c72) 'kB' -> 'KB' (by [@AndreyAkinshin](https://github.com/AndreyAkinshin))
* [23bd4f](https://github.com/dotnet/BenchmarkDotNet/commit/23bd4f188bb0169c8625ab882899714729e1cadc) Handle null values in CsvHelper.Escape (by [@AndreyAkinshin](https://github.com/AndreyAkinshin))
* [77ed63](https://github.com/dotnet/BenchmarkDotNet/commit/77ed631835922e57361352a0d7c4a13f21860e3f) RPlotExporter.FindInPath: handle exceptions, trim quotes #446 (by [@AndreyAkinshin](https://github.com/AndreyAkinshin))
* [626e3a](https://github.com/dotnet/BenchmarkDotNet/commit/626e3a64ba78a66afde9cf82a312c7a2fe4e6e1a) Show Windows brand versions in summary (by [@AndreyAkinshin](https://github.com/AndreyAkinshin))
* [247634](https://github.com/dotnet/BenchmarkDotNet/commit/2476346f639f41dad8748ab55155fc27fd8dbf1d) Set library version: 0.10.6 (by [@AndreyAkinshin](https://github.com/AndreyAkinshin))
## Contributors (3)
* Adam Sitnik ([@adamsitnik](https://github.com/adamsitnik))
* Alina Smirnova ([@alinasmirnova](https://github.com/alinasmirnova))
* Andrey Akinshin ([@AndreyAkinshin](https://github.com/AndreyAkinshin))
Thank you very much!
| {
"content_hash": "0940360fc0fbac7837fec83c4ad99902",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 232,
"avg_line_length": 96.97222222222223,
"alnum_prop": 0.7923231165855056,
"repo_name": "ig-sinicyn/BenchmarkDotNet",
"id": "175be8f603ea0a3e3c19ceda89c5c499bbd2b562",
"size": "3513",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "docs/_changelog/details/v0.10.6.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "3670"
},
{
"name": "C#",
"bytes": "2346156"
},
{
"name": "F#",
"bytes": "521"
},
{
"name": "JavaScript",
"bytes": "1053"
},
{
"name": "PowerShell",
"bytes": "5451"
},
{
"name": "R",
"bytes": "7494"
},
{
"name": "Shell",
"bytes": "3791"
},
{
"name": "Visual Basic",
"bytes": "275"
}
],
"symlink_target": ""
} |
using System;
using System.ComponentModel;
namespace Azure.AI.TextAnalytics
{
/// <summary> The type of the extracted number entity. </summary>
public readonly partial struct NumberKind : IEquatable<NumberKind>
{
private readonly string _value;
/// <summary> Initializes a new instance of <see cref="NumberKind"/>. </summary>
/// <exception cref="ArgumentNullException"> <paramref name="value"/> is null. </exception>
public NumberKind(string value)
{
_value = value ?? throw new ArgumentNullException(nameof(value));
}
private const string IntegerValue = "Integer";
private const string DecimalValue = "Decimal";
private const string PowerValue = "Power";
private const string FractionValue = "Fraction";
private const string PercentValue = "Percent";
private const string UnspecifiedValue = "Unspecified";
/// <summary> Integer. </summary>
public static NumberKind Integer { get; } = new NumberKind(IntegerValue);
/// <summary> Decimal. </summary>
public static NumberKind Decimal { get; } = new NumberKind(DecimalValue);
/// <summary> Power. </summary>
public static NumberKind Power { get; } = new NumberKind(PowerValue);
/// <summary> Fraction. </summary>
public static NumberKind Fraction { get; } = new NumberKind(FractionValue);
/// <summary> Percent. </summary>
public static NumberKind Percent { get; } = new NumberKind(PercentValue);
/// <summary> Unspecified. </summary>
public static NumberKind Unspecified { get; } = new NumberKind(UnspecifiedValue);
/// <summary> Determines if two <see cref="NumberKind"/> values are the same. </summary>
public static bool operator ==(NumberKind left, NumberKind right) => left.Equals(right);
/// <summary> Determines if two <see cref="NumberKind"/> values are not the same. </summary>
public static bool operator !=(NumberKind left, NumberKind right) => !left.Equals(right);
/// <summary> Converts a string to a <see cref="NumberKind"/>. </summary>
public static implicit operator NumberKind(string value) => new NumberKind(value);
/// <inheritdoc />
[EditorBrowsable(EditorBrowsableState.Never)]
public override bool Equals(object obj) => obj is NumberKind other && Equals(other);
/// <inheritdoc />
public bool Equals(NumberKind other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);
/// <inheritdoc />
[EditorBrowsable(EditorBrowsableState.Never)]
public override int GetHashCode() => _value?.GetHashCode() ?? 0;
/// <inheritdoc />
public override string ToString() => _value;
}
}
| {
"content_hash": "6ac0c00138ed35baec485a08da8db4e4",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 129,
"avg_line_length": 50.464285714285715,
"alnum_prop": 0.6510969568294409,
"repo_name": "Azure/azure-sdk-for-net",
"id": "f96f8ca701b7dec495ec404dafd446eb89814462",
"size": "2964",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/NumberKind.cs",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
#ifndef JSON_SPIRIT_PATH_ERROR
#define JSON_SPIRIT_PATH_ERROR
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
#include <string>
#include "platform.h"
namespace json_spirit {
/** A PathError is thrown when you try to access an element by path, e.g. by
* calling Value::getObject("foo.bar.baz") and there is some error in accessing
* the path: one of the values on the path isn't an object or doesn't
* exist. This can also be thrown on Value::insert() or Value::put() calls if
* you specify a path that contains a non-object.
*/
template<typename StringT>
struct BasicPathError {
BasicPathError( const StringT& path_, const StringT& element_, const std::string& reason_ = std::string("") )
: path(path_), element(element_), reason(reason_)
{}
bool operator==(const BasicPathError& rhs) const {
return (path == rhs.path &&
element == rhs.element);
// Ignore the reason since the strings could change -- we really care
// that the path and element are identical.
}
StringT path;
StringT element;
std::string reason;
};
}
#endif
| {
"content_hash": "d76866d5ecbaa5d4ca2925390c8c9611",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 113,
"avg_line_length": 28.923076923076923,
"alnum_prop": 0.6675531914893617,
"repo_name": "andmaj/json-spirit",
"id": "cbd7efb7da92052af9762ad42cb0ec61cea137e4",
"size": "1128",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "include/json_spirit/path_error.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "2669"
},
{
"name": "C++",
"bytes": "181144"
},
{
"name": "CMake",
"bytes": "6165"
}
],
"symlink_target": ""
} |
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18444
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace NCubeSolver.Plugins.Display.OpenGL.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
}
}
| {
"content_hash": "20c4888146dad425d4d6566de840972d",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 151,
"avg_line_length": 41.88461538461539,
"alnum_prop": 0.5876951331496786,
"repo_name": "EdwardSalter/NCubeSolver",
"id": "650d3022a730bb7fba15c316f35e5a45ee60891f",
"size": "1091",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Plugins/Plugin.Display.OpenGL/Properties/Settings.Designer.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "1000"
},
{
"name": "C#",
"bytes": "603301"
},
{
"name": "GLSL",
"bytes": "412"
},
{
"name": "JavaScript",
"bytes": "1173"
}
],
"symlink_target": ""
} |
package core
import (
"k8s.io/autoscaler/cluster-autoscaler/cloudprovider/oci/oci-go-sdk/v43/common"
"net/http"
)
// CreateDrgRouteTableRequest wrapper for the CreateDrgRouteTable operation
//
// # See also
//
// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/core/CreateDrgRouteTable.go.html to see an example of how to use CreateDrgRouteTableRequest.
type CreateDrgRouteTableRequest struct {
// Details for creating a DRG route table.
CreateDrgRouteTableDetails `contributesTo:"body"`
// A token that uniquely identifies a request so it can be retried in case of a timeout or
// server error without risk of executing that same action again. Retry tokens expire after 24
// hours, but can be invalidated before then due to conflicting operations (for example, if a resource
// has been deleted and purged from the system, then a retry of the original creation request
// may be rejected).
OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"`
// Unique Oracle-assigned identifier for the request.
// If you need to contact Oracle about a particular request, please provide the request ID.
OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"`
// Metadata about the request. This information will not be transmitted to the service, but
// represents information that the SDK will consume to drive retry behavior.
RequestMetadata common.RequestMetadata
}
func (request CreateDrgRouteTableRequest) String() string {
return common.PointerString(request)
}
// HTTPRequest implements the OCIRequest interface
func (request CreateDrgRouteTableRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser) (http.Request, error) {
return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request)
}
// BinaryRequestBody implements the OCIRequest interface
func (request CreateDrgRouteTableRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) {
return nil, false
}
// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy.
func (request CreateDrgRouteTableRequest) RetryPolicy() *common.RetryPolicy {
return request.RequestMetadata.RetryPolicy
}
// CreateDrgRouteTableResponse wrapper for the CreateDrgRouteTable operation
type CreateDrgRouteTableResponse struct {
// The underlying http response
RawResponse *http.Response
// The DrgRouteTable instance
DrgRouteTable `presentIn:"body"`
// For optimistic concurrency control. See `if-match`.
Etag *string `presentIn:"header" name:"etag"`
// Unique Oracle-assigned identifier for the request. If you need to contact
// Oracle about a particular request, please provide the request ID.
OpcRequestId *string `presentIn:"header" name:"opc-request-id"`
}
func (response CreateDrgRouteTableResponse) String() string {
return common.PointerString(response)
}
// HTTPResponse implements the OCIResponse interface
func (response CreateDrgRouteTableResponse) HTTPResponse() *http.Response {
return response.RawResponse
}
| {
"content_hash": "a21587358aa72e3ac4bcdb0f1e11ae90",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 171,
"avg_line_length": 38.625,
"alnum_prop": 0.7941747572815534,
"repo_name": "kubernetes/autoscaler",
"id": "45fc4a70b191cf8f30bcd1c6ed7cabd7a6a38efb",
"size": "3457",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "cluster-autoscaler/cloudprovider/oci/oci-go-sdk/v43/core/create_drg_route_table_request_response.go",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Dockerfile",
"bytes": "5407"
},
{
"name": "Go",
"bytes": "19468437"
},
{
"name": "Makefile",
"bytes": "19380"
},
{
"name": "Mustache",
"bytes": "4034"
},
{
"name": "Python",
"bytes": "20902"
},
{
"name": "Roff",
"bytes": "1730"
},
{
"name": "Ruby",
"bytes": "1255"
},
{
"name": "Shell",
"bytes": "53412"
}
],
"symlink_target": ""
} |
<html lang="en">
<head>
<title>DRANDTRIANGULAR - AMD Core Math Library (ACML) 5.3.1</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="AMD Core Math Library (ACML) 5.3.1">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Continuous-Univariate-Distributions.html#Continuous-Univariate-Distributions" title="Continuous Univariate Distributions">
<link rel="prev" href="DRANDSTUDENTST.html#DRANDSTUDENTST" title="DRANDSTUDENTST">
<link rel="next" href="DRANDUNIFORM.html#DRANDUNIFORM" title="DRANDUNIFORM">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
--></style>
</head>
<body>
<div class="node">
<a name="DRANDTRIANGULAR"></a>
<p>
Next: <a rel="next" accesskey="n" href="DRANDUNIFORM.html#DRANDUNIFORM">DRANDUNIFORM</a>,
Previous: <a rel="previous" accesskey="p" href="DRANDSTUDENTST.html#DRANDSTUDENTST">DRANDSTUDENTST</a>,
Up: <a rel="up" accesskey="u" href="Continuous-Univariate-Distributions.html#Continuous-Univariate-Distributions">Continuous Univariate Distributions</a>
<hr>
</div>
<h5 class="unnumberedsubsubsec"><code>DRANDTRIANGULAR / SRANDTRIANGULAR</code></h5>
<p><a name="index-triangular-distribution-685"></a><a name="index-continuous-univariate-distribution_002c-triangular-686"></a><a name="index-univariate-distribution_002c-triangular-687"></a>Generates a vector of random variates from a Triangular distribution
with probability density function, f(X), where:
f(X) = [2 * (X - XMIN)] / [(XMAX - XMIN) * (XMED - XMIN)], if XMIN < X <= XMED, else f(X) = [2 * (XMAX - X)] / [(XMAX - XMIN) * (XMAX - XMED)], if XMED < X <= XMAX, otherwise f(X) = 0.
<p><a name="index-SRANDTRIANGULAR-688"></a><em>
(Note that SRANDTRIANGULAR is the single precision version of DRANDTRIANGULAR. The argument lists of both routines are identical except that any double precision arguments of DRANDTRIANGULAR are replaced in SRANDTRIANGULAR by single precision arguments - type REAL in FORTRAN or type float in C).
</em>
<div class="defun">
— SUBROUTINE: <b>DRANDTRIANGULAR</b> (<var>N,XMIN,XMED,XMAX,STATE,X,INFO</var>)<var><a name="index-DRANDTRIANGULAR-689"></a></var><br>
<blockquote><!-- ================================================================================= -->
<div class="defun">
— Input: INTEGER <b>N</b><var><a name="index-N-690"></a></var><br>
<blockquote><!-- @deftypevr {Input} INTEGER N -->
<p>On input: number of variates required.
<br> Constraint: <var>N</var>>=0.
<!-- @end deftypevr -->
</blockquote></div>
<!-- ================================================================================= -->
<div class="defun">
— Input: DOUBLE PRECISION <b>XMIN</b><var><a name="index-XMIN-691"></a></var><br>
<blockquote> <p>On input: minimum value for the distribution.
</p></blockquote></div>
<!-- ================================================================================= -->
<div class="defun">
— Input: DOUBLE PRECISION <b>XMED</b><var><a name="index-XMED-692"></a></var><br>
<blockquote> <p>On input: median value for the distribution.
<br>Constraint: <var>XMIN</var><=<var>XMED</var>
<=<var>XMAX</var>.
</blockquote></div>
<!-- ================================================================================= -->
<div class="defun">
— Input: DOUBLE PRECISION <b>XMAX</b><var><a name="index-XMAX-693"></a></var><br>
<blockquote> <p>On input: maximum value for the distribution.
<br>Constraint: <var>XMAX</var>>=<var>XMIN</var>.
</blockquote></div>
<!-- ================================================================================= -->
<div class="defun">
— Input/Output: INTEGER <b>STATE</b>(<var>*</var>)<var><a name="index-STATE-694"></a></var><br>
<blockquote><!-- @deftypevr {Input/Output} INTEGER STATE(*) -->
<p>The <var>STATE</var> vector holds information on the state of the base
generator being used and as such its minimum length varies. Prior to
calling <code>DRANDTRIANGULAR</code> <var>STATE</var> must have been initialized. See
<a href="Initialization-of-the-Base-Generators.html#Initialization-of-the-Base-Generators">Initialization of the Base Generators</a> for information on
initialization of the <var>STATE</var> variable.
<br> On input: the current state of the base generator.
<br> On output: the updated state of the base generator.
<!-- @end deftypevr -->
</blockquote></div>
<!-- ================================================================================= -->
<div class="defun">
— Output: DOUBLE PRECISION <b>X</b>(<var>N</var>)<var><a name="index-X-695"></a></var><br>
<blockquote><!-- @deftypevr {Output} DOUBLE PRECISION X(@var{N}) -->
<p>On output: vector of variates from the specified distribution.
<!-- @end deftypevr -->
</blockquote></div>
<!-- ================================================================================= -->
<div class="defun">
— Output: INTEGER <b>INFO</b><var><a name="index-INFO-696"></a></var><br>
<blockquote><!-- @deftypevr {Output} INTEGER INFO -->
<p>On output: <var>INFO</var> is an error indicator. On successful exit,
<var>INFO</var> contains 0. If <var>INFO</var> = -i on exit, the i-th
argument had an illegal value.
<!-- @end deftypevr -->
</blockquote></div>
</p></blockquote></div>
<!-- Using set rather than the raw variables in the example as PDF and INFO act -->
<!-- differently with raw variables, but the same with @value{} -->
<pre class="display"> Example:
<p><table class="cartouche" summary="cartouche" border="1"><tr><td>
<pre class="example"> C <!-- /@w --> <!-- /@w --> <!-- /@w --> <!-- /@w --> <!-- /@w --> <!-- /@w -->Generate 100 values from the Triangular distribution
<!-- /@w --> <!-- /@w --> <!-- /@w --> <!-- /@w --> <!-- /@w --> <!-- /@w --> <!-- /@w -->INTEGER LSTATE,N
<!-- /@w --> <!-- /@w --> <!-- /@w --> <!-- /@w --> <!-- /@w --> <!-- /@w --> <!-- /@w -->PARAMETER (LSTATE=16,N=100)
<!-- /@w --> <!-- /@w --> <!-- /@w --> <!-- /@w --> <!-- /@w --> <!-- /@w --> <!-- /@w -->INTEGER I,INFO,SEED(1),STATE(LSTATE)
<!-- /@w --> <!-- /@w --> <!-- /@w --> <!-- /@w --> <!-- /@w --> <!-- /@w --> <!-- /@w -->DOUBLE PRECISION XMIN,XMAX,XMED
<!-- /@w --> <!-- /@w --> <!-- /@w --> <!-- /@w --> <!-- /@w --> <!-- /@w --> <!-- /@w -->DOUBLE PRECISION X(N)
C <!-- /@w --> <!-- /@w --> <!-- /@w --> <!-- /@w --> <!-- /@w --> <!-- /@w -->Set the seed
<!-- /@w --> <!-- /@w --> <!-- /@w --> <!-- /@w --> <!-- /@w --> <!-- /@w --> <!-- /@w -->SEED(1) = 1234
C <!-- /@w --> <!-- /@w --> <!-- /@w --> <!-- /@w --> <!-- /@w --> <!-- /@w -->Read in the distributional parameters
<!-- /@w --> <!-- /@w --> <!-- /@w --> <!-- /@w --> <!-- /@w --> <!-- /@w --> <!-- /@w -->READ(5,*) XMIN,XMAX,XMED
C <!-- /@w --> <!-- /@w --> <!-- /@w --> <!-- /@w --> <!-- /@w --> <!-- /@w -->Initialize the STATE vector
<!-- /@w --> <!-- /@w --> <!-- /@w --> <!-- /@w --> <!-- /@w --> <!-- /@w --> <!-- /@w -->CALL DRANDINITIALIZE(1,1,SEED,1,STATE,LSTATE,INFO)
C <!-- /@w --> <!-- /@w --> <!-- /@w --> <!-- /@w --> <!-- /@w --> <!-- /@w -->Generate N variates from the Triangular distribution
<!-- /@w --> <!-- /@w --> <!-- /@w --> <!-- /@w --> <!-- /@w --> <!-- /@w --> <!-- /@w -->CALL DRANDTRIANGULAR(N,XMIN,XMAX,XMED,STATE,X,INFO)
C <!-- /@w --> <!-- /@w --> <!-- /@w --> <!-- /@w --> <!-- /@w --> <!-- /@w -->Print the results
<!-- /@w --> <!-- /@w --> <!-- /@w --> <!-- /@w --> <!-- /@w --> <!-- /@w --> <!-- /@w -->WRITE(6,*) (X(I),I=1,N)
</pre>
</td></tr></table>
</pre>
<!-- ================================================================================= -->
<!-- ================================================================================= -->
</body></html>
| {
"content_hash": "bdbbb574f014f1f048abcdd4a0886edb",
"timestamp": "",
"source": "github",
"line_count": 145,
"max_line_length": 297,
"avg_line_length": 64.06206896551724,
"alnum_prop": 0.5252449133383572,
"repo_name": "KaimingOuyang/HPC-K-Means",
"id": "27cad07bbc24b22fe655de97d3bab7ec40dc32b0",
"size": "9289",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "acml/Doc/html/DRANDTRIANGULAR.html",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Assembly",
"bytes": "609"
},
{
"name": "C",
"bytes": "18803878"
},
{
"name": "C++",
"bytes": "113300862"
},
{
"name": "CMake",
"bytes": "433056"
},
{
"name": "Cuda",
"bytes": "26751"
},
{
"name": "FORTRAN",
"bytes": "394128"
},
{
"name": "Groff",
"bytes": "677565"
},
{
"name": "HTML",
"bytes": "1413540"
},
{
"name": "M4",
"bytes": "1204"
},
{
"name": "Makefile",
"bytes": "787790"
},
{
"name": "Matlab",
"bytes": "17397"
},
{
"name": "Objective-C",
"bytes": "847314"
},
{
"name": "Perl",
"bytes": "11571"
},
{
"name": "Prolog",
"bytes": "3949"
},
{
"name": "Python",
"bytes": "26431"
},
{
"name": "Shell",
"bytes": "79099"
}
],
"symlink_target": ""
} |
package soundgates.simulation;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.AbstractHandler;
public class StopSimulationHandler extends AbstractHandler {
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
ProcessStore.killSimulation();
return null;
}
}
| {
"content_hash": "ec9baee5086f2fd72c10bd2a84f31b06",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 72,
"avg_line_length": 27.428571428571427,
"alnum_prop": 0.828125,
"repo_name": "EPiCS/soundgates",
"id": "23b8cfbafaae0787016b6dfd604a12987a684317",
"size": "384",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "software/editor/Soundgates.simulation/src/soundgates/simulation/StopSimulationHandler.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "2447778"
},
{
"name": "C++",
"bytes": "201611999"
},
{
"name": "Groovy",
"bytes": "543"
},
{
"name": "Java",
"bytes": "1306962"
},
{
"name": "Objective-C",
"bytes": "96"
},
{
"name": "Pure Data",
"bytes": "19836"
},
{
"name": "Python",
"bytes": "43858"
},
{
"name": "Scilab",
"bytes": "2137"
},
{
"name": "Shell",
"bytes": "21552"
},
{
"name": "Tcl",
"bytes": "78478"
},
{
"name": "TeX",
"bytes": "82291"
},
{
"name": "VHDL",
"bytes": "801572"
},
{
"name": "Verilog",
"bytes": "2113972"
},
{
"name": "XSLT",
"bytes": "230893"
}
],
"symlink_target": ""
} |
/*global atom*/
'use strict'
var plugin = module.exports;
var path = require('path');
var TEMPLATE_DIR = '../template-engines/';
var templateEngines = {
'jade': require(TEMPLATE_DIR + 'jade'),
'haml': require(TEMPLATE_DIR + 'haml')
};
/*
* Replace contents of the editor with the converted content
* based on engine
**/
function convert (engine) {
return function () {
var editor = atom.workspace.getActiveEditor();
var originalText = editor.getSelectedText();
var isSelected = true;
var convertedText = '';
if (!originalText) {
originalText = editor.getText();
isSelected = false;
}
// If no original text, simply return
if (!originalText) {
return;
}
try {
convertedText = templateEngines[engine].toHTML(originalText);
} catch (err) {
console.error(err);
atom.beep();
}
if (isSelected) {
editor.setTextInBufferRange(editor.getSelectedBufferRange(), convertedText);
} else {
editor.setText(convertedText);
}
}
}
plugin.activate = function () {
Object.keys(templateEngines)
.forEach(function (engine) {
atom.workspaceView.command('template-convert-to:' + engine, convert(engine));
});
}; | {
"content_hash": "1ccee29a58484ad65d115af1ace024a0",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 83,
"avg_line_length": 22.436363636363637,
"alnum_prop": 0.6369529983792545,
"repo_name": "rowoot/atom-template-engine",
"id": "9c3c0af624ef73c11674ccfababde48a0fb26355",
"size": "1234",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/atom-template-engine.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "2505"
}
],
"symlink_target": ""
} |
<?php
namespace ILL\VisitBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilder;
class VisitType extends AbstractType
{
public function buildForm(FormBuilder $builder, array $options)
{
$builder
->add('name')
->add('start_date', 'date', array('error_bubbling'=>false))
->add('end_date', 'date', array('error_bubbling'=>false))
->add('details', 'text', array('error_bubbling'=>true))
->add('responsible')
->add('institute')
;
}
public function getName()
{
return 'ill_visitbundle_visittype';
}
}
| {
"content_hash": "208634961969a6c5a86a04911e1cd4d8",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 71,
"avg_line_length": 25.26923076923077,
"alnum_prop": 0.589041095890411,
"repo_name": "M0dM/GroupVis",
"id": "b884b6311833392c8f7055706cd7c103e6d1d875",
"size": "657",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/ILL/VisitBundle/Form/VisitType.php",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "50504"
},
{
"name": "PHP",
"bytes": "79547"
}
],
"symlink_target": ""
} |
'-------------------------------------------------------------------------------------------'
' Inicio del codigo
'-------------------------------------------------------------------------------------------'
' Importando librerias
'-------------------------------------------------------------------------------------------'
Imports System.Data
'-------------------------------------------------------------------------------------------'
' Inicio de clase "rOPagos_AtributoA_Conceptos"
'-------------------------------------------------------------------------------------------'
Partial Class rOPagos_AtributoA_Conceptos
Inherits vis2formularios.frmReporte
Dim loObjetoReporte As CrystalDecisions.CrystalReports.Engine.ReportDocument
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Try
Dim lcParametro0Desde As String = goServicios.mObtenerCampoFormatoSQL(cusAplicacion.goReportes.paParametrosIniciales(0))
Dim lcParametro0Hasta As String = goServicios.mObtenerCampoFormatoSQL(cusAplicacion.goReportes.paParametrosFinales(0))
Dim lcParametro1Desde As String = goServicios.mObtenerCampoFormatoSQL(cusAplicacion.goReportes.paParametrosIniciales(1), goServicios.enuOpcionesRedondeo.KN_FechaInicioDelDia)
Dim lcParametro1Hasta As String = goServicios.mObtenerCampoFormatoSQL(cusAplicacion.goReportes.paParametrosFinales(1), goServicios.enuOpcionesRedondeo.KN_FechaFinDelDia)
Dim lcParametro2Desde As String = goServicios.mObtenerCampoFormatoSQL(cusAplicacion.goReportes.paParametrosIniciales(2))
Dim lcParametro2Hasta As String = goServicios.mObtenerCampoFormatoSQL(cusAplicacion.goReportes.paParametrosFinales(2))
Dim lcParametro3Desde As String = goServicios.mObtenerListaFormatoSQL(cusAplicacion.goReportes.paParametrosIniciales(3))
Dim lcParametro4Desde As String = goServicios.mObtenerCampoFormatoSQL(cusAplicacion.goReportes.paParametrosIniciales(4))
Dim lcParametro4Hasta As String = goServicios.mObtenerCampoFormatoSQL(cusAplicacion.goReportes.paParametrosFinales(4))
Dim lcParametro5Desde As String = goServicios.mObtenerCampoFormatoSQL(cusAplicacion.goReportes.paParametrosIniciales(5))
Dim lcParametro5Hasta As String = goServicios.mObtenerCampoFormatoSQL(cusAplicacion.goReportes.paParametrosFinales(5))
Dim lcParametro6Desde As String = goServicios.mObtenerCampoFormatoSQL(cusAplicacion.goReportes.paParametrosIniciales(6))
Dim lcParametro6Hasta As String = goServicios.mObtenerCampoFormatoSQL(cusAplicacion.goReportes.paParametrosFinales(6))
Dim lcParametro7Desde As String = goServicios.mObtenerCampoFormatoSQL(cusAplicacion.goReportes.paParametrosIniciales(7))
Dim lcParametro7Hasta As String = goServicios.mObtenerCampoFormatoSQL(cusAplicacion.goReportes.paParametrosFinales(7))
Dim lcParametro8Desde As String = goServicios.mObtenerCampoFormatoSQL(cusAplicacion.goReportes.paParametrosIniciales(8))
Dim lcParametro8Hasta As String = goServicios.mObtenerCampoFormatoSQL(cusAplicacion.goReportes.paParametrosFinales(8))
Dim lcOrdenamiento As String = cusAplicacion.goReportes.pcOrden
Dim loConsulta As New StringBuilder()
loConsulta.AppendLine("SELECT CASE WHEN (Conceptos.Atributo_A='') ")
loConsulta.AppendLine(" THEN '(Sin Atributo A asignado)'")
loConsulta.AppendLine(" ELSE Conceptos.Atributo_A ")
loConsulta.AppendLine(" END AS Atributo_A,")
loConsulta.AppendLine(" Conceptos.Cod_Con,")
loConsulta.AppendLine(" Conceptos.Nom_con,")
loConsulta.AppendLine(" SUM(Renglones_oPagos.Mon_deb) AS Mon_Deb,")
loConsulta.AppendLine(" SUM(Renglones_oPagos.Mon_hab) AS Mon_Hab,")
loConsulta.AppendLine(" SUM(Renglones_oPagos.Mon_imp1) AS Mon_Imp1")
loConsulta.AppendLine("FROM Ordenes_Pagos ")
loConsulta.AppendLine(" JOIN Renglones_oPagos ON Ordenes_Pagos.Documento = Renglones_oPagos.Documento")
loConsulta.AppendLine(" JOIN Conceptos ON Renglones_oPagos.Cod_Con = Conceptos.Cod_con")
loConsulta.AppendLine(" AND Conceptos.Atributo_A BETWEEN " & lcParametro8Desde)
loConsulta.AppendLine(" AND " & lcParametro8Hasta)
loConsulta.AppendLine("WHERE Ordenes_Pagos.Documento BETWEEN " & lcParametro0Desde)
loConsulta.AppendLine(" AND " & lcParametro0Hasta)
loConsulta.AppendLine(" AND Ordenes_Pagos.Fec_Ini BETWEEN " & lcParametro1Desde)
loConsulta.AppendLine(" AND " & lcParametro1Hasta)
loConsulta.AppendLine(" AND Ordenes_Pagos.Cod_Pro BETWEEN " & lcParametro2Desde)
loConsulta.AppendLine(" AND " & lcParametro2Hasta)
loConsulta.AppendLine(" AND Ordenes_Pagos.Status IN (" & lcParametro3Desde & ")")
loConsulta.AppendLine(" AND Renglones_oPagos.Cod_Con BETWEEN " & lcParametro4Desde)
loConsulta.AppendLine(" AND " & lcParametro4Hasta)
loConsulta.AppendLine(" AND Ordenes_Pagos.Cod_Mon BETWEEN " & lcParametro5Desde)
loConsulta.AppendLine(" AND " & lcParametro5Hasta)
loConsulta.AppendLine(" AND Ordenes_Pagos.Cod_Rev BETWEEN " & lcParametro6Desde)
loConsulta.AppendLine(" AND " & lcParametro6Hasta)
loConsulta.AppendLine(" AND Ordenes_Pagos.Cod_Suc BETWEEN " & lcParametro7Desde)
loConsulta.AppendLine(" AND " & lcParametro7Hasta)
loConsulta.AppendLine("GROUP BY Conceptos.Atributo_A,")
loConsulta.AppendLine(" Conceptos.Cod_Con,")
loConsulta.AppendLine(" Conceptos.Nom_Con")
loConsulta.AppendLine("ORDER BY " & lcOrdenamiento)
Dim loServicios As New cusDatos.goDatos
Dim laDatosReporte As DataSet = loServicios.mObtenerTodos(loConsulta.ToString, "curReportes")
loObjetoReporte = cusAplicacion.goReportes.mCargarReporte("rOPagos_AtributoA_Conceptos", laDatosReporte)
Me.mTraducirReporte(loObjetoReporte)
Me.mFormatearCamposReporte(loObjetoReporte)
Me.crvrOPagos_AtributoA_Conceptos.ReportSource = loObjetoReporte
Catch loExcepcion As Exception
Me.WbcAdministradorMensajeModal.mMostrarMensajeModal("Error", _
"No se pudo Completar el Proceso: " & loExcepcion.Message, _
vis3Controles.wbcAdministradorMensajeModal.enumTipoMensaje.KN_Error, _
"auto", _
"auto")
End Try
End Sub
Protected Sub Page_Unload(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Unload
Try
loObjetoReporte.Close()
Catch loExcepcion As Exception
End Try
End Sub
End Class
'-------------------------------------------------------------------------------------------'
' Fin del codigo '
'-------------------------------------------------------------------------------------------'
' RJG: 23/03/15: Código inicial, a partir de OPagos_gConceptos. '
'-------------------------------------------------------------------------------------------'
| {
"content_hash": "bddd97086727ca8e12ca87b9d414c254",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 186,
"avg_line_length": 62.30769230769231,
"alnum_prop": 0.6445816186556927,
"repo_name": "kodeitsolutions/ef-reports",
"id": "28b84e300cfb0d91d73301bd81ba012f99b1b72a",
"size": "7293",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "rOPagos_AtributoA_Conceptos.aspx.vb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "6246816"
},
{
"name": "Visual Basic",
"bytes": "25803337"
}
],
"symlink_target": ""
} |
const updateWebpackConfig = require('./core/updateWebpackConfig')
const configureServer = require('./core/configureServer')
function snapguidist(config = {}) {
const serverInfo = {
host: config.serverHost || 'localhost',
port: config.serverPort || 6060,
}
const {
dangerouslyUpdateWebpackConfig: _updateWebpackConfig,
configureServer: _configureServer,
} = config
return Object.assign(config,
{
dangerouslyUpdateWebpackConfig(webpackConfig, env) {
let final = updateWebpackConfig(webpackConfig, env, serverInfo)
if (_updateWebpackConfig) {
final = _updateWebpackConfig(final, env)
}
return final
},
configureServer(app, env) {
configureServer(app, env)
if (_configureServer) {
_configureServer(app, env)
}
},
})
}
module.exports = snapguidist
| {
"content_hash": "8a63a06fce954b9b0d02c0cb2b9628c0",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 71,
"avg_line_length": 24.555555555555557,
"alnum_prop": 0.6493212669683258,
"repo_name": "MicheleBertoli/snapguidist",
"id": "3c5cf43cf7278ae8c42187baa7e8377789ab6941",
"size": "884",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/index.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1227"
},
{
"name": "JavaScript",
"bytes": "19839"
}
],
"symlink_target": ""
} |
odoo.define('website_forum.editor', function (require) {
"use strict";
var core = require('web.core');
var contentMenu = require('website.contentMenu');
var website = require('website.website');
var _t = core._t;
contentMenu.TopBar.include({
new_forum: function() {
website.prompt({
id: "editor_new_forum",
window_title: _t("New Forum"),
input: "Forum Name",init: function () {
var $group = this.$dialog.find("div.form-group");
$group.removeClass("mb0");
var $add = $(
'<div class="form-group mb0">'+
'<label class="col-sm-offset-3 col-sm-9 text-left">'+
' <input type="checkbox" required="required"/> '+
'</label>'+
'</div>');
$add.find('label').append(_t("Add page in menu"));
$group.after($add);
}
}).then(function (forum_name, field, $dialog) {
var add_menu = ($dialog.find('input[type="checkbox"]').is(':checked'));
website.form('/forum/new', 'POST', {
forum_name: forum_name,
add_menu: add_menu || ""
});
});
},
});
});
| {
"content_hash": "331ce8745314013099231533062b5a8b",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 83,
"avg_line_length": 33.526315789473685,
"alnum_prop": 0.4717425431711146,
"repo_name": "vileopratama/vitech",
"id": "cecdc2df99256eef51eb4dd5e5e77cd8922bd210",
"size": "1274",
"binary": false,
"copies": "70",
"ref": "refs/heads/master",
"path": "src/addons/website_forum/static/src/js/website_forum.editor.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "9611"
},
{
"name": "CSS",
"bytes": "2125999"
},
{
"name": "HTML",
"bytes": "252393"
},
{
"name": "Java",
"bytes": "1840167"
},
{
"name": "JavaScript",
"bytes": "6176224"
},
{
"name": "Makefile",
"bytes": "19072"
},
{
"name": "Mako",
"bytes": "7659"
},
{
"name": "NSIS",
"bytes": "16782"
},
{
"name": "Python",
"bytes": "9438805"
},
{
"name": "Ruby",
"bytes": "220"
},
{
"name": "Shell",
"bytes": "22312"
},
{
"name": "Vim script",
"bytes": "406"
},
{
"name": "XSLT",
"bytes": "11489"
}
],
"symlink_target": ""
} |
package mnm.c2j;
import org.objectweb.asm.Opcodes;
import mnm.c2j.json.AnnotationJson;
import mnm.c2j.json.BaseClassJson;
import mnm.c2j.json.ClassJson;
import mnm.c2j.json.EnumJson;
import mnm.c2j.json.InterfaceJson;
public enum Kind {
ENUM(Opcodes.ACC_ENUM, EnumJson.class),
ANNOTATION(Opcodes.ACC_ANNOTATION, AnnotationJson.class),
INTERFACE(Opcodes.ACC_INTERFACE, InterfaceJson.class),
CLASS(0, ClassJson.class),;
private int flag;
private Class<? extends BaseClassJson> jsonClass;
private Kind(int flag, Class<? extends BaseClassJson> json) {
this.flag = flag;
this.jsonClass = json;
}
public static Kind getKind(int access) {
for (Kind k : values()) {
if ((access & k.flag) == k.flag)
return k;
}
return CLASS;
}
public BaseClassJson newJson() {
try {
return jsonClass.newInstance();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
| {
"content_hash": "0ef2927ea7b8573b040dc3232055ca20",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 65,
"avg_line_length": 25.55,
"alnum_prop": 0.6320939334637965,
"repo_name": "killjoy1221/Class2Json",
"id": "2728a1bccd4f92e4226147de4c09c36d06267d4e",
"size": "1022",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/mnm/c2j/Kind.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "36565"
}
],
"symlink_target": ""
} |
/*
* Copyright (c) 2009 The Khronos Group Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this
* software and /or associated documentation files (the "Materials "), to deal in the
* Materials without restriction, including without limitation the rights to use, copy,
* modify, merge, publish, distribute, sublicense, and/or sell copies of the Materials,
* and to permit persons to whom the Materials are 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 Materials.
*
* THE MATERIALS ARE 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 MATERIALS OR THE USE OR OTHER DEALINGS IN THE
* MATERIALS.
*/
#include <stdlib.h>
#include <stdio.h>
//#include <string.h>
#include <unistd.h>
//#include <sys/time.h>
#include <SLES/OpenSLES.h>
//#define TEST_VOLUME_ITF
//#define TEST_COLD_START
#define MAX_NUMBER_INTERFACES 2
#define PREFETCHEVENT_ERROR_CANDIDATE \
(SL_PREFETCHEVENT_STATUSCHANGE | SL_PREFETCHEVENT_FILLLEVELCHANGE)
//-----------------------------------------------------------------
//* Exits the application if an error is encountered */
#define CheckErr(x) ExitOnErrorFunc(x,__LINE__)
void ExitOnErrorFunc( SLresult result , int line)
{
if (SL_RESULT_SUCCESS != result) {
fprintf(stderr, "%u error code encountered at line %d, exiting\n", result, line);
exit(EXIT_FAILURE);
}
}
bool prefetchError = false;
//-----------------------------------------------------------------
/* PrefetchStatusItf callback for an audio player */
void PrefetchEventCallback( SLPrefetchStatusItf caller, void *pContext, SLuint32 event)
{
SLpermille level = 0;
SLresult result;
result = (*caller)->GetFillLevel(caller, &level);
CheckErr(result);
SLuint32 status;
//fprintf(stdout, "PrefetchEventCallback: received event %u\n", event);
result = (*caller)->GetPrefetchStatus(caller, &status);
CheckErr(result);
if ((PREFETCHEVENT_ERROR_CANDIDATE == (event & PREFETCHEVENT_ERROR_CANDIDATE))
&& (level == 0) && (status == SL_PREFETCHSTATUS_UNDERFLOW)) {
fprintf(stdout, "PrefetchEventCallback: Error while prefetching data, exiting\n");
prefetchError = true;
}
if (event & SL_PREFETCHEVENT_FILLLEVELCHANGE) {
fprintf(stdout, "PrefetchEventCallback: Buffer fill level is = %d\n", level);
}
if (event & SL_PREFETCHEVENT_STATUSCHANGE) {
fprintf(stdout, "PrefetchEventCallback: Prefetch Status is = %u\n", status);
}
}
//-----------------------------------------------------------------
/* PlayItf callback for playback events */
void PlayEventCallback(
SLPlayItf caller,
void *pContext,
SLuint32 event)
{
if (SL_PLAYEVENT_HEADATEND & event) {
fprintf(stdout, "SL_PLAYEVENT_HEADATEND reached\n");
//SignalEos();
}
if (SL_PLAYEVENT_HEADATNEWPOS & event) {
SLmillisecond pMsec = 0;
(*caller)->GetPosition(caller, &pMsec);
fprintf(stdout, "SL_PLAYEVENT_HEADATNEWPOS current position=%ums\n", pMsec);
}
if (SL_PLAYEVENT_HEADATMARKER & event) {
SLmillisecond pMsec = 0;
(*caller)->GetPosition(caller, &pMsec);
fprintf(stdout, "SL_PLAYEVENT_HEADATMARKER current position=%ums\n", pMsec);
}
}
//-----------------------------------------------------------------
/* Play some music from a URI */
void TestPlayUri( SLObjectItf sl, const char* path)
{
SLEngineItf EngineItf;
SLint32 numOutputs = 0;
SLuint32 deviceID = 0;
SLresult res;
SLDataSource audioSource;
SLDataLocator_URI uri;
SLDataFormat_MIME mime;
SLDataSink audioSink;
SLDataLocator_OutputMix locator_outputmix;
SLObjectItf player;
SLPlayItf playItf;
SLVolumeItf volItf;
SLPrefetchStatusItf prefetchItf;
SLObjectItf OutputMix;
SLboolean required[MAX_NUMBER_INTERFACES];
SLInterfaceID iidArray[MAX_NUMBER_INTERFACES];
/* Get the SL Engine Interface which is implicit */
res = (*sl)->GetInterface(sl, SL_IID_ENGINE, (void*)&EngineItf);
CheckErr(res);
/* Initialize arrays required[] and iidArray[] */
for (int i=0 ; i < MAX_NUMBER_INTERFACES ; i++) {
required[i] = SL_BOOLEAN_FALSE;
iidArray[i] = SL_IID_NULL;
}
// Set arrays required[] and iidArray[] for VOLUME and PREFETCHSTATUS interface
required[0] = SL_BOOLEAN_TRUE;
iidArray[0] = SL_IID_VOLUME;
required[1] = SL_BOOLEAN_TRUE;
iidArray[1] = SL_IID_PREFETCHSTATUS;
// Create Output Mix object to be used by player
res = (*EngineItf)->CreateOutputMix(EngineItf, &OutputMix, 0,
iidArray, required); CheckErr(res);
// Realizing the Output Mix object in synchronous mode.
res = (*OutputMix)->Realize(OutputMix, SL_BOOLEAN_FALSE);
CheckErr(res);
/* Setup the data source structure for the URI */
uri.locatorType = SL_DATALOCATOR_URI;
uri.URI = (SLchar*) path;
mime.formatType = SL_DATAFORMAT_MIME;
mime.mimeType = (SLchar*)NULL;
mime.containerType = SL_CONTAINERTYPE_UNSPECIFIED;
audioSource.pFormat = (void *)&mime;
audioSource.pLocator = (void *)&uri;
/* Setup the data sink structure */
locator_outputmix.locatorType = SL_DATALOCATOR_OUTPUTMIX;
locator_outputmix.outputMix = OutputMix;
audioSink.pLocator = (void *)&locator_outputmix;
audioSink.pFormat = NULL;
/* Create the audio player */
res = (*EngineItf)->CreateAudioPlayer(EngineItf, &player, &audioSource, &audioSink,
MAX_NUMBER_INTERFACES, iidArray, required); CheckErr(res);
/* Realizing the player in synchronous mode. */
res = (*player)->Realize(player, SL_BOOLEAN_FALSE); CheckErr(res);
fprintf(stdout, "URI example: after Realize\n");
/* Get interfaces */
res = (*player)->GetInterface(player, SL_IID_PLAY, (void*)&playItf);
CheckErr(res);
res = (*player)->GetInterface(player, SL_IID_VOLUME, (void*)&volItf);
CheckErr(res);
res = (*player)->GetInterface(player, SL_IID_PREFETCHSTATUS, (void*)&prefetchItf);
CheckErr(res);
res = (*prefetchItf)->RegisterCallback(prefetchItf, PrefetchEventCallback, &prefetchItf);
CheckErr(res);
res = (*prefetchItf)->SetCallbackEventsMask(prefetchItf,
SL_PREFETCHEVENT_FILLLEVELCHANGE | SL_PREFETCHEVENT_STATUSCHANGE);
CheckErr(res);
/* Configure fill level updates every 5 percent */
(*prefetchItf)->SetFillUpdatePeriod(prefetchItf, 50);
/* Set up the player callback to get events during the decoding */
res = (*playItf)->SetMarkerPosition(playItf, 2000);
CheckErr(res);
res = (*playItf)->SetPositionUpdatePeriod(playItf, 500);
CheckErr(res);
res = (*playItf)->SetCallbackEventsMask(playItf,
SL_PLAYEVENT_HEADATMARKER | SL_PLAYEVENT_HEADATNEWPOS | SL_PLAYEVENT_HEADATEND);
CheckErr(res);
res = (*playItf)->RegisterCallback(playItf, PlayEventCallback, NULL);
CheckErr(res);
/* Display duration */
SLmillisecond durationInMsec = SL_TIME_UNKNOWN;
res = (*playItf)->GetDuration(playItf, &durationInMsec);
CheckErr(res);
if (durationInMsec == SL_TIME_UNKNOWN) {
fprintf(stdout, "Content duration is unknown (before starting to prefetch)\n");
} else {
fprintf(stdout, "Content duration is %u ms (before starting to prefetch)\n",
durationInMsec);
}
/* Set the player volume */
res = (*volItf)->SetVolumeLevel( volItf, -300);
CheckErr(res);
/* Play the URI */
/* first cause the player to prefetch the data */
fprintf(stdout, "Before set to PAUSED\n");
res = (*playItf)->SetPlayState( playItf, SL_PLAYSTATE_PAUSED );
fprintf(stdout, "After set to PAUSED\n");
CheckErr(res);
usleep(100 * 1000);
/* wait until there's data to play */
//SLpermille fillLevel = 0;
SLuint32 prefetchStatus = SL_PREFETCHSTATUS_UNDERFLOW;
SLuint32 timeOutIndex = 100; // 10s
while ((prefetchStatus != SL_PREFETCHSTATUS_SUFFICIENTDATA) && (timeOutIndex > 0) &&
!prefetchError) {
usleep(100 * 1000);
(*prefetchItf)->GetPrefetchStatus(prefetchItf, &prefetchStatus);
timeOutIndex--;
}
if (timeOutIndex == 0 || prefetchError) {
fprintf(stderr, "We\'re done waiting, failed to prefetch data in time, exiting\n");
goto destroyRes;
}
/* Display duration again, */
res = (*playItf)->GetDuration(playItf, &durationInMsec);
CheckErr(res);
if (durationInMsec == SL_TIME_UNKNOWN) {
fprintf(stdout, "Content duration is unknown (after prefetch completed)\n");
} else {
fprintf(stdout, "Content duration is %u ms (after prefetch completed)\n", durationInMsec);
}
fprintf(stdout, "URI example: starting to play\n");
res = (*playItf)->SetPlayState( playItf, SL_PLAYSTATE_PLAYING );
CheckErr(res);
#ifdef TEST_VOLUME_ITF
usleep(5*1000 * 1000);
fprintf(stdout, "setting vol to 0\n");
(*volItf)->SetVolumeLevel( volItf, 0);
usleep(3*1000 * 1000);
fprintf(stdout, "setting vol to -20dB\n");
(*volItf)->SetVolumeLevel( volItf, -2000);
usleep(3*1000 * 1000);
fprintf(stdout, "mute\n");
(*volItf)->SetMute( volItf, SL_BOOLEAN_TRUE);
usleep(3*1000 * 1000);
fprintf(stdout, "setting vol to 0dB while muted\n");
(*volItf)->SetVolumeLevel( volItf, 0);
usleep(3*1000 * 1000);
fprintf(stdout, "unmuting\n");
(*volItf)->SetMute( volItf, SL_BOOLEAN_FALSE);
usleep(3*1000 * 1000);
#endif
#ifndef TEST_COLD_START
usleep(durationInMsec * 1000);
#else
/* Wait as long as the duration of the content before stopping */
/* Experiment: wait for the duration + 200ms: with a cold start of the audio hardware, we */
/* won't see the SL_PLAYEVENT_HEADATEND event, due to hw wake up induced latency, but */
/* with a warm start it will be received. */
usleep((durationInMsec + 200) * 1000);
#endif
/* Make sure player is stopped */
fprintf(stdout, "URI example: stopping playback\n");
res = (*playItf)->SetPlayState(playItf, SL_PLAYSTATE_STOPPED);
CheckErr(res);
destroyRes:
/* Destroy the player */
(*player)->Destroy(player);
/* Destroy Output Mix object */
(*OutputMix)->Destroy(OutputMix);
}
//-----------------------------------------------------------------
int main(int argc, char* const argv[])
{
SLresult res;
SLObjectItf sl;
fprintf(stdout, "OpenSL ES test %s: exercises SLPlayItf, SLVolumeItf ", argv[0]);
fprintf(stdout, "and AudioPlayer with SLDataLocator_URI source / OutputMix sink\n");
fprintf(stdout, "Plays a sound and stops after its reported duration\n\n");
if (argc == 1) {
fprintf(stdout, "Usage: %s path \n\t%s url\n", argv[0], argv[0]);
fprintf(stdout, "Example: \"%s /sdcard/my.mp3\" or \"%s file:///sdcard/my.mp3\"\n",
argv[0], argv[0]);
exit(EXIT_FAILURE);
}
SLEngineOption EngineOption[] = {
{(SLuint32) SL_ENGINEOPTION_THREADSAFE,
(SLuint32) SL_BOOLEAN_TRUE}};
res = slCreateEngine( &sl, 1, EngineOption, 0, NULL, NULL);
CheckErr(res);
/* Realizing the SL Engine in synchronous mode. */
res = (*sl)->Realize(sl, SL_BOOLEAN_FALSE);
CheckErr(res);
TestPlayUri(sl, argv[1]);
/* Shutdown OpenSL ES */
(*sl)->Destroy(sl);
return EXIT_SUCCESS;
}
| {
"content_hash": "4b6264b27797effd094bfc86e092f7ab",
"timestamp": "",
"source": "github",
"line_count": 341,
"max_line_length": 98,
"avg_line_length": 35.6950146627566,
"alnum_prop": 0.6298882681564246,
"repo_name": "indashnet/InDashNet.Open.UN2000",
"id": "19fcb53cb1a58acaceab1d58cf743f827ca2ffb3",
"size": "12791",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "android/frameworks/wilhelm/tests/mimeUri/slesTestPlayUri.cpp",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
package org.jetbrains.plugins.groovy.lang.psi.api.statements;
import javax.annotation.Nonnull;
import com.intellij.psi.PsiType;
import com.intellij.util.ArrayFactory;
import org.jetbrains.annotations.NonNls;
import javax.annotation.Nullable;
import org.jetbrains.plugins.groovy.lang.psi.api.auxiliary.modifiers.GrModifier;
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrExpression;
import org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.members.GrMembersDeclaration;
import org.jetbrains.plugins.groovy.lang.psi.api.types.GrTypeElement;
/**
* @author: Dmitry.Krasilschikov
* @date: 27.03.2007
*/
public interface GrVariableDeclaration extends GrStatement, GrMembersDeclaration {
ArrayFactory<GrVariableDeclaration> ARRAY_FACTORY = new ArrayFactory<GrVariableDeclaration>() {
@Nonnull
@Override
public GrVariableDeclaration[] create(int count) {
return new GrVariableDeclaration[count];
}
};
@Nullable
GrTypeElement getTypeElementGroovy();
@Nonnull
GrVariable[] getVariables();
void setType(@javax.annotation.Nullable PsiType type);
boolean isTuple();
@Nullable
GrTypeElement getTypeElementGroovyForVariable(GrVariable var);
@Nullable
GrExpression getTupleInitializer();
@Override
boolean hasModifierProperty(@GrModifier.GrModifierConstant @NonNls @Nonnull String name);
}
| {
"content_hash": "e645ab0679608caefdec1b1657f905de",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 97,
"avg_line_length": 29.91304347826087,
"alnum_prop": 0.7936046511627907,
"repo_name": "consulo/consulo-groovy",
"id": "dea3c58b3926ec7337cb38aaff36ca37562d256b",
"size": "1376",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "groovy-psi/src/main/java/org/jetbrains/plugins/groovy/lang/psi/api/statements/GrVariableDeclaration.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Groovy",
"bytes": "902456"
},
{
"name": "HTML",
"bytes": "67017"
},
{
"name": "Java",
"bytes": "7813970"
},
{
"name": "Lex",
"bytes": "61130"
}
],
"symlink_target": ""
} |
'use strict';
var benchmark = require('benchmark');
var bitcore = require('..');
var bitcoinjs = require('bitcoinjs-lib');
var bcoin = require('bcoin');
var async = require('async');
var fullnode = require('fullnode');
var blockData = require('./block-357238.json');
var maxTime = 20;
console.log('Benchmarking Block/Transaction Serialization');
console.log('---------------------------------------');
async.series([
function(next) {
var buffers = [];
var hashBuffers = [];
console.log('Generating Random Test Data...');
for (var i = 0; i < 100; i++) {
// uint64le
var br = new bitcore.encoding.BufferWriter();
var num = Math.round(Math.random() * 10000000000000);
br.writeUInt64LEBN(new bitcore.crypto.BN(num));
buffers.push(br.toBuffer());
// hashes
var data = bitcore.crypto.Hash.sha256sha256(new Buffer(32));
hashBuffers.push(data);
}
var c = 0;
var bn;
function readUInt64LEBN() {
if (c >= buffers.length) {
c = 0;
}
var buf = buffers[c];
var br = new bitcore.encoding.BufferReader(buf);
bn = br.readUInt64LEBN();
c++;
}
var reversed;
function readReverse() {
if (c >= hashBuffers.length) {
c = 0;
}
var buf = hashBuffers[c];
var br = new bitcore.encoding.BufferReader(buf);
reversed = br.readReverse();
c++;
}
console.log('Starting benchmark...');
var suite = new benchmark.Suite();
suite.add('bufferReader.readUInt64LEBN()', readUInt64LEBN, {maxTime: maxTime});
suite.add('bufferReader.readReverse()', readReverse, {maxTime: maxTime});
suite
.on('cycle', function(event) {
console.log(String(event.target));
})
.on('complete', function() {
console.log('Done');
console.log('----------------------------------------------------------------------');
next();
})
.run();
},
function(next) {
var block1;
var block2;
var block3;
function bitcoreTest() {
block1 = bitcore.Block.fromString(blockData);
}
function bitcoinjsTest() {
block2 =bitcoinjs .Block.fromHex(blockData);
}
var parser = new bcoin.protocol.parser();
function bcoinTest() {
var raw = bcoin.utils.toArray(blockData, 'hex');
var data = parser.parseBlock(raw);
block3 = new bcoin.block(data, 'block');
}
var blockDataMessage = '0000000000000000' + blockData; // add mock leading magic and size
function fullnodeTest() {
fullnode.Block().fromHex(blockDataMessage);
}
var suite = new benchmark.Suite();
suite.add('bitcore', bitcoreTest, {maxTime: maxTime});
suite.add('bitcoinjs',bitcoinjsTest , {maxTime: maxTime});
suite.add('bcoin', bcoinTest, {maxTime: maxTime});
suite.add('fullnode', fullnodeTest, {maxTime: maxTime});
suite
.on('cycle', function(event) {
console.log(String(event.target));
})
.on('complete', function() {
console.log('Fastest is ' + this.filter('fastest').pluck('name'));
console.log('----------------------------------------------------------------------');
next();
})
.run();
}
], function(err) {
console.log('Finished');
});
| {
"content_hash": "15c9c97c79c38858840b95457f32416f",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 94,
"avg_line_length": 27.0327868852459,
"alnum_prop": 0.5609460278956944,
"repo_name": "bitcoremgv/bitcoremgv",
"id": "823912695a37e4ccce174ae22ed2f26526e6bbc7",
"size": "3298",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "bitcoremgv/benchmark/serialization.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "576"
},
{
"name": "JavaScript",
"bytes": "746987"
},
{
"name": "Roff",
"bytes": "15"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Globalization;
using System.Linq;
using System.Windows.Forms;
using Palaso.Reporting;
using Palaso.WritingSystems;
using Palaso.UI.WindowsForms.Keyboarding.Interfaces;
using Palaso.UI.WindowsForms.Keyboarding.InternalInterfaces;
#if __MonoCS__
using Palaso.UI.WindowsForms.Keyboarding.Linux;
#else
using Palaso.UI.WindowsForms.Keyboarding.Windows;
#endif
using Palaso.UI.WindowsForms.Keyboarding.Types;
namespace Palaso.UI.WindowsForms.Keyboarding
{
/// <summary>
/// Singleton class with methods for registering different keyboarding engines (e.g. Windows
/// system, Keyman, XKB, IBus keyboards), and activating keyboards.
/// Clients have to call KeyboardController.Initialize() before they can start using the
/// keyboarding functionality, and they have to call KeyboardController.Shutdown() before
/// the application or the unit test exits.
/// </summary>
public static class KeyboardController
{
#region Nested Manager class
/// <summary>
/// Allows setting different keyboard adapters which is needed for tests. Also allows
/// registering keyboard layouts.
/// </summary>
public static class Manager
{
/// <summary>
/// Sets the available keyboard adaptors. Note that if this is called more than once, the adapters
/// installed previously will be closed and no longer useable. Do not pass adapter instances that have been
/// previously passed. At least one adapter must be of type System.
/// </summary>
public static void SetKeyboardAdaptors(IKeyboardAdaptor[] adaptors)
{
if (!(Keyboard.Controller is IKeyboardControllerImpl))
Keyboard.Controller = new KeyboardControllerImpl();
Instance.Keyboards.Clear(); // InitializeAdaptors below will fill it in again.
if (Adaptors != null)
{
foreach (var adaptor in Adaptors)
adaptor.Close();
}
Adaptors = adaptors;
InitializeAdaptors();
}
/// <summary>
/// Resets the keyboard adaptors to the default ones.
/// </summary>
public static void Reset()
{
SetKeyboardAdaptors(new IKeyboardAdaptor[] {
#if __MonoCS__
new XkbKeyboardAdaptor(), new IbusKeyboardAdaptor(), new CombinedKeyboardAdaptor(),
new CinnamonIbusAdaptor()
#else
new WinKeyboardAdaptor(), new KeymanKeyboardAdaptor(),
#endif
});
}
public static void InitializeAdaptors()
{
// this will also populate m_keyboards
foreach (var adaptor in Adaptors)
adaptor.Initialize();
}
/// <summary>
/// Adds a keyboard to the list of installed keyboards
/// </summary>
/// <param name='description'>Keyboard description object</param>
public static void RegisterKeyboard(IKeyboardDefinition description)
{
if (!Instance.Keyboards.Contains(description))
Instance.Keyboards.Add(description);
}
internal static void ClearAllKeyboards()
{
Instance.Keyboards.Clear();
}
}
#endregion
#region Class KeyboardControllerImpl
private sealed class KeyboardControllerImpl : IKeyboardController, IKeyboardControllerImpl, IDisposable
{
private List<string> LanguagesAlreadyShownKeyboardNotFoundMessages { get; set; }
private IKeyboardDefinition m_ActiveKeyboard;
public KeyboardCollection Keyboards { get; private set; }
public Dictionary<Control, object> EventHandlers { get; private set; }
public event RegisterEventHandler ControlAdded;
public event ControlEventHandler ControlRemoving;
public KeyboardControllerImpl()
{
Keyboards = new KeyboardCollection();
EventHandlers = new Dictionary<Control, object>();
LanguagesAlreadyShownKeyboardNotFoundMessages = new List<string>();
}
public void UpdateAvailableKeyboards()
{
Keyboards.Clear();
foreach (var adapter in Adaptors)
adapter.UpdateAvailableKeyboards();
}
#region Disposable stuff
#if DEBUG
/// <summary/>
~KeyboardControllerImpl()
{
Dispose(false);
}
#endif
/// <summary/>
public bool IsDisposed { get; private set; }
/// <summary/>
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
/// <summary/>
private void Dispose(bool fDisposing)
{
System.Diagnostics.Debug.WriteLineIf(!fDisposing,
"****** Missing Dispose() call for " + GetType() + ". *******");
if (fDisposing && !IsDisposed)
{
// dispose managed and unmanaged objects
if (Adaptors != null)
{
foreach (var adaptor in Adaptors)
adaptor.Close();
Adaptors = null;
}
}
IsDisposed = true;
}
#endregion
public IKeyboardDefinition DefaultKeyboard
{
get { return Adaptors.First(adaptor => adaptor.Type == KeyboardType.System).DefaultKeyboard; }
}
public IKeyboardDefinition GetKeyboard(string layoutNameWithLocale)
{
if (string.IsNullOrEmpty(layoutNameWithLocale))
return KeyboardDescription.Zero;
if (Keyboards.Contains(layoutNameWithLocale))
return Keyboards[layoutNameWithLocale];
var parts = layoutNameWithLocale.Split('|');
if (parts.Length == 2)
{
// This is the way Paratext stored IDs in 7.4-7.5 while there was a temporary bug-fix in place)
return GetKeyboard(parts[0], parts[1]);
}
// Handle old Palaso IDs
parts = layoutNameWithLocale.Split('-');
if (parts.Length > 1)
{
for (int i = 1; i < parts.Length; i++)
{
var kb = GetKeyboard(string.Join("-", parts.Take(i)), string.Join("-", parts.Skip(i)));
if (!kb.Equals(KeyboardDescription.Zero))
return kb;
}
}
return KeyboardDescription.Zero;
}
public IKeyboardDefinition GetKeyboard(string layoutName, string locale)
{
if (string.IsNullOrEmpty(layoutName) && string.IsNullOrEmpty(locale))
return KeyboardDescription.Zero;
return Keyboards.Contains(layoutName, locale) ?
Keyboards[layoutName, locale] : KeyboardDescription.Zero;
}
/// <summary>
/// Tries to get the keyboard for the specified <paramref name="writingSystem"/>.
/// </summary>
/// <returns>
/// Returns <c>KeyboardDescription.Zero</c> if no keyboard can be found.
/// </returns>
public IKeyboardDefinition GetKeyboard(IWritingSystemDefinition writingSystem)
{
if (writingSystem == null)
return KeyboardDescription.Zero;
return writingSystem.LocalKeyboard ?? KeyboardDescription.Zero;
}
public IKeyboardDefinition GetKeyboard(IInputLanguage language)
{
// NOTE: on Windows InputLanguage.LayoutName returns a wrong name in some cases.
// Therefore we need this overload so that we can identify the keyboard correctly.
return Keyboards
.Where(keyboard => keyboard is KeyboardDescription &&
((KeyboardDescription)keyboard).InputLanguage != null &&
((KeyboardDescription)keyboard).InputLanguage.Equals(language))
.DefaultIfEmpty(KeyboardDescription.Zero)
.First();
}
/// <summary>
/// Sets the keyboard.
/// </summary>
/// <param name='layoutName'>Keyboard layout name</param>
public void SetKeyboard(string layoutName)
{
var keyboard = GetKeyboard(layoutName);
if (keyboard.Equals(KeyboardDescription.Zero))
{
if (!LanguagesAlreadyShownKeyboardNotFoundMessages.Contains(layoutName))
{
LanguagesAlreadyShownKeyboardNotFoundMessages.Add(layoutName);
ErrorReport.NotifyUserOfProblem(new ShowOncePerSessionBasedOnExactMessagePolicy(),
"Could not find a keyboard ime that had a keyboard named '{0}'", layoutName);
}
return;
}
SetKeyboard(keyboard);
}
public void SetKeyboard(string layoutName, string locale)
{
SetKeyboard(GetKeyboard(layoutName, locale));
}
public void SetKeyboard(IWritingSystemDefinition writingSystem)
{
SetKeyboard(writingSystem.LocalKeyboard);
}
public void SetKeyboard(IInputLanguage language)
{
SetKeyboard(GetKeyboard(language));
}
public void SetKeyboard(IKeyboardDefinition keyboard)
{
keyboard.Activate();
}
/// <summary>
/// Activates the keyboard of the default input language
/// </summary>
public void ActivateDefaultKeyboard()
{
if (CinnamonKeyboardHandling)
{
#if __MonoCS__
CinnamonIbusAdaptor wasta = Adaptors.First(adaptor => adaptor.GetType().ToString().Contains("CinnamonIbus")) as CinnamonIbusAdaptor;
wasta.ActivateDefaultKeyboard();
#endif
}
else
{
SetKeyboard(DefaultKeyboard);
}
}
/// <summary>
/// Returns everything that is installed on the system and available to be used.
/// This would typically be used to populate a list of available keyboards in configuring a writing system.
/// </summary>
public IEnumerable<IKeyboardDefinition> AllAvailableKeyboards
{
get { return Keyboards; }
}
/// <summary>
/// Creates and returns a keyboard definition object based on the layout and locale.
/// </summary>
public IKeyboardDefinition CreateKeyboardDefinition(string layout, string locale)
{
var existingKeyboard = AllAvailableKeyboards.FirstOrDefault(keyboard => keyboard.Layout == layout && keyboard.Locale == locale);
return existingKeyboard ??
Adaptors.First(adaptor => adaptor.Type == KeyboardType.System)
.CreateKeyboardDefinition(layout, locale);
}
/// <summary>
/// Gets or sets the currently active keyboard
/// </summary>
public IKeyboardDefinition ActiveKeyboard
{
get
{
if (m_ActiveKeyboard == null)
{
try
{
var lang = InputLanguage.CurrentInputLanguage;
m_ActiveKeyboard = GetKeyboard(lang.LayoutName, lang.Culture.Name);
}
catch (CultureNotFoundException)
{
}
if (m_ActiveKeyboard == null)
m_ActiveKeyboard = KeyboardDescription.Zero;
}
return m_ActiveKeyboard;
}
set { m_ActiveKeyboard = value; }
}
/// <summary>
/// Figures out the system default keyboard for the specified writing system (the one to use if we have no available KnownKeyboards).
/// The implementation may use obsolete fields such as Keyboard
/// </summary>
public IKeyboardDefinition DefaultForWritingSystem(IWritingSystemDefinition ws)
{
return LegacyForWritingSystem(ws) ?? DefaultKeyboard;
}
/// <summary>
/// Finds a keyboard specified using one of the legacy fields. If such a keyboard is found, it is appropriate to
/// automatically add it to KnownKeyboards. If one is not, a general DefaultKeyboard should NOT be added.
/// </summary>
/// <param name="ws"></param>
/// <returns></returns>
public IKeyboardDefinition LegacyForWritingSystem(IWritingSystemDefinition ws)
{
var legacyWs = ws as ILegacyWritingSystemDefinition;
if (legacyWs == null)
return DefaultKeyboard;
return LegacyKeyboardHandling.GetKeyboardFromLegacyWritingSystem(legacyWs, this);
}
/// <summary>
/// Registers the control for keyboarding. Called by KeyboardController.Register.
/// </summary>
public void RegisterControl(Control control, object eventHandler)
{
EventHandlers[control] = eventHandler;
if (ControlAdded != null)
ControlAdded(this, new RegisterEventArgs(control, eventHandler));
}
/// <summary>
/// Unregisters the control from keyboarding. Called by KeyboardController.Unregister.
/// </summary>
/// <param name="control">Control.</param>
public void UnregisterControl(Control control)
{
if (ControlRemoving != null)
ControlRemoving(this, new ControlEventArgs(control));
EventHandlers.Remove(control);
}
#region Legacy keyboard handling
private static class LegacyKeyboardHandling
{
public static IKeyboardDefinition GetKeyboardFromLegacyWritingSystem(ILegacyWritingSystemDefinition ws,
KeyboardControllerImpl controller)
{
if (!string.IsNullOrEmpty(ws.WindowsLcid))
{
var keyboard = HandleFwLegacyKeyboards(ws, controller);
if (keyboard != null)
return keyboard;
}
if (!string.IsNullOrEmpty(ws.Keyboard))
{
if (controller.Keyboards.Contains(ws.Keyboard))
return controller.Keyboards[ws.Keyboard];
// Palaso WinIME keyboard
var locale = GetLocaleName(ws.Keyboard);
var layout = GetLayoutName(ws.Keyboard);
if (controller.Keyboards.Contains(layout, locale))
return controller.Keyboards[layout, locale];
// Palaso Keyman or Ibus keyboard
var keyboard = controller.Keyboards.FirstOrDefault(kbd => kbd.Layout == layout);
if (keyboard != null)
return keyboard;
}
return null;
}
private static IKeyboardDefinition HandleFwLegacyKeyboards(ILegacyWritingSystemDefinition ws,
KeyboardControllerImpl controller)
{
var lcid = GetLcid(ws);
if (lcid >= 0)
{
try
{
if (string.IsNullOrEmpty(ws.Keyboard))
{
// FW system keyboard
var keyboard = controller.Keyboards.FirstOrDefault(
kbd =>
{
var keyboardDescription = kbd as KeyboardDescription;
if (keyboardDescription == null || keyboardDescription.InputLanguage == null || keyboardDescription.InputLanguage.Culture == null)
return false;
return keyboardDescription.InputLanguage.Culture.LCID == lcid;
});
if (keyboard != null)
return keyboard;
}
else
{
// FW keyman keyboard
var culture = new CultureInfo(lcid);
if (controller.Keyboards.Contains(ws.Keyboard, culture.Name))
return controller.Keyboards[ws.Keyboard, culture.Name];
}
}
catch (CultureNotFoundException)
{
// Culture specified by LCID is not supported on current system. Just ignore.
}
}
return null;
}
private static int GetLcid(ILegacyWritingSystemDefinition ws)
{
int lcid;
if (!Int32.TryParse(ws.WindowsLcid, out lcid))
lcid = -1; // can't convert ws.WindowsLcid to a valid LCID. Just ignore.
return lcid;
}
private static string GetLocaleName(string name)
{
var split = name.Split(new[] { '-' });
string localeName;
if (split.Length <= 1)
{
localeName = string.Empty;
}
else if (split.Length > 1 && split.Length <= 3)
{
localeName = string.Join("-", split.Skip(1).ToArray());
}
else
{
localeName = string.Join("-", split.Skip(split.Length - 2).ToArray());
}
return localeName;
}
private static string GetLayoutName(string name)
{
//Just cut off the length of the locale + 1 for the dash
var locale = GetLocaleName(name);
if (string.IsNullOrEmpty(locale))
{
return name;
}
var layoutName = name.Substring(0, name.Length - (locale.Length + 1));
return layoutName;
}
}
#endregion
}
#endregion
#region Static methods and properties
/// <summary>
/// Gets the current keyboard controller singleton.
/// </summary>
private static IKeyboardControllerImpl Instance
{
get
{
return Keyboard.Controller as IKeyboardControllerImpl;
}
}
/// <summary>
/// Enables the PalasoUIWinForms keyboarding. This should be called during application startup.
/// </summary>
public static void Initialize()
{
// Note: arguably it is undesirable to install this as the public keyboard controller before we initialize it
// (the Reset call). However, we have not in general attempted thread safety for the keyboarding code; it seems
// highly unlikely that any but the UI thread wants to manipulate keyboards. Apart from other threads, nothing
// has a chance to access this before we return. If initialization does not complete successfully, we clear the
// global.
try
{
Keyboard.Controller = new KeyboardControllerImpl();
Manager.Reset();
}
catch (Exception)
{
Keyboard.Controller = null;
throw;
}
}
/// <summary>
/// Ends support for the PalasoUIWinForms keyboarding
/// </summary>
public static void Shutdown()
{
if (Instance == null)
return;
Instance.Dispose();
Keyboard.Controller = null;
}
/// <summary>
/// Gets or sets the available keyboard adaptors.
/// </summary>
internal static IKeyboardAdaptor[] Adaptors { get; private set; }
#if __MonoCS__
/// <summary>
/// Flag that Linux is using the combined keyboard handling (Ubuntu saucy/trusty/later?)
/// </summary>
public static bool CombinedKeyboardHandling { get; internal set; }
#endif
/// <summary>
/// Flag that Linux is Wasta-14 (Mint 17/Cinnamon) using IBus for keyboarding.
/// </summary>
public static bool CinnamonKeyboardHandling { get; internal set; }
/// <summary>
/// Gets the currently active keyboard
/// </summary>
public static IKeyboardDefinition ActiveKeyboard
{
get { return Instance.ActiveKeyboard; }
}
/// <summary>
/// Returns <c>true</c> if KeyboardController.Initialize() got called before.
/// </summary>
public static bool IsInitialized { get { return Instance != null; }}
/// <summary>
/// Register the control for keyboarding, optionally providing an event handler for
/// a keyboarding adapter. If <paramref ref="eventHandler"/> is <c>null</c> the
/// default handler will be used.
/// The application should call this method for each control that needs IME input before
/// displaying the control, typically after calling the InitializeComponent() method.
/// </summary>
public static void Register(Control control, object eventHandler = null)
{
if (Instance == null)
throw new ApplicationException("KeyboardController is not initialized! Please call KeyboardController.Initialize() first.");
Instance.RegisterControl(control, eventHandler);
}
/// <summary>
/// Unregister the control from keyboarding. The application should call this method
/// prior to disposing the control so that the keyboard adapters can release unmanaged
/// resources.
/// </summary>
public static void Unregister(Control control)
{
Instance.UnregisterControl(control);
}
internal static IKeyboardControllerImpl EventProvider
{
get { return Instance; }
}
#endregion
}
}
| {
"content_hash": "bd0cb0e3b4cfbbdd0a4aac847b240980",
"timestamp": "",
"source": "github",
"line_count": 600,
"max_line_length": 140,
"avg_line_length": 30.441666666666666,
"alnum_prop": 0.6860662469203395,
"repo_name": "darcywong00/libpalaso",
"id": "913562cc04d7da4b2e5c54a8f6c52e9e57328e90",
"size": "18761",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "PalasoUIWindowsForms/Keyboarding/KeyboardController.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "5461279"
},
{
"name": "Makefile",
"bytes": "529"
},
{
"name": "Python",
"bytes": "7859"
},
{
"name": "Shell",
"bytes": "15792"
},
{
"name": "XSLT",
"bytes": "22208"
}
],
"symlink_target": ""
} |
(function() {
Showcase.ShowComponentsListGroupController = Ember.Controller.extend({
listSimple: Ember.A(['Cras justo odio', 'Dapibus ac facilisis in', 'Morbi leo risus']),
listWithBadges: Ember.A([
Ember.Object.create({
title: 'Inbox',
badge: '45'
}), Ember.Object.create({
title: 'Sent',
badge: '33'
})
]),
listWithSub: Ember.A([
Ember.Object.create({
title: 'Inbox',
sub: 'Incoming mails folder',
badge: '45'
}), Ember.Object.create({
title: 'Sent',
sub: 'Sent emails folder',
badge: '33'
})
])
});
}).call(this);
| {
"content_hash": "f33efd9a0a60aaeeeaff2818321efc62",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 91,
"avg_line_length": 25.307692307692307,
"alnum_prop": 0.5349544072948328,
"repo_name": "vsymguysung/bootstrap-for-ember-no-coffeescript",
"id": "f8f62f00c0df10134041ca44cdafc2162a3f54f3",
"size": "658",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/scripts/showcase/controllers/ShowcaseComponentsListGroupController.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "2379"
},
{
"name": "JavaScript",
"bytes": "254049"
}
],
"symlink_target": ""
} |
<?php
namespace prgTW\BaseCRM\Service;
use prgTW\BaseCRM\Resource\InstanceResource;
class Reminder extends InstanceResource
{
/** {@inheritdoc} */
protected function getEndpoint()
{
return self::ENDPOINT_SALES;
}
/** {@inheritdoc} */
public function save(array $fieldNames = [])
{
$fieldNames = array_intersect($fieldNames, [
'content',
'done',
'remind',
'date',
'hour',
]);
return parent::save($fieldNames);
}
}
| {
"content_hash": "2f19aeaacebbb434d351eef5291a7274",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 46,
"avg_line_length": 16.035714285714285,
"alnum_prop": 0.6570155902004454,
"repo_name": "prgTW/basecrm-php-api",
"id": "2c881edd7d10b5192a76a13dc2a982a80453fcc0",
"size": "449",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Service/Reminder.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "85705"
}
],
"symlink_target": ""
} |
function HomeController()
{
// bind event listeners to button clicks //
var that = this;
// handle user logout //
$('#btn-logout').click(function(){ that.attemptLogout(); });
// confirm account deletion //
$('#account-form-btn1').click(function(){$('.modal-confirm').modal('show')});
// handle account deletion //
$('.modal-confirm .submit').click(function(){ that.deleteAccount(); });
var gotoLogin = function(){window.location.href = '/';};
this.deleteAccount = function()
{
$('.modal-confirm').modal('hide');
var that = this;
$.ajax({
url: '/delete',
type: 'POST',
data: { id: $('#userId').val()},
success: function(data){
that.showLockedAlert('Your account has been deleted.<br>Redirecting you back to the homepage.', gotoLogin);
setTimeout(gotoLogin, 3000);
},
error: function(jqXHR){
console.log(jqXHR.responseText+' :: '+jqXHR.statusText);
}
});
}
this.attemptLogout = function()
{
console.log('Attempting logout');
var that = this;
that.showLockedAlert('Logging out.');
$.ajax({
url: "/home",
type: "POST",
data: {logout : true},
success: function(data){
that.showLockedAlert('You are now logged out.<br>Redirecting you back to the homepage.', gotoLogin);
setTimeout(gotoLogin, 3000);
},
error: function(jqXHR){
console.log(jqXHR.responseText+' :: '+jqXHR.statusText);
}
});
}
this.showLockedAlert = function(msg, okCallback){
$('.modal-alert').modal({ show : false, keyboard : false, backdrop : 'static' });
$('.modal-alert .modal-header h3').text('Success!');
$('.modal-alert .modal-body p').html(msg);
$('.modal-alert').modal('show');
okCallback && $('.modal-alert button').click(okCallback);
}
}
HomeController.prototype.onUpdateSuccess = function()
{
$('.modal-alert').modal({ show : false, keyboard : true, backdrop : true });
$('.modal-alert .modal-header h3').text('Success!');
$('.modal-alert .modal-body p').html('Your account has been updated.');
$('.modal-alert').modal('show');
$('.modal-alert button').off('click');
}
| {
"content_hash": "26c262dff701fa27452933c6f21c126a",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 112,
"avg_line_length": 29.112676056338028,
"alnum_prop": 0.6366715045960329,
"repo_name": "Glavin001/smucs",
"id": "af340f23f7083fee4792cdca44523fb2775c4ff3",
"size": "2068",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/public/js/controllers/homeController.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "41008"
},
{
"name": "Python",
"bytes": "393225"
}
],
"symlink_target": ""
} |
package content
import (
"bytes"
"compress/gzip"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net/url"
"strings"
"sync"
"github.com/Masterminds/semver/v3"
"github.com/rancher/rancher/pkg/api/steve/catalog/types"
v1 "github.com/rancher/rancher/pkg/apis/catalog.cattle.io/v1"
"github.com/rancher/rancher/pkg/catalogv2"
"github.com/rancher/rancher/pkg/catalogv2/git"
"github.com/rancher/rancher/pkg/catalogv2/helm"
helmhttp "github.com/rancher/rancher/pkg/catalogv2/http"
catalogcontrollers "github.com/rancher/rancher/pkg/generated/controllers/catalog.cattle.io/v1"
"github.com/rancher/rancher/pkg/settings"
corecontrollers "github.com/rancher/wrangler/pkg/generated/controllers/core/v1"
"github.com/rancher/wrangler/pkg/schemas/validation"
"github.com/sirupsen/logrus"
"helm.sh/helm/v3/pkg/repo"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/discovery"
)
type Manager struct {
configMaps corecontrollers.ConfigMapCache
secrets corecontrollers.SecretCache
clusterRepos catalogcontrollers.ClusterRepoCache
discovery discovery.DiscoveryInterface
IndexCache map[string]indexCache
lock sync.RWMutex
}
type indexCache struct {
index *repo.IndexFile
revision string
}
func NewManager(
discovery discovery.DiscoveryInterface,
configMaps corecontrollers.ConfigMapCache,
secrets corecontrollers.SecretCache,
clusterRepos catalogcontrollers.ClusterRepoCache) *Manager {
return &Manager{
discovery: discovery,
configMaps: configMaps,
secrets: secrets,
clusterRepos: clusterRepos,
IndexCache: map[string]indexCache{},
}
}
type repoDef struct {
typedata *metav1.TypeMeta
metadata *metav1.ObjectMeta
spec *v1.RepoSpec
status *v1.RepoStatus
}
func (c *Manager) getRepo(namespace, name string) (repoDef, error) {
if namespace == "" {
cr, err := c.clusterRepos.Get(name)
if err != nil {
return repoDef{}, err
}
return repoDef{
typedata: &cr.TypeMeta,
metadata: &cr.ObjectMeta,
spec: &cr.Spec,
status: &cr.Status,
}, nil
}
panic("namespace should never be empty")
}
func (c *Manager) readBytes(cm *corev1.ConfigMap) ([]byte, error) {
var (
bytes = cm.BinaryData["content"]
err error
)
for {
next := cm.Annotations["catalog.cattle.io/next"]
if next == "" {
break
}
cm, err = c.configMaps.Get(cm.Namespace, next)
if err != nil {
return nil, err
}
bytes = append(bytes, cm.BinaryData["content"]...)
}
return bytes, nil
}
func (c *Manager) Index(namespace, name string, skipFilter bool) (*repo.IndexFile, error) {
r, err := c.getRepo(namespace, name)
if err != nil {
return nil, err
}
cm, err := c.configMaps.Get(r.status.IndexConfigMapNamespace, r.status.IndexConfigMapName)
if err != nil {
return nil, err
}
k8sVersion, err := c.k8sVersion()
if err != nil {
return nil, err
}
c.lock.RLock()
if cache, ok := c.IndexCache[fmt.Sprintf("%s/%s", r.status.IndexConfigMapNamespace, r.status.IndexConfigMapName)]; ok {
if cm.ResourceVersion == cache.revision {
c.lock.RUnlock()
return c.filterReleases(deepCopyIndex(cache.index), k8sVersion, skipFilter), nil
}
}
c.lock.RUnlock()
if len(cm.OwnerReferences) == 0 || cm.OwnerReferences[0].UID != r.metadata.UID {
return nil, validation.Unauthorized
}
data, err := c.readBytes(cm)
if err != nil {
return nil, err
}
gz, err := gzip.NewReader(bytes.NewBuffer(data))
if err != nil {
return nil, err
}
defer gz.Close()
data, err = ioutil.ReadAll(gz)
if err != nil {
return nil, err
}
index := &repo.IndexFile{}
if err := json.Unmarshal(data, index); err != nil {
return nil, err
}
c.lock.Lock()
c.IndexCache[fmt.Sprintf("%s/%s", r.status.IndexConfigMapNamespace, r.status.IndexConfigMapName)] = indexCache{
index: index,
revision: cm.ResourceVersion,
}
c.lock.Unlock()
return c.filterReleases(deepCopyIndex(index), k8sVersion, skipFilter), nil
}
func (c *Manager) k8sVersion() (*semver.Version, error) {
info, err := c.discovery.ServerVersion()
if err != nil {
return nil, err
}
return semver.NewVersion(info.GitVersion)
}
func deepCopyIndex(src *repo.IndexFile) *repo.IndexFile {
deepcopy := repo.IndexFile{
APIVersion: src.APIVersion,
Generated: src.Generated,
Entries: map[string]repo.ChartVersions{},
}
keys := deepcopy.PublicKeys
copy(keys, src.PublicKeys)
for k, entries := range src.Entries {
for _, chart := range entries {
cpMeta := *chart.Metadata
cpChart := &repo.ChartVersion{
Metadata: &cpMeta,
Created: chart.Created,
Removed: chart.Removed,
Digest: chart.Digest,
URLs: make([]string, len(chart.URLs)),
}
copy(cpChart.URLs, chart.URLs)
deepcopy.Entries[k] = append(deepcopy.Entries[k], cpChart)
}
}
return &deepcopy
}
func (c *Manager) filterReleases(index *repo.IndexFile, k8sVersion *semver.Version, skipFilter bool) *repo.IndexFile {
if !settings.IsRelease() || skipFilter {
return index
}
rancherVersion, err := semver.NewVersion(settings.ServerVersion.Get())
if err != nil {
logrus.Errorf("failed to parse server version %s: %v", settings.ServerVersion.Get(), err)
return index
}
rancherVersionWithoutPrerelease, err := rancherVersion.SetPrerelease("")
if err != nil {
logrus.Errorf("failed to remove prerelease from %s: %v", settings.ServerVersion.Get(), err)
return index
}
for rel, versions := range index.Entries {
newVersions := make([]*repo.ChartVersion, 0, len(versions))
for _, version := range versions {
if constraintStr, ok := version.Annotations["catalog.cattle.io/rancher-version"]; ok {
if constraint, err := semver.NewConstraint(constraintStr); err == nil {
satisfiesConstraint, errs := constraint.Validate(rancherVersion)
// Check if the reason for failure is because it is ignroing prereleases
constraintDoesNotMatchPrereleases := false
for _, err := range errs {
// Comes from error in https://github.com/Masterminds/semver/blob/60c7ae8a99210a90a9457d5de5f6dcbc4dab8e64/constraints.go#L93
if strings.Contains(err.Error(), "the constraint is only looking for release versions") {
constraintDoesNotMatchPrereleases = true
break
}
}
if constraintDoesNotMatchPrereleases {
satisfiesConstraint = constraint.Check(&rancherVersionWithoutPrerelease)
}
if !satisfiesConstraint {
continue
}
} else {
logrus.Errorf("failed to parse constraint version %s: %v", constraintStr, err)
}
}
if constraintStr, ok := version.Annotations["catalog.cattle.io/kube-version"]; ok {
if constraint, err := semver.NewConstraint(constraintStr); err == nil {
if !constraint.Check(k8sVersion) {
continue
}
} else {
logrus.Errorf("failed to parse constraint kube-version %s from annotation: %v", constraintStr, err)
}
}
if version.KubeVersion != "" {
if constraint, err := semver.NewConstraint(version.KubeVersion); err == nil {
if !constraint.Check(k8sVersion) {
continue
}
} else {
logrus.Errorf("failed to parse constraint for kubeversion %s: %v", version.KubeVersion, err)
}
}
newVersions = append(newVersions, version)
}
if len(newVersions) == 0 {
delete(index.Entries, rel)
} else {
index.Entries[rel] = newVersions
}
}
return index
}
func (c *Manager) Icon(namespace, name, chartName, version string) (io.ReadCloser, string, error) {
index, err := c.Index(namespace, name, true)
if err != nil {
return nil, "", err
}
chart, err := index.Get(chartName, version)
if err != nil {
return nil, "", err
}
repo, err := c.getRepo(namespace, name)
if err != nil {
return nil, "", err
}
if !isHTTP(chart.Icon) && repo.status.Commit != "" {
return git.Icon(namespace, name, repo.status.URL, chart)
}
secret, err := catalogv2.GetSecret(c.secrets, repo.spec, repo.metadata.Namespace)
if err != nil {
return nil, "", err
}
return helmhttp.Icon(secret, repo.status.URL, repo.spec.CABundle, repo.spec.InsecureSkipTLSverify, repo.spec.DisableSameOriginCheck, chart)
}
func isHTTP(iconURL string) bool {
u, err := url.Parse(iconURL)
return err == nil && (u.Scheme == "http" || u.Scheme == "https")
}
func (c *Manager) Chart(namespace, name, chartName, version string, skipFilter bool) (io.ReadCloser, error) {
index, err := c.Index(namespace, name, skipFilter)
if err != nil {
return nil, err
}
chart, err := index.Get(chartName, version)
if err != nil {
return nil, err
}
repo, err := c.getRepo(namespace, name)
if err != nil {
return nil, err
}
if repo.status.Commit != "" {
return git.Chart(namespace, name, repo.status.URL, chart)
}
secret, err := catalogv2.GetSecret(c.secrets, repo.spec, repo.metadata.Namespace)
if err != nil {
return nil, err
}
return helmhttp.Chart(secret, repo.status.URL, repo.spec.CABundle, repo.spec.InsecureSkipTLSverify, repo.spec.DisableSameOriginCheck, chart)
}
func (c *Manager) Info(namespace, name, chartName, version string) (*types.ChartInfo, error) {
chart, err := c.Chart(namespace, name, chartName, version, true)
if err != nil {
return nil, err
}
defer chart.Close()
return helm.InfoFromTarball(chart)
}
| {
"content_hash": "4160f61bbc69078abbe1137b03425647",
"timestamp": "",
"source": "github",
"line_count": 341,
"max_line_length": 141,
"avg_line_length": 27.058651026392962,
"alnum_prop": 0.6936165600953723,
"repo_name": "rancher/rancher",
"id": "62e0c03833c18ae5573cab08572df6938fe7434b",
"size": "9227",
"binary": false,
"copies": "1",
"ref": "refs/heads/release/v2.7",
"path": "pkg/catalogv2/content/content.go",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "395"
},
{
"name": "Dockerfile",
"bytes": "17618"
},
{
"name": "Go",
"bytes": "10336092"
},
{
"name": "Groovy",
"bytes": "119828"
},
{
"name": "HCL",
"bytes": "35182"
},
{
"name": "JavaScript",
"bytes": "609"
},
{
"name": "Jinja",
"bytes": "30303"
},
{
"name": "Makefile",
"bytes": "483"
},
{
"name": "Mustache",
"bytes": "2113"
},
{
"name": "PowerShell",
"bytes": "38206"
},
{
"name": "Python",
"bytes": "1720222"
},
{
"name": "Shell",
"bytes": "106041"
}
],
"symlink_target": ""
} |
package org.smartdeveloperhub.vocabulary.language.lexvo;
import java.io.IOException;
import java.io.StringReader;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import org.apache.jena.riot.RiotException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.smartdeveloperhub.vocabulary.language.lexvo.Chronographer.Task;
import org.smartdeveloperhub.vocabulary.language.spi.Language;
import org.smartdeveloperhub.vocabulary.language.spi.LanguageDataSource;
import org.smartdeveloperhub.vocabulary.language.spi.Tag;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import com.google.common.hash.Hashing;
import com.hp.hpl.jena.rdf.model.Literal;
import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory;
import com.hp.hpl.jena.rdf.model.Property;
import com.hp.hpl.jena.rdf.model.RDFNode;
import com.hp.hpl.jena.rdf.model.Resource;
import com.hp.hpl.jena.rdf.model.Statement;
import com.hp.hpl.jena.rdf.model.StmtIterator;
public final class LexvoDataSource implements LanguageDataSource {
private abstract static class TypeInspector implements Task<Void,RuntimeException> {
private final Model model;
private final String propertyName;
private TypeInspector(final Model model,final String propertyName) {
this.model = model;
this.propertyName = propertyName;
}
@Override
public Void execute() throws RuntimeException {
final StmtIterator iterator=
this.model.
listStatements(
null,
this.model.createProperty("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),
this.model.createProperty(this.propertyName));
try {
while(iterator.hasNext()) {
handler(iterator.next());
}
return null;
} finally {
iterator.close();
}
}
protected abstract void handler(Statement next);
}
private static final Logger LOGGER=LoggerFactory.getLogger(LexvoDataSource.class);
private final Map<Integer,Language> languages;
private final Map<Tag,Integer> tag2Language;
private String lexvoVersion;
private String lexvoSha256;
private String lexvoSha512;
public LexvoDataSource() {
this.languages=Maps.newLinkedHashMap();
this.tag2Language=Maps.newLinkedHashMap();
}
@Override
public String name() {
return "Lexvo";
}
@Override
public String version() {
return this.lexvoVersion;
}
@Override
public String sha512() {
return this.lexvoSha512;
}
@Override
public String sha256() {
return this.lexvoSha256;
}
@Override
public List<Language> languages() {
return ImmutableList.copyOf(this.languages.values());
}
public LexvoDataSource load(final String version, final Path input) throws IOException {
clean();
findLanguages(loadModel(version,input));
return this;
}
private void clean() {
this.lexvoVersion=null;
this.lexvoSha256=null;
this.lexvoSha512=null;
}
private Model loadModel(final String version,final Path input) throws IOException {
final byte[] rawData=readInput(input);
final String data=stringifyRawData(rawData);
final Model model=parseRDF(data);
this.lexvoVersion=version;
this.lexvoSha256=Hashing.sha256().hashBytes(rawData).toString();
this.lexvoSha512=Hashing.sha512().hashBytes(rawData).toString();
return model;
}
private void findLanguages(final Model model) {
new Chronographer("searching for languages").
time(
new TypeInspector(model,"lvont:Language") {
private int counter=0;
@Override
protected void handler(final Statement next) {
final Resource subject = next.getSubject();
if(subject.isAnon()) {
LOGGER.warn("Language cannot be an anonymous individual");
return;
}
final Set<Tag> tags=Sets.newTreeSet();
getTag(tags,subject,"http://lexvo.org/ontology#iso639P1Code",Tag.Part.ISO_639_1);
getTag(tags,subject,"http://lexvo.org/ontology#iso6392BCode",Tag.Part.ISO_639_2b);
getTag(tags,subject,"http://lexvo.org/ontology#iso6392TCode",Tag.Part.ISO_639_2t);
getTag(tags,subject,"http://lexvo.org/ontology#iso639P3PCode",Tag.Part.ISO_639_3);
getTag(tags,subject,"http://lexvo.org/ontology#iso639P5Code",Tag.Part.ISO_639_5);
if(tags.isEmpty()) {
LOGGER.warn("Language {} has no tags",subject.getURI());
return;
}
final Map<String, String> localizedNames = getLocalizedNames(subject);
if(localizedNames.isEmpty()) {
LOGGER.info("Language {} has no localized names",subject.getURI());
}
final Language language=
Language.
builder().
withId(this.counter++).
withTags(tags).
withLocalizedNames(localizedNames).
build();
for(final Tag tag:tags) {
LexvoDataSource.this.tag2Language.put(tag,language.id());
}
LexvoDataSource.this.languages.put(language.id(),language);
}
private void getTag(final Set<Tag> tags,final Resource resource,final String propertyName, final Tag.Part part) {
final Property tagProperty = resource.getModel().getProperty(propertyName);
final Statement property = resource.getProperty(tagProperty);
if(property!=null) {
final RDFNode object = property.getObject();
if(object.isLiteral()) {
final LexvoTag tag = LexvoTag.create(part,object.asLiteral().getString());
tags.add(tag);
}
}
}
private Map<String,String> getLocalizedNames(final Resource resource) {
final Property label = resource.getModel().getProperty("http://www.w3.org/2000/01/rdf-schema#label");
final StmtIterator iterator = resource.listProperties(label);
try {
final Map<String,String> localizations=Maps.newTreeMap();
while(iterator.hasNext()) {
final Statement next=iterator.next();
final RDFNode object=next.getObject();
if(!object.isLiteral()) {
continue;
}
final Literal literal=object.asLiteral();
final String language=literal.getLanguage();
if(language!=null) {
localizations.put(language,literal.getString());
}
}
return localizations;
} finally {
iterator.close();
}
}
}
);
}
private static String stringifyRawData(final byte[] content) {
return
new Chronographer("loading contents").
time(
new Task<String,RuntimeException>() {
@Override
public String execute() {
return new String(content,StandardCharsets.UTF_8);
}
}
);
}
private static byte[] readInput(final Path path) throws IOException {
return
new Chronographer("file reading").
onStart("path %s", path).
time(
new Task<byte[],IOException>() {
@Override
public byte[] execute() throws IOException {
return Files.readAllBytes(path);
}
}
);
}
private static Model parseRDF(final String data) {
return
new Chronographer("parsing contents").
timeIn(TimeUnit.SECONDS).
time(
new Task<Model,RiotException>() {
@Override
public Model execute() {
final Model model=ModelFactory.createDefaultModel();
model.read(new StringReader(data),"http://www.lexvo.org/","RDF/XML");
return model;
}
}
);
}
}
| {
"content_hash": "0543707b73de82af7764e196ba639b8f",
"timestamp": "",
"source": "github",
"line_count": 249,
"max_line_length": 118,
"avg_line_length": 29.823293172690764,
"alnum_prop": 0.6982224616213305,
"repo_name": "SmartDeveloperHub/sdh-vocabulary",
"id": "d5012e9739bbe54435a6d306259bc01b22c476c9",
"size": "8765",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/test/java/org/smartdeveloperhub/vocabulary/language/lexvo/LexvoDataSource.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "408400"
},
{
"name": "Shell",
"bytes": "7276"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="robots" content="index, follow, all" />
<title>Edujugon\Laradoo\Providers\OdooServiceProvider | Odoo ERP API for Laravel</title>
<link rel="stylesheet" type="text/css" href="../../../css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="../../../css/bootstrap-theme.min.css">
<link rel="stylesheet" type="text/css" href="../../../css/sami.css">
<script src="../../../js/jquery-1.11.1.min.js"></script>
<script src="../../../js/bootstrap.min.js"></script>
<script src="../../../js/typeahead.min.js"></script>
<script src="../../../sami.js"></script>
<meta name="MobileOptimized" content="width">
<meta name="HandheldFriendly" content="true">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1">
</head>
<body id="class" data-name="class:Edujugon_Laradoo_Providers_OdooServiceProvider" data-root-path="../../../">
<div id="content">
<div id="left-column">
<div id="control-panel">
<form action="#" method="GET">
<select id="version-switcher" name="version">
<option value="../../../../1.1.0/index.html" data-version="1.1.0">Laradoo 1.1.0</option>
<option value="../../../../master/index.html" data-version="master">Laradoo Master</option>
</select>
</form>
<script>
$('option[data-version="'+window.projectVersion+'"]').prop('selected', true);
</script>
<form id="search-form" action="../../../search.html" method="GET">
<span class="glyphicon glyphicon-search"></span>
<input name="search"
class="typeahead form-control"
type="search"
placeholder="Search">
</form>
</div>
<div id="api-tree"></div>
</div>
<div id="right-column">
<nav id="site-nav" class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-elements">
<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="../../../index.html">Odoo ERP API for Laravel</a>
</div>
<div class="collapse navbar-collapse" id="navbar-elements">
<ul class="nav navbar-nav">
<li><a href="../../../classes.html">Classes</a></li>
<li><a href="../../../namespaces.html">Namespaces</a></li>
<li><a href="../../../interfaces.html">Interfaces</a></li>
<li><a href="../../../traits.html">Traits</a></li>
<li><a href="../../../doc-index.html">Index</a></li>
<li><a href="../../../search.html">Search</a></li>
</ul>
</div>
</div>
</nav>
<div class="namespace-breadcrumbs">
<ol class="breadcrumb">
<li><span class="label label-default">class</span></li>
<li><a href="../../../Edujugon.html">Edujugon</a></li>
<li><a href="../../../Edujugon/Laradoo.html">Laradoo</a></li>
<li><a href="../../../Edujugon/Laradoo/Providers.html">Providers</a></li>
<li>OdooServiceProvider</li>
</ol>
</div>
<div id="page-content">
<div class="page-header">
<h1>
OdooServiceProvider
</h1>
</div>
<p> class
<strong>OdooServiceProvider</strong> extends <abbr title="Illuminate\Support\ServiceProvider">ServiceProvider</abbr> (<a href="https://github.com/edujugon/laradoo/blob/1.1.0/src/Providers/OdooServiceProvider.php">View source</a>)
</p>
<h2>Methods</h2>
<div class="container-fluid underlined">
<div class="row">
<div class="col-md-2 type">
void
</div>
<div class="col-md-8 type">
<a href="#method_boot">boot</a>()
<p>Bootstrap the application services.</p> </div>
<div class="col-md-2"></div>
</div>
<div class="row">
<div class="col-md-2 type">
void
</div>
<div class="col-md-8 type">
<a href="#method_register">register</a>()
<p>Register the application services.</p> </div>
<div class="col-md-2"></div>
</div>
</div>
<h2>Details</h2>
<div id="method-details">
<div class="method-item">
<h3 id="method_boot">
<div class="location">at <a href="https://github.com/edujugon/laradoo/blob/1.1.0/src/Providers/OdooServiceProvider.php#L15">line 15</a></div>
<code> void
<strong>boot</strong>()
</code>
</h3>
<div class="details">
<div class="method-description">
<p>Bootstrap the application services.</p> </div>
<div class="tags">
<h4>Return Value</h4>
<table class="table table-condensed">
<tr>
<td>void</td>
<td></td>
</tr>
</table>
</div>
</div>
</div>
<div class="method-item">
<h3 id="method_register">
<div class="location">at <a href="https://github.com/edujugon/laradoo/blob/1.1.0/src/Providers/OdooServiceProvider.php#L29">line 29</a></div>
<code> void
<strong>register</strong>()
</code>
</h3>
<div class="details">
<div class="method-description">
<p>Register the application services.</p> </div>
<div class="tags">
<h4>Return Value</h4>
<table class="table table-condensed">
<tr>
<td>void</td>
<td></td>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
<div id="footer">
Generated by <a href="http://sami.sensiolabs.org/">Sami, the API Documentation Generator</a>.
</div>
</div>
</div>
</body>
</html>
| {
"content_hash": "070ea554b4c901adb670d4a0d339177d",
"timestamp": "",
"source": "github",
"line_count": 203,
"max_line_length": 247,
"avg_line_length": 37.251231527093594,
"alnum_prop": 0.43149960327955567,
"repo_name": "Edujugon/laradoo",
"id": "b63e9e1823988705b33dc5e5d38125aada377bbb",
"size": "7562",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "docs/build/1.1.0/Edujugon/Laradoo/Providers/OdooServiceProvider.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "85968"
}
],
"symlink_target": ""
} |
package com.xinqihd.sns.gameserver.proto;
public final class XinqiBseSyncPos {
private XinqiBseSyncPos() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
}
public interface BseSyncPosOrBuilder
extends com.google.protobuf.MessageOrBuilder {
// required string sessionID = 1;
boolean hasSessionID();
String getSessionID();
// required int32 x = 2;
boolean hasX();
int getX();
// required int32 y = 3;
boolean hasY();
int getY();
}
public static final class BseSyncPos extends
com.google.protobuf.GeneratedMessage
implements BseSyncPosOrBuilder {
// Use BseSyncPos.newBuilder() to construct.
private BseSyncPos(Builder builder) {
super(builder);
}
private BseSyncPos(boolean noInit) {}
private static final BseSyncPos defaultInstance;
public static BseSyncPos getDefaultInstance() {
return defaultInstance;
}
public BseSyncPos getDefaultInstanceForType() {
return defaultInstance;
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.xinqihd.sns.gameserver.proto.XinqiBseSyncPos.internal_static_com_xinqihd_sns_gameserver_proto_BseSyncPos_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.xinqihd.sns.gameserver.proto.XinqiBseSyncPos.internal_static_com_xinqihd_sns_gameserver_proto_BseSyncPos_fieldAccessorTable;
}
private int bitField0_;
// required string sessionID = 1;
public static final int SESSIONID_FIELD_NUMBER = 1;
private java.lang.Object sessionID_;
public boolean hasSessionID() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
public String getSessionID() {
java.lang.Object ref = sessionID_;
if (ref instanceof String) {
return (String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
if (com.google.protobuf.Internal.isValidUtf8(bs)) {
sessionID_ = s;
}
return s;
}
}
private com.google.protobuf.ByteString getSessionIDBytes() {
java.lang.Object ref = sessionID_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((String) ref);
sessionID_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
// required int32 x = 2;
public static final int X_FIELD_NUMBER = 2;
private int x_;
public boolean hasX() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
public int getX() {
return x_;
}
// required int32 y = 3;
public static final int Y_FIELD_NUMBER = 3;
private int y_;
public boolean hasY() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
public int getY() {
return y_;
}
private void initFields() {
sessionID_ = "";
x_ = 0;
y_ = 0;
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
if (!hasSessionID()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasX()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasY()) {
memoizedIsInitialized = 0;
return false;
}
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (((bitField0_ & 0x00000001) == 0x00000001)) {
output.writeBytes(1, getSessionIDBytes());
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
output.writeInt32(2, x_);
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
output.writeInt32(3, y_);
}
getUnknownFields().writeTo(output);
}
private int memoizedSerializedSize = -1;
public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(1, getSessionIDBytes());
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(2, x_);
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(3, y_);
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
protected java.lang.Object writeReplace()
throws java.io.ObjectStreamException {
return super.writeReplace();
}
public static com.xinqihd.sns.gameserver.proto.XinqiBseSyncPos.BseSyncPos parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data).buildParsed();
}
public static com.xinqihd.sns.gameserver.proto.XinqiBseSyncPos.BseSyncPos parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data, extensionRegistry)
.buildParsed();
}
public static com.xinqihd.sns.gameserver.proto.XinqiBseSyncPos.BseSyncPos parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data).buildParsed();
}
public static com.xinqihd.sns.gameserver.proto.XinqiBseSyncPos.BseSyncPos parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data, extensionRegistry)
.buildParsed();
}
public static com.xinqihd.sns.gameserver.proto.XinqiBseSyncPos.BseSyncPos parseFrom(java.io.InputStream input)
throws java.io.IOException {
return newBuilder().mergeFrom(input).buildParsed();
}
public static com.xinqihd.sns.gameserver.proto.XinqiBseSyncPos.BseSyncPos parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return newBuilder().mergeFrom(input, extensionRegistry)
.buildParsed();
}
public static com.xinqihd.sns.gameserver.proto.XinqiBseSyncPos.BseSyncPos parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
Builder builder = newBuilder();
if (builder.mergeDelimitedFrom(input)) {
return builder.buildParsed();
} else {
return null;
}
}
public static com.xinqihd.sns.gameserver.proto.XinqiBseSyncPos.BseSyncPos parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
Builder builder = newBuilder();
if (builder.mergeDelimitedFrom(input, extensionRegistry)) {
return builder.buildParsed();
} else {
return null;
}
}
public static com.xinqihd.sns.gameserver.proto.XinqiBseSyncPos.BseSyncPos parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return newBuilder().mergeFrom(input).buildParsed();
}
public static com.xinqihd.sns.gameserver.proto.XinqiBseSyncPos.BseSyncPos parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return newBuilder().mergeFrom(input, extensionRegistry)
.buildParsed();
}
public static Builder newBuilder() { return Builder.create(); }
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder(com.xinqihd.sns.gameserver.proto.XinqiBseSyncPos.BseSyncPos prototype) {
return newBuilder().mergeFrom(prototype);
}
public Builder toBuilder() { return newBuilder(this); }
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder>
implements com.xinqihd.sns.gameserver.proto.XinqiBseSyncPos.BseSyncPosOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.xinqihd.sns.gameserver.proto.XinqiBseSyncPos.internal_static_com_xinqihd_sns_gameserver_proto_BseSyncPos_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.xinqihd.sns.gameserver.proto.XinqiBseSyncPos.internal_static_com_xinqihd_sns_gameserver_proto_BseSyncPos_fieldAccessorTable;
}
// Construct using com.xinqihd.sns.gameserver.proto.XinqiBseSyncPos.BseSyncPos.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
}
}
private static Builder create() {
return new Builder();
}
public Builder clear() {
super.clear();
sessionID_ = "";
bitField0_ = (bitField0_ & ~0x00000001);
x_ = 0;
bitField0_ = (bitField0_ & ~0x00000002);
y_ = 0;
bitField0_ = (bitField0_ & ~0x00000004);
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.xinqihd.sns.gameserver.proto.XinqiBseSyncPos.BseSyncPos.getDescriptor();
}
public com.xinqihd.sns.gameserver.proto.XinqiBseSyncPos.BseSyncPos getDefaultInstanceForType() {
return com.xinqihd.sns.gameserver.proto.XinqiBseSyncPos.BseSyncPos.getDefaultInstance();
}
public com.xinqihd.sns.gameserver.proto.XinqiBseSyncPos.BseSyncPos build() {
com.xinqihd.sns.gameserver.proto.XinqiBseSyncPos.BseSyncPos result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
private com.xinqihd.sns.gameserver.proto.XinqiBseSyncPos.BseSyncPos buildParsed()
throws com.google.protobuf.InvalidProtocolBufferException {
com.xinqihd.sns.gameserver.proto.XinqiBseSyncPos.BseSyncPos result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(
result).asInvalidProtocolBufferException();
}
return result;
}
public com.xinqihd.sns.gameserver.proto.XinqiBseSyncPos.BseSyncPos buildPartial() {
com.xinqihd.sns.gameserver.proto.XinqiBseSyncPos.BseSyncPos result = new com.xinqihd.sns.gameserver.proto.XinqiBseSyncPos.BseSyncPos(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
to_bitField0_ |= 0x00000001;
}
result.sessionID_ = sessionID_;
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
to_bitField0_ |= 0x00000002;
}
result.x_ = x_;
if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
to_bitField0_ |= 0x00000004;
}
result.y_ = y_;
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.xinqihd.sns.gameserver.proto.XinqiBseSyncPos.BseSyncPos) {
return mergeFrom((com.xinqihd.sns.gameserver.proto.XinqiBseSyncPos.BseSyncPos)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.xinqihd.sns.gameserver.proto.XinqiBseSyncPos.BseSyncPos other) {
if (other == com.xinqihd.sns.gameserver.proto.XinqiBseSyncPos.BseSyncPos.getDefaultInstance()) return this;
if (other.hasSessionID()) {
setSessionID(other.getSessionID());
}
if (other.hasX()) {
setX(other.getX());
}
if (other.hasY()) {
setY(other.getY());
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
if (!hasSessionID()) {
return false;
}
if (!hasX()) {
return false;
}
if (!hasY()) {
return false;
}
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder(
this.getUnknownFields());
while (true) {
int tag = input.readTag();
switch (tag) {
case 0:
this.setUnknownFields(unknownFields.build());
onChanged();
return this;
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
this.setUnknownFields(unknownFields.build());
onChanged();
return this;
}
break;
}
case 10: {
bitField0_ |= 0x00000001;
sessionID_ = input.readBytes();
break;
}
case 16: {
bitField0_ |= 0x00000002;
x_ = input.readInt32();
break;
}
case 24: {
bitField0_ |= 0x00000004;
y_ = input.readInt32();
break;
}
}
}
}
private int bitField0_;
// required string sessionID = 1;
private java.lang.Object sessionID_ = "";
public boolean hasSessionID() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
public String getSessionID() {
java.lang.Object ref = sessionID_;
if (!(ref instanceof String)) {
String s = ((com.google.protobuf.ByteString) ref).toStringUtf8();
sessionID_ = s;
return s;
} else {
return (String) ref;
}
}
public Builder setSessionID(String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000001;
sessionID_ = value;
onChanged();
return this;
}
public Builder clearSessionID() {
bitField0_ = (bitField0_ & ~0x00000001);
sessionID_ = getDefaultInstance().getSessionID();
onChanged();
return this;
}
void setSessionID(com.google.protobuf.ByteString value) {
bitField0_ |= 0x00000001;
sessionID_ = value;
onChanged();
}
// required int32 x = 2;
private int x_ ;
public boolean hasX() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
public int getX() {
return x_;
}
public Builder setX(int value) {
bitField0_ |= 0x00000002;
x_ = value;
onChanged();
return this;
}
public Builder clearX() {
bitField0_ = (bitField0_ & ~0x00000002);
x_ = 0;
onChanged();
return this;
}
// required int32 y = 3;
private int y_ ;
public boolean hasY() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
public int getY() {
return y_;
}
public Builder setY(int value) {
bitField0_ |= 0x00000004;
y_ = value;
onChanged();
return this;
}
public Builder clearY() {
bitField0_ = (bitField0_ & ~0x00000004);
y_ = 0;
onChanged();
return this;
}
// @@protoc_insertion_point(builder_scope:com.xinqihd.sns.gameserver.proto.BseSyncPos)
}
static {
defaultInstance = new BseSyncPos(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:com.xinqihd.sns.gameserver.proto.BseSyncPos)
}
private static com.google.protobuf.Descriptors.Descriptor
internal_static_com_xinqihd_sns_gameserver_proto_BseSyncPos_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_com_xinqihd_sns_gameserver_proto_BseSyncPos_fieldAccessorTable;
public static com.google.protobuf.Descriptors.FileDescriptor
getDescriptor() {
return descriptor;
}
private static com.google.protobuf.Descriptors.FileDescriptor
descriptor;
static {
java.lang.String[] descriptorData = {
"\n\020BseSyncPos.proto\022 com.xinqihd.sns.game" +
"server.proto\"5\n\nBseSyncPos\022\021\n\tsessionID\030" +
"\001 \002(\t\022\t\n\001x\030\002 \002(\005\022\t\n\001y\030\003 \002(\005B\021B\017XinqiBseS" +
"yncPos"
};
com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
public com.google.protobuf.ExtensionRegistry assignDescriptors(
com.google.protobuf.Descriptors.FileDescriptor root) {
descriptor = root;
internal_static_com_xinqihd_sns_gameserver_proto_BseSyncPos_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_com_xinqihd_sns_gameserver_proto_BseSyncPos_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_com_xinqihd_sns_gameserver_proto_BseSyncPos_descriptor,
new java.lang.String[] { "SessionID", "X", "Y", },
com.xinqihd.sns.gameserver.proto.XinqiBseSyncPos.BseSyncPos.class,
com.xinqihd.sns.gameserver.proto.XinqiBseSyncPos.BseSyncPos.Builder.class);
return null;
}
};
com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
}, assigner);
}
// @@protoc_insertion_point(outer_class_scope)
}
| {
"content_hash": "36a5006888bc3d70f6f66b560bc54976",
"timestamp": "",
"source": "github",
"line_count": 563,
"max_line_length": 147,
"avg_line_length": 34.83303730017762,
"alnum_prop": 0.6247004232318597,
"repo_name": "wangqi/gameserver",
"id": "589276a24c15d1c77989c1715f1e39837d653c75",
"size": "19700",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "server/src/gensrc/java/com/xinqihd/sns/gameserver/proto/XinqiBseSyncPos.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "IDL",
"bytes": "33142"
},
{
"name": "Java",
"bytes": "7197480"
},
{
"name": "Lua",
"bytes": "2013259"
},
{
"name": "Shell",
"bytes": "37724"
}
],
"symlink_target": ""
} |
require 'mustache'
require 'pathname'
require 'repo_manager/assets/asset_configuration'
require 'repo_manager/assets/asset_accessors'
module RepoManager
class BaseAsset
include RepoManager::AssetAccessors
extend RepoManager::AssetAccessors
#
# --- Asset attributes START here ---
#
# Asset defined path
#
# Defaults to asset name when the path attribute is blank
#
# NOTE: This is not the path to the asset configuration file. If not an
# absolute path, then it is relative to the current working directory
#
# @example Full paths
#
# path: /home/robert/photos/photo1.jpg
#
# path: /home/robert/app/appfolder
#
# @example Home folder '~' paths are expanded automatically
#
# path: ~/photos/photo1.jpg -> /home/robert/photos/photo1.jpg
#
# @example Relative paths are expanded automatically relative to the CWD
#
# path: photos/photo1.jpg -> /home/robert/photos/photo1.jpg
#
# @example Mustache templates are supported
#
# path: /home/robert/{{name}}/appfolder -> /home/robert/app1/appfolder
#
# @example Mustache braces that come at the start must be quoted
#
# path: "{{name}}/appfolder" -> /home/robert/app1/appfolder
#
# @return [String] an absolute path
def path
return @path if @path
path = attributes[:path] || name
path = render(path)
if (path && !Pathname.new(path).absolute?)
# expand path if starts with '~'
path = File.expand_path(path) if path.match(/^~/)
# paths can be relative to cwd
path = File.join(File.expand_path(FileUtils.pwd), path) if (!Pathname.new(path).absolute?)
end
@path = path
end
def path=(value)
@path = nil
attributes[:path] = value
end
# Description (short)
#
# @return [String]
create_accessors :description
# Notes (user)
#
# @return [String]
create_accessors :notes
# Classification tags, an array of strings
#
# @return [Array] of tag strings
def tags
attributes[:tags] || []
end
def tags=(value)
attributes[:tags] = value
end
#
# --- Asset attributes END here ---
#
# The asset name is loosely tied to the name of the configuration folder (datastore).
# The name may also be a hash key from a YAML config file.
#
# The name should be a valid ruby variable name, in turn, a valid folder name, but this
# is not enforced.
#
# @see self.path_to_name
attr_accessor :name
# subclass factory to create Assets
#
# Call with classname to create. Pass in optional configuration folder
# name and/or a hash of attributes
#
# @param [String] asset_type (AppAsset) classname to initialize
# @param [String] asset_name (nil) asset name or folder name, if folder, will load YAML config
# @param [Hash] attributes ({}) initial attributes
#
# @return [BaseAsset] the created BaseAsset or decendent asset
def self.create(asset_type=:app_asset, asset_name=nil, attributes={})
classified_name = asset_type.to_s.split('_').collect!{ |w| w.capitalize }.join
Object.const_get('RepoManager').const_get(classified_name).new(asset_name, attributes)
end
# takes any path and returns a string suitable for asset name (Ruby identifier)
#
# @return [String] valid asset name
def self.path_to_name(path)
basename = File.basename(path)
basename = basename.gsub(/\&/,' and ')
basename = basename.downcase.strip.gsub(/ /,'_')
basename = basename.gsub(/[^a-zA-Z_0-9]/,'')
basename = basename.downcase.strip.gsub(/ /,'_')
basename.gsub(/[_]+/,'_')
end
# @param [String/Symbol] asset_name_or_folder (nil) if folder exists, will load YAML config
# @param [Hash] attributes ({}) initial attributes
def initialize(asset_name_or_folder=nil, attributes={})
# allow for lazy loading (TODO), don't assign empty attributes
@attributes = attributes.deep_clone unless attributes.empty?
# create user_attribute methods
create_accessors(@attributes[:user_attributes]) if @attributes && @attributes[:user_attributes]
return unless asset_name_or_folder
folder = asset_name_or_folder.to_s
@name = File.basename(folder)
logger.debug "Asset name: #{name}"
logger.debug "Asset configuration folder: #{folder}"
if File.exists?(folder)
logger.debug "initializing new asset with folder: #{folder}"
configuration.load(folder)
end
end
def configuration
@configuration ||= RepoManager::AssetConfiguration.new(self)
end
# attributes is the hash loaded from the asset config file
def attributes
@attributes ||= {}
end
def to_hash
result = {}
result.merge!(:name => name) if name
result.merge!(:attributes => attributes)
result
end
# ERB binding
def get_binding
binding
end
# render a string with mustache tags replaced in the context of this class
#
# @return [String/nil] with mustache tags replaced or nil if template is nil
def render(template)
return nil unless template
Mustache.render(template, self)
end
# support for Mustache rendering of ad hoc user defined variables
# if the key exists in the hash, use if for a lookup
def method_missing(name, *args, &block)
return attributes[name.to_sym] if attributes.include?(name.to_sym)
return super
end
# method_missing support
def respond_to?(name)
return true if attributes.include?(name.to_sym)
super
end
end
end
| {
"content_hash": "900acd1ee40516cde96652b77119aac3",
"timestamp": "",
"source": "github",
"line_count": 192,
"max_line_length": 101,
"avg_line_length": 29.869791666666668,
"alnum_prop": 0.640104620749782,
"repo_name": "robertwahler/repo_manager",
"id": "a695f8528e8c9054d2b842b6ce7e97f926001292",
"size": "6013",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/repo_manager/assets/base_asset.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "676"
},
{
"name": "Gherkin",
"bytes": "76484"
},
{
"name": "HTML",
"bytes": "2117"
},
{
"name": "Ruby",
"bytes": "136063"
}
],
"symlink_target": ""
} |
package p2utils;
public class BinarySearchTreeNode<E>{
String key;
E elem;
BinarySearchTreeNode<E> left = null;
BinarySearchTreeNode<E> right = null;
public BinarySearchTreeNode(String chave, E elemento){
key = chave;
elem = elemento;
}
// procura uma chave
public BinarySearchTreeNode<E> search(String chave){
if (chave.equals(key)) {
return this;
} else if (chave.compareTo(key) < 0 && left != null) {
return left.search(chave);
} else if (chave.compareTo(key) > 0 && right != null) {
return right.search(chave);
} else {
return null;
}
}
// garante que a chave existe
public boolean contains(String chave){
return this.search(chave) != null;
}
// mete uma folha (wow)
public BinarySearchTreeNode<E> insertLeaf(BinarySearchTreeNode<E> node){
BinarySearchTreeNode toRet = node;
if (node == null) {
toRet = this;
} else if (this.key.compareTo(node.key) < 0) {
node.left = insertLeaf(node.left);
} else if (this.key.compareTo(node.key) > 0) {
node.right = insertLeaf(node.right);
}
return toRet;
}
// também dá pra remover usando inserção mas isso é muito fácil
public BinarySearchTreeNode<E> removeRecursive(String chave){
BinarySearchTreeNode tmp = this;
if (chave.compareTo(key) < 0) {
left = left.removeRecursive(chave);
} else if (chave.compareTo(key) > 0) {
right = right.removeRecursive(chave);
} else if (left == null) {
tmp = right;
} else if (right == null) {
tmp = left;
} else {
tmp = right.leftMost();
right = right.removeRecursive(tmp.key);
tmp.left = left;
tmp.right = right;
}
return tmp;
}
// vê qual é que está mais à esquerda
public BinarySearchTreeNode<E> leftMost(){
if (left != null) {
return left.leftMost();
} else {
return this;
}
}
// same que em cima, mas pra direita
public BinarySearchTreeNode<E> rightMost(){
if (right != null) {
return right.rightMost();
} else {
return this;
}
}
// o nome diz tudo
public String toString(){
String toRet = key;
if (left != null) {
toRet += " " + left.toString();
}
if (right != null) {
toRet += " " + right.toString();
}
return toRet;
}
// o comentário da de cima
public int arrayKeys(String[] keysArray, int rounds){
int jogs = rounds;
if (left != null) {
jogs = left.arrayKeys(keysArray, rounds);
}
keysArray[jogs++] = key;
if (right != null) {
jogs = right.arrayKeys(keysArray, jogs);
}
return jogs;
}
} | {
"content_hash": "1d95cad378d6f860d651e8096aa690fc",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 73,
"avg_line_length": 22.0625,
"alnum_prop": 0.6430594900849859,
"repo_name": "ZePaiva/Prog2",
"id": "4c2767e477c70a4d12067882190322762d3f9bb6",
"size": "2482",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "A13 - Árvores Binárias/p2utils/BinarySearchTreeNode.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "502233"
},
{
"name": "Shell",
"bytes": "1207"
},
{
"name": "TeX",
"bytes": "47940"
}
],
"symlink_target": ""
} |
Manipulate time and bend it to your will.
## Methods
### `configure ( offset, accelerationFactor, startAt )`
### `translate ( timestamp, msecOut )`
### `now ( msecOut )`
### `interval ( msecOrSec )`
### `msec ( )`
Returns the current timestamp in milliseconds.
### `sec ( )`
Returns the current timestamp in seconds.
## Properties
### `offset`
### `accelerationFactor`
### `startAt`
| {
"content_hash": "b448d1b8325a5e08f4b48708c6b64219",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 55,
"avg_line_length": 10.972972972972974,
"alnum_prop": 0.6280788177339901,
"repo_name": "Wizcorp/timer.js",
"id": "50442f4e4c2f549f8b2435fe6c60d2e6ca19197f",
"size": "426",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "2146"
}
],
"symlink_target": ""
} |
package com.taobao.tddl.manager;
import java.io.FileInputStream;
import java.util.Map.Entry;
import java.util.Properties;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.exception.ExceptionUtils;
import com.taobao.tddl.common.utils.logger.Logger;
import com.taobao.tddl.common.utils.logger.LoggerFactory;
import com.taobao.tddl.manager.JettyEmbedServer;
public class TddlManagerLauncher {
private static final Logger logger = LoggerFactory.getLogger(TddlManagerLauncher.class);
private static final String CLASSPATH_URL_PREFIX = "classpath:";
public static void main(String[] args) throws Throwable {
try {
String conf = System.getProperty("tddl.conf", "classpath:tddl.properties");
Properties properties = new Properties();
if (conf.startsWith(CLASSPATH_URL_PREFIX)) {
conf = StringUtils.substringAfter(conf, CLASSPATH_URL_PREFIX);
properties.load(TddlManagerLauncher.class.getClassLoader().getResourceAsStream(conf));
} else {
properties.load(new FileInputStream(conf));
}
// 合并配置到system参数中
mergeProps(properties);
logger.info("## start the manager server.");
final JettyEmbedServer server = new JettyEmbedServer(properties.getProperty("tddl.jetty", "jetty.xml"));
server.start();
logger.info("## the manager server is running now ......");
Runtime.getRuntime().addShutdownHook(new Thread() {
public void run() {
try {
logger.info("## stop the manager server");
server.join();
} catch (Throwable e) {
logger.warn("##something goes wrong when stopping manager Server:\n"
+ ExceptionUtils.getFullStackTrace(e));
} finally {
logger.info("## manager server is down.");
}
}
});
} catch (Throwable e) {
logger.error("## Something goes wrong when starting up the manager Server:\n"
+ ExceptionUtils.getFullStackTrace(e));
System.exit(0);
}
}
private static void mergeProps(Properties props) {
for (Entry<Object, Object> entry : props.entrySet()) {
System.setProperty((String) entry.getKey(), (String) entry.getValue());
}
}
}
| {
"content_hash": "8b65f7e9023c6b1cd4133eac788d553c",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 116,
"avg_line_length": 39.78125,
"alnum_prop": 0.5883739198743126,
"repo_name": "xloye/tddl5",
"id": "29018c10f6c2c9e216ac87056a531e14b72a81ca",
"size": "2562",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tddl-manager/src/main/java/com/taobao/tddl/manager/TddlManagerLauncher.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "2238"
},
{
"name": "CSS",
"bytes": "23992"
},
{
"name": "Java",
"bytes": "9099464"
},
{
"name": "JavaScript",
"bytes": "140331"
},
{
"name": "Shell",
"bytes": "10381"
}
],
"symlink_target": ""
} |
import type { IController } from 'angular';
import { module } from 'angular';
import type { IModalInstanceService } from 'angular-ui-bootstrap';
import ANGULAR_UI_BOOTSTRAP from 'angular-ui-bootstrap';
import type { Application, ILoadBalancerDeleteCommand } from '@spinnaker/core';
import { LoadBalancerWriter, TaskMonitor } from '@spinnaker/core';
import { GOOGLE_LOADBALANCER_CONFIGURE_HTTP_HTTPLOADBALANCER_WRITE_SERVICE } from '../../configure/http/httpLoadBalancer.write.service';
import type { GceHttpLoadBalancerUtils } from '../../httpLoadBalancerUtils.service';
import { GCE_HTTP_LOAD_BALANCER_UTILS } from '../../httpLoadBalancerUtils.service';
class Verification {
public verified = false;
}
class Params {
public deleteHealthChecks = false;
}
interface IGoogleLoadBalancerDeleteOperation extends ILoadBalancerDeleteCommand {
region: string;
accountName: string;
deleteHealthChecks: boolean;
loadBalancerType: string;
}
class DeleteLoadBalancerModalController implements IController {
public verification: Verification = new Verification();
public params: Params = new Params();
public taskMonitor: any;
public static $inject = [
'application',
'gceHttpLoadBalancerUtils',
'gceHttpLoadBalancerWriter',
'loadBalancer',
'$uibModalInstance',
];
constructor(
private application: Application,
private gceHttpLoadBalancerUtils: GceHttpLoadBalancerUtils,
private gceHttpLoadBalancerWriter: any,
private loadBalancer: any,
private $uibModalInstance: IModalInstanceService,
) {}
public $onInit(): void {
const taskMonitorConfig = {
application: this.application,
title: 'Deleting ' + this.loadBalancer.name,
modalInstance: this.$uibModalInstance,
};
this.taskMonitor = new TaskMonitor(taskMonitorConfig);
}
public isValid(): boolean {
return this.verification.verified;
}
public submit(): void {
this.taskMonitor.submit(this.getSubmitMethod());
}
public cancel(): void {
this.$uibModalInstance.dismiss();
}
public hasHealthChecks(): boolean {
if (this.gceHttpLoadBalancerUtils.isHttpLoadBalancer(this.loadBalancer)) {
return true;
} else {
return !!this.loadBalancer.healthCheck;
}
}
private getSubmitMethod(): () => PromiseLike<any> {
if (this.gceHttpLoadBalancerUtils.isHttpLoadBalancer(this.loadBalancer)) {
return () => {
return this.gceHttpLoadBalancerWriter.deleteLoadBalancers(this.loadBalancer, this.application, this.params);
};
} else {
return () => {
const command: IGoogleLoadBalancerDeleteOperation = {
cloudProvider: 'gce',
loadBalancerName: this.loadBalancer.name,
accountName: this.loadBalancer.account,
credentials: this.loadBalancer.account,
region: this.loadBalancer.region,
loadBalancerType: this.loadBalancer.loadBalancerType || 'NETWORK',
deleteHealthChecks: this.params.deleteHealthChecks,
};
return LoadBalancerWriter.deleteLoadBalancer(command, this.application);
};
}
}
}
export const DELETE_MODAL_CONTROLLER = 'spinnaker.gce.loadBalancer.deleteModal.controller';
module(DELETE_MODAL_CONTROLLER, [
ANGULAR_UI_BOOTSTRAP as any,
GOOGLE_LOADBALANCER_CONFIGURE_HTTP_HTTPLOADBALANCER_WRITE_SERVICE,
GCE_HTTP_LOAD_BALANCER_UTILS,
]).controller('gceLoadBalancerDeleteModalCtrl', DeleteLoadBalancerModalController);
| {
"content_hash": "12a6a62e6c5ffdb7c9c6094146b30b29",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 136,
"avg_line_length": 32.87619047619047,
"alnum_prop": 0.7259559675550405,
"repo_name": "spinnaker/deck",
"id": "5e2ad27045acf4fc8798f312a3263690eeb43dd8",
"size": "3452",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "packages/google/src/loadBalancer/details/deleteModal/deleteModal.controller.ts",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "7158"
},
{
"name": "HTML",
"bytes": "1044492"
},
{
"name": "JavaScript",
"bytes": "1783693"
},
{
"name": "Less",
"bytes": "209547"
},
{
"name": "Shell",
"bytes": "18398"
},
{
"name": "Slim",
"bytes": "269"
},
{
"name": "TypeScript",
"bytes": "6383917"
}
],
"symlink_target": ""
} |
'use strict';
var Q = require('q'),
Logger = require('../util/logger');
/**
* Require commands only when called.
*
* Running `commandFactory(id)` is equivalent to `require(id)`. Both calls return
* a command function. The difference is that `cmd = commandFactory()` and `cmd()`
* return as soon as possible and load and execute the command asynchronously.
*/
function commandFactory(id) {
if (process.env.STRICT_REQUIRE) {
require(id);
}
function command() {
var commandArgs = [].slice.call(arguments);
return withLogger(function (logger) {
commandArgs.unshift(logger);
return require(id).apply(undefined, commandArgs);
});
}
function runFromArgv(argv) {
return withLogger(function (logger) {
return require(id).line.call(undefined, logger, argv);
});
}
function withLogger(func) {
var logger = new Logger();
Q.try(func, logger)
.done(function () {
var args = [].slice.call(arguments);
args.unshift('end');
logger.emit.apply(logger, args);
}, function (error) {
console.log(error);
logger.emit('error', error);
});
return logger;
}
command.line = runFromArgv;
return command;
}
module.exports = {
// completion: commandFactory('./completion'),
help: commandFactory('./help'),
train: commandFactory('./train'),
evaluate: commandFactory('./evaluate')
}; | {
"content_hash": "941422ed7dcbcb7e4fcc32c3cd3dc7e8",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 82,
"avg_line_length": 25.866666666666667,
"alnum_prop": 0.5779639175257731,
"repo_name": "vasopikof/node-svm",
"id": "c676cfb506294021667b5975dd80d29b5b7c5de1",
"size": "1552",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "lib/commands/index.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "3350"
},
{
"name": "C++",
"bytes": "96737"
},
{
"name": "JavaScript",
"bytes": "141664"
},
{
"name": "Makefile",
"bytes": "732"
},
{
"name": "Python",
"bytes": "289"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>ppsimpl: 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.11.2 / ppsimpl - 8.9.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
ppsimpl
<small>
8.9.0
<span class="label label-info">Not compatible</span>
</small>
</h1>
<p><em><script>document.write(moment("2020-08-31 05:47:56 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2020-08-31 05:47:56 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-m4 1 Virtual package relying on m4
coq 8.11.2 Formal proof management system
num 1.3 The legacy Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.11.0 The OCaml compiler (virtual package)
ocaml-base-compiler 4.11.0 Official release 4.11.0
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.8.1 A library manager for OCaml
# opam file:
opam-version: "2.0"
maintainer: "[email protected]"
homepage: "http://ppsimpl.gforge.inria.fr/"
dev-repo: "git+https://scm.gforge.inria.fr/anonscm/git/ppsimpl/ppsimpl.git"
authors: ["Frédéric Besson"]
bug-reports: "[email protected]"
license: "LGPL 3"
build: [
["./configure"]
[make "-j%{jobs}%"]
]
install: [
[make "install"]
]
depends: [
"ocaml"
"coq" {>= "8.9" & < "8.10~"}
"coq-bignums" {>= "8.9" & < "8.10~"}
]
depopts: [ "coq-flocq" "coq-mathcomp-ssreflect" ]
tags: [
"keyword:integers" "keyword:arithmetic" "keyword:automation"
"category:Miscellaneous/Coq Extensions"
"logpath:PP"
]
synopsis: "Ppsimpl is a reflexive tactic for canonising (arithmetic) goals"
url {
src: "https://gforge.inria.fr/frs/download.php/file/38014/ppsimpl-03-05-2019.tar.gz"
checksum: "md5=ced4651a2fc70c0f146cde6eb722cd77"
}
</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-ppsimpl.8.9.0 coq.8.11.2</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.11.2).
The following dependencies couldn't be met:
- coq-ppsimpl -> coq < 8.10~ -> ocaml < 4.10
base of this switch (use `--unlock-base' to force)
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-ppsimpl.8.9.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">
<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>
| {
"content_hash": "04e4660d0913b7f1a042e539fd3ce88a",
"timestamp": "",
"source": "github",
"line_count": 169,
"max_line_length": 157,
"avg_line_length": 39.798816568047336,
"alnum_prop": 0.5333035979779959,
"repo_name": "coq-bench/coq-bench.github.io",
"id": "5b341d7d9ae12311299120141a02869941a89121",
"size": "6730",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clean/Linux-x86_64-4.11.0-2.0.7/released/8.11.2/ppsimpl/8.9.0.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
<header class="site-header" role="banner">
{% assign custom_url = site.url | append: site.baseurl %} {% assign full_base_url = site.github.url | default: custom_url %}
<div>
<a class="navbar-brand logo"
title="{{site.title | escape}}"
href="{{ full_base_url }}/">{{ site.title | escape }}</a>
</div>
<nav class="navbar main-nav">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<a class="navbar-brand" href="{{ full_base_url }}/">{{ site.title | escape }}</a>
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-collapse" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-collapse">
<ul class="nav navbar-nav">
{% for my_page in site.pages %} {% if my_page.title and my_page.menu != false %}
<li><a class="page-link" href="{{ my_page.url | prepend: full_base_url }}">{{ my_page.title | escape }}</a></li>
{% endif %} {% endfor %}
</ul>
</div>
<!-- /.navbar-collapse -->
</nav>
</header>
| {
"content_hash": "1920aaddefbd6a952366975c5fbca046",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 138,
"avg_line_length": 51.724137931034484,
"alnum_prop": 0.5313333333333333,
"repo_name": "blackhawkaviation/blackhawkaviation",
"id": "6a446d47d6afb23bb1bce2726f1bb41aa762f4ba",
"size": "1500",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "_includes/header.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "6363"
},
{
"name": "HTML",
"bytes": "5997"
},
{
"name": "JavaScript",
"bytes": "5353"
},
{
"name": "Ruby",
"bytes": "1972"
}
],
"symlink_target": ""
} |
package org.jkiss.dbeaver.model.sql;
/**
* Help topic
*/
public class SQLHelpTopic {
private String contents;
private String example;
private String url;
public SQLHelpTopic() {
}
public String getContents() {
return contents;
}
public void setContents(String contents) {
this.contents = contents;
}
public String getExample() {
return example;
}
public void setExample(String example) {
this.example = example;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
}
| {
"content_hash": "0afbd0456606427864cf5d0f483cf79a",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 46,
"avg_line_length": 16.256410256410255,
"alnum_prop": 0.5946372239747634,
"repo_name": "ruspl-afed/dbeaver",
"id": "81acc2fbf4cd10e23d77aa0cf78631f71358bd22",
"size": "1295",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/sql/SQLHelpTopic.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "690"
},
{
"name": "C++",
"bytes": "65328"
},
{
"name": "CSS",
"bytes": "4214"
},
{
"name": "HTML",
"bytes": "2368"
},
{
"name": "Java",
"bytes": "12750447"
},
{
"name": "Shell",
"bytes": "32"
},
{
"name": "XSLT",
"bytes": "7361"
}
],
"symlink_target": ""
} |
namespace Sitecore.FakeDb.Tests
{
using System;
using System.IO;
using System.Linq;
using System.Web;
using FluentAssertions;
using Sitecore.Common;
using Sitecore.Configuration;
using Sitecore.Data;
using Sitecore.Data.Items;
using Sitecore.Data.Managers;
using Sitecore.Exceptions;
using Sitecore.FakeDb.Data.Engines;
using Sitecore.FakeDb.Security.AccessControl;
using Sitecore.Globalization;
using Sitecore.Reflection;
using Sitecore.Security.AccessControl;
using Sitecore.Security.Accounts;
using Sitecore.SecurityModel;
using Xunit;
using Version = Sitecore.Data.Version;
public class DbTest
{
private readonly ID itemId = ID.NewID;
private readonly ID templateId = ID.NewID;
[Fact]
public void ShouldCreateCoupleOfItemsWithFields()
{
// act
using (var db = new Db
{
new DbItem("item1") { { "Title", "Welcome from item 1!" } },
new DbItem("item2") { { "Title", "Welcome from item 2!" } }
})
{
var item1 = db.Database.GetItem("/sitecore/content/item1");
var item2 = db.Database.GetItem("/sitecore/content/item2");
// assert
item1["Title"].Should().Be("Welcome from item 1!");
item2["Title"].Should().Be("Welcome from item 2!");
}
}
[Fact]
public void ShouldCreateItemHierarchyAndReadChildByPath()
{
// arrange & act
using (var db = new Db
{
new DbItem("parent")
{
new DbItem("child")
}
})
{
// assert
db.GetItem("/sitecore/content/parent/child").Should().NotBeNull();
}
}
[Fact]
public void ShouldCreateItemInCustomLanguage()
{
// arrange & act
using (var db = new Db
{
new DbItem("home") { Fields = { new DbField("Title") { { "da", "Hej!" } } } }
})
{
var item = db.Database.GetItem("/sitecore/content/home", Language.Parse("da"));
// assert
item["Title"].Should().Be("Hej!");
item.Language.Should().Be(Language.Parse("da"));
}
}
[Fact]
public void ShouldCreateItemInSpecificLanguage()
{
// arrange & act
using (var db = new Db
{
new DbItem("home") { new DbField("Title") { { "en", "Hello!" }, { "da", "Hej!" } } }
})
{
db.Database.GetItem("/sitecore/content/home", Language.Parse("en"))["Title"].Should().Be("Hello!");
db.Database.GetItem("/sitecore/content/home", Language.Parse("da"))["Title"].Should().Be("Hej!");
}
}
[Fact]
public void ShouldCreateItemOfPredefinedTemplate()
{
// act
using (var db = new Db
{
new DbTemplate("Sample", this.templateId) { "Title" },
new DbItem("Home", this.itemId, this.templateId)
})
{
// assert
var item = db.Database.GetItem(this.itemId);
item.Fields["Title"].Should().NotBeNull();
item.TemplateID.Should().Be(this.templateId);
}
}
[Fact]
public void ShouldCreateItemOfPredefinedTemplatePredefinedFields()
{
// act
using (var db = new Db
{
new DbTemplate("Sample", this.templateId) { "Title" },
new DbItem("Home", this.itemId, this.templateId) { { "Title", "Welcome!" } }
})
{
// assert
var item = db.GetItem(this.itemId);
item.Fields["Title"].Value.Should().Be("Welcome!");
item.TemplateID.Should().Be(this.templateId);
}
}
[Fact]
public void ShouldCreateItemOfVersionOne()
{
// arrange & act
using (var db = new Db { new DbItem("home") })
{
var item = db.Database.GetItem("/sitecore/content/home");
// assert
item.Version.Should().Be(Version.First);
item.Versions.Count.Should().Be(1);
item.Versions[Version.First].Should().NotBeNull();
}
}
[Fact]
public void ShouldCreateItemTemplate()
{
// arrange & act
using (var db = new Db { new DbTemplate("products") })
{
// assert
db.Database.GetTemplate("products").Should().NotBeNull();
}
}
[Fact]
public void ShouldCreateItemWithFields()
{
// act
using (var db = new Db
{
new DbItem("home", this.itemId) { { "Title", "Welcome!" } }
})
{
var item = db.Database.GetItem(this.itemId);
// assert
item["Title"].Should().Be("Welcome!");
}
}
[Fact]
public void ShouldCreateItemWithFieldsAndChildren()
{
// arrange & act
using (var db = new Db
{
new DbItem("parent")
{
Fields = { { "Title", "Welcome to parent item!" } },
Children = { new DbItem("child") { { "Title", "Welcome to child item!" } } }
}
})
{
// assert
var parent = db.GetItem("/sitecore/content/parent");
parent["Title"].Should().Be("Welcome to parent item!");
parent.Children["child"]["Title"].Should().Be("Welcome to child item!");
}
}
[Fact]
public void ShouldCreateItemInInvariantLanguage()
{
// arrange & act
using (var db = new Db
{
new DbItem("home") { new DbField("Title") { { "", "Hello!" } } }
})
{
db.Database.GetItem("/sitecore/content/home", Language.Invariant)["Title"].Should().Be("Hello!");
}
}
[Fact]
public void ShouldGetItemInInvariantLanguage()
{
// arrange
using (var db = new Db { new DbItem("home") })
{
// act
var item = db.GetItem("/sitecore/content/home", Language.Invariant.Name);
// assert
item.Should().NotBeNull();
item.Language.Should().Be(Language.Invariant);
}
}
[Fact]
public void ShouldGetItemInInvariantLanguageAndVersion()
{
// arrange
using (var db = new Db { new DbItem("home") })
{
// act
var item = db.GetItem("/sitecore/content/home", Language.Invariant.Name, 1);
// assert
item.Should().NotBeNull();
item.Language.Should().Be(Language.Invariant);
}
}
[Fact]
public void ShouldCreateSimpleItem()
{
// arrange
var id = new ID("{91494A40-B2AE-42B5-9469-1C7B023B886B}");
// act
using (var db = new Db { new DbItem("myitem", id) })
{
var i = db.Database.GetItem(id);
// assert
i.Should().NotBeNull();
i.Name.Should().Be("myitem");
}
}
[Fact]
public void ShouldDenyItemCreateAccess()
{
// arrange
using (var db = new Db
{
new DbItem("home") { Access = new DbItemAccess { CanCreate = false } }
})
{
var item = db.GetItem("/sitecore/content/home");
// act
Action action = () => item.Add("child", item.Template);
// assert
action.ShouldThrow<AccessDeniedException>();
}
}
[Fact]
public void ShouldDenyItemReadAccess()
{
// arrange & act
using (var db = new Db
{
new DbItem("home") { Access = new DbItemAccess { CanRead = false } }
})
{
// assert
db.GetItem("/sitecore/content/home").Should().BeNull();
}
}
[Fact]
public void ShouldDenyItemWriteAccess()
{
// arrange
using (var db = new Db
{
new DbItem("home") { Access = new DbItemAccess { CanWrite = false } }
})
{
var item = db.GetItem("/sitecore/content/home");
// act
Action action = () => new EditContext(item);
// assert
action.ShouldThrow<UnauthorizedAccessException>();
}
}
[Fact]
public void ShouldGenerateTemplateIdIfNotSet()
{
// arrange
var template = new DbTemplate((ID)null);
// act
using (new Db { template })
{
// assert
template.ID.Should().NotBeNull();
template.ID.Should().NotBe(ID.Null);
}
}
[Fact]
public void ShouldGetItemById()
{
// arrange
var id = ID.NewID;
using (var db = new Db { new DbItem("my item", id) })
{
// act & assert
db.GetItem(id).Should().NotBeNull();
}
}
[Fact]
public void ShouldGetItemByIdAndLanguage()
{
// arrange
var id = ID.NewID;
using (var db = new Db { new DbItem("my item", id) })
{
// act & assert
db.GetItem(id, "en").Should().NotBeNull();
}
}
[Fact]
public void ShouldGetItemByIdLanguageAndVersion()
{
// arrange
var id = ID.NewID;
using (var db = new Db { new DbItem("my item", id) })
{
// act & assert
db.GetItem(id, "en", 1).Should().NotBeNull();
}
}
[Fact]
public void ShouldGetItemByPath()
{
// arrange
using (var db = new Db { new DbItem("my item") })
{
// act & assert
db.GetItem("/sitecore/content/my item").Should().NotBeNull();
}
}
[Fact]
public void ShouldGetItemByPathAndLanguage()
{
// arrange
using (var db = new Db { new DbItem("home") })
{
// act & assert
db.GetItem("/sitecore/content/home", "en").Should().NotBeNull();
}
}
[Fact]
public void ShouldGetItemFromSitecoreDatabase()
{
// arrange
using (var db = new Db())
{
// act & assert
db.GetItem("/sitecore/content").Should().NotBeNull();
}
}
[Fact]
public void ShouldGetItemByUri()
{
// arrange
using (var db = new Db
{
new DbItem("home", this.itemId)
{
new DbField("Title")
{
{ "en", 1, "Welcome!" },
{ "da", 1, "Hello!" },
{ "da", 2, "Velkommen!" }
}
}
})
{
// act & assert
var uriEn1 = new ItemUri(this.itemId, Language.Parse("en"), Version.Parse(1), db.Database);
Database.GetItem(uriEn1).Should().NotBeNull("the item '{0}' should not be null", uriEn1);
Database.GetItem(uriEn1)["Title"].Should().Be("Welcome!");
var uriDa1 = new ItemUri(this.itemId, Language.Parse("da"), Version.Parse(1), db.Database);
Database.GetItem(uriDa1).Should().NotBeNull("the item '{0}' should not be null", uriDa1);
Database.GetItem(uriDa1)["Title"].Should().Be("Hello!");
var uriDa2 = new ItemUri(this.itemId, Language.Parse("da"), Version.Parse(2), db.Database);
Database.GetItem(uriDa2).Should().NotBeNull("the item '{0}' should not be null", uriDa2);
Database.GetItem(uriDa2)["Title"].Should().Be("Velkommen!");
}
}
[Fact]
public void ShouldGetItemParent()
{
// arrange
using (var db = new Db { new DbItem("item") })
{
// act
var parent = db.GetItem("/sitecore/content/item").Parent;
// assert
parent.Paths.FullPath.Should().Be("/sitecore/content");
}
}
[Fact]
public void ShouldHaveDefaultMasterDatabase()
{
// arrange
using (var db = new Db())
{
// act & assert
db.Database.Name.Should().Be("master");
}
}
[Fact]
public void ShouldInitializeDataStorage()
{
// arrange & act
using (var db = new Db())
{
// assert
db.DataStorage.Should().NotBeNull();
}
}
[Fact]
public void ShouldNotShareTemplateForItemsIfTemplatesSetExplicitly()
{
// arrange & act
using (var db = new Db
{
new DbItem("article 1") { { "Title", "A1" } },
new DbItem("article 2", ID.NewID, ID.NewID) { { "Title", "A2" } }
})
{
var item1 = db.GetItem("/sitecore/content/article 1");
var item2 = db.GetItem("/sitecore/content/article 2");
// assert
item1.TemplateID.Should().NotBe(item2.TemplateID);
item1["Title"].Should().Be("A1");
item2["Title"].Should().Be("A2");
}
}
[Fact]
public void ShouldNotShareTemplateForItemsWithDifferentFields()
{
// arrange & act
using (var db = new Db
{
new DbItem("some item") { { "some field", "some value" } },
new DbItem("another item") { { "another field", "another value" } }
})
{
var template1 = db.GetItem("/sitecore/content/some item").TemplateID;
var template2 = db.GetItem("/sitecore/content/another item").TemplateID;
// assert
template1.Should().NotBe(template2);
}
}
[Fact]
public void ShouldReadDefaultContentItem()
{
// arrange
using (var db = new Db())
{
// act
var item = db.Database.GetItem(ItemIDs.ContentRoot);
// assert
item.Should().NotBeNull();
}
}
[Fact]
public void ShouldReadFieldValueByIdAndName()
{
// arrange
var fieldId = ID.NewID;
using (var db = new Db
{
new DbItem("home") { new DbField("Title", fieldId) { Value = "Hello!" } }
})
{
// act
var item = db.GetItem("/sitecore/content/home");
// assert
item[fieldId].Should().Be("Hello!");
item["Title"].Should().Be("Hello!");
}
}
[Fact]
public void ShouldRemoveItemVersion()
{
// arrange
using (var db = new Db
{
new DbItem("home")
{
Fields = { new DbField("Title") { { "en", 1, "Hi" }, { "en", 2, "Hello" } } }
}
})
{
var item = db.GetItem("/sitecore/content/home");
// act
item.Versions.RemoveVersion();
// assert
db.GetItem("/sitecore/content/home", "en", 1)["Title"].Should().Be("Hi");
db.GetItem("/sitecore/content/home", "en", 2)["Title"].Should().BeEmpty();
}
}
[Fact]
public void ShouldRemoveAllVersions()
{
// arrange
using (var db = new Db
{
new DbItem("home")
{
Fields = { new DbField("Title") { { "en", 1, "Hi" }, { "da", 2, "Hey" } } }
}
})
{
var item = db.GetItem("/sitecore/content/home");
// act
item.Versions.RemoveAll(true);
// assert
db.GetItem("/sitecore/content/home", "en", 1)["Title"].Should().BeEmpty();
db.GetItem("/sitecore/content/home", "da", 1)["Title"].Should().BeEmpty();
db.GetItem("/sitecore/content/home", "da", 2)["Title"].Should().BeEmpty();
}
}
[Fact]
public void ShouldRenameItem()
{
// arrange
using (var db = new Db { new DbItem("home") })
{
var home = db.Database.GetItem("/sitecore/content/home");
// act
using (new EditContext(home))
{
home.Name = "new home";
}
// assert
db.Database.GetItem("/sitecore/content/new home").Should().NotBeNull();
db.Database.GetItem("/sitecore/content/new home").Name.Should().Be("new home");
db.Database.GetItem("/sitecore/content/home").Should().BeNull();
}
}
[Theory]
[InlineData("master")]
[InlineData("web")]
[InlineData("core")]
public void ShouldResolveDatabaseByName(string name)
{
// arrange
using (var db = new Db(name))
{
// act & assert
db.Database.Name.Should().Be(name);
}
}
[Fact]
public void ShouldSetAndGetCustomSettings()
{
// arrange
using (var db = new Db())
{
// act
db.Configuration.Settings["my setting"] = "my new value";
// assert
Settings.GetSetting("my setting").Should().Be("my new value");
}
}
[Fact]
public void ShouldCleanUpSettingsAfterDispose()
{
// arrange
using (var db = new Db())
{
// act
db.Configuration.Settings["my setting"] = "my new value";
}
// assert
Settings.GetSetting("my setting").Should().BeEmpty();
}
[Fact]
public void ShouldSetChildItemFullIfParentIdIsSet()
{
// arrange
var parent = new DbItem("parent");
var child = new DbItem("child");
// act
using (var db = new Db { parent })
{
child.ParentID = parent.ID;
db.Add(child);
// assert
child.FullPath.Should().Be("/sitecore/content/parent/child");
}
}
[Fact]
public void ShouldSetChildItemFullPathOnDbInit()
{
// arrange
var parent = new DbItem("parent");
var child = new DbItem("child");
parent.Add(child);
// act
using (new Db { parent })
{
// assert
child.FullPath.Should().Be("/sitecore/content/parent/child");
}
}
[Fact]
public void ShouldSetDatabaseInDataStorage()
{
// arrange & act
using (var db = new Db())
{
// assert
db.DataStorage.Database.Should().BeSameAs(db.Database);
}
}
[Fact]
public void ShouldSetDefaultLanguage()
{
// arrange & act
using (var db = new Db { new DbItem("home") })
{
var item = db.Database.GetItem("/sitecore/content/home");
// assert
item.Language.Should().Be(Language.Parse("en"));
}
}
[Fact]
public void ShouldSetSitecoreContentFullPathByDefault()
{
// arrange
var item = new DbItem("home");
// act
using (new Db { item })
{
// asert
item.FullPath.Should().Be("/sitecore/content/home");
}
}
[Fact]
public void ShouldSetSitecoreContentParentIdByDefault()
{
// arrange
var item = new DbItem("home");
// act
using (new Db { item })
{
// assert
item.ParentID.Should().Be(ItemIDs.ContentRoot);
}
}
[Fact]
public void ShouldShareTemplateForItemsWithFields()
{
// arrange & act
using (var db = new Db
{
new DbItem("article 1") { { "Title", "A1" } },
new DbItem("article 2") { { "Title", "A2" } }
})
{
var template1 = db.GetItem("/sitecore/content/article 1").TemplateID;
var template2 = db.GetItem("/sitecore/content/article 2").TemplateID;
// assert
template1.Should().Be(template2);
}
}
[Theory]
[InlineData("/sitecore/content/home", "/sitecore/content/site", true)]
[InlineData("/sitecore/content/home", "/sitecore/content/site/four", true)]
[InlineData("/sitecore/content/home", "/sitecore/content/home/one", false)]
[InlineData("/sitecore/content/home/one", "/sitecore/content/site/two", true)]
[InlineData("/sitecore/content/site/two", "/sitecore/content/site/three", false)]
[InlineData("/sitecore/content/site/two", "/sitecore/content/site/four", false)]
public void ShouldReuseGeneratedTemplateFromNotOnlySiblings(string pathOne, string pathTwo, bool match)
{
// arrange
using (var db = new Db
{
new DbItem("home")
{
new DbItem("one") { { "Title", "One" } }
},
new DbItem("site")
{
new DbItem("two") { { "Title", "Two" } },
new DbItem("three") { { "Title", "Three" }, { "Name", "Three" } },
new DbItem("four")
}
})
{
// act
var one = db.GetItem(pathOne);
var two = db.GetItem(pathTwo);
// assert
(one.TemplateID == two.TemplateID).Should().Be(match);
}
}
[Fact]
public void ShouldThrowIfNoDbInstanceInitialized()
{
// act
Action action = () => Database.GetDatabase("master").GetItem("/sitecore/content");
// assert
action.ShouldThrow<InvalidOperationException>()
.WithMessage("Sitecore.FakeDb.Db instance has not been initialized.");
}
[Fact]
public void ShouldThrowIfItemIdIsInUse()
{
// arrange
var id = new ID("{57289DB1-1C33-46DF-A7BA-C214B7F4C54C}");
using (var db = new Db { new DbItem("old home", id) })
{
// act
Action action = () => db.Add(new DbItem("new home", id));
// assert
action.ShouldThrow<InvalidOperationException>()
.WithMessage("An item with the same id has already been added ('{57289DB1-1C33-46DF-A7BA-C214B7F4C54C}', '/sitecore/content/new home').");
}
}
[Fact]
public void ShouldThrowIfTemplateIdIsInUseByOtherTemplate()
{
// arrange
var id = new ID("{825697FD-5EED-47ED-8404-E9A47D7D6BDF}");
using (var db = new Db { new DbTemplate("old product", id) })
{
// act
Action action = () => db.Add(new DbTemplate("new product", id));
// assert
action.ShouldThrow<InvalidOperationException>()
.WithMessage("A template with the same id has already been added ('{825697FD-5EED-47ED-8404-E9A47D7D6BDF}', 'new product').");
}
}
[Fact]
public void ShouldThrowIfTemplateIdIsInUseByOtherItem()
{
// arrange
var existingItemId = new ID("{61A9DB3D-8929-4472-A952-543F5304E341}");
var newItemTemplateId = existingItemId;
using (var db = new Db { new DbItem("existing item", existingItemId) })
{
// act
Action action = () => db.Add(new DbItem("new item", ID.NewID, newItemTemplateId));
// assert
action.ShouldThrow<InvalidOperationException>()
.WithMessage("Unable to create the item based on the template '{61A9DB3D-8929-4472-A952-543F5304E341}'. An item with the same id has already been added ('/sitecore/content/existing item').");
}
}
[Fact]
public void ShouldInitializeDbConfigurationUsingFactoryConfiguration()
{
// arrange
using (var db = new Db())
{
// act & assert
db.Configuration.Settings.ConfigSection.Should().BeEquivalentTo(Factory.GetConfiguration());
}
}
[Fact]
public void ShouldInitializePipelineWatcherUsingFactoryConfiguration()
{
// arrange
using (var db = new Db())
{
// act & assert
db.PipelineWatcher.ConfigSection.Should().BeEquivalentTo(Factory.GetConfiguration());
}
}
[Fact]
public void ShouldBeEqualsButNotSame()
{
// arrange
using (var db = new Db { new DbItem("home") })
{
// act
var item1 = db.GetItem("/sitecore/content/Home");
var item2 = db.GetItem("/sitecore/content/Home");
// assert
item1.Should().Be(item2);
item1.Should().NotBeSameAs(item2);
}
}
[Fact]
public void ShouldCreateVersionedItem()
{
using (var db = new Db
{
new DbItem("home")
{
Fields =
{
new DbField("Title")
{
{ "en", 1, "title version 1" },
{ "en", 2, "title version 2" }
}
}
}
})
{
var item1 = db.Database.GetItem("/sitecore/content/home", Language.Parse("en"), Version.Parse(1));
item1["Title"].Should().Be("title version 1");
item1.Version.Number.Should().Be(1);
var item2 = db.Database.GetItem("/sitecore/content/home", Language.Parse("en"), Version.Parse(2));
item2["Title"].Should().Be("title version 2");
item2.Version.Number.Should().Be(2);
}
}
[Fact]
public void ShouldGetItemVersionsCount()
{
// arrange
using (var db = new Db
{
new DbItem("home")
{
Fields =
{
new DbField("Title") { { "en", 1, "v1" }, { "en", 2, "v2" } }
}
}
})
{
var item = db.GetItem("/sitecore/content/home");
// act & assert
item.Versions.Count.Should().Be(2);
}
}
[Fact]
public void ShouldGetLanguages()
{
// arrange
using (var db = new Db
{
new DbItem("home")
{
Fields =
{
new DbField("Title") { { "en", 1, string.Empty }, { "da", 2, string.Empty } }
}
}
})
{
var item = db.GetItem("/sitecore/content/home");
// act & assert
item.Languages.Length.Should().Be(2);
item.Languages.Should().Contain(Language.Parse("en"));
item.Languages.Should().Contain(Language.Parse("da"));
}
}
[Fact]
public void ShouldCreateItemVersion()
{
// arrange
using (var db = new Db
{
new DbItem("home") { { "Title", "hello" } }
})
{
var item1 = db.GetItem("/sitecore/content/home");
// act
var item2 = item1.Versions.AddVersion();
using (new EditContext(item2))
{
item2["Title"] = "Hi there!";
}
// assert
item1["Title"].Should().Be("hello");
item2["Title"].Should().Be("Hi there!");
db.GetItem("/sitecore/content/home", "en", 1)["Title"].Should().Be("hello");
db.GetItem("/sitecore/content/home", "en", 2)["Title"].Should().Be("Hi there!");
}
}
[Fact]
public void ShouldCreateItemOfAnyVersion()
{
// arrange
using (var db = new Db
{
new DbItem("home") { { "Title", "title v1" } }
})
{
var version2 = db.GetItem("/sitecore/content/home", "en", 2);
// act
using (new EditContext(version2))
{
version2["Title"] = "title v2";
}
// assert
db.GetItem("/sitecore/content/home", "en", 1)["Title"].Should().Be("title v1");
db.GetItem("/sitecore/content/home", "en", 2)["Title"].Should().Be("title v2");
}
}
[Fact]
public void ShouldCreateAndFulfilCompositeFieldsStructure()
{
// arrange
using (var db = new Db())
{
// act
db.Add(new DbItem("item1") { { "field1", "item1-field1-value" }, { "field2", "item1-field2-value" } });
db.Add(new DbItem("item2") { { "field1", "item2-field1-value" }, { "field2", "item2-field2-value" } });
// assert
db.GetItem("/sitecore/content/item1")["field1"].Should().Be("item1-field1-value");
db.GetItem("/sitecore/content/item1")["field2"].Should().Be("item1-field2-value");
db.GetItem("/sitecore/content/item2")["field1"].Should().Be("item2-field1-value");
db.GetItem("/sitecore/content/item2")["field2"].Should().Be("item2-field2-value");
}
}
[Fact]
public void ShouldCreateItemOfFolderTemplate()
{
// arrange & act
using (var db = new Db
{
new DbItem("Sample") { TemplateID = TemplateIDs.Folder }
})
{
// assert
db.GetItem("/sitecore/content/sample").TemplateID.Should().Be(TemplateIDs.Folder);
}
}
[Fact]
public void ShouldCreateSampleTemplateIfTemplateIdIsSetButTemplateIsMissing()
{
// act
using (var db = new Db
{
new DbItem("home", ID.NewID, this.templateId)
})
{
// assert
db.GetItem("/sitecore/content/home").TemplateID.Should().Be(this.templateId);
}
}
[Fact]
public void ShouldCreateItemWithStatisticsUsingItemManager()
{
// arrange
using (var db = new Db { new DbTemplate("Sample", this.templateId) })
{
var root = db.Database.GetItem("/sitecore/content");
// act
var item = ItemManager.CreateItem("Home", root, this.templateId, this.itemId);
// assert
item[FieldIDs.Created].Should().NotBeEmpty();
item[FieldIDs.CreatedBy].Should().NotBeEmpty();
item[FieldIDs.Updated].Should().NotBeEmpty();
item[FieldIDs.UpdatedBy].Should().NotBeEmpty();
item[FieldIDs.Revision].Should().NotBeEmpty();
}
}
[Fact]
public void ShouldCheckIfItemHasChildren()
{
// arrange
using (var db = new Db { new DbItem("Home") })
{
// act & assert
db.GetItem("/sitecore/content").Children.Count.Should().Be(1);
db.GetItem("/sitecore/content").HasChildren.Should().BeTrue();
}
}
[Fact]
public void ShouldDeleteItemChildren()
{
// arrange
using (var db = new Db { new DbItem("Home") })
{
// act
db.GetItem("/sitecore/content").DeleteChildren();
// assert
db.GetItem("/sitecore/content").Children.Any().Should().BeFalse();
db.GetItem("/sitecore/content").HasChildren.Should().BeFalse();
}
}
[Fact]
public void ShouldCreateTemplateIfNoTemplateProvided()
{
// arrange
using (var db = new Db { new DbItem("home") })
{
// act
var item = db.GetItem("/sitecore/content/home");
// assert
item.TemplateID.Should().NotBeNull();
item.Template.Should().NotBeNull();
}
}
[Fact]
public void ShouldCreateTemplateFieldsFromItemFieldsIfNoTemplateProvided()
{
// arrange
using (var db = new Db
{
new DbItem("home") { new DbField("Link") { Type = "General Link" } }
})
{
// act
var item = db.GetItem("/sitecore/content/home");
var field = item.Template.GetField("Link");
// assert
field.Should().NotBeNull();
field.Type.Should().Be("General Link");
}
}
[Fact]
public void ShouldPropagateFieldTypesFromTemplateToItem()
{
// arrange
using (var db = new Db
{
new DbItem("home") { new DbField("Link") { Type = "General Link" } }
})
{
// act
var item = db.GetItem("/sitecore/content/home");
// assert
item.Fields["Link"].Type.Should().Be("General Link");
}
}
[Fact]
public void ShouldMoveItem()
{
// arrange
using (var db = new Db
{
new DbItem("old root") { new DbItem("item") },
new DbItem("new root")
})
{
var item = db.GetItem("/sitecore/content/old root/item");
var newRoot = db.GetItem("/sitecore/content/new root");
// act
item.MoveTo(newRoot);
// assert
db.GetItem("/sitecore/content/new root/item").Should().NotBeNull();
db.GetItem("/sitecore/content/new root").Children["item"].Should().NotBeNull();
db.GetItem("/sitecore/content/old root/item").Should().BeNull();
db.GetItem("/sitecore/content/old root").Children["item"].Should().BeNull();
}
}
[Fact]
public void ShouldCleanupSettingsOnDispose()
{
// arrange
using (var db = new Db())
{
db.Configuration.Settings["Database"] = "core";
// act & assert
Settings.GetSetting("Database").Should().Be("core");
}
Settings.GetSetting("Database").Should().BeNullOrEmpty();
}
[Fact]
public void ShouldAccessTemplateAsTemplate()
{
// arrange
using (var db = new Db { new DbTemplate("Main", this.templateId) })
{
// act & assert
TemplateManager.GetTemplate(this.templateId, db.Database).ID.Should().Be(this.templateId);
TemplateManager.GetTemplate("Main", db.Database).ID.Should().Be(this.templateId);
}
}
[Fact]
public void ShouldAccessTemplateAsItem()
{
// arrange
using (var db = new Db { new DbTemplate("Main", this.templateId) })
{
// act
var item = db.GetItem("/sitecore/templates/Main");
// assert
item.Should().NotBeNull();
item.ID.Should().Be(this.templateId);
}
}
[Fact]
public void ShouldBeAbleToWorkWithTemplatesInFolders()
{
// arrange
var folderId = ID.NewID;
using (var db = new Db
{
new DbItem("folder", folderId, TemplateIDs.Folder) { ParentID = ItemIDs.TemplateRoot },
new DbTemplate("Main", this.templateId) { ParentID = folderId }
})
{
// act
var templateItem = db.GetItem("/sitecore/templates/folder/Main");
// assert
TemplateManager.GetTemplate(this.templateId, db.Database).ID.Should().Be(this.templateId);
TemplateManager.GetTemplate("Main", db.Database).ID.Should().Be(this.templateId);
templateItem.Should().NotBeNull();
templateItem.ID.Should().Be(this.templateId);
}
}
[Fact]
public void TemplateShouldComeBackWithBaseTemplatesDefinedOnTemplateAndItem()
{
// arrange
var baseId = ID.NewID;
using (var db = new Db
{
new DbTemplate("base", baseId),
new DbTemplate("main", this.templateId) { BaseIDs = new[] { baseId } }
})
{
var template = TemplateManager.GetTemplate("main", db.Database);
var templateItem = db.GetItem(this.templateId);
// assert
template.BaseIDs.Should().HaveCount(1);
template.GetBaseTemplates().Should().HaveCount(2); // current 'base' + standard
template.GetBaseTemplates().Any(t => t.ID == baseId).Should().BeTrue();
template.GetField(FieldIDs.BaseTemplate).Should().NotBeNull();
template.GetField("__Base template").Should().NotBeNull();
templateItem.Fields[FieldIDs.BaseTemplate].Should().NotBeNull();
templateItem.Fields[FieldIDs.BaseTemplate].Value.Should().Contain(baseId.ToString());
templateItem.Fields["__Base template"].Should().NotBeNull();
templateItem.Fields["__Base template"].Value.Should().Contain(baseId.ToString());
}
}
[Theory]
[InlineData("CanRead", WellknownRights.ItemRead, true, SecurityPermission.AllowAccess, @"au|extranet\John|pe|+item:read|")]
[InlineData("CanRead", WellknownRights.ItemRead, false, SecurityPermission.DenyAccess, @"au|extranet\John|pe|-item:read|")]
[InlineData("CanWrite", WellknownRights.ItemWrite, true, SecurityPermission.AllowAccess, @"au|extranet\John|pe|+item:write|")]
[InlineData("CanWrite", WellknownRights.ItemWrite, false, SecurityPermission.DenyAccess, @"au|extranet\John|pe|-item:write|")]
[InlineData("CanRename", WellknownRights.ItemRename, true, SecurityPermission.AllowAccess, @"au|extranet\John|pe|+item:rename|")]
[InlineData("CanRename", WellknownRights.ItemRename, false, SecurityPermission.DenyAccess, @"au|extranet\John|pe|-item:rename|")]
[InlineData("CanCreate", WellknownRights.ItemCreate, true, SecurityPermission.AllowAccess, @"au|extranet\John|pe|+item:create|")]
[InlineData("CanCreate", WellknownRights.ItemCreate, false, SecurityPermission.DenyAccess, @"au|extranet\John|pe|-item:create|")]
[InlineData("CanDelete", WellknownRights.ItemDelete, true, SecurityPermission.AllowAccess, @"au|extranet\John|pe|+item:delete|")]
[InlineData("CanDelete", WellknownRights.ItemDelete, false, SecurityPermission.DenyAccess, @"au|extranet\John|pe|-item:delete|")]
[InlineData("CanAdmin", WellknownRights.ItemAdmin, true, SecurityPermission.AllowAccess, @"au|extranet\John|pe|+item:admin|")]
[InlineData("CanAdmin", WellknownRights.ItemAdmin, false, SecurityPermission.DenyAccess, @"au|extranet\John|pe|-item:admin|")]
public void ShouldSetItemAccessRules(string propertyName, string accessRight, bool actualPermission, SecurityPermission expectedPermission, string expectedSecurity)
{
// arrange
var user = User.FromName(@"extranet\John", false);
using (new UserSwitcher(user))
using (new SecurityDisabler())
using (var db = new Db())
{
var dbitem = new DbItem("home");
ReflectionUtil.SetProperty(dbitem.Access, propertyName, actualPermission);
// act
db.Add(dbitem);
var item = db.GetItem("/sitecore/content/home");
// assert
item["__Security"].Should().Be(expectedSecurity);
}
}
[Fact]
public void ShouldAddTemplateToTemplateRecords()
{
// arrange & act
using (var db = new Db { new DbTemplate(this.templateId) })
{
// assert
db.Database.Templates[this.templateId].Should().NotBeNull();
}
}
[Fact]
public void ShouldAddTemplateAndResetTemplatesCache()
{
// arrange
using (var db = new Db())
{
// cache the existing templates
TemplateManager.GetTemplates(db.Database);
// act
db.Add(new DbTemplate("My Template", this.templateId));
// assert
TemplateManager.GetTemplate(this.templateId, db.Database).Should().NotBeNull();
}
}
[Fact]
public void ShouldGetEmptyFieldValueForInvariantLanguage()
{
// arrange
using (var db = new Db
{
new DbItem("home") { { "Title", "Hello!" } }
})
{
// act
var item = db.Database.GetItem("/sitecore/content/home", Language.Invariant);
// assert
item["Title"].Should().BeEmpty();
}
}
[Fact]
public void ShouldEnumerateDbItems()
{
// arrange
using (var db = new Db())
{
// act
foreach (var item in db)
{
// assert
item.Should().BeAssignableTo<DbItem>();
}
}
}
[Fact]
public void ShouldThrowIfNoParentFoundById()
{
// arrange
const string ParentId = "{483AE2C1-3494-4248-B591-030F2E2C9843}";
using (var db = new Db())
{
var homessItem = new DbItem("homeless") { ParentID = new ID(ParentId) };
// act
Action action = () => db.Add(homessItem);
// assert
action.ShouldThrow<ItemNotFoundException>()
.WithMessage("The parent item \"{483AE2C1-3494-4248-B591-030F2E2C9843}\" was not found.");
}
}
[Fact]
public void ShouldGetBaseTemplates()
{
// arrange
using (var db = new Db { new DbItem("home") })
{
var item = db.GetItem("/sitecore/content/home");
// act
var baseTemplates = item.Template.BaseTemplates;
// assert
baseTemplates.Should().NotBeNull();
}
}
[Fact]
public void ShouldGetItemChildByPathIfAddedUsingChildrenCollection()
{
// arrange
using (var db = new Db
{
new DbItem("home") { Children = { new DbItem("sub-item") } }
})
{
// act
var item = db.GetItem("/sitecore/content/home/sub-item");
// assert
item.Should().NotBeNull();
}
}
[Fact]
public void ShouldCreateItemBasedOnTemplateField()
{
using (var db = new Db
{
new DbItem("TestField", this.itemId, TemplateIDs.TemplateField)
})
{
db.GetItem(this.itemId).Should().NotBeNull();
}
}
[Fact]
public void ShouldCloneItem()
{
// arrange
using (var db = new Db { new DbItem("home") })
{
var item = db.GetItem("/sitecore/content/home");
// act
var clone = item.CloneTo(item.Parent, "clone", true);
// assert
clone.SourceUri.Should().Be(item.Uri);
}
}
[Fact]
public void ShouldSwitchDataStorage()
{
// act
using (var db = new Db())
{
// assert
DataStorageSwitcher.CurrentValue(db.Database.Name).Should().BeSameAs(db.DataStorage);
}
}
[Fact]
public void ShouldDisposeDataStorageSwitcher()
{
// arrange
DataStorage dataStorage;
// act
using (var db = new Db())
{
dataStorage = db.DataStorage;
}
// assert
Switcher<DataStorage>.CurrentValue.Should().NotBeSameAs(dataStorage);
}
[Fact]
public void ShouldSupportNestedDatabases()
{
// arrange
using (var db = new Db { new DbItem("home") })
{
// act
using (new Db()) { }
// assert
db.GetItem("/sitecore/content/home").Should().NotBeNull();
}
}
[Fact]
public void ShouldRecycleItem()
{
using (var db = new Db { new DbItem("home") })
{
db.GetItem("/sitecore/content/home").Recycle();
}
}
[Fact]
public void ShouldChangeTemplate()
{
// arrange
var newTemplateId = ID.NewID;
using (var db = new Db
{
new DbItem("home", this.itemId, this.templateId),
new DbTemplate("new template", newTemplateId)
})
{
var item = db.GetItem(this.itemId);
var newTemplate = db.GetItem(newTemplateId);
// act
item.ChangeTemplate(newTemplate);
// assert
item.TemplateID.Should().Be(newTemplate.ID);
}
}
[Fact]
public void ShouldSupportMuiltipleParallelDatabases()
{
// arrange
using (var core = new Db("core") { new DbItem("core") })
using (var master = new Db("master") { new DbItem("master") })
{
// act
var coreHome = core.GetItem("/sitecore/content/core");
var masterHome = master.GetItem("/sitecore/content/master");
// assert
coreHome.Should().NotBeNull(); // <-- Fails here
masterHome.Should().NotBeNull();
}
}
[Fact]
public void ShouldNotBeAffectedByMockedHttpContext()
{
// arrange
using (var db = new Db { new DbItem("home") })
{
var request = new HttpRequest("", "http://mysite", "");
var response = new HttpResponse(new StringWriter());
HttpContext.Current = new HttpContext(request, response);
try
{
// act
var page = db.GetItem("/sitecore/content/home"); // <-- Fails here
// assert
page.Should().NotBeNull();
}
finally
{
HttpContext.Current = null;
}
}
}
}
} | {
"content_hash": "07a9f3d02201e5d5263dfb11357a39f7",
"timestamp": "",
"source": "github",
"line_count": 1556,
"max_line_length": 205,
"avg_line_length": 28.816838046272494,
"alnum_prop": 0.5156002587033609,
"repo_name": "hermanussen/Sitecore.FakeDb",
"id": "95f524c1a9216cb21e3d114ce3a77df2e16ef741",
"size": "44841",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Sitecore.FakeDb.Tests/DbTest.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "370"
},
{
"name": "C#",
"bytes": "633452"
},
{
"name": "XSLT",
"bytes": "2023"
}
],
"symlink_target": ""
} |
using EasyLOB;
using EasyLOB.Mvc;
namespace Chinook.Mvc
{
public partial class PlaylistCollectionModel : CollectionModel
{
#region Properties
public override bool IsMasterDetail
{
get { return false; }
}
#endregion Properties
#region Methods
public PlaylistCollectionModel()
: base()
{
}
public PlaylistCollectionModel(ZActivityOperations activityOperations, string controllerAction, string masterControllerAction = null)
: this()
{
ActivityOperations = activityOperations;
ControllerAction = controllerAction;
MasterControllerAction = masterControllerAction;
}
#endregion Methods
}
}
| {
"content_hash": "fa832e0f657590c5d946d31254b2ab74",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 141,
"avg_line_length": 24.205882352941178,
"alnum_prop": 0.5844471445929527,
"repo_name": "EasyLOB/EasyLOB-Chinook-2",
"id": "6fa861931066cee7d7807414628029c25d274344",
"size": "825",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Chinook.Mvc/Models/Chinook/Playlist/PlaylistCollectionModel.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP.NET",
"bytes": "220"
},
{
"name": "Batchfile",
"bytes": "400"
},
{
"name": "C#",
"bytes": "1101121"
},
{
"name": "CSS",
"bytes": "83743"
},
{
"name": "HTML",
"bytes": "736297"
},
{
"name": "JavaScript",
"bytes": "2303199"
},
{
"name": "Less",
"bytes": "21304676"
},
{
"name": "TSQL",
"bytes": "9029"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0-beta2) on Mon Mar 19 18:31:34 CST 2007 -->
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
<TITLE>
SupportedValuesAttribute (Java Platform SE 6)
</TITLE><script>var _hmt = _hmt || [];(function() {var hm = document.createElement("script");hm.src = "//hm.baidu.com/hm.js?dd1361ca20a10cc161e72d4bc4fef6df";var s = document.getElementsByTagName("script")[0];s.parentNode.insertBefore(hm, s);})();</script>
<META NAME="date" CONTENT="2007-03-19">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="SupportedValuesAttribute (Java Platform SE 6)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="跳过导航链接"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>概述</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>软件包</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>类</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/SupportedValuesAttribute.html"><FONT CLASS="NavBarFont1"><B>使用</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>树</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>已过时</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>索引</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>帮助</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
<b>Java<sup><font size=-2>TM</font></sup> Platform<br>Standard Ed. 6</b></EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../javax/print/attribute/Size2DSyntax.html" title="javax.print.attribute 中的类"><B>上一个类</B></A>
<A HREF="../../../javax/print/attribute/TextSyntax.html" title="javax.print.attribute 中的类"><B>下一个类</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html?javax/print/attribute/SupportedValuesAttribute.html" target="_top"><B>框架</B></A>
<A HREF="SupportedValuesAttribute.html" target="_top"><B>无框架</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>所有类</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../allclasses-noframe.html"><B>所有类</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
摘要: 嵌套 | 字段 | 构造方法 | 方法</FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
详细信息: 字段 | 构造方法 | 方法</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
javax.print.attribute</FONT>
<BR>
接口 SupportedValuesAttribute</H2>
<DL>
<DT><B>所有超级接口:</B> <DD><A HREF="../../../javax/print/attribute/Attribute.html" title="javax.print.attribute 中的接口">Attribute</A>, <A HREF="../../../java/io/Serializable.html" title="java.io 中的接口">Serializable</A></DD>
</DL>
<DL>
<DT><B>所有已知实现类:</B> <DD><A HREF="../../../javax/print/attribute/standard/CopiesSupported.html" title="javax.print.attribute.standard 中的类">CopiesSupported</A>, <A HREF="../../../javax/print/attribute/standard/JobImpressionsSupported.html" title="javax.print.attribute.standard 中的类">JobImpressionsSupported</A>, <A HREF="../../../javax/print/attribute/standard/JobKOctetsSupported.html" title="javax.print.attribute.standard 中的类">JobKOctetsSupported</A>, <A HREF="../../../javax/print/attribute/standard/JobMediaSheetsSupported.html" title="javax.print.attribute.standard 中的类">JobMediaSheetsSupported</A>, <A HREF="../../../javax/print/attribute/standard/JobPrioritySupported.html" title="javax.print.attribute.standard 中的类">JobPrioritySupported</A>, <A HREF="../../../javax/print/attribute/standard/NumberUpSupported.html" title="javax.print.attribute.standard 中的类">NumberUpSupported</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public interface <B>SupportedValuesAttribute</B><DT>extends <A HREF="../../../javax/print/attribute/Attribute.html" title="javax.print.attribute 中的接口">Attribute</A></DL>
</PRE>
<P>
接口 SupportedValuesAttribute 是打印属性类实现的标记接口,以指示该属性描述用于其他属性的支持值。例如,如果“打印服务”实例支持 <A HREF="../../../javax/print/attribute/standard/Copies.html" title="javax.print.attribute.standard 中的类"><CODE>Copies</CODE></A> 属性,则该“打印服务”实例将具有 <A HREF="../../../javax/print/attribute/standard/CopiesSupported.html" title="javax.print.attribute.standard 中的类"><CODE>CopiesSupported</CODE></A> 属性,它是一个 SupportedValuesAttribute,该属性提供客户机为 <A HREF="../../../javax/print/attribute/standard/Copies.html" title="javax.print.attribute.standard 中的类"><CODE>Copies</CODE></A> 属性指定的合法值。
<P>
<P>
<P>
<HR>
<P>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>方法摘要</B></FONT></TH>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_javax.print.attribute.Attribute"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>从接口 javax.print.attribute.<A HREF="../../../javax/print/attribute/Attribute.html" title="javax.print.attribute 中的接口">Attribute</A> 继承的方法</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../javax/print/attribute/Attribute.html#getCategory()">getCategory</A>, <A HREF="../../../javax/print/attribute/Attribute.html#getName()">getName</A></CODE></TD>
</TR>
</TABLE>
<P>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="跳过导航链接"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>概述</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>软件包</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>类</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/SupportedValuesAttribute.html"><FONT CLASS="NavBarFont1"><B>使用</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>树</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>已过时</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>索引</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>帮助</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
<b>Java<sup><font size=-2>TM</font></sup> Platform<br>Standard Ed. 6</b></EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../javax/print/attribute/Size2DSyntax.html" title="javax.print.attribute 中的类"><B>上一个类</B></A>
<A HREF="../../../javax/print/attribute/TextSyntax.html" title="javax.print.attribute 中的类"><B>下一个类</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html?javax/print/attribute/SupportedValuesAttribute.html" target="_top"><B>框架</B></A>
<A HREF="SupportedValuesAttribute.html" target="_top"><B>无框架</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>所有类</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../allclasses-noframe.html"><B>所有类</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
摘要: 嵌套 | 字段 | 构造方法 | 方法</FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
详细信息: 字段 | 构造方法 | 方法</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
<font size="-1"><a href="http://bugs.sun.com/services/bugreport/index.jsp">提交错误或意见</a><br>有关更多的 API 参考资料和开发人员文档,请参阅 <a href="http://java.sun.com/javase/6/webnotes/devdocs-vs-specs.html">Java SE 开发人员文档</a>。该文档包含更详细的、面向开发人员的描述,以及总体概述、术语定义、使用技巧和工作代码示例。 <p>版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守<a href="http://java.sun.com/javase/6/docs/legal/license.html">许可证条款</a>。另请参阅<a href="http://java.sun.com/docs/redist.html">文档重新分发政策</a>。</font>
</BODY>
</HTML>
| {
"content_hash": "74337dc50b6222f78b38c4f56ccb0444",
"timestamp": "",
"source": "github",
"line_count": 199,
"max_line_length": 891,
"avg_line_length": 51.79899497487437,
"alnum_prop": 0.6531819945673264,
"repo_name": "piterlin/piterlin.github.io",
"id": "191fb1fd4750ee12f0e43bf8cb7c03c3d5615194",
"size": "11142",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "doc/jdk6_cn/javax/print/attribute/SupportedValuesAttribute.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "479"
},
{
"name": "HTML",
"bytes": "9480869"
},
{
"name": "JavaScript",
"bytes": "246"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<!-- [if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!-- [if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!-- [if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!-- [if gt IE 8]><!-->
<html class="no-js">
<!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>126</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- build:css css/vendor.css-->
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.css">
<link rel="stylesheet" href="bower_components/font-awesome/css/font-awesome.css">
<!-- endbuild-->
<!-- build:css css/main.css-->
<link type="text/css" rel="stylesheet" href=".tmp/style.css">
<!-- endbuild-->
<!-- build:js js/modernizr.js-->
<script src="scripts/plugins/modernizr.js"></script>
<!-- endbuild-->
<link rel="shortcut icon" href="favicon.ico">
<link href="https://fonts.googleapis.com/css?family=Lato:400,300,700,900" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css?family=Caveat+Brush" rel="stylesheet">
</head>
<body><!--[if lt IE 7]>
<p class="chromeframe">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">activate Google Chrome Frame</a> to improve your experience.</p>
<![endif]-->
<div class="container-fluid">
<div class="central-logo"><a href="/inside.html"><img src="images/logo126.png"></a></div>
<div class="row">
<ul class="navigation">
<li><a href="/music.html">Music</a></li>
<li><a href="/events.html">Events</a></li>
<li> <a href="/info.html">Info</a></li>
</ul>
</div>
<div class="row contact-list">
<div class="col-sm-6 col-md-6 col-xs-12 col-lg-3">
<div class="panel">
<div class="panel-body p-t-10">
<div class="media-main"><a class="pull-left"><img class="thumb-lg img-circle bx-s" src="http://bootdey.com/img/Content/user_1.jpg" alt=""></a>
<div class="info">
<h4>Carl Brave</h4>
</div>
</div>
<div class="clearfix"></div>
<hr>
<ul class="social-links list-inline p-b-10">
<li><a class="tooltips" title="" data-placement="top" data-toggle="tooltip" href="#" data-original-title="Facebook"><i class="fa fa-facebook"></i></a></li>
<li><a class="tooltips" title="" data-placement="top" data-toggle="tooltip" href="#" data-original-title="Instagram"><i class="fa fa-instagram"></i></a></li>
<li><a class="tooltips" title="" data-placement="top" data-toggle="tooltip" href="#" data-original-title="Message"><i class="fa fa-envelope-o"></i></a></li>
</ul>
</div>
</div>
</div>
<div class="col-sm-6 col-md-6 col-xs-12 col-lg-3">
<div class="panel">
<div class="panel-body p-t-10">
<div class="media-main"><a class="pull-left"><img class="thumb-lg img-circle bx-s" src="http://bootdey.com/img/Content/user_2.jpg" alt=""></a>
<div class="info">
<h4>Ketama</h4>
</div>
</div>
<div class="clearfix"></div>
<hr>
<ul class="social-links list-inline p-b-10">
<li><a class="tooltips" title="" data-placement="top" data-toggle="tooltip" href="#" data-original-title="Facebook"><i class="fa fa-facebook"></i></a></li>
<li><a class="tooltips" title="" data-placement="top" data-toggle="tooltip" href="#" data-original-title="Instagram"><i class="fa fa-instagram"></i></a></li>
<li><a class="tooltips" title="" data-placement="top" data-toggle="tooltip" href="#" data-original-title="Message"><i class="fa fa-envelope-o"></i></a></li>
</ul>
</div>
</div>
</div>
<div class="col-sm-6 col-md-6 col-xs-12 col-lg-3">
<div class="panel">
<div class="panel-body p-t-10">
<div class="media-main"><a class="pull-left"><img class="thumb-lg img-circle bx-s" src="http://bootdey.com/img/Content/user_3.jpg" alt=""></a>
<div class="info">
<h4>Franco</h4>
</div>
</div>
<div class="clearfix"></div>
<hr>
<ul class="social-links list-inline p-b-10">
<li><a class="tooltips" title="" data-placement="top" data-toggle="tooltip" href="#" data-original-title="Facebook"><i class="fa fa-facebook"></i></a></li>
<li><a class="tooltips" title="" data-placement="top" data-toggle="tooltip" href="#" data-original-title="Instagram"><i class="fa fa-instagram"></i></a></li>
<li><a class="tooltips" title="" data-placement="top" data-toggle="tooltip" href="#" data-original-title="Message"><i class="fa fa-envelope-o"></i></a></li>
</ul>
</div>
</div>
</div>
<div class="col-sm-6 col-md-6 col-xs-12 col-lg-3">
<div class="panel">
<div class="panel-body p-t-10">
<div class="media-main"><a class="pull-left"><img class="thumb-lg img-circle bx-s" src="http://bootdey.com/img/Content/user_1.jpg" alt=""></a>
<div class="info">
<h4>Seany</h4>
</div>
</div>
<div class="clearfix"></div>
<hr>
<ul class="social-links list-inline p-b-10">
<li><a class="tooltips" title="" data-placement="top" data-toggle="tooltip" href="#" data-original-title="Facebook"><i class="fa fa-facebook"></i></a></li>
<li><a class="tooltips" title="" data-placement="top" data-toggle="tooltip" href="#" data-original-title="Instagram"><i class="fa fa-instagram"></i></a></li>
<li><a class="tooltips" title="" data-placement="top" data-toggle="tooltip" href="#" data-original-title="Message"><i class="fa fa-envelope-o"></i></a></li>
</ul>
</div>
</div>
</div>
<div class="col-xs-12 booking-box">
<div class="booking-title">
<h3>BOOKING</h3>
</div>
<ul class="booking-info">
<li>Tel: 3330011223</li>
<li>
<p>Email:<a href="mailto: [email protected]"> [email protected] </a></p>
</li>
</ul>
</div>
</div>
</div>
</body>
<!-- build:js js/vendor.js-->
<script src="bower_components/jquery/dist/jquery.js"></script>
<script src="bower_components/bootstrap/dist/js/bootstrap.js"></script>
<script src="bower_components/holderjs/holder.js"></script>
<!-- endbuild-->
<!-- build:js js/main.js-->
<script src=".tmp/main.js"></script>
<!-- endbuild-->
</html> | {
"content_hash": "f02636a7d5e2225aaf6fd79c8e2ea461",
"timestamp": "",
"source": "github",
"line_count": 135,
"max_line_length": 267,
"avg_line_length": 52.888888888888886,
"alnum_prop": 0.5415966386554621,
"repo_name": "murthag94/126",
"id": "a922d52544bb52d9734a2536e0bcf70c64d536bd",
"size": "7140",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/info.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "27"
},
{
"name": "CSS",
"bytes": "51803"
},
{
"name": "HTML",
"bytes": "38274"
},
{
"name": "JavaScript",
"bytes": "8368"
}
],
"symlink_target": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.