text stringlengths 2 1.04M | meta dict |
|---|---|
<?php
namespace DTS\eBaySDK\MerchantData\Types\Test;
use DTS\eBaySDK\MerchantData\Types\BestOfferDetailsType;
class BestOfferDetailsTypeTest extends \PHPUnit_Framework_TestCase
{
private $obj;
protected function setUp()
{
$this->obj = new BestOfferDetailsType();
}
public function testCanBeCreated()
{
$this->assertInstanceOf('\DTS\eBaySDK\MerchantData\Types\BestOfferDetailsType', $this->obj);
}
public function testExtendsBaseType()
{
$this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj);
}
}
| {
"content_hash": "c8230a4e22252b55e28c8a0a68ba1945",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 100,
"avg_line_length": 22.307692307692307,
"alnum_prop": 0.6931034482758621,
"repo_name": "emullaraj/ebay-sdk-php",
"id": "b8e3b5fb6cb671608bc6fefac01d6debae30b4bd",
"size": "1310",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "test/DTS/eBaySDK/MerchantData/Types/BestOfferDetailsTypeTest.php",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Makefile",
"bytes": "1933"
},
{
"name": "PHP",
"bytes": "8374034"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Threading;
using UnityEngine;
using UnityEngine.Assertions;
using UnityPlatformer;
namespace UnityPlatformer.Test {
/// <summary>
/// Input for automated tests
/// * Move right until wall, then move left
/// * If found a ladder climb
/// </summary>
public class LadderPlayerStartTest : PlayerStart {
/// <summary>
/// PlatformerCollider2D to listen collision callbacks
/// </summary>
internal PlatformerCollider2D pc2d;
/// <summary>
/// where is facing
/// </summary>
Facing facing = Facing.Right;
public float checkTimeSinceLastLadderArea = 10.0f;
public float checkTimeSinceLastLadderState = 10.0f;
[HideInInspector]
public AIInput aiInput;
public override void OnAwake(bool notify = true) {
base.OnAwake(notify);
aiInput = instance.GetComponentInChildren<AIInput>();
if (aiInput == null) {
Debug.LogWarning("AIInput is expected in the prefab");
return;
}
pc2d = instance.GetComponentInChildren<PlatformerCollider2D>();
character = instance.GetComponentInChildren<Character>();
aiInput.SetX(1);
character.onAreaChange += OnAreaChange;
character.onStateChange += OnStateChange;
pc2d.onLeftWall += OnLeftWall;
pc2d.onRightWall += OnRightWall;
}
void OnStateChange(States before, States after) {
if ((before & States.Ladder) == States.Ladder &&
(after & States.OnGround) == States.OnGround) {
aiInput.SetY(0);
aiInput.SetX((float)facing);
}
}
/// <summary>
/// Listen area changes
/// if enter ladder climb
/// if leave ladder resume horizontal movement
/// </summary>
void OnAreaChange(Areas before, Areas after) {
if ((after & Areas.Ladder) == Areas.Ladder) {
if (character.ladder.IsAboveTop(character, character.feet)) {
aiInput.SetY(-1);
} else {
aiInput.SetY(1);
}
aiInput.SetX(0);
UpdateManager.SetTimeout(ContinueMoving, 2.5f);
}
}
/// <summary>
/// resume horizontal movement
/// this prevent to get stuck in a vine (where top is not reachable)
/// </summary>
void ContinueMoving() {
aiInput.SetX((float)facing);
}
/// <summary>
/// Character hit a wall, move in the other direction
/// </summary>
void OnLeftWall() {
facing = Facing.Right;
aiInput.SetX((float)facing);
}
/// <summary>
/// Character hit a wall, move in the other direction
/// </summary>
void OnRightWall() {
facing = Facing.Left;
aiInput.SetX((float)facing);
}
// TEST
float timeSinceLastLadderArea = 0.0f;
float timeSinceLastLadderState = 0.0f;
public void OnEnable() {
UpdateManager.SetInterval(OnEverySecond, -0.1f);
}
void OnEverySecond() {
float delta = UpdateManager.GetCurrentDelta();
timeSinceLastLadderArea += delta;
timeSinceLastLadderState += delta;
if (character.IsOnState(States.Ladder)) {
timeSinceLastLadderState = 0.0f;
}
if (character.IsOnArea(Areas.Ladder)) {
timeSinceLastLadderArea = 0.0f;
}
if (timeSinceLastLadderArea > checkTimeSinceLastLadderArea) {
Assert.IsTrue(false, "checkTimeSinceLastLadderArea seconds without touching a Ladder");
}
if (timeSinceLastLadderState > checkTimeSinceLastLadderState) {
Assert.IsTrue(false, "checkTimeSinceLastLadderState seconds being in a Ladder");
}
}
}
}
| {
"content_hash": "d997ef1ac88bb1ea4d0ab5b59a5fb142",
"timestamp": "",
"source": "github",
"line_count": 127,
"max_line_length": 95,
"avg_line_length": 28.31496062992126,
"alnum_prop": 0.639321468298109,
"repo_name": "llafuente/unity-platformer",
"id": "44733bf78ffa44d23483ae2904c9a6547e3b41c6",
"size": "3596",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Assets/Test/LadderPlayerStartTest.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "AutoHotkey",
"bytes": "1230"
},
{
"name": "Batchfile",
"bytes": "495"
},
{
"name": "C#",
"bytes": "424897"
},
{
"name": "PowerShell",
"bytes": "2205"
},
{
"name": "Shell",
"bytes": "4387"
}
],
"symlink_target": ""
} |
package ua.com.fielden.platform.ui.config;
import ua.com.fielden.platform.dao.CommonEntityDao;
import ua.com.fielden.platform.dao.annotations.SessionRequired;
import ua.com.fielden.platform.entity.annotation.EntityType;
import ua.com.fielden.platform.entity.query.IFilter;
import ua.com.fielden.platform.entity.query.model.EntityResultQueryModel;
import ua.com.fielden.platform.ui.config.EntityMasterConfig;
import ua.com.fielden.platform.ui.config.EntityMasterConfigCo;
import com.google.inject.Inject;
/**
*
* DAO implementation of {@link EntityMasterConfigCo}.
*
* @author TG Team
*
*/
@EntityType(EntityMasterConfig.class)
public class EntityMasterConfigDao extends CommonEntityDao<EntityMasterConfig> implements EntityMasterConfigCo {
@Inject
protected EntityMasterConfigDao(final IFilter filter) {
super(filter);
}
@Override
@SessionRequired
public int batchDelete(EntityResultQueryModel<EntityMasterConfig> model) {
return defaultBatchDelete(model);
}
}
| {
"content_hash": "69bbba54dd0036f7dfa32a11be66074e",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 112,
"avg_line_length": 30.11764705882353,
"alnum_prop": 0.7802734375,
"repo_name": "fieldenms/tg",
"id": "7dbb27bcb67c2b6f0372a8fe471fa7f8d3a89bfe",
"size": "1024",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "platform-dao/src/main/java/ua/com/fielden/platform/ui/config/EntityMasterConfigDao.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "4729"
},
{
"name": "CSS",
"bytes": "177044"
},
{
"name": "CoffeeScript",
"bytes": "2455"
},
{
"name": "HTML",
"bytes": "2236957"
},
{
"name": "Java",
"bytes": "12685270"
},
{
"name": "JavaScript",
"bytes": "34404107"
},
{
"name": "Makefile",
"bytes": "28094"
},
{
"name": "Python",
"bytes": "3798"
},
{
"name": "Roff",
"bytes": "3102"
},
{
"name": "Shell",
"bytes": "13899"
},
{
"name": "TSQL",
"bytes": "1058"
},
{
"name": "TeX",
"bytes": "1296798"
},
{
"name": "XSLT",
"bytes": "6158"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<meta name="collection" content="exclude">
<!-- Generated by javadoc (build 1.5.0-rc) on Wed Aug 11 07:29:25 PDT 2004 -->
<TITLE>
Uses of Interface javax.naming.directory.Attributes (Java 2 Platform SE 5.0)
</TITLE>
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
parent.document.title="Uses of Interface javax.naming.directory.Attributes (Java 2 Platform SE 5.0)";
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<!-- ========= 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="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory"><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-files/index-1.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>
<b>Java<sup><font size=-2>TM</font></sup> 2 Platform<br>Standard Ed. 5.0</b></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?javax/naming/directory//class-useAttributes.html" target="_top"><B>FRAMES</B></A>
<A HREF="Attributes.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 Interface<br>javax.naming.directory.Attributes</B></H2>
</CENTER>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
Packages that use <A HREF="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory">Attributes</A></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><A HREF="#javax.naming.directory"><B>javax.naming.directory</B></A></TD>
<TD>Extends the <tt>javax.naming</tt> package to provide functionality
for accessing directory services. </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><A HREF="#javax.naming.ldap"><B>javax.naming.ldap</B></A></TD>
<TD>Provides support for LDAPv3 extended operations and controls. </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><A HREF="#javax.naming.spi"><B>javax.naming.spi</B></A></TD>
<TD>Provides the means for dynamically plugging in support for accessing
naming and directory services through the <tt>javax.naming</tt>
and related packages. </TD>
</TR>
</TABLE>
<P>
<A NAME="javax.naming.directory"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
Uses of <A HREF="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory">Attributes</A> in <A HREF="../../../../javax/naming/directory/package-summary.html">javax.naming.directory</A></FONT></TH>
</TR>
</TABLE>
<P>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left" COLSPAN="2">Classes in <A HREF="../../../../javax/naming/directory/package-summary.html">javax.naming.directory</A> that implement <A HREF="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory">Attributes</A></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/naming/directory/BasicAttributes.html" title="class in javax.naming.directory">BasicAttributes</A></B></CODE>
<BR>
This class provides a basic implementation
of the Attributes interface.</TD>
</TR>
</TABLE>
<P>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../javax/naming/directory/package-summary.html">javax.naming.directory</A> that return <A HREF="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory">Attributes</A></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory">Attributes</A></CODE></FONT></TD>
<TD><CODE><B>SearchResult.</B><B><A HREF="../../../../javax/naming/directory/SearchResult.html#getAttributes()">getAttributes</A></B>()</CODE>
<BR>
Retrieves the attributes in this search result.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory">Attributes</A></CODE></FONT></TD>
<TD><CODE><B>InitialDirContext.</B><B><A HREF="../../../../javax/naming/directory/InitialDirContext.html#getAttributes(javax.naming.Name)">getAttributes</A></B>(<A HREF="../../../../javax/naming/Name.html" title="interface in javax.naming">Name</A> name)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory">Attributes</A></CODE></FONT></TD>
<TD><CODE><B>DirContext.</B><B><A HREF="../../../../javax/naming/directory/DirContext.html#getAttributes(javax.naming.Name)">getAttributes</A></B>(<A HREF="../../../../javax/naming/Name.html" title="interface in javax.naming">Name</A> name)</CODE>
<BR>
Retrieves all of the attributes associated with a named object.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory">Attributes</A></CODE></FONT></TD>
<TD><CODE><B>InitialDirContext.</B><B><A HREF="../../../../javax/naming/directory/InitialDirContext.html#getAttributes(javax.naming.Name, java.lang.String[])">getAttributes</A></B>(<A HREF="../../../../javax/naming/Name.html" title="interface in javax.naming">Name</A> name,
<A HREF="../../../../java/lang/String.html" title="class in java.lang">String</A>[] attrIds)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory">Attributes</A></CODE></FONT></TD>
<TD><CODE><B>DirContext.</B><B><A HREF="../../../../javax/naming/directory/DirContext.html#getAttributes(javax.naming.Name, java.lang.String[])">getAttributes</A></B>(<A HREF="../../../../javax/naming/Name.html" title="interface in javax.naming">Name</A> name,
<A HREF="../../../../java/lang/String.html" title="class in java.lang">String</A>[] attrIds)</CODE>
<BR>
Retrieves selected attributes associated with a named object.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory">Attributes</A></CODE></FONT></TD>
<TD><CODE><B>InitialDirContext.</B><B><A HREF="../../../../javax/naming/directory/InitialDirContext.html#getAttributes(java.lang.String)">getAttributes</A></B>(<A HREF="../../../../java/lang/String.html" title="class in java.lang">String</A> name)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory">Attributes</A></CODE></FONT></TD>
<TD><CODE><B>DirContext.</B><B><A HREF="../../../../javax/naming/directory/DirContext.html#getAttributes(java.lang.String)">getAttributes</A></B>(<A HREF="../../../../java/lang/String.html" title="class in java.lang">String</A> name)</CODE>
<BR>
Retrieves all of the attributes associated with a named object.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory">Attributes</A></CODE></FONT></TD>
<TD><CODE><B>InitialDirContext.</B><B><A HREF="../../../../javax/naming/directory/InitialDirContext.html#getAttributes(java.lang.String, java.lang.String[])">getAttributes</A></B>(<A HREF="../../../../java/lang/String.html" title="class in java.lang">String</A> name,
<A HREF="../../../../java/lang/String.html" title="class in java.lang">String</A>[] attrIds)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory">Attributes</A></CODE></FONT></TD>
<TD><CODE><B>DirContext.</B><B><A HREF="../../../../javax/naming/directory/DirContext.html#getAttributes(java.lang.String, java.lang.String[])">getAttributes</A></B>(<A HREF="../../../../java/lang/String.html" title="class in java.lang">String</A> name,
<A HREF="../../../../java/lang/String.html" title="class in java.lang">String</A>[] attrIds)</CODE>
<BR>
Retrieves selected attributes associated with a named object.</TD>
</TR>
</TABLE>
<P>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../javax/naming/directory/package-summary.html">javax.naming.directory</A> with parameters of type <A HREF="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory">Attributes</A></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B>InitialDirContext.</B><B><A HREF="../../../../javax/naming/directory/InitialDirContext.html#bind(javax.naming.Name, java.lang.Object, javax.naming.directory.Attributes)">bind</A></B>(<A HREF="../../../../javax/naming/Name.html" title="interface in javax.naming">Name</A> name,
<A HREF="../../../../java/lang/Object.html" title="class in java.lang">Object</A> obj,
<A HREF="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory">Attributes</A> attrs)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B>DirContext.</B><B><A HREF="../../../../javax/naming/directory/DirContext.html#bind(javax.naming.Name, java.lang.Object, javax.naming.directory.Attributes)">bind</A></B>(<A HREF="../../../../javax/naming/Name.html" title="interface in javax.naming">Name</A> name,
<A HREF="../../../../java/lang/Object.html" title="class in java.lang">Object</A> obj,
<A HREF="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory">Attributes</A> attrs)</CODE>
<BR>
Binds a name to an object, along with associated attributes.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B>InitialDirContext.</B><B><A HREF="../../../../javax/naming/directory/InitialDirContext.html#bind(java.lang.String, java.lang.Object, javax.naming.directory.Attributes)">bind</A></B>(<A HREF="../../../../java/lang/String.html" title="class in java.lang">String</A> name,
<A HREF="../../../../java/lang/Object.html" title="class in java.lang">Object</A> obj,
<A HREF="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory">Attributes</A> attrs)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B>DirContext.</B><B><A HREF="../../../../javax/naming/directory/DirContext.html#bind(java.lang.String, java.lang.Object, javax.naming.directory.Attributes)">bind</A></B>(<A HREF="../../../../java/lang/String.html" title="class in java.lang">String</A> name,
<A HREF="../../../../java/lang/Object.html" title="class in java.lang">Object</A> obj,
<A HREF="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory">Attributes</A> attrs)</CODE>
<BR>
Binds a name to an object, along with associated attributes.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../javax/naming/directory/DirContext.html" title="interface in javax.naming.directory">DirContext</A></CODE></FONT></TD>
<TD><CODE><B>InitialDirContext.</B><B><A HREF="../../../../javax/naming/directory/InitialDirContext.html#createSubcontext(javax.naming.Name, javax.naming.directory.Attributes)">createSubcontext</A></B>(<A HREF="../../../../javax/naming/Name.html" title="interface in javax.naming">Name</A> name,
<A HREF="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory">Attributes</A> attrs)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../javax/naming/directory/DirContext.html" title="interface in javax.naming.directory">DirContext</A></CODE></FONT></TD>
<TD><CODE><B>DirContext.</B><B><A HREF="../../../../javax/naming/directory/DirContext.html#createSubcontext(javax.naming.Name, javax.naming.directory.Attributes)">createSubcontext</A></B>(<A HREF="../../../../javax/naming/Name.html" title="interface in javax.naming">Name</A> name,
<A HREF="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory">Attributes</A> attrs)</CODE>
<BR>
Creates and binds a new context, along with associated attributes.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../javax/naming/directory/DirContext.html" title="interface in javax.naming.directory">DirContext</A></CODE></FONT></TD>
<TD><CODE><B>InitialDirContext.</B><B><A HREF="../../../../javax/naming/directory/InitialDirContext.html#createSubcontext(java.lang.String, javax.naming.directory.Attributes)">createSubcontext</A></B>(<A HREF="../../../../java/lang/String.html" title="class in java.lang">String</A> name,
<A HREF="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory">Attributes</A> attrs)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../javax/naming/directory/DirContext.html" title="interface in javax.naming.directory">DirContext</A></CODE></FONT></TD>
<TD><CODE><B>DirContext.</B><B><A HREF="../../../../javax/naming/directory/DirContext.html#createSubcontext(java.lang.String, javax.naming.directory.Attributes)">createSubcontext</A></B>(<A HREF="../../../../java/lang/String.html" title="class in java.lang">String</A> name,
<A HREF="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory">Attributes</A> attrs)</CODE>
<BR>
Creates and binds a new context, along with associated attributes.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B>InitialDirContext.</B><B><A HREF="../../../../javax/naming/directory/InitialDirContext.html#modifyAttributes(javax.naming.Name, int, javax.naming.directory.Attributes)">modifyAttributes</A></B>(<A HREF="../../../../javax/naming/Name.html" title="interface in javax.naming">Name</A> name,
int mod_op,
<A HREF="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory">Attributes</A> attrs)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B>DirContext.</B><B><A HREF="../../../../javax/naming/directory/DirContext.html#modifyAttributes(javax.naming.Name, int, javax.naming.directory.Attributes)">modifyAttributes</A></B>(<A HREF="../../../../javax/naming/Name.html" title="interface in javax.naming">Name</A> name,
int mod_op,
<A HREF="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory">Attributes</A> attrs)</CODE>
<BR>
Modifies the attributes associated with a named object.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B>InitialDirContext.</B><B><A HREF="../../../../javax/naming/directory/InitialDirContext.html#modifyAttributes(java.lang.String, int, javax.naming.directory.Attributes)">modifyAttributes</A></B>(<A HREF="../../../../java/lang/String.html" title="class in java.lang">String</A> name,
int mod_op,
<A HREF="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory">Attributes</A> attrs)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B>DirContext.</B><B><A HREF="../../../../javax/naming/directory/DirContext.html#modifyAttributes(java.lang.String, int, javax.naming.directory.Attributes)">modifyAttributes</A></B>(<A HREF="../../../../java/lang/String.html" title="class in java.lang">String</A> name,
int mod_op,
<A HREF="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory">Attributes</A> attrs)</CODE>
<BR>
Modifies the attributes associated with a named object.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B>InitialDirContext.</B><B><A HREF="../../../../javax/naming/directory/InitialDirContext.html#rebind(javax.naming.Name, java.lang.Object, javax.naming.directory.Attributes)">rebind</A></B>(<A HREF="../../../../javax/naming/Name.html" title="interface in javax.naming">Name</A> name,
<A HREF="../../../../java/lang/Object.html" title="class in java.lang">Object</A> obj,
<A HREF="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory">Attributes</A> attrs)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B>DirContext.</B><B><A HREF="../../../../javax/naming/directory/DirContext.html#rebind(javax.naming.Name, java.lang.Object, javax.naming.directory.Attributes)">rebind</A></B>(<A HREF="../../../../javax/naming/Name.html" title="interface in javax.naming">Name</A> name,
<A HREF="../../../../java/lang/Object.html" title="class in java.lang">Object</A> obj,
<A HREF="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory">Attributes</A> attrs)</CODE>
<BR>
Binds a name to an object, along with associated attributes,
overwriting any existing binding.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B>InitialDirContext.</B><B><A HREF="../../../../javax/naming/directory/InitialDirContext.html#rebind(java.lang.String, java.lang.Object, javax.naming.directory.Attributes)">rebind</A></B>(<A HREF="../../../../java/lang/String.html" title="class in java.lang">String</A> name,
<A HREF="../../../../java/lang/Object.html" title="class in java.lang">Object</A> obj,
<A HREF="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory">Attributes</A> attrs)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B>DirContext.</B><B><A HREF="../../../../javax/naming/directory/DirContext.html#rebind(java.lang.String, java.lang.Object, javax.naming.directory.Attributes)">rebind</A></B>(<A HREF="../../../../java/lang/String.html" title="class in java.lang">String</A> name,
<A HREF="../../../../java/lang/Object.html" title="class in java.lang">Object</A> obj,
<A HREF="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory">Attributes</A> attrs)</CODE>
<BR>
Binds a name to an object, along with associated attributes,
overwriting any existing binding.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../javax/naming/NamingEnumeration.html" title="interface in javax.naming">NamingEnumeration</A><<A HREF="../../../../javax/naming/directory/SearchResult.html" title="class in javax.naming.directory">SearchResult</A>></CODE></FONT></TD>
<TD><CODE><B>InitialDirContext.</B><B><A HREF="../../../../javax/naming/directory/InitialDirContext.html#search(javax.naming.Name, javax.naming.directory.Attributes)">search</A></B>(<A HREF="../../../../javax/naming/Name.html" title="interface in javax.naming">Name</A> name,
<A HREF="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory">Attributes</A> matchingAttributes)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../javax/naming/NamingEnumeration.html" title="interface in javax.naming">NamingEnumeration</A><<A HREF="../../../../javax/naming/directory/SearchResult.html" title="class in javax.naming.directory">SearchResult</A>></CODE></FONT></TD>
<TD><CODE><B>DirContext.</B><B><A HREF="../../../../javax/naming/directory/DirContext.html#search(javax.naming.Name, javax.naming.directory.Attributes)">search</A></B>(<A HREF="../../../../javax/naming/Name.html" title="interface in javax.naming">Name</A> name,
<A HREF="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory">Attributes</A> matchingAttributes)</CODE>
<BR>
Searches in a single context for objects that contain a
specified set of attributes.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../javax/naming/NamingEnumeration.html" title="interface in javax.naming">NamingEnumeration</A><<A HREF="../../../../javax/naming/directory/SearchResult.html" title="class in javax.naming.directory">SearchResult</A>></CODE></FONT></TD>
<TD><CODE><B>InitialDirContext.</B><B><A HREF="../../../../javax/naming/directory/InitialDirContext.html#search(javax.naming.Name, javax.naming.directory.Attributes, java.lang.String[])">search</A></B>(<A HREF="../../../../javax/naming/Name.html" title="interface in javax.naming">Name</A> name,
<A HREF="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory">Attributes</A> matchingAttributes,
<A HREF="../../../../java/lang/String.html" title="class in java.lang">String</A>[] attributesToReturn)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../javax/naming/NamingEnumeration.html" title="interface in javax.naming">NamingEnumeration</A><<A HREF="../../../../javax/naming/directory/SearchResult.html" title="class in javax.naming.directory">SearchResult</A>></CODE></FONT></TD>
<TD><CODE><B>DirContext.</B><B><A HREF="../../../../javax/naming/directory/DirContext.html#search(javax.naming.Name, javax.naming.directory.Attributes, java.lang.String[])">search</A></B>(<A HREF="../../../../javax/naming/Name.html" title="interface in javax.naming">Name</A> name,
<A HREF="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory">Attributes</A> matchingAttributes,
<A HREF="../../../../java/lang/String.html" title="class in java.lang">String</A>[] attributesToReturn)</CODE>
<BR>
Searches in a single context for objects that contain a
specified set of attributes, and retrieves selected attributes.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../javax/naming/NamingEnumeration.html" title="interface in javax.naming">NamingEnumeration</A><<A HREF="../../../../javax/naming/directory/SearchResult.html" title="class in javax.naming.directory">SearchResult</A>></CODE></FONT></TD>
<TD><CODE><B>InitialDirContext.</B><B><A HREF="../../../../javax/naming/directory/InitialDirContext.html#search(java.lang.String, javax.naming.directory.Attributes)">search</A></B>(<A HREF="../../../../java/lang/String.html" title="class in java.lang">String</A> name,
<A HREF="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory">Attributes</A> matchingAttributes)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../javax/naming/NamingEnumeration.html" title="interface in javax.naming">NamingEnumeration</A><<A HREF="../../../../javax/naming/directory/SearchResult.html" title="class in javax.naming.directory">SearchResult</A>></CODE></FONT></TD>
<TD><CODE><B>DirContext.</B><B><A HREF="../../../../javax/naming/directory/DirContext.html#search(java.lang.String, javax.naming.directory.Attributes)">search</A></B>(<A HREF="../../../../java/lang/String.html" title="class in java.lang">String</A> name,
<A HREF="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory">Attributes</A> matchingAttributes)</CODE>
<BR>
Searches in a single context for objects that contain a
specified set of attributes.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../javax/naming/NamingEnumeration.html" title="interface in javax.naming">NamingEnumeration</A><<A HREF="../../../../javax/naming/directory/SearchResult.html" title="class in javax.naming.directory">SearchResult</A>></CODE></FONT></TD>
<TD><CODE><B>InitialDirContext.</B><B><A HREF="../../../../javax/naming/directory/InitialDirContext.html#search(java.lang.String, javax.naming.directory.Attributes, java.lang.String[])">search</A></B>(<A HREF="../../../../java/lang/String.html" title="class in java.lang">String</A> name,
<A HREF="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory">Attributes</A> matchingAttributes,
<A HREF="../../../../java/lang/String.html" title="class in java.lang">String</A>[] attributesToReturn)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../javax/naming/NamingEnumeration.html" title="interface in javax.naming">NamingEnumeration</A><<A HREF="../../../../javax/naming/directory/SearchResult.html" title="class in javax.naming.directory">SearchResult</A>></CODE></FONT></TD>
<TD><CODE><B>DirContext.</B><B><A HREF="../../../../javax/naming/directory/DirContext.html#search(java.lang.String, javax.naming.directory.Attributes, java.lang.String[])">search</A></B>(<A HREF="../../../../java/lang/String.html" title="class in java.lang">String</A> name,
<A HREF="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory">Attributes</A> matchingAttributes,
<A HREF="../../../../java/lang/String.html" title="class in java.lang">String</A>[] attributesToReturn)</CODE>
<BR>
Searches in a single context for objects that contain a
specified set of attributes, and retrieves selected attributes.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B>SearchResult.</B><B><A HREF="../../../../javax/naming/directory/SearchResult.html#setAttributes(javax.naming.directory.Attributes)">setAttributes</A></B>(<A HREF="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory">Attributes</A> attrs)</CODE>
<BR>
Sets the attributes of this search result to <code>attrs</code>.</TD>
</TR>
</TABLE>
<P>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left" COLSPAN="2">Constructors in <A HREF="../../../../javax/naming/directory/package-summary.html">javax.naming.directory</A> with parameters of type <A HREF="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory">Attributes</A></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../javax/naming/directory/SearchResult.html#SearchResult(java.lang.String, java.lang.Object, javax.naming.directory.Attributes)">SearchResult</A></B>(<A HREF="../../../../java/lang/String.html" title="class in java.lang">String</A> name,
<A HREF="../../../../java/lang/Object.html" title="class in java.lang">Object</A> obj,
<A HREF="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory">Attributes</A> attrs)</CODE>
<BR>
Constructs a search result using the result's name, its bound object, and
its attributes.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../javax/naming/directory/SearchResult.html#SearchResult(java.lang.String, java.lang.Object, javax.naming.directory.Attributes, boolean)">SearchResult</A></B>(<A HREF="../../../../java/lang/String.html" title="class in java.lang">String</A> name,
<A HREF="../../../../java/lang/Object.html" title="class in java.lang">Object</A> obj,
<A HREF="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory">Attributes</A> attrs,
boolean isRelative)</CODE>
<BR>
Constructs a search result using the result's name, its bound object, and
its attributes, and whether the name is relative.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../javax/naming/directory/SearchResult.html#SearchResult(java.lang.String, java.lang.String, java.lang.Object, javax.naming.directory.Attributes)">SearchResult</A></B>(<A HREF="../../../../java/lang/String.html" title="class in java.lang">String</A> name,
<A HREF="../../../../java/lang/String.html" title="class in java.lang">String</A> className,
<A HREF="../../../../java/lang/Object.html" title="class in java.lang">Object</A> obj,
<A HREF="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory">Attributes</A> attrs)</CODE>
<BR>
Constructs a search result using the result's name, its class name,
its bound object, and its attributes.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../javax/naming/directory/SearchResult.html#SearchResult(java.lang.String, java.lang.String, java.lang.Object, javax.naming.directory.Attributes, boolean)">SearchResult</A></B>(<A HREF="../../../../java/lang/String.html" title="class in java.lang">String</A> name,
<A HREF="../../../../java/lang/String.html" title="class in java.lang">String</A> className,
<A HREF="../../../../java/lang/Object.html" title="class in java.lang">Object</A> obj,
<A HREF="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory">Attributes</A> attrs,
boolean isRelative)</CODE>
<BR>
Constructs a search result using the result's name, its class name,
its bound object, its attributes, and whether the name is relative.</TD>
</TR>
</TABLE>
<P>
<A NAME="javax.naming.ldap"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
Uses of <A HREF="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory">Attributes</A> in <A HREF="../../../../javax/naming/ldap/package-summary.html">javax.naming.ldap</A></FONT></TH>
</TR>
</TABLE>
<P>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../javax/naming/ldap/package-summary.html">javax.naming.ldap</A> that return <A HREF="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory">Attributes</A></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory">Attributes</A></CODE></FONT></TD>
<TD><CODE><B>Rdn.</B><B><A HREF="../../../../javax/naming/ldap/Rdn.html#toAttributes()">toAttributes</A></B>()</CODE>
<BR>
Retrieves the <A HREF="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory"><CODE>Attributes</CODE></A>
view of the type/value mappings contained in this Rdn.</TD>
</TR>
</TABLE>
<P>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left" COLSPAN="2">Constructors in <A HREF="../../../../javax/naming/ldap/package-summary.html">javax.naming.ldap</A> with parameters of type <A HREF="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory">Attributes</A></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../javax/naming/ldap/Rdn.html#Rdn(javax.naming.directory.Attributes)">Rdn</A></B>(<A HREF="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory">Attributes</A> attrSet)</CODE>
<BR>
Constructs an Rdn from the given attribute set.</TD>
</TR>
</TABLE>
<P>
<A NAME="javax.naming.spi"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
Uses of <A HREF="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory">Attributes</A> in <A HREF="../../../../javax/naming/spi/package-summary.html">javax.naming.spi</A></FONT></TH>
</TR>
</TABLE>
<P>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../javax/naming/spi/package-summary.html">javax.naming.spi</A> that return <A HREF="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory">Attributes</A></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory">Attributes</A></CODE></FONT></TD>
<TD><CODE><B>DirStateFactory.Result.</B><B><A HREF="../../../../javax/naming/spi/DirStateFactory.Result.html#getAttributes()">getAttributes</A></B>()</CODE>
<BR>
Retrieves the attributes to be bound.</TD>
</TR>
</TABLE>
<P>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../javax/naming/spi/package-summary.html">javax.naming.spi</A> with parameters of type <A HREF="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory">Attributes</A></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../java/lang/Object.html" title="class in java.lang">Object</A></CODE></FONT></TD>
<TD><CODE><B>DirObjectFactory.</B><B><A HREF="../../../../javax/naming/spi/DirObjectFactory.html#getObjectInstance(java.lang.Object, javax.naming.Name, javax.naming.Context, java.util.Hashtable, javax.naming.directory.Attributes)">getObjectInstance</A></B>(<A HREF="../../../../java/lang/Object.html" title="class in java.lang">Object</A> obj,
<A HREF="../../../../javax/naming/Name.html" title="interface in javax.naming">Name</A> name,
<A HREF="../../../../javax/naming/Context.html" title="interface in javax.naming">Context</A> nameCtx,
<A HREF="../../../../java/util/Hashtable.html" title="class in java.util">Hashtable</A><?,?> environment,
<A HREF="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory">Attributes</A> attrs)</CODE>
<BR>
Creates an object using the location or reference information, and attributes
specified.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="../../../../java/lang/Object.html" title="class in java.lang">Object</A></CODE></FONT></TD>
<TD><CODE><B>DirectoryManager.</B><B><A HREF="../../../../javax/naming/spi/DirectoryManager.html#getObjectInstance(java.lang.Object, javax.naming.Name, javax.naming.Context, java.util.Hashtable, javax.naming.directory.Attributes)">getObjectInstance</A></B>(<A HREF="../../../../java/lang/Object.html" title="class in java.lang">Object</A> refInfo,
<A HREF="../../../../javax/naming/Name.html" title="interface in javax.naming">Name</A> name,
<A HREF="../../../../javax/naming/Context.html" title="interface in javax.naming">Context</A> nameCtx,
<A HREF="../../../../java/util/Hashtable.html" title="class in java.util">Hashtable</A><?,?> environment,
<A HREF="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory">Attributes</A> attrs)</CODE>
<BR>
Creates an instance of an object for the specified object,
attributes, and environment.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../javax/naming/spi/DirStateFactory.Result.html" title="class in javax.naming.spi">DirStateFactory.Result</A></CODE></FONT></TD>
<TD><CODE><B>DirStateFactory.</B><B><A HREF="../../../../javax/naming/spi/DirStateFactory.html#getStateToBind(java.lang.Object, javax.naming.Name, javax.naming.Context, java.util.Hashtable, javax.naming.directory.Attributes)">getStateToBind</A></B>(<A HREF="../../../../java/lang/Object.html" title="class in java.lang">Object</A> obj,
<A HREF="../../../../javax/naming/Name.html" title="interface in javax.naming">Name</A> name,
<A HREF="../../../../javax/naming/Context.html" title="interface in javax.naming">Context</A> nameCtx,
<A HREF="../../../../java/util/Hashtable.html" title="class in java.util">Hashtable</A><?,?> environment,
<A HREF="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory">Attributes</A> inAttrs)</CODE>
<BR>
Retrieves the state of an object for binding given the object and attributes
to be transformed.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="../../../../javax/naming/spi/DirStateFactory.Result.html" title="class in javax.naming.spi">DirStateFactory.Result</A></CODE></FONT></TD>
<TD><CODE><B>DirectoryManager.</B><B><A HREF="../../../../javax/naming/spi/DirectoryManager.html#getStateToBind(java.lang.Object, javax.naming.Name, javax.naming.Context, java.util.Hashtable, javax.naming.directory.Attributes)">getStateToBind</A></B>(<A HREF="../../../../java/lang/Object.html" title="class in java.lang">Object</A> obj,
<A HREF="../../../../javax/naming/Name.html" title="interface in javax.naming">Name</A> name,
<A HREF="../../../../javax/naming/Context.html" title="interface in javax.naming">Context</A> nameCtx,
<A HREF="../../../../java/util/Hashtable.html" title="class in java.util">Hashtable</A><?,?> environment,
<A HREF="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory">Attributes</A> attrs)</CODE>
<BR>
Retrieves the state of an object for binding when given the original
object and its attributes.</TD>
</TR>
</TABLE>
<P>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left" COLSPAN="2">Constructors in <A HREF="../../../../javax/naming/spi/package-summary.html">javax.naming.spi</A> with parameters of type <A HREF="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory">Attributes</A></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../javax/naming/spi/DirStateFactory.Result.html#DirStateFactory.Result(java.lang.Object, javax.naming.directory.Attributes)">DirStateFactory.Result</A></B>(<A HREF="../../../../java/lang/Object.html" title="class in java.lang">Object</A> obj,
<A HREF="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory">Attributes</A> outAttrs)</CODE>
<BR>
Constructs an instance of Result.</TD>
</TR>
</TABLE>
<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="../../../../javax/naming/directory/Attributes.html" title="interface in javax.naming.directory"><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-files/index-1.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>
<b>Java<sup><font size=-2>TM</font></sup> 2 Platform<br>Standard Ed. 5.0</b></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?javax/naming/directory//class-useAttributes.html" target="_top"><B>FRAMES</B></A>
<A HREF="Attributes.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>
<font size="-1"><a href="http://java.sun.com/cgi-bin/bugreport.cgi">Submit a bug or feature</a><br>For further API reference and developer documentation, see <a href="../../../../../relnotes/devdocs-vs-specs.html">Java 2 SDK SE Developer Documentation</a>. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. <p>Copyright © 2004, 2010 Oracle and/or its affiliates. All rights reserved. Use is subject to <a href="../../../../../relnotes/license.html">license terms</a>. Also see the <a href="http://java.sun.com/docs/redist.html">documentation redistribution policy</a>.</font>
<!-- Start SiteCatalyst code -->
<script language="JavaScript" src="http://www.oracle.com/ocom/groups/systemobject/@mktg_admin/documents/systemobject/s_code_download.js"></script>
<script language="JavaScript" src="http://www.oracle.com/ocom/groups/systemobject/@mktg_admin/documents/systemobject/s_code.js"></script>
<!-- ********** DO NOT ALTER ANYTHING BELOW THIS LINE ! *********** -->
<!-- Below code will send the info to Omniture server -->
<script language="javascript">var s_code=s.t();if(s_code)document.write(s_code)</script>
<!-- End SiteCatalyst code -->
</body>
</HTML>
| {
"content_hash": "ccbde67a2440ea0679338b8b9565462f",
"timestamp": "",
"source": "github",
"line_count": 725,
"max_line_length": 695,
"avg_line_length": 71.60275862068966,
"alnum_prop": 0.6670904607797812,
"repo_name": "Smolations/more-dash-docsets",
"id": "869cbe0e1803112e1fa745513047f4c48a5516bc",
"size": "51912",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docsets/Java 5.docset/Contents/Resources/Documents/javax/naming/directory/class-use/Attributes.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1456655"
},
{
"name": "Emacs Lisp",
"bytes": "3680"
},
{
"name": "JavaScript",
"bytes": "139712"
},
{
"name": "Puppet",
"bytes": "15851"
},
{
"name": "Ruby",
"bytes": "66500"
},
{
"name": "Shell",
"bytes": "11437"
}
],
"symlink_target": ""
} |
class Level {
public:
Level();
~Level();
void update();
void draw(float farClippingPlane);
void dump();
void createTree();
void updateATree();
void generateEnemies();
void drawHealthBar();
void drawScore();
void calculateMaxRadius();
void clean();
kdtree *ptree;
kdtree *atree;
ModelList *pmodels;
ModelList *amodels;
GeometryList *geometries;
BombList *bombs;
WallList *walls;
ForceList *forces;
Ship *ship;
int frame;
unsigned int myScore;
float maxRadius, maxARadius;
float worldDepth;
bool enemieson;
private:
void updateActiveModels();
void checkActiveCollisions();
void checkShipCollisions();
void checkWallCollisions();
void drawActive(float farClippingPlane);
void drawPassive(float farClippingPlane);
bool behindShip(Model *model);
};
#endif
| {
"content_hash": "e88aa44be8bcf35572739338d1f78d1a",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 45,
"avg_line_length": 21.30952380952381,
"alnum_prop": 0.6536312849162011,
"repo_name": "kyleconroy/starfighter",
"id": "3dc297e6c0c8fdd69c1feb4e98374b81458566f7",
"size": "1069",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "level.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "1181784"
},
{
"name": "C++",
"bytes": "1068145"
},
{
"name": "CSS",
"bytes": "11931"
},
{
"name": "Fortran",
"bytes": "5118"
},
{
"name": "Objective-C",
"bytes": "15447"
},
{
"name": "Python",
"bytes": "764"
},
{
"name": "Ruby",
"bytes": "2081"
},
{
"name": "Shell",
"bytes": "12072"
}
],
"symlink_target": ""
} |
from pycloudia.packages.interfaces import IEncoder
from pycloudia.packages.exceptions import InvalidEncodingError
class Encoder(object, IEncoder):
encoding = None
content_delimiter = None
headers_delimiter = None
def encode(self, package):
assert isinstance(package.content, str)
assert isinstance(package.headers, dict)
message = self._create_message(package)
message = self._convert_message(message)
return message
def _create_message(self, package):
return '{headers}{delimiter}{content}'.format(
headers=self._encode_headers(package.headers),
content=package.content,
delimiter=self.delimiter,
)
def _convert_message(self, message):
try:
return str(message)
except UnicodeEncodeError:
try:
return message.encode(self.encoding)
except UnicodeEncodeError:
raise InvalidEncodingError('Unable convert package to {0}'.format(self.encoding))
def _encode_headers(self, headers):
return self.headers_delimiter.join([
'{0}:{1}'.format(name, value)
for name, value
in headers.data.iteritems()
])
| {
"content_hash": "ab9e69113f1c5f480792b9ed5134fea6",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 97,
"avg_line_length": 32.12820512820513,
"alnum_prop": 0.6296887470071828,
"repo_name": "cordis/pycloudia",
"id": "3f4d0c713f67790db55fddb0f92e35334f385d84",
"size": "1253",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "pycloudia/packages/encoder.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "139347"
}
],
"symlink_target": ""
} |
class AddAuditsTable < ActiveRecord::Migration[4.2]
def self.up
create_table :audits, :force => true do |t|
t.column :auditable_id, :integer
t.column :auditable_type, :string
t.column :user_id, :integer
t.column :user_type, :string
t.column :username, :string
t.column :action, :string
t.column :changes, :text
t.column :version, :integer, :default => 0
t.column :created_at, :datetime
end
add_index :audits, [:auditable_id, :auditable_type], :name => 'auditable_index'
add_index :audits, [:user_id, :user_type], :name => 'user_index'
add_index :audits, :created_at
end
def self.down
drop_table :audits
end
end
| {
"content_hash": "978d37a2918aab6c7b2d2f3ff5eb5cda",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 83,
"avg_line_length": 30.652173913043477,
"alnum_prop": 0.625531914893617,
"repo_name": "dfurber/historyforge",
"id": "2c0a58641db6b8116587f15b376ecf773c885cd7",
"size": "705",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "db/migrate/012_add_audits_table.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "29045"
},
{
"name": "CoffeeScript",
"bytes": "32378"
},
{
"name": "Dockerfile",
"bytes": "1405"
},
{
"name": "HTML",
"bytes": "162348"
},
{
"name": "JavaScript",
"bytes": "64650"
},
{
"name": "Ruby",
"bytes": "348617"
},
{
"name": "Shell",
"bytes": "1726"
}
],
"symlink_target": ""
} |
from hazelcast.serialization.bits import *
from hazelcast.protocol.client_message import ClientMessage
from hazelcast.protocol.custom_codec import *
from hazelcast.util import ImmutableLazyDataList
from hazelcast.protocol.codec.multi_map_message_type import *
REQUEST_TYPE = MULTIMAP_CONTAINSENTRY
RESPONSE_TYPE = 101
RETRYABLE = True
def calculate_size(name, key, value, thread_id):
""" Calculates the request payload size"""
data_size = 0
data_size += calculate_size_str(name)
data_size += calculate_size_data(key)
data_size += calculate_size_data(value)
data_size += LONG_SIZE_IN_BYTES
return data_size
def encode_request(name, key, value, thread_id):
""" Encode request into client_message"""
client_message = ClientMessage(payload_size=calculate_size(name, key, value, thread_id))
client_message.set_message_type(REQUEST_TYPE)
client_message.set_retryable(RETRYABLE)
client_message.append_str(name)
client_message.append_data(key)
client_message.append_data(value)
client_message.append_long(thread_id)
client_message.update_frame_length()
return client_message
def decode_response(client_message, to_object=None):
""" Decode response from client message"""
parameters = dict(response=None)
parameters['response'] = client_message.read_bool()
return parameters
| {
"content_hash": "c1818ef6d509d1b6423f1c640f4eb441",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 92,
"avg_line_length": 32.38095238095238,
"alnum_prop": 0.7375,
"repo_name": "LifeDJIK/S.H.I.V.A.",
"id": "23a9a1e41c37ad26006b4ad7ec4264e5d0c9e35a",
"size": "1360",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "containers/shiva/hazelcast/protocol/codec/multi_map_contains_entry_codec.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "4401"
},
{
"name": "HTML",
"bytes": "7268"
},
{
"name": "Python",
"bytes": "19571"
}
],
"symlink_target": ""
} |
import json
import argparse
import docker
class SwarmInspect:
def __init__(self, func=None):
cli = docker.from_env()
if func:
self.execute = func(cli)
def execute(self):
print("No EndPoint Resource Provided")
def discovery_nodes(cli):
node_list = cli.nodes.list()
nodes = [{
"{#NODE_NAME}": item.attrs["Description"]["Hostname"],
"{#NODE_ID}": item.id,
}
for item in node_list]
print(json.dumps({'data': nodes}))
def extrode_multiple_urls(urls):
""" Return the last (right) url value """
if urls:
return urls.split(',')[-1]
return urls
def discovery_services(cli):
services_list = cli.services.list()
services = [{
"{#SERVICE_ID}": item.id,
"{#SERVICE_NAME}": item.name,
"{#SERVICE_HTTPSUPPORT}":
extrode_multiple_urls(item.attrs['Spec']['Labels'].get('com.df.serviceDomain', False))
} for item in services_list]
print(json.dumps({'data': services}))
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--resource', type=str, choices=['nodes','services'], required=True)
args = parser.parse_args()
if 'nodes' in args.resource:
sinspect = SwarmInspect(discovery_nodes)
else:
sinspect = SwarmInspect(discovery_services)
| {
"content_hash": "349357483b494cac415fd811c40d80a0",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 108,
"avg_line_length": 24.627118644067796,
"alnum_prop": 0.5588437715072264,
"repo_name": "gcavalcante8808/zbx-docker",
"id": "eb3234b68af689d22d83fdc6221caffe4f3444a5",
"size": "1476",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "scripts/docker_cluster_discovery.py",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Python",
"bytes": "8058"
}
],
"symlink_target": ""
} |
<?php
namespace PHPExiftool\Driver\Tag\RIFF;
use JMS\Serializer\Annotation\ExclusionPolicy;
use PHPExiftool\Driver\AbstractTag;
/**
* @ExclusionPolicy("all")
*/
class TapeName extends AbstractTag
{
protected $Id = 'TAPE';
protected $Name = 'TapeName';
protected $FullName = 'RIFF::Info';
protected $GroupName = 'RIFF';
protected $g0 = 'RIFF';
protected $g1 = 'RIFF';
protected $g2 = 'Audio';
protected $Type = '?';
protected $Writable = false;
protected $Description = 'Tape Name';
protected $local_g2 = 'Video';
}
| {
"content_hash": "efd3cce4eb77a0646c38e049be72e686",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 46,
"avg_line_length": 15.210526315789474,
"alnum_prop": 0.6401384083044983,
"repo_name": "bburnichon/PHPExiftool",
"id": "0a5e12f4ba1852603ed6a92481e370c8ce870192",
"size": "802",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/PHPExiftool/Driver/Tag/RIFF/TapeName.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "22076400"
}
],
"symlink_target": ""
} |
import bz2
import io
import json
import typing
import pytest
from sanic import Sanic, response
import cloudevents.exceptions as cloud_exceptions
from cloudevents.conversion import to_binary, to_structured
from cloudevents.pydantic import CloudEvent, from_http
from cloudevents.sdk import converters
from cloudevents.sdk.converters.binary import is_binary
from cloudevents.sdk.converters.structured import is_structured
invalid_test_headers = [
{
"ce-source": "<event-source>",
"ce-type": "cloudevent.event.type",
"ce-specversion": "1.0",
},
{
"ce-id": "my-id",
"ce-type": "cloudevent.event.type",
"ce-specversion": "1.0",
},
{"ce-id": "my-id", "ce-source": "<event-source>", "ce-specversion": "1.0"},
{
"ce-id": "my-id",
"ce-source": "<event-source>",
"ce-type": "cloudevent.event.type",
},
]
invalid_cloudevent_request_body = [
{
"source": "<event-source>",
"type": "cloudevent.event.type",
"specversion": "1.0",
},
{"id": "my-id", "type": "cloudevent.event.type", "specversion": "1.0"},
{"id": "my-id", "source": "<event-source>", "specversion": "1.0"},
{
"id": "my-id",
"source": "<event-source>",
"type": "cloudevent.event.type",
},
]
test_data = {"payload-content": "Hello World!"}
app = Sanic("test_pydantic_http_events")
@app.route("/event", ["POST"])
async def echo(request):
decoder = None
if "binary-payload" in request.headers:
decoder = lambda x: x
event = from_http(dict(request.headers), request.body, data_unmarshaller=decoder)
data = (
event.data
if isinstance(event.data, (bytes, bytearray, memoryview))
else json.dumps(event.data).encode()
)
return response.raw(data, headers={k: event[k] for k in event})
@pytest.mark.parametrize("body", invalid_cloudevent_request_body)
def test_missing_required_fields_structured(body):
with pytest.raises(cloud_exceptions.MissingRequiredFields):
_ = from_http(
{"Content-Type": "application/cloudevents+json"}, json.dumps(body)
)
@pytest.mark.parametrize("headers", invalid_test_headers)
def test_missing_required_fields_binary(headers):
with pytest.raises(cloud_exceptions.MissingRequiredFields):
_ = from_http(headers, json.dumps(test_data))
@pytest.mark.parametrize("headers", invalid_test_headers)
def test_missing_required_fields_empty_data_binary(headers):
# Test for issue #115
with pytest.raises(cloud_exceptions.MissingRequiredFields):
_ = from_http(headers, None)
@pytest.mark.parametrize("specversion", ["1.0", "0.3"])
def test_emit_binary_event(specversion):
headers = {
"ce-id": "my-id",
"ce-source": "<event-source>",
"ce-type": "cloudevent.event.type",
"ce-specversion": specversion,
"Content-Type": "text/plain",
}
data = json.dumps(test_data)
_, r = app.test_client.post("/event", headers=headers, data=data)
# Convert byte array to dict
# e.g. r.body = b'{"payload-content": "Hello World!"}'
body = json.loads(r.body.decode("utf-8"))
# Check response fields
for key in test_data:
assert body[key] == test_data[key], body
for key in headers:
if key != "Content-Type":
attribute_key = key[3:]
assert r.headers[attribute_key] == headers[key]
assert r.status_code == 200
@pytest.mark.parametrize("specversion", ["1.0", "0.3"])
def test_emit_structured_event(specversion):
headers = {"Content-Type": "application/cloudevents+json"}
body = {
"id": "my-id",
"source": "<event-source>",
"type": "cloudevent.event.type",
"specversion": specversion,
"data": test_data,
}
_, r = app.test_client.post("/event", headers=headers, data=json.dumps(body))
# Convert byte array to dict
# e.g. r.body = b'{"payload-content": "Hello World!"}'
body = json.loads(r.body.decode("utf-8"))
# Check response fields
for key in test_data:
assert body[key] == test_data[key]
assert r.status_code == 200
@pytest.mark.parametrize(
"converter", [converters.TypeBinary, converters.TypeStructured]
)
@pytest.mark.parametrize("specversion", ["1.0", "0.3"])
def test_roundtrip_non_json_event(converter, specversion):
input_data = io.BytesIO()
for _ in range(100):
for j in range(20):
assert 1 == input_data.write(j.to_bytes(1, byteorder="big"))
compressed_data = bz2.compress(input_data.getvalue())
attrs = {"source": "test", "type": "t"}
event = CloudEvent(attrs, compressed_data)
if converter == converters.TypeStructured:
headers, data = to_structured(event, data_marshaller=lambda x: x)
elif converter == converters.TypeBinary:
headers, data = to_binary(event, data_marshaller=lambda x: x)
headers["binary-payload"] = "true" # Decoding hint for server
_, r = app.test_client.post("/event", headers=headers, data=data)
assert r.status_code == 200
for key in attrs:
assert r.headers[key] == attrs[key]
assert compressed_data == r.body, r.body
@pytest.mark.parametrize("specversion", ["1.0", "0.3"])
def test_missing_ce_prefix_binary_event(specversion):
prefixed_headers = {}
headers = {
"ce-id": "my-id",
"ce-source": "<event-source>",
"ce-type": "cloudevent.event.type",
"ce-specversion": specversion,
}
for key in headers:
# breaking prefix e.g. e-id instead of ce-id
prefixed_headers[key[1:]] = headers[key]
with pytest.raises(cloud_exceptions.MissingRequiredFields):
# CloudEvent constructor throws TypeError if missing required field
# and NotImplementedError because structured calls aren't
# implemented. In this instance one of the required keys should have
# prefix e-id instead of ce-id therefore it should throw
_ = from_http(prefixed_headers, json.dumps(test_data))
@pytest.mark.parametrize("specversion", ["1.0", "0.3"])
def test_valid_binary_events(specversion):
# Test creating multiple cloud events
events_queue = []
headers = {}
num_cloudevents = 30
for i in range(num_cloudevents):
headers = {
"ce-id": f"id{i}",
"ce-source": f"source{i}.com.test",
"ce-type": "cloudevent.test.type",
"ce-specversion": specversion,
}
data = {"payload": f"payload-{i}"}
events_queue.append(from_http(headers, json.dumps(data)))
for i, event in enumerate(events_queue):
data = event.data
assert event["id"] == f"id{i}"
assert event["source"] == f"source{i}.com.test"
assert event["specversion"] == specversion
assert event.data["payload"] == f"payload-{i}"
@pytest.mark.parametrize("specversion", ["1.0", "0.3"])
def test_structured_to_request(specversion):
attributes = {
"specversion": specversion,
"type": "word.found.name",
"id": "96fb5f0b-001e-0108-6dfe-da6e2806f124",
"source": "pytest",
}
data = {"message": "Hello World!"}
event = CloudEvent(attributes, data)
headers, body_bytes = to_structured(event)
assert isinstance(body_bytes, bytes)
body = json.loads(body_bytes)
assert headers["content-type"] == "application/cloudevents+json"
for key in attributes:
assert body[key] == attributes[key]
assert body["data"] == data, f"|{body_bytes}|| {body}"
@pytest.mark.parametrize("specversion", ["1.0", "0.3"])
def test_attributes_view_accessor(specversion: str):
attributes: dict[str, typing.Any] = {
"specversion": specversion,
"type": "word.found.name",
"id": "96fb5f0b-001e-0108-6dfe-da6e2806f124",
"source": "pytest",
}
data = {"message": "Hello World!"}
event: CloudEvent = CloudEvent(attributes, data)
event_attributes: typing.Mapping[str, typing.Any] = event.get_attributes()
assert event_attributes["specversion"] == attributes["specversion"]
assert event_attributes["type"] == attributes["type"]
assert event_attributes["id"] == attributes["id"]
assert event_attributes["source"] == attributes["source"]
assert event_attributes["time"]
@pytest.mark.parametrize("specversion", ["1.0", "0.3"])
def test_binary_to_request(specversion):
attributes = {
"specversion": specversion,
"type": "word.found.name",
"id": "96fb5f0b-001e-0108-6dfe-da6e2806f124",
"source": "pytest",
}
data = {"message": "Hello World!"}
event = CloudEvent(attributes, data)
headers, body_bytes = to_binary(event)
body = json.loads(body_bytes)
for key in data:
assert body[key] == data[key]
for key in attributes:
assert attributes[key] == headers["ce-" + key]
@pytest.mark.parametrize("specversion", ["1.0", "0.3"])
def test_empty_data_structured_event(specversion):
# Testing if cloudevent breaks when no structured data field present
attributes = {
"specversion": specversion,
"datacontenttype": "application/cloudevents+json",
"type": "word.found.name",
"id": "96fb5f0b-001e-0108-6dfe-da6e2806f124",
"time": "2018-10-23T12:28:22.4579346Z",
"source": "<source-url>",
}
event = from_http(
{"content-type": "application/cloudevents+json"}, json.dumps(attributes)
)
assert event.data is None
attributes["data"] = ""
# Data of empty string will be marshalled into None
event = from_http(
{"content-type": "application/cloudevents+json"}, json.dumps(attributes)
)
assert event.data is None
@pytest.mark.parametrize("specversion", ["1.0", "0.3"])
def test_empty_data_binary_event(specversion):
# Testing if cloudevent breaks when no structured data field present
headers = {
"Content-Type": "application/octet-stream",
"ce-specversion": specversion,
"ce-type": "word.found.name",
"ce-id": "96fb5f0b-001e-0108-6dfe-da6e2806f124",
"ce-time": "2018-10-23T12:28:22.4579346Z",
"ce-source": "<source-url>",
}
event = from_http(headers, None)
assert event.data is None
data = ""
# Data of empty string will be marshalled into None
event = from_http(headers, data)
assert event.data is None
@pytest.mark.parametrize("specversion", ["1.0", "0.3"])
def test_valid_structured_events(specversion):
# Test creating multiple cloud events
events_queue = []
num_cloudevents = 30
for i in range(num_cloudevents):
event = {
"id": f"id{i}",
"source": f"source{i}.com.test",
"type": "cloudevent.test.type",
"specversion": specversion,
"data": {"payload": f"payload-{i}"},
}
events_queue.append(
from_http(
{"content-type": "application/cloudevents+json"},
json.dumps(event),
)
)
for i, event in enumerate(events_queue):
assert event["id"] == f"id{i}"
assert event["source"] == f"source{i}.com.test"
assert event["specversion"] == specversion
assert event.data["payload"] == f"payload-{i}"
@pytest.mark.parametrize("specversion", ["1.0", "0.3"])
def test_structured_no_content_type(specversion):
# Test creating multiple cloud events
data = {
"id": "id",
"source": "source.com.test",
"type": "cloudevent.test.type",
"specversion": specversion,
"data": test_data,
}
event = from_http({}, json.dumps(data))
assert event["id"] == "id"
assert event["source"] == "source.com.test"
assert event["specversion"] == specversion
for key, val in test_data.items():
assert event.data[key] == val
def test_is_binary():
headers = {
"ce-id": "my-id",
"ce-source": "<event-source>",
"ce-type": "cloudevent.event.type",
"ce-specversion": "1.0",
"Content-Type": "text/plain",
}
assert is_binary(headers)
headers = {
"Content-Type": "application/cloudevents+json",
}
assert not is_binary(headers)
headers = {}
assert not is_binary(headers)
@pytest.mark.parametrize("specversion", ["1.0", "0.3"])
def test_cloudevent_repr(specversion):
headers = {
"Content-Type": "application/octet-stream",
"ce-specversion": specversion,
"ce-type": "word.found.name",
"ce-id": "96fb5f0b-001e-0108-6dfe-da6e2806f124",
"ce-time": "2018-10-23T12:28:22.4579346Z",
"ce-source": "<source-url>",
}
event = from_http(headers, "")
# Testing to make sure event is printable. I could run event. __repr__() but
# we had issues in the past where event.__repr__() could run but
# print(event) would fail.
print(event) # noqa T201
@pytest.mark.parametrize("specversion", ["1.0", "0.3"])
def test_none_data_cloudevent(specversion):
event = CloudEvent(
{
"source": "<my-url>",
"type": "issue.example",
"specversion": specversion,
}
)
to_binary(event)
to_structured(event)
def test_wrong_specversion():
headers = {"Content-Type": "application/cloudevents+json"}
data = json.dumps(
{
"specversion": "0.2",
"type": "word.found.name",
"id": "96fb5f0b-001e-0108-6dfe-da6e2806f124",
"source": "<my-source>",
}
)
with pytest.raises(cloud_exceptions.InvalidRequiredFields) as e:
from_http(headers, data)
assert "Found invalid specversion 0.2" in str(e.value)
def test_invalid_data_format_structured_from_http():
headers = {"Content-Type": "application/cloudevents+json"}
data = 20
with pytest.raises(cloud_exceptions.InvalidStructuredJSON) as e:
from_http(headers, data)
assert "Expected json of type (str, bytes, bytearray)" in str(e.value)
def test_wrong_specversion_to_request():
event = CloudEvent({"source": "s", "type": "t"}, None)
with pytest.raises(cloud_exceptions.InvalidRequiredFields) as e:
event["specversion"] = "0.2"
to_binary(event)
assert "Unsupported specversion: 0.2" in str(e.value)
def test_is_structured():
headers = {
"Content-Type": "application/cloudevents+json",
}
assert is_structured(headers)
headers = {
"ce-id": "my-id",
"ce-source": "<event-source>",
"ce-type": "cloudevent.event.type",
"ce-specversion": "1.0",
"Content-Type": "text/plain",
}
assert not is_structured(headers)
def test_empty_json_structured():
headers = {"Content-Type": "application/cloudevents+json"}
data = ""
with pytest.raises(cloud_exceptions.MissingRequiredFields) as e:
from_http(headers, data)
assert "Failed to read specversion from both headers and data" in str(e.value)
def test_uppercase_headers_with_none_data_binary():
headers = {
"Ce-Id": "my-id",
"Ce-Source": "<event-source>",
"Ce-Type": "cloudevent.event.type",
"Ce-Specversion": "1.0",
}
event = from_http(headers, None)
for key in headers:
assert event[key.lower()[3:]] == headers[key]
assert event.data is None
_, new_data = to_binary(event)
assert new_data is None
def test_generic_exception():
headers = {"Content-Type": "application/cloudevents+json"}
data = json.dumps(
{
"specversion": "1.0",
"source": "s",
"type": "t",
"id": "1234-1234-1234",
"data": "",
}
)
with pytest.raises(cloud_exceptions.GenericException) as e:
from_http({}, None)
e.errisinstance(cloud_exceptions.MissingRequiredFields)
with pytest.raises(cloud_exceptions.GenericException) as e:
from_http({}, 123)
e.errisinstance(cloud_exceptions.InvalidStructuredJSON)
with pytest.raises(cloud_exceptions.GenericException) as e:
from_http(headers, data, data_unmarshaller=lambda x: 1 / 0)
e.errisinstance(cloud_exceptions.DataUnmarshallerError)
with pytest.raises(cloud_exceptions.GenericException) as e:
event = from_http(headers, data)
to_binary(event, data_marshaller=lambda x: 1 / 0)
e.errisinstance(cloud_exceptions.DataMarshallerError)
def test_non_dict_data_no_headers_bug():
# Test for issue #116
headers = {"Content-Type": "application/cloudevents+json"}
data = "123"
with pytest.raises(cloud_exceptions.MissingRequiredFields) as e:
from_http(headers, data)
assert "Failed to read specversion from both headers and data" in str(e.value)
assert "The following deserialized data has no 'get' method" in str(e.value)
| {
"content_hash": "23afb5525c234b7292c9b4aa738b177a",
"timestamp": "",
"source": "github",
"line_count": 518,
"max_line_length": 85,
"avg_line_length": 32.5965250965251,
"alnum_prop": 0.6174711282203139,
"repo_name": "cloudevents/sdk-python",
"id": "4195fdb6ff8cd96bb322a0574c73a60257f198f1",
"size": "17510",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "cloudevents/tests/test_pydantic_events.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Python",
"bytes": "218008"
}
],
"symlink_target": ""
} |
require 'spec_helper'
RSpec.describe Users::TermsController do
include TermsHelper
let_it_be(:user) { create(:user) }
let(:term) { create(:term) }
before do
sign_in user
end
describe 'GET #index' do
context 'when a user is signed in' do
it 'redirects when no terms exist' do
get :index
expect(response).to redirect_to(root_path)
end
context 'when terms exist' do
before do
stub_env('IN_MEMORY_APPLICATION_SETTINGS', 'false')
term
end
it 'shows terms when they exist' do
get :index
expect(response).to have_gitlab_http_status(:success)
end
it 'shows a message when the user already accepted the terms' do
accept_terms(user)
get :index
expect(controller).to set_flash.now[:notice].to(/already accepted/)
end
end
end
context 'when a user is not signed in' do
before do
sign_out user
end
context 'when terms exist' do
before do
stub_env('IN_MEMORY_APPLICATION_SETTINGS', 'false')
term
end
it 'returns success response' do
get :index
expect(response).to have_gitlab_http_status(:success)
end
end
context 'when no terms exist' do
it 'redirects' do
get :index
expect(response).to redirect_to(root_path)
end
end
end
end
describe 'POST #accept' do
context 'when a user is signed in' do
it 'saves that the user accepted the terms' do
post :accept, params: { id: term.id }
agreement = user.term_agreements.find_by(term: term)
expect(agreement.accepted).to eq(true)
end
it 'redirects to a path when specified' do
post :accept, params: { id: term.id, redirect: groups_path }
expect(response).to redirect_to(groups_path)
end
it 'redirects to the referer when no redirect specified' do
request.env["HTTP_REFERER"] = groups_url
post :accept, params: { id: term.id }
expect(response).to redirect_to(groups_path)
end
context 'redirecting to another domain' do
it 'is prevented when passing a redirect param' do
post :accept, params: { id: term.id, redirect: '//example.com/random/path' }
expect(response).to redirect_to(root_path)
end
it 'is prevented when redirecting to the referer' do
request.env["HTTP_REFERER"] = 'http://example.com/and/a/path'
post :accept, params: { id: term.id }
expect(response).to redirect_to(root_path)
end
end
end
context 'when a user is not signed in' do
before do
sign_out user
end
it 'redirects to login page' do
post :accept, params: { id: term.id }
expect(response).to redirect_to(new_user_session_path)
end
end
end
describe 'POST #decline' do
context 'when a user is signed in' do
it 'stores that the user declined the terms' do
post :decline, params: { id: term.id }
agreement = user.term_agreements.find_by(term: term)
expect(agreement.accepted).to eq(false)
end
it 'signs out the user' do
post :decline, params: { id: term.id }
expect(response).to redirect_to(root_path)
expect(assigns(:current_user)).to be_nil
end
end
context 'when a user is not signed in' do
before do
sign_out user
end
it 'redirects to login page' do
post :decline, params: { id: term.id }
expect(response).to redirect_to(new_user_session_path)
end
end
end
end
| {
"content_hash": "90da39dfe05d04477fb6e866f4363a7d",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 86,
"avg_line_length": 24.12258064516129,
"alnum_prop": 0.5924043861995186,
"repo_name": "mmkassem/gitlabhq",
"id": "0acc300818780eef574f9d8cd461be6ced2e1e1a",
"size": "3770",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "spec/controllers/users/terms_controller_spec.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "113683"
},
{
"name": "CoffeeScript",
"bytes": "139197"
},
{
"name": "Cucumber",
"bytes": "119759"
},
{
"name": "HTML",
"bytes": "447030"
},
{
"name": "JavaScript",
"bytes": "29805"
},
{
"name": "Ruby",
"bytes": "2417833"
},
{
"name": "Shell",
"bytes": "14336"
}
],
"symlink_target": ""
} |
import { h } from 'omi';
import createSvgIcon from './utils/createSvgIcon';
export default createSvgIcon(h("path", {
d: "M10 17l5-5-5-5v10z"
}), 'ArrowRightTwoTone'); | {
"content_hash": "8df69adb7821bf53304320dfe7823891",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 50,
"avg_line_length": 33.6,
"alnum_prop": 0.7023809523809523,
"repo_name": "AlloyTeam/Nuclear",
"id": "0143845fffb29eab27d1dfd5370a6aff3189cd30",
"size": "168",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "components/icon/esm/arrow-right-two-tone.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "6920"
},
{
"name": "HTML",
"bytes": "129087"
},
{
"name": "JavaScript",
"bytes": "416137"
}
],
"symlink_target": ""
} |
<?php
namespace RectorPrefix20210615;
if (\class_exists('Tx_Extbase_Error_Warning')) {
return;
}
class Tx_Extbase_Error_Warning
{
}
\class_alias('Tx_Extbase_Error_Warning', 'Tx_Extbase_Error_Warning', \false);
| {
"content_hash": "6cbe469a75b627f671235018c21e1461",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 77,
"avg_line_length": 19.636363636363637,
"alnum_prop": 0.7175925925925926,
"repo_name": "RectorPHP/Rector",
"id": "d7161cba4bfe03bafbcf57fd3430b305b65f5ea7",
"size": "216",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "vendor/ssch/typo3-rector/stubs/Tx_Extbase_Error_Warning.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "503421"
}
],
"symlink_target": ""
} |
package uk.ac.ebi.phenotype.web.controller;
import org.apache.solr.client.solrj.SolrServerException;
import org.mousephenotype.cda.enumerations.OrderType;
import org.mousephenotype.cda.solr.service.OrderService;
import org.mousephenotype.cda.solr.service.dto.Allele2DTO;
import org.mousephenotype.cda.solr.service.dto.ProductDTO;
import org.mousephenotype.cda.solr.web.dto.OrderTableRow;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Controller
public class OrderController {
@Autowired
OrderService orderService;
/**
*
* @param allele e.g. Thpotm1(KOMP)Vlcg
* @param model
* @param request
* @param attributes
* @return
* @throws SolrServerException, IOException
*/
@RequestMapping("/order")
public String order(@RequestParam (required = true) String acc, @RequestParam (required = true) String allele, @RequestParam (required = true) String type, @RequestParam(required=false, defaultValue="false") boolean creLine,
Model model, HttpServletRequest request, RedirectAttributes attributes) throws SolrServerException, IOException {
System.out.println("orderVector being called with acc="+acc+" allele="+allele);
//type "targeting_vector", "es_cell", "mouse"
OrderType orderType=OrderType.valueOf(type);
Allele2DTO allele2DTO = orderService.getAlleForGeneAndAllele(acc, allele, creLine);
model.addAttribute("allele", allele2DTO);
Map<String, List<ProductDTO>> storeToProductsMap = orderService.getStoreNameToProductsMap(acc, allele, orderType, creLine);
model.addAttribute("storeToProductsMap", storeToProductsMap);
model.addAttribute("type", orderType);
if(creLine){
model.addAttribute("creLine", true);
}
return "order";
}
@RequestMapping("/qcData")
public String qcData(@RequestParam (required= true) String type, @RequestParam (required=true)String productName, @RequestParam (required=true)String alleleName, @RequestParam(required=false, defaultValue="false") boolean creLine, Model model, HttpServletRequest request, RedirectAttributes attributes) throws SolrServerException, IOException {
//get the qc_data list
OrderType orderType=OrderType.valueOf(type);
HashMap<String, HashMap<String, List<String>>> qcData = orderService.getProductQc(orderType, productName, alleleName, creLine);
model.addAttribute("qcData", qcData);
return "qcData";
}
@RequestMapping("/order/creline")
public String creLineAlleles(@RequestParam (required = false) String acc, Model model) throws SolrServerException, IOException{
List<OrderTableRow> orderRows = orderService.getOrderTableRows(acc, null, true);
model.addAttribute("orderRows", orderRows);
model.addAttribute("creLine", true);
model.addAttribute("acc", acc);
return "creLineAlleles";
}
}
| {
"content_hash": "cd8c583b3b4d7fd11fa4cbed118fc8c6",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 346,
"avg_line_length": 42.53333333333333,
"alnum_prop": 0.7821316614420063,
"repo_name": "mpi2/PhenotypeData",
"id": "ef3147737e9b59b21ed9c1360f90926164c68af6",
"size": "3190",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "web/src/main/java/uk/ac/ebi/phenotype/web/controller/OrderController.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "155295"
},
{
"name": "HTML",
"bytes": "5517747"
},
{
"name": "Java",
"bytes": "8735323"
},
{
"name": "JavaScript",
"bytes": "742355"
},
{
"name": "Python",
"bytes": "390859"
},
{
"name": "R",
"bytes": "46188"
},
{
"name": "Shell",
"bytes": "13016"
}
],
"symlink_target": ""
} |
// .NAME vtkShaderCodeLibrary - Library for Hardware Shaders.
// .SECTION Description
// This class provides the hardware shader code.
// .SECTION Thanks
// Shader support in VTK includes key contributions by Gary Templet at
// Sandia National Labs.
#ifndef __vtkShaderCodeLibrary_h
#define __vtkShaderCodeLibrary_h
#include "vtkIOGeometryModule.h" // For export macro
#include "vtkObject.h"
class VTKIOGEOMETRY_EXPORT vtkShaderCodeLibrary : public vtkObject
{
public:
static vtkShaderCodeLibrary* New();
vtkTypeMacro(vtkShaderCodeLibrary, vtkObject);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Obtain the code for the shader with given name.
// Note that Cg shader names are prefixed with CG and
// GLSL shader names are prefixed with GLSL.
// This method allocates memory. It's the responsibility
// of the caller to free this memory.
static char* GetShaderCode(const char* name);
// Description:
// Returns an array of pointers to char strings that are
// the names of the shader codes provided by the library.
// The end of the array is marked by a null pointer.
static const char** GetListOfShaderCodeNames();
// Description:
// Provides for registering shader code. This overrides the compiled in shader
// codes.
static void RegisterShaderCode(const char* name, const char* code);
//BTX
protected:
vtkShaderCodeLibrary();
~vtkShaderCodeLibrary();
private:
vtkShaderCodeLibrary(const vtkShaderCodeLibrary&); // Not implemented.
void operator=(const vtkShaderCodeLibrary&); // Not implemented.
// vtkInternalCleanup is used to destroy Internal ptr when the application
// exits.
class vtkInternalCleanup
{
public:
vtkInternalCleanup() {};
~vtkInternalCleanup();
};
friend class vtkInternalCleanup;
static vtkInternalCleanup Cleanup;
// vtkInternal is used to maintain user registered shader codes.
class vtkInternal;
static vtkInternal* Internal;
//ETX
};
#endif
| {
"content_hash": "3e1bc4b575c84527a57678e0c9f93668",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 80,
"avg_line_length": 28.37142857142857,
"alnum_prop": 0.7457200402819738,
"repo_name": "cjh1/VTK",
"id": "ebff4cb5a22f621c3d1ba3ec1b846f46470f4977",
"size": "2576",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "IO/Geometry/vtkShaderCodeLibrary.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Assembly",
"bytes": "37444"
},
{
"name": "C",
"bytes": "43136914"
},
{
"name": "C++",
"bytes": "53535381"
},
{
"name": "CSS",
"bytes": "7532"
},
{
"name": "Java",
"bytes": "132882"
},
{
"name": "Objective-C",
"bytes": "540710"
},
{
"name": "Pascal",
"bytes": "3255"
},
{
"name": "Perl",
"bytes": "177703"
},
{
"name": "Prolog",
"bytes": "4746"
},
{
"name": "Python",
"bytes": "980726"
},
{
"name": "Shell",
"bytes": "31723"
},
{
"name": "Tcl",
"bytes": "1890698"
}
],
"symlink_target": ""
} |
<html dir="LTR">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252" />
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5" />
<title>EnabledDate Property</title>
<xml>
</xml>
<link rel="stylesheet" type="text/css" href="MSDN.css" />
</head>
<body id="bodyID" class="dtBODY">
<div id="nsbanner">
<div id="bannerrow1">
<table class="bannerparthead" cellspacing="0">
<tr id="hdr">
<td class="runninghead">Apache log4net SDK Documentation - Microsoft .NET Framework 4.0</td>
<td class="product">
</td>
</tr>
</table>
</div>
<div id="TitleRow">
<h1 class="dtH1">OnlyOnceErrorHandler.EnabledDate Property</h1>
</div>
</div>
<div id="nstext">
<p> The date the first error that trigged this error handler occured. </p>
<div class="syntax">
<span class="lang">[Visual Basic]</span>
<br />Public ReadOnly Property EnabledDate As <a href="ms-help://MS.NETFrameworkSDKv1.1/cpref/html/frlrfSystemDateTimeClassTopic.htm">Date</a></div>
<div class="syntax">
<span class="lang">[C#]</span>
<br />public <a href="ms-help://MS.NETFrameworkSDKv1.1/cpref/html/frlrfSystemDateTimeClassTopic.htm">System.DateTime</a> EnabledDate {get;}</div>
<p>
</p>
<h4 class="dtH4">See Also</h4>
<p>
<a href="log4net.Util.OnlyOnceErrorHandler.html">OnlyOnceErrorHandler Class</a> | <a href="log4net.Util.html">log4net.Util Namespace</a></p>
<object type="application/x-oleobject" classid="clsid:1e2a7bd0-dab9-11d0-b93a-00c04fc99f9e" viewastext="true" style="display: none;">
<param name="Keyword" value="EnabledDate property">
</param>
<param name="Keyword" value="EnabledDate property, OnlyOnceErrorHandler class">
</param>
<param name="Keyword" value="OnlyOnceErrorHandler.EnabledDate property">
</param>
</object>
<hr />
<div id="footer"><a href='http://logging.apache.org/log4net/'>Copyright 2004-2013 The Apache Software Foundation.</a><br></br>Apache log4net, Apache and log4net are trademarks of The Apache Software Foundation.</div>
</div>
</body>
</html> | {
"content_hash": "b90cd73436f1bff346e326e41fa28154",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 222,
"avg_line_length": 46.92,
"alnum_prop": 0.618073316283035,
"repo_name": "gersonkurz/manualisator",
"id": "7a69a0cc4c0da4742e2f7d8b4363212af9efdaad",
"size": "2346",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "manualisator/log4net-1.2.13/doc/release/sdk/log4net.Util.OnlyOnceErrorHandler.EnabledDate.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C#",
"bytes": "235121"
},
{
"name": "CSS",
"bytes": "15869"
},
{
"name": "HTML",
"bytes": "9723377"
},
{
"name": "JavaScript",
"bytes": "5685"
},
{
"name": "NSIS",
"bytes": "1916"
},
{
"name": "Shell",
"bytes": "1041"
}
],
"symlink_target": ""
} |
<component name="libraryTable">
<library name="Maven: org.camunda.connect:camunda-connect-http-client:1.0.3">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/camunda/connect/camunda-connect-http-client/1.0.3/camunda-connect-http-client-1.0.3.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/camunda/connect/camunda-connect-http-client/1.0.3/camunda-connect-http-client-1.0.3-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/camunda/connect/camunda-connect-http-client/1.0.3/camunda-connect-http-client-1.0.3-sources.jar!/" />
</SOURCES>
</library>
</component> | {
"content_hash": "47ca395e8720ab87343aec124c3dd277",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 147,
"avg_line_length": 50.76923076923077,
"alnum_prop": 0.6878787878787879,
"repo_name": "frmurillo/digibp-gpsommer",
"id": "620ede3751c302722d68c239681d9bcf31cd927d",
"size": "660",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": ".idea/libraries/Maven__org_camunda_connect_camunda_connect_http_client_1_0_3.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "31020"
},
{
"name": "Java",
"bytes": "3146"
}
],
"symlink_target": ""
} |
package com.example.kevin.helloandroid;
import android.app.Application;
import android.test.ApplicationTestCase;
/**
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
} | {
"content_hash": "bfe92f6175f4f64f591d4aa9743e6cc0",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 93,
"avg_line_length": 27.76923076923077,
"alnum_prop": 0.7534626038781164,
"repo_name": "andymeneely/attack-surface-metrics",
"id": "d7db1ed029e42bd4495141ddc667d005c05e9381",
"size": "361",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tests/HelloAndroid/app/src/androidTest/java/com/example/kevin/helloandroid/ApplicationTest.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "2867"
},
{
"name": "HTML",
"bytes": "11096"
},
{
"name": "Java",
"bytes": "5399"
},
{
"name": "Python",
"bytes": "318916"
},
{
"name": "Shell",
"bytes": "183"
}
],
"symlink_target": ""
} |
'use strict';
import React from 'react';
import {Map} from 'immutable';
import {get} from './actions';
import {flash} from '../flashMessages/actions';
import Component from '../components/component.react';
import Subheader from '../components/subheader.react';
import Spinner from '../components/spinner.react';
class Detail extends Component {
componentDidMount() {
get(this.uuid()).catch(err => {
flash(err.message);
this.redirectToList();
});
}
uuid() {
return this.props.router.getCurrentParams().uuid;
}
redirectToList() {
this.props.router.transitionTo('phones');
}
render() {
const phone = this.props.phones.get(this.uuid());
if (get.pending || !phone)
return <Spinner fullscreen={true} />;
return (
<div>
<Subheader backTitle="Back" router={this.props.router}>
<h1>{phone.hostname} ({phone.netName})</h1>
<h2><strong>IMEI:</strong> {phone.imei}</h2>
</Subheader>
<div id="context">
<strong>Client:</strong> {phone.client}<br />
<strong>Network:</strong> {phone.netName}<br />
<strong>Battery:</strong> {phone.battery}<br />
<strong>Signal:</strong> {phone.signal}<br />
<strong>Sent messages:</strong> {phone.sent}<br />
<strong>Received messages:</strong> {phone.received}<br />
<strong>Sending enabled:</strong> {String(phone.sendEnabled)}<br />
<strong>Receiving enabled:</strong> {String(phone.receiveEnabled)}
</div>
</div>
);
}
}
Detail.propTypes = {
router: React.PropTypes.func,
phones: React.PropTypes.instanceOf(Map).isRequired
};
export default Detail;
| {
"content_hash": "82bb5f2adfbc11c64a2471fa61e7fb78",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 77,
"avg_line_length": 26.96825396825397,
"alnum_prop": 0.6191877575044143,
"repo_name": "VojtechBartos/smsgw",
"id": "c842f70d0dac01fdfc12d895a71a726330ab4bc4",
"size": "1699",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "smsgw/static/js/phones/detail.react.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "34680"
},
{
"name": "HTML",
"bytes": "1155"
},
{
"name": "JavaScript",
"bytes": "143152"
},
{
"name": "Makefile",
"bytes": "212"
},
{
"name": "Mako",
"bytes": "526"
},
{
"name": "Python",
"bytes": "189569"
},
{
"name": "Shell",
"bytes": "464"
}
],
"symlink_target": ""
} |
package org.jruby.rack;
import java.util.Queue;
/**
* Works like the pooling application factory, with the variation that it will
* create all application instances (runtimes) serially, using no extra threads.
*
* @author Ola Bini <ola.bini@gmail.com>
*/
public class SerialPoolingRackApplicationFactory extends PoolingRackApplicationFactory {
public SerialPoolingRackApplicationFactory(RackApplicationFactory factory) {
super(factory);
}
@Override
protected void launchInitialization(final Queue<RackApplication> apps) {
while ( ! apps.isEmpty() ) {
final RackApplication app = apps.remove();
try {
app.init();
applicationPool.add(app);
log(RackLogger.INFO, "added application to pool, size now = " + applicationPool.size());
}
catch (RackInitializationException e) {
log(RackLogger.ERROR, "unable to initialize application", e);
}
}
}
@Override
protected void waitTillPoolReady() {
return; // waiting makes no sense here as we're initializing serialy
}
}
| {
"content_hash": "5da0408d1881473841cafaacce9ef36e",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 104,
"avg_line_length": 30.102564102564102,
"alnum_prop": 0.6345826235093697,
"repo_name": "janrain/jruby-rack",
"id": "45df2af0ab1bf866916da0bcb61876ec4387c9ea",
"size": "1372",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/org/jruby/rack/SerialPoolingRackApplicationFactory.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "301129"
},
{
"name": "JavaScript",
"bytes": "22880"
},
{
"name": "Ruby",
"bytes": "503364"
},
{
"name": "Shell",
"bytes": "5705"
}
],
"symlink_target": ""
} |
using Erato.Model;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Erato.Data
{
/// <summary>
/// 底座 Repository
/// </summary>
public class PedestalRepository
{
#region Field
/// <summary>
/// Repository对象
/// </summary>
private IMongoRepository<Pedestal> repository;
#endregion //Field
#region Constructor
/// <summary>
/// 底座 Repository
/// </summary>
public PedestalRepository()
{
this.repository = new MongoRepository<Pedestal>(RheaServer.EratoDatabase);
}
#endregion //Constructor
#region Method
/// <summary>
/// 获取所有底座
/// </summary>
/// <returns></returns>
public IEnumerable<Pedestal> Get()
{
return this.repository.AsEnumerable();
}
/// <summary>
/// 获取底座
/// </summary>
/// <param name="id">ID</param>
/// <returns></returns>
public Pedestal Get(string id)
{
return this.repository.GetById(id);
}
/// <summary>
/// 添加底座
/// </summary>
/// <param name="data">底座数据</param>
/// <returns></returns>
public ErrorCode Create(Pedestal data)
{
try
{
this.repository.Add(data);
return ErrorCode.Success;
}
catch (Exception)
{
return ErrorCode.Exception;
}
}
/// <summary>
/// 编辑底座
/// </summary>
/// <param name="data">底座数据</param>
/// <returns></returns>
public ErrorCode Update(Pedestal data)
{
try
{
this.repository.Update(data);
}
catch (Exception)
{
return ErrorCode.Exception;
}
return ErrorCode.Success;
}
/// <summary>
/// 删除底座
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public ErrorCode Delete(string id)
{
try
{
this.repository.Delete(id);
}
catch (Exception)
{
return ErrorCode.Exception;
}
return ErrorCode.Success;
}
#endregion //Method
}
}
| {
"content_hash": "78bd86c3965385a5c61491a73c4cf953",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 86,
"avg_line_length": 22.9009009009009,
"alnum_prop": 0.46105428796223447,
"repo_name": "robertzml/Erato",
"id": "1c128c987885adccee5bdee42a933a9904f625c9",
"size": "2616",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop-v0",
"path": "Erato.Data/PedestalRepository.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "99"
},
{
"name": "C#",
"bytes": "911855"
},
{
"name": "CSS",
"bytes": "988194"
},
{
"name": "JavaScript",
"bytes": "2074606"
},
{
"name": "Python",
"bytes": "5845"
}
],
"symlink_target": ""
} |
var Calculator = require('./calculator');
describe("Calculator", function () {
var calculator;
beforeEach(function (){
calculator = Calculator();
});
describe("add()", function () {
it("adds two numbers together", function () {
var numOne = 2;
var numTwo = 6;
var expectedResult = 8;
var actualResult = calculator.add(numOne, numTwo);
expect(actualResult).toEqual(expectedResult);
});
});
}); | {
"content_hash": "6330cf2955eeaa536855b1b3b03e2753",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 56,
"avg_line_length": 22.4,
"alnum_prop": 0.6138392857142857,
"repo_name": "aintgoin2goa/recap",
"id": "276e3d990708208138fe4d9fed3f0476795216d4",
"size": "448",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "node_modules/grunt-jasmine-node-coverage/spec/test_spec.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "113753"
},
{
"name": "Shell",
"bytes": "599"
},
{
"name": "TypeScript",
"bytes": "180438"
}
],
"symlink_target": ""
} |
package com.amazonaws.services.devicefarm.model;
import java.io.Serializable;
import com.amazonaws.AmazonWebServiceRequest;
/**
* <p>
* Represents a request to the get upload operation.
* </p>
*/
public class GetUploadRequest extends AmazonWebServiceRequest implements
Serializable, Cloneable {
/**
* <p>
* The upload's ARN.
* </p>
*/
private String arn;
/**
* <p>
* The upload's ARN.
* </p>
*
* @param arn
* The upload's ARN.
*/
public void setArn(String arn) {
this.arn = arn;
}
/**
* <p>
* The upload's ARN.
* </p>
*
* @return The upload's ARN.
*/
public String getArn() {
return this.arn;
}
/**
* <p>
* The upload's ARN.
* </p>
*
* @param arn
* The upload's ARN.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public GetUploadRequest withArn(String arn) {
setArn(arn);
return this;
}
/**
* Returns a string representation of this object; useful for testing and
* debugging.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getArn() != null)
sb.append("Arn: " + getArn());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof GetUploadRequest == false)
return false;
GetUploadRequest other = (GetUploadRequest) obj;
if (other.getArn() == null ^ this.getArn() == null)
return false;
if (other.getArn() != null
&& other.getArn().equals(this.getArn()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode
+ ((getArn() == null) ? 0 : getArn().hashCode());
return hashCode;
}
@Override
public GetUploadRequest clone() {
return (GetUploadRequest) super.clone();
}
} | {
"content_hash": "fa1d7cad60f648cd601049923d05b58d",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 77,
"avg_line_length": 21.945945945945947,
"alnum_prop": 0.5233990147783252,
"repo_name": "trasa/aws-sdk-java",
"id": "56c5732b6c9b0a07facd5bc78a6b46b7e27d4dea",
"size": "3020",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "aws-java-sdk-devicefarm/src/main/java/com/amazonaws/services/devicefarm/model/GetUploadRequest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "100011199"
},
{
"name": "Scilab",
"bytes": "2354"
}
],
"symlink_target": ""
} |
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
* LogitBoost.java
* Copyright (C) 1999, 2002 University of Waikato, Hamilton, New Zealand
*
*/
package weka.classifiers.meta;
import weka.classifiers.Classifier;
import weka.classifiers.Evaluation;
import weka.classifiers.RandomizableIteratedSingleClassifierEnhancer;
import weka.classifiers.Sourcable;
import weka.core.Attribute;
import weka.core.Capabilities;
import weka.core.Instance;
import weka.core.Instances;
import weka.core.Option;
import weka.core.RevisionUtils;
import weka.core.TechnicalInformation;
import weka.core.TechnicalInformationHandler;
import weka.core.Utils;
import weka.core.WeightedInstancesHandler;
import weka.core.Capabilities.Capability;
import weka.core.TechnicalInformation.Field;
import weka.core.TechnicalInformation.Type;
import java.util.Enumeration;
import java.util.Random;
import java.util.Vector;
/**
<!-- globalinfo-start -->
* Class for performing additive logistic regression. <br/>
* This class performs classification using a regression scheme as the base learner, and can handle multi-class problems. For more information, see<br/>
* <br/>
* J. Friedman, T. Hastie, R. Tibshirani (1998). Additive Logistic Regression: a Statistical View of Boosting. Stanford University.<br/>
* <br/>
* Can do efficient internal cross-validation to determine appropriate number of iterations.
* <p/>
<!-- globalinfo-end -->
*
<!-- technical-bibtex-start -->
* BibTeX:
* <pre>
* @techreport{Friedman1998,
* address = {Stanford University},
* author = {J. Friedman and T. Hastie and R. Tibshirani},
* title = {Additive Logistic Regression: a Statistical View of Boosting},
* year = {1998},
* PS = {http://www-stat.stanford.edu/\~jhf/ftp/boost.ps}
* }
* </pre>
* <p/>
<!-- technical-bibtex-end -->
*
<!-- options-start -->
* Valid options are: <p/>
*
* <pre> -Q
* Use resampling instead of reweighting for boosting.</pre>
*
* <pre> -P <percent>
* Percentage of weight mass to base training on.
* (default 100, reduce to around 90 speed up)</pre>
*
* <pre> -F <num>
* Number of folds for internal cross-validation.
* (default 0 -- no cross-validation)</pre>
*
* <pre> -R <num>
* Number of runs for internal cross-validation.
* (default 1)</pre>
*
* <pre> -L <num>
* Threshold on the improvement of the likelihood.
* (default -Double.MAX_VALUE)</pre>
*
* <pre> -H <num>
* Shrinkage parameter.
* (default 1)</pre>
*
* <pre> -S <num>
* Random number seed.
* (default 1)</pre>
*
* <pre> -I <num>
* Number of iterations.
* (default 10)</pre>
*
* <pre> -D
* If set, classifier is run in debug mode and
* may output additional info to the console</pre>
*
* <pre> -W
* Full name of base classifier.
* (default: weka.classifiers.trees.DecisionStump)</pre>
*
* <pre>
* Options specific to classifier weka.classifiers.trees.DecisionStump:
* </pre>
*
* <pre> -D
* If set, classifier is run in debug mode and
* may output additional info to the console</pre>
*
<!-- options-end -->
*
* Options after -- are passed to the designated learner.<p>
*
* @author Len Trigg (trigg@cs.waikato.ac.nz)
* @author Eibe Frank (eibe@cs.waikato.ac.nz)
* @version $Revision: 9371 $
*/
public class LogitBoost
extends RandomizableIteratedSingleClassifierEnhancer
implements Sourcable, WeightedInstancesHandler, TechnicalInformationHandler {
/** for serialization */
private static final long serialVersionUID = 8627452775249625582L;
/** Array for storing the generated base classifiers.
Note: we are hiding the variable from IteratedSingleClassifierEnhancer*/
protected Classifier [][] m_Classifiers;
/** The number of classes */
protected int m_NumClasses;
/** The number of successfully generated base classifiers. */
protected int m_NumGenerated;
/** The number of folds for the internal cross-validation. */
protected int m_NumFolds = 0;
/** The number of runs for the internal cross-validation. */
protected int m_NumRuns = 1;
/** Weight thresholding. The percentage of weight mass used in training */
protected int m_WeightThreshold = 100;
/** A threshold for responses (Friedman suggests between 2 and 4) */
protected static final double Z_MAX = 3;
/** Dummy dataset with a numeric class */
protected Instances m_NumericClassData;
/** The actual class attribute (for getting class names) */
protected Attribute m_ClassAttribute;
/** Use boosting with reweighting? */
protected boolean m_UseResampling;
/** The threshold on the improvement of the likelihood */
protected double m_Precision = -Double.MAX_VALUE;
/** The value of the shrinkage parameter */
protected double m_Shrinkage = 1;
/** The random number generator used */
protected Random m_RandomInstance = null;
/** The value by which the actual target value for the
true class is offset. */
protected double m_Offset = 0.0;
/** a ZeroR model in case no model can be built from the data */
protected Classifier m_ZeroR;
/**
* Returns a string describing classifier
* @return a description suitable for
* displaying in the explorer/experimenter gui
*/
public String globalInfo() {
return "Class for performing additive logistic regression. \n"
+ "This class performs classification using a regression scheme as the "
+ "base learner, and can handle multi-class problems. For more "
+ "information, see\n\n"
+ getTechnicalInformation().toString() + "\n\n"
+ "Can do efficient internal cross-validation to determine "
+ "appropriate number of iterations.";
}
/**
* Constructor.
*/
public LogitBoost() {
m_Classifier = new weka.classifiers.trees.DecisionStump();
}
/**
* Returns an instance of a TechnicalInformation object, containing
* detailed information about the technical background of this class,
* e.g., paper reference or book this class is based on.
*
* @return the technical information about this class
*/
public TechnicalInformation getTechnicalInformation() {
TechnicalInformation result;
result = new TechnicalInformation(Type.TECHREPORT);
result.setValue(Field.AUTHOR, "J. Friedman and T. Hastie and R. Tibshirani");
result.setValue(Field.YEAR, "1998");
result.setValue(Field.TITLE, "Additive Logistic Regression: a Statistical View of Boosting");
result.setValue(Field.ADDRESS, "Stanford University");
result.setValue(Field.PS, "http://www-stat.stanford.edu/~jhf/ftp/boost.ps");
return result;
}
/**
* String describing default classifier.
*
* @return the default classifier classname
*/
protected String defaultClassifierString() {
return "weka.classifiers.trees.DecisionStump";
}
/**
* Select only instances with weights that contribute to
* the specified quantile of the weight distribution
*
* @param data the input instances
* @param quantile the specified quantile eg 0.9 to select
* 90% of the weight mass
* @return the selected instances
*/
protected Instances selectWeightQuantile(Instances data, double quantile) {
int numInstances = data.numInstances();
Instances trainData = new Instances(data, numInstances);
double [] weights = new double [numInstances];
double sumOfWeights = 0;
for (int i = 0; i < numInstances; i++) {
weights[i] = data.instance(i).weight();
sumOfWeights += weights[i];
}
double weightMassToSelect = sumOfWeights * quantile;
int [] sortedIndices = Utils.sort(weights);
// Select the instances
sumOfWeights = 0;
for (int i = numInstances-1; i >= 0; i--) {
Instance instance = (Instance)data.instance(sortedIndices[i]).copy();
trainData.add(instance);
sumOfWeights += weights[sortedIndices[i]];
if ((sumOfWeights > weightMassToSelect) &&
(i > 0) &&
(weights[sortedIndices[i]] != weights[sortedIndices[i-1]])) {
break;
}
}
if (m_Debug) {
System.err.println("Selected " + trainData.numInstances()
+ " out of " + numInstances);
}
return trainData;
}
/**
* Returns an enumeration describing the available options.
*
* @return an enumeration of all the available options.
*/
public Enumeration listOptions() {
Vector newVector = new Vector(6);
newVector.addElement(new Option(
"\tUse resampling instead of reweighting for boosting.",
"Q", 0, "-Q"));
newVector.addElement(new Option(
"\tPercentage of weight mass to base training on.\n"
+"\t(default 100, reduce to around 90 speed up)",
"P", 1, "-P <percent>"));
newVector.addElement(new Option(
"\tNumber of folds for internal cross-validation.\n"
+"\t(default 0 -- no cross-validation)",
"F", 1, "-F <num>"));
newVector.addElement(new Option(
"\tNumber of runs for internal cross-validation.\n"
+"\t(default 1)",
"R", 1, "-R <num>"));
newVector.addElement(new Option(
"\tThreshold on the improvement of the likelihood.\n"
+"\t(default -Double.MAX_VALUE)",
"L", 1, "-L <num>"));
newVector.addElement(new Option(
"\tShrinkage parameter.\n"
+"\t(default 1)",
"H", 1, "-H <num>"));
Enumeration enu = super.listOptions();
while (enu.hasMoreElements()) {
newVector.addElement(enu.nextElement());
}
return newVector.elements();
}
/**
* Parses a given list of options. <p/>
*
<!-- options-start -->
* Valid options are: <p/>
*
* <pre> -Q
* Use resampling instead of reweighting for boosting.</pre>
*
* <pre> -P <percent>
* Percentage of weight mass to base training on.
* (default 100, reduce to around 90 speed up)</pre>
*
* <pre> -F <num>
* Number of folds for internal cross-validation.
* (default 0 -- no cross-validation)</pre>
*
* <pre> -R <num>
* Number of runs for internal cross-validation.
* (default 1)</pre>
*
* <pre> -L <num>
* Threshold on the improvement of the likelihood.
* (default -Double.MAX_VALUE)</pre>
*
* <pre> -H <num>
* Shrinkage parameter.
* (default 1)</pre>
*
* <pre> -S <num>
* Random number seed.
* (default 1)</pre>
*
* <pre> -I <num>
* Number of iterations.
* (default 10)</pre>
*
* <pre> -D
* If set, classifier is run in debug mode and
* may output additional info to the console</pre>
*
* <pre> -W
* Full name of base classifier.
* (default: weka.classifiers.trees.DecisionStump)</pre>
*
* <pre>
* Options specific to classifier weka.classifiers.trees.DecisionStump:
* </pre>
*
* <pre> -D
* If set, classifier is run in debug mode and
* may output additional info to the console</pre>
*
<!-- options-end -->
*
* Options after -- are passed to the designated learner.<p>
*
* @param options the list of options as an array of strings
* @throws Exception if an option is not supported
*/
public void setOptions(String[] options) throws Exception {
String numFolds = Utils.getOption('F', options);
if (numFolds.length() != 0) {
setNumFolds(Integer.parseInt(numFolds));
} else {
setNumFolds(0);
}
String numRuns = Utils.getOption('R', options);
if (numRuns.length() != 0) {
setNumRuns(Integer.parseInt(numRuns));
} else {
setNumRuns(1);
}
String thresholdString = Utils.getOption('P', options);
if (thresholdString.length() != 0) {
setWeightThreshold(Integer.parseInt(thresholdString));
} else {
setWeightThreshold(100);
}
String precisionString = Utils.getOption('L', options);
if (precisionString.length() != 0) {
setLikelihoodThreshold(new Double(precisionString).
doubleValue());
} else {
setLikelihoodThreshold(-Double.MAX_VALUE);
}
String shrinkageString = Utils.getOption('H', options);
if (shrinkageString.length() != 0) {
setShrinkage(new Double(shrinkageString).
doubleValue());
} else {
setShrinkage(1.0);
}
setUseResampling(Utils.getFlag('Q', options));
if (m_UseResampling && (thresholdString.length() != 0)) {
throw new Exception("Weight pruning with resampling"+
"not allowed.");
}
super.setOptions(options);
}
/**
* Gets the current settings of the Classifier.
*
* @return an array of strings suitable for passing to setOptions
*/
public String [] getOptions() {
String [] superOptions = super.getOptions();
String [] options = new String [superOptions.length + 10];
int current = 0;
if (getUseResampling()) {
options[current++] = "-Q";
} else {
options[current++] = "-P";
options[current++] = "" + getWeightThreshold();
}
options[current++] = "-F"; options[current++] = "" + getNumFolds();
options[current++] = "-R"; options[current++] = "" + getNumRuns();
options[current++] = "-L"; options[current++] = "" + getLikelihoodThreshold();
options[current++] = "-H"; options[current++] = "" + getShrinkage();
System.arraycopy(superOptions, 0, options, current,
superOptions.length);
current += superOptions.length;
while (current < options.length) {
options[current++] = "";
}
return options;
}
/**
* Returns the tip text for this property
* @return tip text for this property suitable for
* displaying in the explorer/experimenter gui
*/
public String shrinkageTipText() {
return "Shrinkage parameter (use small value like 0.1 to reduce "
+ "overfitting).";
}
/**
* Get the value of Shrinkage.
*
* @return Value of Shrinkage.
*/
public double getShrinkage() {
return m_Shrinkage;
}
/**
* Set the value of Shrinkage.
*
* @param newShrinkage Value to assign to Shrinkage.
*/
public void setShrinkage(double newShrinkage) {
m_Shrinkage = newShrinkage;
}
/**
* Returns the tip text for this property
* @return tip text for this property suitable for
* displaying in the explorer/experimenter gui
*/
public String likelihoodThresholdTipText() {
return "Threshold on improvement in likelihood.";
}
/**
* Get the value of Precision.
*
* @return Value of Precision.
*/
public double getLikelihoodThreshold() {
return m_Precision;
}
/**
* Set the value of Precision.
*
* @param newPrecision Value to assign to Precision.
*/
public void setLikelihoodThreshold(double newPrecision) {
m_Precision = newPrecision;
}
/**
* Returns the tip text for this property
* @return tip text for this property suitable for
* displaying in the explorer/experimenter gui
*/
public String numRunsTipText() {
return "Number of runs for internal cross-validation.";
}
/**
* Get the value of NumRuns.
*
* @return Value of NumRuns.
*/
public int getNumRuns() {
return m_NumRuns;
}
/**
* Set the value of NumRuns.
*
* @param newNumRuns Value to assign to NumRuns.
*/
public void setNumRuns(int newNumRuns) {
m_NumRuns = newNumRuns;
}
/**
* Returns the tip text for this property
* @return tip text for this property suitable for
* displaying in the explorer/experimenter gui
*/
public String numFoldsTipText() {
return "Number of folds for internal cross-validation (default 0 "
+ "means no cross-validation is performed).";
}
/**
* Get the value of NumFolds.
*
* @return Value of NumFolds.
*/
public int getNumFolds() {
return m_NumFolds;
}
/**
* Set the value of NumFolds.
*
* @param newNumFolds Value to assign to NumFolds.
*/
public void setNumFolds(int newNumFolds) {
m_NumFolds = newNumFolds;
}
/**
* Returns the tip text for this property
* @return tip text for this property suitable for
* displaying in the explorer/experimenter gui
*/
public String useResamplingTipText() {
return "Whether resampling is used instead of reweighting.";
}
/**
* Set resampling mode
*
* @param r true if resampling should be done
*/
public void setUseResampling(boolean r) {
m_UseResampling = r;
}
/**
* Get whether resampling is turned on
*
* @return true if resampling output is on
*/
public boolean getUseResampling() {
return m_UseResampling;
}
/**
* Returns the tip text for this property
* @return tip text for this property suitable for
* displaying in the explorer/experimenter gui
*/
public String weightThresholdTipText() {
return "Weight threshold for weight pruning (reduce to 90 "
+ "for speeding up learning process).";
}
/**
* Set weight thresholding
*
* @param threshold the percentage of weight mass used for training
*/
public void setWeightThreshold(int threshold) {
m_WeightThreshold = threshold;
}
/**
* Get the degree of weight thresholding
*
* @return the percentage of weight mass used for training
*/
public int getWeightThreshold() {
return m_WeightThreshold;
}
/**
* Returns default capabilities of the classifier.
*
* @return the capabilities of this classifier
*/
public Capabilities getCapabilities() {
Capabilities result = super.getCapabilities();
// class
result.disableAllClasses();
result.disableAllClassDependencies();
result.enable(Capability.NOMINAL_CLASS);
return result;
}
/**
* Builds the boosted classifier
*
* @param data the data to train the classifier with
* @throws Exception if building fails, e.g., can't handle data
*/
public void buildClassifier(Instances data) throws Exception {
m_RandomInstance = new Random(m_Seed);
int classIndex = data.classIndex();
if (m_Classifier == null) {
throw new Exception("A base classifier has not been specified!");
}
if (!(m_Classifier instanceof WeightedInstancesHandler) &&
!m_UseResampling) {
m_UseResampling = true;
}
// can classifier handle the data?
getCapabilities().testWithFail(data);
if (m_Debug) {
System.err.println("Creating copy of the training data");
}
// remove instances with missing class
data = new Instances(data);
data.deleteWithMissingClass();
// only class? -> build ZeroR model
if (data.numAttributes() == 1) {
System.err.println(
"Cannot build model (only class attribute present in data!), "
+ "using ZeroR model instead!");
m_ZeroR = new weka.classifiers.rules.ZeroR();
m_ZeroR.buildClassifier(data);
return;
}
else {
m_ZeroR = null;
}
m_NumClasses = data.numClasses();
m_ClassAttribute = data.classAttribute();
// Create the base classifiers
if (m_Debug) {
System.err.println("Creating base classifiers");
}
m_Classifiers = new Classifier [m_NumClasses][];
for (int j = 0; j < m_NumClasses; j++) {
m_Classifiers[j] = Classifier.makeCopies(m_Classifier,
getNumIterations());
}
// Do we want to select the appropriate number of iterations
// using cross-validation?
int bestNumIterations = getNumIterations();
if (m_NumFolds > 1) {
if (m_Debug) {
System.err.println("Processing first fold.");
}
// Array for storing the results
double[] results = new double[getNumIterations()];
// Iterate throught the cv-runs
for (int r = 0; r < m_NumRuns; r++) {
// Stratify the data
data.randomize(m_RandomInstance);
data.stratify(m_NumFolds);
// Perform the cross-validation
for (int i = 0; i < m_NumFolds; i++) {
// Get train and test folds
Instances train = data.trainCV(m_NumFolds, i, m_RandomInstance);
Instances test = data.testCV(m_NumFolds, i);
// Make class numeric
Instances trainN = new Instances(train);
trainN.setClassIndex(-1);
trainN.deleteAttributeAt(classIndex);
trainN.insertAttributeAt(new Attribute("'pseudo class'"), classIndex);
trainN.setClassIndex(classIndex);
m_NumericClassData = new Instances(trainN, 0);
// Get class values
int numInstances = train.numInstances();
double [][] trainFs = new double [numInstances][m_NumClasses];
double [][] trainYs = new double [numInstances][m_NumClasses];
for (int j = 0; j < m_NumClasses; j++) {
for (int k = 0; k < numInstances; k++) {
trainYs[k][j] = (train.instance(k).classValue() == j) ?
1.0 - m_Offset: 0.0 + (m_Offset / (double)m_NumClasses);
}
}
// Perform iterations
double[][] probs = initialProbs(numInstances);
m_NumGenerated = 0;
double sumOfWeights = train.sumOfWeights();
for (int j = 0; j < getNumIterations(); j++) {
performIteration(trainYs, trainFs, probs, trainN, sumOfWeights);
Evaluation eval = new Evaluation(train);
eval.evaluateModel(this, test);
results[j] += eval.correct();
}
}
}
// Find the number of iterations with the lowest error
double bestResult = -Double.MAX_VALUE;
for (int j = 0; j < getNumIterations(); j++) {
if (results[j] > bestResult) {
bestResult = results[j];
bestNumIterations = j;
}
}
if (m_Debug) {
System.err.println("Best result for " +
bestNumIterations + " iterations: " +
bestResult);
}
}
// Build classifier on all the data
int numInstances = data.numInstances();
double [][] trainFs = new double [numInstances][m_NumClasses];
double [][] trainYs = new double [numInstances][m_NumClasses];
for (int j = 0; j < m_NumClasses; j++) {
for (int i = 0, k = 0; i < numInstances; i++, k++) {
trainYs[i][j] = (data.instance(k).classValue() == j) ?
1.0 - m_Offset: 0.0 + (m_Offset / (double)m_NumClasses);
}
}
// Make class numeric
data.setClassIndex(-1);
data.deleteAttributeAt(classIndex);
data.insertAttributeAt(new Attribute("'pseudo class'"), classIndex);
data.setClassIndex(classIndex);
m_NumericClassData = new Instances(data, 0);
// Perform iterations
double[][] probs = initialProbs(numInstances);
double logLikelihood = logLikelihood(trainYs, probs);
m_NumGenerated = 0;
if (m_Debug) {
System.err.println("Avg. log-likelihood: " + logLikelihood);
}
double sumOfWeights = data.sumOfWeights();
for (int j = 0; j < bestNumIterations; j++) {
double previousLoglikelihood = logLikelihood;
performIteration(trainYs, trainFs, probs, data, sumOfWeights);
logLikelihood = logLikelihood(trainYs, probs);
if (m_Debug) {
System.err.println("Avg. log-likelihood: " + logLikelihood);
}
if (Math.abs(previousLoglikelihood - logLikelihood) < m_Precision) {
return;
}
}
}
/**
* Gets the intial class probabilities.
*
* @param numInstances the number of instances
* @return the initial class probabilities
*/
private double[][] initialProbs(int numInstances) {
double[][] probs = new double[numInstances][m_NumClasses];
for (int i = 0; i < numInstances; i++) {
for (int j = 0 ; j < m_NumClasses; j++) {
probs[i][j] = 1.0 / m_NumClasses;
}
}
return probs;
}
/**
* Computes loglikelihood given class values
* and estimated probablities.
*
* @param trainYs class values
* @param probs estimated probabilities
* @return the computed loglikelihood
*/
private double logLikelihood(double[][] trainYs, double[][] probs) {
double logLikelihood = 0;
for (int i = 0; i < trainYs.length; i++) {
for (int j = 0; j < m_NumClasses; j++) {
if (trainYs[i][j] == 1.0 - m_Offset) {
logLikelihood -= Math.log(probs[i][j]);
}
}
}
return logLikelihood / (double)trainYs.length;
}
/**
* Performs one boosting iteration.
*
* @param trainYs class values
* @param trainFs F scores
* @param probs probabilities
* @param data the data to run the iteration on
* @param origSumOfWeights the original sum of weights
* @throws Exception in case base classifiers run into problems
*/
private void performIteration(double[][] trainYs,
double[][] trainFs,
double[][] probs,
Instances data,
double origSumOfWeights) throws Exception {
if (m_Debug) {
System.err.println("Training classifier " + (m_NumGenerated + 1));
}
// Build the new models
for (int j = 0; j < m_NumClasses; j++) {
if (m_Debug) {
System.err.println("\t...for class " + (j + 1)
+ " (" + m_ClassAttribute.name()
+ "=" + m_ClassAttribute.value(j) + ")");
}
// Make copy because we want to save the weights
Instances boostData = new Instances(data);
// Set instance pseudoclass and weights
for (int i = 0; i < probs.length; i++) {
// Compute response and weight
double p = probs[i][j];
double z, actual = trainYs[i][j];
if (actual == 1 - m_Offset) {
z = 1.0 / p;
if (z > Z_MAX) { // threshold
z = Z_MAX;
}
} else {
z = -1.0 / (1.0 - p);
if (z < -Z_MAX) { // threshold
z = -Z_MAX;
}
}
double w = (actual - p) / z;
// Set values for instance
Instance current = boostData.instance(i);
current.setValue(boostData.classIndex(), z);
current.setWeight(current.weight() * w);
}
// Scale the weights (helps with some base learners)
double sumOfWeights = boostData.sumOfWeights();
double scalingFactor = (double)origSumOfWeights / sumOfWeights;
for (int i = 0; i < probs.length; i++) {
Instance current = boostData.instance(i);
current.setWeight(current.weight() * scalingFactor);
}
// Select instances to train the classifier on
Instances trainData = boostData;
if (m_WeightThreshold < 100) {
trainData = selectWeightQuantile(boostData,
(double)m_WeightThreshold / 100);
} else {
if (m_UseResampling) {
double[] weights = new double[boostData.numInstances()];
for (int kk = 0; kk < weights.length; kk++) {
weights[kk] = boostData.instance(kk).weight();
}
trainData = boostData.resampleWithWeights(m_RandomInstance,
weights);
}
}
// Build the classifier
m_Classifiers[j][m_NumGenerated].buildClassifier(trainData);
}
// Evaluate / increment trainFs from the classifier
for (int i = 0; i < trainFs.length; i++) {
double [] pred = new double [m_NumClasses];
double predSum = 0;
for (int j = 0; j < m_NumClasses; j++) {
pred[j] = m_Shrinkage * m_Classifiers[j][m_NumGenerated]
.classifyInstance(data.instance(i));
predSum += pred[j];
}
predSum /= m_NumClasses;
for (int j = 0; j < m_NumClasses; j++) {
trainFs[i][j] += (pred[j] - predSum) * (m_NumClasses - 1)
/ m_NumClasses;
}
}
m_NumGenerated++;
// Compute the current probability estimates
for (int i = 0; i < trainYs.length; i++) {
probs[i] = probs(trainFs[i]);
}
}
/**
* Returns the array of classifiers that have been built.
*
* @return the built classifiers
*/
public Classifier[][] classifiers() {
Classifier[][] classifiers =
new Classifier[m_NumClasses][m_NumGenerated];
for (int j = 0; j < m_NumClasses; j++) {
for (int i = 0; i < m_NumGenerated; i++) {
classifiers[j][i] = m_Classifiers[j][i];
}
}
return classifiers;
}
/**
* Computes probabilities from F scores
*
* @param Fs the F scores
* @return the computed probabilities
*/
private double[] probs(double[] Fs) {
double maxF = -Double.MAX_VALUE;
for (int i = 0; i < Fs.length; i++) {
if (Fs[i] > maxF) {
maxF = Fs[i];
}
}
double sum = 0;
double[] probs = new double[Fs.length];
for (int i = 0; i < Fs.length; i++) {
probs[i] = Math.exp(Fs[i] - maxF);
sum += probs[i];
}
Utils.normalize(probs, sum);
return probs;
}
/**
* Calculates the class membership probabilities for the given test instance.
*
* @param instance the instance to be classified
* @return predicted class probability distribution
* @throws Exception if instance could not be classified
* successfully
*/
public double [] distributionForInstance(Instance instance)
throws Exception {
// default model?
if (m_ZeroR != null) {
return m_ZeroR.distributionForInstance(instance);
}
instance = (Instance)instance.copy();
instance.setDataset(m_NumericClassData);
double [] pred = new double [m_NumClasses];
double [] Fs = new double [m_NumClasses];
for (int i = 0; i < m_NumGenerated; i++) {
double predSum = 0;
for (int j = 0; j < m_NumClasses; j++) {
pred[j] = m_Shrinkage * m_Classifiers[j][i].classifyInstance(instance);
predSum += pred[j];
}
predSum /= m_NumClasses;
for (int j = 0; j < m_NumClasses; j++) {
Fs[j] += (pred[j] - predSum) * (m_NumClasses - 1)
/ m_NumClasses;
}
}
return probs(Fs);
}
/**
* Returns the boosted model as Java source code.
*
* @param className the classname in the generated code
* @return the tree as Java source code
* @throws Exception if something goes wrong
*/
public String toSource(String className) throws Exception {
if (m_NumGenerated == 0) {
throw new Exception("No model built yet");
}
if (!(m_Classifiers[0][0] instanceof Sourcable)) {
throw new Exception("Base learner " + m_Classifier.getClass().getName()
+ " is not Sourcable");
}
StringBuffer text = new StringBuffer("class ");
text.append(className).append(" {\n\n");
text.append(" private static double RtoP(double []R, int j) {\n"+
" double Rcenter = 0;\n"+
" for (int i = 0; i < R.length; i++) {\n"+
" Rcenter += R[i];\n"+
" }\n"+
" Rcenter /= R.length;\n"+
" double Rsum = 0;\n"+
" for (int i = 0; i < R.length; i++) {\n"+
" Rsum += Math.exp(R[i] - Rcenter);\n"+
" }\n"+
" return Math.exp(R[j]) / Rsum;\n"+
" }\n\n");
text.append(" public static double classify(Object[] i) {\n" +
" double [] d = distribution(i);\n" +
" double maxV = d[0];\n" +
" int maxI = 0;\n"+
" for (int j = 1; j < " + m_NumClasses + "; j++) {\n"+
" if (d[j] > maxV) { maxV = d[j]; maxI = j; }\n"+
" }\n return (double) maxI;\n }\n\n");
text.append(" public static double [] distribution(Object [] i) {\n");
text.append(" double [] Fs = new double [" + m_NumClasses + "];\n");
text.append(" double [] Fi = new double [" + m_NumClasses + "];\n");
text.append(" double Fsum;\n");
for (int i = 0; i < m_NumGenerated; i++) {
text.append(" Fsum = 0;\n");
for (int j = 0; j < m_NumClasses; j++) {
text.append(" Fi[" + j + "] = " + className + '_' +j + '_' + i
+ ".classify(i); Fsum += Fi[" + j + "];\n");
}
text.append(" Fsum /= " + m_NumClasses + ";\n");
text.append(" for (int j = 0; j < " + m_NumClasses + "; j++) {");
text.append(" Fs[j] += (Fi[j] - Fsum) * "
+ (m_NumClasses - 1) + " / " + m_NumClasses + "; }\n");
}
text.append(" double [] dist = new double [" + m_NumClasses + "];\n" +
" for (int j = 0; j < " + m_NumClasses + "; j++) {\n"+
" dist[j] = RtoP(Fs, j);\n"+
" }\n return dist;\n");
text.append(" }\n}\n");
for (int i = 0; i < m_Classifiers.length; i++) {
for (int j = 0; j < m_Classifiers[i].length; j++) {
text.append(((Sourcable)m_Classifiers[i][j])
.toSource(className + '_' + i + '_' + j));
}
}
return text.toString();
}
/**
* Returns description of the boosted classifier.
*
* @return description of the boosted classifier as a string
*/
public String toString() {
// only ZeroR model?
if (m_ZeroR != null) {
StringBuffer buf = new StringBuffer();
buf.append(this.getClass().getName().replaceAll(".*\\.", "") + "\n");
buf.append(this.getClass().getName().replaceAll(".*\\.", "").replaceAll(".", "=") + "\n\n");
buf.append("Warning: No model could be built, hence ZeroR model is used:\n\n");
buf.append(m_ZeroR.toString());
return buf.toString();
}
StringBuffer text = new StringBuffer();
if (m_NumGenerated == 0) {
text.append("LogitBoost: No model built yet.");
// text.append(m_Classifiers[0].toString()+"\n");
} else {
text.append("LogitBoost: Base classifiers and their weights: \n");
for (int i = 0; i < m_NumGenerated; i++) {
text.append("\nIteration "+(i+1));
for (int j = 0; j < m_NumClasses; j++) {
text.append("\n\tClass " + (j + 1)
+ " (" + m_ClassAttribute.name()
+ "=" + m_ClassAttribute.value(j) + ")\n\n"
+ m_Classifiers[j][i].toString() + "\n");
}
}
text.append("Number of performed iterations: " +
m_NumGenerated + "\n");
}
return text.toString();
}
/**
* Returns the revision string.
*
* @return the revision
*/
public String getRevision() {
return RevisionUtils.extract("$Revision: 9371 $");
}
/**
* Main method for testing this class.
*
* @param argv the options
*/
public static void main(String [] argv) {
runClassifier(new LogitBoost(), argv);
}
}
| {
"content_hash": "1d70d0e8d08d402468ce18aa14977d5a",
"timestamp": "",
"source": "github",
"line_count": 1171,
"max_line_length": 153,
"avg_line_length": 29.35269000853971,
"alnum_prop": 0.622337949493774,
"repo_name": "williamClanton/singularity",
"id": "2be0b22f679554e6de40ab6fbb2634559b10842f",
"size": "34372",
"binary": false,
"copies": "6",
"ref": "refs/heads/master",
"path": "weka/src/main/java/weka/classifiers/meta/LogitBoost.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "38272"
},
{
"name": "HTML",
"bytes": "299170"
},
{
"name": "Java",
"bytes": "16004522"
},
{
"name": "JavaScript",
"bytes": "924725"
},
{
"name": "Lex",
"bytes": "7606"
},
{
"name": "Python",
"bytes": "377"
},
{
"name": "R",
"bytes": "26"
}
],
"symlink_target": ""
} |
layout: redirect
newurl: http://pmem.io/libpmemobj-cpp/master/doxygen/search/typedefs_4.html
---
| {
"content_hash": "d207ac76fa08d7ca41585d4693b75ee9",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 75,
"avg_line_length": 32.333333333333336,
"alnum_prop": 0.7731958762886598,
"repo_name": "janekmi/janekmi.github.io",
"id": "f7f7aa0efa7b55fdf548193a0d8a8a0009775b54",
"size": "101",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "nvml/cpp_obj/master/cpp_html/search/typedefs_4.md",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "15152"
},
{
"name": "HTML",
"bytes": "48413"
},
{
"name": "Ruby",
"bytes": "79"
}
],
"symlink_target": ""
} |
module.exports = formatKeys;
/**
* Format input keys recursively.
*
* @param {Object} input
* @param {Function} formatter
* @returns {Object}
*/
function formatKeys(input, formatter) {
if (!input || typeof input !== 'object') {
throw new Error('input is not an object literal or array');
}
if (typeof formatter !== 'function') {
throw new Error('formatter is not a function');
}
if (Array.isArray(input)) {
return input.map(function(val) {
return formatIfObject(val, formatter);
});
}
return Object.keys(input).reduce(function(mem, key) {
var newKey = formatter(key);
mem[newKey] = formatIfObject(input[key], formatter);
return mem;
}, {});
}
// check val isn't null, is an object, and is not an object represented by a string (i.e. Date)
function formatIfObject(val, formatter) {
var parsed = JSON.parse(JSON.stringify(val));
var shouldFormat = val && typeof parsed === 'object';
return shouldFormat ? formatKeys(val, formatter) : val;
}
| {
"content_hash": "66ee66b4a646d143acc5c1b3e5b9dea0",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 95,
"avg_line_length": 26.342105263157894,
"alnum_prop": 0.6633366633366633,
"repo_name": "neoziro/format-keys",
"id": "3626418452df17493e75f26011888ece1f569581",
"size": "1001",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "index.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "2426"
}
],
"symlink_target": ""
} |
typedef struct {
unsigned char red,green,blue;
} PPMPixel;
typedef struct {
int x, y;
PPMPixel *data;
} PPMImage;
typedef struct {
int x, y;
double data[FILTER_SIZE * FILTER_SIZE];
double factor;
double bias;
} Filter;
#endif
| {
"content_hash": "bd2f013e471457a7ec7700f2daa9a73e",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 44,
"avg_line_length": 14.722222222222221,
"alnum_prop": 0.6188679245283019,
"repo_name": "bojdell/cuda-video-project",
"id": "c0c9791bf2eca9a507a6c1af2045d8c1cc8f6403",
"size": "405",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ppm.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "24620"
},
{
"name": "Cuda",
"bytes": "37568"
},
{
"name": "Makefile",
"bytes": "1340"
}
],
"symlink_target": ""
} |
title: News from the Fraser Lab
layout: post
group: news
---
<!-- This loops through the paginated posts -->
{% for post in paginator.posts %}
<hr>
<h2><a href="{{ post.url }}">{{ post.title }}</a></h2>
<p class="author">
<span class="author"><a href="/members#{{post.author}}">{{post.author}}</a></span><br>
<span class="date"><em>{{ post.date | date_to_long_string }}</em></span>
</p>
<div class="content">
{{ post.content }}
</div>
{% endfor %}
<hr>
<!-- This makes links to other paginator pages -->
{% if paginator.total_pages > 1 %}
<ul class="pagination">
<li> {% if paginator.previous_page %} <a href="{{ paginator.previous_page_path }}"> {% endif %} Prev</a> </li>
{% for page in (1..paginator.total_pages) %}
{% if page == paginator.page %}
<li class="active">{{ page }} </li>
{% elsif page == 1 %}
<li><a href="/news/">{{ page }}</a> </li>
{% else %}
<li><a href="/news/page{{ page }}">{{ page }}</a> </li>
{% endif %}
{% endfor %}
<li> {% if paginator.next_page %} <a href="{{ paginator.next_page_path }}"> {% endif %} Next</a></li>
</ul>
{% endif %}
| {
"content_hash": "ec2a44ac102e0f2a16d35a6688e99866",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 119,
"avg_line_length": 30.473684210526315,
"alnum_prop": 0.5492227979274611,
"repo_name": "fraser-lab/fraser-lab.github.io",
"id": "c40242e7dae1e36bd39282b1bdf2ee25fec44b59",
"size": "1162",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "news/index.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "6393"
},
{
"name": "HTML",
"bytes": "3685151"
},
{
"name": "JavaScript",
"bytes": "262590"
},
{
"name": "Ruby",
"bytes": "87"
},
{
"name": "TeX",
"bytes": "3354"
}
],
"symlink_target": ""
} |
var should = require('should'),
supertest = require('supertest'),
testUtils = require('../../../utils/index'),
localUtils = require('./utils'),
moment = require('moment'),
user = testUtils.DataGenerator.forModel.users[0],
models = require('../../../../server/models/index'),
constants = require('../../../../server/lib/constants'),
config = require('../../../../server/config/index'),
security = require('../../../../server/lib/security/index'),
settingsCache = require('../../../../server/services/settings/cache'),
ghost = testUtils.startGhost,
request;
describe('Authentication API', function () {
var accesstoken = '', ghostServer;
describe('auth & authorize', function () {
before(function () {
return ghost()
.then(function (_ghostServer) {
ghostServer = _ghostServer;
request = supertest.agent(config.get('url'));
})
.then(function () {
return localUtils.doAuth(request);
})
.then(function (token) {
accesstoken = token;
});
});
afterEach(function () {
return testUtils.clearBruteData();
});
it('can authenticate', function (done) {
request.post(localUtils.API.getApiQuery('authentication/token'))
.set('Origin', config.get('url'))
.send({
grant_type: 'password',
username: user.email,
password: user.password,
client_id: 'ghost-admin',
client_secret: 'not_available'
})
.expect('Content-Type', /json/)
// TODO: make it possible to override oauth2orize's header so that this is consistent
.expect('Cache-Control', 'no-store')
.expect(200)
.end(function (err, res) {
if (err) {
return done(err);
}
should.not.exist(res.headers['x-cache-invalidate']);
var jsonResponse = res.body,
newAccessToken;
should.exist(jsonResponse.access_token);
should.exist(jsonResponse.refresh_token);
should.exist(jsonResponse.expires_in);
should.exist(jsonResponse.token_type);
models.Accesstoken.findOne({
token: jsonResponse.access_token
}).then(function (_newAccessToken) {
newAccessToken = _newAccessToken;
return models.Refreshtoken.findOne({
token: jsonResponse.refresh_token
});
}).then(function (newRefreshToken) {
newAccessToken.get('issued_by').should.eql(newRefreshToken.id);
done();
}).catch(done);
});
});
it('can\'t authenticate unknown user', function (done) {
request.post(localUtils.API.getApiQuery('authentication/token'))
.set('Origin', config.get('url'))
.set('Accept', 'application/json')
.send({
grant_type: 'password',
username: 'invalid@email.com',
password: user.password,
client_id: 'ghost-admin',
client_secret: 'not_available'
}).expect('Content-Type', /json/)
.expect('Cache-Control', testUtils.cacheRules.private)
.expect(404)
.end(function (err, res) {
if (err) {
return done(err);
}
var jsonResponse = res.body;
should.exist(jsonResponse.errors[0].errorType);
jsonResponse.errors[0].errorType.should.eql('NotFoundError');
done();
});
});
it('can\'t authenticate invalid password user', function (done) {
request.post(localUtils.API.getApiQuery('authentication/token'))
.set('Origin', config.get('url'))
.set('Accept', 'application/json')
.send({
grant_type: 'password',
username: user.email,
password: 'invalid',
client_id: 'ghost-admin',
client_secret: 'not_available'
}).expect('Content-Type', /json/)
.expect('Cache-Control', testUtils.cacheRules.private)
.expect(422)
.end(function (err, res) {
if (err) {
return done(err);
}
var jsonResponse = res.body;
should.exist(jsonResponse.errors[0].errorType);
jsonResponse.errors[0].errorType.should.eql('ValidationError');
done();
});
});
it('can request new access token', function (done) {
request.post(localUtils.API.getApiQuery('authentication/token'))
.set('Origin', config.get('url'))
.send({
grant_type: 'password',
username: user.email,
password: user.password,
client_id: 'ghost-admin',
client_secret: 'not_available'
})
.expect('Content-Type', /json/)
// TODO: make it possible to override oauth2orize's header so that this is consistent
.expect('Cache-Control', 'no-store')
.expect(200)
.end(function (err, res) {
if (err) {
return done(err);
}
var refreshToken = res.body.refresh_token;
models.Accesstoken.findOne({
token: accesstoken
}).then(function (oldAccessToken) {
moment(oldAccessToken.get('expires')).diff(moment(), 'minutes').should.be.above(6);
request.post(localUtils.API.getApiQuery('authentication/token'))
.set('Origin', config.get('url'))
.set('Authorization', 'Bearer ' + accesstoken)
.send({
grant_type: 'refresh_token',
refresh_token: refreshToken,
client_id: 'ghost-admin',
client_secret: 'not_available'
})
.expect('Content-Type', /json/)
// TODO: make it possible to override oauth2orize's header so that this is consistent
.expect('Cache-Control', 'no-store')
.expect(200)
.end(function (err, res) {
if (err) {
return done(err);
}
var jsonResponse = res.body;
should.exist(jsonResponse.access_token);
should.exist(jsonResponse.expires_in);
models.Accesstoken.findOne({
token: accesstoken
}).then(function (oldAccessToken) {
moment(oldAccessToken.get('expires')).diff(moment(), 'minutes').should.be.below(6);
return models.Refreshtoken.findOne({
token: refreshToken
});
}).then(function (refreshTokenModel) {
// NOTE: the static 6 month ms number in our constants are based on 30 days
// We have to compare against the static number. We can't compare against the month in
// the next 6 month dynamically, because each month has a different number of days,
// which results in a different ms number.
moment(Date.now() + constants.SIX_MONTH_MS)
.startOf('day')
.diff(moment(refreshTokenModel.get('expires')).startOf('day'), 'month').should.eql(0);
done();
});
});
});
});
});
it('can\'t request new access token with invalid refresh token', function (done) {
request.post(localUtils.API.getApiQuery('authentication/token'))
.set('Origin', config.get('url'))
.set('Accept', 'application/json')
.send({
grant_type: 'refresh_token',
refresh_token: 'invalid',
client_id: 'ghost-admin',
client_secret: 'not_available'
}).expect('Content-Type', /json/)
.expect('Cache-Control', testUtils.cacheRules.private)
.expect(403)
.end(function (err, res) {
if (err) {
return done(err);
}
var jsonResponse = res.body;
should.exist(jsonResponse.errors[0].errorType);
jsonResponse.errors[0].errorType.should.eql('NoPermissionError');
done();
});
});
it('reset password', function (done) {
models.User.getOwnerUser(testUtils.context.internal)
.then(function (ownerUser) {
var token = security.tokens.resetToken.generateHash({
expires: Date.now() + (1000 * 60),
email: user.email,
dbHash: settingsCache.get('db_hash'),
password: ownerUser.get('password')
});
request.put(localUtils.API.getApiQuery('authentication/passwordreset'))
.set('Origin', config.get('url'))
.set('Accept', 'application/json')
.send({
passwordreset: [{
token: token,
newPassword: 'thisissupersafe',
ne2Password: 'thisissupersafe'
}]
})
.expect('Content-Type', /json/)
.expect('Cache-Control', testUtils.cacheRules.private)
.expect(200)
.end(function (err) {
if (err) {
return done(err);
}
done();
});
})
.catch(done);
});
it('reset password: invalid token', function () {
return request
.put(localUtils.API.getApiQuery('authentication/passwordreset'))
.set('Origin', config.get('url'))
.set('Accept', 'application/json')
.send({
passwordreset: [{
token: 'invalid',
newPassword: 'thisissupersafe',
ne2Password: 'thisissupersafe'
}]
})
.expect('Content-Type', /json/)
.expect('Cache-Control', testUtils.cacheRules.private)
.expect(401);
});
it('revoke token', function () {
return request
.post(localUtils.API.getApiQuery('authentication/revoke'))
.set('Authorization', 'Bearer ' + accesstoken)
.set('Origin', config.get('url'))
.set('Accept', 'application/json')
.send({
token: accesstoken,
token_type_hint: 'access_token'
})
.expect('Content-Type', /json/)
.expect('Cache-Control', testUtils.cacheRules.private)
.expect(200)
.then(() => {
return request
.get(localUtils.API.getApiQuery('posts/'))
.set('Authorization', 'Bearer ' + accesstoken)
.expect(401);
});
});
});
describe('Blog setup', function () {
before(function () {
return ghost({forceStart: true})
.then(function (_ghostServer) {
ghostServer = _ghostServer;
request = supertest.agent(config.get('url'));
});
});
it('is setup? no', function () {
return request
.get(localUtils.API.getApiQuery('authentication/setup'))
.set('Origin', config.get('url'))
.expect('Content-Type', /json/)
.expect(200)
.then((res) => {
res.body.setup[0].status.should.be.false();
});
});
it('complete setup', function () {
return request
.post(localUtils.API.getApiQuery('authentication/setup'))
.set('Origin', config.get('url'))
.send({
setup: [{
name: 'test user',
email: 'test@example.com',
password: 'thisissupersafe',
blogTitle: 'a test blog'
}]
})
.expect('Content-Type', /json/)
.expect(201)
.then((res) => {
const jsonResponse = res.body;
should.exist(jsonResponse.users);
should.not.exist(jsonResponse.meta);
jsonResponse.users.should.have.length(1);
localUtils.API.checkResponse(jsonResponse.users[0], 'user');
const newUser = jsonResponse.users[0];
newUser.id.should.equal(testUtils.DataGenerator.Content.users[0].id);
newUser.name.should.equal('test user');
newUser.email.should.equal('test@example.com');
});
});
it('is setup? yes', function () {
return request
.get(localUtils.API.getApiQuery('authentication/setup'))
.set('Origin', config.get('url'))
.expect('Content-Type', /json/)
.expect(200)
.then((res) => {
res.body.setup[0].status.should.be.true();
});
});
it('complete setup again', function () {
return request
.post(localUtils.API.getApiQuery('authentication/setup'))
.set('Origin', config.get('url'))
.send({
setup: [{
name: 'test user',
email: 'test-leo@example.com',
password: 'thisissupersafe',
blogTitle: 'a test blog'
}]
})
.expect('Content-Type', /json/)
.expect(403);
});
});
describe('Invitation', function () {
before(function () {
return ghost()
.then(function (_ghostServer) {
ghostServer = _ghostServer;
request = supertest.agent(config.get('url'));
// simulates blog setup (initialises the owner)
return localUtils.doAuth(request, 'invites');
});
});
it('try to accept without invite', function () {
return request
.post(localUtils.API.getApiQuery('authentication/invitation'))
.set('Origin', config.get('url'))
.send({
invitation: [{
token: 'lul11111',
password: 'lel123456',
email: 'not-invited@example.org',
name: 'not invited'
}]
})
.expect('Content-Type', /json/)
.expect(404);
});
it('try to accept with invite', function () {
return request
.post(localUtils.API.getApiQuery('authentication/invitation'))
.set('Origin', config.get('url'))
.send({
invitation: [{
token: testUtils.DataGenerator.forKnex.invites[0].token,
password: '12345678910',
email: testUtils.DataGenerator.forKnex.invites[0].email,
name: 'invited'
}]
})
.expect('Content-Type', /json/)
.expect(200);
});
});
});
| {
"content_hash": "21ddecac475a04536ec4bdbd1e0b88ae",
"timestamp": "",
"source": "github",
"line_count": 415,
"max_line_length": 126,
"avg_line_length": 42.57349397590362,
"alnum_prop": 0.4295336201041431,
"repo_name": "Gargol/Ghost",
"id": "8890d55f317253ebbafc21906cc7ab3435f77728",
"size": "17668",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "core/test/regression/api/v0.1/authentication_spec.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "117809"
},
{
"name": "HTML",
"bytes": "167721"
},
{
"name": "JavaScript",
"bytes": "2324264"
},
{
"name": "XSLT",
"bytes": "7177"
}
],
"symlink_target": ""
} |
package scala.tools.selectivecps
import org.junit.Test
class CompilerErrors extends CompilerTesting {
// @Test -- disabled
def infer0 =
expectCPSError("cannot cps-transform expression 8: type arguments [Int(8),String,Int] do not conform to method shiftUnit's type parameter bounds [A,B,C >: B]",
"""|def test(x: => Int @cpsParam[String,Int]) = 7
|
|def main(args: Array[String]) = {
| test(8)
|}""")
@Test def function0 =
expectCPSError("""|type mismatch;
| found : () => Int @scala.util.continuations.cpsParam[Int,Int]
| required: () => Int""".stripMargin,
"""|def main(args: Array[String]): Any = {
| val f = () => shift { k: (Int=>Int) => k(7) }
| val g: () => Int = f
|
| println(reset(g()))
|}""")
@Test def function2 =
expectCPSError(
"""|type mismatch;
| found : () => Int
| required: () => Int @scala.util.continuations.cpsParam[Int,Int]""".stripMargin,
"""|def main(args: Array[String]): Any = {
| val f = () => 7
| val g: () => Int @cps[Int] = f
|
| println(reset(g()))
|}""")
@Test def function3 =
expectCPSError(
"""|type mismatch;
| found : Int @scala.util.continuations.cpsParam[Int,Int]
| required: Int""".stripMargin,
"""|def main(args: Array[String]): Any = {
| val g: () => Int = () => shift { k: (Int=>Int) => k(7) }
|
| println(reset(g()))
|}""")
@Test def infer2 =
expectCPSError("illegal answer type modification: scala.util.continuations.cpsParam[String,Int] andThen scala.util.continuations.cpsParam[String,Int]",
"""|def test(x: => Int @cpsParam[String,Int]) = 7
|
|def sym() = shift { k: (Int => String) => 9 }
|
|
|def main(args: Array[String]): Any = {
| test { sym(); sym() }
|}""")
@Test def `lazy` =
expectCPSError("implementation restriction: cps annotations not allowed on lazy value definitions",
"""|def foo() = {
| lazy val x = shift((k:Unit=>Unit)=>k())
| println(x)
|}
|
|def main(args: Array[String]) = {
| reset {
| foo()
| }
|}""")
@Test def t1929 =
expectCPSError(
"""|type mismatch;
| found : Int @scala.util.continuations.cpsParam[String,String] @scala.util.continuations.cpsSynth
| required: Int @scala.util.continuations.cpsParam[Int,String]""".stripMargin,
"""|def main(args : Array[String]) {
| reset {
| println("up")
| val x = shift((k:Int=>String) => k(8) + k(2))
| println("down " + x)
| val y = shift((k:Int=>String) => k(3))
| println("down2 " + y)
| y + x
| }
|}""")
@Test def t2285 =
expectCPSError(
"""|type mismatch;
| found : Int @scala.util.continuations.cpsParam[String,String] @scala.util.continuations.cpsSynth
| required: Int @scala.util.continuations.cpsParam[Int,String]""".stripMargin,
"""|def bar() = shift { k: (String => String) => k("1") }
|
|def foo() = reset { bar(); 7 }""")
@Test def t2949 =
expectCPSError(
"""|type mismatch;
| found : Int
| required: ? @scala.util.continuations.cpsParam[List[?],Any]""".stripMargin,
"""|def reflect[A,B](xs : List[A]) = shift{ xs.flatMap[B, List[B]] }
|def reify[A, B](x : A @cpsParam[List[A], B]) = reset{ List(x) }
|
|def main(args: Array[String]): Unit = println(reify {
| val x = reflect[Int, Int](List(1,2,3))
| val y = reflect[Int, Int](List(2,4,8))
| x * y
|})""")
@Test def t3718 =
expectCPSError(
"cannot cps-transform malformed (possibly in shift/reset placement) expression",
"scala.util.continuations.reset((_: Any).##)")
@Test def t5314_missing_result_type =
expectCPSError(
"method bar has return statement; needs result type",
"""|def foo(x:Int): Int @cps[Int] = x
|
|def bar(x:Int) = return foo(x)
|
|reset {
| val res = bar(8)
| println(res)
| res
|}""")
@Test def t5314_npe =
expectCPSError(
"method bar has return statement; needs result type",
"def bar(x:Int) = { return x; x } // NPE")
@Test def t5314_return_reset =
expectCPSError(
"return expression not allowed, since method calls CPS method",
"""|val rnd = new scala.util.Random
|
|def foo(x: Int): Int @cps[Int] = shift { k => k(x) }
|
|def bar(x: Int): Int @cps[Int] = return foo(x)
|
|def caller(): Int = {
| val v: Int = reset {
| val res: Int = bar(8)
| if (rnd.nextInt(100) > 50) return 5 // not allowed, since method is calling `reset`
| 42
| }
| v
|}
|
|caller()""")
@Test def t5314_type_error =
expectCPSError(
"""|type mismatch;
| found : Int @scala.util.continuations.cpsParam[Int,Int]
| required: Int @scala.util.continuations.cpsParam[String,String]""".stripMargin,
"""|def foo(x:Int): Int @cps[Int] = shift { k => k(x) }
|
|// should be a type error
|def bar(x:Int): Int @cps[String] = return foo(x)
|
|def caller(): Unit = {
| val v: String = reset {
| val res: Int = bar(8)
| "hello"
| }
|}
|
|caller()""")
@Test def t5445 =
expectCPSError(
"cps annotations not allowed on by-value parameters or value definitions",
"def foo(block: Unit @suspendable ): Unit @suspendable = {}")
@Test def trycatch2 =
expectCPSErrors(2, "only simple cps types allowed in try/catch blocks (found: Int @scala.util.continuations.cpsParam[String,Int])",
"""|def fatal[T]: T = throw new Exception
|def cpsIntStringInt = shift { k:(Int=>String) => k(3); 7 }
|def cpsIntIntString = shift { k:(Int=>Int) => k(3); "7" }
|
|def foo1 = try {
| fatal[Int]
| cpsIntStringInt
|} catch {
| case ex: Throwable =>
| cpsIntStringInt
|}
|
|def foo2 = try {
| fatal[Int]
| cpsIntStringInt
|} catch {
| case ex: Throwable =>
| cpsIntStringInt
|}
|
|
|def main(args: Array[String]): Unit = {
| println(reset { foo1; "3" })
| println(reset { foo2; "3" })
|}""")
}
class CompilerTesting {
private def pluginJar: String = {
val f = sys.props("scala-continuations-plugin.jar")
assert(new java.io.File(f).exists, f)
f
}
def loadPlugin = s"-Xplugin:${pluginJar} -P:continuations:enable"
// note: `code` should have a | margin
def cpsErrorMessages(msg: String, code: String) =
errorMessages(msg, loadPlugin)(s"import scala.util.continuations._\nobject Test {\n${code.stripMargin}\n}")
def expectCPSError(msg: String, code: String) = {
val errors = cpsErrorMessages(msg, code)
assert(errors exists (_ contains msg), errors mkString "\n")
}
def expectCPSErrors(msgCount: Int, msg: String, code: String) = {
val errors = cpsErrorMessages(msg, code)
val errorCount = errors.filter(_ contains msg).length
assert(errorCount == msgCount, s"$errorCount occurrences of \'$msg\' found -- expected $msgCount in:\n${errors mkString "\n"}")
}
// TODO: move to scala.tools.reflect.ToolboxFactory
def errorMessages(errorSnippet: String, compileOptions: String)(code: String): List[String] = {
import scala.tools.reflect._
val m = scala.reflect.runtime.currentMirror
val tb = m.mkToolBox(options = compileOptions) //: ToolBox[m.universe.type]
val fe = tb.frontEnd
try {
tb.eval(tb.parse(code))
Nil
} catch {
case _: ToolBoxError =>
import fe._
infos.toList collect { case Info(_, msg, ERROR) => msg }
}
}
} | {
"content_hash": "bd3686d8364f32b32b2843b16f4738db",
"timestamp": "",
"source": "github",
"line_count": 249,
"max_line_length": 163,
"avg_line_length": 32.94377510040161,
"alnum_prop": 0.534194806778008,
"repo_name": "scala/scala-continuations",
"id": "13a253f9d1e9561b21e3040c12952bf2481dbd8c",
"size": "8491",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "library/src/test/scala/scala/tools/selectivecps/CompilerErrors.scala",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Scala",
"bytes": "145940"
},
{
"name": "Shell",
"bytes": "3936"
}
],
"symlink_target": ""
} |
require "kitchen/terraform/inspec/fail_fast_with_hosts"
require "kitchen/terraform/inspec_runner"
::RSpec.describe ::Kitchen::Terraform::InSpec::FailFastWithHosts do
subject do
described_class.new hosts: hosts, options: options, profile_locations: profile_locations
end
let :hosts do
["host-one", "host-two"]
end
let :options do
{ key: "value" }
end
let :profile_locations do
[]
end
describe "#exec" do
let :inspec_runner_one do
instance_double ::Kitchen::Terraform::InSpecRunner
end
let :inspec_runner_two do
instance_double ::Kitchen::Terraform::InSpecRunner
end
before do
allow(::Kitchen::Terraform::InSpecRunner).to receive(:new).with(
options: { host: "host-one", key: "value" },
profile_locations: profile_locations,
).and_return inspec_runner_one
allow(::Kitchen::Terraform::InSpecRunner).to receive(:new).with(
options: { host: "host-two", key: "value" },
profile_locations: profile_locations,
).and_return inspec_runner_two
end
specify "should run InSpec against each host" do
expect(inspec_runner_one).to receive :exec
expect(inspec_runner_two).to receive :exec
end
after do
subject.exec
end
end
end
| {
"content_hash": "02301988ea9c64ced21c9f9013b1e810",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 92,
"avg_line_length": 25.62,
"alnum_prop": 0.6619828259172521,
"repo_name": "newcontext/kitchen-terraform",
"id": "17d0ab9be0cd608efd26e78f422f18f560fb41fa",
"size": "1899",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "spec/lib/kitchen/terraform/inspec/fail_fast_with_hosts_spec.rb",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Ruby",
"bytes": "116227"
}
],
"symlink_target": ""
} |
<BOUCLE_tous (DOCUMENTS types_documents) {id_document=#ID} {tout}>[
(#REM) on trouvera plusieurs variable de hauteur/largeur
- les balises #HAUTEUR et #LARGEUR
- #ENV{hauteur} et {largeur} correspondant <emb|hauteur=xx...>
- #GET{hauteur} et #GET{largeur} correspondent prioritairement a #ENV,
puis #LARGEUR/HAUTEUR sauf si il y a un controleur
]
#SET{hauteur,#ENV{hauteur,#HAUTEUR}} #SET{largeur,#ENV{largeur,#LARGEUR}}
[(#REM)
Si la taille est zero, mettre une valeur par defaut 320x240
][(#GET{hauteur}|plus{#GET{largeur}}|?{'',
[(#SET{largeur,320})][(#SET{hauteur,240})]
})]
[(#REM)
Pour quicktime il faut ajouter 16 pixels en hauteur
cf. http://article.gmane.org/gmane.comp.web.spip.zone/9231/match=quicktime
][(#EXTENSION|=={mov}|?{#SET{hauteur,#GET{hauteur}|plus{16}}})]
[(#ENV{controls}=={PlayButton}|?{#SET{hauteur,25},''})][
(#ENV{controls}=={PlayButton}|?{#SET{largeur,40},''})][
(#ENV{controls}=={PositionSlider}|?{#SET{hauteur,25},''})][
(#ENV{controls}=={PositionSlider}|?{#SET{largeur,#GET{largeur}|moins{40}},''})
][(#INCLUS|=={embed}|?{[(#ENV{controls,''}|?{'',' '})
<div class='spip_document_#ID_DOCUMENT spip_documents[ spip_documents_(#ENV{align})]'[
style='[(#ENV{align}|match{^(left|right)$}|?{' '})float:#ENV{align};] (#ENV{align,center}|=={center}|?{'',' '})[width:(#GET{largeur}|max{120})px]']>
]})
]
<object width='#GET{largeur}' height='#GET{hauteur}'>
<param name='movie' value='#URL_DOCUMENT' />
<param name='src' value='#URL_DOCUMENT' />
[(#ENV*|env_to_params)]
<embed src='#URL_DOCUMENT' [(#ENV*|env_to_attributs)] width='#GET{largeur}' height='#GET{hauteur}'></embed></object>
[<div class='spip_doc_titre'><strong>(#TITRE)</strong></div>][<div class='spip_doc_descriptif'>(#DESCRIPTIF|PtoBR)[(#NOTES|PtoBR)]</div>]</div>
</BOUCLE_tous>
| {
"content_hash": "7c89376a789a5eb1552111feaf99aec2",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 148,
"avg_line_length": 46.89473684210526,
"alnum_prop": 0.6588103254769921,
"repo_name": "eyeswebcrea/espace-couture-sittler.fr",
"id": "534f0f4cdb7ba5bded9c81afe19e249e31a94ae8",
"size": "1782",
"binary": false,
"copies": "7",
"ref": "refs/heads/master",
"path": "spip/prive/modeles/video.html",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "46548"
},
{
"name": "CSS",
"bytes": "296767"
},
{
"name": "JavaScript",
"bytes": "3622204"
},
{
"name": "PHP",
"bytes": "13761546"
},
{
"name": "Perl",
"bytes": "424"
},
{
"name": "Ruby",
"bytes": "768"
},
{
"name": "Shell",
"bytes": "846"
}
],
"symlink_target": ""
} |
module Jondo
# Defines HTTP request methods
module Request
# Perform an HTTP GET request
def get(path, options={}, raw=false, unformatted=false)
request(:get, path, options, raw, unformatted)
end
# Perform an HTTP POST request
def post(path, options={}, raw=false, unformatted=false)
request(:post, path, options, raw, unformatted)
end
# Perform an HTTP PUT request
def put(path, options={}, raw=false, unformatted=false)
request(:put, path, options, raw, unformatted)
end
# Perform an HTTP DELETE request
def delete(path, options={}, raw=false, unformatted=false)
request(:delete, path, options, raw, unformatted)
end
private
# Perform an HTTP request
def request(method, path, options, raw=false, unformatted=false)
response = connection(raw).send(method) do |request|
path = formatted_path(path) unless unformatted
case method
when :get, :delete
request.url(path, options)
when :post, :put
request.path = path
request.body = options unless options.nil? || options.empty?
end
end
raw ? response : response.body
end
def formatted_path(path)
[path, format].compact.join('.')
end
end
end
| {
"content_hash": "5b82a3bb65221083df918f1f57128112",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 70,
"avg_line_length": 28.644444444444446,
"alnum_prop": 0.6384794414274632,
"repo_name": "Xhatch/jondo",
"id": "f7109342c94007db6d4919b99099c128510f9c54",
"size": "1289",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/jondo/request.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "9659"
}
],
"symlink_target": ""
} |
'''Tests the "helloworld" example.'''
import unittest
import asyncio
from pulsar import send, SERVER_SOFTWARE
from pulsar.apps.http import HttpClient
from pulsar.apps.test import dont_run_with_thread
from .manage import server
class TestFlaskThread(unittest.TestCase):
app_cfg = None
concurrency = 'thread'
@classmethod
def name(cls):
return 'flask_' + cls.concurrency
@classmethod
@asyncio.coroutine
def setUpClass(cls):
s = server(name=cls.name(),
concurrency=cls.concurrency,
bind='127.0.0.1:0')
cls.app_cfg = yield from send('arbiter', 'run', s)
cls.uri = 'http://{0}:{1}'.format(*cls.app_cfg.addresses[0])
cls.client = HttpClient()
@classmethod
def tearDownClass(cls):
if cls.app_cfg is not None:
return send('arbiter', 'kill_actor', cls.app_cfg.name)
@asyncio.coroutine
def testResponse200(self):
c = self.client
response = yield from c.get(self.uri)
self.assertEqual(response.status_code, 200)
content = response.content
self.assertEqual(content, b'Flask Example')
headers = response.headers
self.assertTrue(headers)
self.assertEqual(headers['server'], SERVER_SOFTWARE)
@asyncio.coroutine
def testResponse404(self):
c = self.client
response = yield from c.get('%s/bh' % self.uri)
self.assertEqual(response.status_code, 404)
self.assertEqual(response.content, b'404 Page')
@dont_run_with_thread
class TestFlaskProcess(TestFlaskThread):
concurrency = 'process'
| {
"content_hash": "4746bb625bbb7b8bc602842804aaa154",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 68,
"avg_line_length": 29.053571428571427,
"alnum_prop": 0.6435156730178242,
"repo_name": "dejlek/pulsar",
"id": "09d20019f960fb81b857c07fdd8a5c6c45f843dc",
"size": "1627",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "examples/flaskapp/tests.py",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "553"
},
{
"name": "C++",
"bytes": "1517"
},
{
"name": "CSS",
"bytes": "1302"
},
{
"name": "HTML",
"bytes": "1085"
},
{
"name": "JavaScript",
"bytes": "116"
},
{
"name": "Python",
"bytes": "1149959"
}
],
"symlink_target": ""
} |
package com.base.po;
import javax.persistence.Entity;
import javax.persistence.Id;
@Entity
public class Notification {
@Id
private int id;//通知表id
private String message;//通知内容
private String title;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
}
| {
"content_hash": "62ce502ab1f3f4302c93ce36639d10a2",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 41,
"avg_line_length": 15.617647058823529,
"alnum_prop": 0.6930320150659134,
"repo_name": "pange123/PB_Management",
"id": "e6077d8a860b902e66f1acb46ba3a33487e0cd41",
"size": "545",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "后台页面/src/com/base/po/Notification.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "2198764"
},
{
"name": "CoffeeScript",
"bytes": "1415"
},
{
"name": "HTML",
"bytes": "2679284"
},
{
"name": "Java",
"bytes": "1250013"
},
{
"name": "JavaScript",
"bytes": "5577775"
}
],
"symlink_target": ""
} |
require 'strscan'
module Tcl
module Ruby
class Interpreter
private
def ___string(*arg)
send("___string_#{arg[0]}", *arg[1..-1])
rescue ArgumentError => e
raise(TclArgumentError, "string #{arg[0]}: #{e.message}")
end
def ___string_length(str)
str.length
end
def ___string_equal(*arg)
opts = {}
if arg.size != 2
opts = OptionParser.parse(['nocase', 'length?'], arg)
raise(TclArgumentError, 'string equal ?-nocase? ?-length int? string1 string2') unless arg.size == 2
end
__string_equal_body(*arg, opts)
end
def __string_equal_body(str1, str2, opts = {})
if opts.key?('nocase')
str1 = str1.upcase
str2 = str2.upcase
end
if opts.key?('length')
range = (0...opts['length'].to_i)
(str1[range] == str2[range]) ? '1' : '0'
else
(str1 == str2) ? '1' : '0'
end
end
def ___string_index(str, index)
str[parse_index_format(index)]
end
def ___string_map(*arg)
opts = {}
if arg.size != 2
opts = OptionParser.parse(['nocase'], arg)
raise(TclArgumentError, 'string map ?-nocase? charMap string') unless arg.size == 2
end
__string_map_body(*arg, opts)
end
def __string_map_body(char_map, str, opts = {})
h = parse(char_map, true).to_h
scan = StringScanner.new str
rstr = ''
until scan.empty?
r = h.each do |k, v|
next unless (opts['nocase'] && scan.scan(/#{k}/i)) ||
scan.scan(/#{k}/)
rstr << v
break false
end
rstr << scan.scan(/./) if r
end
rstr
end
def ___string_range(str, first, last)
first = parse_index_format first
last = parse_index_format last
str[first..last]
end
def ___string_repeat(str, count)
str * count.to_i
end
def ___string_tolower(str, first = 0, last = nil)
last ||= str.size
__string_tosomething(str, first, last, :downcase)
end
def __string_tosomething(str, first, last, modifier)
first = parse_index_format first
last = parse_index_format last
str[first..last] = str[first..last].send(modifier)
str
end
def ___string_totitle(str, first = 0, last = -1)
__string_tosomething(str, first, last, :capitalize)
end
def ___string_toupper(str, first = 0, last = -1)
__string_tosomething(str, first, last, :upcase)
end
def ___string_trim(str, chars = '\s')
__string_trimmer(str, chars, 3)
end
def ___string_trimleft(str, chars = '\s')
__string_trimmer(str, chars, 1)
end
def ___string_trimright(str, chars = '\s')
__string_trimmer(str, chars, 2)
end
def __string_trimmer(str, chars, mode)
str.sub!(/\A[#{chars}]+/, '') if mode & 1 != 0
str.sub!(/[#{chars}]+\z/, '') if mode & 2 != 0
str
end
end
end
end
| {
"content_hash": "dfce214531ce20dce08ed4bb46a4292e",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 110,
"avg_line_length": 26.805084745762713,
"alnum_prop": 0.5042680999051533,
"repo_name": "kiyonori-matsumoto/tcl-ruby",
"id": "abd6d440fac45929e51de9964ca8823237454e50",
"size": "3163",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/tcl/ruby/commands/string.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "56063"
},
{
"name": "Shell",
"bytes": "131"
},
{
"name": "Tcl",
"bytes": "414"
}
],
"symlink_target": ""
} |
package org.rapidoid.http.impl;
import org.rapidoid.RapidoidThing;
import org.rapidoid.annotation.Authors;
import org.rapidoid.annotation.Since;
import org.rapidoid.buffer.Buf;
import org.rapidoid.bytes.Bytes;
import org.rapidoid.bytes.BytesUtil;
import org.rapidoid.collection.Coll;
import org.rapidoid.commons.Err;
import org.rapidoid.data.BufRange;
import org.rapidoid.data.BufRanges;
import org.rapidoid.data.KeyValueRanges;
import org.rapidoid.http.HttpContentType;
import org.rapidoid.io.Upload;
import org.rapidoid.log.Log;
import org.rapidoid.net.impl.RapidoidHelper;
import org.rapidoid.u.U;
import org.rapidoid.wrap.IntWrap;
import java.util.List;
import java.util.Map;
import static org.rapidoid.util.Constants.*;
@Authors("Nikolche Mihajlovski")
@Since("2.0.0")
public class HttpParser extends RapidoidThing {
private static final byte[] CONNECTION = "Connection:".getBytes();
private static final byte[] KEEP_ALIVE = "keep-alive".getBytes();
private static final byte[] CONTENT_LENGTH = "Content-Length:".getBytes();
private static final byte[] COOKIE = "Cookie".getBytes();
private static final byte[] CT_MULTIPART_FORM_DATA_BOUNDARY1 = "multipart/form-data; boundary=".getBytes();
private static final byte[] CT_MULTIPART_FORM_DATA_BOUNDARY2 = "multipart/form-data;boundary=".getBytes();
private static final byte[] CT_MULTIPART_FORM_DATA = "multipart/form-data".getBytes();
private static final byte[] CT_FORM_URLENCODED = "application/x-www-form-urlencoded".getBytes();
private static final byte[] CT_JSON = "application/json".getBytes();
private static final byte[] CONTENT_TYPE = "Content-Type".getBytes();
private static final byte[] CONTENT_DISPOSITION = "Content-Disposition".getBytes();
private static final byte[] FORM_DATA = "form-data;".getBytes();
private static final byte[] NAME_EQ = "name=".getBytes();
private static final byte[] FILENAME_EQ = "filename=".getBytes();
private static final byte[] CHARSET_EQ = "charset=".getBytes();
private static final byte[] _UTF_8 = "UTF-8".getBytes();
private static final byte[] _ISO_8859_1 = "ISO-8859-1".getBytes();
private static final byte[] CONTENT_TRANSFER_ENCODING = "Content-Transfer-Encoding".getBytes();
private static final byte[] _7BIT = "7bit".getBytes();
private static final byte[] _8BIT = "8bit".getBytes();
private static final byte[] BINARY = "binary".getBytes();
private static final byte[] GET = "GET".getBytes();
public void parse(Buf buf, RapidoidHelper helper) {
Bytes bytes = buf.bytes();
BufRange protocol = helper.protocol;
BufRanges headers = helper.headers;
buf.scanUntil(SPACE, helper.verb);
buf.scanUntil(SPACE, helper.uri);
buf.scanLn(protocol);
helper.isKeepAlive.value = detectKeepAlive(buf, helper, bytes, protocol, headers);
BytesUtil.split(bytes, helper.uri, ASTERISK, helper.path, helper.query, false);
helper.isGet.value = BytesUtil.matches(bytes, helper.verb, GET, true);
if (!helper.isGet.value) {
parseBody(buf, helper);
}
}
private boolean detectKeepAlive(Buf buf, RapidoidHelper helper, Bytes bytes, BufRange protocol, BufRanges headers) {
IntWrap result = helper.integers[0];
boolean keepAliveByDefault = protocol.isEmpty() || bytes.get(protocol.last()) != '0'; // e.g. HTTP/1.1
// try to detect the opposite of the default
if (keepAliveByDefault) {
buf.scanLnLn(headers.reset(), result, (byte) 's', (byte) 'e'); // clo[se]
} else {
buf.scanLnLn(headers.reset(), result, (byte) 'v', (byte) 'e'); // keep-ali[ve]
}
int possibleConnHeaderPos = result.value;
if (possibleConnHeaderPos < 0) return keepAliveByDefault; // no evidence of the opposite
BufRange possibleConnHdr = headers.get(possibleConnHeaderPos);
if (BytesUtil.startsWith(bytes, possibleConnHdr, CONNECTION, true)) {
return !keepAliveByDefault; // detected the opposite of the default
}
return isKeepAlive(bytes, headers, helper, keepAliveByDefault);
}
private boolean isKeepAlive(Bytes bytes, BufRanges headers, RapidoidHelper helper, boolean keepAliveByDefault) {
BufRange connHdr = headers.getByPrefix(bytes, CONNECTION, false);
return connHdr != null ? getKeepAliveValue(bytes, connHdr, helper) : keepAliveByDefault;
}
private boolean getKeepAliveValue(Bytes bytes, BufRange connHdr, RapidoidHelper helper) {
assert bytes != null;
assert connHdr != null;
BufRange connVal = helper.ranges5.ranges[3];
connVal.setInterval(connHdr.start + CONNECTION.length, connHdr.limit());
BytesUtil.trim(bytes, connVal);
return BytesUtil.matches(bytes, connVal, KEEP_ALIVE, false);
}
private void parseBody(Buf buf, RapidoidHelper helper) {
BufRanges headers = helper.headers;
BufRange body = helper.body;
BufRange clen = headers.getByPrefix(buf.bytes(), CONTENT_LENGTH, false);
if (clen != null) {
BufRange clenValue = helper.ranges5.ranges[helper.ranges5.ranges.length - 1];
clenValue.setInterval(clen.start + CONTENT_LENGTH.length, clen.limit());
BytesUtil.trim(buf.bytes(), clenValue);
long len = buf.getN(clenValue);
U.must(len >= 0 && len <= Integer.MAX_VALUE, "Invalid body size!");
buf.scanN((int) len, body);
Log.debug("Request body complete", "range", body);
} else {
body.reset();
}
}
public void parseParams(Buf buf, KeyValueRanges params, BufRange range) {
parseURLEncodedKV(buf, params, range);
}
private void parseURLEncodedKV(Buf buf, KeyValueRanges params, BufRange body) {
int pos = buf.position();
int limit = buf.limit();
buf.position(body.start);
buf.limit(body.limit());
while (buf.hasRemaining()) {
int ind = params.add();
int which = buf.scanTo(EQ, AMP, params.keys[ind], false);
if (which == 1) {
buf.scanTo(AMP, params.values[ind], false);
}
}
buf.position(pos);
buf.limit(limit);
}
public int parseHeaders(Buf buf, int from, int to, KeyValueRanges headersKV, RapidoidHelper helper) {
int pos = buf.position();
int limit = buf.limit();
buf.position(from);
buf.limit(to);
BufRanges headers = helper.ranges2.reset();
buf.scanLnLn(headers);
parseHeadersIntoKV(buf, headers, headersKV, null, helper);
int bodyPos = buf.position();
buf.position(pos);
buf.limit(limit);
return bodyPos;
}
public void parseHeadersIntoKV(Buf buf, BufRanges headers, KeyValueRanges headersKV, KeyValueRanges cookies,
RapidoidHelper helper) {
BufRange cookie = helper.ranges5.ranges[0];
for (int i = 0; i < headers.count; i++) {
BufRange hdr = headers.ranges[i];
int ind = headersKV.add();
BufRange key = headersKV.keys[ind];
BufRange val = headersKV.values[ind];
assert !hdr.isEmpty();
boolean split = BytesUtil.split(buf.bytes(), hdr, COL, key, val, true);
U.must(split, "Invalid HTTP header!");
if (cookies != null && BytesUtil.matches(buf.bytes(), key, COOKIE, false)) {
headersKV.count--; // don't include cookies in headers
do {
BytesUtil.split(buf.bytes(), val, SEMI_COL, cookie, val, true);
int cind = cookies.add();
BytesUtil.split(buf.bytes(), cookie, EQ, cookies.keys[cind], cookies.values[cind], true);
} while (!val.isEmpty());
}
}
}
/**
* @return <code>false</code> if the data wasn't parsed.
*/
private boolean parseBody(Buf src, KeyValueRanges headers, BufRange body,
KeyValueRanges data, BufRanges dataContentTypes,
Map<String, List<Upload>> files, RapidoidHelper helper) {
if (body.isEmpty()) {
return true;
}
BufRange multipartBoundary = helper.ranges5.ranges[0];
HttpContentType contentType = getContentType(src, headers, multipartBoundary);
switch (contentType) {
case MULTIPART:
if (multipartBoundary.isEmpty()) {
detectMultipartBoundary(src, body, multipartBoundary);
}
helper.bytes[0] = '-';
helper.bytes[1] = '-';
src.get(multipartBoundary, helper.bytes, 2);
Err.rteIf(multipartBoundary.isEmpty(), "Invalid multi-part HTTP request!");
Map<String, List<Upload>> autoFiles = Coll.mapOfLists();
parseMultiParts(src, body, data, dataContentTypes, autoFiles, multipartBoundary, helper);
files.putAll(autoFiles);
return true;
case FORM_URLENCODED:
byte bodyStart = src.get(body.start);
if (bodyStart != '{' && bodyStart != '[' && bodyStart != '<') { // not json nor xml
parseURLEncodedKV(src, data, body);
return true;
} else {
return false;
}
case JSON:
return false;
case OTHER:
return false;
case NOT_FOUND:
return false;
default:
throw Err.notExpected();
}
}
private void detectMultipartBoundary(Buf src, BufRange body, BufRange multipartBoundary) {
BytesUtil.parseLine(src.bytes(), multipartBoundary, body.start, body.limit());
multipartBoundary.strip(2, 0);
}
/* http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.2 */
private void parseMultiParts(Buf src, BufRange body, KeyValueRanges data, BufRanges dataContentTypes,
Map<String, List<Upload>> files, BufRange multipartBoundary, RapidoidHelper helper) {
int start = body.start;
int limit = body.limit();
int sepLen = multipartBoundary.length + 2;
int pos1 = -1, pos2;
try {
while ((pos2 = BytesUtil.find(src.bytes(), start, limit, helper.bytes, 0, sepLen, true)) >= 0) {
if (pos1 >= 0 && pos2 >= 0) {
int from = pos1 + sepLen + 2;
int to = pos2 - 2;
parseMultiPart(src, data, dataContentTypes, files, helper, from, to);
}
pos1 = pos2;
start = pos2 + sepLen;
}
} catch (Throwable e) {
Log.warn("Multipart parse error!", e);
throw U.rte("Multipart data parse error!", e);
}
}
private void parseMultiPart(Buf src, KeyValueRanges data, BufRanges dataContentTypes,
Map<String, List<Upload>> files, RapidoidHelper helper, int from, int to) {
KeyValueRanges headers = helper.headersKV.reset();
BufRange partBody = helper.ranges4.ranges[0];
BufRange contType = helper.ranges4.ranges[1];
BufRange contEnc = helper.ranges4.ranges[2];
BufRange dispo1 = helper.ranges4.ranges[3];
BufRange dispo2 = helper.ranges4.ranges[4];
BufRange name = helper.ranges4.ranges[5];
BufRange filename = helper.ranges4.ranges[6];
BufRange charset = helper.ranges4.ranges[7];
int bodyPos = parseHeaders(src, from, to, headers, helper);
partBody.setInterval(bodyPos, to);
// form-data; name="a" | form-data; name="f2"; filename="test2.txt"
BufRange disposition = headers.get(src, CONTENT_DISPOSITION, false);
if (BytesUtil.startsWith(src.bytes(), disposition, FORM_DATA, false)) {
disposition.strip(FORM_DATA.length, 0);
} else {
return;
}
BytesUtil.split(src.bytes(), disposition, SEMI_COL, dispo1, dispo2, true);
if (!parseDisposition(src, dispo1, dispo2, name, filename)) {
if (!parseDisposition(src, dispo2, dispo1, name, filename)) {
throw U.rte("Unrecognized Content-disposition header!");
}
}
// (OPTIONAL) e.g. application/octet-stream | text/plain;
// charset=ISO-8859-1 | image/svg+xml | text/plain; charset=utf-8 |
// | multipart/mixed; boundary=BbC04y | application/pdf |
// application/vnd.oasis.opendocument.text | image/gif |
// video/mp4; codecs="avc1.640028 | DEFAULT=text/plain
BufRange contentType = headers.get(src, CONTENT_TYPE, false);
contType.reset();
contEnc.reset();
if (Log.isDebugEnabled()) {
checkCharset(src, contType, contEnc, charset, contentType);
}
// (OPTIONAL) e.g. 7bit | 8bit | binary | DEFAULT=7bit
BufRange encoding = headers.get(src, CONTENT_TRANSFER_ENCODING, false);
if (encoding != null) {
boolean validEncoding = BytesUtil.matches(src.bytes(), encoding, _7BIT, false)
|| BytesUtil.matches(src.bytes(), encoding, _8BIT, false)
|| BytesUtil.matches(src.bytes(), encoding, BINARY, false);
Err.rteIf(!validEncoding, "Invalid Content-transfer-encoding header value!");
}
if (filename.isEmpty()) {
int ind = data.add();
data.keys[ind].assign(name);
data.values[ind].assign(partBody);
if (contentType != null) {
dataContentTypes.add(contentType.start, contentType.length);
} else {
dataContentTypes.add();
}
} else {
String uploadParamName = src.get(name);
String uploadFilename = src.get(filename);
byte[] uploadContent = partBody.bytes(src);
files.get(uploadParamName).add(new Upload(uploadFilename, uploadContent));
}
}
private void checkCharset(Buf src, BufRange contType, BufRange contEnc, BufRange charset, BufRange contentType) {
if (contentType != null) {
BytesUtil.split(src.bytes(), contentType, SEMI_COL, contType, contEnc, true);
if (BytesUtil.startsWith(src.bytes(), contEnc, CHARSET_EQ, false)) {
charset.assign(contEnc);
charset.strip(CHARSET_EQ.length, 0);
BytesUtil.trim(src.bytes(), charset);
if (!BytesUtil.matches(src.bytes(), charset, _UTF_8, false)
&& !BytesUtil.matches(src.bytes(), charset, _ISO_8859_1, false)) {
Log.warn("Tipically the UTF-8 and ISO-8859-1 charsets are expected, but received different!",
"charset", src.get(charset));
}
}
}
}
private boolean parseDisposition(Buf src, BufRange dispoA, BufRange dispoB, BufRange name, BufRange filename) {
if (BytesUtil.startsWith(src.bytes(), dispoA, NAME_EQ, false)) {
name.assign(dispoA);
name.strip(NAME_EQ.length, 0);
BytesUtil.trim(src.bytes(), name);
name.strip(1, 1);
if (BytesUtil.startsWith(src.bytes(), dispoB, FILENAME_EQ, false)) {
filename.assign(dispoB);
filename.strip(FILENAME_EQ.length, 0);
BytesUtil.trim(src.bytes(), filename);
filename.strip(1, 1);
} else {
filename.reset();
}
return true;
}
return false;
}
private HttpContentType getContentType(Buf buf, KeyValueRanges headers, BufRange multipartBoundary) {
BufRange contType = headers.get(buf, CONTENT_TYPE, false);
if (contType != null) {
if (BytesUtil.startsWith(buf.bytes(), contType, CT_FORM_URLENCODED, false)) {
multipartBoundary.reset();
return HttpContentType.FORM_URLENCODED;
}
if (BytesUtil.startsWith(buf.bytes(), contType, CT_JSON, false)) {
multipartBoundary.reset();
return HttpContentType.JSON;
}
if (BytesUtil.startsWith(buf.bytes(), contType, CT_MULTIPART_FORM_DATA_BOUNDARY1, false)) {
multipartBoundary.setInterval(contType.start + CT_MULTIPART_FORM_DATA_BOUNDARY1.length,
contType.limit());
return HttpContentType.MULTIPART;
}
if (BytesUtil.startsWith(buf.bytes(), contType, CT_MULTIPART_FORM_DATA_BOUNDARY2, false)) {
multipartBoundary.setInterval(contType.start + CT_MULTIPART_FORM_DATA_BOUNDARY2.length,
contType.limit());
return HttpContentType.MULTIPART;
}
if (BytesUtil.startsWith(buf.bytes(), contType, CT_MULTIPART_FORM_DATA, false)) {
multipartBoundary.reset();
return HttpContentType.MULTIPART;
}
}
multipartBoundary.reset();
return contType != null ? HttpContentType.OTHER : HttpContentType.NOT_FOUND;
}
@SuppressWarnings("unchecked")
public boolean parsePosted(Buf input, KeyValueRanges headersKV, BufRange rBody, KeyValueRanges posted,
Map<String, List<Upload>> files, RapidoidHelper helper, Map<String, Object> dest) {
BufRanges dataContentTypes = helper.ranges3.reset();
boolean completed = parseBody(input, headersKV, rBody, posted, dataContentTypes, files, helper);
posted.toUrlDecodedParams(input, dest, dataContentTypes);
return completed;
}
}
| {
"content_hash": "d2e901a6c13bc71d62df908ea729b695",
"timestamp": "",
"source": "github",
"line_count": 490,
"max_line_length": 120,
"avg_line_length": 36.71224489795918,
"alnum_prop": 0.6002001222969593,
"repo_name": "rapidoid/rapidoid",
"id": "16de42f278b7dd548b35a9a972d97c4db4016501",
"size": "18669",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "rapidoid-http-server/src/main/java/org/rapidoid/http/impl/HttpParser.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "435"
},
{
"name": "CSS",
"bytes": "25393"
},
{
"name": "HTML",
"bytes": "43107"
},
{
"name": "Java",
"bytes": "2973308"
},
{
"name": "JavaScript",
"bytes": "10766"
},
{
"name": "Shell",
"bytes": "12047"
}
],
"symlink_target": ""
} |
def interactive():
"""
Code for all the interactive prompts throughout the chapter.
>>> import myset
>>> s1 = myset.MySet()
>>> s2 = myset.MySet()
>>> s1.add(1)
>>> s2.add('a')
>>> s1.items()
[1]
>>> s2.items()
['a']
>>> myset.MySet.__dict__
[...('__init__', <function __init__ at 0x...>),
('__module__', 'myset'),
('add', <function add at 0x...>),
('items', <function items at 0x...>),
('remove', <function remove at 0x...>)]
>>> s = myset.MySet()
>>> s.__dict__
{'_state': {}}
# Show awfulness of API
>>> import pymel.core as pmc
>>> objname = 'myobj'
>>> _ = pmc.joint(name=objname)
>>> from maya import OpenMaya
>>> sellist = OpenMaya.MSelectionList()
>>> sellist.add(objname) #Can't initialize a list with items.
>>> mobj = OpenMaya.MObject()
>>> sellist.getDependNode(0, mobj) #Pass by reference
>>> jntdepnode = OpenMaya.MFnDependencyNode(mobj) #Function sets
>>> jntdepnode.name()
u'myobj'
## Name to OpenMaya node
>>> trans, shape = pmc.polyCube(name='mynode')
>>> pmc.PyNode('mynode')
nt.Transform(u'mynode')
>>> sellist = OpenMaya.MSelectionList() #(1)
>>> sellist.add('mynode') #(2)
>>> node = OpenMaya.MObject() #(3)
>>> sellist.getDependNode(0, node) #(4)
>>> node #(5)
<maya.OpenMaya.MObject; proxy of <Swig Object of type 'MObject...
## OpenMaya node to name
>>> pynode = trans
>>> mobject = node
>>> pynode.name()
u'mynode'
>>> OpenMaya.MFnDependencyNode(mobject).name()
u'mynode'
>>> p = pmc.PyNode('perspShape')
>>> p.__apimfn__()
<maya.OpenMaya.MFnCamera; proxy of <Swig Object of type 'MFnCa...
>>> p.__apimdagpath__()
<maya.OpenMaya.MDagPath; proxy of <Swig Object of type 'MDagPa...
>>> a = p.focalLength
>>> a
Attribute(u'perspShape.focalLength')
>>> a.__apimplug__()
<maya.OpenMaya.MPlug; proxy of <Swig Object of type 'MPlug *' ...
## Hash
>>> hash(pynode) #doctest: +SKIP
409350872
>>> OpenMaya.MObjectHandle(mobject).hashCode() #doctest: +SKIP
409350872
>>> from maya import OpenMaya, OpenMayaAnim
>>> joint = OpenMayaAnim.MFnIkJoint() #(1)
>>> joint.create()
>>> joint.setDegreesOfFreedom(True, False, True) #(2)
>>> utils = [OpenMaya.MScriptUtil() for su in range(3)] #(3)
>>> ptrs = [su.asBoolPtr() for su in utils] #(4)
>>> joint.getDegreesOfFreedom(*ptrs) #(5)
>>> [OpenMaya.MScriptUtil.getBool(ptr) for ptr in ptrs] #(6)
[1, 0, 1]
>>> import pymel.core, os
>>> for p in os.getenv('MAYA_PLUG_IN_PATH').split(os.pathsep):
... print p
/Users/rgalanakis/Library/Preferences/Autodesk/maya/plug-ins
/Users/Shared/Autodesk/maya/plug-ins
"""
if __name__ == "__main__":
import doctest
doctest.testmod(optionflags=doctest.ELLIPSIS)
ignore = """
> value = False;
> Print(value);
False
> MakeTrue(&value);
> Print(value);
True
"""
ignore2 = """
face_to_vert_inds_and_normals = {
face0_id: [
[vert0_index, vert1_index, vert2_index],
[vert0_norm, vert1_norm, vert2_norm]
],
face1_id: [
[vert1_index, vert2_index, vert3_index],
[vert1_norm, vert2_norm, vert3_norm]
],
...
}
"""
| {
"content_hash": "3a4c4874bff5bd6a7240832919a9f226",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 65,
"avg_line_length": 23.76984126984127,
"alnum_prop": 0.6297161936560934,
"repo_name": "rgalanakis/practicalmayapython",
"id": "81e9b90de72289a36de7a520835f943310a418e6",
"size": "2996",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/chapter7/interactive.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "213109"
},
{
"name": "Shell",
"bytes": "76"
}
],
"symlink_target": ""
} |
function test_simple() {
var canvas = document.getElementById('canvas');
var stage = new Stage(canvas);
var shape = new Shape();
shape.graphics.beginFill('rgba(255,0,0,1)').drawRoundRect(0, 0, 120, 120, 10);
stage.addChild(shape);
stage.update();
}
function test_animation() {
var ss = new SpriteSheet({
"frames": {
"width": 200,
"numFrames": 64,
"regX": 2,
"regY": 2,
"height": 361
},
"animations": { "jump": [26, 63], "run": [0, 25] },
"images": ["./assets/runningGrant.png"]
});
ss.getAnimation("run").frequency = 2;
ss.getAnimation("run").next = "jump";
ss.getAnimation("jump").next = "run";
var bitmapAnimation = new BitmapAnimation(ss);
bitmapAnimation.scaleY = bitmapAnimation.scaleX = .4;
bitmapAnimation.gotoAndPlay("run");
Ticker.setFPS(60);
Ticker.addListener(stage);
stage.addChild(bitmapAnimation);
}
function test_graphics() {
var g = new Graphics();
g.setStrokeStyle(1);
g.beginStroke(Graphics.getRGB(0, 0, 0));
g.beginFill(Graphics.getRGB(255, 0, 0));
g.drawCircle(0, 0, 3);
var s = new Shape(g);
s.x = 100;
s.y = 100;
stage.addChild(s);
stage.update();
var myGraphics: Graphics;
myGraphics.beginStroke("#F00").beginFill("#00F").drawRect(20, 20, 100, 50).draw(myContext2D);
} | {
"content_hash": "43bc5423d09ad7dc8c07ea61a02e33c8",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 97,
"avg_line_length": 27.568627450980394,
"alnum_prop": 0.585348506401138,
"repo_name": "Diullei/DefinitelyTyped_test_proposal",
"id": "180393611eadc2ccc745334bdfcb2562f75b8bd9",
"size": "1445",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "easeljs/easeljs-tests.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "1132"
}
],
"symlink_target": ""
} |
SocialSupport
=============
commonjs module titanium
| {
"content_hash": "d7048a0a8f1e19ae4b5c9e65a41f523c",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 24,
"avg_line_length": 13.5,
"alnum_prop": 0.6481481481481481,
"repo_name": "coe/SocialSupport",
"id": "e930fffce2c8bc5b2a86ad99dcd2c61c40d78c56",
"size": "54",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CoffeeScript",
"bytes": "4697"
},
{
"name": "JavaScript",
"bytes": "0"
}
],
"symlink_target": ""
} |
<?php
namespace ZFBrasil\Test\DoctrineMoneyModule\Form;
use Money\Currency;
use Money\Money;
use PHPUnit_Framework_TestCase as TestCase;
use Zend\Form\FormElementManager;
use ZFBrasil\DoctrineMoneyModule\Form\Factory\MoneyFieldsetFactory;
use ZFBrasil\DoctrineMoneyModule\Form\MoneyFieldset;
/**
* Description of MoneyFieldsetTest.
*
* @author Fábio Carneiro <fahecs@gmail.com>
* @license MIT
*/
class MoneyFieldsetTest extends TestCase
{
public function testCanHydrateMoneyWithInteger()
{
$fieldset = $this->getMoneyFieldset();
$fieldset->bindValues([
'amount' => 500,
'currency' => 'BRL',
]);
$this->assertInstanceOf(Money::class, $fieldset->getObject());
}
/**
* @return MoneyFieldset
*/
private function getMoneyFieldset()
{
$factory = new MoneyFieldsetFactory();
$formManager = $this->getMock(FormElementManager::class);
return $factory($formManager);
}
public function testCanHydrateMoneyWithString()
{
$fieldset = $this->getMoneyFieldset();
$fieldset->bindValues([
'amount' => '500',
'currency' => 'BRL',
]);
$this->assertInstanceOf(Money::class, $fieldset->getObject());
}
}
| {
"content_hash": "d57100845ea6a1955ce6568ba3f715a3",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 70,
"avg_line_length": 24.22641509433962,
"alnum_prop": 0.6401869158878505,
"repo_name": "zfbrasil/doctrine-money-module",
"id": "1caf1189cec1eaef0a5ddd1884036309df5d3e9b",
"size": "1285",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/Form/MoneyFieldsetTest.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "27646"
}
],
"symlink_target": ""
} |
package com.amazonaws.services.directory.model.transform;
import javax.annotation.Generated;
import com.amazonaws.SdkClientException;
import com.amazonaws.services.directory.model.*;
import com.amazonaws.protocol.*;
import com.amazonaws.annotation.SdkInternalApi;
/**
* ResetUserPasswordRequestMarshaller
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class ResetUserPasswordRequestMarshaller {
private static final MarshallingInfo<String> DIRECTORYID_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("DirectoryId").build();
private static final MarshallingInfo<String> USERNAME_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
.marshallLocationName("UserName").build();
private static final MarshallingInfo<String> NEWPASSWORD_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("NewPassword").build();
private static final ResetUserPasswordRequestMarshaller instance = new ResetUserPasswordRequestMarshaller();
public static ResetUserPasswordRequestMarshaller getInstance() {
return instance;
}
/**
* Marshall the given parameter object.
*/
public void marshall(ResetUserPasswordRequest resetUserPasswordRequest, ProtocolMarshaller protocolMarshaller) {
if (resetUserPasswordRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(resetUserPasswordRequest.getDirectoryId(), DIRECTORYID_BINDING);
protocolMarshaller.marshall(resetUserPasswordRequest.getUserName(), USERNAME_BINDING);
protocolMarshaller.marshall(resetUserPasswordRequest.getNewPassword(), NEWPASSWORD_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
}
}
| {
"content_hash": "34b0b5ccbccf2c9d4bb9c0e5b2f40d59",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 158,
"avg_line_length": 42.14,
"alnum_prop": 0.7560512577123872,
"repo_name": "jentfoo/aws-sdk-java",
"id": "eec0c2c5ec1ee01a2c1efbb51b9e054eb54f56ed",
"size": "2687",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "aws-java-sdk-directory/src/main/java/com/amazonaws/services/directory/model/transform/ResetUserPasswordRequestMarshaller.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "270"
},
{
"name": "FreeMarker",
"bytes": "173637"
},
{
"name": "Gherkin",
"bytes": "25063"
},
{
"name": "Java",
"bytes": "356214839"
},
{
"name": "Scilab",
"bytes": "3924"
},
{
"name": "Shell",
"bytes": "295"
}
],
"symlink_target": ""
} |
'use strict';
import {EmitterEvent, EventEmitter, IEmitterEvent, IEventEmitter, ListenerUnbind} from 'vs/base/common/eventEmitter';
import {IDisposable, disposeAll} from 'vs/base/common/lifecycle';
import * as strings from 'vs/base/common/strings';
import {Position} from 'vs/editor/common/core/position';
import {Range} from 'vs/editor/common/core/range';
import {Selection} from 'vs/editor/common/core/selection';
import * as editorCommon from 'vs/editor/common/editorCommon';
import {ViewModelCursors} from 'vs/editor/common/viewModel/viewModelCursors';
import {ViewModelDecorations} from 'vs/editor/common/viewModel/viewModelDecorations';
export interface ILinesCollection {
setTabSize(newTabSize:number, emit:(evenType:string, payload:any)=>void): boolean;
setWrappingColumn(newWrappingColumn:number, columnsForFullWidthChar:number, emit:(evenType:string, payload:any)=>void): boolean;
setWrappingIndent(newWrappingIndent:editorCommon.WrappingIndent, emit:(evenType:string, payload:any)=>void): boolean;
onModelFlushed(versionId:number, emit:(evenType:string, payload:any)=>void): void;
onModelLinesDeleted(versionId:number, fromLineNumber:number, toLineNumber:number, emit:(evenType:string, payload:any)=>void): void;
onModelLinesInserted(versionId:number, fromLineNumber:number, toLineNumber:number, text:string[], emit:(evenType:string, payload:any)=>void): void;
onModelLineChanged(versionId:number, lineNumber:number, newText:string, emit:(evenType:string, payload:any)=>void): boolean;
getOutputLineCount(): number;
getOutputLineContent(outputLineNumber:number): string;
getOutputLineMinColumn(outputLineNumber:number): number;
getOutputLineMaxColumn(outputLineNumber:number): number;
getOutputLineTokens(outputLineNumber:number, inaccurateTokensAcceptable:boolean): editorCommon.IViewLineTokens;
convertOutputPositionToInputPosition(viewLineNumber:number, viewColumn:number): editorCommon.IEditorPosition;
convertInputPositionToOutputPosition(inputLineNumber:number, inputColumn:number): editorCommon.IEditorPosition;
setHiddenAreas(ranges:editorCommon.IRange[], emit:(evenType:string, payload:any)=>void): void;
inputPositionIsVisible(inputLineNumber:number, inputColumn:number): boolean;
dispose(): void;
}
export class ViewModel extends EventEmitter implements editorCommon.IViewModel {
private editorId:number;
private configuration:editorCommon.IConfiguration;
private model:editorCommon.IModel;
private listenersToRemove:ListenerUnbind[];
private _toDispose: IDisposable[];
private lines:ILinesCollection;
private decorations:ViewModelDecorations;
private cursors:ViewModelCursors;
private shouldForceTokenization:boolean;
private getCurrentCenteredModelRange:()=>editorCommon.IEditorRange;
constructor(lines:ILinesCollection, editorId:number, configuration:editorCommon.IConfiguration, model:editorCommon.IModel, getCurrentCenteredModelRange:()=>editorCommon.IEditorRange) {
super();
this.lines = lines;
this.editorId = editorId;
this.configuration = configuration;
this.model = model;
this.getCurrentCenteredModelRange = getCurrentCenteredModelRange;
this.decorations = new ViewModelDecorations(this.editorId, this.configuration, {
convertModelRangeToViewRange: (modelRange:editorCommon.IRange, isWholeLine:boolean) => {
if (isWholeLine) {
return this.convertWholeLineModelRangeToViewRange(modelRange);
}
return this.convertModelRangeToViewRange(modelRange);
}
});
this.decorations.reset(this.model);
this.cursors = new ViewModelCursors(this.configuration, this);
this._updateShouldForceTokenization();
this.listenersToRemove = [];
this._toDispose = [];
this.listenersToRemove.push(this.model.addBulkListener((events:IEmitterEvent[]) => this.onEvents(events)));
this._toDispose.push(this.configuration.onDidChange((e) => {
this.onEvents([new EmitterEvent(editorCommon.EventType.ConfigurationChanged, e)]);
}));
}
public setHiddenAreas(ranges:editorCommon.IRange[]): void {
this.deferredEmit(() => {
let lineMappingChanged = this.lines.setHiddenAreas(ranges, (eventType:string, payload:any) => this.emit(eventType, payload));
if (lineMappingChanged) {
this.emit(editorCommon.ViewEventNames.LineMappingChangedEvent);
this.decorations.onLineMappingChanged((eventType:string, payload:any) => this.emit(eventType, payload));
this.cursors.onLineMappingChanged((eventType:string, payload:any) => this.emit(eventType, payload));
this._updateShouldForceTokenization();
}
});
}
public modelPositionIsVisible(position:editorCommon.IPosition): boolean {
return this.lines.inputPositionIsVisible(position.lineNumber, position.column);
}
public dispose(): void {
this.listenersToRemove.forEach((element) => {
element();
});
this._toDispose = disposeAll(this._toDispose);
this.listenersToRemove = [];
this.decorations.dispose();
this.decorations = null;
this.lines.dispose();
this.lines = null;
this.configuration = null;
this.model = null;
}
private _updateShouldForceTokenization(): void {
this.shouldForceTokenization = (this.lines.getOutputLineCount() <= this.configuration.editor.forcedTokenizationBoundary);
}
private _onTabSizeChange(newTabSize:number): boolean {
var lineMappingChanged = this.lines.setTabSize(newTabSize, (eventType:string, payload:any) => this.emit(eventType, payload));
if (lineMappingChanged) {
this.emit(editorCommon.ViewEventNames.LineMappingChangedEvent);
this.decorations.onLineMappingChanged((eventType:string, payload:any) => this.emit(eventType, payload));
this.cursors.onLineMappingChanged((eventType: string, payload: any) => this.emit(eventType, payload));
this._updateShouldForceTokenization();
}
return lineMappingChanged;
}
private _onWrappingIndentChange(newWrappingIndent:string): boolean {
var lineMappingChanged = this.lines.setWrappingIndent(editorCommon.wrappingIndentFromString(newWrappingIndent), (eventType:string, payload:any) => this.emit(eventType, payload));
if (lineMappingChanged) {
this.emit(editorCommon.ViewEventNames.LineMappingChangedEvent);
this.decorations.onLineMappingChanged((eventType:string, payload:any) => this.emit(eventType, payload));
this.cursors.onLineMappingChanged((eventType: string, payload: any) => this.emit(eventType, payload));
this._updateShouldForceTokenization();
}
return lineMappingChanged;
}
private _restoreCenteredModelRange(range:editorCommon.IEditorRange): void {
// modelLine -> viewLine
var newCenteredViewRange = this.convertModelRangeToViewRange(range);
// Send a reveal event to restore the centered content
var restoreRevealEvent:editorCommon.IViewRevealRangeEvent = {
range: newCenteredViewRange,
verticalType: editorCommon.VerticalRevealType.Center,
revealHorizontal: false
};
this.emit(editorCommon.ViewEventNames.RevealRangeEvent, restoreRevealEvent);
}
private _onWrappingColumnChange(newWrappingColumn:number, columnsForFullWidthChar:number): boolean {
let lineMappingChanged = this.lines.setWrappingColumn(newWrappingColumn, columnsForFullWidthChar, (eventType:string, payload:any) => this.emit(eventType, payload));
if (lineMappingChanged) {
this.emit(editorCommon.ViewEventNames.LineMappingChangedEvent);
this.decorations.onLineMappingChanged((eventType:string, payload:any) => this.emit(eventType, payload));
this.cursors.onLineMappingChanged((eventType: string, payload: any) => this.emit(eventType, payload));
this._updateShouldForceTokenization();
}
return lineMappingChanged;
}
public addEventSource(eventSource:IEventEmitter): void {
this.listenersToRemove.push(eventSource.addBulkListener((events:IEmitterEvent[]) => this.onEvents(events)));
}
private onEvents(events:IEmitterEvent[]): void {
this.deferredEmit(() => {
let hasContentChange = events.some((e) => e.getType() === editorCommon.EventType.ModelContentChanged),
previousCenteredModelRange:editorCommon.IEditorRange;
if (!hasContentChange) {
// We can only convert the current centered view range to the current centered model range if the model has no changes.
previousCenteredModelRange = this.getCurrentCenteredModelRange();
}
let i:number,
len:number,
e: IEmitterEvent,
data:any,
shouldUpdateForceTokenization = false,
modelContentChangedEvent:editorCommon.IModelContentChangedEvent,
hadOtherModelChange = false,
hadModelLineChangeThatChangedLineMapping = false,
revealPreviousCenteredModelRange = false;
for (i = 0, len = events.length; i < len; i++) {
e = events[i];
data = e.getData();
switch (e.getType()) {
case editorCommon.EventType.ModelContentChanged:
modelContentChangedEvent = <editorCommon.IModelContentChangedEvent>data;
switch (modelContentChangedEvent.changeType) {
case editorCommon.EventType.ModelContentChangedFlush:
this.onModelFlushed(<editorCommon.IModelContentChangedFlushEvent>modelContentChangedEvent);
hadOtherModelChange = true;
break;
case editorCommon.EventType.ModelContentChangedLinesDeleted:
this.onModelLinesDeleted(<editorCommon.IModelContentChangedLinesDeletedEvent>modelContentChangedEvent);
hadOtherModelChange = true;
break;
case editorCommon.EventType.ModelContentChangedLinesInserted:
this.onModelLinesInserted(<editorCommon.IModelContentChangedLinesInsertedEvent>modelContentChangedEvent);
hadOtherModelChange = true;
break;
case editorCommon.EventType.ModelContentChangedLineChanged:
hadModelLineChangeThatChangedLineMapping = this.onModelLineChanged(<editorCommon.IModelContentChangedLineChangedEvent>modelContentChangedEvent);
break;
default:
console.info('ViewModel received unknown event: ');
console.info(e);
}
shouldUpdateForceTokenization = true;
break;
case editorCommon.EventType.ModelTokensChanged:
this.onModelTokensChanged(<editorCommon.IModelTokensChangedEvent>data);
break;
case editorCommon.EventType.ModelModeChanged:
// That's ok, a model tokens changed event will follow shortly
break;
case editorCommon.EventType.ModelModeSupportChanged:
// That's ok, no work to do
break;
case editorCommon.EventType.ModelContentChanged2:
// Ignore
break;
case editorCommon.EventType.ModelDecorationsChanged:
this.onModelDecorationsChanged(<editorCommon.IModelDecorationsChangedEvent>data);
break;
case editorCommon.EventType.ModelDispose:
// Ignore, since the editor will take care of this and destroy the view shortly
break;
case editorCommon.EventType.CursorPositionChanged:
this.onCursorPositionChanged(<editorCommon.ICursorPositionChangedEvent>data);
break;
case editorCommon.EventType.CursorSelectionChanged:
this.onCursorSelectionChanged(<editorCommon.ICursorSelectionChangedEvent>data);
break;
case editorCommon.EventType.CursorRevealRange:
this.onCursorRevealRange(<editorCommon.ICursorRevealRangeEvent>data);
break;
case editorCommon.EventType.CursorScrollRequest:
this.onCursorScrollRequest(<editorCommon.ICursorScrollRequestEvent>data);
break;
case editorCommon.EventType.ConfigurationChanged:
revealPreviousCenteredModelRange = this._onTabSizeChange(this.configuration.getIndentationOptions().tabSize) || revealPreviousCenteredModelRange;
revealPreviousCenteredModelRange = this._onWrappingIndentChange(this.configuration.editor.wrappingIndent) || revealPreviousCenteredModelRange;
revealPreviousCenteredModelRange = this._onWrappingColumnChange(this.configuration.editor.wrappingInfo.wrappingColumn, this.configuration.editor.typicalFullwidthCharacterWidth / this.configuration.editor.typicalHalfwidthCharacterWidth) || revealPreviousCenteredModelRange;
if ((<editorCommon.IConfigurationChangedEvent>data).readOnly) {
// Must read again all decorations due to readOnly filtering
this.decorations.reset(this.model);
var decorationsChangedEvent:editorCommon.IViewDecorationsChangedEvent = {
inlineDecorationsChanged: false
};
this.emit(editorCommon.ViewEventNames.DecorationsChangedEvent, decorationsChangedEvent);
}
this.emit(e.getType(), <editorCommon.IConfigurationChangedEvent>data);
break;
default:
console.info('View received unknown event: ');
console.info(e);
}
}
if (shouldUpdateForceTokenization) {
this._updateShouldForceTokenization();
}
if (!hadOtherModelChange && hadModelLineChangeThatChangedLineMapping) {
this.emit(editorCommon.ViewEventNames.LineMappingChangedEvent);
this.decorations.onLineMappingChanged((eventType:string, payload:any) => this.emit(eventType, payload));
this.cursors.onLineMappingChanged((eventType: string, payload: any) => this.emit(eventType, payload));
this._updateShouldForceTokenization();
}
if (revealPreviousCenteredModelRange && previousCenteredModelRange) {
this._restoreCenteredModelRange(previousCenteredModelRange);
}
});
}
// --- begin inbound event conversion
private onModelFlushed(e:editorCommon.IModelContentChangedFlushEvent): void {
this.lines.onModelFlushed(e.versionId, (eventType:string, payload:any) => this.emit(eventType, payload));
this.decorations.reset(this.model);
}
private onModelDecorationsChanged(e:editorCommon.IModelDecorationsChangedEvent): void {
this.decorations.onModelDecorationsChanged(e, (eventType:string, payload:any) => this.emit(eventType, payload));
}
private onModelLinesDeleted(e:editorCommon.IModelContentChangedLinesDeletedEvent): void {
this.lines.onModelLinesDeleted(e.versionId, e.fromLineNumber, e.toLineNumber, (eventType:string, payload:any) => this.emit(eventType, payload));
}
private onModelTokensChanged(e:editorCommon.IModelTokensChangedEvent): void {
var viewStartLineNumber = this.convertModelPositionToViewPosition(e.fromLineNumber, 1).lineNumber;
var viewEndLineNumber = this.convertModelPositionToViewPosition(e.toLineNumber, this.model.getLineMaxColumn(e.toLineNumber)).lineNumber;
var e:editorCommon.IViewTokensChangedEvent = {
fromLineNumber: viewStartLineNumber,
toLineNumber: viewEndLineNumber
};
this.emit(editorCommon.ViewEventNames.TokensChangedEvent, e);
}
private onModelLineChanged(e:editorCommon.IModelContentChangedLineChangedEvent): boolean {
var lineMappingChanged = this.lines.onModelLineChanged(e.versionId, e.lineNumber, e.detail, (eventType:string, payload:any) => this.emit(eventType, payload));
return lineMappingChanged;
}
private onModelLinesInserted(e:editorCommon.IModelContentChangedLinesInsertedEvent): void {
this.lines.onModelLinesInserted(e.versionId, e.fromLineNumber, e.toLineNumber, e.detail.split('\n'), (eventType:string, payload:any) => this.emit(eventType, payload));
}
public validateViewRange(viewStartLineNumber:number, viewStartColumn:number, viewEndLineNumber:number, viewEndColumn:number, modelRange:editorCommon.IEditorRange): editorCommon.IEditorRange {
var validViewStart = this.validateViewPosition(viewStartColumn, viewStartColumn, modelRange.getStartPosition());
var validViewEnd = this.validateViewPosition(viewEndLineNumber, viewEndColumn, modelRange.getEndPosition());
return new Range(validViewStart.lineNumber, validViewStart.column, validViewEnd.lineNumber, validViewEnd.column);
}
public validateViewPosition(viewLineNumber:number, viewColumn:number, modelPosition:editorCommon.IEditorPosition): editorCommon.IEditorPosition {
if (viewLineNumber < 1) {
viewLineNumber = 1;
}
var lineCount = this.getLineCount();
if (viewLineNumber > lineCount) {
viewLineNumber = lineCount;
}
var viewMinColumn = this.getLineMinColumn(viewLineNumber);
var viewMaxColumn = this.getLineMaxColumn(viewLineNumber);
if (viewColumn < viewMinColumn) {
viewColumn = viewMinColumn;
}
if (viewColumn > viewMaxColumn) {
viewColumn = viewMaxColumn;
}
var computedModelPosition = this.convertViewPositionToModelPosition(viewLineNumber, viewColumn);
if (computedModelPosition.equals(modelPosition)) {
return new Position(viewLineNumber, viewColumn);
}
return this.convertModelPositionToViewPosition(modelPosition.lineNumber, modelPosition.column);
}
public validateViewSelection(viewSelection:editorCommon.IEditorSelection, modelSelection:editorCommon.IEditorSelection): editorCommon.IEditorSelection {
let modelSelectionStart = new Position(modelSelection.selectionStartLineNumber, modelSelection.selectionStartColumn);
let modelPosition = new Position(modelSelection.positionLineNumber, modelSelection.positionColumn);
let viewSelectionStart = this.validateViewPosition(viewSelection.selectionStartLineNumber, viewSelection.selectionStartColumn, modelSelectionStart);
let viewPosition = this.validateViewPosition(viewSelection.positionLineNumber, viewSelection.positionColumn, modelPosition);
return new Selection(viewSelectionStart.lineNumber, viewSelectionStart.column, viewPosition.lineNumber, viewPosition.column);
}
private onCursorPositionChanged(e:editorCommon.ICursorPositionChangedEvent): void {
this.cursors.onCursorPositionChanged(e, (eventType:string, payload:any) => this.emit(eventType, payload));
}
private onCursorSelectionChanged(e:editorCommon.ICursorSelectionChangedEvent): void {
this.cursors.onCursorSelectionChanged(e, (eventType:string, payload:any) => this.emit(eventType, payload));
}
private onCursorRevealRange(e:editorCommon.ICursorRevealRangeEvent): void {
this.cursors.onCursorRevealRange(e, (eventType:string, payload:any) => this.emit(eventType, payload));
}
private onCursorScrollRequest(e:editorCommon.ICursorScrollRequestEvent): void {
this.cursors.onCursorScrollRequest(e, (eventType:string, payload:any) => this.emit(eventType, payload));
}
// --- end inbound event conversion
public getLineCount(): number {
return this.lines.getOutputLineCount();
}
public getLineContent(lineNumber:number): string {
return this.lines.getOutputLineContent(lineNumber);
}
public getLineMinColumn(lineNumber:number): number {
return this.lines.getOutputLineMinColumn(lineNumber);
}
public getLineMaxColumn(lineNumber:number): number {
return this.lines.getOutputLineMaxColumn(lineNumber);
}
public getLineFirstNonWhitespaceColumn(lineNumber: number): number {
var result = strings.firstNonWhitespaceIndex(this.getLineContent(lineNumber));
if (result === -1) {
return 0;
}
return result + 1;
}
public getLineLastNonWhitespaceColumn(lineNumber: number): number {
var result = strings.lastNonWhitespaceIndex(this.getLineContent(lineNumber));
if (result === -1) {
return 0;
}
return result + 2;
}
public getLineTokens(lineNumber:number): editorCommon.IViewLineTokens {
return this.lines.getOutputLineTokens(lineNumber, !this.shouldForceTokenization);
}
public getLineRenderLineNumber(viewLineNumber:number): string {
var modelPosition = this.convertViewPositionToModelPosition(viewLineNumber, 1);
if (modelPosition.column !== 1) {
return '';
}
var modelLineNumber = modelPosition.lineNumber;
if (typeof this.configuration.editor.lineNumbers === 'function') {
return this.configuration.editor.lineNumbers(modelLineNumber);
}
return modelLineNumber.toString();
}
public getDecorationsResolver(startLineNumber:number, endLineNumber:number): editorCommon.IViewModelDecorationsResolver {
return this.decorations.getDecorationsResolver(startLineNumber, endLineNumber);
}
public getAllDecorations(): editorCommon.IModelDecoration[] {
return this.decorations.getAllDecorations();
}
public getEOL(): string {
return this.model.getEOL();
}
public getValueInRange(range:editorCommon.IRange, eol:editorCommon.EndOfLinePreference): string {
var modelRange = this.convertViewRangeToModelRange(range);
return this.model.getValueInRange(modelRange, eol);
}
public getModelLineContent(modelLineNumber:number): string {
return this.model.getLineContent(modelLineNumber);
}
public getSelections(): editorCommon.IEditorSelection[] {
return this.cursors.getSelections();
}
public getModelLineMaxColumn(modelLineNumber:number): number {
return this.model.getLineMaxColumn(modelLineNumber);
}
public validateModelPosition(position:editorCommon.IPosition): editorCommon.IEditorPosition {
return this.model.validatePosition(position);
}
public convertViewPositionToModelPosition(viewLineNumber:number, viewColumn:number): editorCommon.IEditorPosition {
return this.lines.convertOutputPositionToInputPosition(viewLineNumber, viewColumn);
}
public convertViewRangeToModelRange(viewRange:editorCommon.IRange): editorCommon.IEditorRange {
var start = this.convertViewPositionToModelPosition(viewRange.startLineNumber, viewRange.startColumn);
var end = this.convertViewPositionToModelPosition(viewRange.endLineNumber, viewRange.endColumn);
return new Range(start.lineNumber, start.column, end.lineNumber, end.column);
}
public convertModelPositionToViewPosition(modelLineNumber:number, modelColumn:number): editorCommon.IEditorPosition {
return this.lines.convertInputPositionToOutputPosition(modelLineNumber, modelColumn);
}
public convertModelSelectionToViewSelection(modelSelection:editorCommon.IEditorSelection): editorCommon.IEditorSelection {
var selectionStart = this.convertModelPositionToViewPosition(modelSelection.selectionStartLineNumber, modelSelection.selectionStartColumn);
var position = this.convertModelPositionToViewPosition(modelSelection.positionLineNumber, modelSelection.positionColumn);
return new Selection(selectionStart.lineNumber, selectionStart.column, position.lineNumber, position.column);
}
public convertModelRangeToViewRange(modelRange:editorCommon.IRange): editorCommon.IEditorRange {
var start = this.convertModelPositionToViewPosition(modelRange.startLineNumber, modelRange.startColumn);
var end = this.convertModelPositionToViewPosition(modelRange.endLineNumber, modelRange.endColumn);
return new Range(start.lineNumber, start.column, end.lineNumber, end.column);
}
public convertWholeLineModelRangeToViewRange(modelRange:editorCommon.IRange): editorCommon.IEditorRange {
var start = this.convertModelPositionToViewPosition(modelRange.startLineNumber, 1);
var end = this.convertModelPositionToViewPosition(modelRange.endLineNumber, this.model.getLineMaxColumn(modelRange.endLineNumber));
return new Range(start.lineNumber, start.column, end.lineNumber, end.column);
}
} | {
"content_hash": "4825534a5324c0a11deb3096d9d6c647",
"timestamp": "",
"source": "github",
"line_count": 496,
"max_line_length": 278,
"avg_line_length": 45.63911290322581,
"alnum_prop": 0.7904757697574767,
"repo_name": "punker76/vscode",
"id": "92c841ef10811e09b566d3edc09a281b698c9079",
"size": "22988",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/vs/editor/common/viewModel/viewModel.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "AppleScript",
"bytes": "1296"
},
{
"name": "Batchfile",
"bytes": "1222"
},
{
"name": "CSS",
"bytes": "434362"
},
{
"name": "HTML",
"bytes": "31019"
},
{
"name": "JavaScript",
"bytes": "8335235"
},
{
"name": "Shell",
"bytes": "5734"
},
{
"name": "TypeScript",
"bytes": "10139448"
}
],
"symlink_target": ""
} |
import datetime
import unittest
from wallabag import Wallabag
class TestWallabag(unittest.TestCase):
host = 'http://localhost:8000'
client_id = ''
client_secret = ''
token = ''
def setUp(self):
access_token = self.test_get_token()
self.format = 'json'
self.w = Wallabag(host=self.host,
token=access_token,
client_id=self.client_id,
client_secret=self.client_secret)
def test_get_token(self):
params = {"grant_type": "password",
"client_id":
'1_4wqe1riwt0qoks844kwc4go08koogkgk88go4cckkwg0408kcg',
"client_secret": '4mzw3qwi1xyc0cks4k80s4c8kco40wwkkkw0g40kwk4o4c44co',
"username": 'wallabag',
"password": 'wallabag'}
print(self.host)
data = Wallabag.get_token(host=self.host, **params)
print(data)
self.assertTrue(isinstance(data, str), True)
return data
def create_entry(self):
title = 'foobar title'
url = 'https://somwhere.over.the.raibow.com/'
tags = ['foo', 'bar']
starred = 0
archive = 0
content = '<p>Additional content</p>'
language = 'FR'
published_at = datetime.datetime.now()
authors = 'John Doe'
public = 0
original_url = 'http://localhost'
data = self.w.post_entries(url, title, tags, starred, archive, content, language, published_at, authors,
public, original_url)
return data
def test_get_entries(self):
params = {'delete': 0,
'sort': 'created',
'order': 'desc',
'page': 1,
'perPage': 30,
'tags': []}
data = self.w.get_entries(**params)
self.assertIsInstance(data, dict)
def test_get_entry(self):
entry = 1
self.assertTrue(isinstance(entry, int), True)
data = self.w.get_entry(entry)
self.assertTrue(data, str)
def test_get_entry_tags(self):
entry = 1
self.assertTrue(isinstance(entry, int), True)
data = self.w.get_entry_tags(entry)
self.assertIsInstance(data, list)
def test_get_tags(self):
data = self.w.get_tags()
self.assertIsInstance(data, list)
def test_post_entries(self):
data = self.create_entry()
self.assertTrue(data, True)
def test_patch_entries(self):
entry = 1
params = {'title': 'I change the title',
'archive': 0,
'tags': ["bimbo", "pipo"],
'order': 'asc',
'star': 0,
'delete': 0}
self.assertTrue(isinstance(entry, int), True)
self.assertTrue(isinstance(params, dict), True)
data = self.w.patch_entries(entry, **params)
self.assertTrue(data, True)
def test_delete_entries(self):
entry = self.create_entry()
self.assertTrue(isinstance(entry['id'], int), True)
data = self.w.delete_entries(entry['id'])
self.assertTrue(data, True)
def test_post_entry_tags(self):
entry = 1
self.assertTrue(isinstance(entry, int), True)
tags = ['foo', 'bar']
self.assertTrue(isinstance(tags, list), True)
data = self.w.post_entry_tags(entry, tags)
self.assertTrue(data, True)
"""
def test_delete_entry_tag(self):
entry = self.create_entry()
tag = 'bar'
self.assertTrue(isinstance(entry['id'], int), True)
self.assertTrue(isinstance(tag, str), True)
resp = self.w.delete_entry_tag(entry['id'], tag)
self.assertTrue(resp, True)
"""
if __name__ == '__main__':
unittest.main()
| {
"content_hash": "0197d5c5d7b2e35c863d25f5f4d83e30",
"timestamp": "",
"source": "github",
"line_count": 120,
"max_line_length": 112,
"avg_line_length": 31.95,
"alnum_prop": 0.5422535211267606,
"repo_name": "foxmask/wallabag_api",
"id": "056ac5c165b336ec6a4b468cf92c274e899024bb",
"size": "3850",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "wallabag_api/wallabag_test.py",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Python",
"bytes": "24838"
}
],
"symlink_target": ""
} |
title: Компонент React Accordion
components: Accordion, AccordionActions, AccordionDetails, AccordionSummary
githubLabel: 'component: Accordion'
materialDesign: https://material.io/archive/guidelines/components/expansion-panels.html
waiAria: 'https://www.w3.org/TR/wai-aria-practices/#accordion'
---
# Accordion
<p class="description">Аккордеоны содержат потоки создания и позволяют осуществить легковесное редактирование элемента.</p>
[Accordion](https://material.io/archive/guidelines/components/expansion-panels.html) это простой контейнер, который может использоваться отдельно, либо как часть более крупного компонента, такого как Card (карточка).
{{"component": "modules/components/ComponentLinkHeader.js"}}
> **На заметку:** Аккордеоны больше не задокументированы в [руководствах Material Design](https://material.io/), но Material-UI будет продолжать поддерживать их. Ранее они были известны как "expansion panels".
## Простая Accordion
{{"demo": "pages/components/accordion/SimpleAccordion.js", "bg": true}}
## Контролируемый аккордеон
Используя компонент `Accordion`, расширив его поведение по умолчанию, можно получить "аккордеон".
{{"demo": "pages/components/accordion/ControlledAccordions.js", "bg": true}}
## Customized accordions
Ниже находится пример кастомизации компонента. You can learn more about this in the [overrides documentation page](/customization/how-to-customize/).
{{"demo": "pages/components/accordion/CustomizedAccordions.js"}}
## Производительность
Содержимое аккордеонов монтируется по умолчанию, даже если панель не развернута. Это поведение подразумевает рендеринг на стороне сервера и SEO. Если внутри аккордеона находятся ресурсоемкие, для рендеринга, иерархии компонентов или просто на странице много аккордеонов, то возможно хорошей идеей будет изменить поведение по умолчанию включив `unmountOnExit` в `TransitionProps`:
```jsx
<Accordion TransitionProps={{ unmountOnExit: true }} />
```
Как и при любой оптимизации производительности, эта функция не панацея. Сначала идентифицируйте узкие места и лишь затем пытайтесь применить эти стратегии.
## Доступность
(WAI-ARIA: https://www.w3.org/TR/wai-aria-practices/#accordion)
Для оптимальной доступности мы рекомендуем установить `id` и `aria-controls` на `AccordionSummary`. `Accordion` унаследует необходимые `aria-labelbyby` и `id` для области содержимого панели.
| {
"content_hash": "046566f7e1e9b6ee8292373381e3ce8e",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 379,
"avg_line_length": 49.479166666666664,
"alnum_prop": 0.7987368421052632,
"repo_name": "callemall/material-ui",
"id": "b3a3de8fd91cca80b19fa75059e543e95f1b3f04",
"size": "3384",
"binary": false,
"copies": "1",
"ref": "refs/heads/next",
"path": "docs/src/pages/components/accordion/accordion-ru.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "302"
},
{
"name": "JavaScript",
"bytes": "1758519"
},
{
"name": "Shell",
"bytes": "144"
},
{
"name": "TypeScript",
"bytes": "27469"
}
],
"symlink_target": ""
} |
WYSIWYG edit for AngularJS
Install from npm repository
```
npm install my-editor
```
[Demo](http://itryapitsin.github.io/my-editor/)
Add links to scrips
```
<script src="js/my-editor-tpl.js"></script>
<script src="js/my-editor.js"></script>
```
Add modules to your AngularJS application
```
angular.module('my-editor-example-app', ['my-editor', 'my-editor-tpl', ...])
```
Add my-editor tag to you HTML page
```
<my-editor data-ng-model="text"></my-editor>
```
Check result :) | {
"content_hash": "a15ed5490245bffd730f73246380b840",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 76,
"avg_line_length": 15.67741935483871,
"alnum_prop": 0.6748971193415638,
"repo_name": "itryapitsin/my-editor",
"id": "d34dc083db58244dc7bfe5fe4e2a91c874838222",
"size": "498",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "153117"
},
{
"name": "HTML",
"bytes": "2267"
},
{
"name": "JavaScript",
"bytes": "1377639"
}
],
"symlink_target": ""
} |
package org.hisp.dhis.webapi.controller.dataelement;
import org.hisp.dhis.dataelement.DataElementGroupSet;
import org.hisp.dhis.schema.descriptors.DataElementGroupSetSchemaDescriptor;
import org.hisp.dhis.webapi.controller.AbstractCrudController;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
/**
* @author Morten Olav Hansen <mortenoh@gmail.com>
*/
@Controller
@RequestMapping( value = DataElementGroupSetSchemaDescriptor.API_ENDPOINT )
public class DataElementGroupSetController
extends AbstractCrudController<DataElementGroupSet>
{
}
| {
"content_hash": "281dbb1605305bf13f3082fa79ee65b6",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 76,
"avg_line_length": 34.05555555555556,
"alnum_prop": 0.8417618270799347,
"repo_name": "msf-oca-his/dhis2-core",
"id": "71dce5ef6e7ff0962ea14248cfef6638c61c5527",
"size": "2169",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "dhis-2/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/dataelement/DataElementGroupSetController.java",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "186517"
},
{
"name": "Dockerfile",
"bytes": "2280"
},
{
"name": "HTML",
"bytes": "69119"
},
{
"name": "Java",
"bytes": "30867122"
},
{
"name": "JavaScript",
"bytes": "958564"
},
{
"name": "PLpgSQL",
"bytes": "60867"
},
{
"name": "Ruby",
"bytes": "1011"
},
{
"name": "SCSS",
"bytes": "4229"
},
{
"name": "Shell",
"bytes": "21208"
},
{
"name": "XSLT",
"bytes": "8451"
}
],
"symlink_target": ""
} |
{-# LANGUAGE CPP, DeriveDataTypeable #-}
------------------------------------------------------------------------------
-- |
-- Module: Database.PostgreSQL.Simple.Copy
-- Copyright: (c) 2013 Leon P Smith
-- License: BSD3
-- Maintainer: Leon P Smith <leon@melding-monads.com>
-- Stability: experimental
--
-- mid-level support for COPY IN and COPY OUT. See
-- <https://www.postgresql.org/docs/9.5/static/sql-copy.html> for
-- more information.
--
-- To use this binding, first call 'copy' with an appropriate
-- query as documented in the link above. Then, in the case of a
-- @COPY TO STDOUT@ query, call 'getCopyData' repeatedly until it
-- returns 'CopyOutDone'. In the case of a @COPY FROM STDIN@
-- query, call 'putCopyData' repeatedly and then finish by calling
-- either 'putCopyEnd' to proceed or 'putCopyError' to abort.
--
-- You cannot issue another query on the same connection while a copy
-- is ongoing; this will result in an exception. It is harmless to
-- concurrently call @getNotification@ on a connection while it is in
-- a @CopyIn@ or @CopyOut@ state, however be aware that current versions
-- of the PostgreSQL backend will not deliver notifications to a client
-- while a transaction is ongoing.
--
------------------------------------------------------------------------------
module Database.PostgreSQL.Simple.Copy
( copy
, copy_
, CopyOutResult(..)
, getCopyData
, putCopyData
, putCopyEnd
, putCopyError
) where
import Control.Applicative
import Control.Concurrent
import Control.Exception ( throwIO )
import qualified Data.Attoparsec.ByteString.Char8 as P
import Data.Typeable(Typeable)
import Data.Int(Int64)
import qualified Data.ByteString.Char8 as B
import qualified Database.PostgreSQL.LibPQ as PQ
import Database.PostgreSQL.Simple
import Database.PostgreSQL.Simple.Types
import Database.PostgreSQL.Simple.Internal hiding (result, row)
-- | Issue a @COPY FROM STDIN@ or @COPY TO STDOUT@ query. In the former
-- case, the connection's state will change to @CopyIn@; in the latter,
-- @CopyOut@. The connection must be in the ready state in order
-- to call this function. Performs parameter subsitution.
copy :: ( ToRow params ) => Connection -> Query -> params -> IO ()
copy conn template qs = do
q <- formatQuery conn template qs
doCopy "Database.PostgreSQL.Simple.Copy.copy" conn template q
-- | Issue a @COPY FROM STDIN@ or @COPY TO STDOUT@ query. In the former
-- case, the connection's state will change to @CopyIn@; in the latter,
-- @CopyOut@. The connection must be in the ready state in order
-- to call this function. Does not perform parameter subsitution.
copy_ :: Connection -> Query -> IO ()
copy_ conn (Query q) = do
doCopy "Database.PostgreSQL.Simple.Copy.copy_" conn (Query q) q
doCopy :: B.ByteString -> Connection -> Query -> B.ByteString -> IO ()
doCopy funcName conn template q = do
result <- exec conn q
status <- PQ.resultStatus result
let errMsg msg = throwIO $ QueryError
(B.unpack funcName ++ " " ++ msg)
template
let err = errMsg $ show status
case status of
PQ.EmptyQuery -> err
PQ.CommandOk -> err
PQ.TuplesOk -> err
PQ.CopyOut -> return ()
PQ.CopyIn -> return ()
#if MIN_VERSION_postgresql_libpq(0,9,3)
PQ.CopyBoth -> errMsg "COPY BOTH is not supported"
#endif
#if MIN_VERSION_postgresql_libpq(0,9,2)
PQ.SingleTuple -> errMsg "single-row mode is not supported"
#endif
PQ.BadResponse -> throwResultError funcName result status
PQ.NonfatalError -> throwResultError funcName result status
PQ.FatalError -> throwResultError funcName result status
data CopyOutResult
= CopyOutRow !B.ByteString -- ^ Data representing either exactly
-- one row of the result, or header
-- or footer data depending on format.
| CopyOutDone {-# UNPACK #-} !Int64 -- ^ No more rows, and a count of the
-- number of rows returned.
deriving (Eq, Typeable, Show)
-- | Retrieve some data from a @COPY TO STDOUT@ query. A connection
-- must be in the @CopyOut@ state in order to call this function. If this
-- returns a 'CopyOutRow', the connection remains in the @CopyOut@ state,
-- if it returns 'CopyOutDone', then the connection has reverted to the
-- ready state.
getCopyData :: Connection -> IO CopyOutResult
getCopyData conn = withConnection conn loop
where
funcName = "Database.PostgreSQL.Simple.Copy.getCopyData"
loop pqconn = do
#if defined(mingw32_HOST_OS)
row <- PQ.getCopyData pqconn False
#else
row <- PQ.getCopyData pqconn True
#endif
case row of
PQ.CopyOutRow rowdata -> return $! CopyOutRow rowdata
PQ.CopyOutDone -> CopyOutDone <$> getCopyCommandTag funcName pqconn
#if defined(mingw32_HOST_OS)
PQ.CopyOutWouldBlock -> do
fail (B.unpack funcName ++ ": the impossible happened")
#else
PQ.CopyOutWouldBlock -> do
mfd <- PQ.socket pqconn
case mfd of
Nothing -> throwIO (fdError funcName)
Just fd -> do
threadWaitRead fd
_ <- PQ.consumeInput pqconn
loop pqconn
#endif
PQ.CopyOutError -> do
mmsg <- PQ.errorMessage pqconn
throwIO SqlError {
sqlState = "",
sqlExecStatus = FatalError,
sqlErrorMsg = maybe "" id mmsg,
sqlErrorDetail = "",
sqlErrorHint = funcName
}
-- | Feed some data to a @COPY FROM STDIN@ query. Note that
-- the data does not need to represent a single row, or even an
-- integral number of rows. The net result of
-- @putCopyData conn a >> putCopyData conn b@
-- is the same as @putCopyData conn c@ whenever @c == BS.append a b@.
--
-- A connection must be in the @CopyIn@ state in order to call this
-- function, otherwise a 'SqlError' exception will result. The
-- connection remains in the @CopyIn@ state after this function
-- is called.
putCopyData :: Connection -> B.ByteString -> IO ()
putCopyData conn dat = withConnection conn $ \pqconn -> do
doCopyIn funcName (\c -> PQ.putCopyData c dat) pqconn
where
funcName = "Database.PostgreSQL.Simple.Copy.putCopyData"
-- | Completes a @COPY FROM STDIN@ query. Returns the number of rows
-- processed.
--
-- A connection must be in the @CopyIn@ state in order to call this
-- function, otherwise a 'SqlError' exception will result. The
-- connection's state changes back to ready after this function
-- is called.
putCopyEnd :: Connection -> IO Int64
putCopyEnd conn = withConnection conn $ \pqconn -> do
doCopyIn funcName (\c -> PQ.putCopyEnd c Nothing) pqconn
getCopyCommandTag funcName pqconn
where
funcName = "Database.PostgreSQL.Simple.Copy.putCopyEnd"
-- | Aborts a @COPY FROM STDIN@ query. The string parameter is simply
-- an arbitrary error message that may show up in the PostgreSQL
-- server's log.
--
-- A connection must be in the @CopyIn@ state in order to call this
-- function, otherwise a 'SqlError' exception will result. The
-- connection's state changes back to ready after this function
-- is called.
putCopyError :: Connection -> B.ByteString -> IO ()
putCopyError conn err = withConnection conn $ \pqconn -> do
doCopyIn funcName (\c -> PQ.putCopyEnd c (Just err)) pqconn
consumeResults pqconn
where
funcName = "Database.PostgreSQL.Simple.Copy.putCopyError"
doCopyIn :: B.ByteString -> (PQ.Connection -> IO PQ.CopyInResult)
-> PQ.Connection -> IO ()
doCopyIn funcName action = loop
where
loop pqconn = do
stat <- action pqconn
case stat of
PQ.CopyInOk -> return ()
PQ.CopyInError -> do
mmsg <- PQ.errorMessage pqconn
throwIO SqlError {
sqlState = "",
sqlExecStatus = FatalError,
sqlErrorMsg = maybe "" id mmsg,
sqlErrorDetail = "",
sqlErrorHint = funcName
}
PQ.CopyInWouldBlock -> do
mfd <- PQ.socket pqconn
case mfd of
Nothing -> throwIO (fdError funcName)
Just fd -> do
threadWaitWrite fd
loop pqconn
{-# INLINE doCopyIn #-}
getCopyCommandTag :: B.ByteString -> PQ.Connection -> IO Int64
getCopyCommandTag funcName pqconn = do
result <- maybe (fail errCmdStatus) return =<< PQ.getResult pqconn
cmdStat <- maybe (fail errCmdStatus) return =<< PQ.cmdStatus result
consumeResults pqconn
let rowCount = P.string "COPY " *> (P.decimal <* P.endOfInput)
case P.parseOnly rowCount cmdStat of
Left _ -> do mmsg <- PQ.errorMessage pqconn
fail $ errCmdStatusFmt
++ maybe "" (\msg -> "\nConnection error: "++B.unpack msg) mmsg
Right n -> return $! n
where
errCmdStatus = B.unpack funcName ++ ": failed to fetch command status"
errCmdStatusFmt = B.unpack funcName ++ ": failed to parse command status"
consumeResults :: PQ.Connection -> IO ()
consumeResults pqconn = do
mres <- PQ.getResult pqconn
case mres of
Nothing -> return ()
Just _ -> consumeResults pqconn
| {
"content_hash": "de2b9ffc0f7a92ec566fe915bb4f555d",
"timestamp": "",
"source": "github",
"line_count": 248,
"max_line_length": 87,
"avg_line_length": 39.016129032258064,
"alnum_prop": 0.6241215378255478,
"repo_name": "tomjaguarpaw/postgresql-simple",
"id": "95f19bf820841eaa041723adf2b7c1960e7c75c2",
"size": "9676",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Database/PostgreSQL/Simple/Copy.hs",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Haskell",
"bytes": "281121"
},
{
"name": "Shell",
"bytes": "422"
}
],
"symlink_target": ""
} |
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "6f27fe111d2be406633d4c39bcb9e63b",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.23076923076923,
"alnum_prop": 0.6917293233082706,
"repo_name": "mdoering/backbone",
"id": "c3a98e3ee718fae0dd878217cd2d5dba6aa63816",
"size": "194",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Asterales/Asteraceae/Artemisia/Artemisia vulgaris/ Syn. Artemisia rubriflora/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
namespace Amazon.SimpleWorkflow.Model
{
/// <summary>
/// <para> Provides details of the <c>StartChildWorkflowExecutionFailed</c> event. </para>
/// </summary>
public class StartChildWorkflowExecutionFailedEventAttributes
{
private WorkflowType workflowType;
private string cause;
private string workflowId;
private long? initiatedEventId;
private long? decisionTaskCompletedEventId;
private string control;
/// <summary>
/// The workflow type provided in the <c>StartChildWorkflowExecution</c> <a>Decision</a> that failed.
///
/// </summary>
public WorkflowType WorkflowType
{
get { return this.workflowType; }
set { this.workflowType = value; }
}
/// <summary>
/// Sets the WorkflowType property
/// </summary>
/// <param name="workflowType">The value to set for the WorkflowType property </param>
/// <returns>this instance</returns>
[Obsolete("The With methods are obsolete and will be removed in version 2 of the AWS SDK for .NET. See http://aws.amazon.com/sdkfornet/#version2 for more information.")]
public StartChildWorkflowExecutionFailedEventAttributes WithWorkflowType(WorkflowType workflowType)
{
this.workflowType = workflowType;
return this;
}
// Check to see if WorkflowType property is set
internal bool IsSetWorkflowType()
{
return this.workflowType != null;
}
/// <summary>
/// The cause of the failure to process the decision. This information is generated by the system and can be useful for diagnostic purposes.
/// <note>If <b>cause</b> is set to OPERATION_NOT_PERMITTED, the decision failed because it lacked sufficient permissions. For details and
/// example IAM policies, see <a href="http://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html">Using IAM to Manage Access
/// to Amazon SWF Workflows</a>.</note>
///
/// <para>
/// <b>Constraints:</b>
/// <list type="definition">
/// <item>
/// <term>Allowed Values</term>
/// <description>WORKFLOW_TYPE_DOES_NOT_EXIST, WORKFLOW_TYPE_DEPRECATED, OPEN_CHILDREN_LIMIT_EXCEEDED, OPEN_WORKFLOWS_LIMIT_EXCEEDED, CHILD_CREATION_RATE_EXCEEDED, WORKFLOW_ALREADY_RUNNING, DEFAULT_EXECUTION_START_TO_CLOSE_TIMEOUT_UNDEFINED, DEFAULT_TASK_LIST_UNDEFINED, DEFAULT_TASK_START_TO_CLOSE_TIMEOUT_UNDEFINED, DEFAULT_CHILD_POLICY_UNDEFINED, OPERATION_NOT_PERMITTED</description>
/// </item>
/// </list>
/// </para>
/// </summary>
public string Cause
{
get { return this.cause; }
set { this.cause = value; }
}
/// <summary>
/// Sets the Cause property
/// </summary>
/// <param name="cause">The value to set for the Cause property </param>
/// <returns>this instance</returns>
[Obsolete("The With methods are obsolete and will be removed in version 2 of the AWS SDK for .NET. See http://aws.amazon.com/sdkfornet/#version2 for more information.")]
public StartChildWorkflowExecutionFailedEventAttributes WithCause(string cause)
{
this.cause = cause;
return this;
}
// Check to see if Cause property is set
internal bool IsSetCause()
{
return this.cause != null;
}
/// <summary>
/// The <c>workflowId</c> of the child workflow execution.
///
/// <para>
/// <b>Constraints:</b>
/// <list type="definition">
/// <item>
/// <term>Length</term>
/// <description>1 - 256</description>
/// </item>
/// </list>
/// </para>
/// </summary>
public string WorkflowId
{
get { return this.workflowId; }
set { this.workflowId = value; }
}
/// <summary>
/// Sets the WorkflowId property
/// </summary>
/// <param name="workflowId">The value to set for the WorkflowId property </param>
/// <returns>this instance</returns>
[Obsolete("The With methods are obsolete and will be removed in version 2 of the AWS SDK for .NET. See http://aws.amazon.com/sdkfornet/#version2 for more information.")]
public StartChildWorkflowExecutionFailedEventAttributes WithWorkflowId(string workflowId)
{
this.workflowId = workflowId;
return this;
}
// Check to see if WorkflowId property is set
internal bool IsSetWorkflowId()
{
return this.workflowId != null;
}
/// <summary>
/// The id of the <c>StartChildWorkflowExecutionInitiated</c> event corresponding to the <c>StartChildWorkflowExecution</c> <a>Decision</a> to
/// start this child workflow execution. This information can be useful for diagnosing problems by tracing back the chain of events leading up
/// to this event.
///
/// </summary>
public long InitiatedEventId
{
get { return this.initiatedEventId ?? default(long); }
set { this.initiatedEventId = value; }
}
/// <summary>
/// Sets the InitiatedEventId property
/// </summary>
/// <param name="initiatedEventId">The value to set for the InitiatedEventId property </param>
/// <returns>this instance</returns>
[Obsolete("The With methods are obsolete and will be removed in version 2 of the AWS SDK for .NET. See http://aws.amazon.com/sdkfornet/#version2 for more information.")]
public StartChildWorkflowExecutionFailedEventAttributes WithInitiatedEventId(long initiatedEventId)
{
this.initiatedEventId = initiatedEventId;
return this;
}
// Check to see if InitiatedEventId property is set
internal bool IsSetInitiatedEventId()
{
return this.initiatedEventId.HasValue;
}
/// <summary>
/// The id of the <c>DecisionTaskCompleted</c> event corresponding to the decision task that resulted in the <c>StartChildWorkflowExecution</c>
/// <a>Decision</a> to request this child workflow execution. This information can be useful for diagnosing problems by tracing back the cause
/// of events.
///
/// </summary>
public long DecisionTaskCompletedEventId
{
get { return this.decisionTaskCompletedEventId ?? default(long); }
set { this.decisionTaskCompletedEventId = value; }
}
/// <summary>
/// Sets the DecisionTaskCompletedEventId property
/// </summary>
/// <param name="decisionTaskCompletedEventId">The value to set for the DecisionTaskCompletedEventId property </param>
/// <returns>this instance</returns>
[Obsolete("The With methods are obsolete and will be removed in version 2 of the AWS SDK for .NET. See http://aws.amazon.com/sdkfornet/#version2 for more information.")]
public StartChildWorkflowExecutionFailedEventAttributes WithDecisionTaskCompletedEventId(long decisionTaskCompletedEventId)
{
this.decisionTaskCompletedEventId = decisionTaskCompletedEventId;
return this;
}
// Check to see if DecisionTaskCompletedEventId property is set
internal bool IsSetDecisionTaskCompletedEventId()
{
return this.decisionTaskCompletedEventId.HasValue;
}
public string Control
{
get { return this.control; }
set { this.control = value; }
}
/// <summary>
/// Sets the Control property
/// </summary>
/// <param name="control">The value to set for the Control property </param>
/// <returns>this instance</returns>
[Obsolete("The With methods are obsolete and will be removed in version 2 of the AWS SDK for .NET. See http://aws.amazon.com/sdkfornet/#version2 for more information.")]
public StartChildWorkflowExecutionFailedEventAttributes WithControl(string control)
{
this.control = control;
return this;
}
// Check to see if Control property is set
internal bool IsSetControl()
{
return this.control != null;
}
}
}
| {
"content_hash": "37bac89bfa9aa3537d38adf7bdc067aa",
"timestamp": "",
"source": "github",
"line_count": 217,
"max_line_length": 403,
"avg_line_length": 40.59447004608295,
"alnum_prop": 0.608355091383812,
"repo_name": "emcvipr/dataservices-sdk-dotnet",
"id": "2953a7bbf46df75cc3ea2ef358ad4dd880a0ad4e",
"size": "9396",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "AWSSDK/Amazon.SimpleWorkflow/Model/StartChildWorkflowExecutionFailedEventAttributes.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C#",
"bytes": "30500772"
},
{
"name": "Shell",
"bytes": "1726"
},
{
"name": "XSLT",
"bytes": "337772"
}
],
"symlink_target": ""
} |
'use strict';
const Log = require('log');
const log = new Log('info');
// The next part is here to prevent a major exception when there
// is no internet connection. This could probable be solved better.
process.on("uncaughtException", function (err) {
log.warning("Whoops! There was an uncaught exception...");
log.error(err);
});
const argv = require('yargs')
.usage('Usage: $0 --consul <IP|FQDN>:<port> --resync <seconds> --ownNetworkOnly <true|false> --servicesWithPortBindingsOnly <true|false>')
.demand(['consul'])
.default({resync: 3600, ownNetworkOnly: 'false', servicesWithPortBindingsOnly: 'false'})
.boolean('ownNetworkOnly')
.boolean('servicesWithPortBindingsOnly')
.check(function (argv) {
if (argv.resync < 30) throw "Value for re-syncing the services must be greater than or at least equal to 30 seconds";
return true;
})
.argv;
const Registrator = function (options) {
const consul = require('consul')({
"host": options.consul.split(':', 2)[0],
"port": options.consul.split(':', 2)[1]
});
const Docker = require('dockerode');
const docker = new Docker();
const Container = require("./lib/container");
// gather facts about myself
this.getIps = function () {
let interfaces = require("os").networkInterfaces();
let addresses = {};
for (let device in interfaces) {
for (let index in interfaces[device]) {
let properties = interfaces[device][index];
if (properties.family === 'IPv4' && !properties.internal) {
addresses[properties.address] = properties.netmask;
}
}
}
return addresses;
};
const registratorFacts = {
'consul_agent': consul.agent,
'own_network_only': options.ownNetworkOnly,
'ips': this.getIps(),
'services_with_port_bindings_only': options.servicesWithPortBindingsOnly
};
this.listen = function () {
log.info("Listening on container events");
docker.getEvents(null, function (err, stream) {
if (err) {
log.error('Error occurred: ' + err);
return;
}
const onFinished = function (err, output) {
if (err) {
log.error('Error occurred: ' + err);
log.error(output);
return;
}
log.info(output);
};
const onProgress = function (event) {
let status = (typeof event.status === 'undefined' ? null : event.status);
let id = (typeof event.id === 'undefined' ? null : event.id);
if (status && (status === "start" || status === "unpause")) {
docker.getContainer(id).inspect(function (err, containerFacts) {
if (err) {
log.error('Error occurred: ' + err);
return;
}
let container = new Container(containerFacts, registratorFacts);
container.consulRegister(function (err, data, res, container) {
if (err) {
log.error('Error occurred: ' + err);
log.error(data);
log.error(res);
log.error(container);
return;
}
log.info("Registered " + container.id);
});
});
} else if (status && (status === "die" || status === "pause")) {
docker.getContainer(id).inspect(function (err, containerFacts) {
if (err) {
log.error('Error occurred: ' + err);
return;
}
let container = new Container(containerFacts, registratorFacts);
container.consulDeregister(function (err, data, res, container) {
if (err) {
log.error('Error occurred: ' + err);
log.error(data);
log.error(res);
log.error(container);
return;
}
log.info("Deregistered " + container.id);
});
});
} else if (status && status.startsWith("health_status:")) {
let state = status.split(":", 2)[1].trim();
log.info(JSON.stringify({'state': state, 'event_object': event}));
}
};
docker.modem.followProgress(stream, onFinished, onProgress);
});
};
this.sync = function (interval) {
const sync = function () {
log.info("Synchronizing services");
// register all running containers
docker.listContainers(function (err, containers) {
if (err) {
log.error('Error occurred: ' + err);
return;
}
for (let index = 0; index < containers.length; index++) {
docker.getContainer(containers[index].Id).inspect(function (err, containerFacts) {
if (err) {
log.error('Error occurred: ' + err);
return;
}
let container = new Container(containerFacts, registratorFacts);
container.consulRegister(function (err, data, res, container) {
if (err) {
log.error('Error occurred: ' + err);
log.error(data);
log.error(res);
log.error(container);
return;
}
log.info("Synced and registered " + container.id);
});
});
}
});
// deregister all unavailable services
consul.agent.service.list(function (err, services) {
if (err) {
log.error('Error occurred: ' + err);
return;
}
let containerIds = (function (serviceIds) {
let containerIds = {};
for (let index = 0; index < serviceIds.length; index++) {
let containerId = serviceIds[index].split(':', 2)[0];
// skip if service is consul itself
if (containerId === 'consul') continue;
// skip if service is already in the array
if (containerIds.hasOwnProperty(containerId) && containerIds[containerId].indexOf(serviceIds[index]) >= 0) continue;
// create new array if service key is not available already
if (!containerIds.hasOwnProperty(containerId)) containerIds[containerId] = [];
// add service to list of container
containerIds[containerId].push(serviceIds[index]);
}
return containerIds;
})(services instanceof Object ? Object.keys(services) : []);
for (let containerId in containerIds) {
if (containerIds.hasOwnProperty(containerId)) {
docker.getContainer(containerId).inspect(function (err, data) {
if (err || data.State.Status !== "running") {
for (let index = 0; index < containerIds[containerId].length; index++) {
consul.agent.service.deregister(containerIds[containerId][index], function (err, data, res) {
if (err) {
log.error('Error occurred: ' + err);
log.error(data);
log.error(res);
log.error(containerIds[containerId][index]);
}
log.info("Synced and deregistered " + containerIds[containerId][index]);
});
}
}
});
}
}
});
};
sync();
setInterval(sync, interval);
};
if (!module.parent) {
this.listen();
this.sync(options.resync * 1000);
}
};
module.exports = new Registrator(argv);
| {
"content_hash": "92e3a79b48ee9a1019e14a846fb70b7b",
"timestamp": "",
"source": "github",
"line_count": 225,
"max_line_length": 142,
"avg_line_length": 40.46666666666667,
"alnum_prop": 0.44810543657331137,
"repo_name": "olafnorge/registrator",
"id": "34441987e9144828d40dce57d058a7444af6a74f",
"size": "10248",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "rootfs/opt/registrator/index.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "26467"
},
{
"name": "Shell",
"bytes": "1223"
}
],
"symlink_target": ""
} |
#pragma once
#include "il2cpp-config.h"
#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif
#include <stdint.h>
#include "mscorlib_System_MulticastDelegate3201952435.h"
#include "mscorlib_System_Int322071877448.h"
// System.Object
struct Il2CppObject;
// System.IAsyncResult
struct IAsyncResult_t1999651008;
// System.AsyncCallback
struct AsyncCallback_t163412349;
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Collections.Generic.Dictionary`2/Transform`1<System.Object,System.Int32,System.Int32>
struct Transform_1_t699222221 : public MulticastDelegate_t3201952435
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
| {
"content_hash": "c1e31dda6d70ea588e3cc94d32b8f8a5",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 95,
"avg_line_length": 19.047619047619047,
"alnum_prop": 0.77625,
"repo_name": "BPenzar/SuperDinoBros.",
"id": "33eed7337595842f8d24f9a3e4f51eb319de675a",
"size": "802",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Unity_Code/DinoRun_Final/Temp/il2cppOutput/il2cppOutput/mscorlib_System_Collections_Generic_Dictionary_2_Tr699222221.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C#",
"bytes": "89025"
},
{
"name": "CSS",
"bytes": "10740"
},
{
"name": "HTML",
"bytes": "10283"
}
],
"symlink_target": ""
} |
@interface AppDelegate ()
@end
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
return YES;
}
- (void)applicationWillResignActive:(UIApplication *)application {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}
- (void)applicationDidEnterBackground:(UIApplication *)application {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
- (void)applicationWillEnterForeground:(UIApplication *)application {
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}
- (void)applicationDidBecomeActive:(UIApplication *)application {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
- (void)applicationWillTerminate:(UIApplication *)application {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
@end
| {
"content_hash": "77646f5521c35210120b1bdb06f68cbe",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 281,
"avg_line_length": 53.48571428571429,
"alnum_prop": 0.7863247863247863,
"repo_name": "BestJoker/FJSGCDDemo",
"id": "4f1b3244cd52f6c2452b99b0bc59800588f97d78",
"size": "2041",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "FJSGCDDemo/AppDelegate.m",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Objective-C",
"bytes": "24180"
}
],
"symlink_target": ""
} |
PluginHandle g_pluginHandle = kPluginHandle_Invalid;
SKSEScaleformInterface * g_scaleform = NULL;
SKSESerializationInterface * g_serialization = NULL;
SKSEPapyrusInterface * g_papyrus = NULL;
extern bool registerAllFunctions(VMClassRegistry *registry);
extern void Serialization_Revert(SKSESerializationInterface * intfc);
extern void Serialization_Save(SKSESerializationInterface * intfc);
extern void Serialization_Load(SKSESerializationInterface * intfc);
extern "C" {
bool SKSEPlugin_Query(const SKSEInterface * skse, PluginInfo * info)
{
gLog.OpenRelative(CSIDL_MYDOCUMENTS, "\\My Games\\Skyrim\\SKSE\\JContainers.log");
gLog.SetPrintLevel(IDebugLog::kLevel_Error);
gLog.SetLogLevel(IDebugLog::kLevel_DebugMessage);
// populate info structure
info->infoVersion = PluginInfo::kInfoVersion;
info->name = "JContainers";
info->version = 1;
// store plugin handle so we can identify ourselves later
g_pluginHandle = skse->GetPluginHandle();
_MESSAGE("JContainers %u.%u\n", kJVersionMajor, kJVersionMinor);
if (skse->isEditor) {
_MESSAGE("loaded in editor, marking as incompatible");
return false;
}
else if(skse->runtimeVersion != RUNTIME_VERSION_1_9_32_0) {
_MESSAGE("unsupported runtime version %08X", skse->runtimeVersion);
return false;
}
// get the serialization interface and query its version
g_serialization = (SKSESerializationInterface *)skse->QueryInterface(kInterface_Serialization);
if (!g_serialization) {
_MESSAGE("couldn't get serialization interface");
return false;
}
if (g_serialization->version < SKSESerializationInterface::kVersion) {
_MESSAGE("serialization interface too old (%d expected %d)", g_serialization->version, SKSESerializationInterface::kVersion);
return false;
}
g_papyrus = (SKSEPapyrusInterface *)skse->QueryInterface(kInterface_Papyrus);
if (!g_papyrus) {
_MESSAGE("couldn't get papyrus interface");
return false;
}
return true;
}
bool SKSEPlugin_Load(const SKSEInterface * skse)
{
_MESSAGE("plugin loaded");
// register callbacks and unique ID for serialization
// ### this must be a UNIQUE ID, change this and email me the ID so I can let you know if someone else has already taken it
g_serialization->SetUniqueID(g_pluginHandle, kJStorageChunk);
g_serialization->SetRevertCallback(g_pluginHandle, Serialization_Revert);
g_serialization->SetSaveCallback(g_pluginHandle, Serialization_Save);
g_serialization->SetLoadCallback(g_pluginHandle, Serialization_Load);
g_papyrus->Register(registerAllFunctions);
return true;
}
__declspec(dllexport) void launchShityTest() {
testing::runTests(meta<testing::TestInfo>::getListConst());
}
};
| {
"content_hash": "38d13d7c90c86f16d4852cbff0e1fd1c",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 131,
"avg_line_length": 34.258823529411764,
"alnum_prop": 0.6943681318681318,
"repo_name": "Verteiron/JContainers",
"id": "ec3c4c99a162aad42cd37799b8c36af026db831f",
"size": "3109",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "JContainers/src/main.cpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "10914"
},
{
"name": "C",
"bytes": "2186353"
},
{
"name": "C++",
"bytes": "24269870"
},
{
"name": "CSS",
"bytes": "17095"
},
{
"name": "IDL",
"bytes": "14"
},
{
"name": "Max",
"bytes": "36857"
},
{
"name": "Objective-C",
"bytes": "8898"
},
{
"name": "Perl",
"bytes": "1297"
},
{
"name": "Python",
"bytes": "1173266"
},
{
"name": "R",
"bytes": "354"
},
{
"name": "Shell",
"bytes": "285093"
},
{
"name": "XSLT",
"bytes": "759"
}
],
"symlink_target": ""
} |
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="com.axiomalaska.crks.vo.LayerType" table="layer_type" schema="crks">
<id name="id" type="java.lang.Integer">
<column name="id" />
<generator class="sequence">
<param name="sequence">layer_type_id_seq</param>
</generator>
</id>
<property name="type" type="string">
<column name="type" length="50" not-null="true" />
</property>
<property name="label" type="string">
<column name="label" length="50" />
</property>
<set name="layerSubtypes" inverse="true">
<key>
<column name="layer_type_id" />
</key>
<one-to-many class="com.axiomalaska.crks.vo.LayerSubtype" />
</set>
<set name="layerGroups" inverse="true">
<key>
<column name="layer_type_id" />
</key>
<one-to-many class="com.axiomalaska.crks.vo.LayerGroup" />
</set>
</class>
</hibernate-mapping>
| {
"content_hash": "a43064134c9849ce8bab5cbbf3e14974",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 85,
"avg_line_length": 39.16129032258065,
"alnum_prop": 0.5461285008237232,
"repo_name": "axiom-data-science/crks-service",
"id": "f2fe6a65118c52f8a72718885d49c2ca65203e8d",
"size": "1214",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/resources/com/axiomalaska/crks/vo/LayerType.hbm.xml",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "Java",
"bytes": "207157"
}
],
"symlink_target": ""
} |
#ifndef _osapi_core_
#define _osapi_core_
#include <stdarg.h> /* for va_list */
/*difines constants for OS_BinSemCreate for state of semaphore */
#define OS_SEM_FULL 1
#define OS_SEM_EMPTY 0
/* #define for enabling floating point operations on a task*/
#define OS_FP_ENABLED 1
/* tables for the properties of objects */
/*tasks */
typedef struct
{
char name [OS_MAX_API_NAME];
uint32 creator;
uint32 stack_size;
uint32 priority;
uint32 OStask_id;
}OS_task_prop_t;
/* queues */
typedef struct
{
char name [OS_MAX_API_NAME];
uint32 creator;
}OS_queue_prop_t;
/* Binary Semaphores */
typedef struct
{
char name [OS_MAX_API_NAME];
uint32 creator;
int32 value;
}OS_bin_sem_prop_t;
/* Counting Semaphores */
typedef struct
{
char name [OS_MAX_API_NAME];
uint32 creator;
int32 value;
}OS_count_sem_prop_t;
/* Mutexes */
typedef struct
{
char name [OS_MAX_API_NAME];
uint32 creator;
}OS_mut_sem_prop_t;
/* struct for OS_GetLocalTime() */
typedef struct
{
uint32 seconds;
uint32 microsecs;
}OS_time_t;
/* heap info */
typedef struct
{
uint32 free_bytes;
uint32 free_blocks;
uint32 largest_free_block;
}OS_heap_prop_t;
/* This typedef is for the OS_GetErrorName function, to ensure
* everyone is making an array of the same length */
typedef char os_err_name_t[35];
/*
** These typedefs are for the task entry point
*/
typedef void osal_task;
typedef osal_task ((*osal_task_entry)(void));
/*
** Exported Functions
*/
/*
** Initialization of API
*/
int32 OS_API_Init (void);
/*
** Task API
*/
int32 OS_TaskCreate (uint32 *task_id, const char *task_name,
osal_task_entry function_pointer,
const uint32 *stack_pointer,
uint32 stack_size,
uint32 priority, uint32 flags);
int32 OS_TaskDelete (uint32 task_id);
void OS_TaskExit (void);
int32 OS_TaskInstallDeleteHandler(void *function_pointer);
int32 OS_TaskDelay (uint32 millisecond);
int32 OS_TaskSetPriority (uint32 task_id, uint32 new_priority);
int32 OS_TaskRegister (void);
uint32 OS_TaskGetId (void);
int32 OS_TaskGetIdByName (uint32 *task_id, const char *task_name);
int32 OS_TaskGetInfo (uint32 task_id, OS_task_prop_t *task_prop);
/*
** Message Queue API
*/
/*
** Queue Create now has the Queue ID returned to the caller.
*/
int32 OS_QueueCreate (uint32 *queue_id, const char *queue_name,
uint32 queue_depth, uint32 data_size, uint32 flags);
int32 OS_QueueDelete (uint32 queue_id);
int32 OS_QueueGet (uint32 queue_id, void *data, uint32 size,
uint32 *size_copied, int32 timeout);
int32 OS_QueuePut (uint32 queue_id, void *data, uint32 size,
uint32 flags);
int32 OS_QueueGetIdByName (uint32 *queue_id, const char *queue_name);
int32 OS_QueueGetInfo (uint32 queue_id, OS_queue_prop_t *queue_prop);
/*
** Semaphore API
*/
int32 OS_BinSemCreate (uint32 *sem_id, const char *sem_name,
uint32 sem_initial_value, uint32 options);
int32 OS_BinSemFlush (uint32 sem_id);
int32 OS_BinSemGive (uint32 sem_id);
int32 OS_BinSemTake (uint32 sem_id);
int32 OS_BinSemTimedWait (uint32 sem_id, uint32 msecs);
int32 OS_BinSemDelete (uint32 sem_id);
int32 OS_BinSemGetIdByName (uint32 *sem_id, const char *sem_name);
int32 OS_BinSemGetInfo (uint32 sem_id, OS_bin_sem_prop_t *bin_prop);
int32 OS_CountSemCreate (uint32 *sem_id, const char *sem_name,
uint32 sem_initial_value, uint32 options);
int32 OS_CountSemGive (uint32 sem_id);
int32 OS_CountSemTake (uint32 sem_id);
int32 OS_CountSemTimedWait (uint32 sem_id, uint32 msecs);
int32 OS_CountSemDelete (uint32 sem_id);
int32 OS_CountSemGetIdByName (uint32 *sem_id, const char *sem_name);
int32 OS_CountSemGetInfo (uint32 sem_id, OS_count_sem_prop_t *count_prop);
/*
** Mutex API
*/
int32 OS_MutSemCreate (uint32 *sem_id, const char *sem_name, uint32 options);
int32 OS_MutSemGive (uint32 sem_id);
int32 OS_MutSemTake (uint32 sem_id);
int32 OS_MutSemDelete (uint32 sem_id);
int32 OS_MutSemGetIdByName (uint32 *sem_id, const char *sem_name);
int32 OS_MutSemGetInfo (uint32 sem_id, OS_mut_sem_prop_t *mut_prop);
/*
** OS Time/Tick related API
*/
int32 OS_Milli2Ticks (uint32 milli_seconds);
int32 OS_Tick2Micros (void);
int32 OS_GetLocalTime (OS_time_t *time_struct);
int32 OS_SetLocalTime (OS_time_t *time_struct);
/*
** Exception API
*/
int32 OS_ExcAttachHandler (uint32 ExceptionNumber,
void (*ExceptionHandler)(uint32, uint32 *,uint32),
int32 parameter);
int32 OS_ExcEnable (int32 ExceptionNumber);
int32 OS_ExcDisable (int32 ExceptionNumber);
/*
** Floating Point Unit API
*/
int32 OS_FPUExcAttachHandler (uint32 ExceptionNumber, void * ExceptionHandler ,
int32 parameter);
int32 OS_FPUExcEnable (int32 ExceptionNumber);
int32 OS_FPUExcDisable (int32 ExceptionNumber);
int32 OS_FPUExcSetMask (uint32 mask);
int32 OS_FPUExcGetMask (uint32 *mask);
/*
** Interrupt API
*/
int32 OS_IntAttachHandler (uint32 InterruptNumber, osal_task_entry InterruptHandler, int32 parameter);
int32 OS_IntUnlock (int32 IntLevel);
int32 OS_IntLock (void);
int32 OS_IntEnable (int32 Level);
int32 OS_IntDisable (int32 Level);
int32 OS_IntSetMask (uint32 mask);
int32 OS_IntGetMask (uint32 *mask);
int32 OS_IntAck (int32 InterruptNumber);
/*
** Shared memory API
*/
int32 OS_ShMemInit (void);
int32 OS_ShMemCreate (uint32 *Id, uint32 NBytes, char* SegName);
int32 OS_ShMemSemTake (uint32 Id);
int32 OS_ShMemSemGive (uint32 Id);
int32 OS_ShMemAttach (uint32 * Address, uint32 Id);
int32 OS_ShMemGetIdByName (uint32 *ShMemId, const char *SegName );
/*
** Heap API
*/
int32 OS_HeapGetInfo (OS_heap_prop_t *heap_prop);
/*
** API for useful debugging function
*/
int32 OS_GetErrorName (int32 error_num, os_err_name_t* err_name);
/*
** Abstraction for printf statements
*/
void OS_printf( const char *string, ...);
void OS_printf_disable(void);
void OS_printf_enable(void);
#endif
| {
"content_hash": "9b6d6dc09ee8c50bbc4be5a77cf461e7",
"timestamp": "",
"source": "github",
"line_count": 239,
"max_line_length": 103,
"avg_line_length": 28.338912133891213,
"alnum_prop": 0.6189280968551601,
"repo_name": "CACTUS-Mission/TRAPSat",
"id": "8c9b13a78c3f8c8da586fd854c9fd238bb004cd5",
"size": "8201",
"binary": false,
"copies": "25",
"ref": "refs/heads/master",
"path": "TRAPSat_cFS/cfs/osal/src/os/inc/osapi-os-core.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Arduino",
"bytes": "3346"
},
{
"name": "C",
"bytes": "5898670"
},
{
"name": "C++",
"bytes": "843022"
},
{
"name": "Java",
"bytes": "1041409"
},
{
"name": "Makefile",
"bytes": "262573"
},
{
"name": "Objective-C",
"bytes": "36682"
},
{
"name": "Perl",
"bytes": "79709"
},
{
"name": "Perl6",
"bytes": "21884"
},
{
"name": "Python",
"bytes": "597468"
},
{
"name": "Shell",
"bytes": "14444"
}
],
"symlink_target": ""
} |
XBMC-MQTT-notification-system
=============================
Subscribes to a MQTT topic and will display the messages on XBMC using custom popup or the built in XBMC notification system, if the message is formated correctly.
Typical format of the MQTT message that needs to be sent to topic.
{"lvl":"1","sub":"xxxxxx","txt":"xxxxxx","img":"xxx","delay":"10000"}
lvl -- Message level; a "1" uses the custom larger popup, a "2" uses the xbmc built in notification. (see screenshots below)
sub -- subject of message
txt -- main body of text, needs to be less than 150 characters for the custom larger popup
img -- ?? pixels, transparent background, location and name, eg. special://masterprofile/Thumbnails/xxx_1.png
delay -- show message for this long, in miliseconds
##Installation;
- download https://bitbucket.org/oojah/mosquitto/src/698853a74c8e/lib/python/mosquitto.py
- copy autoexec.py & mosquitto.py to XBMC userdata folder.
- copy background.png and mqtt.png to a folder, I normally use the Thumbnails one.
- edit autoexec.py and change the broker and topic settings.
##Notes;
- Using autoexec.py as I haven't got around to making it a plugin yet... it's on the todo list!
- to get the latest version of mosquitto.py please visit http://mosquitto.org <- doubt latest version will work
- I have found that the latest version of mosquitto.py that will work is this one, https://bitbucket.org/oojah/mosquitto/src/698853a74c8e/lib/python/mosquitto.py
- have tested on ATV2 with XBMC frodo 12.2 and Windows7 with XBMC frodo 12.2 succesfully.
##Example:
###Startup
This shows that it has connected successfully to the broker.

###Level-1 Message
Custom pop-up
JSON string sent to topic;
{"lvl":"1","sub":"@CFA_Updates","txt":"Visiting NSW's tomorrow? Monitor fire conditions. Follow @nswrfs and remember many parks & reserves closed http://www.environment.nsw.gov.au/NationalParks/FireClosure.aspx #nswfires","img":"special://masterprofile/Thumbnails/cfa.png","delay":"20000"}

###Level-2 Message
Using bulit-in XBMC notification system
JSON string sent to topic;
{"lvl":"2","sub":"@CFA_Updates","txt":"Visiting NSW's tomorrow? Monitor fire conditions. Follow @nswrfs and remember many parks & reserves closed http://www.environment.nsw.gov.au/NationalParks/FireClosure.aspx #nswfires","img":"special://masterprofile/Thumbnails/cfa.png","delay":"20000"}

##todo;
- need to change to a xbmc addon with config settings, currently just using the autoexec.py and modifying settings in script.
- deal with the odd ascii characters, typical only has issues on the internal xbmc notification system
- handle the exiting of XBMC, by killing this script nicely... will this effect will_set >? atm xbmc forces a kill
- add back in reporting of playback status, play/stop/pause/resume/now playing
- fix so it works with latest version of mosquitto.py
- remove all the lazy print statements and use the xbmc logging system
| {
"content_hash": "d65bcfaee086cff933b287d71bb7313b",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 293,
"avg_line_length": 52.91935483870968,
"alnum_prop": 0.7519049070405365,
"repo_name": "matbor/mqtt2xbmc-notifications",
"id": "86ccb06de1d9999cff9fefe0168b4b248896203f",
"size": "3281",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "73806"
}
],
"symlink_target": ""
} |
using System;
namespace Com.Bekijkhet.Lora
{
public class InvalidMICException : ApplicationException
{
}
}
| {
"content_hash": "0446a898229fcb3ce1feccc38fc762f0",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 59,
"avg_line_length": 14.555555555555555,
"alnum_prop": 0.6564885496183206,
"repo_name": "broersa/mylorawan",
"id": "9614cc435b95a01a0113662e6adf6df7ea858ed5",
"size": "133",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Com.Bekijkhet.Lora/InvalidMICException.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "251962"
}
],
"symlink_target": ""
} |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "koob_beta.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the
# issue is really that Django is missing to avoid masking other
# exceptions on Python 2.
try:
import django
except ImportError:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
)
raise
execute_from_command_line(sys.argv)
| {
"content_hash": "d25f2f5db20355c24774edc87e051ece",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 77,
"avg_line_length": 37.38095238095238,
"alnum_prop": 0.6203821656050955,
"repo_name": "PingaxAnalytics/koob_beta",
"id": "4b0357c1eb525123a83af0aca3675f434214dca0",
"size": "807",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "manage.py",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "Python",
"bytes": "19398"
}
],
"symlink_target": ""
} |
<?php
namespace frontend\models;
use common\models\User;
use yii\base\Model;
use Yii;
/**
* Signup form
*/
class SignupForm extends Model
{
public $username;
public $email;
public $password;
public $status;
/**
* @inheritdoc
*/
public function rules()
{
return [
['username', 'filter', 'filter' => 'trim'],
['username', 'required'],
['username', 'unique', 'targetClass' => '\common\models\User', 'message' => 'Это имя пользователя уже используется.'],
['username', 'string', 'min' => 2, 'max' => 255],
['email', 'filter', 'filter' => 'trim'],
['email', 'required'],
['email', 'email'],
['email', 'string', 'max' => 255],
['email', 'unique', 'targetClass' => '\common\models\User', 'message' => 'Эта электронная почта уже используется.'],
['password', 'required'],
['password', 'string', 'min' => 6],
['status', 'default', 'value' => User::STATUS_NOT_ACTIVE, 'on' => 'default'],
['status', 'in', 'range' =>[
User::STATUS_NOT_ACTIVE,
User::STATUS_ACTIVE
]],
['status', 'default', 'value' => User::STATUS_NOT_ACTIVE, 'on' => 'emailActivation'],
];
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
'id' => 'ID',
'username' => 'Логин',
'email' => 'Email*',
'password' => 'Пароль',
];
}
/**
* Signs user up.
*
* @return User|null the saved model or null if saving fails
*/
public function signup()
{
if ($this->validate()) {
$user = new User();
$user->username = $this->username;
$user->email = $this->email;
$user->setPassword($this->password);
$user->generateAuthKey();
if ($this->sendSignupEmail($user))
{
Yii::$app->session->setFlash('success', 'Уведомление успешно отправлено');
}
else
{
Yii::$app->session->setFlash('danger', 'Произошла ошибка при отправке уведомления.');
}
if($this->scenario === 'emailActivation')
{
$user->generateActivateKey();
}
if ($user->save()) {
return $user;
}
}
return null;
}
public function sendActivationEmail($user)
{
return Yii::$app->mailer->compose('activationEmail', ['user' => $user])
->setFrom([Yii::$app->params['supportEmail'] => 'gapchich.ru (отправлено роботом).'])
->setTo($this->email)
->setSubject('Активация для '.Yii::$app->name)
->send();
}
/**
*
* @param User $user
*/
private function sendSignupEmail($user)
{
return Yii::$app->mailer->compose('newUserEmail', ['user' => $user])
// ->setFrom([Yii::$app->params['supportEmail'] => Yii::$app->name.' (отправлено роботом).'])
->setFrom([Yii::$app->params['supportEmail'] => Yii::$app->name.' (отправлено роботом).'])
->setTo(Yii::$app->params['supportEmail'])
->setSubject('Регистрация нового пользователя '.$user->username)
->send();
}
}
| {
"content_hash": "c03dd1a6f6a89c49492abbdcbc5317fe",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 130,
"avg_line_length": 30.88888888888889,
"alnum_prop": 0.4560044272274488,
"repo_name": "kvazarum/gapchichru",
"id": "4b68972111cb2e2164cfa7f86f67cd93a7684923",
"size": "3849",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "frontend/models/SignupForm.php",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "ApacheConf",
"bytes": "1274"
},
{
"name": "Batchfile",
"bytes": "1541"
},
{
"name": "CSS",
"bytes": "2819"
},
{
"name": "PHP",
"bytes": "272873"
}
],
"symlink_target": ""
} |
package org.apache.guacamole.net.auth.simple;
import java.util.Collections;
import org.apache.guacamole.net.auth.User;
/**
* An extremely simple read-only implementation of a Directory of Users which
* provides access to a single pre-defined User.
*/
public class SimpleUserDirectory extends SimpleDirectory<User> {
/**
* Creates a new SimpleUserDirectory which provides access to the single
* user provided.
*
* @param user The user to provide access to.
*/
public SimpleUserDirectory(User user) {
super(Collections.singletonMap(user.getIdentifier(), user));
}
}
| {
"content_hash": "6e760df67a03f45eb54e4ec793257371",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 77,
"avg_line_length": 25.75,
"alnum_prop": 0.7135922330097088,
"repo_name": "softpymesJeffer/incubator-guacamole-client",
"id": "f9068d4e3086ca67d4f0af9604232974bdf352f4",
"size": "1425",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "guacamole-ext/src/main/java/org/apache/guacamole/net/auth/simple/SimpleUserDirectory.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "111722"
},
{
"name": "HTML",
"bytes": "63951"
},
{
"name": "Java",
"bytes": "2017268"
},
{
"name": "JavaScript",
"bytes": "1331022"
},
{
"name": "PLSQL",
"bytes": "2094"
},
{
"name": "Roff",
"bytes": "2434"
},
{
"name": "Shell",
"bytes": "24501"
}
],
"symlink_target": ""
} |
//
// IMYAOPCollectionDemo.m
// YYKitDemo
//
// Created by ljh on 2018/10/22.
// Copyright © 2018 ibireme. All rights reserved.
//
#import "IMYAOPCollectionDemo.h"
@interface IMYAOPCollectionDemo () <IMYAOPCollectionViewDelegate, IMYAOPCollectionViewDataSource, IMYAOPCollectionViewGetModelProtocol>
@end
@implementation IMYAOPCollectionDemo
- (void)setAopUtils:(IMYAOPCollectionViewUtils *)aopUtils {
_aopUtils = aopUtils;
[self injectTableView];
}
- (void)injectTableView {
[self.aopUtils.collectionView registerClass:[UICollectionViewCell class] forCellWithReuseIdentifier:@"AD"];
///广告回调,跟TableView的Delegate,DataSource 一样。
self.aopUtils.delegate = self;
self.aopUtils.dataSource = self;
dispatch_async(dispatch_get_main_queue(), ^{
[self insertRows];
});
}
///简单的rows插入
- (void)insertRows {
NSMutableArray<IMYAOPCollectionViewInsertBody *> *insertBodys = [NSMutableArray array];
///随机生成了5个要插入的位置
for (int i = 0; i < 5; i++) {
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:arc4random() % 10 inSection:0];
[insertBodys addObject:[IMYAOPCollectionViewInsertBody insertBodyWithIndexPath:indexPath]];
}
///清空 旧数据
[self.aopUtils insertWithSections:nil];
[self.aopUtils insertWithIndexPaths:nil];
///插入 新数据, 同一个 row 会按数组的顺序 row 进行 递增
[self.aopUtils insertWithIndexPaths:insertBodys];
///调用tableView的reloadData,进行页面刷新
[self.aopUtils.collectionView reloadData];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
NSLog(@"%@", self.aopUtils.allModels);
});
}
/**
* 插入sections demo
* 单纯插入section 是没法显示的,要跟 row 配合。
*/
- (void)insertSections {
NSMutableArray<IMYAOPCollectionViewInsertBody *> *insertBodys = [NSMutableArray array];
for (int i = 1; i < 6; i++) {
NSInteger section = arc4random() % i;
IMYAOPCollectionViewInsertBody *body = [IMYAOPCollectionViewInsertBody insertBodyWithSection:section];
[insertBodys addObject:body];
}
[self.aopUtils insertWithSections:insertBodys];
[insertBodys enumerateObjectsUsingBlock:^(IMYAOPCollectionViewInsertBody *_Nonnull obj, NSUInteger idx, BOOL *_Nonnull stop) {
obj.indexPath = [NSIndexPath indexPathForRow:0 inSection:obj.resultSection];
}];
[self.aopUtils insertWithIndexPaths:insertBodys];
[self.aopUtils.collectionView reloadData];
}
#pragma mark -AOP Delegate
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
// 防止警告用的,并不会调用
return 1;
}
- (void)aopCollectionUtils:(IMYAOPCollectionViewUtils *)collectionUtils numberOfSections:(NSInteger)sectionNumber {
///可以获取真实的 sectionNumber 可以在这边进行一些AOP的数据初始化
}
- (void)aopCollectionUtils:(IMYAOPCollectionViewUtils *)collectionUtils willDisplayCell:(UICollectionViewCell *)cell forItemAtIndexPath:(NSIndexPath *)indexPath {
///真实的 will display 回调. 有些时候统计需要
}
- (void)aopCollectionUtils:(IMYAOPCollectionViewUtils *)collectionUtils didEndDisplayingCell:(UICollectionViewCell *)cell forItemAtIndexPath:(NSIndexPath *)indexPath {
///真实的 did end display 回调. 有些时候统计需要
}
- (id)collectionView:(UICollectionView *)collectionView modelForItemAtIndexPath:(NSIndexPath *)indexPath {
return [NSString stringWithFormat:@"ad: %ld, %ld", indexPath.section, indexPath.row];
}
#pragma mark - UITableView 回调
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"AD" forIndexPath:indexPath];
cell.contentView.backgroundColor = [UIColor redColor];
UILabel *titleLabel = [cell.contentView viewWithTag:100];
if (!titleLabel) {
titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, 20, 100, 20)];
titleLabel.tag = 100;
titleLabel.textColor = [UIColor whiteColor];
[cell.contentView addSubview:titleLabel];
}
titleLabel.text = [NSString stringWithFormat:@"ad cell %ld", indexPath.row];
return cell;
}
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
return CGSizeMake(100, 100);
}
- (void)collectionView:(UICollectionView *)collectionView willDisplayCell:(UICollectionViewCell *)cell forItemAtIndexPath:(NSIndexPath *)indexPath {
NSLog(@"插入的 ad cell 要显示啦 %ld", indexPath.row);
}
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"被点击了> <" message:[NSString stringWithFormat:@"我的位置: %@", indexPath] delegate:nil cancelButtonTitle:@"哦~滚" otherButtonTitles:nil];
[alertView show];
}
@end
| {
"content_hash": "9370d33d8db6aff115bfb6949204c04c",
"timestamp": "",
"source": "github",
"line_count": 127,
"max_line_length": 195,
"avg_line_length": 38.47244094488189,
"alnum_prop": 0.7413016782644289,
"repo_name": "li6185377/IMYAOPTableView",
"id": "a70936a05c31865a3fc4d0e898c3d783e2cc5293",
"size": "5205",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "AOPTableViewDemo/Demo/YYKitDemo/IMYAOPCollectionDemo.m",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Objective-C",
"bytes": "2175322"
},
{
"name": "Ruby",
"bytes": "84"
}
],
"symlink_target": ""
} |
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "69f800c8d3ff5f2287cd4d2208f5779a",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.23076923076923,
"alnum_prop": 0.6917293233082706,
"repo_name": "mdoering/backbone",
"id": "d9fb4baaf55ee14142e678826e466bd995d768b4",
"size": "194",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Liliopsida/Asparagales/Orchidaceae/Telipogon/Telipogon monteverdensis/ Syn. Stellilabium monteverdense/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
<?php
namespace Anax\Users;
/**
* Model for Users.
*
*/
class User extends \Anax\MVC\CDatabaseModel
{
public function getQuestions($acronym) {
$sql = "SELECT * FROM kmom07_user
JOIN kmom07_question
ON kmom07_question.name=kmom07_user.acronym";
$questions = $this->db->executeFetchAll($sql);
$res = array();
foreach($questions as $question) {
if ($question->acronym == $acronym) {
array_push($res, $question);
}
}
return $res;
}
public function getAnswers($acronym) {
$sql = "SELECT * FROM kmom07_user
JOIN kmom07_answer
ON kmom07_answer.user=kmom07_user.acronym";
$answers = $this->db->executeFetchAll($sql);
$res = array();
foreach($answers as $answer) {
if ($answer->acronym == $acronym) {
array_push($res, $answer);
}
}
return $res;
}
public function linkAnswerToQuestion($acronym) {
$sql = "SELECT * FROM kmom07_question
JOIN kmom07_answer
ON kmom07_answer.questionID=kmom07_question.id";
$answers = $this->db->executeFetchAll($sql);
$res = array();
foreach($answers as $answer) {
if ($answer->user == $acronym) {
array_push($res, $answer);
}
}
return $res;
}
public function incrementTimesLoggedOn($acronym) {
$sql = "SELECT timesLoggedOn FROM kmom07_user WHERE acronym = ?";
$params = array($acronym);
$timesLoggedOn = $this->db->executeFetchAll($sql, $params);
$val = $timesLoggedOn[0]->timesLoggedOn;
$val++;
$update = "UPDATE kmom07_user SET timesLoggedOn=? WHERE acronym=?;";
$params2 = array($val, $acronym);
$this->db->execute($update, $params2);
}
public function getMostLoggedOn() {
$sql = "SELECT * FROM kmom07_user
ORDER BY timesLoggedOn DESC LIMIT 3;";
$mostLoggedOn = $this->db->executeFetchAll($sql);
return $mostLoggedOn;
}
public function checkLogin() {
if (isset($_SESSION['user'])) {
return true;
}else{
return false;
}
}
} | {
"content_hash": "2f97e1c8453eb52d13809204c27047b2",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 72,
"avg_line_length": 23.933333333333334,
"alnum_prop": 0.5728876508820798,
"repo_name": "tomasvo89/kmom0710",
"id": "e536c10b2bb735978f86ab5ff19fad534fd5c012",
"size": "2154",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/Users/User.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "477"
},
{
"name": "CSS",
"bytes": "22616"
},
{
"name": "JavaScript",
"bytes": "3126"
},
{
"name": "PHP",
"bytes": "384469"
}
],
"symlink_target": ""
} |
<?php
// Register widgetized areas
if ( ! function_exists( 'the_widgets_init' ) ) {
function the_widgets_init() {
if ( ! function_exists( 'register_sidebars' ) )
return;
// Widgetized sidebars
register_sidebar( array( 'name' => __( 'Primary', 'woothemes' ), 'id' => 'primary', 'description' => __( 'The default primary sidebar for your website, used in two or three-column layouts.', 'woothemes' ), 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h3>', 'after_title' => '</h3>' ) );
register_sidebar( array( 'name' => __( 'Secondary', 'woothemes' ), 'id' => 'secondary', 'description' => __( 'A secondary sidebar for your website, used in three-column layouts.', 'woothemes' ), 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h3>', 'after_title' => '</h3>' ) );
// Footer widgetized areas
$total = get_option( 'woo_footer_sidebars', 4 );
if ( ! $total ) $total = 4;
for ( $i = 1; $i <= intval( $total ); $i++ ) {
register_sidebar( array( 'name' => sprintf( __( 'Footer %d', 'woothemes' ), $i ), 'id' => sprintf( 'footer-%d', $i ), 'description' => sprintf( __( 'Widgetized Footer Region %d.', 'woothemes' ), $i ), 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h3>', 'after_title' => '</h3>' ) );
}
register_sidebar( array( 'name' => __( 'Homepage', 'woothemes' ), 'id' => 'homepage', 'description' => __( 'Optional widgetized homepage (displays only if widgets are added here).', 'woothemes' ), 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h3>', 'after_title' => '</h3>' ) );
register_sidebar( array( 'name' => __( '"Widgets" Page Template', 'woothemes' ), 'id' => 'widgets-page-template', 'description' => __( 'The widgetized area used on the "Widgets" page template (displays only if widgets are added here). Defaults to page content if no widgets are added.', 'woothemes' ), 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h3>', 'after_title' => '</h3>' ) );
} // End the_widgets_init()
}
add_action( 'init', 'the_widgets_init' );
?> | {
"content_hash": "936e42d0d110e01a78a22019e14173c8",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 445,
"avg_line_length": 91.48,
"alnum_prop": 0.585045911674683,
"repo_name": "mandino/filmfestival.misfit.co",
"id": "842990d2e78336ffdd325c20e1475a30dfd7bd3e",
"size": "2287",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "wp-content/themes/filmfestival/includes/sidebar-init.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ActionScript",
"bytes": "5874"
},
{
"name": "CSS",
"bytes": "2070668"
},
{
"name": "JavaScript",
"bytes": "2562924"
},
{
"name": "PHP",
"bytes": "12409654"
},
{
"name": "Ruby",
"bytes": "863"
},
{
"name": "XSLT",
"bytes": "9376"
}
],
"symlink_target": ""
} |
package edu.ucdenver.ccp.datasource.rdfizer.rdf.filter;
import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import jdbm.PrimaryTreeMap;
import jdbm.RecordManager;
import jdbm.RecordManagerFactory;
import org.apache.log4j.Logger;
import edu.ucdenver.ccp.common.file.FileUtil;
/**
* @author Center for Computational Pharmacology, UC Denver; ccpsupport@ucdenver.edu
*
*/
public class Jdbm2Cache implements DiskBasedHash {
private static final Logger logger = Logger.getLogger(Jdbm2Cache.class);
private final RecordManager recMan;
// private final PrimaryTreeMap<String, String> map;
private final Map<String, PrimaryTreeMap<String, String>> maps;
private long addCount;
public Jdbm2Cache(File storageFile) throws IOException {
File storageDir = storageFile.getParentFile();
logger.info("JDBMS CACHE STORAGE: " + storageDir.getAbsolutePath());
if (!storageDir.exists()) {
logger.info("Creating directory to store duplicate filter cache files: " + storageDir);
FileUtil.mkdir(storageDir);
} else {
FileUtil.cleanDirectory(storageDir);
}
recMan = RecordManagerFactory.createRecordManager(storageFile.getAbsolutePath());
maps = new HashMap<String, PrimaryTreeMap<String, String>>();
// map = recMan.treeMap("triples");
}
@Override
public void add(Object o) throws IOException {
addCount++;
String[] nodeKeyValue = getNodeKeyValue(o.toString());
String nodeKey = nodeKeyValue[0];
String sha1 = nodeKeyValue[1];
PrimaryTreeMap<String, String> map = getMap(nodeKey);
map.put(sha1, "");
if (addCount % 1000000 == 0) {
commitToDisk();
}
}
/**
* @throws IOException
*/
private void commitToDisk() throws IOException {
logger.info("committing jdbm2 cache to disk...");
recMan.commit();
for (Entry<String, PrimaryTreeMap<String, String>> entry : maps.entrySet()) {
logger.info("cache size (" + entry.getKey() + "): " + entry.getValue().size());
}
}
/**
* @param nodeKey
* @return
*/
private PrimaryTreeMap<String, String> getMap(String nodeKey) {
if (maps.containsKey(nodeKey)) {
return maps.get(nodeKey);
}
PrimaryTreeMap<String, String> map = recMan.treeMap(nodeKey);
maps.put(nodeKey, map);
return map;
}
@Override
public boolean contains(Object o) {
String[] nodeKeyValue = getNodeKeyValue(o.toString());
String nodeKey = nodeKeyValue[0];
String sha1 = nodeKeyValue[1];
PrimaryTreeMap<String, String> map = getMap(nodeKey);
return map.containsKey(sha1);
// return map.containsKey(o.toString());
}
@Override
public void shutdown() throws IOException {
logger.info("shutting down Jdbm2Cache...");
commitToDisk();
recMan.close();
}
/**
* @param string
* @return
*/
private String[] getNodeKeyValue(String s) {
int underscoreIndex = s.indexOf("_");
String sha1 = s.substring(underscoreIndex + 1);
String nodeKey = s.substring(0, underscoreIndex);
// logger.debug("NODEKEY: " + nodeKey + " SHA1: " + sha1);
return new String[] { nodeKey, sha1 };
}
}
| {
"content_hash": "908761e755c19fcc6f61a4b48db1bc75",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 90,
"avg_line_length": 26.68695652173913,
"alnum_prop": 0.7109807754969045,
"repo_name": "bill-baumgartner/datasource",
"id": "8c21d8dc5590170e9705843c36d69e6a8aeedd52",
"size": "4759",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "datasource-rdfizer/src/main/java/edu/ucdenver/ccp/datasource/rdfizer/rdf/filter/Jdbm2Cache.java",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Java",
"bytes": "2951658"
},
{
"name": "Shell",
"bytes": "4434"
},
{
"name": "Web Ontology Language",
"bytes": "40558"
}
],
"symlink_target": ""
} |
import _plotly_utils.basevalidators
class ColorbarValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self, plotly_name="colorbar", parent_name="histogram2dcontour", **kwargs
):
super(ColorbarValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
data_class_str=kwargs.pop("data_class_str", "ColorBar"),
data_docs=kwargs.pop(
"data_docs",
"""
bgcolor
Sets the color of padded area.
bordercolor
Sets the axis line color.
borderwidth
Sets the width (in px) or the border enclosing
this color bar.
dtick
Sets the step in-between ticks on this axis.
Use with `tick0`. Must be a positive number, or
special strings available to "log" and "date"
axes. If the axis `type` is "log", then ticks
are set every 10^(n*dtick) where n is the tick
number. For example, to set a tick mark at 1,
10, 100, 1000, ... set dtick to 1. To set tick
marks at 1, 100, 10000, ... set dtick to 2. To
set tick marks at 1, 5, 25, 125, 625, 3125, ...
set dtick to log_10(5), or 0.69897000433. "log"
has several special values; "L<f>", where `f`
is a positive number, gives ticks linearly
spaced in value (but not position). For example
`tick0` = 0.1, `dtick` = "L0.5" will put ticks
at 0.1, 0.6, 1.1, 1.6 etc. To show powers of 10
plus small digits between, use "D1" (all
digits) or "D2" (only 2 and 5). `tick0` is
ignored for "D1" and "D2". If the axis `type`
is "date", then you must convert the time to
milliseconds. For example, to set the interval
between ticks to one day, set `dtick` to
86400000.0. "date" also has special values
"M<n>" gives ticks spaced by a number of
months. `n` must be a positive integer. To set
ticks on the 15th of every third month, set
`tick0` to "2000-01-15" and `dtick` to "M3". To
set ticks every 4 years, set `dtick` to "M48"
exponentformat
Determines a formatting rule for the tick
exponents. For example, consider the number
1,000,000,000. If "none", it appears as
1,000,000,000. If "e", 1e+9. If "E", 1E+9. If
"power", 1x10^9 (with 9 in a super script). If
"SI", 1G. If "B", 1B.
len
Sets the length of the color bar This measure
excludes the padding of both ends. That is, the
color bar length is this length minus the
padding on both ends.
lenmode
Determines whether this color bar's length
(i.e. the measure in the color variation
direction) is set in units of plot "fraction"
or in *pixels. Use `len` to set the value.
nticks
Specifies the maximum number of ticks for the
particular axis. The actual number of ticks
will be chosen automatically to be less than or
equal to `nticks`. Has an effect only if
`tickmode` is set to "auto".
outlinecolor
Sets the axis line color.
outlinewidth
Sets the width (in px) of the axis line.
separatethousands
If "true", even 4-digit integers are separated
showexponent
If "all", all exponents are shown besides their
significands. If "first", only the exponent of
the first tick is shown. If "last", only the
exponent of the last tick is shown. If "none",
no exponents appear.
showticklabels
Determines whether or not the tick labels are
drawn.
showtickprefix
If "all", all tick labels are displayed with a
prefix. If "first", only the first tick is
displayed with a prefix. If "last", only the
last tick is displayed with a suffix. If
"none", tick prefixes are hidden.
showticksuffix
Same as `showtickprefix` but for tick suffixes.
thickness
Sets the thickness of the color bar This
measure excludes the size of the padding, ticks
and labels.
thicknessmode
Determines whether this color bar's thickness
(i.e. the measure in the constant color
direction) is set in units of plot "fraction"
or in "pixels". Use `thickness` to set the
value.
tick0
Sets the placement of the first tick on this
axis. Use with `dtick`. If the axis `type` is
"log", then you must take the log of your
starting tick (e.g. to set the starting tick to
100, set the `tick0` to 2) except when
`dtick`=*L<f>* (see `dtick` for more info). If
the axis `type` is "date", it should be a date
string, like date data. If the axis `type` is
"category", it should be a number, using the
scale where each category is assigned a serial
number from zero in the order it appears.
tickangle
Sets the angle of the tick labels with respect
to the horizontal. For example, a `tickangle`
of -90 draws the tick labels vertically.
tickcolor
Sets the tick color.
tickfont
Sets the color bar's tick label font
tickformat
Sets the tick label formatting rule using d3
formatting mini-languages which are very
similar to those in Python. For numbers, see:
https://github.com/d3/d3-3.x-api-
reference/blob/master/Formatting.md#d3_format
And for dates see:
https://github.com/d3/d3-3.x-api-
reference/blob/master/Time-Formatting.md#format
We add one item to d3's date formatter: "%{n}f"
for fractional seconds with n digits. For
example, *2016-10-13 09:15:23.456* with
tickformat "%H~%M~%S.%2f" would display
"09~15~23.46"
tickformatstops
A tuple of :class:`plotly.graph_objects.histogr
am2dcontour.colorbar.Tickformatstop` instances
or dicts with compatible properties
tickformatstopdefaults
When used in a template (as layout.template.dat
a.histogram2dcontour.colorbar.tickformatstopdef
aults), sets the default property values to use
for elements of
histogram2dcontour.colorbar.tickformatstops
ticklen
Sets the tick length (in px).
tickmode
Sets the tick mode for this axis. If "auto",
the number of ticks is set via `nticks`. If
"linear", the placement of the ticks is
determined by a starting position `tick0` and a
tick step `dtick` ("linear" is the default
value if `tick0` and `dtick` are provided). If
"array", the placement of the ticks is set via
`tickvals` and the tick text is `ticktext`.
("array" is the default value if `tickvals` is
provided).
tickprefix
Sets a tick label prefix.
ticks
Determines whether ticks are drawn or not. If
"", this axis' ticks are not drawn. If
"outside" ("inside"), this axis' are drawn
outside (inside) the axis lines.
ticksuffix
Sets a tick label suffix.
ticktext
Sets the text displayed at the ticks position
via `tickvals`. Only has an effect if
`tickmode` is set to "array". Used with
`tickvals`.
ticktextsrc
Sets the source reference on Chart Studio Cloud
for ticktext .
tickvals
Sets the values at which ticks on this axis
appear. Only has an effect if `tickmode` is set
to "array". Used with `ticktext`.
tickvalssrc
Sets the source reference on Chart Studio Cloud
for tickvals .
tickwidth
Sets the tick width (in px).
title
:class:`plotly.graph_objects.histogram2dcontour
.colorbar.Title` instance or dict with
compatible properties
titlefont
Deprecated: Please use
histogram2dcontour.colorbar.title.font instead.
Sets this color bar's title font. Note that the
title's font used to be set by the now
deprecated `titlefont` attribute.
titleside
Deprecated: Please use
histogram2dcontour.colorbar.title.side instead.
Determines the location of color bar's title
with respect to the color bar. Note that the
title's location used to be set by the now
deprecated `titleside` attribute.
x
Sets the x position of the color bar (in plot
fraction).
xanchor
Sets this color bar's horizontal position
anchor. This anchor binds the `x` position to
the "left", "center" or "right" of the color
bar.
xpad
Sets the amount of padding (in px) along the x
direction.
y
Sets the y position of the color bar (in plot
fraction).
yanchor
Sets this color bar's vertical position anchor
This anchor binds the `y` position to the
"top", "middle" or "bottom" of the color bar.
ypad
Sets the amount of padding (in px) along the y
direction.
""",
),
**kwargs
)
| {
"content_hash": "de2d1be041a61a41ea2de832380baf47",
"timestamp": "",
"source": "github",
"line_count": 230,
"max_line_length": 80,
"avg_line_length": 47.32608695652174,
"alnum_prop": 0.5246669728984842,
"repo_name": "plotly/python-api",
"id": "11d3f5a1e0017a1b417fd8a2b3b4d2cab0fb5e93",
"size": "10885",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "packages/python/plotly/plotly/validators/histogram2dcontour/_colorbar.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "6870"
},
{
"name": "Makefile",
"bytes": "1708"
},
{
"name": "Python",
"bytes": "823245"
},
{
"name": "Shell",
"bytes": "3238"
}
],
"symlink_target": ""
} |
/*
* Modified by the GLib Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GLib Team. See the ChangeLog
* files for a list of changes. These files are distributed with
* GLib at ftp://ftp.gtk.org/pub/gtk/.
*/
/*
* MT safe
*/
#include "config.h"
#include "glib.h"
#include "galias.h"
void g_slist_push_allocator (gpointer dummy) { /* present for binary compat only */ }
void g_slist_pop_allocator (void) { /* present for binary compat only */ }
#define _g_slist_alloc0() g_slice_new0 (GSList)
#define _g_slist_alloc() g_slice_new (GSList)
#define _g_slist_free1(slist) g_slice_free (GSList, slist)
GSList*
g_slist_alloc (void)
{
return _g_slist_alloc0 ();
}
/**
* g_slist_free:
* @list: a #GSList
*
* Frees all of the memory used by a #GSList.
* The freed elements are returned to the slice allocator.
*/
void
g_slist_free (GSList *list)
{
g_slice_free_chain (GSList, list, next);
}
/**
* g_slist_free_1:
* @list: a #GSList element
*
* Frees one #GSList element.
* It is usually used after g_slist_remove_link().
*/
void
g_slist_free_1 (GSList *list)
{
_g_slist_free1 (list);
}
/**
* g_slist_append:
* @list: a #GSList
* @data: the data for the new element
*
* Adds a new element on to the end of the list.
*
* <note><para>
* The return value is the new start of the list, which may
* have changed, so make sure you store the new value.
* </para></note>
*
* <note><para>
* Note that g_slist_append() has to traverse the entire list
* to find the end, which is inefficient when adding multiple
* elements. A common idiom to avoid the inefficiency is to prepend
* the elements and reverse the list when all elements have been added.
* </para></note>
*
* |[
* /* Notice that these are initialized to the empty list. */
* GSList *list = NULL, *number_list = NULL;
*
* /* This is a list of strings. */
* list = g_slist_append (list, "first");
* list = g_slist_append (list, "second");
*
* /* This is a list of integers. */
* number_list = g_slist_append (number_list, GINT_TO_POINTER (27));
* number_list = g_slist_append (number_list, GINT_TO_POINTER (14));
* ]|
*
* Returns: the new start of the #GSList
*/
GSList*
g_slist_append (GSList *list,
gpointer data)
{
GSList *new_list;
GSList *last;
new_list = _g_slist_alloc ();
new_list->data = data;
new_list->next = NULL;
if (list)
{
last = g_slist_last (list);
/* g_assert (last != NULL); */
last->next = new_list;
return list;
}
else
return new_list;
}
/**
* g_slist_prepend:
* @list: a #GSList
* @data: the data for the new element
*
* Adds a new element on to the start of the list.
*
* <note><para>
* The return value is the new start of the list, which
* may have changed, so make sure you store the new value.
* </para></note>
*
* |[
* /* Notice that it is initialized to the empty list. */
* GSList *list = NULL;
* list = g_slist_prepend (list, "last");
* list = g_slist_prepend (list, "first");
* ]|
*
* Returns: the new start of the #GSList
*/
GSList*
g_slist_prepend (GSList *list,
gpointer data)
{
GSList *new_list;
new_list = _g_slist_alloc ();
new_list->data = data;
new_list->next = list;
return new_list;
}
/**
* g_slist_insert:
* @list: a #GSList
* @data: the data for the new element
* @position: the position to insert the element.
* If this is negative, or is larger than the number
* of elements in the list, the new element is added on
* to the end of the list.
*
* Inserts a new element into the list at the given position.
*
* Returns: the new start of the #GSList
*/
GSList*
g_slist_insert (GSList *list,
gpointer data,
gint position)
{
GSList *prev_list;
GSList *tmp_list;
GSList *new_list;
if (position < 0)
return g_slist_append (list, data);
else if (position == 0)
return g_slist_prepend (list, data);
new_list = _g_slist_alloc ();
new_list->data = data;
if (!list)
{
new_list->next = NULL;
return new_list;
}
prev_list = NULL;
tmp_list = list;
while ((position-- > 0) && tmp_list)
{
prev_list = tmp_list;
tmp_list = tmp_list->next;
}
if (prev_list)
{
new_list->next = prev_list->next;
prev_list->next = new_list;
}
else
{
new_list->next = list;
list = new_list;
}
return list;
}
/**
* g_slist_insert_before:
* @slist: a #GSList
* @sibling: node to insert @data before
* @data: data to put in the newly-inserted node
*
* Inserts a node before @sibling containing @data.
*
* Returns: the new head of the list.
*/
GSList*
g_slist_insert_before (GSList *slist,
GSList *sibling,
gpointer data)
{
if (!slist)
{
slist = _g_slist_alloc ();
slist->data = data;
slist->next = NULL;
g_return_val_if_fail (sibling == NULL, slist);
return slist;
}
else
{
GSList *node, *last = NULL;
for (node = slist; node; last = node, node = last->next)
if (node == sibling)
break;
if (!last)
{
node = _g_slist_alloc ();
node->data = data;
node->next = slist;
return node;
}
else
{
node = _g_slist_alloc ();
node->data = data;
node->next = last->next;
last->next = node;
return slist;
}
}
}
/**
* g_slist_concat:
* @list1: a #GSList
* @list2: the #GSList to add to the end of the first #GSList
*
* Adds the second #GSList onto the end of the first #GSList.
* Note that the elements of the second #GSList are not copied.
* They are used directly.
*
* Returns: the start of the new #GSList
*/
GSList *
g_slist_concat (GSList *list1, GSList *list2)
{
if (list2)
{
if (list1)
g_slist_last (list1)->next = list2;
else
list1 = list2;
}
return list1;
}
/**
* g_slist_remove:
* @list: a #GSList
* @data: the data of the element to remove
*
* Removes an element from a #GSList.
* If two elements contain the same data, only the first is removed.
* If none of the elements contain the data, the #GSList is unchanged.
*
* Returns: the new start of the #GSList
*/
GSList*
g_slist_remove (GSList *list,
gconstpointer data)
{
GSList *tmp, *prev = NULL;
tmp = list;
while (tmp)
{
if (tmp->data == data)
{
if (prev)
prev->next = tmp->next;
else
list = tmp->next;
g_slist_free_1 (tmp);
break;
}
prev = tmp;
tmp = prev->next;
}
return list;
}
/**
* g_slist_remove_all:
* @list: a #GSList
* @data: data to remove
*
* Removes all list nodes with data equal to @data.
* Returns the new head of the list. Contrast with
* g_slist_remove() which removes only the first node
* matching the given data.
*
* Returns: new head of @list
*/
GSList*
g_slist_remove_all (GSList *list,
gconstpointer data)
{
GSList *tmp, *prev = NULL;
tmp = list;
while (tmp)
{
if (tmp->data == data)
{
GSList *next = tmp->next;
if (prev)
prev->next = next;
else
list = next;
g_slist_free_1 (tmp);
tmp = next;
}
else
{
prev = tmp;
tmp = prev->next;
}
}
return list;
}
static inline GSList*
_g_slist_remove_link (GSList *list,
GSList *link)
{
GSList *tmp;
GSList *prev;
prev = NULL;
tmp = list;
while (tmp)
{
if (tmp == link)
{
if (prev)
prev->next = tmp->next;
if (list == tmp)
list = list->next;
tmp->next = NULL;
break;
}
prev = tmp;
tmp = tmp->next;
}
return list;
}
/**
* g_slist_remove_link:
* @list: a #GSList
* @link_: an element in the #GSList
*
* Removes an element from a #GSList, without
* freeing the element. The removed element's next
* link is set to %NULL, so that it becomes a
* self-contained list with one element.
*
* Returns: the new start of the #GSList, without the element
*/
GSList*
g_slist_remove_link (GSList *list,
GSList *link_)
{
return _g_slist_remove_link (list, link_);
}
/**
* g_slist_delete_link:
* @list: a #GSList
* @link_: node to delete
*
* Removes the node link_ from the list and frees it.
* Compare this to g_slist_remove_link() which removes the node
* without freeing it.
*
* Returns: the new head of @list
*/
GSList*
g_slist_delete_link (GSList *list,
GSList *link_)
{
list = _g_slist_remove_link (list, link_);
_g_slist_free1 (link_);
return list;
}
/**
* g_slist_copy:
* @list: a #GSList
*
* Copies a #GSList.
*
* <note><para>
* Note that this is a "shallow" copy. If the list elements
* consist of pointers to data, the pointers are copied but
* the actual data isn't.
* </para></note>
*
* Returns: a copy of @list
*/
GSList*
g_slist_copy (GSList *list)
{
GSList *new_list = NULL;
if (list)
{
GSList *last;
new_list = _g_slist_alloc ();
new_list->data = list->data;
last = new_list;
list = list->next;
while (list)
{
last->next = _g_slist_alloc ();
last = last->next;
last->data = list->data;
list = list->next;
}
last->next = NULL;
}
return new_list;
}
/**
* g_slist_reverse:
* @list: a #GSList
*
* Reverses a #GSList.
*
* Returns: the start of the reversed #GSList
*/
GSList*
g_slist_reverse (GSList *list)
{
GSList *prev = NULL;
while (list)
{
GSList *next = list->next;
list->next = prev;
prev = list;
list = next;
}
return prev;
}
/**
* g_slist_nth:
* @list: a #GSList
* @n: the position of the element, counting from 0
*
* Gets the element at the given position in a #GSList.
*
* Returns: the element, or %NULL if the position is off
* the end of the #GSList
*/
GSList*
g_slist_nth (GSList *list,
guint n)
{
while (n-- > 0 && list)
list = list->next;
return list;
}
/**
* g_slist_nth_data:
* @list: a #GSList
* @n: the position of the element
*
* Gets the data of the element at the given position.
*
* Returns: the element's data, or %NULL if the position
* is off the end of the #GSList
*/
gpointer
g_slist_nth_data (GSList *list,
guint n)
{
while (n-- > 0 && list)
list = list->next;
return list ? list->data : NULL;
}
/**
* g_slist_find:
* @list: a #GSList
* @data: the element data to find
*
* Finds the element in a #GSList which
* contains the given data.
*
* Returns: the found #GSList element,
* or %NULL if it is not found
*/
GSList*
g_slist_find (GSList *list,
gconstpointer data)
{
while (list)
{
if (list->data == data)
break;
list = list->next;
}
return list;
}
/**
* g_slist_find_custom:
* @list: a #GSList
* @data: user data passed to the function
* @func: the function to call for each element.
* It should return 0 when the desired element is found
*
* Finds an element in a #GSList, using a supplied function to
* find the desired element. It iterates over the list, calling
* the given function which should return 0 when the desired
* element is found. The function takes two #gconstpointer arguments,
* the #GSList element's data as the first argument and the
* given user data.
*
* Returns: the found #GSList element, or %NULL if it is not found
*/
GSList*
g_slist_find_custom (GSList *list,
gconstpointer data,
GCompareFunc func)
{
g_return_val_if_fail (func != NULL, list);
while (list)
{
if (! func (list->data, data))
return list;
list = list->next;
}
return NULL;
}
/**
* g_slist_position:
* @list: a #GSList
* @llink: an element in the #GSList
*
* Gets the position of the given element
* in the #GSList (starting from 0).
*
* Returns: the position of the element in the #GSList,
* or -1 if the element is not found
*/
gint
g_slist_position (GSList *list,
GSList *llink)
{
gint i;
i = 0;
while (list)
{
if (list == llink)
return i;
i++;
list = list->next;
}
return -1;
}
/**
* g_slist_index:
* @list: a #GSList
* @data: the data to find
*
* Gets the position of the element containing
* the given data (starting from 0).
*
* Returns: the index of the element containing the data,
* or -1 if the data is not found
*/
gint
g_slist_index (GSList *list,
gconstpointer data)
{
gint i;
i = 0;
while (list)
{
if (list->data == data)
return i;
i++;
list = list->next;
}
return -1;
}
/**
* g_slist_last:
* @list: a #GSList
*
* Gets the last element in a #GSList.
*
* <note><para>
* This function iterates over the whole list.
* </para></note>
*
* Returns: the last element in the #GSList,
* or %NULL if the #GSList has no elements
*/
GSList*
g_slist_last (GSList *list)
{
if (list)
{
while (list->next)
list = list->next;
}
return list;
}
/**
* g_slist_length:
* @list: a #GSList
*
* Gets the number of elements in a #GSList.
*
* <note><para>
* This function iterates over the whole list to
* count its elements.
* </para></note>
*
* Returns: the number of elements in the #GSList
*/
guint
g_slist_length (GSList *list)
{
guint length;
length = 0;
while (list)
{
length++;
list = list->next;
}
return length;
}
/**
* g_slist_foreach:
* @list: a #GSList
* @func: the function to call with each element's data
* @user_data: user data to pass to the function
*
* Calls a function for each element of a #GSList.
*/
void
g_slist_foreach (GSList *list,
GFunc func,
gpointer user_data)
{
while (list)
{
GSList *next = list->next;
(*func) (list->data, user_data);
list = next;
}
}
static GSList*
g_slist_insert_sorted_real (GSList *list,
gpointer data,
GFunc func,
gpointer user_data)
{
GSList *tmp_list = list;
GSList *prev_list = NULL;
GSList *new_list;
gint cmp;
g_return_val_if_fail (func != NULL, list);
if (!list)
{
new_list = _g_slist_alloc ();
new_list->data = data;
new_list->next = NULL;
return new_list;
}
cmp = ((GCompareDataFunc) func) (data, tmp_list->data, user_data);
while ((tmp_list->next) && (cmp > 0))
{
prev_list = tmp_list;
tmp_list = tmp_list->next;
cmp = ((GCompareDataFunc) func) (data, tmp_list->data, user_data);
}
new_list = _g_slist_alloc ();
new_list->data = data;
if ((!tmp_list->next) && (cmp > 0))
{
tmp_list->next = new_list;
new_list->next = NULL;
return list;
}
if (prev_list)
{
prev_list->next = new_list;
new_list->next = tmp_list;
return list;
}
else
{
new_list->next = list;
return new_list;
}
}
/**
* g_slist_insert_sorted:
* @list: a #GSList
* @data: the data for the new element
* @func: the function to compare elements in the list.
* It should return a number > 0 if the first parameter
* comes after the second parameter in the sort order.
*
* Inserts a new element into the list, using the given
* comparison function to determine its position.
*
* Returns: the new start of the #GSList
*/
GSList*
g_slist_insert_sorted (GSList *list,
gpointer data,
GCompareFunc func)
{
return g_slist_insert_sorted_real (list, data, (GFunc) func, NULL);
}
/**
* g_slist_insert_sorted_with_data:
* @list: a #GSList
* @data: the data for the new element
* @func: the function to compare elements in the list.
* It should return a number > 0 if the first parameter
* comes after the second parameter in the sort order.
* @user_data: data to pass to comparison function
*
* Inserts a new element into the list, using the given
* comparison function to determine its position.
*
* Returns: the new start of the #GSList
*
* Since: 2.10
*/
GSList*
g_slist_insert_sorted_with_data (GSList *list,
gpointer data,
GCompareDataFunc func,
gpointer user_data)
{
return g_slist_insert_sorted_real (list, data, (GFunc) func, user_data);
}
static GSList *
g_slist_sort_merge (GSList *l1,
GSList *l2,
GFunc compare_func,
gpointer user_data)
{
GSList list, *l;
gint cmp;
l=&list;
while (l1 && l2)
{
cmp = ((GCompareDataFunc) compare_func) (l1->data, l2->data, user_data);
if (cmp <= 0)
{
l=l->next=l1;
l1=l1->next;
}
else
{
l=l->next=l2;
l2=l2->next;
}
}
l->next= l1 ? l1 : l2;
return list.next;
}
static GSList *
g_slist_sort_real (GSList *list,
GFunc compare_func,
gpointer user_data)
{
GSList *l1, *l2;
if (!list)
return NULL;
if (!list->next)
return list;
l1 = list;
l2 = list->next;
while ((l2 = l2->next) != NULL)
{
if ((l2 = l2->next) == NULL)
break;
l1=l1->next;
}
l2 = l1->next;
l1->next = NULL;
return g_slist_sort_merge (g_slist_sort_real (list, compare_func, user_data),
g_slist_sort_real (l2, compare_func, user_data),
compare_func,
user_data);
}
/**
* g_slist_sort:
* @list: a #GSList
* @compare_func: the comparison function used to sort the #GSList.
* This function is passed the data from 2 elements of the #GSList
* and should return 0 if they are equal, a negative value if the
* first element comes before the second, or a positive value if
* the first element comes after the second.
*
* Sorts a #GSList using the given comparison function.
*
* Returns: the start of the sorted #GSList
*/
GSList *
g_slist_sort (GSList *list,
GCompareFunc compare_func)
{
return g_slist_sort_real (list, (GFunc) compare_func, NULL);
}
/**
* g_slist_sort_with_data:
* @list: a #GSList
* @compare_func: comparison function
* @user_data: data to pass to comparison function
*
* Like g_slist_sort(), but the sort function accepts a user data argument.
*
* Returns: new head of the list
*/
GSList *
g_slist_sort_with_data (GSList *list,
GCompareDataFunc compare_func,
gpointer user_data)
{
return g_slist_sort_real (list, (GFunc) compare_func, user_data);
}
#define __G_SLIST_C__
#include "galiasdef.c"
| {
"content_hash": "9c671a58945828f3783da01bb4a01367",
"timestamp": "",
"source": "github",
"line_count": 931,
"max_line_length": 85,
"avg_line_length": 19.72717508055854,
"alnum_prop": 0.5965370793858217,
"repo_name": "Xperia-Nicki/android_platform_sony_nicki",
"id": "47c50416aa205d6b0206eca4095007eb0ef9c517",
"size": "19242",
"binary": false,
"copies": "33",
"ref": "refs/heads/master",
"path": "external/bluetooth/glib/glib/gslist.c",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Ada",
"bytes": "89080"
},
{
"name": "Assembly",
"bytes": "212775"
},
{
"name": "Awk",
"bytes": "19252"
},
{
"name": "C",
"bytes": "68667466"
},
{
"name": "C#",
"bytes": "55625"
},
{
"name": "C++",
"bytes": "54670920"
},
{
"name": "CLIPS",
"bytes": "12224"
},
{
"name": "CSS",
"bytes": "283405"
},
{
"name": "D",
"bytes": "1931"
},
{
"name": "Java",
"bytes": "4882"
},
{
"name": "JavaScript",
"bytes": "19597804"
},
{
"name": "Objective-C",
"bytes": "5849156"
},
{
"name": "PHP",
"bytes": "17224"
},
{
"name": "Pascal",
"bytes": "42411"
},
{
"name": "Perl",
"bytes": "1632149"
},
{
"name": "Prolog",
"bytes": "214621"
},
{
"name": "Python",
"bytes": "3493321"
},
{
"name": "R",
"bytes": "290"
},
{
"name": "Ruby",
"bytes": "78743"
},
{
"name": "Scilab",
"bytes": "554"
},
{
"name": "Shell",
"bytes": "265637"
},
{
"name": "TypeScript",
"bytes": "45459"
},
{
"name": "XSLT",
"bytes": "11219"
}
],
"symlink_target": ""
} |
namespace MVCMagicSampleMVC6BP.Controllers
{
using Boilerplate.Web.Mvc;
using Microsoft.AspNet.Mvc;
using MVCMagicSampleMVC6BP.Constants;
/// <summary>
/// Provides methods that respond to HTTP requests with HTTP errors.
/// </summary>
[Route("[controller]")]
public sealed class ErrorController : Controller
{
#region Public Methods
/// <summary>
/// Gets the error view for the specified HTTP error status code. Returns a <see cref="PartialViewResult"/> if
/// the request is an Ajax request, otherwise returns a full <see cref="ViewResult"/>.
/// </summary>
/// <param name="statusCode">The HTTP error status code.</param>
/// <param name="status">The name of the HTTP error status code e.g. 'notfound'. This is not used but is here
/// for aesthetic purposes.</param>
/// <returns>A <see cref="PartialViewResult"/> if the request is an Ajax request, otherwise returns a full
/// <see cref="ViewResult"/> containing the error view.</returns>
[ResponseCache(CacheProfileName = CacheProfileNames.Error)]
[HttpGet("{statusCode}/{status?}", Name = ActionNames.ErrorController.Get.Error)]
public IActionResult Error(int statusCode, string status)
{
this.Response.StatusCode = statusCode;
ActionResult result;
if (this.Request.IsAjaxRequest())
{
// This allows us to show errors even in partial views.
result = this.PartialView(ViewNames.ErrorController.Error, statusCode);
}
else
{
result = this.View(ViewNames.ErrorController.Error, statusCode);
}
return result;
}
#endregion
}
} | {
"content_hash": "87cb7d26e0f18ad354b9eaf4581264a1",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 119,
"avg_line_length": 39.369565217391305,
"alnum_prop": 0.616234124792932,
"repo_name": "Pro-Coded/MVCMagic",
"id": "3dcbcc543d56235cdfea3c334054d534c9231dd0",
"size": "1813",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "MVCMagicSampleMVC6BP/Controllers/ErrorController.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "111"
},
{
"name": "C#",
"bytes": "353237"
},
{
"name": "CSS",
"bytes": "83595"
},
{
"name": "HTML",
"bytes": "145448"
},
{
"name": "JavaScript",
"bytes": "40825"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>onMute property - MediaStreamTrack class - polymer_app_layout.behaviors library - Dart API</title>
<!-- required because all the links are pseudo-absolute -->
<base href="../..">
<link href='https://fonts.googleapis.com/css?family=Source+Code+Pro|Roboto:500,400italic,300,400' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="static-assets/prettify.css">
<link rel="stylesheet" href="static-assets/css/bootstrap.min.css">
<link rel="stylesheet" href="static-assets/styles.css">
<meta name="description" content="API docs for the onMute property from the MediaStreamTrack class, for the Dart programming language.">
<link rel="icon" href="static-assets/favicon.png">
<!-- Do not remove placeholder -->
<!-- Header Placeholder -->
</head>
<body>
<div id="overlay-under-drawer"></div>
<header class="container-fluid" id="title">
<nav class="navbar navbar-fixed-top">
<div class="container">
<button id="sidenav-left-toggle" type="button"> </button>
<ol class="breadcrumbs gt-separated hidden-xs">
<li><a href="index.html">polymer_app_layout_template</a></li>
<li><a href="polymer_app_layout.behaviors/polymer_app_layout.behaviors-library.html">polymer_app_layout.behaviors</a></li>
<li><a href="polymer_app_layout.behaviors/MediaStreamTrack-class.html">MediaStreamTrack</a></li>
<li class="self-crumb">onMute</li>
</ol>
<div class="self-name">onMute</div>
</div>
</nav>
<div class="container masthead">
<ol class="breadcrumbs gt-separated visible-xs">
<li><a href="index.html">polymer_app_layout_template</a></li>
<li><a href="polymer_app_layout.behaviors/polymer_app_layout.behaviors-library.html">polymer_app_layout.behaviors</a></li>
<li><a href="polymer_app_layout.behaviors/MediaStreamTrack-class.html">MediaStreamTrack</a></li>
<li class="self-crumb">onMute</li>
</ol>
<div class="title-description">
<h1 class="title">
<div class="kind">property</div> onMute
</h1>
<!-- p class="subtitle">
Stream of <code class="prettyprint lang-dart">mute</code> events handled by this <code class="prettyprint lang-dart">MediaStreamTrack</code>.
</p -->
</div>
<ul class="subnav">
</ul>
</div>
</header>
<div class="container body">
<div class="col-xs-6 col-sm-3 sidebar sidebar-offcanvas-left">
<h5><a href="index.html">polymer_app_layout_template</a></h5>
<h5><a href="polymer_app_layout.behaviors/polymer_app_layout.behaviors-library.html">polymer_app_layout.behaviors</a></h5>
<h5><a href="polymer_app_layout.behaviors/MediaStreamTrack-class.html">MediaStreamTrack</a></h5>
<ol>
<li class="section-title"><a href="polymer_app_layout.behaviors/MediaStreamTrack-class.html#constants">Constants</a></li>
<li><a href="polymer_app_layout.behaviors/MediaStreamTrack/endedEvent.html">endedEvent</a></li>
<li><a href="polymer_app_layout.behaviors/MediaStreamTrack/muteEvent.html">muteEvent</a></li>
<li><a href="polymer_app_layout.behaviors/MediaStreamTrack/unmuteEvent.html">unmuteEvent</a></li>
<li class="section-title"><a href="polymer_app_layout.behaviors/MediaStreamTrack-class.html#static-methods">Static methods</a></li>
<li><a href="polymer_app_layout.behaviors/MediaStreamTrack/getSources.html">getSources</a></li>
<li class="section-title"><a href="polymer_app_layout.behaviors/MediaStreamTrack-class.html#instance-properties">Properties</a></li>
<li><a href="polymer_app_layout.behaviors/MediaStreamTrack/enabled.html">enabled</a>
</li>
<li><a href="polymer_app_layout.behaviors/MediaStreamTrack/id.html">id</a>
</li>
<li><a href="polymer_app_layout.behaviors/MediaStreamTrack/kind.html">kind</a>
</li>
<li><a href="polymer_app_layout.behaviors/MediaStreamTrack/label.html">label</a>
</li>
<li><a href="polymer_app_layout.behaviors/MediaStreamTrack/muted.html">muted</a>
</li>
<li>on
</li>
<li><a href="polymer_app_layout.behaviors/MediaStreamTrack/onEnded.html">onEnded</a>
</li>
<li><a href="polymer_app_layout.behaviors/MediaStreamTrack/onMute.html">onMute</a>
</li>
<li><a href="polymer_app_layout.behaviors/MediaStreamTrack/onUnmute.html">onUnmute</a>
</li>
<li><a href="polymer_app_layout.behaviors/MediaStreamTrack/readyState.html">readyState</a>
</li>
<li class="section-title"><a href="polymer_app_layout.behaviors/MediaStreamTrack-class.html#methods">Methods</a></li>
<li>addEventListener
</li>
<li><a href="polymer_app_layout.behaviors/MediaStreamTrack/clone.html">clone</a>
</li>
<li>dispatchEvent
</li>
<li>removeEventListener
</li>
<li><a href="polymer_app_layout.behaviors/MediaStreamTrack/stop.html">stop</a>
</li>
</ol>
</div><!--/.sidebar-offcanvas-->
<div class="col-xs-12 col-sm-9 col-md-6 main-content">
<section class="multi-line-signature">
<span class="returntype">Stream<<a href="dart-html/Event-class.html">Event</a>></span>
<span class="name ">onMute</span>
<div class="readable-writable">
read-only
</div>
</section>
<section class="desc markdown">
<p>Stream of <code class="prettyprint lang-dart">mute</code> events handled by this <code class="prettyprint lang-dart">MediaStreamTrack</code>.</p>
</section>
</div> <!-- /.main-content -->
</div> <!-- container -->
<footer>
<div class="container-fluid">
<div class="container">
<p class="text-center">
<span class="no-break">
polymer_app_layout_template 0.1.0 api docs
</span>
•
<span class="copyright no-break">
<a href="https://www.dartlang.org">
<img src="static-assets/favicon.png" alt="Dart" title="Dart"width="16" height="16">
</a>
</span>
•
<span class="copyright no-break">
<a href="http://creativecommons.org/licenses/by-sa/4.0/">cc license</a>
</span>
</p>
</div>
</div>
</footer>
<script src="static-assets/prettify.js"></script>
<script src="static-assets/script.js"></script>
<!-- Do not remove placeholder -->
<!-- Footer Placeholder -->
</body>
</html>
| {
"content_hash": "6ddd366f750362728c7caf53f3936ad4",
"timestamp": "",
"source": "github",
"line_count": 164,
"max_line_length": 160,
"avg_line_length": 41.59146341463415,
"alnum_prop": 0.6293798563260519,
"repo_name": "lejard-h/polymer_app_layout_templates",
"id": "b412e8176b57468e2ea9be1b8c6584f7459f3ff3",
"size": "6821",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "doc/api/polymer_app_layout.behaviors/MediaStreamTrack/onMute.html",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "2381"
},
{
"name": "Dart",
"bytes": "25778"
},
{
"name": "HTML",
"bytes": "17680"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--
-->
<templates><template autoinsert="true" context="java" deleted="false" description="init method for junit 4" enabled="true" name="b4">${before:import('org.junit.Before')}${initMocks:importStatic('org.mockito.MockitoAnnotations.*')}
@${:newType(org.junit.Before)}
public void initBeforeTest() throws Exception {
initMocks(this);
${cursor}
}</template><template autoinsert="true" context="java" deleted="false" description="Junit 4 for testing exception" enabled="true" name="te">${:import('org.junit.Test')}
@${annotation:newType(org.junit.Test)}(expected=${expectionname}.class)
public void should_throw_${testname}_when() throws Exception {
${cursor}
}</template><template autoinsert="true" context="java-members" deleted="false" description="test method (JUnit 4)" enabled="true" name="tt">${staticImport:importStatic('org.junit.Assert.*')}${staticImport1:importStatic('org.mockito.Mockito.*')}${staticImport2:importStatic('org.mockito.MockitoAnnotations.Mock')}
@${:newType(org.junit.Test)}
public void should_${testname}() throws Exception {
${cursor}
}</template></templates> | {
"content_hash": "5655f9b4c790b79cacf564ff8cc332e9",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 312,
"avg_line_length": 63.833333333333336,
"alnum_prop": 0.7362924281984334,
"repo_name": "xebia-france/dev-radar",
"id": "eefc5ed09eb27ef95289e86b1a000433c2941dcd",
"size": "1938",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "build-tools/tdd-basic-templates.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "46964"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/ll_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" />
</androidx.core.widget.NestedScrollView> | {
"content_hash": "a67293713029abffbe4c7d12f02705f4",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 97,
"avg_line_length": 40.72727272727273,
"alnum_prop": 0.7053571428571429,
"repo_name": "ximsfei/Android-skin-support",
"id": "74ef699ab8adf89db0e91ff5834964f2739ffca8",
"size": "448",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "demo/skin-mobile/src/main/res/layout/fragment_base.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "719213"
},
{
"name": "Shell",
"bytes": "625"
}
],
"symlink_target": ""
} |
package com.mauriciotogneri.dry.compiler.runtime.statements;
import com.mauriciotogneri.dry.compiler.runtime.Context;
import com.mauriciotogneri.dry.compiler.runtime.constant.Constant;
import java.util.Optional;
public interface Statement
{
Optional<Constant> execute(Context context);
} | {
"content_hash": "b775c922f030106971cc4e3993482b64",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 66,
"avg_line_length": 26.727272727272727,
"alnum_prop": 0.826530612244898,
"repo_name": "mauriciotogneri/dry",
"id": "0a7fe8bd345ae91075010d653533b546ad0bfae5",
"size": "294",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/com/mauriciotogneri/dry/compiler/runtime/statements/Statement.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "138561"
},
{
"name": "Shell",
"bytes": "161"
}
],
"symlink_target": ""
} |
pub mod ffi;
pub mod atom;
pub mod connection;
pub mod screen;
pub mod event;
pub mod window;
pub use self::connection::Connection;
pub use self::screen::Screen;
pub use self::window::Window;
pub use self::atom::Atom;
pub use self::event::{
Event, EventType, EventIterator, ResizedEvent, MouseMovedEvent,
ButtonPressedEvent, ButtonReleasedEvent, MouseButton,
};
#[derive(PartialEq)]
pub struct XID {
pub id: ffi::c_uint
}
| {
"content_hash": "2181529119fc22468152184652c2489f",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 66,
"avg_line_length": 21.65,
"alnum_prop": 0.7367205542725174,
"repo_name": "polydraw/polydraw",
"id": "2e53bb13c1eecffba77c022a8d3e351cf3ef1ee1",
"size": "463",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/sys/xcb/mod.rs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Rust",
"bytes": "471918"
}
],
"symlink_target": ""
} |
#pragma once
#ifndef __H__OCULAR_EDITOR_ROUTINE_DISPLAY__H__
#define __H__OCULAR_EDITOR_ROUTINE_DISPLAY__H__
#include "PropertiesDisplayBox.hpp"
//------------------------------------------------------------------------------------------
/**
* \addtogroup Ocular
* @{
*/
namespace Ocular
{
/**
* \addtogroup Editor
* @{
*/
namespace Editor
{
/**
* \class RoutineDisplay
*/
class RoutineDisplay : public PropertiesDisplayBox
{
public:
RoutineDisplay(std::string const& routineName, QWidget* parent = nullptr);
~RoutineDisplay();
//------------------------------------------------------------
virtual void setObject(Core::SceneObject* object) override;
virtual void updateProperties() override;
protected:
void buildProperties();
void removeProperties();
//------------------------------------------------------------
Core::ARoutine* m_Routine;
std::string m_RoutineName;
private:
std::vector<PropertyWidget*> m_Properties;
};
}
/**
* @} End of Doxygen Groups
*/
}
/**
* @} End of Doxygen Groups
*/
//------------------------------------------------------------------------------------------
#endif | {
"content_hash": "9e97e8853dd8714eecd5e57b01e2bd12",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 92,
"avg_line_length": 21.390625,
"alnum_prop": 0.41490138787436087,
"repo_name": "ssell/OcularEngine",
"id": "75c42d027be5b83ab95c542b45c9ab7cd02d09dd",
"size": "1997",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "OcularEditor/include/Widgets/Properties/RoutineDisplay.hpp",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "1913"
},
{
"name": "C++",
"bytes": "3134358"
},
{
"name": "GLSL",
"bytes": "8"
},
{
"name": "HLSL",
"bytes": "28813"
}
],
"symlink_target": ""
} |
require_relative "parser_result"
module BaseParsers
def eof
Parser.new do |input|
if input == "" || input.nil?
ParserResult.ok(matched: "", remaining: input)
else
ParserResult.fail(input)
end
end
end
def empty
Parser.new do |input|
ParserResult.ok(matched: "", remaining: input)
end
end
def whitespace
many0 { anyChar([' '] + %w[\b \f \n \r \t]) }
end
def one(char)
Parser.new do |input|
if input[0] == char
ParserResult.ok(matched: char, remaining: input[1..-1])
else
ParserResult.fail(input)
end
end
end
def str(string)
Parser.new do |input|
if input.start_with?(string)
ParserResult.ok(matched: string, remaining: input[string.length..-1])
else
ParserResult.fail(input)
end
end
end
def anyLetter
anyChar(('a'..'z').to_a + ('A'..'Z').to_a)
end
def anyNumber
anyChar ('0'..'9').to_a
end
def many1(&wrapper)
Parser.new do |input|
matched = ""
remaining = input
parser = wrapper.call
loop do
result = parser.run(remaining)
break if remaining.nil? || result.fail?
matched = matched + result.matched
remaining = result.remaining
end
ParserResult.new(!matched.empty?, remaining, matched)
end
end
def many0(&wrapper)
Parser.new do |input|
if input.nil? || input == ""
ParserResult.ok(matched: "", remaining: input)
else
many1(&wrapper).run(input)
end
end
end
def seq(*args)
callback = args[-1]
parsers = args[0..(args.length - 2)]
raise "Seq expects at least a parser and a callback." if callback.nil? || parsers.empty?
Parser.new do |input|
remaining = input
matched = ""
new_args = parsers.map do |parser|
result = parser.run(remaining)
return ParserResult.fail(input) unless result.ok?
remaining = result.remaining
result.matched
end
callback.call(*new_args)
end
end
# This is just an alias of lambda in the DSL. See specs for more on this.
#
def satisfy(&wrapper)
Parser.new do |input|
wrapper.call(input)
end
end
def regex(re)
Parser.new do |input|
test regex: re, with: input
end
end
def match(rule, between:)
first, last = between
Parser.new do |input|
lhs = first.run(input)
if lhs.ok?
middle = rule.run(lhs.remaining)
if middle.ok?
rhs = last.run(middle.remaining)
if rhs.ok?
rhs
else
ParserResult.fail(input)
end
else
ParserResult.fail(input)
end
else
ParserResult.fail(input)
end
end
end
def anyChar(chars)
Parser.new do |input|
first_char = input[0]
result = ParserResult.fail(input)
chars.each do |char|
if first_char == char
result = ParserResult.ok(matched: char, remaining: input[1..-1])
break
end
end
result
end
end
def anyCharBut(chars)
Parser.new do |input|
first_char = input[0]
result = ParserResult.ok(matched: first_char, remaining: input[1..-1])
chars.each do |char|
if first_char == char
result = ParserResult.fail(input)
break
end
end
result
end
end
def exactly(n, &wrapper)
parser = wrapper.call
Parser.new do |input|
matched = ""
remaining = input
success = true
n.to_i.times do
result = parser.run(remaining)
if result.fail?
success = false
break
end
matched = matched + result.matched
remaining = result.remaining
end
if success
ParserResult.ok(matched: matched, remaining: remaining)
else
ParserResult.fail(input)
end
end
end
private
# Test against a simple regex, no groups. It would be possible to pass a callback
# to the regex, in order to work with groups. #MAYBE #TODO
def test(regex:, with:)
match = regex.match(with)
return ParserResult.fail(with) if match.nil?
matched = match[0]
ParserResult.ok(matched: matched, remaining: with[matched.length..-1])
end
end
| {
"content_hash": "1e88730950b7beb4349d7f87157c955d",
"timestamp": "",
"source": "github",
"line_count": 203,
"max_line_length": 92,
"avg_line_length": 22.458128078817733,
"alnum_prop": 0.5499012941434525,
"repo_name": "gosukiwi/parser-combinator",
"id": "1c103fba62b00cf95d6f8b0b38fa7eeb2476cfc0",
"size": "4559",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/base_parsers.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "23895"
}
],
"symlink_target": ""
} |
cd $(dirname "$(readlink -f "$0")")
echo "Activate `basename $0`"
OUT=$1
X=$2
Y=$3
cat << EOF > config
[settings]
throttle-ms = 50
throttle-limit = 5
[bar/top]
monitor = $OUT
width = 100%
height = 35
offset-y = 5
; prevent bar appearing above fullscreen windows
wm-restack = bspwm
override-redirect = true
background = #005f627a
foreground = #f2f2f2
overline-size = 2
overline-color = #bc92f8
underline-size = 2
underline-color = #bc92f8
spacing = 1
padding-right = 2
module-margin-left = 0
module-margin-right = 2
font-0 = "Noto Sans:weight=bold:size=12;0"
font-1 = "FontAwesome:size=12;3"
font-2 = " ypn envypn:size=22;1"
font-3 = "Misc Termsynu:size=13;1"
font-4 = "Unifont:size=10;-1"
modules-left = bspwm
;modules-center = xwindow
modules-right = volume wireless cpu memory battery clock
[module/bspwm]
type = internal/bspwm
format = <label-state> <label-mode>
label-active = %index%
label-active-padding = 2
label-active-margin = 1
label-active-font = 3
label-active-foreground = #fff
label-active-background = #2fbbf2
label-active-overline = #148ebe
label-active-underline = #148ebe
label-occupied = %index%
label-occupied-padding = 2
label-occupied-margin = 1
label-occupied-background = #eeeeee
label-occupied-foreground = #dd222222
label-occupied-overline = #c5c5c5
label-occupied-underline = #c5c5c5
label-occupied-font = 3
label-urgent = %index%
label-urgent-padding = 2
label-urgent-margin = 1
label-urgent-font = 3
label-empty = %index%
label-empty-padding = 2
label-empty-margin = 1
label-empty-font = 3
[module/battery]
type = internal/battery
;full-at = 99
battery = BAT0
adapter = AC0
format-charging = <label-charging>
format-charging-background = #ff9d52
format-charging-foreground = #190f08
format-charging-underline = #ff9d52
format-charging-overline = #ff9d52
format-charging-padding = 2
format-discharging = <label-discharging>
format-discharging-background = #de4b46
format-discharging-foreground = #efd1d1
format-discharging-underline = #e15d58
format-discharging-overline = #e15d58
format-discharging-padding = 2
format-full = <label-full>
format-full-background = #ecd620
format-full-foreground = #2f2a06
format-full-underline = #d4c01c
format-full-overline = #d4c01c
format-full-padding = 2
label-charging = battery %percentage%%
label-discharging = battery %percentage%%
label-full = fully charged
label-charging-font = 3
label-discharging-font = 3
label-full-font = 3
[module/cpu]
type = internal/cpu
interval = 0.5
format = <label> <ramp-coreload>
format-background = #66cc99
format-foreground = #2a5c45
format-underline = #60eaa5
format-overline = #60eaa5
format-padding = 2
label = cpu
label-font = 3
ramp-coreload-0 = ▁
ramp-coreload-0-font = 5
ramp-coreload-0-foreground = #000000
ramp-coreload-1 = ▂
ramp-coreload-1-font = 5
ramp-coreload-1-foreground = #000000
ramp-coreload-2 = ▃
ramp-coreload-2-font = 5
ramp-coreload-2-foreground = #000000
ramp-coreload-3 = ▄
ramp-coreload-3-font = 5
ramp-coreload-3-foreground = #000000
ramp-coreload-4 = ▅
ramp-coreload-4-font = 5
ramp-coreload-4-foreground = #ffffff
ramp-coreload-5 = ▆
ramp-coreload-5-font = 5
ramp-coreload-5-foreground = #ffffff
ramp-coreload-6 = ▇
ramp-coreload-6-font = 5
ramp-coreload-6-foreground = #ff3b51
ramp-coreload-7 = █
ramp-coreload-7-font = 5
ramp-coreload-7-foreground = #ff3b51
[module/memory]
type = internal/memory
format = <label> <bar-used>
format-padding = 2
format-background = #cb66cc
format-foreground = #ffe3ff
format-underline = #e58de6
format-overline = #e58de6
label = memory
label-font = 3
bar-used-width = 14
bar-used-indicator = |
bar-used-indicator-font = 4
bar-used-indicator-foreground = #ffaaf5
bar-used-fill = ─
bar-used-fill-font = 4
bar-used-fill-foreground = #ffaaf5
bar-used-empty = ─
bar-used-empty-font = 4
bar-used-empty-foreground = #934e94
[module/clock]
type = internal/date
date = %%{T3}%Y-%m-%d %H:%M%%{T-}
format-padding = 2
format-background = #ff4279
format-foreground = #ffcddc
format-underline = #ff63a5
format-overline = #ff63a5
[module/volume]
type = internal/volume
speaker-mixer = Speaker
headphone-mixer = Headphone
headphone-id = 9
format-volume-background = #6be5e5
format-volume-foreground = #0a1616
format-volume-underline = #88eaea
format-volume-overline = #88eaea
format-volume-padding = 2
format-muted-background = #0d1c1c
format-muted-foreground = #b8c0c0
format-muted-padding = 2
label-volume = volume %percentage%
label-volume-font = 3
label-muted = sound muted
label-muted-font = 3
[module/xwindow]
type = internal/xwindow
label-font = 3
[module/wireless]
type = internal/network
interface = wlp2s0
format-connected = <label-connected>
format-connected-background = #eaeaea
format-connected-foreground = #0c0c0c
format-connected-underline = #ececec
format-connected-overline = #ececec
format-connected-padding = 2
format-disconnected = <label-disconnected>
format-disconnected-background = #0c0c0c
format-disconnected-foreground = #eaeaea
format-disconnected-underline = #0e0e0e
format-disconnected-overline = #0e0e0e
format-disconnected-padding = 2
label-connected =
label-disconnected =
label-font = 2
; vim:ft=dosini
EOF
| {
"content_hash": "487f8591612c567be07d2a48efeb4f31",
"timestamp": "",
"source": "github",
"line_count": 232,
"max_line_length": 56,
"avg_line_length": 22.137931034482758,
"alnum_prop": 0.7464953271028038,
"repo_name": "platipo/dotfiles",
"id": "4f323a5c76ad1bea98fc9286edd0a8b25bf25838",
"size": "5174",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "config/polybar/polybar_parametric.sh",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "Shell",
"bytes": "11204"
},
{
"name": "Vim script",
"bytes": "1650"
}
],
"symlink_target": ""
} |
package org.sejda.io;
import org.sejda.commons.util.IOUtils;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
import static java.util.Objects.requireNonNull;
/**
* This class consists of solely static methods to create the most appropriate {@link SeekableSource} based on the given input or to bridge {@link SeekableSource}s to the more
* traditional {@link InputStream} or other standard I/O classes.
*
* @author Andrea Vacondio
*
*/
public final class SeekableSources {
/**
* Threshold size in bytes where the SeekableSources method will switch to {@link MemoryMappedSeekableSource#MemoryMappedSeekableSource(File)}
*/
public static final String MAPPED_SIZE_THRESHOLD_PROPERTY = "org.sejda.io.mapped.size.threshold";
/**
* Threshold size in bytes where the SeekableSources method will switch to {@link MemoryMappedSeekableSource#MemoryMappedSeekableSource(File)}
*/
public static final String DISABLE_MEMORY_MAPPED_PROPERTY = "org.sejda.io.mapped.disabled";
/**
* Buffer size for {@link BufferedSeekableSource}
*/
public static final String INPUT_BUFFER_SIZE_PROPERTY = "org.sejda.io.buffered.input.size";
/**
* Size of the pages used by {@link MemoryMappedSeekableSource}
*/
public static final String MEMORY_MAPPED_PAGE_SIZE_PROPERTY = "org.sejda.io.memory.mapped.page.size";
private static final long MB_16 = 1 << 24;
private SeekableSources() {
// utility
}
/**
* Factory method to create a {@link SeekableSource} from a {@link File}. An attempt is made to return the best {@link SeekableSource} implementation based on the size of the
* file and bitness of the JVM.
*
* @param file
* @return a {@link SeekableSource} from the given file.
* @throws IOException
*/
public static SeekableSource seekableSourceFrom(File file) throws IOException {
requireNonNull(file);
return seekableSourceFrom(file.toPath());
}
/**
* Factory method to create a {@link SeekableSource} from a {@link Path}. An attempt is made to return the best {@link SeekableSource} implementation based on the size of the
* file and bitness of the JVM.
*
* @param path
* @return a {@link SeekableSource} from the given file.
* @throws IOException
*/
public static SeekableSource seekableSourceFrom(Path path) throws IOException {
requireNonNull(path);
if (!"32".equals(System.getProperty("sun.arch.data.model")) && !Boolean.getBoolean(
DISABLE_MEMORY_MAPPED_PROPERTY) && Files.size(path) > Long.getLong(MAPPED_SIZE_THRESHOLD_PROPERTY,
MB_16)) {
return new BufferedSeekableSource(new MemoryMappedSeekableSource(path));
}
return new BufferedSeekableSource(new FileChannelSeekableSource(path));
}
/**
* Factory method to create a {@link SeekableSource} from a {@link InputStream}. The whole stream is read and stored in a byte array with a max size of 2GB.
*
* @param stream
* @return a {@link SeekableSource} from the given stream.
* @throws IOException
*/
public static SeekableSource inMemorySeekableSourceFrom(InputStream stream) throws IOException {
requireNonNull(stream);
return new ByteArraySeekableSource(IOUtils.toByteArray(stream));
}
/**
* Factory method to create a {@link SeekableSource} from a byte array.
*
* @param bytes
* @return a {@link SeekableSource} wrapping the given byte array.
*/
public static SeekableSource inMemorySeekableSourceFrom(byte[] bytes) {
requireNonNull(bytes);
return new ByteArraySeekableSource(bytes);
}
/**
* Factory method to create a {@link SeekableSource} from a {@link InputStream}. The whole stream is copied to a temporary file.
*
* @param stream
* @return a {@link SeekableSource} from the given stream.
* @throws IOException
*/
public static SeekableSource onTempFileSeekableSourceFrom(InputStream stream) throws IOException {
return onTempFileSeekableSourceFrom(stream, "SejdaIO");
}
/**
* Factory method to create a {@link SeekableSource} from a {@link InputStream}. The whole stream is copied to a temporary file.
*
* @param stream
* @param filenameHint name to use for the temp file that will be created
* @return a {@link SeekableSource} from the given stream.
* @throws IOException
*/
public static SeekableSource onTempFileSeekableSourceFrom(InputStream stream, String filenameHint) throws IOException {
requireNonNull(stream);
Path temp = Files.createTempDirectory("SejdaIODir").resolve(filenameHint);
if (Files.exists(temp)) {
throw new RuntimeException("Temp file collision: " + temp.toAbsolutePath());
}
Files.copy(stream, temp, StandardCopyOption.REPLACE_EXISTING);
return new BufferedSeekableSource(new FileChannelSeekableSource(temp) {
@Override
public void close() throws IOException {
super.close();
Files.deleteIfExists(temp);
}
});
}
/**
* Factory method to create an {@link OffsettableSeekableSource} from a {@link SeekableSource}
* @param source
* @return
*/
public static OffsettableSeekableSource asOffsettable(SeekableSource source) {
requireNonNull(source);
return new OffsettableSeekableSourceImpl(source);
}
}
| {
"content_hash": "c07a771279121a0c903b63e9a607e433",
"timestamp": "",
"source": "github",
"line_count": 146,
"max_line_length": 178,
"avg_line_length": 38.85616438356164,
"alnum_prop": 0.6837652035959809,
"repo_name": "torakiki/sejda-io",
"id": "eab327c133623fe30f04d2638f0ec66a7d3bec17",
"size": "6291",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/org/sejda/io/SeekableSources.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "118050"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8"?>
<browserconfig>
<msapplication>
<tile>
<square70x70logo src="/images/favicons/mstile-70x70.png"/>
<square150x150logo src="/images/favicons/mstile-150x150.png"/>
<square310x310logo src="/images/favicons/mstile-310x310.png"/>
<wide310x150logo src="/images/favicons/mstile-310x150.png"/>
<TileColor>#ebebeb</TileColor>
</tile>
</msapplication>
</browserconfig>
| {
"content_hash": "80dec429794260a619393679d4cc59ab",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 68,
"avg_line_length": 36.583333333333336,
"alnum_prop": 0.6879271070615034,
"repo_name": "feryardiant/admin-theme",
"id": "7467edf7b0830c970a9a5242148dc940f59c418e",
"size": "439",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/assets/browserconfig.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "6107"
},
{
"name": "JavaScript",
"bytes": "28141"
}
],
"symlink_target": ""
} |
// Copyright 2010-2012 RethinkDB, all rights reserved.
#ifndef CONTAINERS_ARCHIVE_SOCKET_STREAM_HPP_
#define CONTAINERS_ARCHIVE_SOCKET_STREAM_HPP_
#ifdef _WIN32
#include "concurrency/signal.hpp"
#include "containers/archive/archive.hpp"
#include "containers/scoped.hpp"
#include "arch/io/event_watcher.hpp"
#include "arch/runtime/runtime.hpp"
class blocking_fd_watcher_t { };
class socket_stream_t :
public read_stream_t,
public write_stream_t {
public:
socket_stream_t(fd_t fd_, scoped_ptr_t<blocking_fd_watcher_t>)
: fd(fd_),
interruptor(nullptr),
event_watcher(nullptr) { }
socket_stream_t(fd_t fd_, windows_event_watcher_t *ew)
: fd(fd_),
event_watcher(ew),
interruptor(nullptr) {
rassert(ew != nullptr);
rassert(ew->current_thread() == get_thread_id());
}
socket_stream_t(const socket_stream_t &) = default;
int64_t read(void *buf, int64_t count);
int64_t write(const void *buf, int64_t count);
void wait_for_pipe_client(signal_t *interruptor);
void set_interruptor(signal_t *_interruptor) { interruptor = _interruptor; }
private:
fd_t fd;
signal_t *interruptor;
windows_event_watcher_t *event_watcher;
};
#else
#include "concurrency/signal.hpp"
#include "containers/archive/archive.hpp"
#include "arch/io/event_watcher.hpp"
#include "arch/io/io_utils.hpp"
#include "concurrency/cond_var.hpp"
#include "containers/scoped.hpp"
#include "errors.hpp"
/* fd_watcher_t exists to factor the problem of "how to wait for I/O on an fd"
* out of fd_stream_t. The best answer, if available, is to use a
* linux_event_watcher_t to do nonblocking I/O. However, we may want to use
* classes descended from fd_stream_t in contexts where the infrastructure
* needed for linux_event_watcher_t is not in place (eg. external JS processes).
*/
class fd_watcher_t : public home_thread_mixin_debug_only_t {
public:
fd_watcher_t() {}
virtual ~fd_watcher_t() {}
virtual void init_callback(linux_event_callback_t *cb) = 0;
virtual bool is_read_open() = 0;
virtual bool is_write_open() = 0;
virtual void on_shutdown_read() = 0;
virtual void on_shutdown_write() = 0;
// wait_for_{read,write} wait for either an opportunity to read/write, or
// for us to shutdown for reading/writing, or for `interruptor` (if
// non-NULL) to be pulsed, whichever happens first. It returns true if we
// can read/write and false if we have shut down (in which case
// on_shutdown_{read,write} has already been called).
//
// They raise interrupted_exc_t if `interruptor` is pulsed.
virtual MUST_USE bool wait_for_read(signal_t *interruptor) = 0;
virtual MUST_USE bool wait_for_write(signal_t *interruptor) = 0;
private:
DISABLE_COPYING(fd_watcher_t);
};
/* blocking_fd_watcher_t is the simplest fd_watcher_t: it doesn't wait for IO.
*/
class blocking_fd_watcher_t : public fd_watcher_t {
public:
blocking_fd_watcher_t();
virtual bool is_read_open();
virtual bool is_write_open();
virtual void on_shutdown_read();
virtual void on_shutdown_write();
virtual MUST_USE bool wait_for_read(signal_t *interruptor);
virtual MUST_USE bool wait_for_write(signal_t *interruptor);
virtual void init_callback(linux_event_callback_t *cb);
private:
bool read_open_, write_open_;
};
/* linux_event_fd_watcher_t uses a linux_event_watcher to wait for IO, and makes
* its corresponding fd use non-blocking I/O.
*/
class linux_event_fd_watcher_t :
public fd_watcher_t, private linux_event_callback_t {
public:
// does not take ownership of fd
explicit linux_event_fd_watcher_t(fd_t fd);
virtual ~linux_event_fd_watcher_t();
virtual void init_callback(linux_event_callback_t *cb);
virtual void on_event(int events);
virtual bool is_read_open();
virtual bool is_write_open();
virtual void on_shutdown_read();
virtual void on_shutdown_write();
virtual MUST_USE bool wait_for_read(signal_t *interruptor);
virtual MUST_USE bool wait_for_write(signal_t *interruptor);
private:
// True iff there is a waiting read/write operation. Used to ensure that we
// are used in a single-threaded fashion.
bool io_in_progress_;
/* These are pulsed if and only if the read/write end of the connection has
* been closed. */
cond_t read_closed_, write_closed_;
// We forward to this callback on error events.
linux_event_callback_t *event_callback_;
// The linux_event_watcher that we use to wait for IO events.
linux_event_watcher_t event_watcher_;
DISABLE_COPYING(linux_event_fd_watcher_t);
};
class socket_stream_t :
public read_stream_t,
public write_stream_t,
private linux_event_callback_t {
public:
explicit socket_stream_t(fd_t fd);
explicit socket_stream_t(fd_t fd, scoped_ptr_t<fd_watcher_t> &&watcher);
virtual ~socket_stream_t();
// interruptible {read,write}_stream_t functions
virtual MUST_USE int64_t read(void *p, int64_t n);
virtual int64_t write(const void *p, int64_t n);
void set_interruptor(signal_t *_interruptor) { interruptor = _interruptor; }
void assert_thread() { fd_watcher_->assert_thread(); }
bool is_read_open() { return fd_watcher_->is_read_open(); }
bool is_write_open() { return fd_watcher_->is_write_open(); }
private:
void shutdown_read();
void shutdown_write();
// Returns false if we are closed for {read,write}.
// Raises interrupted_exc_t if we are open but interruptor is pulsed.
// Returns true otherwise.
bool check_can_read();
bool check_can_write();
// Wrappers for fd_watcher_->wait_for_{read,write} that shut us down if
// interrupted.
bool wait_for_read();
bool wait_for_write();
// Member fields
// For subclasses to override on_event behavior. Is evaluated as the first
// thing done in on_event.
virtual void do_on_event(int events);
fd_t fd_;
scoped_ptr_t<fd_watcher_t> fd_watcher_;
signal_t *interruptor;
void on_event(int events); // for linux_callback_t
DISABLE_COPYING(socket_stream_t);
};
#endif // _WIN32
#endif // CONTAINERS_ARCHIVE_SOCKET_STREAM_HPP_
| {
"content_hash": "009f001ff2fc69d82cc0ec6127551707",
"timestamp": "",
"source": "github",
"line_count": 196,
"max_line_length": 80,
"avg_line_length": 31.816326530612244,
"alnum_prop": 0.6792815907633099,
"repo_name": "jmptrader/rethinkdb",
"id": "7bcf664c8ec443b1e21d5f8616ec0619682da6e0",
"size": "6236",
"binary": false,
"copies": "11",
"ref": "refs/heads/next",
"path": "src/containers/archive/socket_stream.hpp",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "AppleScript",
"bytes": "2597"
},
{
"name": "C",
"bytes": "79789"
},
{
"name": "C++",
"bytes": "7922818"
},
{
"name": "CSS",
"bytes": "405110"
},
{
"name": "CoffeeScript",
"bytes": "521940"
},
{
"name": "Groff",
"bytes": "572"
},
{
"name": "HTML",
"bytes": "30213"
},
{
"name": "Handlebars",
"bytes": "48097"
},
{
"name": "Haskell",
"bytes": "13234"
},
{
"name": "JavaScript",
"bytes": "717032"
},
{
"name": "Makefile",
"bytes": "62228"
},
{
"name": "Nginx",
"bytes": "728"
},
{
"name": "Perl",
"bytes": "6034"
},
{
"name": "Protocol Buffer",
"bytes": "41595"
},
{
"name": "Python",
"bytes": "4161532"
},
{
"name": "Ruby",
"bytes": "125217"
},
{
"name": "Shell",
"bytes": "50006"
}
],
"symlink_target": ""
} |
[](https://travis-ci.org/biemond/biemond-orawls) [](https://coveralls.io/r/biemond/biemond-orawls?branch=master)
created by Edwin Biemond email biemond at gmail dot com
[biemond.blogspot.com](http://biemond.blogspot.com)
[Github homepage](https://github.com/biemond/biemond-orawls)
Got the same options as the WLS puppet module but with
- types & providers instead of wlstexec scripts ( detect changes )
- more FMW product installations
- support for FMW clusters ( SOA Suite,OSB & ADF )
- optimized for Hiera
- totally refactored
- only for Linux and Solaris
If you need support, checkout the [wls_install](https://www.enterprisemodules.com/shop/products/puppet-wls_install-module) and [wls_config](https://www.enterprisemodules.com/shop/products/puppet-wls_config-module) modules from [Enterprise Modules](https://www.enterprisemodules.com/)
[](https://www.enterprisemodules.com)
This module should work for all Linux & Solaris versions like RedHat, CentOS, Ubuntu, Debian, Suse SLES, OracleLinux, Solaris 10,11 sparc / x86
Dependency with
- hajee/easy_type >=0.10.0
- adrien/filemapper >= 1.1.1
- reidmv/yamlfile >=0.2.0
- fiddyspence/sleep => 1.1.2
- puppetlabs/stdlib => 4.9.0
## Complete examples
- Docker with WebLogic 12.1.3 Cluster [docker-weblogic-puppet](https://github.com/biemond/docker-weblogic-puppet)
- WebLogic 12.2.1 / Puppet 4.2.2 Reference implementation, the vagrant test case for full working WebLogic 12.2.1 cluster example [biemond-orawls-vagrant-12.2.1](https://github.com/biemond/biemond-orawls-vagrant-12.2.1)
- WebLogic 12.2.1 infra (JRF + JRF restricted), the vagrant test case for full working WebLogic 12.2.1 infra cluster example with WebTier (Oracle HTTP Server) [biemond-orawls-vagrant-12.2.1-infra](https://github.com/biemond/biemond-orawls-vagrant-12.2.1-infra)
- WebLogic 12.2.1 infra (JRF + JRF restricted), the vagrant test case for full working WebLogic 12.2.1 infra SOA Suite/BAM/OSB cluster example [biemond-orawls-vagrant-12.2.1-infra-soa](https://github.com/biemond/biemond-orawls-vagrant-12.2.1-infra-soa)
- WebLogic 12.1.3 / Puppet 4.2.1 Reference implementation, the vagrant test case for full working WebLogic 12.1.3 cluster example [biemond-orawls-vagrant-12.1.3](https://github.com/biemond/biemond-orawls-vagrant-12.1.3)
- WebLogic 12.1.3 infra (JRF), the vagrant test case for full working WebLogic 12.1.3 infra cluster example with WebTier (Oracle HTTP Server) [biemond-orawls-vagrant-12.1.3-infra](https://github.com/biemond/biemond-orawls-vagrant-12.1.3-infra)
- WebLogic 12.1.3 infra with OSB, the vagrant test case for full working WebLogic 12.1.3 infra OSB cluster example [biemond-orawls-vagrant-12.1.3-infra-osb](https://github.com/biemond/biemond-orawls-vagrant-12.1.3-infra-osb)
- WebLogic 12.1.3 infra with OSB & SOA,ESS,BAM, the vagrant test case for full working WebLogic 12.1.3 infra OSB SOA Cluster example [biemond-orawls-vagrant-12.1.3-infra-soa](https://github.com/biemond/biemond-orawls-vagrant-12.1.3-infra-soa)
- WebLogic 12.1.2 Reference implementation, the vagrant test case for full working WebLogic 12.1.2 cluster example [biemond-orawls-vagrant-12.1.2](https://github.com/biemond/biemond-orawls-vagrant-12.1.2)
- WebLogic 12.1.2 infra (JRF) with WebTier, the vagrant test case for full working WebLogic 12.1.2 infra cluster example with WebTier (Oracle HTTP Server) [biemond-orawls-vagrant-12.1.2-infra](https://github.com/biemond/biemond-orawls-vagrant-12.1.2-infra)
- Reference Solaris implementation, the vagrant test case for full working WebLogic 12.1.3 cluster example [biemond-orawls-vagrant-solaris](https://github.com/biemond/biemond-orawls-vagrant-solaris)
- Reference OIM / OAM with WebTier, Webgate & Oracle Unified Directory, the vagrant test case for Oracle Identity Manager & Oracle Access Manager 11.1.2.2 example [biemond-orawls-vagrant-oim_oam](https://github.com/biemond/biemond-orawls-vagrant-oim_oam)
- WebLogic 11g Reference implementation, the vagrant test case for full working WebLogic 10.3.6 cluster example [biemond-orawls-vagrant](https://github.com/biemond/biemond-orawls-vagrant)
- Reference Oracle SOA Suite, the vagrant test case for full working WebLogic 10.3.6 SOA Suite + OSB cluster example [biemond-orawls-vagrant-solaris-soa](https://github.com/biemond/biemond-orawls-vagrant-solaris-soa)
- Example of Opensource Puppet 3.4.3 Puppet master configuration in a vagrant box [vagrant-puppetmaster](https://github.com/biemond/vagrant-puppetmaster)
- Oracle Forms, Reports 11.1.1.7 & 11.1.2 Reference implementation, the vagrant test case [biemond-orawls-vagrant-11g-forms](https://github.com/biemond/biemond-orawls-vagrant-11g-forms)
## Orawls WebLogic Features
- [Installs WebLogic](#weblogic), version 10g,11g,12c( 12.1.1, 12.1.2, 12.1.3, 12.2.1 + its FMW infrastructure editions )
- [Apply a BSU patch](#bsu) on a Middleware home ( < 12.1.2 )
- [Apply a OPatch](#opatch) on a Middleware home ( >= 12.1.2 ) or a Oracle product home
- [Create a WebLogic domain](#domain)
- [Pack a WebLogic domain](#packdomain)
- [Copy a WebLogic domain](#copydomain) to a other node with SSH, unpack and enroll to a nodemanager
- [JSSE](#jsse) Java Secure Socket Extension support
- [Custom Identity and Trust Store support](#identity)
- [Linux low on entropy or urandom fix](#urandom)
- [Startup a nodemanager](#nodemanager)
- [start or stop AdminServer, Managed or a Cluster](#control)
- [StoreUserConfig](#storeuserconfig) for storing WebLogic Credentials and using in WLST
- [Dynamic targetting](#Dynamictargetting) by using the notes field in WebLogic for resource targetting
### Fusion Middleware Features 11g & 12c
- installs [FMW](#fmw) software(add-on) to a middleware home, like OSB,SOA Suite, Oracle Identity & Access Management, Oracle Unified Directory, WebCenter Portal + Content
- [WebTier](#webtier) Oracle HTTP server
- [OSB, SOA Suite](#fmwcluster) with BPM and BAM Cluster configuration support ( convert single osb/soa/bam servers to clusters and migrate 11g OPSS to the database )
- [ADF/JRF support](#fmwclusterjrf), Assign JRF libraries to a Server or Cluster target
- [OIM IDM](#oimconfig) / OAM configurations with Oracle OHS OAM WebGate, Also Cluster support for OIM OAM
- [OUD](#instance) OUD Oracle Unified Directory install, WebLogic domain, instances creation & [OUD control](#oud_control)
- [Forms/Reports](#forms) Oracle Forms & Reports 11.1.1.7, 11.1.2 or 12.2.1
- [WC, WCC](#Webcenter) Webcenter portal, content 11g or 12.2.1
- [Change FMW log](#fmwlogdir) location of a managed server
- [Resource Adapter](#resourceadapter) plan and entries for AQ, DB and JMS
## Wls types and providers
- [wls_setting](#wls_setting), set the default wls parameters for the other types and also used by puppet resource
- [wls_adminserver](#wls_adminserver) control the adminserver or subscribe to changes
- [wls_managedserver](#wls_managedserver) control the managed server,cluster or subscribe to changes
- [wls_domain](#wls_domain)
- [wls_deployment](#wls_deployment)
- [wls_domain](#wls_domain)
- [wls_user](#wls_user)
- [wls_authentication_provider](#wls_authentication_provider)
- [wls_identity_asserter](#wls_identity_asserter)
- [wls_machine](#wls_machine)
- [wls_server](#wls_server)
- [wls_server_channel](#wls_server_channel)
- [wls_server_tlog](#wls_server_tlog)
- [wls_cluster](#wls_cluster)
- [wls_migratable_target](#wls_migratable_target)
- [wls_singleton_service](#wls_singleton_service)
- [wls_coherence_cluster](#wls_coherence_cluster)
- [wls_coherence_server](#wls_coherence_server)
- [wls_server_template](#wls_server_template)
- [wls_dynamic_cluster](#wls_dynamic_cluster)
- [wls_virtual_host](#wls_virtual_host)
- [wls_workmanager_constraint](#wls_workmanager_constraint)
- [wls_workmanager](#wls_workmanager)
- [wls_datasource](#wls_datasource)
- [wls_file_persistence_store](#wls_file_persistence_store)
- [wls_jdbc_persistence_store](#wls_jdbc_persistence_store)
- [wls_foreign_jndi_provider
](#wls_foreign_jndi_provider
)
- [wls_foreign_jndi_provider
_link](#wls_foreign_jndi_provider
_link)
- [wls_jmsserver](#wls_jmsserver)
- [wls_safagent](#wls_safagent)
- [wls_jms_module](#wls_jms_module)
- [wls_jms_quota](#wls_jms_quota)
- [wls_jms_sort_destination_key](#wls_jms_sort_destination_key)
- [wls_jms_subdeployment](#wls_jms_subdeployment)
- [wls_jms_queue](#wls_jms_queue)
- [wls_jms_topic](#wls_jms_topic)
- [wls_jms_connection_factory](#wls_jms_connection_factory)
- [wls_jms_template](#wls_jms_template)
- [wls_saf_remote_context](#wls_saf_remote_context)
- [wls_saf_error_handler](#wls_saf_error_handler)
- [wls_saf_imported_destination](#wls_saf_imported_destination)
- [wls_saf_imported_destination_object](#wls_saf_imported_destination_object)
- [wls_foreign_server](#wls_foreign_server)
- [wls_foreign_server_object](#wls_foreign_server_object)
- [wls_mail_session](#wls_mail_session)
- [wls_multi_datasource](#wls_multi_datasource)
- [wls_jms_bridge_destination](#wls_jms_bridge_destination)
- [wls_messaging_bridge](#wls_messaging_bridge)
## Domain creation options (Dev or Prod mode)
all templates creates a WebLogic domain, logs the domain creation output
- domain 'standard' -> a default WebLogic
- domain 'adf' -> JRF + EM + Coherence (12.1.2, 12.1.3, 12.2.1) + OWSM (12.1.2, 12.1.3, 12.2.1) + JAX-WS Advanced + Soap over JMS (12.1.2, 12.1.3, 12.2.1)
- domain 'adf_restricted' -> only for 12.2.1 (no RCU/DB) JRF + EM + Coherence + JAX-WS Advanced + Soap over JMS
- domain 'osb' -> OSB + JRF + EM + OWSM + ESS ( optional with 12.1.3 )
- domain 'osb_soa' -> OSB + SOA Suite + BAM + JRF + EM + OWSM + ESS ( optional with 12.1.3 )
- domain 'osb_soa_bpm' -> OSB + SOA Suite + BAM + BPM + JRF + EM + OWSM + ESS ( optional with 12.1.3 )
- domain 'soa' -> SOA Suite + BAM + JRF + EM + OWSM + ESS ( optional with 12.1.3 )
- domain 'soa_bpm' -> SOA Suite + BAM + BPM + JRF + EM + OWSM + ESS ( optional with 12.1.3 )
- domain 'bam' -> BAM ( only with soa suite installation)
- domain 'wc_wcc_bpm' -> WC (webcenter) + WCC ( Content ) + BPM + JRF + EM + OWSM
- domain 'wc' -> WC (webcenter) + JRF + EM + OWSM
- domain 'oim' -> OIM (Oracle Identity Manager) + OAM ( Oracle Access Manager)
- domain 'oud' -> OUD (Oracle Unified Directory)
## Puppet master with orawls module key points
it should work on every PE or opensource puppet master, customers and I successfully tested orawls on PE 3.0, 3.1, 3.2, 3.3. See also the puppet master vagrant box
But when it fails you can do the following actions.
- Check the time difference/timezone between all the puppet master and agent machines.
- Update orawls and its dependencies on the puppet master.
- After adding or refreshing the easy_type or orawls modules you need to restart all the PE services on the puppet master (this will flush the PE cache) and always do a puppet agent run on the Puppet master
- To solve this error "no such file to load -- easy_type" you need just to do a puppet run on the puppet master when it is still failing you can move the easy_type module to its primary module location ( /etc/puppetlabs/puppet/module )
- Move orawls and easy_type to the primary module location [pup-1515](https://tickets.puppetlabs.com/browse/PUP-1515) when the Puppet master loads a Type, it searches the environment that the agent requested. When it loads providers for that type, it searches the default environment instead of the one the agent requested.
## Orawls WebLogic Facter
Contains WebLogic Facter which displays the following
- Middleware homes
- Oracle Software
- BSU & OPatch patches
- Domain configuration ( everything of a WebLogic Domain like deployments, datasource, JMS, SAF)
## Override the default Oracle operating system user
default this orawls module uses oracle as weblogic install user
you can override this by setting the following fact 'override_weblogic_user', like override_weblogic_user=wls or set FACTER_override_weblogic_user=wls
## Override the default WebLogic domain folder
Set the following hiera parameters for weblogic.pp
wls_domains_dir: '/opt/oracle/wlsdomains/domains'
wls_apps_dir: '/opt/oracle/wlsdomains/applications'
Set the following wls_domains_dir & wls_apps_dir parameters in
- weblogic.pp
- domain.pp
- control.pp
- packdomain.pp
- copydomain.pp
- fmwcluster.pp
- fmwclusterjrf.pp
or hiera parameters of weblogic.pp
orawls::weblogic::wls_domains_dir: *wls_domains_dir
orawls::weblogic::wls_apps_dir: *wls_apps_dir
## <a name="jsse">Java Secure Socket Extension support</a>
Requires the JDK 7 or 8 JCE extension
jdk7::install7{ 'jdk-8u45-linux-x64':
version => "8u45" ,
full_version => "jdk1.8.0_45",
alternatives_priority => 18000,
x64 => true,
download_dir => "/var/tmp/install",
urandom_java_fix => true,
rsa_key_size_fix => true,
cryptography_extension_file => "jce_policy-8.zip",
source_path => "/software",
}
jdk7::install7{ 'jdk1.7.0_51':
version => "7u51" ,
full_version => "jdk1.7.0_51",
alternatives_priority => 18000,
x64 => true,
download_dir => "/data/install",
urandom_java_fix => true,
rsa_key_size_fix => true, <!--
cryptography_extension_file => "UnlimitedJCEPolicyJDK7.zip", <!---
source_path => "/software",
}
To enable this in orawls you can set the jsse_enabled on the following manifests
- nodemanager.pp
- domain.pp
- control.pp
or set the following hiera parameter
wls_jsse_enabled: true
## <a name="identity">Enterprise security with Custom Identity and Trust store</a>
in combination with JDK7 JCE policy, ORAUTILS and WebLogic JSSE you can use your own certificates
just generates all the certificates and set the following hiera variables.
# custom trust
orautils::customTrust: true
orautils::trustKeystoreFile: '/vagrant/truststore.jks'
orautils::trustKeystorePassphrase: 'welcome'
# used by nodemanager, control and domain creation
wls_custom_trust: &wls_custom_trust true
wls_trust_keystore_file: &wls_trust_keystore_file '/vagrant/truststore.jks'
wls_trust_keystore_passphrase: &wls_trust_keystore_passphrase 'welcome'
wls_setting_instances:
'default':
user: oracle
weblogic_home_dir: '/opt/oracle/middleware11g/wlserver_10.3'
connect_url: 't3s://10.10.10.10:7002'
weblogic_user: 'weblogic'
weblogic_password: 'Welcome01'
custom_trust: *wls_custom_trust
trust_keystore_file: *wls_trust_keystore_file
trust_keystore_passphrase: *wls_trust_keystore_passphrase
# create a standard domain with custom identity for the adminserver
domain_instances:
'Wls1036':
domain_template: "standard"
development_mode: false
log_output: *logoutput
custom_identity: true
custom_identity_keystore_filename: '/vagrant/identity_admin.jks'
custom_identity_keystore_passphrase: 'welcome'
custom_identity_alias: 'admin'
custom_identity_privatekey_passphrase: 'welcome'
nodemanager_instances:
'nodemanager':
log_output: *logoutput
custom_identity: true
custom_identity_keystore_filename: '/vagrant/identity_admin.jks'
custom_identity_keystore_passphrase: 'welcome'
custom_identity_alias: 'admin'
custom_identity_privatekey_passphrase: 'welcome'
nodemanager_address: *domain_adminserver_address
server_instances:
'wlsServer1':
ensure: 'present'
arguments: '-XX:PermSize=256m -XX:MaxPermSize=256m -Xms752m -Xmx752m -Dweblogic.Stdout=/var/log/weblogic/wlsServer1.out -Dweblogic.Stderr=/var/log/weblogic/wlsServer1_err.out'
listenaddress: '10.10.10.100'
listenport: '8001'
logfilename: '/var/log/weblogic/wlsServer1.log'
machine: 'Node1'
sslenabled: '1'
ssllistenport: '8201'
sslhostnameverificationignored: '1'
jsseenabled: '1'
custom_identity: '1'
custom_identity_keystore_filename: '/vagrant/identity_node1.jks'
custom_identity_keystore_passphrase: 'welcome'
custom_identity_alias: 'node1'
custom_identity_privatekey_passphrase: 'welcome'
trust_keystore_file: *wls_trust_keystore_file
trust_keystore_passphrase: *wls_trust_keystore_passphrase
## <a name="urandom">Linux low on entropy or urandom fix</a>
can cause certain operations to be very slow. Encryption operations need entropy to ensure randomness. Entropy is generated by the OS when you use the keyboard, the mouse or the disk.
If an encryption operation is missing entropy it will wait until enough is generated.
three options
- use rngd service (include __orawls::urandomfix__ class)
- set java.security in JDK ( jre/lib/security in my jdk7 module )
- set -Djava.security.egd=file:/dev/./urandom param
## Oracle binaries files and alternate download location
Some manifests like orawls:weblogic bsu opatch fmw supports an alternative mountpoint for the big oracle setup/install files.
When not provided it uses the files folder located in the orawls puppet module
else you can use $source =>
- "/mnt"
- "/vagrant"
- "puppet:///modules/orawls/" (default)
- "puppet:///middleware/"
when the files are also accesiable locally then you can also set $remote_file => false this will not move the files to the download folder, just extract or install
## WebLogic requirements
Operating System settings like User, Group, ULimits and kernel parameters requirements
install the following module to set the kernel parameters
puppet module install fiddyspence-sysctl
install the following module to set the user limits parameters
puppet module install erwbgy-limits
sysctl { 'kernel.msgmnb': ensure => 'present', permanent => 'yes', value => '65536',}
sysctl { 'kernel.msgmax': ensure => 'present', permanent => 'yes', value => '65536',}
sysctl { 'kernel.shmmax': ensure => 'present', permanent => 'yes', value => '2147483648',}
sysctl { 'kernel.shmall': ensure => 'present', permanent => 'yes', value => '2097152',}
sysctl { 'fs.file-max': ensure => 'present', permanent => 'yes', value => '344030',}
sysctl { 'net.ipv4.tcp_keepalive_time': ensure => 'present', permanent => 'yes', value => '1800',}
sysctl { 'net.ipv4.tcp_keepalive_intvl': ensure => 'present', permanent => 'yes', value => '30',}
sysctl { 'net.ipv4.tcp_keepalive_probes': ensure => 'present', permanent => 'yes', value => '5',}
sysctl { 'net.ipv4.tcp_fin_timeout': ensure => 'present', permanent => 'yes', value => '30',}
class { 'limits':
config => {'*' => { 'nofile' => { soft => '2048' , hard => '8192', },},
'oracle' => { 'nofile' => { soft => '65535' , hard => '65535', },
'nproc' => { soft => '2048' , hard => '2048', },
'memlock' => { soft => '1048576', hard => '1048576',},},},
use_hiera => false,}
create a WebLogic user and group
group { 'dba' :
ensure => present,
}
# http://raftaman.net/?p=1311 for generating password
user { 'oracle' :
ensure => present,
groups => 'dba',
shell => '/bin/bash',
password => '$1$DSJ51vh6$4XzzwyIOk6Bi/54kglGk3.',
home => "/home/oracle",
comment => 'Oracle user created by Puppet',
managehome => true,
require => Group['dba'],
}
## Necessary Hiera setup for global vars and Facter
if you don't want to provide the same parameters in all the defines and classes
hiera.yaml main configuration
---
:backends: yaml
:yaml:
:datadir: /vagrant/puppet/hieradata
:hierarchy:
- "%{::fqdn}"
- common
vagrantcentos64.example.com.yaml
---
common.yaml
---
# global WebLogic vars
wls_oracle_base_home_dir: &wls_oracle_base_home_dir "/opt/oracle"
wls_weblogic_user: &wls_weblogic_user "weblogic"
# 12.1.2 settings
#wls_weblogic_home_dir: &wls_weblogic_home_dir "/opt/oracle/middleware12c/wlserver"
#wls_middleware_home_dir: &wls_middleware_home_dir "/opt/oracle/middleware12c"
#wls_version: &wls_version 1212
# 10.3.6 settings
wls_weblogic_home_dir: &wls_weblogic_home_dir "/opt/oracle/middleware11g/wlserver_10.3"
wls_middleware_home_dir: &wls_middleware_home_dir "/opt/oracle/middleware11g"
wls_version: &wls_version 1036
# global OS vars
wls_os_user: &wls_os_user "oracle"
wls_os_group: &wls_os_group "dba"
wls_download_dir: &wls_download_dir "/data/install"
wls_source: &wls_source "/vagrant"
wls_jdk_home_dir: &wls_jdk_home_dir "/usr/java/jdk1.7.0_45"
wls_log_dir: &wls_log_dir "/data/logs"
#WebLogic installation variables
orawls::weblogic::version: *wls_version
orawls::weblogic::filename: "wls1036_generic.jar"
# weblogic 12.1.2
#orawls::weblogic::filename: "wls_121200.jar"
# or with 12.1.2 FMW infra
#orawls::weblogic::filename: "fmw_infra_121200.jar"
#orawls::weblogic::fmw_infra: true
orawls::weblogic::middleware_home_dir: *wls_middleware_home_dir
orawls::weblogic::log_output: false
# hiera default anchors
orawls::weblogic::jdk_home_dir: *wls_jdk_home_dir
orawls::weblogic::oracle_base_home_dir: *wls_oracle_base_home_dir
orawls::weblogic::os_user: *wls_os_user
orawls::weblogic::os_group: *wls_os_group
orawls::weblogic::download_dir: *wls_download_dir
orawls::weblogic::source: *wls_source
## WebLogic Module Usage
### weblogic
__orawls::weblogic__ installs WebLogic 10.3.[0-6], 12.1.1, 12.1.2, 12.1.3, 12.2.1
class{'orawls::weblogic':
version => 1221, # 1036|1211|1212|1213|1221
filename => 'fmw_12.2.1.0.0_wls.jar', # wls1036_generic.jar|wls1211_generic.jar|wls_121200.jar
jdk_home_dir => '/usr/java/jdk1.8.0_45',
oracle_base_home_dir => "/opt/oracle",
middleware_home_dir => "/opt/oracle/middleware12c",
weblogic_home_dir => "/opt/oracle/middleware12c/wlserver",
os_user => "oracle",
os_group => "dba",
download_dir => "/data/install",
source => "/vagrant", # puppet:///modules/orawls/ | /mnt |
log_output => true,
}
class{'orawls::weblogic':
version => 1212, # 1036|1211|1212|1213
filename => 'wls_121200.jar', # wls1036_generic.jar|wls1211_generic.jar|wls_121200.jar
jdk_home_dir => '/usr/java/jdk1.7.0_45',
oracle_base_home_dir => "/opt/oracle",
middleware_home_dir => "/opt/oracle/middleware12c",
weblogic_home_dir => "/opt/oracle/middleware12c/wlserver",
os_user => "oracle",
os_group => "dba",
download_dir => "/data/install",
source => "/vagrant", # puppet:///modules/orawls/ | /mnt |
log_output => true,
}
12.1.3 infra
class{'orawls::weblogic':
version => 1213,
filename => 'fmw_12.1.3.0.0_infrastructure.jar',
fmw_infra => true,
jdk_home_dir => '/usr/java/jdk1.7.0_55',
oracle_base_home_dir => "/opt/oracle",
middleware_home_dir => "/opt/oracle/middleware12c",
weblogic_home_dir => "/opt/oracle/middleware12c/wlserver",
os_user => "oracle",
os_group => "dba",
download_dir => "/data/install",
source => "puppet:///middleware",
log_output => true,
}
or with a bin file located on a share
class{'orawls::weblogic':
version => 1036,
filename => "oepe-wls-indigo-installer-11.1.1.8.0.201110211138-10.3.6-linux32.bin",
oracle_base_home_dir => "/opt/weblogic",
middleware_home_dir => "/opt/weblogic/Middleware",
weblogic_home_dir => "/opt/weblogic/Middleware/wlserver_10.3",
fmw_infra => false,
jdk_home_dir => "/usr/java/latest",
os_user => "weblogic",
os_group => "bea",
download_dir => "/data/tmp",
source => "/misc/tact/products/oracle/11g/fmw/wls/11.1.1.8",
remote_file => false,
log_output => true,
temp_directory => "/data/tmp",
}
Same configuration but then with Hiera ( need to have puppet > 3.0 )
include orawls::weblogic
or this
class{'orawls::weblogic':
log_output => true,
}
vagrantcentos64.example.com.yaml
---
orawls::weblogic::log_output: true
### opatch
__orawls::opatch__ apply an OPatch on a Middleware home or a Oracle product home
orawls::opatch {'16175470':
ensure => "present",
oracle_product_home_dir => "/opt/oracle/middleware12c",
jdk_home_dir => "/usr/java/jdk1.7.0_45",
patch_id => "16175470",
patch_file => "p16175470_121200_Generic.zip",
os_user => "oracle",
os_group => "dba",
download_dir => "/data/install",
source => "/vagrant",
log_output => false,
}
or when you set the defaults hiera variables
orawls::opatch {'16175470':
ensure => "present",
oracle_product_home_dir => "/opt/oracle/middleware12c",
patch_id => "16175470",
patch_file => "p16175470_121200_Generic.zip",
}
Same configuration but then with Hiera ( need to have puppet > 3.0 )
$default_params = {}
$opatch_instances = hiera('opatch_instances', {})
create_resources('orawls::opatch',$opatch_instances, $default_params)
common.yaml
---
opatch_instances:
'16175470':
ensure: "present"
oracle_product_home_dir: "/opt/oracle/middleware12c"
patch_id: "16175470"
patch_file: "p16175470_121200_Generic.zip"
jdk_home_dir "/usr/java/jdk1.7.0_45"
os_user: "oracle"
os_group: "dba"
download_dir: "/data/install"
source: "/vagrant"
log_output: true
or when you set the defaults hiera variables
---
opatch_instances:
'16175470':
ensure: "present"
oracle_product_home_dir: "/opt/oracle/middleware12c"
patch_id: "16175470"
patch_file: "p16175470_121200_Generic.zip"
### bsu
__orawls::bsu__ apply or remove a WebLogic BSU Patch ( ensure = present or absent )
orawls::bsu {'BYJ1':
ensure => "present",
middleware_home_dir => "/opt/oracle/middleware11gR1",
weblogic_home_dir => "/opt/oracle/middleware11gR1/wlserver",
jdk_home_dir => "/usr/java/jdk1.7.0_45",
patch_id => "BYJ1",
patch_file => "p17071663_1036_Generic.zip",
os_user => "oracle",
os_group => "dba",
download_dir => "/data/install",
source => "/vagrant",
log_output => false,
}
or when you set the defaults hiera variables
orawls::bsu {'BYJ1':
ensure => "present",
patch_id => "BYJ1",
patch_file => "p17071663_1036_Generic.zip",
log_output => false,
}
Same configuration but then with Hiera ( need to have puppet > 3.0 )
$default_params = {}
$bsu_instances = hiera('bsu_instances', {})
create_resources('orawls::bsu',$bsu_instances, $default_params)
common.yaml
---
bsu_instances:
'BYJ1':
ensure "present"
middleware_home_dir: "/opt/oracle/middleware11gR1"
weblogic_home_dir: "/opt/oracle/middleware11gR1/wlserver"
jdk_home_dir: "/usr/java/jdk1.7.0_45"
patch_id: "BYJ1"
patch_file: "p17071663_1036_Generic.zip"
os_user: "oracle"
os_group: "dba"
download_dir: "/data/install"
source: "/vagrant"
log_output: false
or when you set the defaults hiera variables
---
bsu_instances:
'BYJ1':
ensure "present"
patch_id: "BYJ1"
patch_file: "p17071663_1036_Generic.zip"
log_output: false
### fmw
__orawls::fmw__ installs FMW software (add-on) to a middleware home like OSB,SOA Suite, WebTier (HTTP Server), Oracle Identity Management, Web Center + Content
# fmw_product = adf|soa|osb|wcc|wc|oim|web|webgate|b2b|mft
orawls::fmw{"osbPS6":
middleware_home_dir => "/opt/oracle/middleware11gR1",
weblogic_home_dir => "/opt/oracle/middleware11gR1/wlserver",
jdk_home_dir => "/usr/java/jdk1.7.0_45",
oracle_base_home_dir => "/opt/oracle",
fmw_product => "osb", # adf|soa|osb|oim|wc|wcc|web
fmw_file1 => "ofm_osb_generic_11.1.1.7.0_disk1_1of1.zip",
os_user => "oracle",
os_group => "dba",
download_dir => "/data/install",
source => "/vagrant",
log_output => false,
}
or when you set the defaults hiera variables
orawls::fmw{"osbPS6":
fmw_product => "osb" # adf|soa|osb|oim|wc|wcc|web|webgate
fmw_file1 => "ofm_osb_generic_11.1.1.7.0_disk1_1of1.zip",
log_output => false,
}
orawls::fmw{"osb12.1.3":
version => 1213
fmw_product => "osb"
fmw_file1 => "fmw_12.1.3.0.0_osb_Disk1_1of1.zip",
log_output => false,
}
Same configuration but then with Hiera ( need to have puppet > 3.0 )
$default_params = {}
$fmw_installations = hiera('fmw_installations', {})
create_resources('orawls::fmw',$fmw_installations, $default_params)
common.yaml
when you set the defaults hiera variables
# FMW installation on top of WebLogic 12.2.1
fmw_installations:
'soa1221':
version: 1221
fmw_product: "soa"
fmw_file1: "fmw_12.2.1.0.0_soa_Disk1_1of1.zip"
bpm: true
log_output: true
remote_file: false
'osb1221':
version: 1221
fmw_product: "osb"
fmw_file1: "fmw_12.2.1.0.0_osb_Disk1_1of1.zip"
log_output: true
remote_file: false
'webtier1221':
version: 1221
fmw_product: "web"
fmw_file1: "fmw_12.2.1.0.0_ohs_linux64_Disk1_1of1.zip"
log_output: true
remote_file: false
'forms1221':
version: 1221
fmw_product: "forms"
fmw_file1: "fmw_12.2.1.0.0_fr_linux64_Disk1_1of1.zip"
log_output: true
remote_file: false
'wcc1221':
version: 1221
fmw_product: "wcc"
fmw_file1: "fmw_12.2.1.0.0_wccontent_Disk1_1of1.zip"
log_output: true
remote_file: false
'wc1221':
version: 1221
fmw_product: "wc"
fmw_file1: "fmw_12.2.1.0.0_wcportal_Disk1_1of1.zip"
log_output: true
remote_file: false
if ( defined(Orawls::Fmw["b2b1213"])) {
Orawls::Fmw["soa1213"] -> Orawls::Fmw["b2b1213"]
}
fmw_installations:
'soa1213':
version: *wls_version
fmw_product: "soa"
fmw_file1: "fmw_12.1.3.0.0_soa_Disk1_1of1.zip"
bpm: true
log_output: true
remote_file: false
'webtier1213':
version: *wls_version
fmw_product: "web"
fmw_file1: "fmw_12.1.3.0.0_ohs_linux64_Disk1_1of1.zip"
log_output: true
remote_file: false
'osb1213':
version: *wls_version
fmw_product: "osb"
fmw_file1: "fmw_12.1.3.0.0_osb_Disk1_1of1.zip"
log_output: true
remote_file: false
'mft1213':
version: *wls_version
fmw_product: "mft"
fmw_file1: "fmw_12.1.3.0.0_mft_Disk1_1of1.zip"
log_output: true
remote_file: false
'b2b1213':
version: *wls_version
fmw_product: "b2b"
healthcare: true
fmw_file1: "fmw_12.1.3.0.0_b2b_Disk1_1of1.zip"
log_output: true
remote_file: false
# FMW installation on top of WebLogic 10.3.6
fmw_installations:
'osbPS6':
fmw_product: "osb"
fmw_file1: "ofm_osb_generic_11.1.1.7.0_disk1_1of1.zip"
log_output: true
'soaPS6':
fmw_product: "soa"
fmw_file1: "ofm_soa_generic_11.1.1.7.0_disk1_1of2.zip"
fmw_file2: "ofm_soa_generic_11.1.1.7.0_disk1_2of2.zip"
log_output: true
# FMW installation on top of WebLogic 12.1.2
fmw_installations:
'webtier1212':
version: 1212
fmw_product: "web"
fmw_file1: "ofm_ohs_linux_12.1.2.0.0_64_disk1_1of1.zip"
log_output: true
remote_file: false
fmw_installations:
'webTierPS6':
fmw_product: "web"
fmw_file1: "ofm_webtier_linux_11.1.1.7.0_64_disk1_1of1.zip"
log_output: true
remote_file: false
fmw_installations:
'wcPS7':
fmw_product: "wc"
fmw_file1: "ofm_wc_generic_11.1.1.8.0_disk1_1of1.zip"
log_output: true
remote_file: false
'soaPS6':
fmw_product: "soa"
fmw_file1: "ofm_soa_generic_11.1.1.7.0_disk1_1of2.zip"
fmw_file2: "ofm_soa_generic_11.1.1.7.0_disk1_2of2.zip"
log_output: true
remote_file: false
'wccPS7':
fmw_product: "wcc"
fmw_file1: "ofm_wcc_generic_11.1.1.8.0_disk1_1of2.zip"
fmw_file2: "ofm_wcc_generic_11.1.1.8.0_disk1_2of2.zip"
log_output: true
remote_file: false
'webGate11.1.2.2':
version: 1112
fmw_product: "webgate"
fmw_file1: "ofm_webgates_generic_11.1.2.2.0_disk1_1of1.zip"
log_output: true
remote_file: false
'oud11.1.2.2':
version: 1112
fmw_product: "oud"
fmw_file1: "ofm_oud_generic_11.1.2.2.0_disk1_1of1.zip"
log_output: true
remote_file: false
### domain
__orawls::domain__ creates WebLogic domain like a standard | OSB or SOA Suite | ADF | WebCenter | OIM or OAM or OUD
optional override the default server arguments in the domain.py template with java_arguments parameter
orawls::domain { 'wlsDomain12c':
version => 1212, # 1036|1111|1211|1212|1213
weblogic_home_dir => "/opt/oracle/middleware12c/wlserver",
middleware_home_dir => "/opt/oracle/middleware12c",
jdk_home_dir => "/usr/java/jdk1.7.0_45",
domain_template => "standard", #standard|adf|osb|osb_soa|osb_soa_bpm|soa|soa_bpm
domain_name => "Wls12c",
development_mode => false,
adminserver_name => "AdminServer",
adminserver_address => "localhost",
adminserver_port => 7001,
nodemanager_secure_listener => true,
nodemanager_port => 5556,
java_arguments => { "ADM" => "...", "OSB" => "...", "SOA" => "...", "BAM" => "..."},
weblogic_user => "weblogic",
weblogic_password => "weblogic1",
os_user => "oracle",
os_group => "dba",
log_dir => "/data/logs",
download_dir => "/data/install",
log_output => true,
}
or when you set the defaults hiera variables
orawls::domain { 'wlsDomain12c':
domain_template => "standard",
domain_name => "Wls12c",
development_mode => false,
adminserver_name => "AdminServer",
adminserver_address => "localhost",
adminserver_port => 7001,
nodemanager_port => 5556,
weblogic_password => "weblogic1",
log_output => true,
}
Same configuration but then with Hiera ( need to have puppet > 3.0 )
$default = {}
$domain_instances = hiera('domain_instances', {})
create_resources('orawls::domain',$domain_instances, $default)
vagrantcentos64.example.com.yaml
---
domain_instances:
'wlsDomain12c':
version: 1212
weblogic_home_dir: "/opt/oracle/middleware12c/wlserver"
middleware_home_dir: "/opt/oracle/middleware12c"
jdk_home_dir: "/usr/java/jdk1.7.0_45"
domain_template: "standard"
domain_name: "Wls12c"
development_mode: false
adminserver_name: "AdminServer"
adminserver_address: "localhost"
adminserver_port: 7001
nodemanager_secure_listener: true
nodemanager_port: 5556
weblogic_user: "weblogic"
weblogic_password: "weblogic1"
os_user: "oracle"
os_group: "dba"
log_dir: "/data/logs"
download_dir: "/data/install"
java_arguments:
ADM: "-XX:PermSize=256m -XX:MaxPermSize=512m -Xms1024m -Xmx1024m"
OSB: "-XX:PermSize=256m -XX:MaxPermSize=512m -Xms1024m -Xmx1024m"
log_output: true
or when you set the defaults hiera variables
---
domain_instances:
'wlsDomain12c':
domain_template: "standard"
domain_name: "Wls12c"
development_mode: false
adminserver_name: "AdminServer"
adminserver_address: "localhost"
adminserver_port: 7001
nodemanager_port: 5556
weblogic_password: "weblogic1"
java_arguments:
ADM: "-XX:PermSize=256m -XX:MaxPermSize=512m -Xms1024m -Xmx1024m"
log_output: true
when you just have one WebLogic domain on a server
---
# when you have just one domain on a server
domain_name: "Wls1036"
domain_adminserver: "AdminServer"
domain_adminserver_address: "localhost"
domain_adminserver_port: 7001
domain_nodemanager_port: 5556
domain_wls_password: "weblogic1"
# create a standard domain
domain_instances:
'wlsDomain':
domain_template: "standard"
development_mode: false
log_output: *logoutput
or with custom identity and custom truststore
# used by nodemanager, control and domain creation
wls_custom_trust: &wls_custom_trust true
wls_trust_keystore_file: &wls_trust_keystore_file '/vagrant/truststore.jks'
wls_trust_keystore_passphrase: &wls_trust_keystore_passphrase 'welcome'
# create a standard domain with custom identity for the adminserver
domain_instances:
'Wls1036':
domain_template: "standard"
development_mode: false
log_output: *logoutput
custom_identity: true
custom_identity_keystore_filename: '/vagrant/identity_admin.jks'
custom_identity_keystore_passphrase: 'welcome'
custom_identity_alias: 'admin'
custom_identity_privatekey_passphrase: 'welcome'
FMW 11g, 12.1.2 , 12.1.3 ADF domain with webtier
# create a standard domain
domain_instances:
'adf_domain':
domain_template: "adf"
development_mode: true
log_output: *logoutput
nodemanager_address: "10.10.10.21"
repository_database_url: "jdbc:oracle:thin:@wlsdb.example.com:1521/wlsrepos.example.com"
repository_prefix: "DEV"
repository_password: "Welcome01"
repository_sys_user: "sys"
repository_sys_password: "Welcome01"
rcu_database_url: "wlsdb.example.com:1521:wlsrepos.example.com"
webtier_enabled: true
create_rcu: true
FMW 11g WebLogic SOA Suite domain
# create a standard domain
domain_instances:
'wlsDomain':
domain_template: "osb_soa_bpm"
development_mode: false
log_output: *logoutput
repository_database_url: "jdbc:oracle:thin:@10.10.10.5:1521/test.oracle.com"
repository_prefix: "DEV"
repository_password: "Welcome01"
FMW 11g WebLogic OIM / OAM domain
domain_instances:
'oimDomain':
version: 1112
domain_template: "oim"
development_mode: true
log_output: *logoutput
repository_database_url: "jdbc:oracle:thin:@oimdb.example.com:1521/oimrepos.example.com"
repository_prefix: "DEV"
repository_password: "Welcome01"
repository_sys_user: "sys"
repository_sys_password: "Welcome01"
rcu_database_url: "oimdb.example.com:1521/oimrepos.example.com"
FMW 12.1.3 WebLogic SOA Suite domain
# create a soa domain
domain_instances:
'soa_domain':
version: 1213
domain_template: "osb_soa_bpm"
bam_enabled: true
b2b_enabled: true
ess_enabled: true
development_mode: true
log_output: *logoutput
nodemanager_address: "10.10.10.21"
repository_database_url: "jdbc:oracle:thin:@soadb.example.com:1521/soarepos.example.com"
repository_prefix: "DEV"
repository_password: "Welcome01"
repository_sys_user: "sys"
repository_sys_password: "Welcome01"
rcu_database_url: "soadb.example.com:1521:soarepos.example.com"
FMW 12.1.3 WebLogic OSB domain
domain_instances:
'osb_domain':
version: *wls_version
domain_template: "osb"
development_mode: true
log_output: *logoutput
nodemanager_address: *domain_adminserver_address
repository_database_url: "jdbc:oracle:thin:@osbdb.example.com:1521/osbrepos.example.com"
repository_prefix: "DEV"
repository_password: "Welcome01"
repository_sys_user: "sys"
repository_sys_password: "Welcome01"
rcu_database_url: "osbdb.example.com:1521:osbrepos.example.com"
### packdomain
__orawls::packdomain__ pack a WebLogic Domain and add this to the download folder
orawls::packdomain{"Wls12c":
weblogic_home_dir => "/opt/oracle/middleware12c/wlserver",
middleware_home_dir => "/opt/oracle/middleware12c",
jdk_home_dir => "/usr/java/jdk1.7.0_45",
wls_domains_dir => "/opt/oracle/domains",
domain_name => "Wls12c",
os_user => "oracle",
os_group => "dba",
download_dir => "/data/install",
}
or with hiera
$default_params = {}
$pack_domain_instances = hiera('pack_domain_instances', {})
create_resources('orawls::packdomain',$pack_domain_instances, $default_params)
# pack domains
pack_domain_instances:
'wlsDomain':
log_output: *logoutput
### copydomain
__orawls::copydomain__ copies a WebLogic domain with SSH or from a share, unpack and enroll to a nodemanager
When using ssh (use_ssh = true) you need to setup ssh so you won't need to provide a password
orawls::copydomain{"Wls12c":
version => 1212,
weblogic_home_dir => "/opt/oracle/middleware12c/wlserver",
middleware_home_dir => "/opt/oracle/middleware12c",
jdk_home_dir => "/usr/java/jdk1.7.0_45",
wls_domains_dir => "/opt/oracle/domains",
wls_apps_dir => "/opt/oracle/applications",
domain_name => "Wls12c",
os_user => "oracle",
os_group => "dba",
download_dir => "/data/install",
log_dir => "/var/log/weblogic",
log_output => true,
use_ssh => false,
domain_pack_dir => /mnt/fmw_share,
adminserver_address => "10.10.10.10",
adminserver_port => 7001,
weblogic_user => "weblogic",
weblogic_password => "weblogic1",
setinternalappdeploymentondemandenable => false,
setconfigbackupenabled => true,
setarchiveconfigurationcount => 10,
setconfigurationaudittype => 'logaudit',
}
Configuration with Hiera ( need to have puppet > 3.0 )
$default_params = {}
$copy_instances = hiera('copy_instances', {})
create_resources('orawls::copydomain',$copy_instances, $default_params)
when you just have one WebLogic domain on a server
---
# when you have just one domain on a server
domain_name: "Wls1036"
domain_adminserver: "AdminServer"
domain_adminserver_address: "localhost"
domain_adminserver_port: 7001
domain_nodemanager_port: 5556
domain_wls_password: "weblogic1"
# copy domains to other nodes
copy_instances:
'wlsDomain':
use_ssh: false
domain_pack_dir: /mnt/fmw_share
log_output: *logoutput
'wlsDomain2':
log_output: *logoutput
### nodemanager
__orawls::nodemanager__ start the nodemanager of a WebLogic Domain or Middleware Home
orawls::nodemanager{'nodemanager12c':
version => 1212, # 1036|1111|1211|1212
weblogic_home_dir => "/opt/oracle/middleware12c/wlserver",
jdk_home_dir => "/usr/java/jdk1.7.0_45",
nodemanager_port => 5556,
nodemanager_secure_listener => true,
domain_name => "Wls12c",
os_user => "oracle",
os_group => "dba",
log_dir => "/data/logs",
download_dir => "/data/install",
log_output => true,
sleep => 20,
properties => {},
}
or when you set the defaults hiera variables
orawls::nodemanager{'nodemanager12c':
nodemanager_port => 5556,
domain_name => "Wls12c",
log_output => true,
}
Same configuration but then with Hiera ( need to have puppet > 3.0 )
$default = {}
$nodemanager_instances = hiera('nodemanager_instances', [])
create_resources('orawls::nodemanager',$nodemanager_instances, $default)
vagrantcentos64.example.com.yaml
---
nodemanager_instances:
'nodemanager12c':
version: 1212
weblogic_home_dir: "/opt/oracle/middleware12c/wlserver"
jdk_home_dir: "/usr/java/jdk1.7.0_45"
nodemanager_port: 5556
nodemanager_secure_listener: true
domain_name: "Wls12c"
os_user: "oracle"
os_group: "dba"
log_dir: "/data/logs"
download_dir: "/data/install"
log_output: true
or when you set the defaults hiera variables
---
nodemanager_instances:
'nodemanager12c':
nodemanager_port: 5556
domain_name: "Wls12c"
log_output: true
when you just have one WebLogic domain on a server
#when you just have one domain on a server
domain_name: "Wls1036"
domain_nodemanager_port: 5556
---
nodemanager_instances:
'nodemanager12c':
log_output: true
or with custom identity and custom truststore
# used by nodemanager, control and domain creation
wls_custom_trust: &wls_custom_trust true
wls_trust_keystore_file: &wls_trust_keystore_file '/vagrant/truststore.jks'
wls_trust_keystore_passphrase: &wls_trust_keystore_passphrase 'welcome'
nodemanager_instances:
'nodemanager':
log_output: *logoutput
custom_identity: true
custom_identity_keystore_filename: '/vagrant/identity_admin.jks'
custom_identity_keystore_passphrase: 'welcome'
custom_identity_alias: 'admin'
custom_identity_privatekey_passphrase: 'welcome'
nodemanager_address: *domain_adminserver_address
you can also set some extra nodemanager properties by using the properties parameter like this
nodemanager_instances:
'nodemanager12c':
version: 1212
weblogic_home_dir: "/opt/oracle/middleware12c/wlserver"
jdk_home_dir: "/usr/java/jdk1.7.0_45"
nodemanager_port: 5556
nodemanager_secure_listener: true
domain_name: "Wls12c"
os_user: "oracle"
os_group: "dba"
log_dir: "/data/logs"
download_dir: "/data/install"
log_output: true
properties:
'log_level': 'INFO'
'log_count': '2'
'log_append': true
'log_formatter': 'weblogic.nodemanager.server.LogFormatter'
'listen_backlog': 60
here is an overview of all the parameters you can set with its defaults
'log_limit' => 0,
'domains_dir_remote_sharing_enabled' => false,
'authentication_enabled' => true,
'log_level' => 'INFO',
'domains_file_enabled' => true,
'start_script_name' => 'startWebLogic.sh',
'native_version_enabled' => true,
'log_to_stderr' => true,
'log_count' => '1',
'domain_registration_enabled' => false,
'stop_script_enabled' => true,
'quit_enabled' => false,
'log_append' => true,
'state_check_interval' => 500,
'crash_recovery_enabled' => true,
'start_script_enabled' => true,
'log_formatter' => 'weblogic.nodemanager.server.LogFormatter',
'listen_backlog' => 50,
### control
__orawls::control__ start or stops the AdminServer,Managed Server or a Cluster of a WebLogic Domain, this will call the wls_managedserver and wls_adminserver types
orawls::control{'startWLSAdminServer12c':
domain_name => "Wls12c",
server_type => 'admin', # admin|managed
target => 'Server', # Server|Cluster
server => 'AdminServer',
action => 'start',
weblogic_home_dir => "/opt/oracle/middleware12c/wlserver",
jdk_home_dir => "/usr/java/jdk1.7.0_45",
weblogic_user => "weblogic",
weblogic_password => "weblogic1",
adminserver_address => 'localhost',
adminserver_port => 7001,
nodemanager_port => 5556,
nodemanager_secure_listener => true,
os_user => "oracle",
os_group => "dba",
download_dir => "/data/install",
log_output => true,
}
or when you set the defaults hiera variables
orawls::control{'startWLSAdminServer12c':
domain_name => "Wls12c",
server_type => 'admin', # admin|managed
target => 'Server', # Server|Cluster
server => 'AdminServer',
action => 'start',
weblogic_password => "weblogic1",
adminserver_address => 'localhost',
adminserver_port => 7001,
nodemanager_port => 5556,
log_output => true,
}
Same configuration but then with Hiera ( need to have puppet > 3.0 )
$default = {}
$control_instances = hiera('control_instances', {})
create_resources('orawls::control',$control_instances, $default)
vagrantcentos64.example.com.yaml
---
control_instances:
'startWLSAdminServer12c':
domain_name: "Wls12c"
domain_dir: "/opt/oracle/middleware12c/user_projects/domains/Wls12c"
server_type: 'admin'
target: 'Server'
server: 'AdminServer'
action: 'start'
weblogic_home_dir: "/opt/oracle/middleware12c/wlserver"
jdk_home_dir: "/usr/java/jdk1.7.0_45"
weblogic_user: "weblogic"
weblogic_password: "weblogic1"
adminserver_address: 'localhost'
adminserver_port: 7001
nodemanager_port: 5556
nodemanager_secure_listener: true
os_user: "oracle"
os_group: "dba"
download_dir: "/data/install"
log_output: true
or when you set the defaults hiera variables
---
control_instances:
'startWLSAdminServer12c':
domain_name: "Wls12c"
domain_dir: "/opt/oracle/middleware12c/user_projects/domains/Wls12c"
server_type: 'admin'
target: 'Server'
server: 'AdminServer'
action: 'start'
weblogic_password: "weblogic1"
adminserver_address: 'localhost'
adminserver_port: 7001
nodemanager_port: 5556
log_output: true
when you just have one WebLogic domain on a server
---
#when you just have one domain on a server
domain_name: "Wls1036"
domain_adminserver_address: "localhost"
domain_adminserver_port: 7001
domain_nodemanager_port: 5556
domain_wls_password: "weblogic1"
# startup adminserver for extra configuration
control_instances:
'startWLSAdminServer':
domain_dir: "/opt/oracle/middleware11g/user_projects/domains/Wls1036"
server_type: 'admin'
target: 'Server'
server: 'AdminServer'
action: 'start'
log_output: *logoutput
### urandomfix
__orawls::urandomfix__ Linux low on entropy or urandom fix can cause certain operations to be very slow. Encryption operations need entropy to ensure randomness. Entropy is generated by the OS when you use the keyboard, the mouse or the disk.
If an encryption operation is missing entropy it will wait until enough is generated.
three options
- use rngd service (use this wls::urandomfix class)
- set java.security in JDK ( jre/lib/security in my jdk7 module )
- set -Djava.security.egd=file:/dev/./urandom param
### storeuserconfig
__orawls::storeuserconfig__ Creates WLST user config for WLST , this way you don't need to know the weblogic password.
when you set the defaults hiera variables
orawls::storeuserconfig{'Wls12c':
domain_name => "Wls12c",
adminserver_address => "localhost",
adminserver_port => 7001,
weblogic_password => "weblogic1",
user_config_dir => '/home/oracle',
log_output => false,
}
Same configuration but then with Hiera ( need to have puppet > 3.0 )
notify { 'class userconfig':}
$default_params = {}
$userconfig_instances = hiera('userconfig_instances', {})
create_resources('orawls::storeuserconfig',$userconfig_instances, $default_params)
vagrantcentos64.example.com.yaml
or when you set the defaults hiera variables
---
userconfig_instances:
'Wls12c':
domain_name: "Wls12c"
adminserver_address: "localhost"
adminserver_port: 7001
weblogic_password: "weblogic1"
log_output: true
user_config_dir: '/home/oracle'
when you just have one WebLogic domain on a server
#when you just have one domain on a server
domain_name: "Wls1036"
domain_adminserver_address: "localhost"
domain_adminserver_port: 7001
domain_wls_password: "weblogic1"
---
userconfig_instances:
'Wls12c':
log_output: true
user_config_dir: '/home/oracle'
### Dynamictargetting
Sometimes you do not know how many managed services you will have,
due to application scaling or other use cases. Since you do specify resources
like clusters and datasources in a more 'static' way, there should be a way to
qualify a managed server as a target for such resources.
We use the notes field in WebLogic Server to accomplish this. Currently implemented
for the following resource types:
- wls_cluster
- wls_datasource
- wls_mail_session
The way you use this, is by entering the resource name in the server_parameter
field on the wls_server type, and put the servers field to 'inherited' on the
resource to be targeted.
Example:
wls_server { 'wlsServer1':
ensure => 'present',
arguments => '-XX:PermSize=256m -XX:MaxPermSize=256m -Xms752m -Xmx752m -Dweblogic.Stdout=/var/log/weblogic/wlsServer1.out -Dweblogic.Stderr=/var/log/weblogic/wlsServer1_err.out',
jsseenabled => '0',
listenaddress => '10.10.10.100',
listenport => '8001',
listenportenabled => '1',
machine => 'Node1',
sslenabled => '0',
tunnelingenabled => '0',
max_message_size => '10000000',
server_parameter => 'WebCluster, hrDs',
}
wls_cluster { 'WebCluster':
ensure => 'present',
messagingmode => 'unicast',
migrationbasis => 'consensus',
servers => ['inherited'],
multicastaddress => '239.192.0.0',
multicastport => '7001',
}
wls_datasource { 'hrDS':
ensure => 'present',
connectioncreationretryfrequency => '0',
drivername => 'oracle.jdbc.xa.client.OracleXADataSource',
extraproperties => ['SendStreamAsBlob=true', 'oracle.net.CONNECT_TIMEOUT=10001'],
fanenabled => '0',
globaltransactionsprotocol => 'TwoPhaseCommit',
initialcapacity => '2',
initsql => 'None',
jndinames => ['jdbc/hrDS', 'jdbc/hrDS2'],
maxcapacity => '15',
mincapacity => '1',
rowprefetchenabled => '0',
rowprefetchsize => '48',
secondstotrustidlepoolconnection => '10',
statementcachesize => '10',
target => ['inherited'],
targettype => ['inherited'],
testconnectionsonreserve => '0',
testfrequency => '120',
testtablename => 'SQL SELECT 1 FROM DUAL',
url => 'jdbc:oracle:thin:@dbagent2.alfa.local:1521/test.oracle.com',
user => 'hr',
usexa => '0',
}
In the case of the wls_datasource type, the jdbc connection will be targetted on
the cluster if the managed server is in a cluster.
### fmwlogdir
__orawls::fmwlogdir__ Change a log folder location of a FMW server
when you set the defaults hiera variables
orawls::fmwlogdir{'AdminServer':
middleware_home_dir => "/opt/oracle/middleware11gR1",
weblogic_user => "weblogic",
weblogic_password => "weblogic1",
os_user => "oracle",
os_group => "dba",
download_dir => "/data/install"
log_dir => "/var/log/weblogic"
adminserver_address => "localhost",
adminserver_port => 7001,
server => "AdminServer",
log_output => false,
}
Same configuration but then with Hiera ( need to have puppet > 3.0 )
$default_params = {}
$fmwlogdir_instances = hiera('fmwlogdir_instances', {})
create_resources('orawls::fmwlogdir',$fmwlogdir_instances, $default_params)
vagrantcentos64.example.com.yaml
or when you set the defaults hiera variables
---
fmwlogdir_instances:
'AdminServer':
log_output: true
server: 'AdminServer'
### resourceadapter
__orawls::resourceadapter__ Add a Resource adapter plan for File, FTP, Aq , DB or JMS with some entries
when you set the defaults hiera variables
$default_params = {}
$resource_adapter_instances = hiera('resource_adapter_instances', {})
create_resources('orawls::resourceadapter',$resource_adapter_instances, $default_params)
vagrantcentos64.example.com.yaml
or when you set the defaults hiera variables
resource_adapter_instances:
'JmsAdapter_hr':
adapter_name: 'JmsAdapter'
adapter_path: "/opt/oracle/middleware11g/Oracle_SOA1/soa/connectors/JmsAdapter.rar"
adapter_plan_dir: "/opt/oracle/wlsdomains"
adapter_plan: 'Plan_JMS.xml'
adapter_entry: 'eis/JMS/cf'
adapter_entry_property: 'ConnectionFactoryLocation'
adapter_entry_value: 'jms/cf'
'AqAdapter_hr':
adapter_name: 'AqAdapter'
adapter_path: "/opt/oracle/middleware11g/Oracle_SOA1/soa/connectors/AqAdapter.rar"
adapter_plan_dir: "/opt/oracle/wlsdomains"
adapter_plan: 'Plan_AQ.xml'
adapter_entry: 'eis/AQ/hr'
adapter_entry_property: 'xADataSourceName'
adapter_entry_value: 'jdbc/hrDS'
'DbAdapter_hr':
adapter_name: 'DbAdapter'
adapter_path: "/opt/oracle/middleware11g/Oracle_SOA1/soa/connectors/DbAdapter.rar"
adapter_plan_dir: "/opt/oracle/wlsdomains"
adapter_plan: 'Plan_DB.xml'
adapter_entry: 'eis/DB/hr'
adapter_entry_property: 'xADataSourceName'
adapter_entry_value: 'jdbc/hrDS'
'FTPAdapter_hr':
adapter_name: 'FtpAdapter'
adapter_path: "/opt/oracle/middleware11g/Oracle_SOA1/soa/connectors/FtpAdapter.rar"
adapter_plan_dir: "/opt/oracle/wlsdomains"
adapter_plan: 'Plan_FTP.xml'
adapter_entry: 'eis/FTP/xx'
adapter_entry_property: 'FtpAbsolutePathBegin;FtpPathSeparator;Host;ListParserKey;Password;ServerType;UseFtps;Username;UseSftp'
adapter_entry_value: '/BDDC;/;l2-ibrfongen02.nl.rsg;UNIX;;unix;false;kim;false'
'FileAdapter_hr':
adapter_name: 'FileAdapter'
adapter_path: "/opt/oracle/middleware11g/Oracle_SOA1/soa/connectors/FileAdapter.rar"
adapter_plan_dir: "/opt/oracle/wlsdomains"
adapter_plan: 'Plan_FILE.xml'
adapter_entry: 'eis/FileAdapterXX'
adapter_entry_property: 'ControlDir;IsTransacted'
adapter_entry_value: '/tmp/aaa;false'
or for 12.1.3 ( 12c )
resource_adapter_instances:
'JmsAdapter_hr':
adapter_name: 'JmsAdapter'
adapter_path: "/oracle/product/12.1/middleware/soa/soa/connectors/JmsAdapter.rar"
adapter_plan_dir: "/oracle/product/12.1/middleware"
adapter_plan: 'Plan_JMS.xml'
adapter_entry: 'eis/JMS/cf'
adapter_entry_property: 'ConnectionFactoryLocation'
adapter_entry_value: 'jms/cf'
'AqAdapter_hr':
adapter_name: 'AqAdapter'
adapter_path: "/oracle/product/12.1/middleware/soa/soa/connectors/AqAdapter.rar"
adapter_plan_dir: "/oracle/product/12.1/middleware"
adapter_plan: 'Plan_AQ.xml'
adapter_entry: 'eis/AQ/hr'
adapter_entry_property: 'XADataSourceName'
adapter_entry_value: 'jdbc/hrDS'
'DbAdapter_hr':
adapter_name: 'DbAdapter'
adapter_path: "/oracle/product/12.1/middleware/soa/soa/connectors/DbAdapter.rar"
adapter_plan_dir: "/oracle/product/12.1/middleware"
adapter_plan: 'Plan_DB.xml'
adapter_entry: 'eis/DB/hr'
adapter_entry_property: 'XADataSourceName'
adapter_entry_value: 'jdbc/hrDS'
'FTPAdapter_hr':
adapter_name: 'FtpAdapter'
adapter_path: "/oracle/product/12.1/middleware/soa/soa/connectors/FtpAdapter.rar"
adapter_plan_dir: "/oracle/product/12.1/middleware"
adapter_plan: 'Plan_FTP.xml'
adapter_entry: 'eis/FTP/xx'
adapter_entry_property: 'FtpAbsolutePathBegin;FtpPathSeparator;Host;ListParserKey;Password;ServerType;UseFtps;Username;UseSftp'
adapter_entry_value: '/BDDC;/;l2-ibrfongen02.nl.rsg;UNIX;;unix;false;kim;false'
'FileAdapter_hr':
adapter_name: 'FileAdapter'
adapter_path: "/oracle/product/12.1/middleware/soa/soa/connectors/FileAdapter.rar"
adapter_plan_dir: "/oracle/product/12.1/middleware"
adapter_plan: 'Plan_FILE.xml'
adapter_entry: 'eis/FileAdapterXX'
adapter_entry_property: 'ControlDir;IsTransacted'
adapter_entry_value: '/tmp/aaa;false'
### fmwcluster
__orawls::utils::fmwcluster__ convert existing cluster to a OSB or SOA suite cluster (BPM is optional) and also convert BAM to a BAM cluster. This will also work for OIM / OAM cluster.
The security store is migrated to a database store during this conversion. To maintain a file based store set a standalone hiera param "retain_security_file_store" to true.
You first need to create some OSB, SOA or BAM clusters and add some managed servers to these clusters
for OSB 11g or SOA Suite 11g managed servers make sure to also set the coherence arguments parameters
$default_params = {}
$fmw_cluster_instances = hiera('fmw_cluster_instances', $default_params)
create_resources('orawls::utils::fmwcluster',$fmw_cluster_instances, $default_params)
hiera configuration
# FMW 11g cluster
fmw_cluster_instances:
'soaCluster':
domain_name: "soa_domain"
soa_cluster_name: "SoaCluster"
bam_cluster_name: "BamCluster"
osb_cluster_name: "OsbCluster"
log_output: *logoutput
bpm_enabled: true
bam_enabled: true
soa_enabled: true
osb_enabled: true
repository_prefix: "DEV"
# FMW 12.1.3 cluster
fmw_cluster_instances:
'soaCluster':
domain_name: "soa_domain"
soa_cluster_name: "SoaCluster"
bam_cluster_name: "BamCluster"
osb_cluster_name: "OsbCluster"
ess_cluster_name: "EssCluster" # optional else ESS will be added to the soa cluster
log_output: *logoutput
bpm_enabled: true
bam_enabled: true
soa_enabled: true
osb_enabled: true
b2b_enabled: true
ess_enabled: true
repository_prefix: "DEV"
### fmwclusterjrf
__orawls::utils::fmwclusterjrf__ convert existing cluster to a ADF/JRF cluster
you need to create a wls cluster with some managed servers first
$default_params = {}
$fmw_jrf_cluster_instances = hiera('fmw_jrf_cluster_instances', $default_params)
create_resources('orawls::utils::fmwclusterjrf',$fmw_jrf_cluster_instances, $default_params)
hiera configuration
fmw_jrf_cluster_instances:
'WebCluster':
domain_name: "adf_domain"
jrf_target_name: "WebCluster"
opss_datasource_name: "opss-data-source" #optional
log_output: *logoutput
### webtier
__orawls::utils::webtier__ add an OHS instance to a WebLogic Domain and in the Enterprise Manager, optional with OHS OAM Webgate
$default_params = {}
$webtier_instances = hiera('webtier_instances', {})
create_resources('orawls::utils::webtier',$webtier_instances, $default_params)
hiera configuration
# 11g
webtier_instances:
'ohs1':
action_name: 'create'
instance_name: 'ohs1'
webgate_configure: true
log_output: *logoutput
# 12.1.2
webtier_instances:
'ohs1':
action_name: 'create'
instance_name: 'ohs1'
machine_name: 'Node1'
Webtier for OAM
webtier_instances:
'ohs1':
action_name: 'create'
instance_name: 'ohs1'
webgate_configure: true
webgate_agentname: 'ohs1'
webgate_hostidentifier: 'host1'
oamadminserverhostname: 'oim1admin.example.com'
oamadminserverport: '7001'
log_output: *logoutput
### oimconfig
__orawls::utils::oimconfig__ Configure OIM , oim server, design or remote configuration
$default_params = {}
$oimconfig_instances = hiera('oimconfig_instances', $default_params)
create_resources('orawls::utils::oimconfig',$oimconfig_instances, $default_params)
oimconfig_instances:
'oimDomain':
version: 1112
oim_home: '/opt/oracle/middleware11g/Oracle_IDM1'
server_config: true
oim_password: 'Welcome01'
remote_config: false
keystore_password: 'Welcome01'
design_config: false
oimserver_hostname: 'oim1admin.example.com'
oimserver_port: '14000'
repository_database_url: "oimdb.example.com:1521:oimrepos.example.com"
repository_prefix: "DEV"
repository_password: "Welcome01"
### instance
__orawls::oud::instance__ Configure OUD (Oracle Unified Directory) ldap instance
$default_params = {}
$oudconfig_instances = hiera('oudconfig_instances', $default_params)
create_resources('orawls::oud::instance',$oudconfig_instances, $default_params)
oudconfig_instances:
'instance1':
version: 1112
oud_home: '/opt/oracle/middleware11g/Oracle_OUD1'
oud_instance_name: 'instance1'
oud_root_user_password: 'Welcome01'
oud_baseDN: 'dc=example,dc=com'
oud_ldapPort: 1389
oud_adminConnectorPort: 4444
oud_ldapsPort: 1636
log_output: *logoutput
'instance2':
version: 1112
oud_home: '/opt/oracle/middleware11g/Oracle_OUD1'
oud_instance_name: 'instance2'
oud_root_user_password: 'Welcome01'
oud_baseDN: 'dc=example,dc=com'
oud_ldapPort: 2389
oud_adminConnectorPort: 5555
oud_ldapsPort: 2636
log_output: *logoutput
### oud_control
__orawls::oud::control__ Stop or start an OUD (Oracle Unified Directory) ldap instance
$default_params = {}
$oud_control_instances = hiera('oud_control_instances', $default_params)
create_resources('orawls::oud::control',$oud_control_instances, $default_params)
oud_control_instances:
'instance1':
oud_instances_home_dir: '/opt/oracle/oud_instances'
oud_instance_name: 'instance1'
action: 'start'
log_output: *logoutput
## Types and providers
All wls types needs a wls_setting definition, this is a pointer to an WebLogic AdminServer and you need to create one for every WebLogic domain. When you don't provide a wls_setting identifier in the title of the weblogic type then it will use default as identifier.
Global timeout parameter for WebLogic resource types. use timeout and value in seconds, default = 120 seconds or 2 minutes
###wls_setting
required for all the weblogic type/providers, this is a pointer to an WebLogic AdminServer.
wls_setting { 'default':
user => 'oracle',
weblogic_home_dir => '/opt/oracle/middleware11g/wlserver_10.3',
connect_url => "t3://localhost:7001",
weblogic_user => 'weblogic',
weblogic_password => 'weblogic1',
}
wls_setting { 'domain2':
user => 'oracle',
weblogic_home_dir => '/opt/oracle/middleware11g/wlserver_10.3',
connect_url => "t3://localhost:7011",
weblogic_user => 'weblogic',
weblogic_password => 'weblogic1',
post_classpath => '/opt/oracle/wlsdomains/domains/Wls1036/lib/aa.jar'
}
saving the WLST scripts of all the wls types to a temporary folder
archive_path has /tmp/orawls-archive as default folder
wls_setting { 'default':
debug_module => 'true',
archive_path => '/var/tmp/install/default_domain',
connect_url => 't3s://10.10.10.10:7002',
custom_trust => 'true',
trust_keystore_file => '/vagrant/truststore.jks',
trust_keystore_passphrase => 'welcome',
user => 'oracle',
weblogic_home_dir => '/opt/oracle/middleware12c/wlserver',
weblogic_password => 'weblogic1',
weblogic_user => 'weblogic',
}
wls_setting { 'plain':
debug_module => 'false',
archive_path => '/tmp/orawls-archive',
connect_url => 't3://10.10.10.10:7101',
custom_trust => 'false',
user => 'oracle',
weblogic_home_dir => '/opt/oracle/middleware12c/wlserver',
weblogic_password => 'weblogic1',
weblogic_user => 'weblogic',
}
or in hiera
# and for with weblogic infra 12.2.1, use this post_classpath
wls_setting_instances:
'default':
user: 'oracle'
weblogic_home_dir: '/opt/oracle/middleware12c/wlserver'
connect_url: "t3://10.10.10.21:7001"
weblogic_user: 'weblogic'
weblogic_password: 'weblogic1'
post_classpath: '/opt/oracle/middleware12c/oracle_common/modules/internal/features/jrf_wlsFmw_oracle.jrf.wlst.jar'
# and for with weblogic infra 12.1.3, use this post_classpath
wls_setting_instances:
'default':
user: 'oracle'
weblogic_home_dir: '/opt/oracle/middleware12c/wlserver'
connect_url: "t3://10.10.10.21:7001"
weblogic_user: 'weblogic'
weblogic_password: 'weblogic1'
post_classpath: '/opt/oracle/middleware12c/oracle_common/modules/internal/features/jrf_wlsFmw_oracle.jrf.wlst_12.1.3.jar'
wls_setting_instances:
'default':
user: *wls_os_user
weblogic_home_dir: *wls_weblogic_home_dir
connect_url: "t3s://%{hiera('domain_adminserver_address')}:7002"
weblogic_user: *wls_weblogic_user
weblogic_password: *domain_wls_password
custom_trust: *wls_custom_trust
trust_keystore_file: *wls_trust_keystore_file
trust_keystore_passphrase: *wls_trust_keystore_passphrase
require: Orawls::Domain[Wls1213]
debug_module: true
archive_path: '/var/tmp/install/default_domain'
'plain':
user: *wls_os_user
weblogic_home_dir: *wls_weblogic_home_dir
connect_url: "t3://%{hiera('domain_adminserver_address')}:7101"
weblogic_user: *wls_weblogic_user
weblogic_password: *domain_wls_password
require: Orawls::Domain[plain_Wls]
debug_module: false
With t3s and custom trust
wls_setting_instances:
'default':
user: oracle'
weblogic_home_dir: '/opt/oracle/middleware12c/wlserver'
connect_url: "t3s://10.10.10.21:7002"
weblogic_user: 'weblogic'
weblogic_password: 'weblogic1'
custom_trust: true
trust_keystore_file: '/vagrant/truststore.jks'
trust_keystore_passphrase: 'welcome'
'plain':
user: oracle'
weblogic_home_dir: '/opt/oracle/middleware12c/wlserver'
connect_url: "t3://10.10.10.21:7101"
weblogic_user: 'weblogic'
weblogic_password: 'weblogic1'
### wls_domain
it needs wls_setting and when identifier is not provided it will use the 'default'. Probably after changing the domain you need to restart the AdminServer or subscribe for a restart to this change with the wls_adminserver type
or use puppet resource wls_domain
# In this case it will use default as wls_setting identifier
wls_domain { 'Wls1036':
ensure => 'present',
jmx_platform_mbean_server_enabled => '1',
jmx_platform_mbean_server_used => '1',
jpa_default_provider => 'org.eclipse.persistence.jpa.PersistenceProvider',
jta_max_transactions => '20000',
jta_transaction_timeout => '35',
log_file_min_size => '5000',
log_filecount => '10',
log_filename => '/var/log/weblogic/Wls1036.log',
log_number_of_files_limited => '1',
log_rotate_logon_startup => '1',
log_rotationtype => 'bySize',
security_crossdomain => '0',
web_app_container_show_archived_real_path_enabled => '1',
}
wls_domain { 'Wls11gSetting/Wls11g':
ensure => 'present',
jmx_platform_mbean_server_enabled => '0',
jmx_platform_mbean_server_used => '1',
jpa_default_provider => 'org.apache.openjpa.persistence.PersistenceProviderImpl',
jta_max_transactions => '10000',
jta_transaction_timeout => '30',
log_file_min_size => '5000',
log_filecount => '5',
log_filename => '/var/log/weblogic/Wls11g.log',
log_number_of_files_limited => '0',
log_rotate_logon_startup => '0',
log_rotationtype => 'byTime',
security_crossdomain => '1',
web_app_container_show_archived_real_path_enabled => '0',
}
in hiera
require userconfig
$default_params = {}
$wls_domain_instances = hiera('wls_domain_instances', {})
create_resources('wls_domain',$wls_domain_instances, $default_params)
# 'Wls1036' will use default as wls_setting identifier
# 'Wls11g' will use domain2 as wls_setting identifier
wls_domain_instances:
'Wls1036':
ensure: 'present'
jpa_default_provider: 'org.eclipse.persistence.jpa.PersistenceProvider'
jta_max_transactions: '20000'
jta_transaction_timeout: '35'
log_file_min_size: '5000'
log_filecount: '5'
log_filename: '/var/log/weblogic/Wls1036.log'
log_number_of_files_limited: '1'
log_rotate_logon_startup: '1'
log_rotationtype: 'bySize'
security_crossdomain: '0'
'domain2/Wls11g':
ensure: 'present'
jpa_default_provider: 'org.apache.openjpa.persistence.PersistenceProviderImpl'
jta_max_transactions: '10000'
jta_transaction_timeout: '30'
log_file_min_size: '5000'
log_filecount: '10'
log_filename: '/var/log/weblogic/Wls11g.log'
log_number_of_files_limited: '0'
log_rotate_logon_startup: '0'
log_rotationtype: 'byTime'
security_crossdomain: '1'
### wls_adminserver
type for adminserver control like start, running, abort and stop.
also supports subscribe with refreshonly
# for this type you won't need a wls_setting identifier
wls_adminserver{'AdminServer_Wls1036:':
ensure => 'running', #running|start|abort|stop
server_name => hiera('domain_adminserver'),
domain_name => hiera('domain_name'),
domain_path => "/opt/oracle/wlsdomains/domains/Wls1036",
os_user => hiera('wls_os_user'),
weblogic_home_dir => hiera('wls_weblogic_home_dir'),
weblogic_user => hiera('wls_weblogic_user'),
weblogic_password => hiera('domain_wls_password'),
jdk_home_dir => hiera('wls_jdk_home_dir'),
nodemanager_address => hiera('domain_adminserver_address'),
nodemanager_port => hiera('domain_nodemanager_port'),
jsse_enabled => false,
custom_trust => false,
}
with JSSE and custom trust
# for this type you won't need a wls_setting identifier
wls_adminserver{'AdminServer_Wls1036:':
ensure => 'running', #running|start|abort|stop
server_name => hiera('domain_adminserver'),
domain_name => hiera('domain_name'),
domain_path => "/opt/oracle/wlsdomains/domains/Wls1036",
os_user => hiera('wls_os_user'),
weblogic_home_dir => hiera('wls_weblogic_home_dir'),
weblogic_user => hiera('wls_weblogic_user'),
weblogic_password => hiera('domain_wls_password'),
jdk_home_dir => hiera('wls_jdk_home_dir'),
nodemanager_address => hiera('domain_adminserver_address'),
nodemanager_port => hiera('domain_nodemanager_port'),
jsse_enabled => hiera('wls_jsse_enabled'),
custom_trust => hiera('wls_custom_trust'),
trust_keystore_file => hiera('wls_trust_keystore_file'),
trust_keystore_passphrase => hiera('wls_trust_keystore_passphrase'),
}
subscribe to a wls_domain, wls_authenticaton_provider or wls_identity_asserter event
# for this type you won't need a wls_setting identifier
wls_adminserver{'AdminServer_Wls1036:':
ensure => 'running', #running|start|abort|stop
server_name => hiera('domain_adminserver'),
domain_name => hiera('domain_name'),
domain_path => "/opt/oracle/wlsdomains/domains/Wls1036",
os_user => hiera('wls_os_user'),
weblogic_home_dir => hiera('wls_weblogic_home_dir'),
weblogic_user => hiera('wls_weblogic_user'),
weblogic_password => hiera('domain_wls_password'),
jdk_home_dir => hiera('wls_jdk_home_dir'),
nodemanager_address => hiera('domain_adminserver_address'),
nodemanager_port => hiera('domain_nodemanager_port'),
jsse_enabled => hiera('wls_jsse_enabled'),
custom_trust => hiera('wls_custom_trust'),
trust_keystore_file => hiera('wls_trust_keystore_file'),
trust_keystore_passphrase => hiera('wls_trust_keystore_passphrase'),
refreshonly => true,
subscribe => Wls_domain['Wls1036'],
}
### wls_managedserver
type for managed server control like start, running, abort and stop a managed server or a cluster.
also supports subscribe with refreshonly
# for this type you won't need a wls_setting identifier
wls_managedserver{'JMSServer1_Wls1036:':
ensure => 'running', #running|start|abort|stop
target => 'Server', #Server|Cluster
server_name => 'JMSServer1',
domain_name => hiera('domain_name'),
os_user => hiera('wls_os_user'),
weblogic_home_dir => hiera('wls_weblogic_home_dir'),
weblogic_user => hiera('wls_weblogic_user'),
weblogic_password => hiera('domain_wls_password'),
jdk_home_dir => hiera('wls_jdk_home_dir'),
adminserver_address => hiera('domain_adminserver_address'),
adminserver_port => hiera('domain_adminserver_port'),
}
subscribe to a wls_domain, wls_identity_asserter or wls_authenticaton_provider event
# for this type you won't need a wls_setting identifier
wls_managedserver{'JMSServer1_Wls1036':
ensure => 'running', #running|start|abort|stop
target => 'Server', #Server|Cluster
server_name => 'JMSServer1',
domain_name => hiera('domain_name'),
os_user => hiera('wls_os_user'),
weblogic_home_dir => hiera('wls_weblogic_home_dir'),
weblogic_user => hiera('wls_weblogic_user'),
weblogic_password => hiera('domain_wls_password'),
jdk_home_dir => hiera('wls_jdk_home_dir'),
adminserver_address => hiera('domain_adminserver_address'),
adminserver_port => hiera('domain_adminserver_port'),
refreshonly => true,
subscribe => Wls_domain['Wls1036'],
}
### wls_deployment
it needs wls_setting and when identifier is not provided it will use the 'default'.
or use puppet resource wls_deployment
# 'jersey-bundle' will use default as wls_setting identifier
wls_deployment { 'jersey-bundle':
ensure => 'present',
deploymenttype => 'Library',
stagingmode => 'nostage',
remote => "1",
upload => "1",
target => ['AdminServer', 'WebCluster'],
targettype => ['Server', 'Cluster'],
versionidentifier => '1.18@1.18.0.0',
}
wls_deployment { 'webapp':
ensure => 'present',
deploymenttype => 'AppDeployment',
stagingmode => 'nostage',
remote => "1",
upload => "1",
target => ['WebCluster'],
targettype => ['Cluster'],
versionidentifier => '1.1@1.1.0.0',
require => Wls_deployment['jersey-bundle']
}
in hiera
$default_params = {}
$deployment_instances = hiera('deployment_instances', $default_params)
create_resources('wls_deployment',$deployment_instances, $default_params)
deployment_instances:
'jersey-bundle':
ensure: 'present'
deploymenttype: 'Library'
versionidentifier: '1.18@1.18.0.0'
timeout: 60
stagingmode: "nostage"
remote: "1"
upload: "1"
target:
- 'AdminServer'
- 'WebCluster'
targettype:
- 'Server'
- 'Cluster'
localpath: '/vagrant/jersey-bundle-1.18.war'
require:
- Wls_cluster[WebCluster]
'webapp':
ensure: 'present'
deploymenttype: 'AppDeployment'
versionidentifier: '1.1@1.1.0.0'
timeout: 60
stagingmode: "nostage"
remote: "1"
upload: "1"
target:
- 'WebCluster'
targettype:
- 'Cluster'
localpath: '/vagrant/webapp.war'
require:
- Wls_deployment[jersey-bundle]
- Wls_cluster[WebCluster]
### wls_user
it needs wls_setting and when identifier is not provided it will use the 'default'.
or use puppet resource wls_user
# this will use default as wls_setting identifier
wls_user { 'OracleSystemUser':
ensure => 'present',
authenticationprovider => 'DefaultAuthenticator',
description => 'Oracle application software system user.',
realm => 'myrealm',
}
# this will use default as wls_setting identifier
wls_user { 'default/testuser1':
ensure => 'present',
authenticationprovider => 'DefaultAuthenticator',
description => 'testuser1',
realm => 'myrealm',
}
# this will use domain2 as wls_setting identifier
wls_user { 'domain2/testuser1':
ensure => 'present',
authenticationprovider => 'DefaultAuthenticator',
description => 'testuser1',
realm => 'myrealm',
}
in hiera
$default_params = {}
$user_instances = hiera('user_instances', {})
create_resources('wls_user',$user_instances, $default_params)
# testuser1 will use default as wls_setting identifier
# testuser2 will use domain2 as wls_setting identifier
user_instances:
'testuser1':
ensure: 'present'
password: 'weblogic1'
authenticationprovider: 'DefaultAuthenticator'
realm: 'myrealm'
description: 'my test user'
'domain2/testuser2':
ensure: 'present'
password: 'weblogic1'
authenticationprovider: 'DefaultAuthenticator'
realm: 'myrealm'
description: 'my test user'
### wls_group
it needs wls_setting and when identifier is not provided it will use the 'default'.
or use puppet resource wls_group
# this will use default as wls_setting identifier
wls_group { 'SuperUsers':
ensure => 'present',
authenticationprovider => 'DefaultAuthenticator',
description => 'SuperUsers',
realm => 'myrealm',
users => ['testuser2'],
}
# this will use default as wls_setting identifier
wls_group { 'TestGroup':
ensure => 'present',
authenticationprovider => 'DefaultAuthenticator',
description => 'TestGroup',
realm => 'myrealm',
users => ['testuser1','testuser2'],
}
in hiera
$default_params = {}
$group_instances = hiera('group_instances', {})
create_resources('wls_group',$group_instances, $default_params)
# this will use default as wls_setting identifier
group_instances:
'TestGroup':
ensure: 'present'
authenticationprovider: 'DefaultAuthenticator'
description: 'TestGroup'
realm: 'myrealm'
users:
- 'testuser1'
- 'testuser2'
'SuperUsers':
ensure: 'present'
authenticationprovider: 'DefaultAuthenticator'
description: 'SuperUsers'
realm: 'myrealm'
users:
- 'testuser2'
### wls_authentication_provider
it needs wls_setting and when identifier is not provided it will use the 'default' and probably after the creation the AdminServer needs a reboot or subscribe to a restart with the wls_adminserver type
only control_flag is a property, the rest are parameters and only used in a create action
Optionally, providers can be ordered by providing a value to the order paramater, which is a zero-based list. When configuring ordering order, it may be necessary to create the resources with Puppet ordering (if not using Hiera) or by structuring Hiera in matching order. Otherwise ordering may fail if not all authentication providers are created yet (by default the provider will be ordered last if it is greater than the number of providers currently configured).
To manage Weblogic's DefaultIdentityAsserter use the wls_identity_asserter type.
or use puppet resource wls_authentication_provider
# this will use default as wls_setting identifier
wls_authentication_provider { 'DefaultAuthenticator':
ensure => 'present',
control_flag => 'SUFFICIENT',
}
# this provider will be ordered first in the providers list
wls_authentication_provider { 'ldap':
ensure => 'present',
control_flag => 'SUFFICIENT',
providerclassname => 'weblogic.security.providers.authentication.LDAPAuthenticator',
attributes: => 'Principal;Host;Port;CacheTTL;CacheSize;MaxGroupMembershipSearchLevel;SSLEnabled',
attributesvalues => 'ldapuser;ldapserver;389;60;1024;4;1',
order => '0'
}
in hiera
$default_params = {}
$authentication_provider_instances = hiera('authentication_provider_instances', {})
create_resources('wls_authentication_provider',$authentication_provider_instances, $default_params)
# this will use default as wls_setting identifier
authentication_provider_instances:
'DefaultAuthenticator':
ensure: 'present'
control_flag: 'SUFFICIENT'
#ldap will be the first listed provider
'ldap':
ensure: 'present'
control_flag: 'SUFFICIENT'
providerclassname: 'weblogic.security.providers.authentication.LDAPAuthenticator'
attributes: 'Principal;Host;Port;CacheTTL;CacheSize;MaxGroupMembershipSearchLevel;SSLEnabled'
attributesvalues: 'ldapuser;ldapserver;389;60;1024;4;1'
order: '0'
'IdmsAuthenticator':
ensure: 'present'
control_flag: 'SUFFICIENT'
providerclassname: 'nl.rsg.security.idms.providers.authentication.IdmsAuthenticator'
attributes: 'Endpoint;RequestTimeout;ConnectTimeout'
attributesvalues: 'http://xxxx.com/MSL/4/AccountService;60000;5000'
order: '0'
'ActiveDirectoryAuthenticator':
ensure: 'present'
control_flag: 'SUFFICIENT'
providerclassname: 'weblogic.security.providers.authentication.ActiveDirectoryAuthenticator'
attributes: 'Credential;GroupBaseDN;GroupFromNameFilter;GroupMembershipSearching;Host;MaxGroupMembershipSearchLevel;Principal;UserBaseDN;UserFromNameFilter;UserNameAttribute;Port'
attributesvalues: 'password;DC=ad,DC=company,DC=org;(&(sAMAccountName=%g)(objectclass=group));limited;ad.company.org;0;CN=SER_WASadmin,OU=Service Accounts,DC=ad,DC=company,DC=org;DC=ad,DC=company,DC=org;(&(sAMAccountName=%u)(objectclass=user));sAMAccountName;389'
order: '1'
### wls_identity_asserter
it needs wls_setting and when identifier is not provided it will use the 'default' and probably after the creation the AdminServer needs a reboot or subscribe to a restart with the wls_adminserver type
to provide a list of token types to create provide a "::" seperated list for attribute 'ActiveTypes'
Optionally, the provider can be ordered by specifying a value to the order paramater, which is a zero-based list. When configuring ordering order, it may be necessary to create the resources with Puppet ordering (if not using Hiera) or by structuring Hiera in matching order. Otherwise ordering may fail if not all authentication providers are created yet (by default the provider will be ordered last if it is greater than the number of providers currently configured).
or use puppet resource wls_identity_asserter
wls_authentication_provider { 'DefaultIdentityAsserter':
ensure => 'present',
providerclassname => 'weblogic.security.providers.authentication.DefaultIdentityAsserter',
attributes: => 'DigestReplayDetectionEnabled;UseDefaultUserNameMapper',
attributesvalues => '1;1;',
activetypes => 'AuthenticatedUser::X.509',
defaultmappertype => 'CN',
}
in hiera
$default_params = {}
$identity_asserter_instances = hiera('identity_asserter_instances', {})
create_resources('wls_identity_asserter',$identity_asserter_instances, $default_params)
identity_asserter_instances:
'DefaultIdentityAsserter':
order: '3'
ensure: 'present'
providerclassname: 'weblogic.security.providers.authentication.DefaultIdentityAsserter'
attributes: 'DigestReplayDetectionEnabled;UseDefaultUserNameMapper'
attributesvalues: '1;1'
activetypes: 'AuthenticatedUser::X.509'
defaultmappertype: 'CN'
### wls_machine
it needs wls_setting and when identifier is not provided it will use the 'default'.
or use puppet resource wls_machine
# this will use default as wls_setting identifier
wls_machine { 'test2':
ensure => 'present',
listenaddress => '10.10.10.10',
listenport => '5556',
machinetype => 'UnixMachine',
nmtype => 'SSL',
}
# this will use domain2 as wls_setting identifier
wls_machine { 'domain2/test2':
ensure => 'present',
listenaddress => '10.10.10.10',
listenport => '5556',
machinetype => 'UnixMachine',
nmtype => 'SSL',
}
in hiera
# Node1 will use default as wls_setting identifier
# Node2 will use domain2 as wls_setting identifier
machines_instances:
'Node1':
ensure: 'present'
listenaddress: '10.10.10.100'
listenport: '5556'
machinetype: 'UnixMachine'
nmtype: 'SSL'
'domain2/Node2':
ensure: 'present'
listenaddress: '10.10.10.200'
listenport: '5556'
machinetype: 'UnixMachine'
nmtype: 'SSL'
### wls_server
it needs wls_setting and when identifier is not provided it will use the 'default'.
or use puppet resource wls_server
# this will use default as wls_setting identifier
wls_server { 'wlsServer1':
ensure => 'present',
arguments => '-XX:PermSize=256m -XX:MaxPermSize=256m -Xms752m -Xmx752m -Dweblogic.Stdout=/var/log/weblogic/wlsServer1.out -Dweblogic.Stderr=/var/log/weblogic/wlsServer1_err.out',
jsseenabled => '0',
listenaddress => '10.10.10.100',
listenport => '8001',
listenportenabled => '1',
machine => 'Node1',
sslenabled => '0',
tunnelingenabled => '0',
max_message_size => '10000000',
}
or with log parameters, default file store and ssl
# this will use default as wls_setting identifier
wls_server { 'default/wlsServer2':
ensure => 'present',
arguments => '-XX:PermSize=256m -XX:MaxPermSize=256m -Xms752m -Xmx752m -Dweblogic.Stdout=/var/log/weblogic/wlsServer2.out -Dweblogic.Stderr=/var/log/weblogic/wlsServer2_err.out',
jsseenabled => '0',
listenaddress => '10.10.10.200',
listenport => '8001',
listenportenabled => '1',
log_file_min_size => '2000',
log_filecount => '10',
log_number_of_files_limited => '1',
log_rotate_logon_startup => '1',
log_rotationtype => 'bySize',
logfilename => '/var/log/weblogic/wlsServer2.log',
log_datasource_filename => 'logs/datasource.log',
log_http_filename => 'logs/access.log',
log_http_format => 'date time cs-method cs-uri sc-status',
log_http_format_type => 'common',
log_http_file_count => '10',
log_http_number_of_files_limited => '0',
log_redirect_stderr_to_server => '0',
log_redirect_stdout_to_server => '0',
logintimeout => '5000',
restart_max => '2',
machine => 'Node2',
sslenabled => '1',
sslhostnameverificationignored => '1',
ssllistenport => '8201',
two_way_ssl => '0',
client_certificate_enforced => '0',
default_file_store => '/path/to/default_file_store/',
max_message_size => '25000000',
weblogic_plugin_enabled => '1',
}
If you want automatic restart when the server crashes, or automatically kill when the server hangs
# this will use default as wls_setting identifier
wls_server { 'wlsServer1':
ensure => 'present',
arguments => '-XX:PermSize=256m -XX:MaxPermSize=256m -Xms752m -Xmx752m -Dweblogic.Stdout=/var/log/weblogic/wlsServer1.out -Dweblogic.Stderr=/var/log/weblogic/wlsServer1_err.out',
jsseenabled => '0',
listenaddress => '10.10.10.100',
listenport => '8001',
listenportenabled => '1',
machine => 'Node1',
sslenabled => '0',
tunnelingenabled => '0',
max_message_size => '10000000',
auto_restart => '1',
autokillwfail => '1',
}
or with JSSE with custom identity and trust
# this will use domain2 as wls_setting identifier
wls_server { 'domain2/wlsServer2':
ensure => 'present',
arguments => '-XX:PermSize=256m -XX:MaxPermSize=256m -Xms752m -Xmx752m -Dweblogic.Stdout=/var/log/weblogic/wlsServer2.out -Dweblogic.Stderr=/var/log/weblogic/wlsServer2_err.out',
listenaddress => '10.10.10.200',
listenport => '8001',
listenportenabled => '1',
log_file_min_size => '2000',
log_filecount => '10',
log_number_of_files_limited => '1',
log_rotate_logon_startup => '1',
log_rotationtype => 'bySize',
logfilename => '/var/log/weblogic/wlsServer2.log',
machine => 'Node2',
sslenabled => '1',
sslhostnameverifier => 'None',
sslhostnameverificationignored => '1',
ssllistenport => '8201',
two_way_ssl => '0'
client_certificate_enforced => '0'
jsseenabled => '1',
custom_identity => '1',
custom_identity_alias => 'node2',
custom_identity_keystore_filename => '/vagrant/identity_node2.jks',
custom_identity_keystore_passphrase => 'welcome',
custom_identity_privatekey_passphrase => 'welcome',
trust_keystore_file => '/vagrant/truststore.jks',
trust_keystore_passphrase => 'welcome',
max_message_size => '25000000',
}
in hiera
# this will use default as wls_setting identifier
server_instances:
'wlsServer1':
ensure: 'present'
arguments: '-XX:PermSize=256m -XX:MaxPermSize=256m -Xms752m -Xmx752m -Dweblogic.Stdout=/data/logs/wlsServer1.out -Dweblogic.Stderr=/data/logs/wlsServer1_err.out'
listenaddress: '10.10.10.100'
listenport: '8001'
listenportenabled: '1'
logfilename: '/data/logs/wlsServer1.log'
machine: 'Node1'
sslenabled: '1'
jsseenabled: '0'
ssllistenport: '8201'
sslhostnameverificationignored: '1'
two_way_ssl: '0'
client_certificate_enforced: '0'
or with log parameters
# this will use default as wls_setting identifier
server_instances:
'wlsServer1':
ensure: 'present'
arguments: '-XX:PermSize=256m -XX:MaxPermSize=256m -Xms752m -Xmx752m -Dweblogic.Stdout=/data/logs/wlsServer1.out -Dweblogic.Stderr=/data/logs/wlsServer1_err.out'
listenaddress: '10.10.10.100'
listenport: '8001'
listenportenabled: '1'
logfilename: '/var/log/weblogic/wlsServer1.log'
log_file_min_size: '2000'
log_filecount: '10'
log_number_of_files_limited: '1'
log_rotate_logon_startup: '1'
log_rotationtype: 'bySize'
log_datasource_filename: 'logs/datasource.log'
log_http_filename: 'logs/access.log'
log_http_file_count: '10'
log_http_number_of_files_limited: '0'
log_redirect_stderr_to_server: '0'
log_redirect_stdout_to_server: '0'
logintimeout: '5000'
restart_max: '2'
machine: 'Node1'
sslenabled: '1'
ssllistenport: '8201'
sslhostnameverificationignored: '1'
jsseenabled: '1'
default_file_store: '/path/to/default_file_store/'
max_message_size: '25000000'
You can also pass server arguments as an array, as it makes it easier to use references in YAML.
server_vm_args_permsize: &server_vm_args_permsize '-XX:PermSize=256m'
server_vm_args_max_permsize: &server_vm_args_max_permsize '-XX:MaxPermSize=256m'
server_vm_args_memory: &server_vm_args_memory '-Xms752m'
server_vm_args_max_memory: &server_vm_args_max_memory '-Xmx752m'
# this will use default as wls_setting identifier
server_instances:
'wlsServer1':
ensure: 'present'
arguments:
- *server_vm_args_permsize
- *server_vm_args_max_permsize
- *server_vm_args_memory
- *server_vm_args_max_memory
- '-Dweblogic.Stdout=/var/log/weblogic/wlsServer1.out'
- '-Dweblogic.Stderr=/var/log/weblogic/wlsServer1_err.out'
listenaddress: '10.10.10.100'
listenport: '8001'
logfilename: '/var/log/weblogic/wlsServer1.log'
machine: 'Node1'
sslenabled: '1'
ssllistenport: '8201'
sslhostnameverificationignored: '1'
jsseenabled: '1'
'wlsServer2':
ensure: 'present'
arguments:
- *server_vm_args_permsize
- *server_vm_args_max_permsize
- *server_vm_args_memory
- *server_vm_args_max_memory
- '-Dweblogic.Stdout=/var/log/weblogic/wlsServer2.out'
- '-Dweblogic.Stderr=/var/log/weblogic/wlsServer2_err.out'
listenport: '8001'
logfilename: '/var/log/weblogic/wlsServer2.log'
machine: 'Node2'
sslenabled: '1'
ssllistenport: '8201'
sslhostnameverificationignored: '1'
listenaddress: '10.10.10.200'
jsseenabled: '1'
or with custom identity and custom truststore
# used by nodemanager, control and domain creation
wls_custom_trust: &wls_custom_trust true
wls_trust_keystore_file: &wls_trust_keystore_file '/vagrant/truststore.jks'
wls_trust_keystore_passphrase: &wls_trust_keystore_passphrase 'welcome'
# this will use default as wls_setting identifier
server_instances:
'wlsServer1':
ensure: 'present'
arguments: '-XX:PermSize=256m -XX:MaxPermSize=256m -Xms752m -Xmx752m -Dweblogic.Stdout=/var/log/weblogic/wlsServer1.out -Dweblogic.Stderr=/var/log/weblogic/wlsServer1_err.out'
listenaddress: '10.10.10.100'
listenport: '8001'
logfilename: '/var/log/weblogic/wlsServer1.log'
machine: 'Node1'
sslenabled: '1'
ssllistenport: '8201'
sslhostnameverificationignored: '1'
sslhostnameverifier: 'None'
useservercerts: '0'
jsseenabled: '1'
custom_identity: '1'
custom_identity_keystore_filename: '/vagrant/identity_node1.jks'
custom_identity_keystore_passphrase: 'welcome'
custom_identity_alias: 'node1'
custom_identity_privatekey_passphrase: 'welcome'
trust_keystore_file: *wls_trust_keystore_file
trust_keystore_passphrase: *wls_trust_keystore_passphrase
### wls_server_channel
it needs wls_setting and when identifier is not provided it will use the 'default', the title must also contain the server name
or use puppet resource wls_server_channel
# this will use default as wls_setting identifier
wls_server_channel { 'default/wlsServer1:Channel-Cluster':
ensure => 'present',
channel_identity_customized => '0',
client_certificate_enforced => '0',
custom_identity_alias => 'node1',
enabled => '1',
httpenabled => '1',
listenaddress => '10.10.10.100',
listenport => '8003',
max_message_size => '25000000',
outboundenabled => '0',
protocol => 'cluster-broadcast',
publicaddress => '10.10.10.100',
publicport => '8003',
tunnelingenabled => '0',
two_way_ssl => '0',
}
wls_server_channel { 'default/wlsServer1:HTTP':
ensure => 'present',
channel_identity_customized => '0',
client_certificate_enforced => '0',
custom_identity_alias => 'node1',
enabled => '1',
httpenabled => '1',
listenport => '8004',
max_message_size => '35000000',
outboundenabled => '0',
protocol => 'http',
publicport => '8104',
tunnelingenabled => '0',
two_way_ssl => '0',
}
wls_server_channel { 'default/wlsServer2:Channel-Cluster':
ensure => 'present',
channel_identity_customized => '0',
client_certificate_enforced => '0',
custom_identity_alias => 'node2',
enabled => '1',
httpenabled => '1',
listenaddress => '10.10.10.200',
listenport => '8003',
max_message_size => '25000000',
outboundenabled => '0',
protocol => 'cluster-broadcast',
publicaddress => '10.10.10.200',
publicport => '8003',
tunnelingenabled => '0',
two_way_ssl => '0',
}
wls_server_channel { 'default/wlsServer2:HTTP':
ensure => 'present',
channel_identity_customized => '0',
client_certificate_enforced => '0',
custom_identity_alias => 'node2',
enabled => '1',
httpenabled => '1',
listenport => '8004',
max_message_size => '35000000',
outboundenabled => '0',
protocol => 'http',
publicport => '8104',
tunnelingenabled => '0',
two_way_ssl => '0',
}
in hiera
# this will use default as wls_setting identifier
server_channel_instances:
'wlsServer1:Channel-Cluster':
ensure: 'present'
enabled: '1'
httpenabled: '1'
listenaddress: *domain_node1_address
listenport: '8003'
outboundenabled: '0'
protocol: 'cluster-broadcast'
publicaddress: *domain_node1_address
tunnelingenabled: '0'
# require:
# - Wls_server[wlsServer1]
'wlsServer2:Channel-Cluster':
ensure: 'present'
enabled: '1'
httpenabled: '1'
listenaddress: *domain_node2_address
listenport: '8003'
outboundenabled: '0'
protocol: 'cluster-broadcast'
publicaddress: *domain_node2_address
tunnelingenabled: '0'
# require:
# - Wls_server[wlsServer2]
'wlsServer1:HTTP':
ensure: 'present'
enabled: '1'
httpenabled: '1'
listenport: '8004'
publicport: '8104'
outboundenabled: '0'
protocol: 'http'
tunnelingenabled: '0'
max_message_size: '35000000'
# require:
# - Wls_server[wlsServer1]
'wlsServer2:HTTP':
ensure: 'present'
enabled: '1'
httpenabled: '1'
listenport: '8004'
publicport: '8104'
outboundenabled: '0'
protocol: 'http'
tunnelingenabled: '0'
max_message_size: '35000000'
# require:
# - Wls_server[wlsServer2]
### wls_server_tlog
it needs wls_setting and when identifier is not provided it will use the 'default', the title must also contain the server name
or use puppet resource wls_server_tlog
For this you need to configure a non transactional datasource
in hiera
datasource_instances:
'tlogDS':
ensure: 'present'
drivername: 'oracle.jdbc.OracleDriver'
globaltransactionsprotocol: 'None'
initialcapacity: '2'
jndinames:
- 'jdbc/tlogDS'
maxcapacity: '15'
target:
- 'WebServer1'
- 'JmsWlsServer1'
targettype:
- 'Server'
- 'Server'
testtablename: 'SQL SELECT 1 FROM DUAL'
url: "jdbc:oracle:thin:@wlsdb.example.com:1521/wlsrepos.example.com"
user: 'tlog'
password: 'tlog'
usexa: '1'
server_tlog_instances:
'JmsWlsServer1':
ensure: 'present'
tlog_enabled: 'true'
tlog_datasource: 'tlogDS'
tlog_datasource_prefix: 'TLOG_JmsWlsServer1_'
'WebServer1':
ensure: 'present'
tlog_enabled: 'true'
tlog_datasource: 'tlogDS'
tlog_datasource_prefix: 'TLOG_WebServer1_'
Or as manifest
wls_server_tlog { 'default/JmsWlsServer1':
ensure => 'present',
tlog_datasource => 'tlogDS',
tlog_datasource_prefix => 'TLOG_JmsWlsServer1_',
tlog_enabled => 'true',
}
wls_server_tlog { 'default/WebServer1':
ensure => 'present',
tlog_datasource => 'tlogDS',
tlog_datasource_prefix => 'TLOG_WebServer1_',
tlog_enabled => 'true',
}
### wls_cluster
it needs wls_setting and when identifier is not provided it will use the 'default'.
or use puppet resource wls_cluster
# this will use default as wls_setting identifier
wls_cluster { 'WebCluster':
ensure => 'present',
messagingmode => 'unicast',
migrationbasis => 'consensus',
servers => ['wlsServer3','wlsServer4'],
multicastaddress => '239.192.0.0',
multicastport => '7001',
}
# this will use default as wls_setting identifier
wls_cluster { 'WebCluster2':
ensure => 'present',
messagingmode => 'unicast',
migrationbasis => 'consensus',
servers => ['wlsServer3','wlsServer4'],
unicastbroadcastchannel => 'channel',
multicastaddress => '239.192.0.0',
multicastport => '7001',
frontendhost => '10.10.10.10'
frontendhttpport => '1001'
frontendhttpsport => '1002'
}
in hiera
# this will use default as wls_setting identifier
cluster_instances:
'WebCluster':
ensure: 'present'
messagingmode: 'unicast'
migrationbasis: 'consensus'
servers:
- 'wlsServer1'
- 'wlsServer2'
### wls_migratable_target
it needs wls_setting and when identifier is not provided it will use the 'default'.
or use puppet resource wls_migratable_target
wls_migratable_target { 'wlsServer1 (migratable)':
ensure => 'present',
cluster => 'WebCluster',
migration_policy => 'manual',
number_of_restart_attempts => '6',
seconds_between_restarts => '30',
user_preferred_server => 'wlsServer1',
}
wls_migratable_target { 'wlsServer2 (migratable)':
ensure => 'present',
cluster => 'WebCluster',
migration_policy => 'manual',
number_of_restart_attempts => '6',
seconds_between_restarts => '30',
user_preferred_server => 'wlsServer2',
}
wls_migratable_target { 'Wls11gSetting/wlsServer1 (migratable)':
ensure => 'present',
cluster => 'WebCluster',
migration_policy => 'manual',
number_of_restart_attempts => '6',
seconds_between_restarts => '30',
user_preferred_server => 'wlsServer1',
}
wls_migratable_target { 'Wls11gSetting/wlsServer2 (migratable)':
ensure => 'present',
cluster => 'WebCluster',
migration_policy => 'manual',
number_of_restart_attempts => '6',
seconds_between_restarts => '30',
user_preferred_server => 'wlsServer2',
}
or in hiera
migratable_target_instances:
'wlsServer1 (migratable)':
ensure: 'present'
cluster: 'WebCluster'
migration_policy: 'manual'
number_of_restart_attempts: '6'
seconds_between_restarts: '30'
user_preferred_server: 'wlsServer1'
require:
- Wls_cluster[WebCluster]
'wlsServer2 (migratable)':
ensure: 'present'
cluster: 'WebCluster'
migration_policy: 'manual'
number_of_restart_attempts: '6'
seconds_between_restarts: '30'
user_preferred_server: 'wlsServer2'
require:
- Wls_cluster[WebCluster]
### wls_singleton_service
it needs wls_setting and when identifier is not provided it will use the 'default'.
or use puppet resource wls_singleton_service
# this will use default as wls_setting identifier
wls_singleton_service { 'SingletonService':
ensure => 'present',
cluster => 'ClusterName',
user_preferred_server => 'PreferredServerName',
class_name => 'com.example.package.SingletonServiceImpl',
constrained_candidate_servers => ['PreferredServerName', 'OtherServerName'],
additional_migration_attempts => 2,
millis_to_sleep_between_attempts => 300000,
notes => 'This is a singleton service that prefers to run on PreferredServerName, but can be migrated to OtherServerName.',
}
in hiera
# this will use default as wls_setting identifier
singleton_service_instances:
'SingletonService':
ensure: 'present'
cluster: 'ClusterName'
user_preferred_server: 'PreferredServerName'
class_name: 'com.example.package.SingletonServiceImpl'
constrained_candidate_servers:
- 'PreferredServerName'
- 'OtherServerName'
additional_migration_attempts: 2
millis_to_sleep_between_attempts: 300000
notes: 'This is a singleton service that prefers to run on PreferredServerName, but can be migrated to OtherServerName.'
### wls_coherence_cluster
it needs wls_setting and when identifier is not provided it will use the 'default'.
or use puppet resource wls_coherence_cluster
# this will use default as wls_setting identifier
wls_coherence_cluster { 'WebCoherenceCluster':
ensure => 'present',
clusteringmode => 'unicast',
multicastport => '33389',
target => ['WebCluster'],
targettype => ['Cluster'],
unicastport => '9999',
storage_enabled => '1',
}
wls_coherence_cluster { 'defaultCoherenceCluster':
ensure => 'present',
clusteringmode => 'unicast',
multicastport => '33387',
unicastport => '8888',
}
in hiera
$default_params = {}
$coherence_cluster_instances = hiera('coherence_cluster_instances', {})
create_resources('wls_coherence_cluster',$coherence_cluster_instances, $default_params)
coherence_cluster_instances:
'clusterCoherence':
ensure: 'present'
clusteringmode: 'unicast'
multicastaddress: '231.1.1.1'
multicastport: '33387'
target: ['DynamicCluster']
targettype: ['Cluster']
unicastport: '9099'
unicastaddress: '10.10.10.100,10.10.10.200'
storage_enabled: '1'
### wls_coherence_server
it needs wls_setting and when identifier is not provided it will use the 'default'.
or use puppet resource wls_coherence_server
# this will use default as wls_setting identifier
wls_coherence_server { 'default':
ensure => 'present',
server => 'LocalMachine',
unicastaddress => 'localhost',
unicastport => '8888',
}
### wls_server_template
it needs wls_setting and when identifier is not provided it will use the 'default'.
or use puppet resource wls_server_template
wls_server_template { 'default/ServerTemplateWeb':
ensure => 'present',
arguments => ['-XX:PermSize=256m','-XX:MaxPermSize=256m'],
listenport => '9101',
sslenabled => '1',
ssllistenport => '9102',
}
in hiera
$default_params = {}
$server_template_instances = hiera('server_template_instances', {})
create_resources('wls_server_template',$server_template_instances, $default_params)
server_vm_args_permsize: &server_vm_args_permsize '-XX:PermSize=256m'
server_vm_args_max_permsize: &server_vm_args_max_permsize '-XX:MaxPermSize=256m'
server_vm_args_memory: &server_vm_args_memory '-Xms752m'
server_vm_args_max_memory: &server_vm_args_max_memory '-Xmx752m'
server_template_instances:
'ServerTemplateWeb':
ensure: 'present'
arguments:
- *server_vm_args_permsize
- *server_vm_args_max_permsize
- *server_vm_args_memory
- *server_vm_args_max_memory
listenport: '9101'
sslenabled: '1'
ssllistenport: '9102'
### wls_dynamic_cluster
it needs wls_setting and when identifier is not provided it will use the 'default'.
or use puppet resource wls_dynamic_cluster
wls_dynamic_cluster { 'DynamicCluster':
ensure => 'present',
calculated_listen_port => '0', # '0' or '1'
maximum_server_count => '2',
nodemanager_match => 'Node1,Node2',
server_name_prefix => 'DynCluster-',
server_template_name => 'ServerTemplateWeb',
}
in hiera
$default_params = {}
$dynamic_cluster_instances = hiera('dynamic_cluster_instances', {})
create_resources('wls_dynamic_cluster',$dynamic_cluster_instances, $default_params)
dynamic_cluster_instances:
'DynamicCluster':
ensure: 'present'
calculated_listen_port: '0' # '0' or '1'
maximum_server_count: '2'
nodemanager_match: 'Node1,Node2'
server_name_prefix: 'DynCluster-'
server_template_name: 'ServerTemplateWeb'
### wls_virtual_host
it needs wls_setting and when identifier is not provided it will use the 'default'.
or use puppet resource wls_virtual_host
# this will use default as wls_setting identifier
wls_virtual_host { 'default/WS':
ensure => 'present',
channel => 'HTTP',
target => ['WebCluster'],
targettype => ['Cluster'],
virtual_host_names => ['admin.example.com','10.10.10.10'],
}
in hiera
# this will use default as wls_setting identifier
virtual_host_instances:
'WS':
ensure: 'present'
channel: 'HTTP'
target:
- 'WebCluster'
targettype:
- 'Cluster'
virtual_host_names:
- 'admin.example.com'
- '10.10.10.10'
### wls_workmanager_constaint
it needs wls_setting and when identifier is not provided it will use the 'default'.
or use puppet resource wls_workmanager_constaint
# this will use default as wls_setting identifier
wls_workmanager_constraint { 'CapacityConstraint':
ensure => 'present',
constrainttype => 'Capacity',
constraintvalue => '20',
target => ['WebCluster'],
targettype => ['Cluster'],
}
wls_workmanager_constraint { 'MaxThreadsConstraint':
ensure => 'present',
constrainttype => 'MaxThreadsConstraint',
constraintvalue => '5',
target => ['WebCluster'],
targettype => ['Cluster'],
}
wls_workmanager_constraint { 'MinThreadsConstraint':
ensure => 'present',
constrainttype => 'MinThreadsConstraint',
constraintvalue => '2',
target => ['WebCluster'],
targettype => ['Cluster'],
}
wls_workmanager_constraint { 'FairShareReqClass':
ensure => 'present',
constrainttype => 'FairShareRequestClasses',
constraintvalue => '50',
target => ['WebCluster'],
targettype => ['Cluster'],
}
in hiera
# this will use default as wls_setting identifier
workmanager_constraint_instances:
'CapacityConstraint':
ensure: 'present'
constraintvalue: '20'
target:
- 'WebCluster'
targettype:
- 'Cluster'
constrainttype: 'Capacity'
'MaxThreadsConstraint':
ensure: 'present'
constraintvalue: '5'
target:
- 'WebCluster'
targettype:
- 'Cluster'
constrainttype: 'MaxThreadsConstraint'
'MinThreadsConstraint':
ensure: 'present'
constraintvalue: '2'
target:
- 'WebCluster'
targettype:
- 'Cluster'
constrainttype: 'MinThreadsConstraint'
'FairShareReqClass':
ensure: 'present'
constrainttype: 'FairShareRequestClasses'
constraintvalue: '50'
target:
- 'WebCluster'
targettype:
- 'Cluster'
### wls_workmanager
it needs wls_setting and when identifier is not provided it will use the 'default'.
or use puppet resource wls_workmanager
# this will use default as wls_setting identifier
wls_workmanager { 'WorkManagerConstraints':
ensure => 'present',
capacity => 'CapacityConstraint',
maxthreadsconstraint => 'MaxThreadsConstraint',
minthreadsconstraint => 'MinThreadsConstraint',
fairsharerequestclass => 'FairShareReqClass',
stuckthreads => '0',
target => ['WebCluster'],
targettype => ['Cluster'],
}
in hiera
# this will use default as wls_setting identifier
workmanager_instances:
'WorkManagerConstraints':
ensure: 'present'
capacity: 'CapacityConstraint'
maxthreadsconstraint: 'MaxThreadsConstraint'
minthreadsconstraint: 'MinThreadsConstraint'
fairsharerequestclass: 'FairShareReqClass'
stuckthreads: '1'
target:
- 'WebCluster'
targettype:
- 'Cluster'
### wls_jdbc_persistence_store
it needs wls_setting and when identifier is not provided it will use the 'default'.
or use puppet resource wls_jdbc_persistence_store
wls_jdbc_persistence_store { 'JDBCStoreX':
ensure => 'present',
datasource => 'jmsDS',
prefix_name => 'dev_',
target => ['wlsServer1'],
targettype => ['Server'],
}
in hiera
file_jdbc_store_instances:
'JDBCStoreX':
ensure: 'present'
datasource: 'jmsDS'
prefix_name: 'dev_'
target: ['wlsServer1']
targettype: ['Server']
## wls_foreign_jndi_provider
it needs wls_setting and when identifier is not provided it will use the 'default'.
or use puppet resource wls_foreign_jndi_provider
wls_foreign_jndi_provider { 'DomainA':
ensure => 'present',
initial_context_factory => 'weblogic.jndi.WLInitialContextFactory',
provider_properties => ['bbb=aaaa', 'xxx=123'],
provider_url => 't3://10.10.10.100:7001',
target => ['WebCluster'],
targettype => ['Cluster'],
user => 'weblogic',
password => 'weblogic1',
}
wls_foreign_jndi_provider { 'default/LDAP':
ensure => 'present',
initial_context_factory => 'com.sun.jndi.ldap.LdapCtxFactory',
provider_properties => ['referral=follow'],
provider_url => 'ldap://:10.10.10.100:389',
target => ['AdminServer'],
targettype => ['Server'],
user => 'cn=orcladmin',
password => 'weblogic1',
}
in hiera
wls_foreign_jndi_provider_instances:
'DomainA':
ensure: 'present'
initial_context_factory: 'weblogic.jndi.WLInitialContextFactory'
provider_properties: ['bbb=aaaa', 'xxx=123']
provider_url: 't3://10.10.10.100:7001'
target: ['WebCluster']
targettype: ['Cluster']
user: 'weblogic'
password: 'weblogic1'
'LDAP':
ensure: 'present'
initial_context_factory: 'com.sun.jndi.ldap.LdapCtxFactory'
provider_properties: ['referral=follow']
provider_url: 'ldap://:10.10.10.100:389'
target: ['AdminServer']
targettype: ['Server']
user: 'cn=orcladmin'
password: 'weblogic1'
## wls_foreign_jndi_provider
_link
it needs wls_setting and when identifier is not provided it will use the 'default'.
or use puppet resource wls_foreign_jndi_provider
_link
wls_foreign_jndi_provider_link { 'default/DomainA:aaaa':
ensure => 'present',
local_jndi_name => 'aaaa',
remote_jndi_name => 'bbbb',
}
wls_foreign_jndi_provider_link { 'default/LDAP:aaaaa':
ensure => 'present',
local_jndi_name => 'aaaaa',
remote_jndi_name => 'bbbbb',
}
wls_foreign_jndi_provider_link { 'default/LDAP:ccccc':
ensure => 'present',
local_jndi_name => 'ccccc',
remote_jndi_name => 'ddddd',
}
in hiera
wls_foreign_jndi_provider_link_instances:
'DomainA:aaaa':
ensure: 'present'
local_jndi_name: 'aaaa'
remote_jndi_name: 'bbbb'
require:
- Wls_foreign_jndi_provider[DomainA]
'LDAP:aaaaa':
ensure: 'present'
local_jndi_name: 'aaaaa'
remote_jndi_name: 'bbbbb'
require:
- Wls_foreign_jndi_provider[LDAP]
'LDAP:ccccc':
ensure: 'present'
local_jndi_name: 'ccccc'
remote_jndi_name: 'ddddd'
require:
- Wls_foreign_jndi_provider[LDAP]
### wls_file_persistence_store
it needs wls_setting and when identifier is not provided it will use the 'default'.
or use puppet resource wls_file_persistence_store
# this will use default as wls_setting identifier
wls_file_persistence_store { 'jmsFile1':
ensure => 'present',
directory => 'persistence1',
target => ['wlsServer1'],
targettype => ['Server'],
}
# this will use default as wls_setting identifier
wls_file_persistence_store { 'jmsFile2':
ensure => 'present',
directory => 'persistence2',
target => ['wlsServer2'],
targettype => ['Server'],
}
# this will use default as wls_setting identifier
wls_file_persistence_store { 'jmsFileSAFAgent1':
ensure => 'present',
directory => 'persistenceSaf1',
target => ['wlsServer1'],
targettype => ['Server'],
}
in hiera
# this will use default as wls_setting identifier
file_persistence_store_instances:
'jmsFile1':
ensure: 'present'
directory: 'persistence1'
target:
- 'wlsServer1'
targettype:
- 'Server'
'jmsFile2':
ensure: 'present'
directory: 'persistence2'
target:
- 'wlsServer2'
targettype:
- 'Server'
'jmsFileSAFAgent1':
ensure: 'present'
directory: 'persistenceSaf1'
target:
- 'wlsServer1'
targettype:
- 'Server'
### wls_safagent
it needs wls_setting and when identifier is not provided it will use the 'default'.
or use puppet resource wls_safagent
# this will use default as wls_setting identifier
wls_safagent { 'jmsSAFAgent1':
ensure => 'present',
persistentstore => 'jmsFileSAFAgent1',
persistentstoretype => 'FileStore',
servicetype => 'Sending-only',
target => ['wlsServer1'],
targettype => ['Server'],
}
# this will use default as wls_setting identifier
wls_safagent { 'jmsSAFAgent2':
ensure => 'present',
servicetype => 'Both',
target => ['wlsServer2'],
targettype => ['Server'],
}
in hiera
# this will use default as wls_setting identifier
safagent_instances:
'jmsSAFAgent1':
ensure: 'present'
target:
- 'wlsServer1'
targettype:
- 'Server'
servicetype: 'Sending-only'
persistentstore: 'jmsFileSAFAgent1'
persistentstoretype: 'FileStore'
'jmsSAFAgent2':
ensure: 'present'
target:
- 'wlsServer2'
targettype:
- 'Server'
servicetype: 'Both'
### wls_datasource
it needs wls_setting and when identifier is not provided it will use the 'default'.
xaproperties are case sensitive and should be provided as an array containing all values. Use WLST and run ls() in the JDBCXAParams component of your datasource to determine the valid XA properties which can be set. Preserve the order to ensure idempotent behaviour.
or use puppet resource wls_datasource
# this will use default as wls_setting identifier, no XA properties
wls_datasource { 'hrDS':
ensure => 'present',
connectioncreationretryfrequency => '0',
drivername => 'oracle.jdbc.xa.client.OracleXADataSource',
extraproperties => ['SendStreamAsBlob=true', 'oracle.net.CONNECT_TIMEOUT=10001'],
fanenabled => '0',
globaltransactionsprotocol => 'TwoPhaseCommit',
initialcapacity => '2',
initsql => 'None',
jndinames => ['jdbc/hrDS', 'jdbc/hrDS2'],
maxcapacity => '15',
mincapacity => '1',
rowprefetchenabled => '0',
rowprefetchsize => '48',
secondstotrustidlepoolconnection => '10',
statementcachesize => '10',
target => ['wlsServer1', 'wlsServer2'],
targettype => ['Server', 'Server'],
testconnectionsonreserve => '0',
testfrequency => '120',
testtablename => 'SQL SELECT 1 FROM DUAL',
url => 'jdbc:oracle:thin:@dbagent2.alfa.local:1521/test.oracle.com',
user => 'hr',
usexa => '0',
}
# This will use XA Properties
wls_datasource { 'jmsDS':
ensure => 'present',
drivername => 'com.mysql.jdbc.Driver',
globaltransactionsprotocol => 'None',
initialcapacity => '1',
jndinames => ['jmsDS'],
maxcapacity => '15',
mincapacity => '1',
statementcachesize => '10',
testconnectionsonreserve => '0',
target => ['WebCluster'],
targettype => ['Cluster'],
testtablename => 'SQL SELECT 1',
url => 'jdbc:mysql://10.10.10.10:3306/jms',
user => 'jms',
password => 'pass',
usexa => '1',
xaproperties => ['RollbackLocalTxUponConnClose=0', 'RecoverOnlyOnce=0', 'KeepLogicalConnOpenOnRelease=0', 'KeepXaConnTillTxComplete=1', 'XaTransactionTimeout=14400', 'XaRetryIntervalSeconds=60', 'XaRetryDurationSeconds=0', 'ResourceHealthMonitoring=1', 'NewXaConnForCommit=0', 'XaSetTransactionTimeout=1', 'XaEndOnlyOnce=0', 'NeedTxCtxOnClose=0'],
# To Optionally Configure as Gridlink Datasource
fanenabled => '1',
onsnodelist => '10.10.10.110:6200,10.10.10.111:6200',
}
in hiera
# this will use default as wls_setting identifier
datasource_instances:
'hrDS':
ensure: 'present'
drivername: 'oracle.jdbc.xa.client.OracleXADataSource'
extraproperties:
- 'SendStreamAsBlob=true'
- 'oracle.net.CONNECT_TIMEOUT=1000'
globaltransactionsprotocol: 'TwoPhaseCommit'
initialcapacity: '1'
maxcapacity: '15'
mincapacity: '1'
statementcachesize: '10'
jndinames:
- 'jdbc/hrDS'
target:
- 'WebCluster'
- 'WebCluster2'
targettype:
- 'Cluster'
- 'Cluster'
testtablename: 'SQL SELECT 1 FROM DUAL'
url: "jdbc:oracle:thin:@dbagent2.alfa.local:1521/test.oracle.com"
user: 'hr'
password: 'pass'
usexa: '1'
xaproperties:
- 'RollbackLocalTxUponConnClose=0'
- 'RecoverOnlyOnce=0'
- 'KeepLogicalConnOpenOnRelease=0'
- 'KeepXaConnTillTxComplete=1'
- 'XaTransactionTimeout=14400'
- 'XaRetryIntervalSeconds=60'
- 'XaRetryDurationSeconds=0'
- 'ResourceHealthMonitoring=1'
- 'NewXaConnForCommit=0'
- 'XaSetTransactionTimeout=1'
- 'XaEndOnlyOnce=0'
- 'NeedTxCtxOnClose=0'
testconnectionsonreserve: '0'
secondstotrustidlepoolconnection: '10'
testfrequency: '120'
connectioncreationretryfrequency: '0'
'jmsDS':
ensure: 'present'
drivername: 'com.mysql.jdbc.Driver'
globaltransactionsprotocol: 'None'
initialcapacity: '1'
jndinames:
- 'jmsDS'
maxcapacity: '15'
target:
- 'WebCluster'
targettype:
- 'Cluster'
testtablename: 'SQL SELECT 1'
url: 'jdbc:mysql://10.10.10.10:3306/jms'
user: 'jms'
password: 'pass'
usexa: '1'
# To Optionally Configure as Gridlink Datasource
fanenabled: '1'
onsnodelist: '10.10.10.110:6200,10.10.10.111:6200'
### wls_jmsserver
it needs wls_setting and when identifier is not provided it will use the 'default'.
or use puppet resource wls_jmsserver
# this will use default as wls_setting identifier
wls_jmsserver { 'jmsServer1':
ensure => 'present',
persistentstore => 'jmsFile1',
persistentstoretype => 'FileStore',
target => ['wlsServer1'],
targettype => ['Server'],
allows_persistent_downgrade => '0',
bytes_maximum => '-1',
}
# this will use default as wls_setting identifier
wls_jmsserver { 'jmsServer2':
ensure => 'present',
target => ['wlsServer2'],
targettype => ['Server'],
}
# this will use default as wls_setting identifier
wls_jmsserver { 'jmsServer3':
ensure => 'present',
target => ['wlsServer3'],
targettype => ['Server'],
}
in hiera
# this will use default as wls_setting identifier
jmsserver_instances:
jmsServer1:
ensure: 'present'
target:
- 'wlsServer1'
targettype:
- 'Server'
persistentstore: 'jmsFile1'
persistentstoretype: 'FileStore'
allows_persistent_downgrade: '0'
bytes_maximum: '-1'
jmsServer2:
ensure: 'present'
target:
- 'wlsServer2'
targettype:
- 'Server'
### wls_jms_module
it needs wls_setting and when identifier is not provided it will use the 'default'.
or use puppet resource wls_jms_module
# this will use default as wls_setting identifier
wls_jms_module { 'jmsClusterModule':
ensure => 'present',
target => ['WebCluster'],
targettype => ['Cluster'],
}
in hiera
# this will use default as wls_setting identifier
jms_module_instances:
jmsClusterModule:
ensure: 'present'
target:
- 'WebCluster'
targettype:
- 'Cluster'
### wls_jms_template
it needs wls_setting and when identifier is not provided it will use the 'default'.
or use puppet resource wls_jms_template
wls_jms_template { 'jmsClusterModule:Template-0':
ensure => 'present',
redeliverydelay => '-1',
redeliverylimit => '-1',
}
in hiera
jms_template_instances:
'jmsClusterModule:Template':
ensure: 'present'
redeliverydelay: '-1'
redeliverylimit: '-1'
### wls_jms_sort_destination_key
it needs wls_setting and when identifier is not provided it will use the 'default', title must also contain the jms module name
wls_jms_sort_destination_key { 'jmsClusterModule:JMSPriority':
ensure => 'present',
key_type => 'Int',
property_name => 'JMSPriority',
sort_order => 'Ascending',
}
wls_jms_sort_destination_key { 'default/jmsClusterModule:JMSRedelivered':
ensure => 'present',
key_type => 'Boolean',
property_name => 'JMSRedelivered',
sort_order => 'Ascending',
}
wls_jms_sort_destination_key { 'default/jmsClusterModule:JmsMessageId':
ensure => 'present',
key_type => 'String',
property_name => 'JmsMessageId',
sort_order => 'Descending',
}
in Hiera
jms_sort_destination_key_instances:
'jmsClusterModule:JmsMessageId':
ensure: 'present'
key_type: 'String'
property_name: 'JmsMessageId'
sort_order: 'Descending'
require: Wls_jms_module[jmsClusterModule]
'jmsClusterModule:JMSPriority':
ensure: 'present'
key_type: 'Int'
property_name: 'JMSPriority'
sort_order: 'Ascending'
require: Wls_jms_module[jmsClusterModule]
'jmsClusterModule:JMSRedelivered':
ensure: 'present'
key_type: 'Boolean'
property_name: 'JMSRedelivered'
sort_order: 'Ascending'
require: Wls_jms_module[jmsClusterModule]
### wls_connection_factory
it needs wls_setting and when identifier is not provided it will use the 'default', title must also contain the jms module name
or use puppet resource wls_connection_factory
wls_jms_connection_factory { 'jmsClusterModule:cf':
ensure => 'present',
attachjmsxuserid => '0',
clientidpolicy => 'Restricted',
defaulttargeting => '0',
jndiname => 'jms/cf',
loadbalancingenabled => '1',
messagesmaximum => '10',
reconnectpolicy => 'producer',
serveraffinityenabled => '1',
subdeployment => 'wlsServers',
subscriptionsharingpolicy => 'Exclusive',
transactiontimeout => '3600',
xaenabled => '0',
}
wls_jms_connection_factory { 'default/jmsClusterModule:cf2':
ensure => 'present',
attachjmsxuserid => '0',
clientidpolicy => 'Restricted',
defaulttargeting => '1',
jndiname => 'jms/cf2',
loadbalancingenabled => '1',
messagesmaximum => '10',
reconnectpolicy => 'producer',
serveraffinityenabled => '1',
subscriptionsharingpolicy => 'Exclusive',
transactiontimeout => '3600',
xaenabled => '1',
}
in hiera
jms_connection_factory_instances:
'jmsClusterModule:cf':
ensure: 'present'
jmsmodule: 'jmsClusterModule'
defaulttargeting: '0'
jndiname: 'jms/cf'
subdeployment: 'wlsServers'
transactiontimeout: '3600'
xaenabled: '0'
'jmsClusterModule:cf2':
ensure: 'present'
jmsmodule: 'jmsClusterModule'
defaulttargeting: '1'
jndiname: 'jms/cf2'
transactiontimeout: '3600'
xaenabled: '1'
### wls_jms_queue
it needs wls_setting and when identifier is not provided it will use the 'default', title must also contain the jms module name
or use puppet resource wls_jms_queue
wls_jms_queue { 'jmsClusterModule:ErrorQueue':
ensure => 'present',
defaulttargeting => '0',
distributed => '1',
expirationpolicy => 'Discard',
jndiname => 'jms/ErrorQueue',
redeliverydelay => '-1',
redeliverylimit => '-1',
subdeployment => 'jmsServers',
timetodeliver => '-1',
timetolive => '-1',
templatename => 'Template',
messagelogging => '1',
}
wls_jms_queue { 'jmsClusterModule:Queue1':
ensure => 'present',
defaulttargeting => '0',
distributed => '1',
forwarddelay => '-1',
errordestination => 'ErrorQueue',
expirationpolicy => 'Redirect',
jndiname => 'jms/Queue1',
redeliverydelay => '2000',
redeliverylimit => '3',
subdeployment => 'jmsServers',
timetodeliver => '-1',
timetolive => '300000',
messagelogging => '1',
destination_keys => ['JMSPriority', 'JmsMessageId'],
}
wls_jms_queue { 'jmsClusterModule:Queue2':
ensure => 'present',
defaulttargeting => '0',
distributed => '1',
expirationloggingpolicy => '%header%%properties%',
expirationpolicy => 'Log',
jndiname => 'jms/Queue2',
redeliverydelay => '2000',
redeliverylimit => '3',
subdeployment => 'jmsServers',
timetodeliver => '-1',
timetolive => '300000',
messagelogging => '1',
}
in hiera
jms_queue_instances:
'jmsClusterModule:ErrorQueue':
ensure: 'present'
distributed: '1'
expirationpolicy: 'Discard'
jndiname: 'jms/ErrorQueue'
redeliverydelay: '-1'
redeliverylimit: '-1'
subdeployment: 'jmsServers'
defaulttargeting: '0'
timetodeliver: '-1'
timetolive: '-1'
templatename: 'Template'
messagelogging: '1'
'jmsClusterModule:Queue1':
ensure: 'present'
distributed: '1'
forwarddelay: '-1'
errordestination: 'ErrorQueue'
expirationpolicy: 'Redirect'
jndiname: 'jms/Queue1'
destination_keys:
- 'JMSPriority'
- 'JmsMessageId'
redeliverydelay: '2000'
redeliverylimit: '3'
subdeployment: 'jmsServers'
defaulttargeting: '0'
timetodeliver: '-1'
timetolive: '300000'
messagelogging: '1'
'jmsClusterModule:Queue2':
ensure: 'present'
distributed: '1'
expirationloggingpolicy: '%header%%properties%'
expirationpolicy: 'Log'
jndiname: 'jms/Queue2'
redeliverydelay: '2000'
redeliverylimit: '3'
subdeployment: 'jmsServers'
defaulttargeting: '0'
timetodeliver: '-1'
timetolive: '300000'
messagelogging: '1'
### wls_jms_topic
it needs wls_setting and when identifier is not provided it will use the 'default', title must also contain the jms module name
or use puppet resource wls_jms_topic
wls_jms_topic { 'jmsClusterModule:Topic1':
ensure => 'present',
balancingpolicy => 'Round-Robin',
defaulttargeting => '0',
deliverymode => 'No-Delivery',
destination_keys => ['JMSPriority', 'JmsMessageId'],
distributed => '1',
expirationpolicy => 'Discard',
forwardingpolicy => 'Replicated',
jndiname => 'jms/Topic1',
redeliverydelay => '2000',
redeliverylimit => '2',
subdeployment => 'jmsServers',
timetodeliver => '-1',
timetolive => '300000',
}
wls_jms_topic { 'default/jmsClusterModule:Topic2':
ensure => 'present',
balancingpolicy => 'Round-Robin',
defaulttargeting => '0',
deliverymode => 'No-Delivery',
distributed => '1',
errordestination => 'ErrorQueue',
expirationpolicy => 'Redirect',
forwardingpolicy => 'Replicated',
jndiname => 'jms/Topic2',
redeliverydelay => '2000',
redeliverylimit => '3',
subdeployment => 'jmsServers',
timetodeliver => '-1',
timetolive => '300000',
}
in hiera
jms_topic_instances:
'jmsClusterModule:Topic1':
ensure: 'present'
defaulttargeting: '0'
distributed: '1'
expirationpolicy: 'Discard'
jndiname: 'jms/Topic1'
redeliverydelay: '2000'
redeliverylimit: '2'
subdeployment: 'jmsServers'
timetodeliver: '-1'
timetolive: '300000'
messagelogging: '0'
destination_keys:
- 'JMSPriority'
- 'JmsMessageId'
### wls_jms_quota
it needs wls_setting and when identifier is not provided it will use the 'default', title must also contain the jms module name
or use puppet resource wls_jms_quota
wls_jms_quota { 'jmsClusterModule:QuotaBig':
ensure => 'present',
bytesmaximum => '9223372036854775807',
messagesmaximum => '9223372036854775807',
policy => 'FIFO',
shared => '1',
}
wls_jms_quota { 'jmsClusterModule:QuotaLow':
ensure => 'present',
bytesmaximum => '20000000000',
messagesmaximum => '9223372036854775807',
policy => 'FIFO',
shared => '0',
}
in hiera
jms_quota_instances:
'jmsClusterModule:QuotaBig':
ensure: 'present'
bytesmaximum: '9223372036854775807'
messagesmaximum: '9223372036854775807'
policy: 'FIFO'
shared: '1'
'jmsClusterModule:QuotaLow':
ensure: 'present'
bytesmaximum: '20000000000'
messagesmaximum: '9223372036854775807'
policy: 'FIFO'
shared: '0'
### wls_jms_subdeployment
it needs wls_setting and when identifier is not provided it will use the 'default', title must also contain the jms module name
or use puppet resource wls_jms_subdeployment
wls_jms_subdeployment { 'jmsClusterModule:jmsServers':
ensure => 'present',
target => ['jmsServer1','jmsServer2'],
targettype => ['JMSServer','JMSServer'],
}
wls_jms_subdeployment { 'jmsClusterModule:wlsServers':
ensure => 'present',
target => ['WebCluster'],
targettype => ['Cluster'],
}
in hiera
jms_subdeployment_instances:
'jmsClusterModule:jmsServers':
ensure: 'present'
target:
- 'jmsServer1'
- 'jmsServer2'
targettype:
- 'JMSServer'
- 'JMSServer'
'jmsClusterModule:wlsServers':
ensure: 'present'
target:
- 'WebCluster'
targettype:
- 'Cluster'
### wls_saf_remote_context
it needs wls_setting and when identifier is not provided it will use the 'default', title must also contain the jms module name
or use puppet resource wls_saf_remote_context
wls_saf_remote_context { 'jmsClusterModule:RemoteSAFContext-0':
ensure => 'present',
connect_url => 't3://10.10.10.10:7001',
weblogic_user => 'weblogic',
weblogic_password => 'weblogic1',
}
wls_saf_remote_context { 'jmsClusterModule:RemoteSAFContext-1':
ensure => 'present',
connect_url => 't3://10.10.10.10:7001',
}
in hiera
saf_remote_context_instances:
'jmsClusterModule:RemoteSAFContext-0':
ensure: 'present'
connect_url: 't3://10.10.10.10:7001'
weblogic_user: 'weblogic'
weblogic_password: 'weblogic1'
'jmsClusterModule:RemoteSAFContext-1':
ensure: 'present'
connect_url: 't3://10.10.10.10:7001'
### wls_saf_error_handler
it needs wls_setting and when identifier is not provided it will use the 'default', title must also contain the jms module name
or use puppet resource wls_saf_error_handler
wls_saf_error_handler { 'jmsClusterModule:ErrorHandling-0':
ensure => 'present',
policy => 'Discard',
}
wls_saf_error_handler { 'jmsClusterModule:ErrorHandling-1':
ensure => 'present',
logformat => '%header%%properties%',
policy => 'Log',
}
in hiera
saf_error_handler_instances:
'jmsClusterModule:ErrorHandling-0':
ensure: 'present'
policy: 'Discard'
'jmsClusterModule:ErrorHandling-1':
ensure: 'present'
policy: 'Log'
logformat: '%header%%properties%'
### wls_saf_imported_destination
it needs wls_setting and when identifier is not provided it will use the 'default', title must also contain the jms module name
or use puppet resource wls_saf_imported_destination
wls_saf_imported_destination { 'jmsClusterModule:SAFImportedDestinations-0':
ensure => 'present',
defaulttargeting => '1',
errorhandling => 'ErrorHandling-0',
jndiprefix => 'saf_',
remotecontext => 'RemoteSAFContext-0',
timetolivedefault => '1000000000',
usetimetolivedefault => '1',
}
wls_saf_imported_destination { 'jmsClusterModule:SAFImportedDestinations-1':
ensure => 'present',
defaulttargeting => '0',
jndiprefix => 'saf2_',
remotecontext => 'RemoteSAFContext-1',
subdeployment => 'safServers',
usetimetolivedefault => '0',
}
in hiera
'jmsClusterModule:SAFImportedDestinations-1':
ensure: 'present'
defaulttargeting: '1'
jndiprefix: 'saf2_'
remotecontext: 'RemoteSAFContext-1'
'jmsClusterModule:SAFImportedDestinations-0':
ensure: 'present'
defaulttargeting: '0'
subdeployment: 'safServers'
errorhandling: 'ErrorHandling-1'
jndiprefix: 'saf_'
remotecontext: 'RemoteSAFContext-0'
timetolivedefault: '100000000'
usetimetolivedefault: '1'
### wls_saf_imported_destination_object
it needs wls_setting and when identifier is not provided it will use the 'default', title must also contain the jms module name and imported_destination
or use puppet resource wls_saf_imported_destination_object
wls_saf_imported_destination_object { 'jmsClusterModule:SAFImportedDestinations-0:SAFDemoQueue':
ensure => 'present',
nonpersistentqos => 'Exactly-Once',
object_type => 'queue',
remotejndiname => 'jms/DemoQueue',
unitoforderrouting => 'Hash',
usetimetolivedefault => '0',
}
wls_saf_imported_destination_object { 'jmsClusterModule:SAFImportedDestinations-0:SAFDemoTopic':
ensure => 'present',
nonpersistentqos => 'Exactly-Once',
object_type => 'topic',
remotejndiname => 'jms/DemoTopic',
timetolivedefault => '100000000',
unitoforderrouting => 'Hash',
usetimetolivedefault => '1',
}
in hiera
saf_imported_destination_object_instances:
'jmsClusterModule:SAFImportedDestinations-0:SAFDemoQueue':
ensure: 'present'
object_type: 'queue'
remotejndiname: 'jms/DemoQueue'
unitoforderrouting: 'Hash'
nonpersistentqos: 'Exactly-Once'
'jmsClusterModule:SAFImportedDestinations-0:SAFDemoTopic':
ensure: 'present'
object_type: 'topic'
remotejndiname: 'jms/DemoTopic'
timetolivedefault: '100000000'
unitoforderrouting: 'Hash'
usetimetolivedefault: '1'
nonpersistentqos: 'Exactly-Once'
### wls_foreign_server
it needs wls_setting and when identifier is not provided it will use the 'default', title must also contain the jms module name
or use puppet resource wls_foreign_server
wls_foreign_server { 'jmsClusterModule:AQForeignServer':
ensure => 'present',
defaulttargeting => '1',
extraproperties => 'datasource=jdbc/hrDS',
initialcontextfactory => ['oracle.jms.AQjmsInitialContextFactory'],
}
wls_foreign_server { 'jmsClusterModule:Jboss':
ensure => 'present',
connectionurl => 'remote://10.10.10.10:4447',
defaulttargeting => '0',
extraproperties => ['java.naming.security.principal=jmsuser'],
initialcontextfactory => 'org.jboss.naming.remote.client.InitialContextFactory',
subdeployment => 'wlsServers',
}
in hiera
'jmsClusterModule:AQForeignServer':
ensure: 'present'
defaulttargeting: '1'
extraproperties:
- 'datasource=jdbc/hrDS'
initialcontextfactory: 'oracle.jms.AQjmsInitialContextFactory'
'jmsClusterModule:Jboss':
ensure: 'present'
connectionurl: 'remote://10.10.10.10:4447'
defaulttargeting: '0'
extraproperties:
- 'java.naming.security.principal=jmsuser'
initialcontextfactory: 'org.jboss.naming.remote.client.InitialContextFactory'
subdeployment: 'wlsServers'
password: 'test'
### wls_foreign_server_object
it needs wls_setting and when identifier is not provided it will use the 'default', title must also contain the jms module name and foreign server
or use puppet resource wls_foreign_server_object
wls_foreign_server_object { 'jmsClusterModule:Jboss:CF':
ensure => 'present',
localjndiname => 'jms/jboss/CF',
object_type => 'connectionfactory',
remotejndiname => 'jms/Remote/CF',
}
wls_foreign_server_object { 'jmsClusterModule:Jboss:JBossQ':
ensure => 'present',
localjndiname => 'jms/jboss/Queue',
object_type => 'destination',
remotejndiname => 'jms/Remote/Queue',
}
in hiera
'jmsClusterModule:Jboss:CF':
ensure: 'present'
localjndiname: 'jms/jboss/CF'
object_type: 'connectionfactory'
remotejndiname: 'jms/Remote/CF'
'jmsClusterModule:Jboss:JBossQ':
ensure: 'present'
localjndiname: 'jms/jboss/Queue'
object_type: 'destination'
remotejndiname: 'jms/Remote/Queue'
'jmsClusterModule:AQForeignServer:XAQueueCF':
ensure: 'present'
localjndiname: 'jms/XAQueueCF'
object_type: 'connectionfactory'
remotejndiname: 'XAQueueConnectionFactory'
'jmsClusterModule:AQForeignServer:TestQueue':
ensure: 'present'
localjndiname: 'jms/aq/TestQueue'
object_type: 'destination'
remotejndiname: 'Queues/TestQueue'
### wls_mail_session
it needs wls_setting and when identifier is not provided it will use the 'default'
or use puppet resource wls_mail_server
Valid mail properties are found at: https://javamail.java.net/nonav/docs/api/
wls_mail_session { 'myMailSession':
ensure => 'present',
jndiname => 'myMailSession',
target => ['ManagedServer1', 'WebCluster'],
targettype => ['Server', 'Cluster'],
mailproperty => ['mail.host=smtp.hostname.com', 'mail.user=smtpadmin'],
}
in hiera
mail_session_instances:
'myMailSession':
ensure: present
jndiname: 'myMailSession'
target:
- 'ManagedServer1'
- 'WebCluster'
targettype:
- 'Server'
- 'Cluster'
mailproperty:
- 'mail.host=smtp.hostname.com'
- 'mail.user=smtpadmin'
### wls_multi_datasource
it needs wls_setting and when identifier is not provided it will use the 'default'
or use puppet resource wls_multi_datasource
Valid mail properties are found at: https://javamail.java.net/nonav/docs/api/
wls_multi_datasource { 'myMultiDatasource':
ensure => 'present',
algorithmtype => 'Failover',
datasources => ['myJDBCDatasource'],
jndinames => ['myMultiDatasource'],
target => ['ManagedServer1', 'WebCluster'],
targettype => ['Server', 'Cluster'],
testfrequency => '120',
}
in hiera
multi_datasources:
'myMultiDatasource':
ensure: present
jndinames: 'myMultiDatasource'
testfrequency: 120
algorithmtype: 'Failover'
datasources:
- 'myJDBCDatasource'
target:
- 'ManagedServer1'
- 'WebCluster'
targettype:
- 'Server'
- 'Cluster'
### wls_jms_bridge_destination
it needs wls_setting and when identifier is not provided it will use the 'default'
or use puppet resource wls_jms_bridge_destination
Valid jms bridge destinations are found at: https://javamail.java.net/nonav/docs/api/
wls_jms_bridge_destination { 'myBridgeDest':
ensure => 'present',
adapter => 'eis.jms.WLSConnectionFactoryJNDINoTX',
classpath => 'myClasspath',
connectionfactoryjndi => 'myCFJndi',
connectionurl => 'myConnUrl',
destinationjndi => 'myDestJndi',
destinationtype => 'Queue',
initialcontextfactory => 'weblogic.jndi.WLInitialContextFactory',
}
in hiera
jms_bridge_destinations:
'myBridgeDest':
ensure: present
adapter: 'eis.jms.WLSConnectionFactoryJNDINoTX',
classpath: 'myClasspath',
connectionfactoryjndi: 'myCFJndi',
connectionurl: 'myConnUrl',
destinationjndi: 'myDestJndi',
destinationtype: 'Queue',
initialcontextfactory; 'weblogic.jndi.WLInitialContextFactory',
### wls_messaging_bridge
it needs wls_setting and when identifier is not provided it will use the 'default'
or use puppet resource wls_messaging_bridge
Valid messaging bridge properties are found at: https://javamail.java.net/nonav/docs/api/
wls_messaging_bridge { 'myBrigde':
ensure => 'present',
asyncenabled => '1',
batchinterval => '-1',
batchsize => '10',
durabilityenabled => '1',
idletimemax => '60',
qos => 'Exactly-once',
reconnectdelayincrease => '5',
reconnectdelaymax => '60',
reconnectdelaymin => '15',
selector => 'sel',
transactiontimeout => '30',
sourcedestination => 'mySourceBrigdeDest',
targetdestination => 'MyDestBridgeDest',
target => ['ManagedServer1', 'WebCluster'],
targettype => ['Server', 'Cluster'],
}
in hiera
messaging_bridges:
'myBridge':
ensure: present
asyncenabled: '1'
batchinterval: '-1',
batchsize: '10',
durabilityenabled: '1',
idletimemax: '60',
qos: 'Exactly-once',
reconnectdelayincrease: '5',
reconnectdelaymax: '60',
reconnectdelaymin:: '15',
selector: 'sel',
transactiontimeout: '30',
sourcedestination: 'mySourceBrigdeDest',
targetdestination: 'MyDestBridgeDest',
target:
- 'ManagedServer1'
- 'WebCluster'
targettype:
- 'Server'
- 'Cluster'
| {
"content_hash": "a7b2af957f9598ed36d196ead0578405",
"timestamp": "",
"source": "github",
"line_count": 4426,
"max_line_length": 470,
"avg_line_length": 39.65341165838229,
"alnum_prop": 0.5528301026745525,
"repo_name": "cmbrehm/biemond-orawls",
"id": "12db28900ecfe8ac2b129f0f8210c6c9620c52d7",
"size": "175577",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.markdown",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "551733"
},
{
"name": "Puppet",
"bytes": "168936"
},
{
"name": "Python",
"bytes": "557"
},
{
"name": "Ruby",
"bytes": "308001"
},
{
"name": "Shell",
"bytes": "1636"
}
],
"symlink_target": ""
} |
var TrelloToggleButton = (function() {
'use strict';
var _board_header_selector = '.board-header-btns.mod-left';
var _board_header_btn_class = 'board-header-btn';
var _trello_hideable_classes = ['.card-label','.badges','.list-card-members','.list-card-cover'];
var _key_to_bind = 192; // tilde (`)
var _button_label = 'Toggle Details';
var toggleTrigger;
var createToggleButton = function(buttonLabel) {
toggleTrigger = document.createElement('a');
toggleTrigger.appendChild(document.createTextNode(buttonLabel));
toggleTrigger.setAttribute('href','#');
toggleTrigger.classList.add(_board_header_btn_class);
toggleTrigger.setAttribute('style', 'padding-left: 3px; padding-right: 3px;');
toggleTrigger.addEventListener('click', function(ev){
toggleItemsCallback(ev);
});
var menuButtonsContainer = document.querySelector(_board_header_selector);
menuButtonsContainer.appendChild(toggleTrigger);
};
var toggleItemsCallback = function(ev){
document.querySelectorAll(_trello_hideable_classes).forEach(function(i,x) {
i.style.display = i.style.display == 'none' ? 'block' : 'none';
});
return;
};
var registerKeyBinding = function(key) {
document.onkeydown = function(e) {
e = e || window.event;
switch(e.which || e.keyCode) {
case key:
toggleItemsCallback(e);
break;
default:return; // exit this handler for other keys
}
e.preventDefault(); // prevent the default action (scroll / move caret)
};
};
createToggleButton(_button_label);
registerKeyBinding(_key_to_bind);
})();
| {
"content_hash": "905894806d182c112f6b51aff119176f",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 103,
"avg_line_length": 37.285714285714285,
"alnum_prop": 0.5993431855500821,
"repo_name": "zdfowler/toggle-trello-board-details-tm",
"id": "1d89b9303ac4b0c7a75f4e312ed87cc10aa7f800",
"size": "2311",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "toggle-trello-board-details-tm.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "2311"
}
],
"symlink_target": ""
} |
<?php
/**
* Factory for HTTP client classes
*
* @category Mage
* @package Mage_Connect
* @author Magento Core Team <core@magentocommerce.com>
*/
class Mage_HTTP_Client
{
/**
* Disallow to instantiate - pvt constructor
*/
private function __construct()
{
}
/**
* Factory for HTTP client
* @param string/false $frontend 'curl'/'socket' or false for auto-detect
* @return Mage_HTTP_IClient
*/
public static function getInstance($frontend = false)
{
if(false === $frontend)
{
$frontend = self::detectFrontend();
}
if(false === $frontend)
{
throw new Exception("Cannot find frontend automatically, set it manually");
}
$class = __CLASS__."_".str_replace(' ', DIRECTORY_SEPARATOR, ucwords(str_replace('_', ' ', $frontend)));
$obj = new $class();
return $obj;
}
/**
* Detects frontend type.
* Priority is given to CURL
*
* @return string/bool
*/
protected static function detectFrontend()
{
if(function_exists("curl_init")) {
return "curl";
}
if(function_exists("fsockopen")) {
return "socket";
}
return false;
}
}
| {
"content_hash": "1066dbb530a7a0d85f22f904d59e09a0",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 112,
"avg_line_length": 21.278688524590162,
"alnum_prop": 0.5354391371340523,
"repo_name": "hansbonini/cloud9-magento",
"id": "e769ea3eb30808c4774918c227664027ba8ed731",
"size": "2249",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "www/lib/Mage/HTTP/Client.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ActionScript",
"bytes": "20063"
},
{
"name": "ApacheConf",
"bytes": "6515"
},
{
"name": "Batchfile",
"bytes": "1036"
},
{
"name": "CSS",
"bytes": "1761053"
},
{
"name": "HTML",
"bytes": "5281773"
},
{
"name": "JavaScript",
"bytes": "1126889"
},
{
"name": "PHP",
"bytes": "47400395"
},
{
"name": "PowerShell",
"bytes": "1028"
},
{
"name": "Ruby",
"bytes": "288"
},
{
"name": "Shell",
"bytes": "3879"
},
{
"name": "XSLT",
"bytes": "2135"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Cropper.js</title>
<link rel="stylesheet" href="/assets/instapan/cropper.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.5/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/tether/1.3.7/css/tether.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css">
<style>
.container {
max-width: 640px;
margin: 20px auto;
}
.row {
margin-left: 0 !important;
margin-right: 0 !important;
margin-bottom: 20px;
}
img {
max-width: 100%;
}
.img-container {
margin-bottom: 20px;
}
#imgsPlaceholder img {
margin: 20px;
}
</style>
</head>
<body>
<div class="container">
<h1>Instapan</h1>
<div class="row" id="actions">
<div class="docs-buttons">
<label class="btn btn-primary btn-upload" for="inputImage" title="Upload image file">
<input type="file" class="sr-only" id="inputImage" name="file" accept=".jpg,.jpeg,.png,.gif,.bmp,.tiff">
<span class="docs-tooltip" data-toggle="tooltip" title="" data-original-title="Import image with Blob URLs">
<span class="fa fa-upload"></span>
</span>
</label>
</div>
<div class=" docs-toggles">
<!-- <h3>Toggles:</h3> -->
<label class="control-label">Pictures in gallery: </label>
<div class="btn-group docs-aspect-ratios" data-toggle="buttons">
<label class="btn btn-primary active" >
<input type="radio" class="sr-only" id="aspectRatio1" name="aspectRatio" value="2">
<span class="docs-tooltip" data-toggle="tooltip" title="" data-original-title="aspectRatio: 2 / 1">
2
</span>
</label>
<label class="btn btn-primary">
<input type="radio" class="sr-only" id="aspectRatio2" name="aspectRatio" value="3">
<span class="docs-tooltip" data-toggle="tooltip" title="" data-original-title="aspectRatio: 3 / 1">
3
</span>
</label>
<label class="btn btn-primary">
<input type="radio" class="sr-only" id="aspectRatio3" name="aspectRatio" value="4">
<span class="docs-tooltip" data-toggle="tooltip" title="" data-original-title="aspectRatio: 4 / 1">
4
</span>
</label>
<label class="btn btn-primary">
<input type="radio" class="sr-only" id="aspectRatio4" name="aspectRatio" value="5">
<span class="docs-tooltip" data-toggle="tooltip" title="" data-original-title="aspectRatio: 5 / 1">
5
</span>
</label>
<label class="btn btn-primary">
<input type="radio" class="sr-only" id="aspectRatio5" name="aspectRatio" value="6">
<span class="docs-tooltip" data-toggle="tooltip" title="" data-original-title="aspectRatio: 6 / 1">
6
</span>
</label>
<label class="btn btn-primary">
<input type="radio" class="sr-only" id="aspectRatio6" name="aspectRatio" value="7">
<span class="docs-tooltip" data-toggle="tooltip" title="" data-original-title="aspectRatio: 7 / 1">
7
</span>
</label>
<label class="btn btn-primary">
<input type="radio" class="sr-only" id="aspectRatio7" name="aspectRatio" value="8">
<span class="docs-tooltip" data-toggle="tooltip" title="" data-original-title="aspectRatio: 8 / 1">
8
</span>
</label>
<label class="btn btn-primary">
<input type="radio" class="sr-only" id="aspectRatio8" name="aspectRatio" value="9">
<span class="docs-tooltip" data-toggle="tooltip" title="" data-original-title="aspectRatio: 9 / 1">
9
</span>
</label>
<label class="btn btn-primary">
<input type="radio" class="sr-only" id="aspectRatio9" name="aspectRatio" value="10">
<span class="docs-tooltip" data-toggle="tooltip" title="" data-original-title="aspectRatio: 10 / 1">
10
</span>
</label>
</div>
</div><!-- /.docs-toggles -->
</div>
<div class="img-container">
<img id="image" src="/assets/instapan/picture.jpg" alt="Picture">
</div>
<div class="row">
<a class="btn btn-primary" id="download" download="croppded.jpg">Download</a>
</div>
</div>
<script src="/assets/instapan/cropper.js"></script>
<script src="/assets/instapan/main.js"></script>
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.3.7/js/tether.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.5/js/bootstrap.min.js"></script>
<script>
/*window.addEventListener('DOMContentLoaded', function () {
var image = document.querySelector('#image');
var minAspectRatio = 0.5;
var maxAspectRatio = 1.5;
var cropper = new Cropper(image, {
aspectRatio: 16 / 9,
zoomable: false,
movable: false,
ready: function () {
var cropper = this.cropper;
var containerData = cropper.getContainerData();
var cropBoxData = cropper.getCropBoxData();
console.log(cropBoxData);
var aspectRatio = cropBoxData.width / cropBoxData.height;
var newCropBoxWidth;
},
cropmove: function () {
var cropper = this.cropper;
var cropBoxData = cropper.getCropBoxData();
var aspectRatio = cropBoxData.width / cropBoxData.height;
}
});
});*/
</script>
</body>
</html>
| {
"content_hash": "9b46114cdab47ab72390dbd39274b87d",
"timestamp": "",
"source": "github",
"line_count": 170,
"max_line_length": 120,
"avg_line_length": 36.12352941176471,
"alnum_prop": 0.5717309884383651,
"repo_name": "deepnavy/deepnavy.github.io",
"id": "0d2ed1b42cfba1fd1328fa80d356e7e40fab0ae3",
"size": "6141",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "instapan.html",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "650279"
},
{
"name": "HTML",
"bytes": "897926"
},
{
"name": "JavaScript",
"bytes": "1087599"
},
{
"name": "Ruby",
"bytes": "2106"
}
],
"symlink_target": ""
} |
layout: page
title: Chief Temple Logistics Show
date: 2016-05-24
author: Christian Livingston
tags: weekly links, java
status: published
summary: Proin tempor in felis eget malesuada. Pellentesque.
banner: images/banner/leisure-02.jpg
booking:
startDate: 02/18/2018
endDate: 02/23/2018
ctyhocn: ABISWHX
groupCode: CTLS
published: true
---
Aenean condimentum fermentum sapien ac ultrices. Praesent tristique mi arcu, ac tempor eros hendrerit eget. Proin eu nibh libero. Curabitur sit amet erat ac lorem tempus luctus sed non tortor. Aliquam tempor arcu eget nisl hendrerit pellentesque. Sed quis mauris nunc. Maecenas ut rutrum libero. Proin bibendum nec metus in elementum. Nullam egestas erat eu nisl molestie consequat. Ut interdum nibh purus, vitae faucibus est tempor sit amet.
* Quisque vitae mi vel odio dapibus fringilla
* Integer id dolor vel felis sollicitudin dignissim
* Sed vestibulum tellus et purus tempus viverra
* Integer porta diam et velit facilisis pellentesque.
Sed finibus magna in turpis pellentesque pulvinar. Phasellus eleifend auctor lectus sed bibendum. Mauris mollis quam ut nunc efficitur, vitae vehicula est tempor. Sed hendrerit tellus at massa mollis tristique eget non eros. Vivamus ac nulla mollis, lobortis urna quis, pellentesque purus. Aliquam sed consequat augue. Suspendisse potenti. Duis placerat tristique venenatis.
Mauris ultrices nec dolor at consectetur. Nunc tempor ligula quis neque pulvinar egestas. Phasellus dolor quam, congue ac imperdiet feugiat, rhoncus id nisi. Suspendisse potenti. Quisque congue placerat justo fringilla mollis. Nulla metus mauris, porta at sollicitudin a, euismod a nunc. Nam enim nisi, congue et ligula non, mollis ultricies elit. Nulla accumsan lacinia imperdiet. Donec auctor placerat nisi, vitae fermentum risus finibus et. Aliquam sagittis volutpat sollicitudin.
| {
"content_hash": "3a1258524bd41966edb030e82bce9640",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 483,
"avg_line_length": 77.125,
"alnum_prop": 0.813614262560778,
"repo_name": "KlishGroup/prose-pogs",
"id": "9ac5f22ae3779dd6fdb904ee9362195e6ab143d5",
"size": "1855",
"binary": false,
"copies": "1",
"ref": "refs/heads/gh-pages",
"path": "pogs/A/ABISWHX/CTLS/index.md",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
/* eslint-disable no-param-reassign */
// @flow
import Vue from 'vue';
import cloneDeep from 'lodash/cloneDeep';
import addGlobals from 'vue-add-globals';
import addSlots from './add-slots';
import addProvide from './add-provide';
import compileTemplate from './compile-template';
function addAttrs(vm, attrs) {
const consoleWarnSave = console.error;
console.error = () => {};
if (attrs) {
vm.$attrs = attrs;
} else {
vm.$attrs = {};
}
console.error = consoleWarnSave;
}
function addListeners(vm, listeners) {
const consoleWarnSave = console.error;
console.error = () => {};
if (listeners) {
vm.$listeners = listeners;
} else {
vm.$listeners = {};
}
console.error = consoleWarnSave;
}
export default function createInstance(component: Component, options: MountOptions) {
const instance = options.instance || Vue;
// delete cached constructor
delete component._Ctor;
if (options.context) {
if (!component.functional) {
throw new Error('mount.context can only be used when mounting a functional component');
}
if (typeof options.context !== 'object') {
throw new Error('mount.context must be an object');
}
const clonedComponent = cloneDeep(component);
component = {
render(h) {
return h(clonedComponent, options.context, options.children);
},
};
}
if (!component.render && component.template && !component.functional) {
compileTemplate(component);
}
if (options.provide) {
addProvide(component, options);
}
const Constructor = instance.extend(component);
if (options.globals) {
addGlobals(Constructor, options.globals);
}
const vm = new Constructor(options);
addAttrs(vm, options.attrs);
addListeners(vm, options.listeners);
if (options.slots) {
addSlots(vm, options.slots);
}
return vm;
}
| {
"content_hash": "48e2f9ccdd40f5591640b9115c185335",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 93,
"avg_line_length": 23.49367088607595,
"alnum_prop": 0.6681034482758621,
"repo_name": "eddyerburgh/avoriaz",
"id": "61a30596829da4c4874db35feb7398ef62faef70",
"size": "1856",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/lib/create-instance.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "85559"
},
{
"name": "Shell",
"bytes": "556"
},
{
"name": "TypeScript",
"bytes": "2326"
},
{
"name": "Vue",
"bytes": "9151"
}
],
"symlink_target": ""
} |
package org.javaee7.websocket.whiteboard;
import javax.websocket.EncodeException;
import javax.websocket.Encoder;
import javax.websocket.EndpointConfig;
/**
* @author Arun Gupta
*/
public class FigureEncoder implements Encoder.Text<Figure> {
@Override
public String encode(Figure figure) throws EncodeException {
return figure.getJson().toString();
}
@Override
public void init(EndpointConfig ec) {
System.out.println("init");
}
@Override
public void destroy() {
System.out.println("desroy");
}
}
| {
"content_hash": "f6a7c7a89090701bdb2d1024d1a36dc7",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 64,
"avg_line_length": 21.692307692307693,
"alnum_prop": 0.6897163120567376,
"repo_name": "ftomassetti/JavaIncrementalParser",
"id": "eaa696bac8e950ba544c4fbcb3998e06ff32091d",
"size": "2543",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/test/resources/javaee7-samples/websocket/whiteboard/src/main/java/org/javaee7/websocket/whiteboard/FigureEncoder.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "45351"
},
{
"name": "Groovy",
"bytes": "4889"
},
{
"name": "Java",
"bytes": "2084352"
},
{
"name": "JavaScript",
"bytes": "103909"
},
{
"name": "Scala",
"bytes": "75554"
},
{
"name": "TypeScript",
"bytes": "583"
}
],
"symlink_target": ""
} |
/* Back Button Icon
-----------------------------------------------------------------------------*/
.bar .button.style-back .button-label:before {
border: 1px solid #b0b0b0;
content: '';
display: block;
background: url(../images/icon.png) no-repeat;
height: 32px;
margin-right: 4px;
width: 32px;
}
/* Message
-----------------------------------------------------------------------------*/
.message {
background: rgba(255, 255, 255, 0.5);
border-radius: 8px;
padding: 12px;
text-align: center;
width: 50%;
}
p {
margin-top: 16px;
margin-bottom: 16px;
text-align: center;
}
/* Component View - Activity Indicator
-----------------------------------------------------------------------------*/
.view.component-activity-indicator-view .component-activity-indicator-view-content {
justify-content: center;
align-items: center;
}
.view.component-activity-indicator-view .start-button,
.view.component-activity-indicator-view .stop-button {
position: absolute;
bottom: 12px;
width: 125px;
}
.view.component-activity-indicator-view .start-button {
left: 12px;
}
.view.component-activity-indicator-view .stop-button {
right: 12px;
}
/* Component View - Alert
-----------------------------------------------------------------------------*/
.view.component-alert-view .component-alert-view-content {
padding: 10px 9px;
}
/* Component View - Bar
-----------------------------------------------------------------------------*/
.view.component-bar-dark-view .component-bar-dark-view-content,
.view.component-bar-light-view .component-bar-light-view-content {
justify-content: center;
align-items: center;
}
/* Component View - Button
-----------------------------------------------------------------------------*/
.view.component-button-bar-dark-view .component-button-bar-dark-view-content,
.view.component-button-bar-light-view .component-button-bar-light-view-content {
justify-content: center;
align-items: center;
}
/* Component View - Slider
-----------------------------------------------------------------------------*/
.view.component-slider-view .component-slider-view-content {
padding: 10px 9px;
}
.view.component-slider-view .h-value,
.view.component-slider-view .v-value {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
-o-box-sizing: border-box;
box-sizing: border-box;
background: rgba(255, 255, 255, 0.5);
border-radius: 8px;
font-size: 24px;
font-weight: normal;
height: 75px;
line-height: 75px;
text-align: center;
}
.view.component-slider-view .h-slider,
.view.component-slider-view .v-slider {
display: -webkit-box;
display: -moz-box;
display: -ms-box;
display: -o-box;
display: box;
}
/* Horizontal Slider */
.view.component-slider-view .h-slider {
-webkit-box-orient: vertical;
-moz-box-orient: vertical;
-ms-box-orient: vertical;
-o-box-orient: vertical;
box-orient: vertical;
}
.view.component-slider-view .h-slider .h-value {
margin-top: 10px;
}
/* Vertical Slider */
.view.component-slider-view .v-slider {
-webkit-box-orient: horizontal;
-moz-box-orient: horizontal;
-ms-box-orient: horizontal;
-o-box-orient: horizontal;
box-orient: horizontal;
}
.view.component-slider-view .v-slider .slider {
height: 150px;
}
.view.component-slider-view .v-slider .v-value {
-webkit-box-flex: 1;
-moz-box-flex: 1;
-ms-box-flex: 1;
-o-box-flex: 1;
box-flex: 1;
margin-left: 10px;
line-height: 150px;
height: 150px;
}
/* Component View - Button
-----------------------------------------------------------------------------*/
.view.component-button-view .component-button-view-content {
padding: 10px 9px;
}
.view.component-button-view .list {
padding: 0px;
}
/* Component View - ScrollView
-----------------------------------------------------------------------------*/
.view.component-scroll-view-view .list {
margin-bottom: 0px;
}
/* Horizontal Vertical Paging */
.view.component-scroll-view-h-paging-view .page,
.view.component-scroll-view-v-paging-view .page {
-webkit-backface-visibility: hidden;
-moz-backface-visibility: hidden;
-ms-backface-visibility: hidden;
-o-backface-visibility: hidden;
backface-visibility: hidden;
-webkit-box-orient: vertical;
-moz-box-orient: vertical;
-ms-box-orient: vertical;
-o-box-orient: vertical;
box-orient: vertical;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
-o-box-sizing: border-box;
box-sizing: border-box;
-webkit-box-flex: 1;
-moz-box-flex: 1;
-ms-box-flex: 1;
-o-box-flex: 1;
box-flex: 1;
display: -webkit-box;
display: -moz-box;
display: -ms-box;
display: -o-box;
display: box;
padding: 12px;
}
.view.component-scroll-view-h-paging-view .page span,
.view.component-scroll-view-v-paging-view .page span {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
-o-box-sizing: border-box;
box-sizing: border-box;
-webkit-box-flex: 1;
-moz-box-flex: 1;
-ms-box-flex: 1;
-o-box-flex: 1;
box-flex: 1;
justify-content: center;
align-items: center;
background: rgba(255, 255, 255, 0.5);
border-radius: 8px;
display: -webkit-box;
display: -moz-box;
display: -ms-box;
display: -o-box;
display: box;
font-size: 24px;
font-weight: normal;
height: 100%;
width: 100%;
}
/* Grid Paging */
.view.component-scroll-view-grid-view .row {
display: -webkit-box;
display: -moz-box;
display: -ms-box;
display: -o-box;
display: box;
}
.view.component-scroll-view-grid-view .page {
-webkit-box-orient: vertical;
-moz-box-orient: vertical;
-ms-box-orient: vertical;
-o-box-orient: vertical;
box-orient: vertical;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
-o-box-sizing: border-box;
box-sizing: border-box;
-webkit-box-flex: 1;
-moz-box-flex: 1;
-ms-box-flex: 1;
-o-box-flex: 1;
box-flex: 1;
display: -webkit-box;
display: -moz-box;
display: -ms-box;
display: -o-box;
display: box;
height: 150px;
padding: 12px;
width: 150px;
}
.view.component-scroll-view-grid-view .page span {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
-o-box-sizing: border-box;
box-sizing: border-box;
-webkit-box-flex: 1;
-moz-box-flex: 1;
-ms-box-flex: 1;
-o-box-flex: 1;
box-flex: 1;
justify-content: center;
align-items: center;
background: rgba(255, 255, 255, 0.5);
border-radius: 8px;
display: -webkit-box;
display: -moz-box;
display: -ms-box;
display: -o-box;
display: box;
font-size: 24px;
font-weight: normal;
height: 100%;
width: 100%;
}
.view.component-scroll-view-grid-view .row:nth-child(odd) .page:nth-child(even) span,
.view.component-scroll-view-grid-view .row:nth-child(even) .page:nth-child(odd) span {
background: rgba(255, 255, 255, 0.25);
}
/* Transition View
-----------------------------------------------------------------------------*/
.view.transition-view .transition-view-content {
justify-content: center;
align-items: center;
padding: 12px;
}
/* Event View
-----------------------------------------------------------------------------*/
@-webkit-keyframes flash {
from { -webkit-transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg); }
to { -webkit-transform: rotateX(360deg) rotateY(360deg) rotateZ(360deg); }
}
@-moz-keyframes flash {
from { -moz-transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg); }
to { -moz-transform: rotateX(360deg) rotateY(360deg) rotateZ(360deg); }
}
@-ms-keyframes flash {
from { -ms-transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg); }
to { -ms-transform: rotateX(360deg) rotateY(360deg) rotateZ(360deg); }
}
@-o-keyframes flash {
from { -o-transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg); }
to { -o-transform: rotateX(360deg) rotateY(360deg) rotateZ(360deg); }
}
@keyframes flash {
from { transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg); }
to { transform: rotateX(360deg) rotateY(360deg) rotateZ(360deg); }
}
.view.event-tap-view .event-tap-view-content,
.view.event-pinch-view .event-pinch-view-content,
.view.event-swipe-view .event-swipe-view-content {
justify-content: center;
align-items: center;
-webkit-transform-style: preserve-3d;
-moz-transform-style: preserve-3d;
-ms-transform-style: preserve-3d;
-o-transform-style: preserve-3d;
transform-style: preserve-3d;
-webkit-perspective: 800;
-moz-perspective: 800;
-ms-perspective: 800;
-o-perspective: 800;
perspective: 800;
}
.view.event-tap-view .event-tap-view-content .zone,
.view.event-pinch-view .event-pinch-view-content .zone,
.view.event-swipe-view .event-swipe-view-content .zone {
justify-content: center;
align-items: center;
background: rgba(255, 255, 255, 0.5);
border-radius: 8px;
display: -webkit-box;
display: -moz-box;
display: -ms-box;
display: -o-box;
display: box;
padding: 12px;
text-align: center;
height: 50%;
width: 50%;
}
.view.event-tap-view .event-tap-view-content .zone.flash,
.view.event-pinch-view .event-pinch-view-content .zone.flash,
.view.event-swipe-view .event-swipe-view-content .zone.flash {
-webkit-animation: flash 2s cubic-bezier(0.5, 0.1, 0.5, 1);
-moz-animation: flash 2s cubic-bezier(0.5, 0.1, 0.5, 1);
-ms-animation: flash 2s cubic-bezier(0.5, 0.1, 0.5, 1);
-o-animation: flash 2s cubic-bezier(0.5, 0.1, 0.5, 1);
animation: flash 2s cubic-bezier(0.5, 0.1, 0.5, 1);
}
| {
"content_hash": "d393c24bcf1025c2b5e1779bb784e37d",
"timestamp": "",
"source": "github",
"line_count": 372,
"max_line_length": 86,
"avg_line_length": 26.403225806451612,
"alnum_prop": 0.6036448788434128,
"repo_name": "moobilejs/moobile-core",
"id": "c09e5102753ce773ec27a1d6b74fd721b0dd0b72",
"size": "9822",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "examples/android/css/app.css",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "105265"
},
{
"name": "HTML",
"bytes": "9750"
},
{
"name": "JavaScript",
"bytes": "467544"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "d2a0cc6ca259b5c775ec049aadb4101a",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 31,
"avg_line_length": 9.692307692307692,
"alnum_prop": 0.7063492063492064,
"repo_name": "mdoering/backbone",
"id": "c67205f0a195b097ef3738bb5e65418bc6c7341a",
"size": "178",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Pinophyta/Pinopsida/Pinales/Cupressaceae/Thuja/Thuja lobbii/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
require 'spec_helper'
include ActiveNothing
describe ActiveNothing do
it 'has a version number' do
expect(VERSION).not_to be nil
end
describe '#build' do
it 'should return an Thing object' do
result = described_class.build({})
expect(result.class).to eq(Nothing)
end
end
end
| {
"content_hash": "30a26f93c4c4db7960c61c486175111e",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 41,
"avg_line_length": 19.375,
"alnum_prop": 0.6870967741935484,
"repo_name": "buren/active_nothing",
"id": "080ecfb065b264d559a9919686a28115b9361ffb",
"size": "310",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "spec/active_nothing_spec.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "4330"
},
{
"name": "Shell",
"bytes": "115"
}
],
"symlink_target": ""
} |
#include "ezbake_visibility.hpp"
#include "ezbake_visibility.h" // C API
#include <cctype>
#include <algorithm>
#include <exception>
#include <set>
#include <stdexcept>
#include <string>
#include "boost/algorithm/string/classification.hpp"
#include "boost/algorithm/string/replace.hpp"
#include "boost/algorithm/string/split.hpp"
#include "boost/lexical_cast.hpp"
#pragma GCC diagnostic ignored "-Wconversion"
#include "boost/spirit/include/qi.hpp"
#pragma GCC diagnostic warning "-Wconversion"
#include "boost/spirit/include/phoenix.hpp"
#include "boost/spirit/include/phoenix_operator.hpp"
#include "boost/variant/recursive_wrapper.hpp"
#include "exception_to_error_string.hpp"
using std::invalid_argument;
using std::remove_if;
using std::set;
using std::string;
using boost::apply_visitor;
using boost::lexical_cast;
using boost::recursive_wrapper;
using boost::static_visitor;
using boost::variant;
using boost::algorithm::is_any_of;
using boost::algorithm::replace_all;
using boost::algorithm::split;
using boost::phoenix::construct;
using boost::spirit::qi::_1;
using boost::spirit::qi::_2;
using boost::spirit::qi::_val;
using boost::spirit::qi::alpha;
using boost::spirit::qi::digit;
using boost::spirit::qi::expectation_failure;
using boost::spirit::qi::grammar;
using boost::spirit::qi::lexeme;
using boost::spirit::qi::phrase_parse;
using boost::spirit::qi::rule;
using boost::spirit::qi::space;
using boost::spirit::qi::space_type;
namespace {
const string TRUE_REPLACE = "ezbTezb";
const string FALSE_REPLACE = "ezbFezb";
struct op_or {};
struct op_and {};
struct op_not {};
template<typename tag> struct unop;
template<typename tag> struct binop;
typedef variant<
string,
recursive_wrapper<unop<op_not>>,
recursive_wrapper<binop<op_and>>,
recursive_wrapper<binop<op_or>>> expr;
template<typename tag>
struct unop {
explicit unop(const expr &o): oper1(o) {}
expr oper1;
};
template<typename tag>
struct binop {
binop(const expr &l, const expr &r): oper1(l), oper2(r) {}
expr oper1, oper2;
};
class eval: public static_visitor<bool> {
public:
bool operator()(const string &v) const {
if (v == TRUE_REPLACE) {
return true;
} else if (v == FALSE_REPLACE) {
return false;
}
return lexical_cast<bool>(v);
}
bool operator()(const binop<op_and> &b) const {
return recurse(b.oper1) && recurse(b.oper2);
}
bool operator()(const binop<op_or> &b) const {
return recurse(b.oper1) || recurse(b.oper2);
}
bool operator()(const unop<op_not> &u) const {
return !recurse(u.oper1);
}
private:
template<typename T>
bool recurse(const T &v) const {
return apply_visitor(*this, v);
}
};
bool evaluate(const expr &e) {
return apply_visitor(eval(), e);
}
template<typename Iterator, typename Skipper = space_type>
class parser : public grammar<Iterator, expr(), Skipper>
{
public:
parser() : parser::base_type(expr_) {
expr_ = or_.alias();
or_ = (and_ >> '|' >> or_ )[
_val = construct<binop<op_or>>(_1, _2)] | and_[_val = _1];
and_ = (not_ >> '&' >> and_)[
_val = construct<binop<op_and>>(_1, _2)] | not_[_val = _1];
not_ = ('!' > simple_)[_val = construct<unop<op_not>>(_1)] |
simple_[_val = _1];
simple_ = (('(' > expr_ > ')') | var_);
var_ = lexeme[+(alpha | digit)];
BOOST_SPIRIT_DEBUG_NODE(expr_);
BOOST_SPIRIT_DEBUG_NODE(or_);
BOOST_SPIRIT_DEBUG_NODE(and_);
BOOST_SPIRIT_DEBUG_NODE(not_);
BOOST_SPIRIT_DEBUG_NODE(simple_);
BOOST_SPIRIT_DEBUG_NODE(var_);
}
private:
rule<Iterator, string(), Skipper> var_;
rule<Iterator, expr(), Skipper> not_, and_, or_, simple_, expr_;
};
struct MarkingsComparator
{
bool operator()(const string &s1, const string &s2) {
return s1.length() >= s2.length();
}
};
typedef set<string, MarkingsComparator> MarkingsSet;
MarkingsSet get_markings_from_expression(const string &expression) {
MarkingsSet markings;
set<string> splits;
string expr_no_whitespace = expression;
remove_if(
expr_no_whitespace.begin(), expr_no_whitespace.end(),
::isspace);
split(splits, expr_no_whitespace, is_any_of(";|&!^()"));
auto splits_iter = splits.begin();
for (; splits_iter != splits.end(); ++splits_iter) {
if (!splits_iter->empty()) {
markings.insert(*splits_iter);
}
}
return markings;
}
string vis_auth_to_parsable(
const set<string> &auths,
const string &vis_expr) {
string parsable = vis_expr;
MarkingsSet markings = get_markings_from_expression(vis_expr);
auto markingsIter = markings.begin();
for (; markingsIter != markings.end(); ++markingsIter) {
if (auths.count(*markingsIter) == 1) {
replace_all(parsable, *markingsIter, TRUE_REPLACE);
} else {
replace_all(parsable, *markingsIter, FALSE_REPLACE);
}
}
if (parsable.empty() || parsable[parsable.size() - 1] != ';') {
parsable += ';';
}
return parsable;
}
}
bool ezbake::evaluate_visibility_expression(
const set<string> &auths,
const string &vis_expr) {
typedef string::const_iterator iter;
if (vis_expr.empty()) {
return true; // No visibility expression means a match to any auths
}
if (auths.empty()) {
return false; // There is a visibility expression but no auths
}
const string parsable = vis_auth_to_parsable(auths, vis_expr);
auto f = parsable.begin();
auto l = parsable.end();
parser<iter> p;
try {
expr parsed;
bool ok = phrase_parse(f, l, p > ';', space, parsed);
if (!ok) {
throw invalid_argument("Could not parse expression");
}
return evaluate(parsed);
} catch (const expectation_failure<iter> &e) {
throw invalid_argument(
string("Parse expectation failure at ") +
string(e.first, e.last));
}
if (f != l) {
throw invalid_argument(
string("Could not parse entire expression. Unparsed: ") +
string(f, l));
}
return false;
}
bool ezbake_evaluate_visibility_expression(
const char *auths[],
size_t auths_length,
const char * const vis_expr,
char **error) {
EXCEPTION_TO_ERROR_STRING(false, {
string vis_expr_str;
if (vis_expr != NULL) {
vis_expr_str = vis_expr;
}
set<string> auths_set;
for (size_t i = 0; i < auths_length; ++i) {
auths_set.insert(auths[i]);
}
return ezbake::evaluate_visibility_expression(auths_set, vis_expr_str);
})
}
| {
"content_hash": "436422a5626be01d2c282010553a13fa",
"timestamp": "",
"source": "github",
"line_count": 269,
"max_line_length": 79,
"avg_line_length": 27.24163568773234,
"alnum_prop": 0.570278384279476,
"repo_name": "ezbake/ezbake-permission-utils",
"id": "8238e9cc6a1231b4f7ea9c7003ab4b55b1c11a33",
"size": "7947",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/cpp/ezbake_visibility.cpp",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "12032"
},
{
"name": "C++",
"bytes": "49239"
},
{
"name": "Java",
"bytes": "24152"
}
],
"symlink_target": ""
} |
<?php
namespace Polidog\Todo\Module;
use BEAR\Sunday\Extension\Application\AbstractApp;
class App extends AbstractApp
{
}
| {
"content_hash": "9fe9ddc78f697087c0ed8cd963a58c3b",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 50,
"avg_line_length": 15.5,
"alnum_prop": 0.7983870967741935,
"repo_name": "polidog/Polidog.Todo",
"id": "8a6bacf16c1ae0754829c9ee5e88602807c12932",
"size": "124",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Module/App.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "409"
},
{
"name": "HTML",
"bytes": "3340"
},
{
"name": "PHP",
"bytes": "23156"
}
],
"symlink_target": ""
} |
<!--
Copyright 2015 CloudBees, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<editor>
<help>https://docs.cloudbees.com/docs/cloudbees-cd/latest/plugins/ec-websphere#StartNode</help>
<formElement>
<type>entry</type>
<label>Configuration Name:</label>
<!-- Improvements for CEV-18687 -->
<configuration>1</configuration>
<!-- End of improvements for CEV-18687 -->
<property>configname</property>
<propertyReference>/plugins/@PLUGIN_NAME@/project/websphere_cfgs</propertyReference>
<documentation>Name of the configuration to be used. URL, port and credentials are retrieved from the given configuration. To view or create a new configuration, go to the Administration -> Plugins tab, and select 'Configure' action for @PLUGIN_KEY@ plugin.</documentation>
<htmlDocumentation>Name of the configuration to be used. URL, port and credentials are retrieved from the given configuration.</htmlDocumentation>
<required>1</required>
</formElement>
<formElement>
<label>StartNode Location:</label>
<property>wasStartNodeLocation</property>
<type>entry</type>
<required>1</required>
<documentation>Absolute Physical path in Filesystem to location of startNode script i.e., /path/to/startNode.sh or startNode.bat</documentation>
</formElement>
<formElement>
<label>Node Profile:</label>
<property>wasNodeProfile</property>
<type>entry</type>
<required>0</required>
<documentation>
Profile name of the Node which needs to be started.
If this is not provided StartNode will start the Node which has the default profile.
</documentation>
</formElement>
<formElement>
<label>Log File Location:</label>
<property>wasLogFileLocation</property>
<type>entry</type>
<required>0</required>
<documentation>Absolute Physical path in Filesystem to location of startNode.sh logs i.e., /path/to/startServer.log</documentation>
</formElement>
<formElement>
<label>Timeout:</label>
<property>wasTimeout</property>
<type>entry</type>
<required>0</required>
<documentation>Specifies the waiting time before node start times out and returns an error.</documentation>
</formElement>
<formElement>
<label>Start all Application Servers?:</label>
<property>wasStartServers</property>
<type>checkbox</type>
<required>0</required>
<initiallyChecked>0</initiallyChecked>
<checkedValue>1</checkedValue>
<uncheckedValue>0</uncheckedValue>
<documentation>Start all application servers within node after nodeagent is started.</documentation>
</formElement>
<formElement>
<label>Node Name to start Servers:</label>
<property>wasNodeName</property>
<dependsOn>wasStartServers</dependsOn>
<condition>${wasStartServers} == '1'</condition>
<type>entry</type>
<required>0</required>
<documentation>Name of the node where application servers needs to be started.</documentation>
</formElement>
<formElement>
<label>Additional Parameters:</label>
<property>wasAdditionalParameters</property>
<type>textarea</type>
<required>0</required>
<documentation>
This parameter can be used to either override defaults or pass Custom Properties. For example: -quiet, -nowait, -help.
</documentation>
</formElement>
</editor>
| {
"content_hash": "c8c2d986d3b130f9413c56010790d2c5",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 281,
"avg_line_length": 44.81521739130435,
"alnum_prop": 0.6769342711617754,
"repo_name": "electric-cloud/EC-WebSphere",
"id": "cf9faeff5692c5101791fea690620151ce4795ec",
"size": "4123",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/resources/project/parameterForms/Management/StartNode.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ASL",
"bytes": "180220"
},
{
"name": "Batchfile",
"bytes": "2628"
},
{
"name": "CSS",
"bytes": "2058"
},
{
"name": "Groovy",
"bytes": "917511"
},
{
"name": "Java",
"bytes": "123534"
},
{
"name": "Perl",
"bytes": "895572"
},
{
"name": "Python",
"bytes": "91802"
},
{
"name": "Raku",
"bytes": "10613"
},
{
"name": "Shell",
"bytes": "20136"
}
],
"symlink_target": ""
} |
using System;
namespace Cygments {
internal class CygmenterBuilder : ICygmenterBuilder {
private string _code;
public CygmenterBuilder(string code) {
_code = code;
}
public ICygmenterBuilder WithLexer() {
throw new NotImplementedException();
}
public ICygmenterBuilder WithFormatter() {
throw new NotImplementedException();
}
public string Highlight() {
throw new NotImplementedException();
}
public void Highlight(string file) {
//auto pick lexer/formatter
throw new NotImplementedException();
}
public string Format() {
throw new NotImplementedException();
}
public void Format(string file) {
throw new NotImplementedException();
}
public string Lex() {
throw new NotImplementedException();
}
public void Lex(string file) {
throw new NotImplementedException();
}
}
} | {
"content_hash": "1d06b6aa9f7954a0afd95bbf7c10cc06",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 57,
"avg_line_length": 24.045454545454547,
"alnum_prop": 0.5680529300567108,
"repo_name": "timjk/Cygments",
"id": "ce07a2b0f8deff1011686fb2ae44fd37f7af62c6",
"size": "1058",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Cygments/CygmenterBuilder.cs",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "C#",
"bytes": "21934"
}
],
"symlink_target": ""
} |
@import url(https://fonts.googleapis.com/css?family=News+Cycle:400,700);
@import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic);
/*********************************************
* GLOBAL STYLES
*********************************************/
body {
background: url(vinta/3.jpg);
background-size: cover;
background-repeat: no-repeat;
background-position: center;
background-size: auto 100%;
background-color: #000; }
.reveal {
font-family: "Lato", sans-serif;
font-size: 36px;
font-weight: normal;
color: #000; }
.reveal .slide-background {
background-size: auto 100%;
}
::selection {
color: #fff;
background: rgba(0, 0, 0, 0.99);
text-shadow: none; }
.reveal .slides > section,
.reveal .slides > section > section {
line-height: 1.3;
font-weight: inherit; }
/*********************************************
* HEADERS
*********************************************/
.reveal h1,
.reveal h2,
.reveal h3,
.reveal h4,
.reveal h5,
.reveal h6 {
margin: 0 0 20px 0;
color: #000;
font-family: "News Cycle", Impact, sans-serif;
font-weight: normal;
line-height: 1.2;
letter-spacing: normal;
text-transform: none;
text-shadow: none;
word-wrap: break-word;
}
.reveal h1 {
font-size: 3.77em; }
.reveal h2 {
font-size: 2.11em; }
.reveal h3 {
font-size: 1.55em;
text-align: left;
margin-bottom: 1em}
.reveal h4 {
font-size: 1em;
text-align: left;}
.reveal h1 {
text-shadow: none; }
.reveal div.comment {
display: none;
}
/*.reveal section.section-slide {
background: url(vinta/2.jpg);
background-size: cover;
background-repeat: no-repeat;
background-position: center;
background-size: auto 100%;
}*/
.reveal section.section-slide h1,
.reveal section.section-slide h2,
.reveal section.section-slide h3,
.reveal section.section-slide h4,
.reveal section.section-slide h5,
.reveal section.section-slide h6 {
color: #fff;
}
.reveal section.section-slide .subtitle {
margin-top: 1em;
}
.reveal section.section-slide h2 {
margin-top: 2.5em;
}
.reveal section.section-slide h3 {
text-align: center;
}
.reveal section.section-slide-black h1,
.reveal section.section-slide-black h2,
.reveal section.section-slide-black h3,
.reveal section.section-slide-black h4,
.reveal section.section-slide-black h5,
.reveal section.section-slide-black h6 {
color: #000 !important;
}
.reveal div.status-green {
display: inline-block;
border-radius: 50%;
width: 20px;
height: 20px;
background: green;
}
.reveal div.status-red {
display: inline-block;
border-radius: 50%;
width: 20px;
height: 20px;
background: red;
}
/*********************************************
* OTHER
*********************************************/
.reveal p {
margin: 20px 0;
line-height: 1.3;
text-align: left;}
/* Ensure certain elements are never larger than the slide itself */
.reveal img,
.reveal video,
.reveal iframe {
max-width: 95%;
max-height: 95%; }
.reveal strong,
.reveal b {
font-weight: bold; }
.reveal em {
font-style: italic; }
.reveal ol,
.reveal dl,
.reveal ul {
display: inline-block;
text-align: left;
margin: 0 0 0 1em;
float: left; }
.reveal ol {
list-style-type: decimal; }
.reveal ul {
list-style-type: disc; }
.reveal ul ul {
list-style-type: square; }
.reveal ul ul ul {
list-style-type: circle; }
.reveal ul ul,
.reveal ul ol,
.reveal ol ol,
.reveal ol ul {
display: block;
margin-left: 40px; }
.reveal .ident1 {
margin-left: 50px;
list-style-type: square; }
.reveal dt {
font-weight: bold; }
.reveal dd {
margin-left: 40px; }
.reveal q,
.reveal blockquote {
quotes: none; }
.reveal blockquote {
display: block;
position: relative;
width: 70%;
margin: 20px auto;
padding: 5px;
font-style: italic;
background: rgba(255, 255, 255, 0.05);
box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.2); }
.reveal blockquote p:first-child,
.reveal blockquote p:last-child {
display: inline-block; }
.reveal q {
font-style: italic; }
.reveal pre {
display: block;
position: relative;
width: 90%;
margin: 20px auto;
text-align: left;
font-size: 0.55em;
font-family: monospace;
line-height: 1.2em;
word-wrap: break-word;
box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.3); }
.reveal code {
font-family: monospace; }
.reveal pre code {
display: block;
padding: 5px;
overflow: auto;
max-height: 600px;
word-wrap: normal; }
.reveal table {
margin: auto;
border-collapse: collapse;
border-spacing: 0; }
.reveal table th {
font-weight: bold; }
.reveal table th,
.reveal table td {
text-align: left;
padding: 0.2em 0.5em 0.2em 0.5em;
border-bottom: 1px solid; }
.reveal table th[align="center"],
.reveal table td[align="center"] {
text-align: center; }
.reveal table th[align="right"],
.reveal table td[align="right"] {
text-align: right; }
.reveal table tbody tr:last-child th,
.reveal table tbody tr:last-child td {
border-bottom: none; }
.reveal sup {
vertical-align: super; }
.reveal sub {
vertical-align: sub; }
.reveal small {
display: inline-block;
font-size: 0.6em;
line-height: 1.2em;
vertical-align: top; }
.reveal small * {
vertical-align: top; }
/*********************************************
* LINKS
*********************************************/
.reveal a {
color: #00008B;
text-decoration: none;
-webkit-transition: color .15s ease;
-moz-transition: color .15s ease;
transition: color .15s ease; }
.reveal a:hover {
color: #0000f1;
text-shadow: none;
border: none; }
.reveal .roll span:after {
color: #fff;
background: #00003f; }
/*********************************************
* IMAGES
*********************************************/
.reveal section img {
/*margin: 15px 0px;*/
/*background: rgba(255, 255, 255, 0.12);*/
/*border: 4px solid #000;*/
/*box-shadow: 0 0 10px rgba(0, 0, 0, 0.15); */
}
.reveal section img.plain {
border: 0;
box-shadow: none; }
.reveal a img {
-webkit-transition: all .15s linear;
-moz-transition: all .15s linear;
transition: all .15s linear; }
.reveal a:hover img {
background: rgba(255, 255, 255, 0.2);
border-color: #00008B;
box-shadow: 0 0 20px rgba(0, 0, 0, 0.55); }
/*********************************************
* NAVIGATION CONTROLS
*********************************************/
.reveal .controls .navigate-left,
.reveal .controls .navigate-left.enabled {
border-right-color: #00008B; }
.reveal .controls .navigate-right,
.reveal .controls .navigate-right.enabled {
border-left-color: #00008B; }
.reveal .controls .navigate-up,
.reveal .controls .navigate-up.enabled {
border-bottom-color: #00008B; }
.reveal .controls .navigate-down,
.reveal .controls .navigate-down.enabled {
border-top-color: #00008B; }
.reveal .controls .navigate-left.enabled:hover {
border-right-color: #0000f1; }
.reveal .controls .navigate-right.enabled:hover {
border-left-color: #0000f1; }
.reveal .controls .navigate-up.enabled:hover {
border-bottom-color: #0000f1; }
.reveal .controls .navigate-down.enabled:hover {
border-top-color: #0000f1; }
/*********************************************
* PROGRESS BAR
*********************************************/
.reveal .progress {
background: rgba(0, 0, 0, 0.2); }
.reveal .progress span {
background: #00008B;
-webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
-moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); }
| {
"content_hash": "41f8ea1bbdb999201b007c387a6632f1",
"timestamp": "",
"source": "github",
"line_count": 358,
"max_line_length": 86,
"avg_line_length": 21.022346368715084,
"alnum_prop": 0.6110815838426787,
"repo_name": "filipeximenes/talk_testing_web_apis",
"id": "e64980ec8a06c31d7eeb12bd4e61bdf2d87ea3b4",
"size": "7828",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "assets/custom.css",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "200891"
},
{
"name": "HTML",
"bytes": "80573"
},
{
"name": "JavaScript",
"bytes": "261184"
},
{
"name": "Python",
"bytes": "9547"
}
],
"symlink_target": ""
} |
layout: post
date: 2008-07-31 04:01:00
title: The Kanakabhishekam
tags: [archived-posts]
categories: archives
permalink: /:categories/:year/:month/:day/:title/
---
This was the first time I have seen a "kankAbhishEkam" performed before the person (OK, man!) actually turned 100; if you have seen a thousand full moons, or if you have seen the face of your son's son's son, you can have this celebration.
Here's the chirpy octagenarian (87) in his natty suit, ready for cocktails and dinner on the eve of the celebration:
<a href="http://s297.photobucket.com/albums/mm205/depontis/?action=view¤t=IMG_4723.jpg" target="_blank"><img src="http://i297.photobucket.com/albums/mm205/depontis/IMG_4723.jpg" border="0" alt="gjr in his suit and bowtie"></a>
Here are the four generations (men of course, do women ever get a look in?) of the family:
<a href="http://s297.photobucket.com/albums/mm205/depontis/?action=view¤t=IMG_4983.jpg" target="_blank"><img src="http://i297.photobucket.com/albums/mm205/depontis/IMG_4983.jpg" border="0" alt="janakiram,ramesh,dushyant, siddharth..the four generations"></a>
<lj-cut text=" see the religious part of the function if you wish to">
For the religious funtion, a shiva linga was created, and pooja done to it on stage:
<a href="http://s297.photobucket.com/albums/mm205/depontis/?action=view¤t=IMG_4905.jpg" target="_blank"><img src="http://i297.photobucket.com/albums/mm205/depontis/IMG_4905.jpg" border="0" alt="linga pooja"></a>
The "kalasham" or holy pot had water which was ritually sanctified:
<a href="http://s297.photobucket.com/albums/mm205/depontis/?action=view¤t=IMG_4858.jpg" target="_blank"><img src="http://i297.photobucket.com/albums/mm205/depontis/IMG_4858.jpg" border="0" alt="pooja and kalasham"></a>
A gold-plated sieve was taken, and gold and silver flowers placed upon it:
<a href="http://s297.photobucket.com/albums/mm205/depontis/?action=view¤t=IMG_4907.jpg" target="_blank"><img src="http://i297.photobucket.com/albums/mm205/depontis/IMG_4907.jpg" border="0" alt="gold and silver flowers"></a>
The family then joined together in pouring the sanctified water through the sieve. I have seen one kanakabhishekam (Chandrashekharendra Saraswathi of Kanchi Mutth) where actual gold coins were showered on the man (which was quite uncomfortable for the centenarian!)
<a href="http://s297.photobucket.com/albums/mm205/depontis/?action=view¤t=IMG_4919.jpg" target="_blank"><img src="http://i297.photobucket.com/albums/mm205/depontis/IMG_4919.jpg" border="0" alt="kanakabhishekam"></a>
</lj-cut>
Here's the great-grandfather, with the great-grandson who made the celebration possible!
<a href="http://s297.photobucket.com/albums/mm205/depontis/?action=view¤t=IMG_4979.jpg" target="_blank"><img src="http://i297.photobucket.com/albums/mm205/depontis/IMG_4979.jpg" border="0" alt="janakiram and dushyant"></a>
Here's wishing that we attend the actual 100th birthday, too! (I hope WE are alive and healthy enough!)
The celebration was held in the 120 year old Chiraan Fort, which is a private club now, and it was a real architectural jewel...but more about that later!
| {
"content_hash": "e58f0eb74e69ef5c2bc2c8304a1b180e",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 265,
"avg_line_length": 55,
"alnum_prop": 0.7564263322884013,
"repo_name": "deeyum/deeyum.github.io",
"id": "39c9b40e40b7a562bf46be3b7fb3e910a83efbdf",
"size": "3194",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "_posts/archives/2008-07-31-The-Kanakabhishekam.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "63687"
},
{
"name": "HTML",
"bytes": "9811"
},
{
"name": "Shell",
"bytes": "1339"
}
],
"symlink_target": ""
} |
FROM ubuntu:14.04
# Install self-signed ssl certs
# Install postfix as MTA
# Install dovecot as IMAP server
RUN apt-get update && apt-get -yq install --force-yes ssl-cert \
vim \
postfix \
dovecot-imapd \
mailutils \
supervisor \
postfix-pcre \
rsyslog && apt-get clean && rm -rf /var/lib/apt/lists/*
# SUPERVISOR
RUN mkdir -p /var/log/supervisor
ADD supervisord.conf /etc/supervisor/conf.d/
# postfix configuration
ADD ./postfix.main.cf /etc/postfix/main.cf
ADD ./postfix.master.cf.append /etc/postfix/master-additional.cf
ADD ./postfix.sh /opt/postfix.sh
RUN chmod 755 /opt/postfix.sh && cp /etc/hostname /etc/mailname
# dovecot configuration
ADD ./dovecot.mail /etc/dovecot/conf.d/10-mail.conf
ADD ./dovecot.ssl /etc/dovecot/conf.d/10-ssl.conf
ADD ./dovecot.auth /etc/dovecot/conf.d/10-auth.conf
ADD ./dovecot.master /etc/dovecot/conf.d/10-master.conf
ADD ./dovecot.lda /etc/dovecot/conf.d/15-lda.conf
ADD ./dovecot.imap /etc/dovecot/conf.d/20-imap.conf
# add verbose logging
#ADD ./internal/dovecot.logging /etc/dovecot/conf.d/10-logging.conf
# Note that EXPOSE only works for inter-container links. It doesn't make ports accessible from the host. To expose port(s) to the host, at runtime, use the -p flag.
# SMTP Incoming, IMAP, SMTP Outgoing
EXPOSE 25 143 587
# add script to configure container
ADD ./configure.sh /configure.sh
RUN chmod 755 /configure.sh
# add script to run at container start
ADD ./run.sh /run.sh
RUN chmod 755 /run.sh
ENV CERTIFICATE dovecot.pem
ENV KEYFILE dovecot.pem
# start necessary services for operation
CMD ["/run.sh"]
| {
"content_hash": "09aed8b49d9c9b671f22ccfcc9ab59a5",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 164,
"avg_line_length": 29.67924528301887,
"alnum_prop": 0.7469802924348379,
"repo_name": "htmlgraphic/Mail-Server",
"id": "2b122c34e4b93ba6f1af5465d1854d7b5a159274",
"size": "1573",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "dovecot/Dockerfile",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Dockerfile",
"bytes": "4698"
},
{
"name": "Makefile",
"bytes": "1872"
},
{
"name": "PHP",
"bytes": "169"
},
{
"name": "Shell",
"bytes": "4228"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Xml;
using System.Xml.Serialization;
using AgenaTrader.API;
using AgenaTrader.Custom;
using AgenaTrader.Plugins;
using AgenaTrader.Helper;
using System.Windows.Forms;
/// <summary>
/// Version: 1.3.0
/// -------------------------------------------------------------------------
/// Simon Pucher 2016
/// -------------------------------------------------------------------------
/// todo
/// + if markets are closed no OnCalculate() is called so we need an timer event.
/// -------------------------------------------------------------------------
/// Adds instruments dynamical to a static list (e.g. portfolio) if the market is currently open.
/// -------------------------------------------------------------------------
/// ****** Important ******
/// To compile this indicator without any error you also need access to the utility indicator to use these global source code elements.
/// You will find this indicator on GitHub: https://raw.githubusercontent.com/simonpucher/AgenaTrader/master/Utilities/GlobalUtilities_Utility.cs
/// -------------------------------------------------------------------------
/// Namespace holds all indicators and is required. Do not change it.
/// </summary>
namespace AgenaTrader.UserCode
{
[Description("Adds instruments dynamical to a static list (e.g. portfolio) if the market is currently open.")]
public class DynamicListMarkets_Indicator_Tool : UserIndicator
{
#region Variables
private bool _usemarkethours = true;
private string _instrumentlists = "DAX30;ATX20;DOW30;NASDAQ;S&P500";
private static DateTime _lastupdate = DateTime.Now;
private int _seconds = 60;
private string _name_of_list = String.Empty;
private IInstrumentsList _list = null;
#endregion
protected override void OnInit()
{
IsOverlay = true;
CalculateOnClosedBar = false;
}
protected override void OnStart()
{
this.CheckForNewInstruments();
}
protected override void OnCalculate()
{
this.CheckForNewInstruments();
}
private void CheckForNewInstruments() {
if (_lastupdate.AddSeconds(this._seconds) < DateTime.Now)
{
if (!String.IsNullOrEmpty(Name_of_list))
{
this.Root.Core.InstrumentManager.GetInstrumentLists();
_list = this.Root.Core.InstrumentManager.GetInstrumentsListStatic(this.Name_of_list);
if (_list == null || _list.Count == 0)
{
Log(this.DisplayName + ": The list " + this.Name_of_list + " does not exist.", InfoLogLevel.Warning);
}
}
else
{
Log(this.DisplayName + ": You need to specify a name for the list.", InfoLogLevel.Warning);
}
if (_list != null)
{
//this.Root.Core.InstrumentManager.ClearInstrumentList(this.Name_of_list);
Core.GuiManager.BeginInvoke((Action)(() => this.Root.Core.InstrumentManager.ClearInstrumentList(this.Name_of_list)));
}
if (!String.IsNullOrWhiteSpace(this.Instrumentlists))
{
string[] arr_Instrumentlists = this.Instrumentlists.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
if (arr_Instrumentlists != null && arr_Instrumentlists.Count() > 0)
{
foreach (string item in arr_Instrumentlists)
{
IInstrumentsList instlist = this.Root.Core.InstrumentManager.GetInstrumentsListStatic(item);
if (instlist != null && instlist.Count() > 0)
{
if (UseMarketHours)
{
ITimePeriod timper = this.Root.Core.MarketplaceManager.GetExchangeDescription(instlist.First().Exchange).TradingHours;
if ((DateTime.Now.TimeOfDay > timper.StartTime) && (DateTime.Now.TimeOfDay < timper.EndTime))
{
foreach (IInstrument inst in instlist)
{
if (!_list.Contains(inst))
{
//this.Root.Core.InstrumentManager.AddInstrument2List(inst, this.Name_of_list);
Core.GuiManager.BeginInvoke((Action)(() => Core.InstrumentManager.AddInstrument2List(inst, this.Name_of_list)));
}
}
}
}
else
{
foreach (IInstrument inst in instlist)
{
if (!_list.Contains(inst))
{
//this.Root.Core.InstrumentManager.AddInstrument2List(inst, this.Name_of_list);
Core.GuiManager.BeginInvoke((Action)(() => Core.InstrumentManager.AddInstrument2List(inst, this.Name_of_list)));
}
}
}
}
}
}
}
_lastupdate = DateTime.Now;
}
}
public override string DisplayName
{
get
{
return "DLM (T)";
}
}
public override string ToString()
{
return "DLM (T)";
}
#region Properties
#region InSeries
[Description("The name of the static list to which you would like to add the instruments.")]
[InputParameter]
[DisplayName("Static list")]
public string Name_of_list
{
get { return _name_of_list; }
set { _name_of_list = value; }
}
[Description("If true then all markets with active trading session will be added to the static list.")]
[InputParameter]
[DisplayName("Use market hours")]
public bool UseMarketHours
{
get { return _usemarkethours; }
set { _usemarkethours = value; }
}
[Description("All of these markets will be added automatically to your list if if the market is currently open.")]
[InputParameter]
[DisplayName("Markets")]
public string Instrumentlists
{
get { return _instrumentlists; }
set { _instrumentlists = value; }
}
[Description("Update interval in seconds.")]
[InputParameter]
[DisplayName("Update interval (sec.)")]
public int Seconds
{
get { return _seconds; }
set { _seconds = value; }
}
#endregion
#endregion
}
} | {
"content_hash": "ebd823d8bf31cb2ba8bdf1b181f1fe79",
"timestamp": "",
"source": "github",
"line_count": 224,
"max_line_length": 160,
"avg_line_length": 34.642857142857146,
"alnum_prop": 0.4672680412371134,
"repo_name": "ckovar82/AgenaTrader",
"id": "41a288cf1246dfc81116f7685fa847cb727b8200",
"size": "7760",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "Tools/Indicator/DynamicListMarkets_Utility_tool.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "742571"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<title>惠州城市职业学院高级评价系统 - 教师主页</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="styleSheet" href="css/reset.css">
<link rel="styleSheet" href="css/index_css.css">
<script src="js/jquery-1.11.1.js"></script>
<link rel="stylesheet" type="text/css" href="./bs/css/bootstrap.min.css">
<script type="text/javascript" src="./js/ichart.1.2.1.min.js"></script>
<link rel="stylesheet" href="./css/demo.css" type="text/css"/>
<link rel="stylesheet" type="text/css" href="./css/radarChart.css">
</head>
<body>
<nav class="navbar navbar-default navbar-fixed-top" style="background:#333;">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" style="border:none;" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" 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>
<a class="navbar-brand" href="#" style="color:#E0E0E0;">学生评价系统</a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li ><a href="./admin.html" style="color:#E0E0E0;">首页<span class="sr-only">(current)</span></a></li>
</ul>
<form class="navbar-form navbar-left">
<div class="form-group">
<input type="text" class="form-control" placeholder="输入内容搜索学生名">
</div>
<button type="submit" class="btn btn-default" style="border:none;background:none;"><img style="width:25px;height:25px;" src="./images/shousuo.png">
</button>
</form>
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"style="color:#E0E0E0;
background:none;">欢迎: 张凌老师 <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="#">修改资料</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li role="separator" class="divider"></li>
<li><a href="#">Separated link</a></li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
<div class="container">
<div class="row">
<div class="col-lg-12">1</div>
<div class="col-lg-12">1</div>
<div class="col-lg-12">
<div class="page-header">
<button type="button" class="btn btn-primary pull-right" data-toggle="modal" data-target=".bs-example-modal-sm">导入学生数据</button>
<h3>书院生活</h3>
</div>
</div>
<div class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel">
<div class="modal-dialog modal-sm" role="document">
<div class="modal-content">
<form action="1.php" method="post">
<div class="form-group">
<label for="exampleInputFile">选择elsx</label>
<input type="file" id="exampleInputFile">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="submit" class="btn btn-primary">导入</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row">
<div class="col-lg-12" >
<table class="table table-bordered">
<thead>
<tr>
<th>学生姓名</th>
<th>学号</th>
<th>学校</th>
<th>纪律分</th>
<th>内务分</th>
</tr>
</thead>
<tbody>
<tr>
<td>560001</td>
<td>560001</td>
<td>560001</td>
<td>560001</td>
<td>560001</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</body>
<script src="./jquery.min.js"></script>
<script src="./bs/js/bootstrap.min.js"></script>
<script src="echarts/build/dist/echarts.js"></script>
<script type="text/javascript" src="./js/radarChart.js"></script>
</html> | {
"content_hash": "0749c2fef9fdc75179fda521a6938f14",
"timestamp": "",
"source": "github",
"line_count": 130,
"max_line_length": 170,
"avg_line_length": 33.50769230769231,
"alnum_prop": 0.5971074380165289,
"repo_name": "baijiege9/BigGhostHead",
"id": "f3ae995c2b3d781d5ea0f3c95e7aa088c01a0155",
"size": "4508",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "www/templates/life.html",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "HTML",
"bytes": "349564"
},
{
"name": "Python",
"bytes": "224645"
}
],
"symlink_target": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.