text
stringlengths 4
5.48M
| meta
stringlengths 14
6.54k
|
---|---|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Aspose.Sitefinity.ExportUsersToWord")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Aspose.Sitefinity.ExportUsersToWord")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("1798a686-323c-464f-a636-3a39adea550b")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| {'content_hash': '38b9a1e5dee63a61c3730e5791dc54d5', 'timestamp': '', 'source': 'github', 'line_count': 35, 'max_line_length': 84, 'avg_line_length': 40.08571428571429, 'alnum_prop': 0.7540983606557377, 'repo_name': 'aspose-words/Aspose.Words-for-.NET', 'id': '05597515b0ba4447be66301236c701ee39852269', 'size': '1406', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'Plugins/Sitefinity/Aspose.Sitefinity.ExportUsersToWord/Properties/AssemblyInfo.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'ASP.NET', 'bytes': '113189'}, {'name': 'C#', 'bytes': '935653'}, {'name': 'CSS', 'bytes': '20447'}, {'name': 'HTML', 'bytes': '200130'}, {'name': 'JavaScript', 'bytes': '179162'}, {'name': 'PHP', 'bytes': '4795'}, {'name': 'Rich Text Format', 'bytes': '15884'}]} |
package libldt3.model.objekte;
import java.time.LocalDate;
import java.util.List;
import libldt3.annotations.Feld;
import libldt3.annotations.Feldart;
import libldt3.annotations.Objekt;
import libldt3.annotations.Regelsatz;
import libldt3.model.regel.F002;
import libldt3.model.regel.F015;
import libldt3.model.regel.F018;
import lombok.Getter;
import lombok.Setter;
/**
* In diesem Objekt wird das Muster 39, Grundlage für die
* Krebsfrüherkennungsuntersuchung für Frauen, abgebildet.
*/
@Objekt("0034")
public @Getter @Setter class KrebsfrueherkennungFrauen {
@Feld(value = "7295", feldart = Feldart.muss)
@Regelsatz(value = F002.class, laenge = 8)
private LocalDate untersuchungsTag;
@Feld(value = "7296", feldart = Feldart.kann)
@Regelsatz(laenge = 1)
private Boolean wiederholungsuntersuchung;
@Feld(value = "7297", feldart = Feldart.kann)
@Regelsatz(value = F018.class, laenge = 8)
private LocalDate letzteUntersuchung;
@Feld(value = "7298", feldart = Feldart.kann)
@Regelsatz(maxLaenge = 60)
private String nrLetzterZytologischerBefund;
@Feld(value = "7299", feldart = Feldart.kann)
@Regelsatz(maxLaenge = 6)
private String gruppeLetzterBefund;
@Feld(value = "7336", feldart = Feldart.kann)
@Regelsatz(laenge = 1)
private String gynaekologischeOpStrahlenOderChemotherapie;
@Feld(value = "7337", feldart = Feldart.bedingt_kann)
@Regelsatz(maxLaenge = 60)
private List<String> artGynaekologischeOpStrahlenOderChemotherapie;
@Feld(value = "7338", feldart = Feldart.kann)
@Regelsatz(value = F018.class, laenge = 8)
private LocalDate datumGynaekologischeOp;
@Feld(value = "3668", feldart = Feldart.kann)
@Regelsatz(laenge = 2)
private Integer anzahlSchwangerschaften;
@Feld(value = "8512", feldart = Feldart.kann)
@Regelsatz(value = F018.class, laenge = 8)
private LocalDate ersterTagLetzterZyklus;
@Feld(value = "7339", feldart = Feldart.kann)
@Regelsatz(laenge = 1)
private Boolean graviditaet;
@Feld(value = "7380", feldart = Feldart.kann)
@Regelsatz(laenge = 1)
private Boolean pathologischeGynaekologischeBlutungen;
@Feld(value = "7381", feldart = Feldart.kann)
@Regelsatz(laenge = 1)
private Boolean sonstigerAusfluss;
@Feld(value = "7382", feldart = Feldart.kann)
@Regelsatz(laenge = 1)
private Boolean iup;
@Feld(value = "7383", feldart = Feldart.kann)
@Regelsatz(laenge = 1)
private Boolean ovulationshemmer;
@Feld(value = "7384", feldart = Feldart.kann)
@Regelsatz(laenge = 1)
private Boolean sonstigeHormonanwendung;
@Feld(value = "7385", feldart = Feldart.kann)
@Regelsatz(laenge = 1)
private Boolean vulvaInspektionAuffaellig;
@Feld(value = "7386", feldart = Feldart.kann)
@Regelsatz(laenge = 1)
private Boolean portioUndVaginaAuffaellig;
@Feld(value = "7387", feldart = Feldart.kann)
@Regelsatz(laenge = 1)
private Boolean innereGenitaleAuffaellig;
@Feld(value = "7388", feldart = Feldart.kann)
@Regelsatz(laenge = 1)
private Boolean inguinaleLymphknotenAuffaellig;
@Feld(value = "7389", feldart = Feldart.kann)
@Regelsatz(laenge = 1)
private Boolean behandlungsbeduerftigeNebenbefunde;
@Feld(value = "7390", feldart = Feldart.kann)
@Regelsatz(laenge = 1)
private Boolean haut;
@Feld(value = "7391", feldart = Feldart.kann)
@Regelsatz(laenge = 1)
private Boolean mammaAuffaellig;
@Feld(value = "7392", feldart = Feldart.kann)
@Regelsatz(laenge = 1)
private Boolean axillaereLymphknotenAuffaellig;
@Feld(value = "7393", feldart = Feldart.kann)
@Regelsatz(laenge = 1)
private Boolean rektumKolonBlutOderSchleim;
@Feld(value = "7394", feldart = Feldart.kann)
@Regelsatz(laenge = 1)
private Boolean neuAufgetreteneUnregelmaessigkeiten;
@Feld(value = "7395", feldart = Feldart.kann)
@Regelsatz(laenge = 1)
private Boolean rektumKolonTastbefundAuffaellig;
@Feld(value = "7396", feldart = Feldart.kann)
@Regelsatz(laenge = 1)
private Boolean stuhltestZurueckgegeben;
@Feld(value = "7397", feldart = Feldart.kann)
@Regelsatz(laenge = 1)
private Boolean stuhltestPositiv;
@Feld(value = "7423", feldart = Feldart.kann)
@Regelsatz(maxLaenge = 60)
private Boolean gynaekologischeDiagnose;
@Feld(value = "7398", feldart = Feldart.kann)
@Regelsatz(value = F015.class, laenge = 7)
private String rrBlutdruck;
@Feld(value = "7399", feldart = Feldart.kann)
@Regelsatz(value = F015.class, laenge = 7)
private String rrZweiteMessung;
@Feld(value = "8167", name = "Zusaetzliche_Informationen", feldart = Feldart.kann)
@Regelsatz(laenge = 26)
private List<Fliesstext> zusaetzlicheInformationen;
}
| {'content_hash': 'eada81700fafbc18ee02f15abc3e8577', 'timestamp': '', 'source': 'github', 'line_count': 124, 'max_line_length': 83, 'avg_line_length': 36.29032258064516, 'alnum_prop': 0.7508888888888889, 'repo_name': 'egore/libldt3', 'id': 'b6c5f1a8ed4e79a96ea38e95d38f15422f68a147', 'size': '4503', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/main/java/libldt3/model/objekte/KrebsfrueherkennungFrauen.java', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Java', 'bytes': '389553'}]} |
using Foundation;
using System.CodeDom.Compiler;
namespace ToDoList.iOS
{
[Register ("SplashViewController")]
partial class SplashViewController
{
[Outlet]
UIKit.UIImageView LogoImage { get; set; }
[Outlet]
UIKit.UILabel LogoLabel { get; set; }
[Outlet]
UIKit.UILabel VersionLabel { get; set; }
void ReleaseDesignerOutlets ()
{
if (LogoImage != null) {
LogoImage.Dispose ();
LogoImage = null;
}
if (LogoLabel != null) {
LogoLabel.Dispose ();
LogoLabel = null;
}
if (VersionLabel != null) {
VersionLabel.Dispose ();
VersionLabel = null;
}
}
}
}
| {'content_hash': '3794cdf4b7462db88a51038103dfc45d', 'timestamp': '', 'source': 'github', 'line_count': 36, 'max_line_length': 43, 'avg_line_length': 17.11111111111111, 'alnum_prop': 0.6396103896103896, 'repo_name': 'mcampulla/ToDoList', 'id': '205a17618ad22c0c1a00d41875279e102bcafa92', 'size': '852', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'ToDoList/ToDoList.iOS/UI/MainController/SplashViewController.designer.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C#', 'bytes': '83863'}]} |
using System;
using Magellan.Utilities;
namespace Magellan.Exceptions
{
/// <summary>
/// Base class for exceptions thrown by the Magellan navigation framework.
/// </summary>
public abstract class NavigationException : Exception
{
/// <summary>
/// Initializes a new instance of the <see cref="NavigationException"/> class.
/// </summary>
/// <param name="message">The message.</param>
protected NavigationException(string message)
: base(message.CleanErrorMessage())
{
}
/// <summary>
/// Initializes a new instance of the <see cref="NavigationException"/> class.
/// </summary>
/// <param name="message">The message.</param>
/// <param name="inner">The inner.</param>
protected NavigationException(string message, Exception inner)
: base(message.CleanErrorMessage(), inner)
{
}
}
}
| {'content_hash': '68f141e9ddf9ae995bf21470c0e25a96', 'timestamp': '', 'source': 'github', 'line_count': 30, 'max_line_length': 86, 'avg_line_length': 31.9, 'alnum_prop': 0.5987460815047022, 'repo_name': 'rog1039/magellan-framework', 'id': '0603b8967e5deb382625b54653ef7c8618a76364', 'size': '959', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/Magellan/Exceptions/NavigationException.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'ASP', 'bytes': '1987'}, {'name': 'C#', 'bytes': '831633'}, {'name': 'Shell', 'bytes': '596'}]} |
require("ember-views/views/states/default");
require("ember-views/views/states/pre_render");
require("ember-views/views/states/in_buffer");
require("ember-views/views/states/has_element");
require("ember-views/views/states/in_dom");
require("ember-views/views/states/destroying");
Ember.View.cloneStates = function(from) {
var into = {};
into._default = {};
into.preRender = Ember.create(into._default);
into.destroying = Ember.create(into._default);
into.inBuffer = Ember.create(into._default);
into.hasElement = Ember.create(into._default);
into.inDOM = Ember.create(into.hasElement);
for (var stateName in from) {
if (!from.hasOwnProperty(stateName)) { continue; }
Ember.merge(into[stateName], from[stateName]);
}
return into;
};
| {'content_hash': 'aefc92bd90d8252a814d22c85d872361', 'timestamp': '', 'source': 'github', 'line_count': 24, 'max_line_length': 54, 'avg_line_length': 31.875, 'alnum_prop': 0.7137254901960784, 'repo_name': 'ebryn/ember.js', 'id': 'e41690840b698873bf890697d9787b8962afc6e1', 'size': '765', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'packages/ember-views/lib/views/states.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'JavaScript', 'bytes': '170638'}, {'name': 'Ruby', 'bytes': '7557'}, {'name': 'Shell', 'bytes': '3031'}]} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_24) on Tue May 01 09:56:12 CEST 2012 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
Uses of Class net.sourceforge.pmd.lang.java.ast.ASTTypeParameter (PMD 5.0.0 API)
</TITLE>
<META NAME="date" CONTENT="2012-05-01">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class net.sourceforge.pmd.lang.java.ast.ASTTypeParameter (PMD 5.0.0 API)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../net/sourceforge/pmd/lang/java/ast/ASTTypeParameter.html" title="class in net.sourceforge.pmd.lang.java.ast"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV
NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../../index.html?net/sourceforge/pmd/lang/java/ast//class-useASTTypeParameter.html" target="_top"><B>FRAMES</B></A>
<A HREF="ASTTypeParameter.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<CENTER>
<H2>
<B>Uses of Class<br>net.sourceforge.pmd.lang.java.ast.ASTTypeParameter</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="../../../../../../../net/sourceforge/pmd/lang/java/ast/ASTTypeParameter.html" title="class in net.sourceforge.pmd.lang.java.ast">ASTTypeParameter</A></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><A HREF="#net.sourceforge.pmd.lang.java.ast"><B>net.sourceforge.pmd.lang.java.ast</B></A></TD>
<TD> </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><A HREF="#net.sourceforge.pmd.lang.java.rule"><B>net.sourceforge.pmd.lang.java.rule</B></A></TD>
<TD> </TD>
</TR>
</TABLE>
<P>
<A NAME="net.sourceforge.pmd.lang.java.ast"><!-- --></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="../../../../../../../net/sourceforge/pmd/lang/java/ast/ASTTypeParameter.html" title="class in net.sourceforge.pmd.lang.java.ast">ASTTypeParameter</A> in <A HREF="../../../../../../../net/sourceforge/pmd/lang/java/ast/package-summary.html">net.sourceforge.pmd.lang.java.ast</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="../../../../../../../net/sourceforge/pmd/lang/java/ast/package-summary.html">net.sourceforge.pmd.lang.java.ast</A> with parameters of type <A HREF="../../../../../../../net/sourceforge/pmd/lang/java/ast/ASTTypeParameter.html" title="class in net.sourceforge.pmd.lang.java.ast">ASTTypeParameter</A></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></CODE></FONT></TD>
<TD><CODE><B>JavaParserVisitor.</B><B><A HREF="../../../../../../../net/sourceforge/pmd/lang/java/ast/JavaParserVisitor.html#visit(net.sourceforge.pmd.lang.java.ast.ASTTypeParameter, java.lang.Object)">visit</A></B>(<A HREF="../../../../../../../net/sourceforge/pmd/lang/java/ast/ASTTypeParameter.html" title="class in net.sourceforge.pmd.lang.java.ast">ASTTypeParameter</A> node,
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> data)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></CODE></FONT></TD>
<TD><CODE><B>JavaParserVisitorAdapter.</B><B><A HREF="../../../../../../../net/sourceforge/pmd/lang/java/ast/JavaParserVisitorAdapter.html#visit(net.sourceforge.pmd.lang.java.ast.ASTTypeParameter, java.lang.Object)">visit</A></B>(<A HREF="../../../../../../../net/sourceforge/pmd/lang/java/ast/ASTTypeParameter.html" title="class in net.sourceforge.pmd.lang.java.ast">ASTTypeParameter</A> node,
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> data)</CODE>
<BR>
</TD>
</TR>
</TABLE>
<P>
<A NAME="net.sourceforge.pmd.lang.java.rule"><!-- --></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="../../../../../../../net/sourceforge/pmd/lang/java/ast/ASTTypeParameter.html" title="class in net.sourceforge.pmd.lang.java.ast">ASTTypeParameter</A> in <A HREF="../../../../../../../net/sourceforge/pmd/lang/java/rule/package-summary.html">net.sourceforge.pmd.lang.java.rule</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="../../../../../../../net/sourceforge/pmd/lang/java/rule/package-summary.html">net.sourceforge.pmd.lang.java.rule</A> with parameters of type <A HREF="../../../../../../../net/sourceforge/pmd/lang/java/ast/ASTTypeParameter.html" title="class in net.sourceforge.pmd.lang.java.ast">ASTTypeParameter</A></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></CODE></FONT></TD>
<TD><CODE><B>AbstractJavaRule.</B><B><A HREF="../../../../../../../net/sourceforge/pmd/lang/java/rule/AbstractJavaRule.html#visit(net.sourceforge.pmd.lang.java.ast.ASTTypeParameter, java.lang.Object)">visit</A></B>(<A HREF="../../../../../../../net/sourceforge/pmd/lang/java/ast/ASTTypeParameter.html" title="class in net.sourceforge.pmd.lang.java.ast">ASTTypeParameter</A> node,
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> data)</CODE>
<BR>
</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="../../../../../../../net/sourceforge/pmd/lang/java/ast/ASTTypeParameter.html" title="class in net.sourceforge.pmd.lang.java.ast"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV
NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../../index.html?net/sourceforge/pmd/lang/java/ast//class-useASTTypeParameter.html" target="_top"><B>FRAMES</B></A>
<A HREF="ASTTypeParameter.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
Copyright © 2002-2012 <a href="http://pmd.sourceforge.net/">InfoEther</a>. All Rights Reserved.
</BODY>
</HTML>
| {'content_hash': '0afd3022848917ee9492756c20d9d6a5', 'timestamp': '', 'source': 'github', 'line_count': 221, 'max_line_length': 399, 'avg_line_length': 53.959276018099544, 'alnum_prop': 0.6430188679245283, 'repo_name': 'daejunpark/jsaf', 'id': '5dcd45854404270b66eed7168789742405f4b8ed', 'size': '11925', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'third_party/pmd/docs/apidocs/net/sourceforge/pmd/lang/java/ast/class-use/ASTTypeParameter.html', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'ApacheConf', 'bytes': '379'}, {'name': 'C', 'bytes': '59067'}, {'name': 'C++', 'bytes': '13294'}, {'name': 'CSS', 'bytes': '9351891'}, {'name': 'Emacs Lisp', 'bytes': '9812'}, {'name': 'HTML', 'bytes': '19106074'}, {'name': 'Jasmin', 'bytes': '46'}, {'name': 'Java', 'bytes': '375421'}, {'name': 'JavaScript', 'bytes': '51177272'}, {'name': 'Makefile', 'bytes': '3558'}, {'name': 'Objective-C', 'bytes': '345276'}, {'name': 'Objective-J', 'bytes': '4500028'}, {'name': 'PHP', 'bytes': '12684'}, {'name': 'Perl', 'bytes': '5278'}, {'name': 'Python', 'bytes': '75059'}, {'name': 'Ruby', 'bytes': '22932'}, {'name': 'Scala', 'bytes': '5542753'}, {'name': 'Shell', 'bytes': '91018'}, {'name': 'VimL', 'bytes': '6985'}, {'name': 'XML', 'bytes': '1288109'}]} |
namespace leveldb {
static const int kValueSize = 1000;
class CorruptionTest {
public:
test::ErrorEnv env_;
std::string dbname_;
Cache* tiny_cache_;
Options options_;
DB* db_;
CorruptionTest() {
tiny_cache_ = NewLRUCache(100);
options_.env = &env_;
dbname_ = PathJoin(test::TmpDir(), "db_test");
DestroyDB(dbname_, options_);
db_ = NULL;
options_.create_if_missing = true;
Reopen();
options_.create_if_missing = false;
}
~CorruptionTest() {
delete db_;
DestroyDB(dbname_, Options());
delete tiny_cache_;
}
Status TryReopen(Options* options = NULL) {
delete db_;
db_ = NULL;
Options opt = (options ? *options : options_);
opt.env = &env_;
opt.block_cache = tiny_cache_;
return DB::Open(opt, dbname_, &db_);
}
void Reopen(Options* options = NULL) {
ASSERT_OK(TryReopen(options));
}
void RepairDB() {
delete db_;
db_ = NULL;
ASSERT_OK(::leveldb::RepairDB(dbname_, options_));
}
void Build(int n) {
std::string key_space, value_space;
WriteBatch batch;
for (int i = 0; i < n; i++) {
//if ((i % 100) == 0) fprintf(stderr, "@ %d of %d\n", i, n);
Slice key = Key(i, &key_space);
batch.Clear();
batch.Put(key, Value(i, &value_space));
ASSERT_OK(db_->Write(WriteOptions(), &batch));
}
}
void Check(int min_expected, int max_expected) {
int next_expected = 0;
int missed = 0;
int bad_keys = 0;
int bad_values = 0;
int correct = 0;
std::string value_space;
Iterator* iter = db_->NewIterator(ReadOptions());
for (iter->SeekToFirst(); iter->Valid(); iter->Next()) {
uint64_t key;
Slice in(iter->key());
if (!ConsumeDecimalNumber(&in, &key) ||
!in.empty() ||
key < next_expected) {
bad_keys++;
continue;
}
missed += (key - next_expected);
next_expected = key + 1;
if (iter->value() != Value(key, &value_space)) {
bad_values++;
} else {
correct++;
}
}
delete iter;
fprintf(stderr,
"expected=%d..%d; got=%d; bad_keys=%d; bad_values=%d; missed=%d\n",
min_expected, max_expected, correct, bad_keys, bad_values, missed);
ASSERT_LE(min_expected, correct);
ASSERT_GE(max_expected, correct);
}
void Corrupt(FileType filetype, int offset, int bytes_to_corrupt) {
Status s;
// Pick file to corrupt
std::vector<std::string> filenames;
ASSERT_OK(env_.GetChildren(dbname_, &filenames));
uint64_t number;
FileType type;
std::string fname;
int picked_number = -1;
for (int i = 0; i < filenames.size(); i++) {
if (ParseFileName(filenames[i], &number, &type) &&
type == filetype &&
int(number) > picked_number) { // Pick latest file
fname = PathJoin(dbname_, filenames[i]);
picked_number = number;
}
}
ASSERT_TRUE(!fname.empty()) << filetype;
uint64_t file_size;
s = env_.GetFileSize(fname, &file_size);
if (!s.ok()) {
ASSERT_TRUE(false) << fname << ": " << s.ToString();
}
int fsize = (int)file_size;
if (offset < 0) {
// Relative to end of file; make it absolute
if (-offset > fsize) {
offset = 0;
} else {
offset = fsize + offset;
}
}
if (offset > fsize) {
offset = fsize;
}
if (offset + bytes_to_corrupt > fsize) {
bytes_to_corrupt = fsize - offset;
}
// Do it
std::string contents;
s = ReadFileToString(Env::Default(), fname, &contents);
ASSERT_TRUE(s.ok()) << s.ToString();
for (int i = 0; i < bytes_to_corrupt; i++) {
contents[i + offset] ^= 0x80;
}
s = WriteStringToFile(Env::Default(), contents, fname);
ASSERT_TRUE(s.ok()) << s.ToString();
}
int Property(const std::string& name) {
std::string property;
int result;
if (db_->GetProperty(name, &property) &&
sscanf(property.c_str(), "%d", &result) == 1) {
return result;
} else {
return -1;
}
}
// Return the ith key
Slice Key(int i, std::string* storage) {
char buf[100];
snprintf(buf, sizeof(buf), "%016d", i);
storage->assign(buf, strlen(buf));
return Slice(*storage);
}
// Return the value to associate with the specified key
Slice Value(int k, std::string* storage) {
Random r(k);
return test::RandomString(&r, kValueSize, storage);
}
};
TEST(CorruptionTest, Recovery) {
Build(100);
Check(100, 100);
Corrupt(kLogFile, 19, 1); // WriteBatch tag for first record
Corrupt(kLogFile, log::kBlockSize + 1000, 1); // Somewhere in second block
Reopen();
// The 64 records in the first two log blocks are completely lost.
Check(36, 36);
}
TEST(CorruptionTest, RecoverWriteError) {
env_.writable_file_error_ = true;
Status s = TryReopen();
ASSERT_TRUE(!s.ok());
}
TEST(CorruptionTest, NewFileErrorDuringWrite) {
// Do enough writing to force minor compaction
env_.writable_file_error_ = true;
const int num = 3 + (Options().write_buffer_size / kValueSize);
std::string value_storage;
Status s;
for (int i = 0; s.ok() && i < num; i++) {
WriteBatch batch;
batch.Put("a", Value(100, &value_storage));
s = db_->Write(WriteOptions(), &batch);
}
ASSERT_TRUE(!s.ok());
ASSERT_GE(env_.num_writable_file_errors_, 1);
env_.writable_file_error_ = false;
Reopen();
}
TEST(CorruptionTest, TableFile) {
Build(100);
DBImpl* dbi = reinterpret_cast<DBImpl*>(db_);
dbi->TEST_CompactMemTable();
dbi->TEST_CompactRange(0, NULL, NULL);
dbi->TEST_CompactRange(1, NULL, NULL);
Corrupt(kTableFile, 100, 1);
Check(99, 99);
}
TEST(CorruptionTest, TableFileIndexData) {
Build(10000); // Enough to build multiple Tables
DBImpl* dbi = reinterpret_cast<DBImpl*>(db_);
dbi->TEST_CompactMemTable();
Corrupt(kTableFile, -2000, 500);
Reopen();
Check(5000, 9999);
}
TEST(CorruptionTest, MissingDescriptor) {
Build(1000);
RepairDB();
Reopen();
Check(1000, 1000);
}
TEST(CorruptionTest, SequenceNumberRecovery) {
ASSERT_OK(db_->Put(WriteOptions(), "foo", "v1"));
ASSERT_OK(db_->Put(WriteOptions(), "foo", "v2"));
ASSERT_OK(db_->Put(WriteOptions(), "foo", "v3"));
ASSERT_OK(db_->Put(WriteOptions(), "foo", "v4"));
ASSERT_OK(db_->Put(WriteOptions(), "foo", "v5"));
RepairDB();
Reopen();
std::string v;
ASSERT_OK(db_->Get(ReadOptions(), "foo", &v));
ASSERT_EQ("v5", v);
// Write something. If sequence number was not recovered properly,
// it will be hidden by an earlier write.
ASSERT_OK(db_->Put(WriteOptions(), "foo", "v6"));
ASSERT_OK(db_->Get(ReadOptions(), "foo", &v));
ASSERT_EQ("v6", v);
Reopen();
ASSERT_OK(db_->Get(ReadOptions(), "foo", &v));
ASSERT_EQ("v6", v);
}
TEST(CorruptionTest, CorruptedDescriptor) {
ASSERT_OK(db_->Put(WriteOptions(), "foo", "hello"));
DBImpl* dbi = reinterpret_cast<DBImpl*>(db_);
dbi->TEST_CompactMemTable();
dbi->TEST_CompactRange(0, NULL, NULL);
Corrupt(kDescriptorFile, 0, 1000);
Status s = TryReopen();
ASSERT_TRUE(!s.ok());
RepairDB();
Reopen();
std::string v;
ASSERT_OK(db_->Get(ReadOptions(), "foo", &v));
ASSERT_EQ("hello", v);
}
TEST(CorruptionTest, CompactionInputError) {
Build(10);
DBImpl* dbi = reinterpret_cast<DBImpl*>(db_);
dbi->TEST_CompactMemTable();
const int last = config::kMaxMemCompactLevel;
ASSERT_EQ(1, Property("leveldb.num-files-at-level" + NumberToString(last)));
Corrupt(kTableFile, 100, 1);
Check(9, 9);
// Force compactions by writing lots of values
Build(10000);
Check(10000, 10000);
}
TEST(CorruptionTest, CompactionInputErrorParanoid) {
Options options;
options.paranoid_checks = true;
options.write_buffer_size = 1048576;
Reopen(&options);
DBImpl* dbi = reinterpret_cast<DBImpl*>(db_);
// Fill levels >= 1 so memtable compaction outputs to level 1
for (int level = 1; level < config::kNumLevels; level++) {
dbi->Put(WriteOptions(), "", "begin");
dbi->Put(WriteOptions(), "~", "end");
dbi->TEST_CompactMemTable();
}
Build(10);
dbi->TEST_CompactMemTable();
ASSERT_EQ(1, Property("leveldb.num-files-at-level0"));
Corrupt(kTableFile, 100, 1);
Check(9, 9);
// Write must eventually fail because of corrupted table
Status s;
std::string tmp1, tmp2;
for (int i = 0; i < 10000 && s.ok(); i++) {
s = db_->Put(WriteOptions(), Key(i, &tmp1), Value(i, &tmp2));
}
ASSERT_TRUE(!s.ok()) << "write did not fail in corrupted paranoid db";
}
TEST(CorruptionTest, UnrelatedKeys) {
Build(10);
DBImpl* dbi = reinterpret_cast<DBImpl*>(db_);
dbi->TEST_CompactMemTable();
Corrupt(kTableFile, 100, 1);
std::string tmp1, tmp2;
ASSERT_OK(db_->Put(WriteOptions(), Key(1000, &tmp1), Value(1000, &tmp2)));
std::string v;
ASSERT_OK(db_->Get(ReadOptions(), Key(1000, &tmp1), &v));
ASSERT_EQ(Value(1000, &tmp2).ToString(), v);
dbi->TEST_CompactMemTable();
ASSERT_OK(db_->Get(ReadOptions(), Key(1000, &tmp1), &v));
ASSERT_EQ(Value(1000, &tmp2).ToString(), v);
}
} // namespace leveldb
int main(int argc, char** argv) {
return leveldb::test::RunAllTests();
}
| {'content_hash': '1c3452da5221a9bb18ee67053ff91093', 'timestamp': '', 'source': 'github', 'line_count': 339, 'max_line_length': 79, 'avg_line_length': 26.997050147492626, 'alnum_prop': 0.6067526223776224, 'repo_name': 'goodspeed24e/Programming', 'id': 'f745e928480e37e8fe74239376739d06a3d9fb56', 'size': '9777', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'indexDB/db/corruption_test.cc', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Assembly', 'bytes': '220979'}, {'name': 'C', 'bytes': '763318'}, {'name': 'C#', 'bytes': '13999'}, {'name': 'C++', 'bytes': '3512214'}, {'name': 'CMake', 'bytes': '17939'}, {'name': 'CSS', 'bytes': '11009'}, {'name': 'HTML', 'bytes': '749328'}, {'name': 'JavaScript', 'bytes': '11824'}, {'name': 'Makefile', 'bytes': '31218'}, {'name': 'Objective-C', 'bytes': '14708'}, {'name': 'PHP', 'bytes': '1125216'}, {'name': 'Python', 'bytes': '70969'}, {'name': 'Ruby', 'bytes': '1105'}, {'name': 'Shell', 'bytes': '7300'}]} |
class GroupsController < ApplicationController
before_action :authenticate_user!
respond_to :html, :js
def index
@groups = user_groups
end
def new
@group = Group.new
end
def show
@group = Group.find(params[:id])
unless show?
redirect_to root_url, notice: "Sorry, that action is not allowed."
end
end
def create
@group = Group.create(group_params)
if @group.save
redirect_to user_path(current_user), notice: "Group created."
else
# something
render "new"
end
end
def edit
@group = Group.find(params[:id])
unless show?
redirect_to root_url, notice: "Sorry, that action is not allowed."
end
end
def update
@group = Group.find(params[:id])
if @group.update(group_params)
redirect_to user_path(current_user), notice: "Group updated."
else
render "edit"
end
end
def destroy
@group = Group.find(params[:id])
@group.destroy
redirect_to user_path(current_user)
end
private
def show?
if user_groups.include?(@group)
true
else
false
end
end
def user_groups
groups = current_user.groups
end
def group_params
params.require(:group).permit(:name, :body, :user_id, friend_ids: [])
end
end
| {'content_hash': 'bf0b5ccb2831d5c1a84bb0a46b615fdb', 'timestamp': '', 'source': 'github', 'line_count': 70, 'max_line_length': 74, 'avg_line_length': 18.357142857142858, 'alnum_prop': 0.6280155642023346, 'repo_name': 'finvansant/Sparrow_app', 'id': 'b63a4fa2201ec9d41d08c87a26951b88ca614554', 'size': '1285', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'app/controllers/groups_controller.rb', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '5120'}, {'name': 'CoffeeScript', 'bytes': '633'}, {'name': 'HTML', 'bytes': '13823'}, {'name': 'JavaScript', 'bytes': '776'}, {'name': 'Ruby', 'bytes': '76662'}]} |
package org.thoughtslive.jenkins.plugins.jira.steps;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.powermock.api.mockito.PowerMockito.spy;
import java.io.PrintStream;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
import org.thoughtslive.jenkins.plugins.jira.Site;
import org.thoughtslive.jenkins.plugins.jira.api.Notify;
import org.thoughtslive.jenkins.plugins.jira.api.ResponseData;
import org.thoughtslive.jenkins.plugins.jira.api.ResponseData.ResponseDataBuilder;
import org.thoughtslive.jenkins.plugins.jira.service.JiraService;
import hudson.AbortException;
import hudson.EnvVars;
import hudson.model.Run;
import hudson.model.TaskListener;
/**
* Unit test cases for NotifyIssueStep class.
*
* @author Naresh Rayapati
*
*/
@RunWith(PowerMockRunner.class)
@PrepareForTest({NotifyIssueStep.class, Site.class})
public class NotifyIssueStepTest {
@Mock
TaskListener taskListenerMock;
@Mock
Run<?, ?> runMock;
@Mock
EnvVars envVarsMock;
@Mock
PrintStream printStreamMock;
@Mock
JiraService jiraServiceMock;
@Mock
Site siteMock;
@Mock
Notify notifyMock;
NotifyIssueStep.Execution stepExecution;
@Before
public void setup() {
// Prepare site.
when(envVarsMock.get("JIRA_SITE")).thenReturn("LOCAL");
when(envVarsMock.get("BUILD_URL")).thenReturn("http://localhost:8080/jira-testing/job/01");
PowerMockito.mockStatic(Site.class);
Mockito.when(Site.get(any())).thenReturn(siteMock);
when(siteMock.getService()).thenReturn(jiraServiceMock);
stepExecution = spy(new NotifyIssueStep.Execution());
when(runMock.getCauses()).thenReturn(null);
when(taskListenerMock.getLogger()).thenReturn(printStreamMock);
doNothing().when(printStreamMock).println();
final ResponseDataBuilder<Void> builder = ResponseData.builder();
when(jiraServiceMock.notifyIssue(anyString(), any())).thenReturn(builder.successful(true).code(200).message("Success").build());
stepExecution.listener = taskListenerMock;
stepExecution.envVars = envVarsMock;
stepExecution.run = runMock;
doReturn(jiraServiceMock).when(stepExecution).getJiraService(any());
}
@Test
public void testWithEmptyIdOrKeyThrowsAbortException() throws Exception {
final NotifyIssueStep step = new NotifyIssueStep("", notifyMock);
stepExecution.step = step;
// Execute and assert Test.
assertThatExceptionOfType(AbortException.class).isThrownBy(() -> {
stepExecution.run();
}).withMessage("idOrKey is empty or null.").withStackTraceContaining("AbortException").withNoCause();
}
@Test
public void testSuccessfulNotifyIssue() throws Exception {
final NotifyIssueStep step = new NotifyIssueStep("TEST-1", notifyMock);
stepExecution.step = step;
// Execute Test.
stepExecution.run();
// Assert Test
verify(jiraServiceMock, times(1)).notifyIssue("TEST-1", notifyMock);
assertThat(stepExecution.step.isFailOnError()).isEqualTo(true);
}
} | {'content_hash': '3ed88cf592d24dbb681a2b55a0663912', 'timestamp': '', 'source': 'github', 'line_count': 112, 'max_line_length': 130, 'avg_line_length': 31.482142857142858, 'alnum_prop': 0.7855927396483268, 'repo_name': 'ThoughtsLive/jira-steps', 'id': '0dadf3956f572197e88ec0fe9d99365162c72f98', 'size': '3526', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/test/java/org/thoughtslive/jenkins/plugins/jira/steps/NotifyIssueStepTest.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '251862'}]} |
<?php
// Declare our namespace and use block.
namespace App\Model;
use Illuminate\Database\Eloquent\Model;
/**
* Definition of the Tag Model class.
*/
class Tag extends Model implements iNamed
{
// Declare our traits.
use tNamed;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = ['name'];
/**
* The database table used by the model.
*
* @var string
*/
protected $table = 'tags';
/**
* Defines a Belongs To Many relationship with the Review Library model.
*
* @return Illuminate\Database\Eloquent\Relations\MorphToMany
* The defined relationship.
*/
public function reviewLibraries()
{
return $this->morphedByMany(
'App\Model\Library\Review',
'taggable',
null,
null,
'library_review_id'
);
}
}
| {'content_hash': 'd8361934730f586c5c6baf8052987d78', 'timestamp': '', 'source': 'github', 'line_count': 47, 'max_line_length': 76, 'avg_line_length': 19.595744680851062, 'alnum_prop': 0.5743756786102063, 'repo_name': 'caliginousoft/luv-it', 'id': '0da8c24b1ade60b0bb98af5acb32e7c87012e8af', 'size': '1175', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'app/Model/Tag.php', 'mode': '33261', 'license': 'bsd-2-clause', 'language': [{'name': 'ApacheConf', 'bytes': '430'}, {'name': 'CSS', 'bytes': '72'}, {'name': 'JavaScript', 'bytes': '503'}, {'name': 'PHP', 'bytes': '122296'}]} |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>private</groupId>
<!-- Artifact Id must be in a form of "${product}.${vendor}.${platform}", those properties will be extracted from it later by regexp -->
<!-- The product is "jre", the vendor is one of {oracle, openjdk}, and the platform is one of {masOS, win32, win64, linux32, linux64} -->
<artifactId>jre.intellij.macOS</artifactId>
<!-- JRE version, e.g.,1.8.0_102, ... -->
<version>8u152b1056.10</version>
<name>The entire JRE packed into the JAR.</name>
<description>This is handy for building installers or deploy as required. Helps reducing the size of the source code repository.</description>
<!--name>Nuix Native Launcher.</name>
<description>This is handy for inclusion with an HTTP Server. Helps reducing the size of the source code repository.</description-->
<organization>
<name>Individual</name>
<url>https://github.com/alex-vas/jar-pack</url>
</organization>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.12</version>
<executions>
<!-- Perform series of regular expressions to set up some properties -->
<execution>
<id>regex-product-property</id>
<goals>
<goal>regex-property</goal>
</goals>
<configuration>
<name>packed.product</name>
<value>${project.artifactId}</value>
<regex>^([^.]+)\.([^.]+)\.([^.]+)$</regex>
<replacement>$1</replacement>
<failIfNoMatch>true</failIfNoMatch>
</configuration>
</execution>
<execution>
<id>regex-vendor-property</id>
<goals>
<goal>regex-property</goal>
</goals>
<configuration>
<name>packed.vendor</name>
<value>${project.artifactId}</value>
<regex>^([^.]+)\.([^.]+)\.([^.]+)$</regex>
<replacement>$2</replacement>
<failIfNoMatch>true</failIfNoMatch>
</configuration>
</execution>
<execution>
<id>regex-platform-property</id>
<goals>
<goal>regex-property</goal>
</goals>
<configuration>
<name>packed.platform</name>
<value>${project.artifactId}</value>
<regex>^([^.]+)\.([^.]+)\.([^.]+)$</regex>
<replacement>$3</replacement>
<failIfNoMatch>true</failIfNoMatch>
</configuration>
</execution>
<execution>
<id>regex-path-property</id>
<goals>
<goal>regex-property</goal>
</goals>
<configuration>
<name>packed.path</name>
<value>${project.artifactId}-${project.version}</value>
<regex>.*</regex>
<replacement>$0</replacement>
<failIfNoMatch>true</failIfNoMatch>
</configuration>
</execution>
<execution>
<id>regex-classname-property</id>
<goals>
<goal>regex-property</goal>
</goals>
<configuration>
<name>packed.class.name</name>
<value>JarPack_${packed.product}_${packed.vendor}_${packed.platform}_${project.version}</value>
<regex>\W</regex>
<replacement>_</replacement>
<failIfNoMatch>false</failIfNoMatch>
</configuration>
</execution>
<!-- Include generated source with compile -->
<execution>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${project.build.directory}/generated-sources/replacer</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<!-- Generate the source code -->
<plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>replacer</artifactId>
<version>1.5.3</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>replace</goal>
</goals>
</execution>
</executions>
<configuration>
<file>${basedir}/src/main/java/com/nuix/utils/jarpack/impl/JarPackImplementationTemplate.java</file>
<outputFile>${basedir}/target/generated-sources/replacer/com/nuix/utils/jarpack/impl/${packed.class.name}.java</outputFile>
<replacements>
<replacement>
<token>JarPackImplementationTemplate</token>
<value>\${packed.class.name}</value>
</replacement>
<replacement>
<token>"product"</token>
<value>"\${packed.product}"</value>
</replacement>
<replacement>
<token>"vendor"</token>
<value>"\${packed.vendor}"</value>
</replacement>
<replacement>
<token>"platform"</token>
<value>"\${packed.platform}"</value>
</replacement>
<replacement>
<token>"version"</token>
<value>"\${project.version}"</value>
</replacement>
<replacement>
<token>"path"</token>
<value>"\${packed.path}"</value>
</replacement>
</replacements>
</configuration>
</plugin>
<!-- Specify Java Source code level -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<!-- Copy data/ directory into the jar -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>compile</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<!-- XXX Check the progress of https://issues.apache.org/jira/browse/MRESOURCES-132 and https://issues.apache.org/jira/browse/MRESOURCES-236
What we really want is to copy permissions (specifically chmod +x) into the archive -->
<outputDirectory>${basedir}/target/classes/${packed.path}</outputDirectory>
<resources>
<resource>
<directory>data</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<!-- Set JRE permissions for files (specifically chmod +x) // this is to compensate for the fact that resource copy routine above doesn't copy permissions, see the comment above -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<id>chmod-resources</id>
<phase>compile</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<!-- JRE files -->
<chmod dir="${basedir}/target/classes" includes="**/bin/*" perm="+x"/>
<chmod dir="${basedir}/target/classes" includes="**/lib/jspawnhelper" perm="+x"/> <!-- macOS -->
<chmod dir="${basedir}/target/classes" includes="**/lib/**/*.dylib*" perm="+x"/> <!-- macOS -->
<chmod dir="${basedir}/target/classes" includes="**/lib/jexec" perm="+x"/> <!-- Linux -->
<chmod dir="${basedir}/target/classes" includes="**/lib/**/*.so" perm="+x"/> <!-- Linux -->
</target>
</configuration>
</execution>
</executions>
</plugin>
<!-- Generate list and MD5s for the data/ files -->
<plugin>
<groupId>net.ju-n.maven.plugins</groupId>
<artifactId>checksum-maven-plugin</artifactId>
<version>1.3</version>
<executions>
<execution>
<id>generate-artifact-checksum</id>
<phase>prepare-package</phase>
<goals>
<goal>files</goal>
</goals>
</execution>
</executions>
<configuration>
<fileSets>
<fileSet>
<directory>data</directory>
</fileSet>
</fileSets>
<includeRelativePath>true</includeRelativePath>
<individualFiles>false</individualFiles>
<csvSummary>false</csvSummary>
<xmlSummary>true</xmlSummary>
<xmlSummaryFile>${basedir}/target/classes/META-INF/${packed.path}/file-list.xml</xmlSummaryFile>
</configuration>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<!-- Eclipse auto-generated code -->
<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<versionRange>[1.12,)</versionRange>
<goals>
<goal>regex-property</goal>
<goal>add-source</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute />
</action>
</pluginExecution>
<pluginExecution>
<pluginExecutionFilter>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>replacer</artifactId>
<versionRange>[1.5.3,)</versionRange>
<goals>
<goal>replace</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
| {'content_hash': '9c04b21ee502782c683afab7aee9ae9f', 'timestamp': '', 'source': 'github', 'line_count': 310, 'max_line_length': 193, 'avg_line_length': 47.480645161290326, 'alnum_prop': 0.41178069162307224, 'repo_name': 'alex-vas/jar-pack', 'id': '0e8bbf1c556902cfbfbaccc8920bc69105f3201b', 'size': '14719', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'pom.xml', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '6134'}, {'name': 'Shell', 'bytes': '161'}]} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_151) on Sun Mar 17 11:03:40 MST 2019 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Uses of Class org.wildfly.swarm.config.resource.adapters.resource_adapter.AdminObjects (BOM: * : All 2.4.0.Final API)</title>
<meta name="date" content="2019-03-17">
<link rel="stylesheet" type="text/css" href="../../../../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class org.wildfly.swarm.config.resource.adapters.resource_adapter.AdminObjects (BOM: * : All 2.4.0.Final API)";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../../../org/wildfly/swarm/config/resource/adapters/resource_adapter/AdminObjects.html" title="class in org.wildfly.swarm.config.resource.adapters.resource_adapter">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../../../../../../../../overview-tree.html">Tree</a></li>
<li><a href="../../../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage">Thorntail API, 2.4.0.Final</div>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../../index.html?org/wildfly/swarm/config/resource/adapters/resource_adapter/class-use/AdminObjects.html" target="_top">Frames</a></li>
<li><a href="AdminObjects.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h2 title="Uses of Class org.wildfly.swarm.config.resource.adapters.resource_adapter.AdminObjects" class="title">Uses of Class<br>org.wildfly.swarm.config.resource.adapters.resource_adapter.AdminObjects</h2>
</div>
<div class="classUseContainer">
<ul class="blockList">
<li class="blockList">
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation">
<caption><span>Packages that use <a href="../../../../../../../../org/wildfly/swarm/config/resource/adapters/resource_adapter/AdminObjects.html" title="class in org.wildfly.swarm.config.resource.adapters.resource_adapter">AdminObjects</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Package</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="#org.wildfly.swarm.config.resource.adapters">org.wildfly.swarm.config.resource.adapters</a></td>
<td class="colLast"> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="#org.wildfly.swarm.config.resource.adapters.resource_adapter">org.wildfly.swarm.config.resource.adapters.resource_adapter</a></td>
<td class="colLast"> </td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="org.wildfly.swarm.config.resource.adapters">
<!-- -->
</a>
<h3>Uses of <a href="../../../../../../../../org/wildfly/swarm/config/resource/adapters/resource_adapter/AdminObjects.html" title="class in org.wildfly.swarm.config.resource.adapters.resource_adapter">AdminObjects</a> in <a href="../../../../../../../../org/wildfly/swarm/config/resource/adapters/package-summary.html">org.wildfly.swarm.config.resource.adapters</a></h3>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../../../../org/wildfly/swarm/config/resource/adapters/package-summary.html">org.wildfly.swarm.config.resource.adapters</a> that return <a href="../../../../../../../../org/wildfly/swarm/config/resource/adapters/resource_adapter/AdminObjects.html" title="class in org.wildfly.swarm.config.resource.adapters.resource_adapter">AdminObjects</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../../../org/wildfly/swarm/config/resource/adapters/resource_adapter/AdminObjects.html" title="class in org.wildfly.swarm.config.resource.adapters.resource_adapter">AdminObjects</a></code></td>
<td class="colLast"><span class="typeNameLabel">ResourceAdapter.ResourceAdapterResources.</span><code><span class="memberNameLink"><a href="../../../../../../../../org/wildfly/swarm/config/resource/adapters/ResourceAdapter.ResourceAdapterResources.html#adminObjects-java.lang.String-">adminObjects</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> key)</code> </td>
</tr>
</tbody>
</table>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../../../../org/wildfly/swarm/config/resource/adapters/package-summary.html">org.wildfly.swarm.config.resource.adapters</a> that return types with arguments of type <a href="../../../../../../../../org/wildfly/swarm/config/resource/adapters/resource_adapter/AdminObjects.html" title="class in org.wildfly.swarm.config.resource.adapters.resource_adapter">AdminObjects</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a><<a href="../../../../../../../../org/wildfly/swarm/config/resource/adapters/resource_adapter/AdminObjects.html" title="class in org.wildfly.swarm.config.resource.adapters.resource_adapter">AdminObjects</a>></code></td>
<td class="colLast"><span class="typeNameLabel">ResourceAdapter.ResourceAdapterResources.</span><code><span class="memberNameLink"><a href="../../../../../../../../org/wildfly/swarm/config/resource/adapters/ResourceAdapter.ResourceAdapterResources.html#adminObjects--">adminObjects</a></span>()</code>
<div class="block">Get the list of AdminObjects resources</div>
</td>
</tr>
</tbody>
</table>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../../../../org/wildfly/swarm/config/resource/adapters/package-summary.html">org.wildfly.swarm.config.resource.adapters</a> with parameters of type <a href="../../../../../../../../org/wildfly/swarm/config/resource/adapters/resource_adapter/AdminObjects.html" title="class in org.wildfly.swarm.config.resource.adapters.resource_adapter">AdminObjects</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../../../org/wildfly/swarm/config/resource/adapters/ResourceAdapter.html" title="type parameter in ResourceAdapter">T</a></code></td>
<td class="colLast"><span class="typeNameLabel">ResourceAdapter.</span><code><span class="memberNameLink"><a href="../../../../../../../../org/wildfly/swarm/config/resource/adapters/ResourceAdapter.html#adminObjects-org.wildfly.swarm.config.resource.adapters.resource_adapter.AdminObjects-">adminObjects</a></span>(<a href="../../../../../../../../org/wildfly/swarm/config/resource/adapters/resource_adapter/AdminObjects.html" title="class in org.wildfly.swarm.config.resource.adapters.resource_adapter">AdminObjects</a> value)</code>
<div class="block">Add the AdminObjects object to the list of subresources</div>
</td>
</tr>
</tbody>
</table>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Method parameters in <a href="../../../../../../../../org/wildfly/swarm/config/resource/adapters/package-summary.html">org.wildfly.swarm.config.resource.adapters</a> with type arguments of type <a href="../../../../../../../../org/wildfly/swarm/config/resource/adapters/resource_adapter/AdminObjects.html" title="class in org.wildfly.swarm.config.resource.adapters.resource_adapter">AdminObjects</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../../../org/wildfly/swarm/config/resource/adapters/ResourceAdapter.html" title="type parameter in ResourceAdapter">T</a></code></td>
<td class="colLast"><span class="typeNameLabel">ResourceAdapter.</span><code><span class="memberNameLink"><a href="../../../../../../../../org/wildfly/swarm/config/resource/adapters/ResourceAdapter.html#adminObjects-java.util.List-">adminObjects</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a><<a href="../../../../../../../../org/wildfly/swarm/config/resource/adapters/resource_adapter/AdminObjects.html" title="class in org.wildfly.swarm.config.resource.adapters.resource_adapter">AdminObjects</a>> value)</code>
<div class="block">Add all AdminObjects objects to this subresource</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList"><a name="org.wildfly.swarm.config.resource.adapters.resource_adapter">
<!-- -->
</a>
<h3>Uses of <a href="../../../../../../../../org/wildfly/swarm/config/resource/adapters/resource_adapter/AdminObjects.html" title="class in org.wildfly.swarm.config.resource.adapters.resource_adapter">AdminObjects</a> in <a href="../../../../../../../../org/wildfly/swarm/config/resource/adapters/resource_adapter/package-summary.html">org.wildfly.swarm.config.resource.adapters.resource_adapter</a></h3>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing classes, and an explanation">
<caption><span>Classes in <a href="../../../../../../../../org/wildfly/swarm/config/resource/adapters/resource_adapter/package-summary.html">org.wildfly.swarm.config.resource.adapters.resource_adapter</a> with type parameters of type <a href="../../../../../../../../org/wildfly/swarm/config/resource/adapters/resource_adapter/AdminObjects.html" title="class in org.wildfly.swarm.config.resource.adapters.resource_adapter">AdminObjects</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Class and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>class </code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../../org/wildfly/swarm/config/resource/adapters/resource_adapter/AdminObjects.html" title="class in org.wildfly.swarm.config.resource.adapters.resource_adapter">AdminObjects</a><T extends <a href="../../../../../../../../org/wildfly/swarm/config/resource/adapters/resource_adapter/AdminObjects.html" title="class in org.wildfly.swarm.config.resource.adapters.resource_adapter">AdminObjects</a><T>></span></code>
<div class="block">Specifies an administration object.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>interface </code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../../org/wildfly/swarm/config/resource/adapters/resource_adapter/AdminObjectsConsumer.html" title="interface in org.wildfly.swarm.config.resource.adapters.resource_adapter">AdminObjectsConsumer</a><T extends <a href="../../../../../../../../org/wildfly/swarm/config/resource/adapters/resource_adapter/AdminObjects.html" title="class in org.wildfly.swarm.config.resource.adapters.resource_adapter">AdminObjects</a><T>></span></code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>interface </code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../../org/wildfly/swarm/config/resource/adapters/resource_adapter/AdminObjectsSupplier.html" title="interface in org.wildfly.swarm.config.resource.adapters.resource_adapter">AdminObjectsSupplier</a><T extends <a href="../../../../../../../../org/wildfly/swarm/config/resource/adapters/resource_adapter/AdminObjects.html" title="class in org.wildfly.swarm.config.resource.adapters.resource_adapter">AdminObjects</a>></span></code> </td>
</tr>
</tbody>
</table>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../../../../org/wildfly/swarm/config/resource/adapters/resource_adapter/package-summary.html">org.wildfly.swarm.config.resource.adapters.resource_adapter</a> that return <a href="../../../../../../../../org/wildfly/swarm/config/resource/adapters/resource_adapter/AdminObjects.html" title="class in org.wildfly.swarm.config.resource.adapters.resource_adapter">AdminObjects</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../../../org/wildfly/swarm/config/resource/adapters/resource_adapter/AdminObjects.html" title="class in org.wildfly.swarm.config.resource.adapters.resource_adapter">AdminObjects</a></code></td>
<td class="colLast"><span class="typeNameLabel">AdminObjectsSupplier.</span><code><span class="memberNameLink"><a href="../../../../../../../../org/wildfly/swarm/config/resource/adapters/resource_adapter/AdminObjectsSupplier.html#get--">get</a></span>()</code>
<div class="block">Constructed instance of AdminObjects resource</div>
</td>
</tr>
</tbody>
</table>
</li>
</ul>
</li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../../../org/wildfly/swarm/config/resource/adapters/resource_adapter/AdminObjects.html" title="class in org.wildfly.swarm.config.resource.adapters.resource_adapter">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../../../../../../../../overview-tree.html">Tree</a></li>
<li><a href="../../../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage">Thorntail API, 2.4.0.Final</div>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../../index.html?org/wildfly/swarm/config/resource/adapters/resource_adapter/class-use/AdminObjects.html" target="_top">Frames</a></li>
<li><a href="AdminObjects.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright © 2019 <a href="http://www.jboss.org">JBoss by Red Hat</a>. All rights reserved.</small></p>
</body>
</html>
| {'content_hash': '7ae72acd503e9dd2f6bcfa7d94065779', 'timestamp': '', 'source': 'github', 'line_count': 260, 'max_line_length': 626, 'avg_line_length': 67.61153846153846, 'alnum_prop': 0.6834859775868934, 'repo_name': 'wildfly-swarm/wildfly-swarm-javadocs', 'id': '665de0b73fb9875329f19dc21851885090cf3a7b', 'size': '17579', 'binary': False, 'copies': '1', 'ref': 'refs/heads/gh-pages', 'path': '2.4.0.Final/apidocs/org/wildfly/swarm/config/resource/adapters/resource_adapter/class-use/AdminObjects.html', 'mode': '33188', 'license': 'apache-2.0', 'language': []} |
@interface PCULinkMessageCell ()<PCUPopMenuViewControllerDelegate>
@property (nonatomic, strong) ASTextNode *titleNode;
@property (nonatomic, strong) ASTextNode *dateNode;
@property (nonatomic, strong) ASImageNode *thumbImageNode;
@property (nonatomic, strong) ASTextNode *subTitleNode;
@property (nonatomic, strong) ASImageNode *backgroundImageNode;
@property (nonatomic, strong) PCUPopMenuViewController *popMenuViewController;
@end
@implementation PCULinkMessageCell
- (instancetype)initWithMessageInteractor:(PCUMessageItemInteractor *)messageInteractor {
self = [super initWithMessageInteractor:messageInteractor];
if (self) {
[self.contentNode addSubnode:self.backgroundImageNode];
[self.contentNode addSubnode:self.titleNode];
[self.contentNode addSubnode:self.thumbImageNode];
[self.contentNode addSubnode:self.subTitleNode];
if ([[self linkMessageInteractor] largerLink]) {
[self.contentNode addSubnode:self.dateNode];
}
}
return self;
}
#pragma mark - Layout
- (CGSize)calculateSizeThatFits:(CGSize)constrainedSize {
if ([[self linkMessageInteractor] largerLink]) {
[self.titleNode measure:CGSizeMake(constrainedSize.width - kLargerLinkLRSpace * 2 - kLargerContentLRSpace * 2, CGFLOAT_MAX)];
[self.dateNode measure:CGSizeMake(constrainedSize.width - kLargerLinkLRSpace * 2 - kLargerContentLRSpace * 2, CGFLOAT_MAX)];
[self.subTitleNode measure:CGSizeMake(constrainedSize.width - kLargerLinkLRSpace * 2 - kLargerContentLRSpace * 2, CGFLOAT_MAX)];
CGFloat contentHeight = 0;
contentHeight += 14.0 + self.titleNode.calculatedSize.height;
contentHeight += 6.0 + self.dateNode.calculatedSize.height;
CGFloat imageWidth = constrainedSize.width - kLargerLinkLRSpace * 2 - kLargerContentLRSpace * 2;
CGFloat imageHeight = imageWidth / (kLargerThumbImageRatio);
contentHeight += 10.0 + imageHeight;
contentHeight += 10.0 + self.subTitleNode.calculatedSize.height;
contentHeight += 14.0;
self.contentNode.frame = CGRectMake(0, kLinkCellTBSpace, constrainedSize.width, contentHeight);
return CGSizeMake(constrainedSize.width, contentHeight + kCellGaps + kLinkCellTBSpace * 2);
}
else {
CGFloat contentWidth = constrainedSize.width - kAvatarSize - 10.0 - 60.0;
[self.titleNode measure:CGSizeMake(contentWidth - kNormalContentLRSpace * 2, CGFLOAT_MAX)];
[self.subTitleNode measure:CGSizeMake(contentWidth - kNormalContentLRSpace * 2 - 8.0 - kNormalThumbImageWidth, kNormalThumbImageWidth)];
self.contentNode.frame = CGRectMake(0, 8.0, constrainedSize.width, self.titleNode.calculatedSize.height + 8.0 + kNormalThumbImageWidth + 8.0);
return CGSizeMake(constrainedSize.width, self.titleNode.calculatedSize.height + 8.0 + kNormalThumbImageWidth + 8.0 + 8.0 + kNormalContentTBSpace * 2 + kCellGaps);
}
return constrainedSize;
}
- (void)layout {
if ([[self linkMessageInteractor] largerLink]) {
self.backgroundImageNode.frame = CGRectMake(kLargerLinkLRSpace, 0, self.calculatedSize.width - kLargerLinkLRSpace * 2, self.calculatedSize.height - kCellGaps - kLinkCellTBSpace * 2);
self.titleNode.frame = CGRectMake(kLargerLinkLRSpace + kLargerContentLRSpace,
14,
self.titleNode.calculatedSize.width,
self.titleNode.calculatedSize.height);
self.dateNode.frame = CGRectMake(kLargerLinkLRSpace + kLargerContentLRSpace,
self.titleNode.frame.origin.y + self.titleNode.frame.size.height + 6.0,
self.dateNode.calculatedSize.width,
self.dateNode.calculatedSize.height);
CGFloat imageWidth = self.calculatedSize.width - kLargerLinkLRSpace * 2 - kLargerContentLRSpace * 2;
CGFloat imageHeight = imageWidth / (kLargerThumbImageRatio);
self.thumbImageNode.frame = CGRectMake(kLargerLinkLRSpace + kLargerContentLRSpace,
self.dateNode.frame.origin.y + self.dateNode.frame.size.height + 10.0,
imageWidth,
imageHeight);
self.subTitleNode.frame = CGRectMake(kLargerLinkLRSpace + kLargerContentLRSpace,
self.thumbImageNode.frame.origin.y + self.thumbImageNode.frame.size.height + 10.0,
self.subTitleNode.calculatedSize.width,
self.subTitleNode.calculatedSize.height);
}
else {
[super layout];
CGFloat contentWidth = self.calculatedSize.width - kAvatarSize - 10.0 - 60.0;
if (self.actionType == PCUMessageActionTypeSend) {
self.backgroundImageNode.image = [[UIImage imageNamed:@"SenderTextNodeBkg"] resizableImageWithCapInsets:UIEdgeInsetsMake(23, 20, 20, 20) resizingMode:UIImageResizingModeStretch];
self.backgroundImageNode.frame = CGRectMake(self.calculatedSize.width - kAvatarSize - 10.0 - contentWidth - 4.0, 0.0, contentWidth, self.calculatedSize.height - kCellGaps);
self.titleNode.frame = CGRectMake(self.backgroundImageNode.frame.origin.x + kNormalContentLRSpace + 4.0,
kNormalContentTBSpace + 2.0,
self.titleNode.calculatedSize.width,
self.titleNode.calculatedSize.height);
self.thumbImageNode.frame = CGRectMake(self.backgroundImageNode.frame.origin.x + kNormalContentLRSpace + 4.0, self.titleNode.frame.origin.y + self.titleNode.frame.size.height + 8.0, kNormalThumbImageWidth, kNormalThumbImageWidth);
self.subTitleNode.frame = CGRectMake(self.thumbImageNode.frame.origin.x + self.thumbImageNode.frame.size.width + 8.0, self.thumbImageNode.frame.origin.y + 2.0, self.subTitleNode.calculatedSize.width, self.subTitleNode.calculatedSize.height);
}
else if (self.actionType == PCUMessageActionTypeReceive) {
self.backgroundImageNode.image = [[UIImage imageNamed:@"ReceiverTextNodeBkg"] resizableImageWithCapInsets:UIEdgeInsetsMake(23, 20, 20, 20) resizingMode:UIImageResizingModeStretch];
self.backgroundImageNode.frame = CGRectMake(kAvatarSize + 10.0 + 4.0, 0.0, contentWidth, self.calculatedSize.height - kCellGaps);
self.titleNode.frame = CGRectMake(self.backgroundImageNode.frame.origin.x + 4.0 + kNormalContentLRSpace,
kNormalContentTBSpace + 2.0,
self.titleNode.calculatedSize.width,
self.titleNode.calculatedSize.height);
self.thumbImageNode.frame = CGRectMake(self.backgroundImageNode.frame.origin.x + 4.0 + kNormalContentLRSpace, self.titleNode.frame.origin.y + self.titleNode.frame.size.height + 8.0, kNormalThumbImageWidth, kNormalThumbImageWidth);
self.subTitleNode.frame = CGRectMake(self.thumbImageNode.frame.origin.x + self.thumbImageNode.frame.size.width + 8.0, self.thumbImageNode.frame.origin.y + 2.0, self.subTitleNode.calculatedSize.width, self.subTitleNode.calculatedSize.height);
}
}
[self updateLayoutWithContentFrame:self.backgroundImageNode.frame];
}
#pragma mark - PCUPopMenuViewControllerDelegate
- (void)handleBackgroundImageNodeTapped {
if ([self.delegate respondsToSelector:@selector(PCURequireOpenURL:)]) {
[self.delegate PCURequireOpenURL:[NSURL URLWithString:[[self linkMessageInteractor] linkURLString]]];
}
}
- (void)handleBackgroundImageNodeLongPress:(UILongPressGestureRecognizer *)sender {
if (sender.state == UIGestureRecognizerStateBegan) {
self.backgroundImageNode.alpha = 0.5;
CGPoint thePoint = [sender.view.superview convertPoint:sender.view.frame.origin toView:[[UIApplication sharedApplication] keyWindow]];
thePoint.x += CGRectGetWidth(sender.view.frame) / 2.0;
[self.popMenuViewController presentMenuViewControllerWithReferencePoint:thePoint];
}
else if (sender.state == UIGestureRecognizerStateEnded) {
self.backgroundImageNode.alpha = 1.0;
}
}
- (void)menuItemDidPressed:(PCUPopMenuViewController *)menuViewController itemIndex:(NSUInteger)itemIndex {
if (itemIndex == 0) {
[[UIPasteboard generalPasteboard] setPersistent:YES];
[[UIPasteboard generalPasteboard] setString:[[self linkMessageInteractor] linkURLString]];
}
else if (itemIndex == 1) {
if ([self.delegate respondsToSelector:@selector(PCURequireDeleteMessageItem:)]) {
[self.delegate PCURequireDeleteMessageItem:self.messageInteractor.messageItem];
}
}
else if (itemIndex == 2) {
if ([self.delegate respondsToSelector:@selector(PCURequireForwardMessageItem:)]) {
[self.delegate PCURequireForwardMessageItem:self.messageInteractor.messageItem];
}
}
else if (itemIndex == 3) {
[self.cellDelegate mainViewShouldEnteringSeletionMode];
}
}
#pragma mark - Getter
- (PCULinkMessageItemInteractor *)linkMessageInteractor {
return (id)[super messageInteractor];
}
- (ASTextNode *)titleNode {
if (_titleNode == nil) {
_titleNode = [[ASTextNode alloc] init];
_titleNode.userInteractionEnabled = NO;
if ([self linkMessageInteractor].titleString != nil) {
if ([[self linkMessageInteractor] largerLink]) {
NSAttributedString *attributedString = [[NSAttributedString alloc]
initWithString:[self linkMessageInteractor].titleString
attributes:@{
NSFontAttributeName: [UIFont boldSystemFontOfSize:17.0],
NSForegroundColorAttributeName: [UIColor blackColor]
}];
_titleNode.attributedString = attributedString;
}
else {
NSAttributedString *attributedString = [[NSAttributedString alloc]
initWithString:[self linkMessageInteractor].titleString
attributes:@{
NSFontAttributeName: [UIFont boldSystemFontOfSize:16.0],
NSForegroundColorAttributeName: [UIColor blackColor]
}];
_titleNode.attributedString = attributedString;
}
}
}
return _titleNode;
}
- (ASTextNode *)dateNode {
if (_dateNode == nil) {
_dateNode = [[ASTextNode alloc] init];
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"M月d日"];
NSString *dateString = [dateFormatter stringFromDate:[[[self linkMessageInteractor] messageItem] messageDate]];
if (dateString != nil) {
NSAttributedString *attributedString = [[NSAttributedString alloc]
initWithString:dateString
attributes:@{
NSFontAttributeName: [UIFont systemFontOfSize:15.0],
NSForegroundColorAttributeName: [UIColor grayColor]
}];
_dateNode.attributedString = attributedString;
}
}
return _dateNode;
}
- (ASImageNode *)thumbImageNode {
if (_thumbImageNode == nil) {
_thumbImageNode = [[ASNetworkImageNode alloc] initWithCache:[PCUImageManager sharedInstance]
downloader:[PCUImageManager sharedInstance]];
_thumbImageNode.userInteractionEnabled = NO;
_thumbImageNode.contentMode = UIViewContentModeScaleAspectFill;
_thumbImageNode.layer.masksToBounds = YES;
if ([[self linkMessageInteractor] thumbURLString] != nil) {
[(ASNetworkImageNode *)_thumbImageNode
setURL:[NSURL URLWithString:[[self linkMessageInteractor] thumbURLString]]];
_thumbImageNode.layer.borderColor = [UIColor lightGrayColor].CGColor;
_thumbImageNode.layer.borderWidth = 0.35f;
}
}
return _thumbImageNode;
}
- (ASTextNode *)subTitleNode {
if (_subTitleNode == nil) {
_subTitleNode = [[ASTextNode alloc] init];
_subTitleNode.userInteractionEnabled = NO;
if ([self linkMessageInteractor].subTitleString != nil) {
if ([[self linkMessageInteractor] largerLink]) {
NSAttributedString *attributedString = [[NSAttributedString alloc]
initWithString:[self linkMessageInteractor].subTitleString
attributes:@{
NSFontAttributeName: [UIFont systemFontOfSize:15.0],
NSForegroundColorAttributeName: [UIColor grayColor]
}];
_subTitleNode.attributedString = attributedString;
}
else {
NSAttributedString *attributedString = [[NSAttributedString alloc]
initWithString:[self linkMessageInteractor].subTitleString
attributes:@{
NSFontAttributeName: [UIFont systemFontOfSize:15.0],
NSForegroundColorAttributeName: [UIColor grayColor]
}];
_subTitleNode.attributedString = attributedString;
[_subTitleNode setTruncationMode:NSLineBreakByTruncatingTail];
}
}
}
return _subTitleNode;
}
- (ASImageNode *)backgroundImageNode {
if (_backgroundImageNode == nil) {
if ([self linkMessageInteractor].largerLink) {
_backgroundImageNode = [[ASImageNode alloc] init];
_backgroundImageNode.backgroundColor = [UIColor whiteColor];
_backgroundImageNode.layer.cornerRadius = 8.0f;
_backgroundImageNode.layer.borderWidth = 0.35f;
_backgroundImageNode.layer.borderColor = [UIColor grayColor].CGColor;
}
else {
_backgroundImageNode = [[ASImageNode alloc] init];
}
_backgroundImageNode.userInteractionEnabled = YES;
UILongPressGestureRecognizer *gesture = [[UILongPressGestureRecognizer alloc]
initWithTarget:self
action:@selector(handleBackgroundImageNodeLongPress:)];
gesture.minimumPressDuration = 0.35;
[_backgroundImageNode.view addGestureRecognizer:gesture];
[_backgroundImageNode addTarget:self
action:@selector(handleBackgroundImageNodeTapped)
forControlEvents:ASControlNodeEventTouchUpInside];
}
return _backgroundImageNode;
}
- (PCUPopMenuViewController *)popMenuViewController {
if (_popMenuViewController == nil) {
_popMenuViewController = [[PCUPopMenuViewController alloc] init];
_popMenuViewController.titles = @[@"复制", @"删除", @"转发", @"更多..."];
_popMenuViewController.delegate = self;
}
return _popMenuViewController;
}
@end
| {'content_hash': '067886568bcd13e31f9d6d0199e2cd19', 'timestamp': '', 'source': 'github', 'line_count': 283, 'max_line_length': 253, 'avg_line_length': 57.448763250883395, 'alnum_prop': 0.6102841677943166, 'repo_name': 'PonyGroup/PonyChatUIV2', 'id': '8bb0a162ef4a8b78ad477af0d8f7e527857293db', 'size': '16909', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'PonyChatUI/Classes/User Interface/View/PCULinkMessageCell.m', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Objective-C', 'bytes': '193097'}, {'name': 'Ruby', 'bytes': '328'}]} |
#ifdef APPBLADE_DEBUG_LOGGING
#define ABDebugLog_internal( s, ... ) NSLog( @"<%p %@:(%d)> %@", self, [[NSString stringWithUTF8String:__FILE__] lastPathComponent], __LINE__, [NSString stringWithFormat:(s), ##__VA_ARGS__] )
#else
#define ABDebugLog_internal( s, ... )
#endif
#ifdef APPBLADE_ERROR_LOGGING
#define ABErrorLog( s, ... ) NSLog( @"< %@:(%d)> %@", [[NSString stringWithUTF8String:__FILE__] lastPathComponent], __LINE__, [NSString stringWithFormat:(s), ##__VA_ARGS__] )
#else
#define ABErrorLog( s, ... )
#endif
#endif
| {'content_hash': '5beee943fd5d1e5065fdf3b12fece9e5', 'timestamp': '', 'source': 'github', 'line_count': 12, 'max_line_length': 199, 'avg_line_length': 48.666666666666664, 'alnum_prop': 0.5856164383561644, 'repo_name': 'AppBlade/AppBladeSDK', 'id': 'f2014f7b303639258e1643e9e1852c553d36a636', 'size': '922', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'iOS/Framework/AppBlade/AppBladeLogging.h', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'AppleScript', 'bytes': '18419'}, {'name': 'Assembly', 'bytes': '271213'}, {'name': 'C', 'bytes': '568541'}, {'name': 'C++', 'bytes': '323776'}, {'name': 'Java', 'bytes': '225573'}, {'name': 'Makefile', 'bytes': '3644'}, {'name': 'Objective-C', 'bytes': '4069293'}, {'name': 'Objective-C++', 'bytes': '173035'}, {'name': 'Protocol Buffer', 'bytes': '27620'}, {'name': 'Shell', 'bytes': '36814'}]} |
package com.microsoft.azure.management.recoveryservices.backup.v2017_07_01;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;
/**
* IaaS VM workload-specific backup item representing the Azure Resource
* Manager VM.
*/
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectedItemType")
@JsonTypeName("Microsoft.Compute/virtualMachines")
public class AzureIaaSComputeVMProtectedItem extends AzureIaaSVMProtectedItem {
}
| {'content_hash': '4e87c024ccefee26e49107d96363ed17', 'timestamp': '', 'source': 'github', 'line_count': 15, 'max_line_length': 109, 'avg_line_length': 35.13333333333333, 'alnum_prop': 0.8178368121442126, 'repo_name': 'hovsepm/azure-sdk-for-java', 'id': '93328abc391ce7e6d737074956d930263c5e9f3a', 'size': '757', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'recoveryservices.backup/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2017_07_01/AzureIaaSComputeVMProtectedItem.java', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Batchfile', 'bytes': '6821'}, {'name': 'HTML', 'bytes': '1250'}, {'name': 'Java', 'bytes': '103388992'}, {'name': 'JavaScript', 'bytes': '8139'}, {'name': 'PowerShell', 'bytes': '160'}, {'name': 'Python', 'bytes': '3855'}, {'name': 'Shell', 'bytes': '609'}]} |
<?xml version="1.0" ?><!DOCTYPE TS><TS language="ky" version="2.1">
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About HiCoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+39"/>
<source><b>HiCoin</b> version</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+41"/>
<source>Copyright © 2009-2014 The Bitcoin developers
Copyright © 2011-2014 The PeerCoin developers
Copyright © 2012-2014 The NovaCoin developers
Copyright © 2014 The HiCoin developers</source>
<translation>Copyright © 2009-2014 The Bitcoin developers
Copyright © 2011-2014 The PeerCoin developers
Copyright © 2012-2014 The NovaCoin developers
Copyright © 2014 The HiCoin developers</translation>
</message>
<message>
<location line="+15"/>
<source>
This is experimental software.
Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php.
This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young ([email protected]) and UPnP software written by Thomas Bernard.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>AddressBookPage</name>
<message>
<location filename="../forms/addressbookpage.ui" line="+14"/>
<source>Address Book</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+22"/>
<source>Double-click to edit address or label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+27"/>
<source>Create a new address</source>
<translation>Жаң даректи жасоо</translation>
</message>
<message>
<location line="+14"/>
<source>Copy the currently selected address to the system clipboard</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-11"/>
<source>&New Address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-46"/>
<source>These are your HiCoin addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+60"/>
<source>&Copy Address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>Show &QR Code</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>Sign a message to prove you own a HiCoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Sign &Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>Delete the currently selected address from the list</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-14"/>
<source>Verify a message to ensure it was signed with a specified HiCoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Verify Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>&Delete</source>
<translation>Ө&чүрүү</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="+65"/>
<source>Copy &Label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>&Edit</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+250"/>
<source>Export Address Book Data</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>Error exporting</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>AddressTableModel</name>
<message>
<location filename="../addresstablemodel.cpp" line="+144"/>
<source>Label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation>Дарек</translation>
</message>
<message>
<location line="+36"/>
<source>(no label)</source>
<translation>(аты жок)</translation>
</message>
</context>
<context>
<name>AskPassphraseDialog</name>
<message>
<location filename="../forms/askpassphrasedialog.ui" line="+26"/>
<source>Passphrase Dialog</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+21"/>
<source>Enter passphrase</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>New passphrase</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Repeat new passphrase</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+33"/>
<source>Serves to disable the trivial sendmoney when OS account compromised. Provides no real security.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>For staking only</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="+35"/>
<source>Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Encrypt wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>This operation needs your wallet passphrase to unlock the wallet.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Unlock wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>This operation needs your wallet passphrase to decrypt the wallet.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Decrypt wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Change passphrase</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Enter the old and new passphrase to the wallet.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+46"/>
<source>Confirm wallet encryption</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR COINS</b>!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Are you sure you wish to encrypt your wallet?</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+103"/>
<location line="+24"/>
<source>Warning: The Caps Lock key is on!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-133"/>
<location line="+60"/>
<source>Wallet encrypted</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-58"/>
<source>HiCoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your coins from being stolen by malware infecting your computer.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<location line="+7"/>
<location line="+44"/>
<location line="+6"/>
<source>Wallet encryption failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-56"/>
<source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<location line="+50"/>
<source>The supplied passphrases do not match.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-38"/>
<source>Wallet unlock failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<location line="+12"/>
<location line="+19"/>
<source>The passphrase entered for the wallet decryption was incorrect.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-20"/>
<source>Wallet decryption failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Wallet passphrase was successfully changed.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>BitcoinGUI</name>
<message>
<location filename="../bitcoingui.cpp" line="+280"/>
<source>Sign &message...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+242"/>
<source>Synchronizing with network...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-308"/>
<source>&Overview</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Show general overview of wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+17"/>
<source>&Transactions</source>
<translation>&Транзакциялар</translation>
</message>
<message>
<location line="+1"/>
<source>Browse transaction history</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>&Address Book</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Edit the list of stored addresses and labels</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-13"/>
<source>&Receive coins</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Show the list of addresses for receiving payments</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-7"/>
<source>&Send coins</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>E&xit</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Quit application</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Show information about HiCoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>About &Qt</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Show information about Qt</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>&Options...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>&Encrypt Wallet...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Backup Wallet...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>&Change Passphrase...</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+250"/>
<source>~%n block(s) remaining</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message>
<location line="+6"/>
<source>Downloaded %1 of %2 blocks of transaction history (%3% done).</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-247"/>
<source>&Export...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-62"/>
<source>Send coins to a HiCoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+45"/>
<source>Modify configuration options for HiCoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+18"/>
<source>Export the data in the current tab to a file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-14"/>
<source>Encrypt or decrypt wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Backup wallet to another location</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Change the passphrase used for wallet encryption</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>&Debug window</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Open debugging and diagnostic console</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-5"/>
<source>&Verify message...</source>
<translation>Билдирүүнү &текшерүү...</translation>
</message>
<message>
<location line="-200"/>
<source>HiCoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Wallet</source>
<translation>Капчык</translation>
</message>
<message>
<location line="+178"/>
<source>&About HiCoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>&Show / Hide</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>Unlock wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>&Lock Wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Lock wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+34"/>
<source>&File</source>
<translation>&Файл</translation>
</message>
<message>
<location line="+8"/>
<source>&Settings</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>&Help</source>
<translation>&Жардам</translation>
</message>
<message>
<location line="+9"/>
<source>Tabs toolbar</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Actions toolbar</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<location line="+9"/>
<source>[testnet]</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<location line="+60"/>
<source>HiCoin client</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+70"/>
<source>%n active connection(s) to HiCoin network</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message>
<location line="+40"/>
<source>Downloaded %1 blocks of transaction history.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+413"/>
<source>Staking.<br>Your weight is %1<br>Network weight is %2<br>Expected time to earn reward is %3</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Not staking because wallet is locked</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Not staking because wallet is offline</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Not staking because wallet is syncing</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Not staking because you don't have mature coins</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="-403"/>
<source>%n second(s) ago</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message>
<location line="-284"/>
<source>&Unlock Wallet...</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+288"/>
<source>%n minute(s) ago</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n hour(s) ago</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n day(s) ago</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message>
<location line="+6"/>
<source>Up to date</source>
<translation>Жаңыланган</translation>
</message>
<message>
<location line="+7"/>
<source>Catching up...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>Last received block was generated %1.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+59"/>
<source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Confirm transaction fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+27"/>
<source>Sent transaction</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Incoming transaction</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Date: %1
Amount: %2
Type: %3
Address: %4
</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+100"/>
<location line="+15"/>
<source>URI handling</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-15"/>
<location line="+15"/>
<source>URI can not be parsed! This can be caused by an invalid HiCoin address or malformed URI parameters.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+18"/>
<source>Wallet is <b>encrypted</b> and currently <b>unlocked</b></source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>Wallet is <b>encrypted</b> and currently <b>locked</b></source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>Backup Wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Wallet Data (*.dat)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Backup Failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>There was an error trying to save the wallet data to the new location.</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+76"/>
<source>%n second(s)</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n minute(s)</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n hour(s)</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n day(s)</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message>
<location line="+18"/>
<source>Not staking</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoin.cpp" line="+109"/>
<source>A fatal error occurred. HiCoin can no longer continue safely and will quit.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>ClientModel</name>
<message>
<location filename="../clientmodel.cpp" line="+90"/>
<source>Network Alert</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>CoinControlDialog</name>
<message>
<location filename="../forms/coincontroldialog.ui" line="+14"/>
<source>Coin Control</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+31"/>
<source>Quantity:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+32"/>
<source>Bytes:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+48"/>
<source>Amount:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+32"/>
<source>Priority:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+48"/>
<source>Fee:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>Low Output:</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../coincontroldialog.cpp" line="+551"/>
<source>no</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/coincontroldialog.ui" line="+51"/>
<source>After Fee:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>Change:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+69"/>
<source>(un)select all</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>Tree mode</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>List mode</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+45"/>
<source>Amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Address</source>
<translation>Дарек</translation>
</message>
<message>
<location line="+5"/>
<source>Date</source>
<translation>Дата</translation>
</message>
<message>
<location line="+5"/>
<source>Confirmations</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Confirmed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Priority</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../coincontroldialog.cpp" line="-515"/>
<source>Copy address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<location line="+26"/>
<source>Copy amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-25"/>
<source>Copy transaction ID</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+24"/>
<source>Copy quantity</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Copy fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy after fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy bytes</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy priority</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy low output</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy change</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+317"/>
<source>highest</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>high</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>medium-high</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>medium</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>low-medium</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>low</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>lowest</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+155"/>
<source>DUST</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>yes</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>This label turns red, if the transaction size is bigger than 10000 bytes.
This means a fee of at least %1 per kb is required.
Can vary +/- 1 Byte per input.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Transactions with higher priority get more likely into a block.
This label turns red, if the priority is smaller than "medium".
This means a fee of at least %1 per kb is required.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>This label turns red, if any recipient receives an amount smaller than %1.
This means a fee of at least %2 is required.
Amounts below 0.546 times the minimum relay fee are shown as DUST.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>This label turns red, if the change is smaller than %1.
This means a fee of at least %2 is required.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+37"/>
<location line="+66"/>
<source>(no label)</source>
<translation>(аты жок)</translation>
</message>
<message>
<location line="-9"/>
<source>change from %1 (%2)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>(change)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>EditAddressDialog</name>
<message>
<location filename="../forms/editaddressdialog.ui" line="+14"/>
<source>Edit Address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>&Label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>The label associated with this address book entry</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>&Address</source>
<translation>&Дарек</translation>
</message>
<message>
<location line="+10"/>
<source>The address associated with this address book entry. This can only be modified for sending addresses.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="+20"/>
<source>New receiving address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>New sending address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Edit receiving address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Edit sending address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+76"/>
<source>The entered address "%1" is already in the address book.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-5"/>
<source>The entered address "%1" is not a valid HiCoin address.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>Could not unlock wallet.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>New key generation failed.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>GUIUtil::HelpMessageBox</name>
<message>
<location filename="../guiutil.cpp" line="+420"/>
<location line="+12"/>
<source>HiCoin-Qt</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-12"/>
<source>version</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Usage:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>command-line options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>UI options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Set language, for example "de_DE" (default: system locale)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Start minimized</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Show splash screen on startup (default: 1)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>OptionsDialog</name>
<message>
<location filename="../forms/optionsdialog.ui" line="+14"/>
<source>Options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>&Main</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. Fee 0.01 recommended.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>Pay transaction &fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+31"/>
<source>Reserved amount does not participate in staking and is therefore spendable at any time.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>Reserve</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+31"/>
<source>Automatically start HiCoin after logging in to the system.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Start HiCoin on system login</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Detach block and address databases at shutdown. This means they can be moved to another data directory, but it slows down shutdown. The wallet is always detached.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Detach databases at shutdown</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+21"/>
<source>&Network</source>
<translation>&Тармак</translation>
</message>
<message>
<location line="+6"/>
<source>Automatically open the HiCoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Map port using &UPnP</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Connect to the HiCoin network through a SOCKS proxy (e.g. when connecting through Tor).</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Connect through SOCKS proxy:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>Proxy &IP:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>IP address of the proxy (e.g. 127.0.0.1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>&Port:</source>
<translation>&Порт:</translation>
</message>
<message>
<location line="+19"/>
<source>Port of the proxy (e.g. 9050)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>SOCKS &Version:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>SOCKS version of the proxy (e.g. 5)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+36"/>
<source>&Window</source>
<translation>&Терезе</translation>
</message>
<message>
<location line="+6"/>
<source>Show only a tray icon after minimizing the window.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Minimize to the tray instead of the taskbar</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>M&inimize on close</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+21"/>
<source>&Display</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>User Interface &language:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>The user interface language can be set here. This setting will take effect after restarting HiCoin.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>&Unit to show amounts in:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>Choose the default subdivision unit to show in the interface and when sending coins.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>Whether to show HiCoin addresses in the transaction list or not.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Display addresses in transaction list</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Whether to show coin control features or not.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Display coin &control features (experts only!)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+71"/>
<source>&OK</source>
<translation>&Жарайт</translation>
</message>
<message>
<location line="+7"/>
<source>&Cancel</source>
<translation>&Жокко чыгаруу</translation>
</message>
<message>
<location line="+10"/>
<source>&Apply</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../optionsdialog.cpp" line="+55"/>
<source>default</source>
<translation>жарыяланбаган</translation>
</message>
<message>
<location line="+149"/>
<location line="+9"/>
<source>Warning</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-9"/>
<location line="+9"/>
<source>This setting will take effect after restarting HiCoin.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+29"/>
<source>The supplied proxy address is invalid.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>OverviewPage</name>
<message>
<location filename="../forms/overviewpage.ui" line="+14"/>
<source>Form</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+33"/>
<location line="+231"/>
<source>The displayed information may be out of date. Your wallet automatically synchronizes with the HiCoin network after a connection is established, but this process has not completed yet.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-160"/>
<source>Stake:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+29"/>
<source>Unconfirmed:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-107"/>
<source>Wallet</source>
<translation>Капчык</translation>
</message>
<message>
<location line="+49"/>
<source>Spendable:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>Your current spendable balance</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+71"/>
<source>Immature:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>Mined balance that has not yet matured</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+20"/>
<source>Total:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>Your current total balance</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+46"/>
<source><b>Recent transactions</b></source>
<translation type="unfinished"/>
</message>
<message>
<location line="-108"/>
<source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-29"/>
<source>Total of coins that was staked, and do not yet count toward the current balance</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../overviewpage.cpp" line="+113"/>
<location line="+1"/>
<source>out of sync</source>
<translation>синхрондоштурулган эмес</translation>
</message>
</context>
<context>
<name>QRCodeDialog</name>
<message>
<location filename="../forms/qrcodedialog.ui" line="+14"/>
<source>QR Code Dialog</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+59"/>
<source>Request Payment</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+56"/>
<source>Amount:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-44"/>
<source>Label:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>Message:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+71"/>
<source>&Save As...</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../qrcodedialog.cpp" line="+62"/>
<source>Error encoding URI into QR Code.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+40"/>
<source>The entered amount is invalid, please check.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Resulting URI too long, try to reduce the text for label / message.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>Save QR Code</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>PNG Images (*.png)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>RPCConsole</name>
<message>
<location filename="../forms/rpcconsole.ui" line="+46"/>
<source>Client name</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<location line="+23"/>
<location line="+26"/>
<location line="+23"/>
<location line="+23"/>
<location line="+36"/>
<location line="+53"/>
<location line="+23"/>
<location line="+23"/>
<location filename="../rpcconsole.cpp" line="+348"/>
<source>N/A</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-217"/>
<source>Client version</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-45"/>
<source>&Information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+68"/>
<source>Using OpenSSL version</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+49"/>
<source>Startup time</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+29"/>
<source>Network</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Number of connections</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>On testnet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Block chain</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Current number of blocks</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Estimated total blocks</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Last block time</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+52"/>
<source>&Open</source>
<translation>&Ачуу</translation>
</message>
<message>
<location line="+16"/>
<source>Command-line options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Show the HiCoin-Qt help message to get a list with possible HiCoin command-line options.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Show</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+24"/>
<source>&Console</source>
<translation>&Консоль</translation>
</message>
<message>
<location line="-260"/>
<source>Build date</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-104"/>
<source>HiCoin - Debug window</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>HiCoin Core</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+279"/>
<source>Debug log file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Open the HiCoin debug log file from the current data directory. This can take a few seconds for large log files.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+102"/>
<source>Clear console</source>
<translation>Консолду тазалоо</translation>
</message>
<message>
<location filename="../rpcconsole.cpp" line="-33"/>
<source>Welcome to the HiCoin RPC console.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Type <b>help</b> for an overview of available commands.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>SendCoinsDialog</name>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="+14"/>
<location filename="../sendcoinsdialog.cpp" line="+182"/>
<location line="+5"/>
<location line="+5"/>
<location line="+5"/>
<location line="+6"/>
<location line="+5"/>
<location line="+5"/>
<source>Send Coins</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+76"/>
<source>Coin Control Features</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+20"/>
<source>Inputs...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>automatically selected</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>Insufficient funds!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+77"/>
<source>Quantity:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+22"/>
<location line="+35"/>
<source>0</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-19"/>
<source>Bytes:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+51"/>
<source>Amount:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+22"/>
<location line="+86"/>
<location line="+86"/>
<location line="+32"/>
<source>0.00 XHI</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-191"/>
<source>Priority:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>medium</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+32"/>
<source>Fee:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>Low Output:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>no</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+32"/>
<source>After Fee:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>Change</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+50"/>
<source>custom change address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+106"/>
<source>Send to multiple recipients at once</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Add &Recipient</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+20"/>
<source>Remove all transaction fields</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Clear &All</source>
<translation>&Бардыгын тазалоо</translation>
</message>
<message>
<location line="+28"/>
<source>Balance:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>123.456 XHI</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+31"/>
<source>Confirm the send action</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>S&end</source>
<translation>&Жөнөтүү</translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="-173"/>
<source>Enter a HiCoin address (e.g. HPHWwxzA9gfTKR4CU1Dfgp5W8C8QSviVk8)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>Copy quantity</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy after fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy bytes</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy priority</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy low output</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy change</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+86"/>
<source><b>%1</b> to %2 (%3)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Confirm send coins</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Are you sure you want to send %1?</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source> and </source>
<translation type="unfinished"/>
</message>
<message>
<location line="+29"/>
<source>The recipient address is not valid, please recheck.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>The amount to pay must be larger than 0.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>The amount exceeds your balance.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>The total exceeds your balance when the %1 transaction fee is included.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Duplicate address found, can only send to each address once per send operation.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Error: Transaction creation failed.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+251"/>
<source>WARNING: Invalid HiCoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>(no label)</source>
<translation>(аты жок)</translation>
</message>
<message>
<location line="+4"/>
<source>WARNING: unknown change address</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>SendCoinsEntry</name>
<message>
<location filename="../forms/sendcoinsentry.ui" line="+14"/>
<source>Form</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>A&mount:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>Pay &To:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+24"/>
<location filename="../sendcoinsentry.cpp" line="+25"/>
<source>Enter a label for this address to add it to your address book</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>&Label:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+18"/>
<source>The address to send the payment to (e.g. HPHWwxzA9gfTKR4CU1Dfgp5W8C8QSviVk8)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>Choose address from address book</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>Alt+A</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Paste address from clipboard</source>
<translation>Даректи алмашуу буферинен коюу</translation>
</message>
<message>
<location line="+10"/>
<source>Alt+P</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Remove this recipient</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../sendcoinsentry.cpp" line="+1"/>
<source>Enter a HiCoin address (e.g. HPHWwxzA9gfTKR4CU1Dfgp5W8C8QSviVk8)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>SignVerifyMessageDialog</name>
<message>
<location filename="../forms/signverifymessagedialog.ui" line="+14"/>
<source>Signatures - Sign / Verify a Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<location line="+124"/>
<source>&Sign Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-118"/>
<source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+18"/>
<source>The address to sign the message with (e.g. HPHWwxzA9gfTKR4CU1Dfgp5W8C8QSviVk8)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<location line="+203"/>
<source>Choose an address from the address book</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-193"/>
<location line="+203"/>
<source>Alt+A</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-193"/>
<source>Paste address from clipboard</source>
<translation>Даректи алмашуу буферинен коюу</translation>
</message>
<message>
<location line="+10"/>
<source>Alt+P</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+12"/>
<source>Enter the message you want to sign here</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+24"/>
<source>Copy the current signature to the system clipboard</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+21"/>
<source>Sign the message to prove you own this HiCoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+17"/>
<source>Reset all sign message fields</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<location line="+146"/>
<source>Clear &All</source>
<translation>&Бардыгын тазалоо</translation>
</message>
<message>
<location line="-87"/>
<location line="+70"/>
<source>&Verify Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-64"/>
<source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+21"/>
<source>The address the message was signed with (e.g. HPHWwxzA9gfTKR4CU1Dfgp5W8C8QSviVk8)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+40"/>
<source>Verify the message to ensure it was signed with the specified HiCoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+17"/>
<source>Reset all verify message fields</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../signverifymessagedialog.cpp" line="+27"/>
<location line="+3"/>
<source>Enter a HiCoin address (e.g. HPHWwxzA9gfTKR4CU1Dfgp5W8C8QSviVk8)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-2"/>
<source>Click "Sign Message" to generate signature</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Enter HiCoin signature</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+82"/>
<location line="+81"/>
<source>The entered address is invalid.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-81"/>
<location line="+8"/>
<location line="+73"/>
<location line="+8"/>
<source>Please check the address and try again.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-81"/>
<location line="+81"/>
<source>The entered address does not refer to a key.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-73"/>
<source>Wallet unlock was cancelled.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Private key for the entered address is not available.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+12"/>
<source>Message signing failed.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Message signed.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+59"/>
<source>The signature could not be decoded.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<location line="+13"/>
<source>Please check the signature and try again.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>The signature did not match the message digest.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Message verification failed.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Message verified.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>TransactionDesc</name>
<message>
<location filename="../transactiondesc.cpp" line="+19"/>
<source>Open until %1</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="-2"/>
<source>Open for %n block(s)</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message>
<location line="+8"/>
<source>conflicted</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>%1/offline</source>
<translation>%1/тармакта эмес</translation>
</message>
<message>
<location line="+2"/>
<source>%1/unconfirmed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>%1 confirmations</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+18"/>
<source>Status</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+7"/>
<source>, broadcast through %n node(s)</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message>
<location line="+4"/>
<source>Date</source>
<translation>Дата</translation>
</message>
<message>
<location line="+7"/>
<source>Source</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Generated</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<location line="+17"/>
<source>From</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<location line="+22"/>
<location line="+58"/>
<source>To</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-77"/>
<location line="+2"/>
<source>own address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-2"/>
<source>label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+37"/>
<location line="+12"/>
<location line="+45"/>
<location line="+17"/>
<location line="+30"/>
<source>Credit</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="-102"/>
<source>matures in %n more block(s)</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message>
<location line="+2"/>
<source>not accepted</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+44"/>
<location line="+8"/>
<location line="+15"/>
<location line="+30"/>
<source>Debit</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-39"/>
<source>Transaction fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>Net amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Message</source>
<translation>Билдирүү</translation>
</message>
<message>
<location line="+2"/>
<source>Comment</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Transaction ID</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Generated coins must mature 100 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Debug information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Transaction</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Inputs</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>true</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>false</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-211"/>
<source>, has not been successfully broadcast yet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>unknown</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>TransactionDescDialog</name>
<message>
<location filename="../forms/transactiondescdialog.ui" line="+14"/>
<source>Transaction details</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>This pane shows a detailed description of the transaction</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>TransactionTableModel</name>
<message>
<location filename="../transactiontablemodel.cpp" line="+226"/>
<source>Date</source>
<translation>Дата</translation>
</message>
<message>
<location line="+0"/>
<source>Type</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation>Дарек</translation>
</message>
<message>
<location line="+0"/>
<source>Amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+60"/>
<source>Open until %1</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+12"/>
<source>Confirmed (%1 confirmations)</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="-15"/>
<source>Open for %n more block(s)</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message>
<location line="+6"/>
<source>Offline</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Unconfirmed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Confirming (%1 of %2 recommended confirmations)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Conflicted</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Immature (%1 confirmations, will be available after %2)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>This block was not received by any other nodes and will probably not be accepted!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Generated but not accepted</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+42"/>
<source>Received with</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Received from</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Sent to</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Payment to yourself</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Mined</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+38"/>
<source>(n/a)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+190"/>
<source>Transaction status. Hover over this field to show number of confirmations.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Date and time that the transaction was received.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Type of transaction.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Destination address of transaction.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Amount removed from or added to balance.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>TransactionView</name>
<message>
<location filename="../transactionview.cpp" line="+55"/>
<location line="+16"/>
<source>All</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-15"/>
<source>Today</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>This week</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>This month</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Last month</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>This year</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Range...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>Received with</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Sent to</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>To yourself</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Mined</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Other</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Enter address or label to search</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Min amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+34"/>
<source>Copy address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy transaction ID</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Edit label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Show transaction details</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+144"/>
<source>Export Transaction Data</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Confirmed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Date</source>
<translation>Дата</translation>
</message>
<message>
<location line="+1"/>
<source>Type</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Address</source>
<translation>Дарек</translation>
</message>
<message>
<location line="+1"/>
<source>Amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>ID</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Error exporting</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+100"/>
<source>Range:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>to</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>WalletModel</name>
<message>
<location filename="../walletmodel.cpp" line="+206"/>
<source>Sending...</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>bitcoin-core</name>
<message>
<location filename="../bitcoinstrings.cpp" line="+33"/>
<source>HiCoin version</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Usage:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Send command to -server or hicoind</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>List commands</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Get help for a command</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Options:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Specify configuration file (default: hicoin.conf)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Specify pid file (default: hicoind.pid)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Specify wallet file (within data directory)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-1"/>
<source>Specify data directory</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Set database cache size in megabytes (default: 25)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Set database disk log size in megabytes (default: 100)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Listen for connections on <port> (default: 28361 or testnet: 28363)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Maintain at most <n> connections to peers (default: 125)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Connect to a node to retrieve peer addresses, and disconnect</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Specify your own public address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Bind to given address. Use [host]:port notation for IPv6</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Stake your coins to support network and gain reward (default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Threshold for disconnecting misbehaving peers (default: 100)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-44"/>
<source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+51"/>
<source>Detach block and address databases. Increases shutdown time (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+109"/>
<source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-5"/>
<source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds </source>
<translation type="unfinished"/>
</message>
<message>
<location line="-87"/>
<source>Listen for JSON-RPC connections on <port> (default: 28362 or testnet: 28364)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-11"/>
<source>Accept command line and JSON-RPC commands</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+101"/>
<source>Error: Transaction creation failed </source>
<translation type="unfinished"/>
</message>
<message>
<location line="-5"/>
<source>Error: Wallet locked, unable to create transaction </source>
<translation type="unfinished"/>
</message>
<message>
<location line="-8"/>
<source>Importing blockchain data file.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Importing bootstrap blockchain data file.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-88"/>
<source>Run in the background as a daemon and accept commands</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Use the test network</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-24"/>
<source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-38"/>
<source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+117"/>
<source>Error initializing database environment %s! To recover, BACKUP THAT DIRECTORY, then remove everything from it except for wallet.dat.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-20"/>
<source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+61"/>
<source>Warning: Please check that your computer's date and time are correct! If your clock is wrong HiCoin will not work properly.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-31"/>
<source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-18"/>
<source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-30"/>
<source>Attempt to recover private keys from a corrupt wallet.dat</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Block creation options:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-62"/>
<source>Connect only to the specified node(s)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Discover own IP address (default: 1 when listening and no -externalip)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+94"/>
<source>Failed to listen on any port. Use -listen=0 if you want this.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-90"/>
<source>Find peers using DNS lookup (default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Sync checkpoints policy (default: strict)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+83"/>
<source>Invalid -tor address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Invalid amount for -reservebalance=<amount></source>
<translation type="unfinished"/>
</message>
<message>
<location line="-82"/>
<source>Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Maximum per-connection send buffer, <n>*1000 bytes (default: 1000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-16"/>
<source>Only connect to nodes in network <net> (IPv4, IPv6 or Tor)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+28"/>
<source>Output extra debugging information. Implies all other -debug* options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Output extra network debugging information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Prepend debug output with timestamp</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>SSL options: (see the Bitcoin Wiki for SSL setup instructions)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-74"/>
<source>Select the version of socks proxy to use (4-5, default: 5)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+41"/>
<source>Send trace/debug info to console instead of debug.log file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Send trace/debug info to debugger</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+28"/>
<source>Set maximum block size in bytes (default: 250000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-1"/>
<source>Set minimum block size in bytes (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-29"/>
<source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-42"/>
<source>Specify connection timeout in milliseconds (default: 5000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+109"/>
<source>Unable to sign checkpoint, wrong checkpointkey?
</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-80"/>
<source>Use UPnP to map the listening port (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-1"/>
<source>Use UPnP to map the listening port (default: 1 when listening)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-25"/>
<source>Use proxy to reach tor hidden services (default: same as -proxy)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+42"/>
<source>Username for JSON-RPC connections</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+47"/>
<source>Verifying database integrity...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+57"/>
<source>WARNING: syncronized checkpoint violation detected, but skipped!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Warning: Disk space is low!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-2"/>
<source>Warning: This version is obsolete, upgrade required!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-48"/>
<source>wallet.dat corrupt, salvage failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-54"/>
<source>Password for JSON-RPC connections</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-84"/>
<source>%s, you must set a rpcpassword in the configuration file:
%s
It is recommended you use the following random password:
rpcuser=hicoinrpc
rpcpassword=%s
(you do not need to remember this password)
The username and password MUST NOT be the same.
If the file does not exist, create it with owner-readable-only file permissions.
It is also recommended to set alertnotify so you are notified of problems;
for example: alertnotify=echo %%s | mail -s "HiCoin Alert" [email protected]
</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+51"/>
<source>Find peers using internet relay chat (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Sync time with other nodes. Disable if time on your system is precise e.g. syncing with NTP (default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>When creating transactions, ignore inputs with value less than this (default: 0.01)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>Allow JSON-RPC connections from specified IP address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Send commands to node running on <ip> (default: 127.0.0.1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Require a confirmations for change (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Enforce transaction scripts to use canonical PUSH operators (default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Upgrade wallet to latest format</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Set key pool size to <n> (default: 100)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Rescan the block chain for missing wallet transactions</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>How many blocks to check at startup (default: 2500, 0 = all)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>How thorough the block verification is (0-6, default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Imports blocks from external blk000?.dat file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Use OpenSSL (https) for JSON-RPC connections</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Server certificate file (default: server.cert)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Server private key (default: server.pem)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+53"/>
<source>Error: Wallet unlocked for staking only, unable to create transaction.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+18"/>
<source>WARNING: Invalid checkpoint found! Displayed transactions may not be correct! You may need to upgrade, or notify developers.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-158"/>
<source>This help message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+95"/>
<source>Wallet %s resides outside data directory %s.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Cannot obtain a lock on data directory %s. HiCoin is probably already running.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-98"/>
<source>HiCoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+140"/>
<source>Unable to bind to %s on this computer (bind returned error %d, %s)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-130"/>
<source>Connect through socks proxy</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Allow DNS lookups for -addnode, -seednode and -connect</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+122"/>
<source>Loading addresses...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-15"/>
<source>Error loading blkindex.dat</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Error loading wallet.dat: Wallet corrupted</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Error loading wallet.dat: Wallet requires newer version of HiCoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Wallet needed to be rewritten: restart HiCoin to complete</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Error loading wallet.dat</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-16"/>
<source>Invalid -proxy address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-1"/>
<source>Unknown network specified in -onlynet: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-1"/>
<source>Unknown -socks proxy version requested: %i</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Cannot resolve -bind address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Cannot resolve -externalip address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-24"/>
<source>Invalid amount for -paytxfee=<amount>: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+44"/>
<source>Error: could not start node</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>Sending...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Invalid amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Insufficient funds</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-34"/>
<source>Loading block index...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-103"/>
<source>Add a node to connect to and attempt to keep the connection open</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+122"/>
<source>Unable to bind to %s on this computer. HiCoin is probably already running.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-97"/>
<source>Fee per KB to add to transactions you send</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+55"/>
<source>Invalid amount for -mininput=<amount>: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>Loading wallet...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Cannot downgrade wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Cannot initialize keypool</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Cannot write default address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Rescanning...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Done loading</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-167"/>
<source>To use the %s option</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Error</source>
<translation>Ката</translation>
</message>
<message>
<location line="+6"/>
<source>You must set rpcpassword=<password> in the configuration file:
%s
If the file does not exist, create it with owner-readable-only file permissions.</source>
<translation type="unfinished"/>
</message>
</context>
</TS>
| {'content_hash': '92435f822ebd96bbdbfbe27326b2b93f', 'timestamp': '', 'source': 'github', 'line_count': 3279, 'max_line_length': 395, 'avg_line_length': 32.70661787130223, 'alnum_prop': 0.583402489626556, 'repo_name': 'hicoindev/hicoin', 'id': '170e679abe7fd4e69969850b305d00d64c6e4073', 'size': '107606', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/qt/locale/bitcoin_ky.ts', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Assembly', 'bytes': '51312'}, {'name': 'C', 'bytes': '101999'}, {'name': 'C++', 'bytes': '2824253'}, {'name': 'CSS', 'bytes': '1127'}, {'name': 'HTML', 'bytes': '50620'}, {'name': 'Makefile', 'bytes': '12072'}, {'name': 'NSIS', 'bytes': '6639'}, {'name': 'Objective-C', 'bytes': '1052'}, {'name': 'Objective-C++', 'bytes': '6310'}, {'name': 'Python', 'bytes': '45112'}, {'name': 'QMake', 'bytes': '17918'}, {'name': 'Shell', 'bytes': '8501'}]} |
@interface NSString (autoSize)
- (CGSize)calculateSize:(CGSize)size font:(UIFont *)font;
@end
| {'content_hash': '8d1b79aed6b8bb4c1c15cbf68fcd39ba', 'timestamp': '', 'source': 'github', 'line_count': 3, 'max_line_length': 57, 'avg_line_length': 31.333333333333332, 'alnum_prop': 0.7553191489361702, 'repo_name': 'hukezhu/sina', 'id': '12d7ed59105de88ed33531fdd1dcbb585cb650e2', 'size': '290', 'binary': False, 'copies': '1', 'ref': 'refs/heads/sina', 'path': 'Weibo/Classes/Public/Category/NSString+autoSize.h', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'C', 'bytes': '3266'}, {'name': 'C++', 'bytes': '76016'}, {'name': 'Objective-C', 'bytes': '836165'}, {'name': 'Objective-C++', 'bytes': '83484'}]} |
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2008 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- This file is used to define the mappings between lower-level system
user and group IDs and the higher-level permission names managed
by the platform.
Be VERY careful when editing this file! Mistakes made here can open
big security holes.
-->
<permissions>
<!-- ================================================================== -->
<!-- ================================================================== -->
<!-- ================================================================== -->
<!-- The following tags are associating low-level group IDs with
permission names. By specifying such a mapping, you are saying
that any application process granted the given permission will
also be running with the given group ID attached to its process,
so it can perform any filesystem (read, write, execute) operations
allowed for that group. -->
<permission name="android.permission.BLUETOOTH_ADMIN" >
<group gid="net_bt_admin" />
</permission>
<permission name="android.permission.BLUETOOTH" >
<group gid="net_bt" />
</permission>
<permission name="android.permission.BLUETOOTH_STACK" >
<group gid="net_bt_stack" />
</permission>
<permission name="android.permission.NET_TUNNELING" >
<group gid="vpn" />
</permission>
<permission name="android.permission.INTERNET" >
<group gid="inet" />
</permission>
<permission name="android.permission.READ_LOGS" >
<group gid="log" />
</permission>
<permission name="android.permission.READ_EXTERNAL_STORAGE" >
<group gid="sdcard_r" />
</permission>
<permission name="android.permission.WRITE_EXTERNAL_STORAGE" >
<group gid="sdcard_r" />
<group gid="sdcard_rw" />
</permission>
<permission name="android.permission.ACCESS_ALL_EXTERNAL_STORAGE" >
<group gid="sdcard_r" />
<group gid="sdcard_rw" />
<group gid="sdcard_all" />
</permission>
<permission name="android.permission.WRITE_MEDIA_STORAGE" >
<group gid="media_rw" />
</permission>
<permission name="android.permission.ACCESS_MTP" >
<group gid="mtp" />
</permission>
<permission name="android.permission.NET_ADMIN" >
<group gid="net_admin" />
</permission>
<!-- The group that /cache belongs to, linked to the permission
set on the applications that can access /cache -->
<permission name="android.permission.ACCESS_CACHE_FILESYSTEM" >
<group gid="cache" />
</permission>
<!-- RW permissions to any system resources owned by group 'diag'.
This is for carrier and manufacture diagnostics tools that must be
installable from the framework. Be careful. -->
<permission name="android.permission.DIAGNOSTIC" >
<group gid="input" />
<group gid="diag" />
</permission>
<!-- Group that can read detailed network usage statistics -->
<permission name="android.permission.READ_NETWORK_USAGE_HISTORY">
<group gid="net_bw_stats" />
</permission>
<!-- Group that can modify how network statistics are accounted -->
<permission name="android.permission.MODIFY_NETWORK_ACCOUNTING">
<group gid="net_bw_acct" />
</permission>
<permission name="android.permission.LOOP_RADIO" >
<group gid="loop_radio" />
</permission>
<!-- Group that can read write customization wizard folder usb file node for autobot -->
<permission name="com.htc.framework.permission.ACCESS_AUTOBOT_FILENODE">
<group gid="autobot_access" />
</permission>
<!-- Group that can read write serial port for sync job -->
<permission name="com.htc.permission.USB_SERIAL">
<group gid="usb" />
</permission>
<!-- Hotword training apps sometimes need a GID to talk with low-level
hardware; give them audio for now until full HAL support is added. -->
<permission name="android.permission.MANAGE_VOICE_KEYPHRASES">
<group gid="audio" />
</permission>
<!-- ================================================================== -->
<!-- ================================================================== -->
<!-- ================================================================== -->
<!-- The following tags are assigning high-level permissions to specific
user IDs. These are used to allow specific core system users to
perform the given operations with the higher-level framework. For
example, we give a wide variety of permissions to the shell user
since that is the user the adb shell runs under and developers and
others should have a fairly open environment in which to
interact with the system. -->
<assign-permission name="android.permission.MODIFY_AUDIO_SETTINGS" uid="media" />
<assign-permission name="android.permission.ACCESS_SURFACE_FLINGER" uid="media" />
<assign-permission name="android.permission.WAKE_LOCK" uid="media" />
<assign-permission name="android.permission.UPDATE_DEVICE_STATS" uid="media" />
<assign-permission name="android.permission.UPDATE_APP_OPS_STATS" uid="media" />
<assign-permission name="com.htc.permission.APP_PLATFORM" uid="media" />
<assign-permission name="android.permission.ACCESS_SURFACE_FLINGER" uid="graphics" />
<!-- This is a list of all the libraries available for application
code to link against. -->
<library name="android.test.runner"
file="/system/framework/android.test.runner.jar" />
<library name="javax.obex"
file="/system/framework/javax.obex.jar"/>
<!-- These are the standard packages that are white-listed to always have internet
access while in power save mode, even if they aren't in the foreground. -->
<allow-in-power-save package="com.android.providers.downloads" />
</permissions>
| {'content_hash': '3c45583db033320b2e2cbedb5f8e8210', 'timestamp': '', 'source': 'github', 'line_count': 165, 'max_line_length': 92, 'avg_line_length': 40.25454545454546, 'alnum_prop': 0.6199939777175549, 'repo_name': 'shumxin/FlymeOS_A5DUG', 'id': '9ca43fbf6c71d8a50ab8c614f79f2ccbf487f65e', 'size': '6642', 'binary': False, 'copies': '1', 'ref': 'refs/heads/lollipop-5.0', 'path': 'vendor/system/etc/permissions/platform.xml', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'GLSL', 'bytes': '1500'}, {'name': 'HTML', 'bytes': '96769'}, {'name': 'Makefile', 'bytes': '13678'}, {'name': 'Shell', 'bytes': '103420'}, {'name': 'Smali', 'bytes': '189389087'}]} |
[DscLocalConfigurationManager()]
Configuration ConfigureAzureAutomation
{
param
(
[parameter(Mandatory = $true)]
[string] $RegistrationUrl,
[parameter(Mandatory = $true)]
[pscredential] $RegistrationKey,
[int] $RefreshFrequencyMins = 30,
[int] $ConfigurationModeFrequencyMins = 15,
[string] $ConfigurationMode = "ApplyAndMonitor",
[string] $NodeConfigurationName,
[boolean] $RebootNodeIfNeeded= $false,
[string] $ActionAfterReboot = "ContinueConfiguration",
[boolean] $AllowModuleOverwrite = $false,
[string] $Timestamp = ""
)
if(!$RefreshFrequencyMins -or $RefreshFrequencyMins -eq "")
{
$RefreshFrequencyMins = 30
}
if(!$ConfigurationModeFrequencyMins -or $ConfigurationModeFrequencyMins -eq "")
{
$ConfigurationModeFrequencyMins = 15
}
if(!$ConfigurationMode -or $ConfigurationMode -eq "")
{
$ConfigurationMode = "ApplyAndMonitor"
}
if(!$ActionAfterReboot -or $ActionAfterReboot -eq "")
{
$ActionAfterReboot = "ContinueConfiguration"
}
if(!$NodeConfigurationName -or $NodeConfigurationName -eq "")
{
$ConfigurationNames = $null
}
else
{
$ConfigurationNames = @($NodeConfigurationName)
}
Settings
{
RefreshFrequencyMins = $RefreshFrequencyMins
RefreshMode = "Pull"
ConfigurationMode = $ConfigurationMode
AllowModuleOverwrite = $AllowModuleOverwrite
RebootNodeIfNeeded = $RebootNodeIfNeeded
ActionAfterReboot = $ActionAfterReboot
ConfigurationModeFrequencyMins = $ConfigurationModeFrequencyMins
}
ConfigurationRepositoryWeb AzureAutomationDSC
{
ServerUrl = $RegistrationUrl
RegistrationKey = $RegistrationKey.GetNetworkCredential().Password
ConfigurationNames = $ConfigurationNames
}
ResourceRepositoryWeb AzureAutomationDSC
{
ServerUrl = $RegistrationUrl
RegistrationKey = $RegistrationKey.GetNetworkCredential().Password
}
ReportServerWeb AzureAutomationDSC
{
ServerUrl = $RegistrationUrl
RegistrationKey = $RegistrationKey.GetNetworkCredential().Password
}
} | {'content_hash': '1361efaacdc692386d1a071d501606b4', 'timestamp': '', 'source': 'github', 'line_count': 80, 'max_line_length': 83, 'avg_line_length': 28.4625, 'alnum_prop': 0.6596398770311814, 'repo_name': 'peterschen/ARM', 'id': '2ea96128f5389d5b4704af207b32735cf218e450', 'size': '2277', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'old/04-Services/Scripts/ConfigureAzureAutomation.ps1', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'PowerShell', 'bytes': '32819'}]} |
package nl.xillio.xill.plugins.string.constructs;
import nl.xillio.xill.api.components.MetaExpression;
import nl.xillio.xill.api.components.ExpressionBuilderHelper;
import nl.xillio.xill.api.errors.InvalidUserInputException;
import nl.xillio.xill.api.errors.RobotRuntimeException;
import nl.xillio.xill.plugins.string.exceptions.FailedToGetMatcherException;
import nl.xillio.xill.plugins.string.services.string.RegexService;
import org.testng.Assert;
import org.testng.annotations.Test;
import java.util.Arrays;
import java.util.List;
import java.util.regex.PatternSyntaxException;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.*;
/**
* Test the {@link RegexConstruct}.
*/
public class RegexConstructTest extends ExpressionBuilderHelper {
private int timeoutValue = 10000;
/**
* Test the process method with an ATOMIC value given.
*
* @throws FailedToGetMatcherException
* @throws IllegalArgumentException
* @throws PatternSyntaxException
*/
@Test
public void processStandardInput() throws IllegalArgumentException, FailedToGetMatcherException {
// Mock
String valueValue = "I need a doctor";
MetaExpression value = mock(MetaExpression.class);
when(value.getStringValue()).thenReturn(valueValue);
String regexValue = ".*doctor*.";
MetaExpression regex = mock(MetaExpression.class);
when(regex.getStringValue()).thenReturn(regexValue);
MetaExpression timeout = mock(MetaExpression.class);
when(timeout.getNumberValue()).thenReturn(timeoutValue);
List<String> resultValue = Arrays.asList("a", "b", "c");
RegexService regexService = mock(RegexService.class);
when(regexService.matches(any())).thenReturn(true);
when(regexService.tryMatchElseNull(any())).thenReturn(resultValue);
// Run
MetaExpression result = RegexConstruct.process(value, regex, timeout, regexService);
// Verify
verify(regexService, times(1)).matches(any());
verify(regexService, times(1)).tryMatchElseNull(any());
verify(regexService, times(1)).getMatcher(regexValue, valueValue, timeoutValue);
// Assert
Assert.assertEquals(result.getType(), LIST);
@SuppressWarnings("unchecked")
List<MetaExpression> resultAsList = (List<MetaExpression>) result.getValue();
Assert.assertEquals(resultAsList.get(0).getStringValue(), "a");
Assert.assertEquals(resultAsList.get(1).getStringValue(), "b");
Assert.assertEquals(resultAsList.get(2).getStringValue(), "c");
}
/**
* Test the process method for when it throws an error.
*
* @throws FailedToGetMatcherException
* @throws IllegalArgumentException
* @throws PatternSyntaxException
*/
@Test(expectedExceptions = InvalidUserInputException.class, expectedExceptionsMessageRegExp = "Invalid pattern in regex\\(\\)..*")
public void processInvalidPattern() throws IllegalArgumentException, FailedToGetMatcherException {
// Mock
String valueValue = "I need a doctor";
MetaExpression value = mock(MetaExpression.class);
when(value.getStringValue()).thenReturn(valueValue);
String regexValue = ".*doctor*.";
MetaExpression regex = mock(MetaExpression.class);
when(regex.getStringValue()).thenReturn(regexValue);
MetaExpression timeout = mock(MetaExpression.class);
when(timeout.getNumberValue()).thenReturn(timeoutValue);
Exception returnValue = new PatternSyntaxException(regexValue, regexValue, timeoutValue);
RegexService regexService = mock(RegexService.class);
when(regexService.getMatcher(regexValue, valueValue, timeoutValue)).thenThrow(returnValue);
RegexConstruct.process(value, regex, timeout, regexService);
// Verify
verify(regexService, times(1)).matches(any());
verify(regexService, times(1)).getMatcher(regexValue, valueValue, timeoutValue);
}
/**
* Test the process method for when it throws an error.
*
* @throws FailedToGetMatcherException
* @throws IllegalArgumentException
* @throws PatternSyntaxException
*/
@Test(expectedExceptions = RobotRuntimeException.class, expectedExceptionsMessageRegExp = "Error while executing the regex")
public void processIllegalArgument() throws IllegalArgumentException, FailedToGetMatcherException {
// Mock
String valueValue = "I need a doctor";
MetaExpression value = mock(MetaExpression.class);
when(value.getStringValue()).thenReturn(valueValue);
String regexValue = ".*doctor*.";
MetaExpression regex = mock(MetaExpression.class);
when(regex.getStringValue()).thenReturn(regexValue);
MetaExpression timeout = mock(MetaExpression.class);
when(timeout.getNumberValue()).thenReturn(timeoutValue);
Exception returnValue = new IllegalArgumentException();
RegexService regexService = mock(RegexService.class);
when(regexService.getMatcher(regexValue, valueValue, timeoutValue)).thenThrow(returnValue);
RegexConstruct.process(value, regex, timeout, regexService);
// Verify
verify(regexService, times(1)).matches(any());
verify(regexService, times(1)).getMatcher(regexValue, valueValue, timeoutValue);
}
/**
* Tests if the process returns NULL if no matches are found.
*
* @throws FailedToGetMatcherException
* @throws IllegalArgumentException
* @throws PatternSyntaxException
*/
@Test
public void processNoMatches() throws IllegalArgumentException, FailedToGetMatcherException {
// Mock
String valueValue = "I need a doctor";
MetaExpression value = mock(MetaExpression.class);
when(value.getStringValue()).thenReturn(valueValue);
String regexValue = ".*doctor*.";
MetaExpression regex = mock(MetaExpression.class);
when(regex.getStringValue()).thenReturn(regexValue);
MetaExpression timeout = mock(MetaExpression.class);
when(timeout.getNumberValue()).thenReturn(timeoutValue);
List<String> resultValue = Arrays.asList("a", "b", "c");
RegexService regexService = mock(RegexService.class);
when(regexService.matches(any())).thenReturn(false);
when(regexService.tryMatchElseNull(any())).thenReturn(resultValue);
// Run
MetaExpression result = RegexConstruct.process(value, regex, timeout, regexService);
// Verify
verify(regexService, times(1)).matches(any());
verify(regexService, times(0)).tryMatchElseNull(any());
verify(regexService, times(1)).getMatcher(regexValue, valueValue, timeoutValue);
// Assert
Assert.assertEquals(result, NULL);
}
}
| {'content_hash': 'e22744a3feda042a138abec30e789f01', 'timestamp': '', 'source': 'github', 'line_count': 166, 'max_line_length': 134, 'avg_line_length': 42.397590361445786, 'alnum_prop': 0.684995737425405, 'repo_name': 'XillioQA/xill-platform-3.4', 'id': 'ceedd06e17066df8692f16799275b281f5010d98', 'size': '7671', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'xill-processor/src/test/java/nl/xillio/xill/plugins/string/constructs/RegexConstructTest.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '93045'}, {'name': 'HTML', 'bytes': '22194'}, {'name': 'Java', 'bytes': '3642844'}, {'name': 'JavaScript', 'bytes': '11981754'}, {'name': 'PowerShell', 'bytes': '1383'}, {'name': 'Shell', 'bytes': '959'}]} |
package cmd
import (
"encoding/base64"
"fmt"
"io/ioutil"
"log"
"os"
"strconv"
"github.com/elliottsam/vault-config/crypto"
"github.com/elliottsam/vault-config/template"
"github.com/elliottsam/vault-config/vault"
"github.com/hashicorp/hcl/hcl/printer"
"github.com/hashicorp/vault/api"
"github.com/spf13/cobra"
)
var (
path string
generate bool
decodedKey []byte
)
const secret_tmpl = `
{{ range . }}
{{ LookupSecret . }}
{{ end }}
`
var e crypto.EncryptionObject
// exportCmd represents the export command
var exportCmd = &cobra.Command{
Use: "export",
Short: "Export walks a path and exports secrets",
Long: `A longer description that spans multiple lines and likely contains examples
and usage of using your command. For example:
Cobra is a CLI library for Go that empowers applications.
This application is a tool to generate the needed files
to quickly create a Cobra application.`,
Run: func(cmd *cobra.Command, args []string) {
if path == "" {
log.Fatal("Please supply a Vault path with the -path parameter")
}
c := api.DefaultConfig()
if tlsSkipVerify, ok := os.LookupEnv("VAULT_SKIP_VERIFY"); ok {
if tlsSVBool, err := strconv.ParseBool(tlsSkipVerify); err != nil {
log.Fatal("Error parsing VAULT_SKIP_VERIFY boolean")
} else {
c.ConfigureTLS(&api.TLSConfig{Insecure: tlsSVBool})
}
}
client, err := vault.NewClient(c)
if err != nil {
log.Fatal("Error creating Vault client")
}
sPath, err := client.WalkVault(path)
if err != nil {
log.Fatal(err)
}
tmpl := template.InitGenerator("", []byte(secret_tmpl))
for _, v := range sPath {
tmpl.UpdateVarsMap(v, v)
}
e.PlainText = tmpl.GenerateConfig()
if encrypted {
if generate {
decodedKey = crypto.RandomKey(32)
log.Printf("Generated Key: %s\n", base64.StdEncoding.EncodeToString(decodedKey))
} else if key == "" {
log.Fatalf("Error: No encryption key supplied, either provide key or generate")
} else {
decodedKey, err = base64.StdEncoding.DecodeString(key)
if err != nil {
log.Fatalf("Error decoding base64 key: %v", key)
}
}
e.Key = decodedKey
err = e.InlineEncryptMap("secret/data")
if err != nil {
log.Fatalf("Error encrypting Vault Config: %v", err)
}
e.PlainText = e.CipherText
}
e.PlainText, err = printer.Format(e.PlainText)
if err != nil {
log.Fatalf("Error formatting vault-config: %v", err)
}
if output == "" {
fmt.Println(string(e.PlainText))
} else {
if err := ioutil.WriteFile(output, e.PlainText, 0600); err != nil {
log.Fatalf("Error writing vault config to file: %v", err)
}
}
},
}
func init() {
RootCmd.AddCommand(exportCmd)
exportCmd.Flags().StringVarP(&path, "path", "p", "", "Path to retrieve secrets from")
exportCmd.Flags().BoolVarP(&encrypted, "encrypted", "e", false, "Should output be encrypted?")
exportCmd.Flags().StringVarP(&key, "key", "k", "", "Encryption key this must be 32 bytes")
exportCmd.Flags().BoolVarP(&generate, "generate", "g", false, "Generate encyption key at runtime")
exportCmd.Flags().StringVarP(&output, "output", "o", "", "Filename to output configuration to")
}
| {'content_hash': 'e3598ffaf3949edcd4ad1a5b27700c38', 'timestamp': '', 'source': 'github', 'line_count': 117, 'max_line_length': 99, 'avg_line_length': 27.05982905982906, 'alnum_prop': 0.6730890713834492, 'repo_name': 'elliottsam/vault-config', 'id': '97dc9098d18ab0b6557ce4ba8bc4961e97fd83a9', 'size': '3775', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'cmd/export.go', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Go', 'bytes': '58650'}]} |
package voldemort.store.readonly.fetcher;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import java.io.File;
import java.io.IOException;
import java.text.NumberFormat;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.atomic.AtomicInteger;
import javax.management.ObjectName;
import org.apache.hadoop.fs.FileStatus;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.log4j.Logger;
import voldemort.VoldemortException;
import voldemort.cluster.Cluster;
import voldemort.routing.RoutingStrategy;
import voldemort.routing.RoutingStrategyFactory;
import voldemort.server.VoldemortConfig;
import voldemort.server.protocol.admin.AdminServiceRequestHandler;
import voldemort.server.protocol.admin.AsyncOperationStatus;
import voldemort.store.StoreDefinition;
import voldemort.store.metadata.MetadataStore;
import voldemort.store.quota.QuotaExceededException;
import voldemort.store.readonly.FileFetcher;
import voldemort.store.readonly.ReadOnlyStorageMetadata;
import voldemort.store.readonly.ReadOnlyUtils;
import voldemort.store.readonly.UnauthorizedStoreException;
import voldemort.store.readonly.checksum.CheckSum.CheckSumType;
import voldemort.store.readonly.mr.utils.HadoopUtils;
import voldemort.store.readonly.mr.utils.VoldemortUtils;
import voldemort.utils.ByteUtils;
import voldemort.utils.EventThrottler;
import voldemort.utils.JmxUtils;
import voldemort.utils.Time;
import voldemort.utils.Utils;
/**
* A {@link FileFetcher} implementation that fetches the store files from HDFS
*/
public class HdfsFetcher implements FileFetcher {
// Class-level state
private static final Logger logger = Logger.getLogger(HdfsFetcher.class);
private static final AtomicInteger copyCount = new AtomicInteger(0);
private static Boolean allowFetchingOfSingleFile = false;
// Instance-level state
private final Long maxBytesPerSecond, reportingIntervalBytes;
private final int bufferSize, maxAttempts, maxVersionsStatsFile;
private final long retryDelayMs;
private final boolean enableStatsFile;
private final EventThrottler throttler;
private final VoldemortConfig voldemortConfig;
/**
* This is the constructor invoked via reflection from
* {@link AdminServiceRequestHandler#setFetcherClass(voldemort.server.VoldemortConfig)}
*/
public HdfsFetcher(VoldemortConfig config) {
this(config,
config.getReadOnlyFetcherMaxBytesPerSecond(),
config.getReadOnlyFetcherReportingIntervalBytes(),
config.getReadOnlyFetcherThrottlerInterval(),
config.getFetcherBufferSize(),
config.getReadOnlyFetchRetryCount(),
config.getReadOnlyFetchRetryDelayMs(),
config.isReadOnlyStatsFileEnabled(),
config.getReadOnlyMaxVersionsStatsFile(),
config.getFetcherSocketTimeout());
}
/**
* Test-only constructor, with some default config values, including:
*
* The Hadoop config path is set to empty string, which triggers a different code path
* in {@link HadoopUtils#getConfiguration(voldemort.server.VoldemortConfig, String)}.
*
* The keytab path is set to empty string, which triggers a different code path
* in {@link HadoopUtils#getHadoopFileSystem(voldemort.server.VoldemortConfig, String)}.
*
* FIXME: Change visibility or otherwise ensure that only test code can use this...
*
* @deprecated Do not use for production code, use {@link #HdfsFetcher(voldemort.server.VoldemortConfig)} instead.
*/
@Deprecated
public HdfsFetcher() {
this(new VoldemortConfig(-1, ""), // Fake config with a bogus node ID and server config path
(Long) null,
VoldemortConfig.DEFAULT_REPORTING_INTERVAL_BYTES,
VoldemortConfig.DEFAULT_FETCHER_THROTTLE_INTERVAL_WINDOW_MS,
VoldemortConfig.DEFAULT_FETCHER_BUFFER_SIZE,
3,
1000,
true,
50,
VoldemortConfig.DEFAULT_FETCHER_SOCKET_TIMEOUT);
this.voldemortConfig.setHadoopConfigPath("");
this.voldemortConfig.setReadOnlyKeytabPath("");
}
private HdfsFetcher(VoldemortConfig config,
Long maxBytesPerSecond,
Long reportingIntervalBytes,
int throttlerIntervalMs,
int bufferSize,
int retryCount,
long retryDelayMs,
boolean enableStatsFile,
int maxVersionsStatsFile,
int socketTimeout) {
this.voldemortConfig = config;
String throttlerInfo = "";
if(maxBytesPerSecond != null && maxBytesPerSecond > 0) {
this.maxBytesPerSecond = maxBytesPerSecond;
this.throttler = new EventThrottler(this.maxBytesPerSecond,
throttlerIntervalMs,
"hdfs-fetcher-node-throttler");
throttlerInfo = "throttler with global rate = " + maxBytesPerSecond + " bytes / sec";
} else {
this.maxBytesPerSecond = null;
this.throttler = null;
throttlerInfo = "no throttler";
}
this.reportingIntervalBytes = Utils.notNull(reportingIntervalBytes);
this.bufferSize = bufferSize;
this.maxAttempts = retryCount + 1;
this.retryDelayMs = retryDelayMs;
this.enableStatsFile = enableStatsFile;
this.maxVersionsStatsFile = maxVersionsStatsFile;
logger.info("Created HdfsFetcher: " + throttlerInfo +
", buffer size = " + bufferSize + " bytes" +
", reporting interval = " + reportingIntervalBytes + " bytes" +
", fetcher socket timeout = " + socketTimeout + " ms.");
}
/**
* Used only by unit tests and by the deprecated {@link voldemort.server.http.gui.ReadOnlyStoreManagementServlet}.
*
* FIXME: Refactor test code with dependency injection or scope restrictions so this function is not public.
*
* @deprecated Do not use for production code, use {@link #fetch(String, String, voldemort.server.protocol.admin.AsyncOperationStatus, String, long, voldemort.store.metadata.MetadataStore, Long diskQuotaSizeInKB)} instead.
*/
@Deprecated
@Override
public File fetch(String source, String dest) throws Exception {
return fetch(source, dest, VoldemortConfig.DEFAULT_DEFAULT_STORAGE_SPACE_QUOTA_IN_KB);
}
/**
* Used for unit tests only.
*
* FIXME: Refactor test code with dependency injection or scope restrictions so this function is not public.
*
* @deprecated Do not use for production code, use {@link #fetch(String, String, voldemort.server.protocol.admin.AsyncOperationStatus, String, long, voldemort.store.metadata.MetadataStore, Long diskQuotaSizeInKB)} instead.
*/
@Deprecated
@Override
public File fetch(String source, String dest, long diskQuotaSizeInKB) throws Exception {
return fetchFromSource(source, dest, null, null, -1, diskQuotaSizeInKB, null);
}
@Override
public File fetch(String sourceFileUrl,
String destinationFile,
AsyncOperationStatus status,
String storeName,
long pushVersion,
MetadataStore metadataStore,
Long diskQuotaSizeInKB) throws Exception {
logger.info("Starting fetch for : " + sourceFileUrl);
return fetchFromSource(sourceFileUrl,
destinationFile,
status,
storeName,
pushVersion,
diskQuotaSizeInKB,
metadataStore);
}
private File fetchFromSource(String sourceFileUrl,
String destinationFile,
AsyncOperationStatus status,
String storeName,
long pushVersion,
Long diskQuotaSizeInKB,
MetadataStore metadataStore) throws Exception {
ObjectName jmxName = null;
HdfsCopyStats stats = null;
FileSystem fs = null;
sourceFileUrl = VoldemortUtils.modifyURL(sourceFileUrl, voldemortConfig);
// Flag to indicate whether the fetch is complete or not
boolean isCompleteFetch = false;
try {
// Record as one store fetch
HdfsCopyStats.storeFetch();
fs = HadoopUtils.getHadoopFileSystem(voldemortConfig, sourceFileUrl);
final Path rootPath = new Path(sourceFileUrl);
File destination = new File(destinationFile);
if(destination.exists()) {
throw new VoldemortException("Version directory " + destination.getAbsolutePath()
+ " already exists");
}
boolean isFile = isFile(fs, rootPath);
stats = new HdfsCopyStats(sourceFileUrl,
destination,
false, // stats file initially disabled, to fetch just the first metadata file
maxVersionsStatsFile,
isFile,
null);
jmxName = JmxUtils.registerMbean("hdfs-copy-" + copyCount.getAndIncrement(), stats);
logger.info("Starting fetch for : " + sourceFileUrl);
FetchStrategy fetchStrategy = new BasicFetchStrategy(this,
fs,
stats,
status,
bufferSize);
if(!isFile) { // We are asked to fetch a directory
Utils.mkdirs(destination);
HdfsDirectory rootDirectory = new HdfsDirectory(fs, rootPath, this.voldemortConfig);
List<HdfsDirectory> directoriesToFetch = Lists.newArrayList();
HdfsFile metadataFile = rootDirectory.getMetadataFile();
Long expectedDiskSize = -1L;
if(metadataFile != null) {
File copyLocation = new File(destination, metadataFile.getPath().getName());
fetchStrategy.fetch(metadataFile, copyLocation, null);
rootDirectory.initializeMetadata(copyLocation);
if (metadataFile.getDiskFileName().equals(ReadOnlyUtils.FULL_STORE_METADATA_FILE)) {
// Then we are in build.primary.replica.only mode, and we need to determine which
// partition sub-directories to download
Set<Integer> partitions = getPartitionsForCurrentNode(metadataStore, storeName);
for (int partitionId: partitions) {
String partitionKey = ReadOnlyUtils.PARTITION_DIRECTORY_PREFIX + partitionId;
ReadOnlyStorageMetadata partitionMetadata = rootDirectory.getMetadata().getNestedMetadata(partitionKey);
String diskSizeInBytes = (String) partitionMetadata.get(ReadOnlyStorageMetadata.DISK_SIZE_IN_BYTES);
if (diskSizeInBytes != null && diskSizeInBytes != "") {
logger.debug("Partition " + partitionId + " is served by this node and is not empty, so it will be downloaded.");
if (expectedDiskSize == -1) {
expectedDiskSize = Long.parseLong(diskSizeInBytes);
} else {
expectedDiskSize += Long.parseLong(diskSizeInBytes);
}
HdfsDirectory partitionDirectory = new HdfsDirectory(fs,
new Path(rootPath, partitionKey),
this.voldemortConfig);
partitionDirectory.initializeMetadata(partitionMetadata);
directoriesToFetch.add(partitionDirectory);
} else {
logger.debug("Partition " + partitionId + " is served by this node but it is empty, so it will be skipped.");
}
}
} else {
// Then we are not in build.primary.replica.only mode (old behavior), and we
// need to download the entire node directory we're currently in.
String diskSizeInBytes = (String) rootDirectory.getMetadata()
.get(ReadOnlyStorageMetadata.DISK_SIZE_IN_BYTES);
if (diskSizeInBytes != null && diskSizeInBytes != "") {
expectedDiskSize = Long.parseLong(diskSizeInBytes);
}
directoriesToFetch.add(rootDirectory);
}
}
checkIfQuotaExceeded(diskQuotaSizeInKB,
storeName,
destination,
expectedDiskSize);
stats = new HdfsCopyStats(sourceFileUrl,
destination,
enableStatsFile,
maxVersionsStatsFile,
isFile,
new HdfsPathInfo(directoriesToFetch));
fetchStrategy = new BasicFetchStrategy(this,
fs,
stats,
status,
bufferSize);
logger.debug("directoriesToFetch for store '" + storeName + "': " + Arrays
.toString(directoriesToFetch.toArray()));
for (HdfsDirectory directoryToFetch: directoriesToFetch) {
Map<HdfsFile, byte[]> fileCheckSumMap = fetchStrategy.fetch(directoryToFetch, destination);
if(directoryToFetch.validateCheckSum(fileCheckSumMap)) {
logger.info("Completed fetch: " + sourceFileUrl);
} else {
stats.checkSumFailed();
logger.error("Checksum did not match for " + directoryToFetch.toString() + " !");
return null;
}
}
isCompleteFetch = true;
return destination;
} else if (allowFetchingOfSingleFile) {
/** This code path is only used by {@link #main(String[])} */
Utils.mkdirs(destination);
HdfsFile file = new HdfsFile(fs.getFileStatus(rootPath));
String fileName = file.getDiskFileName();
File copyLocation = new File(destination, fileName);
fetchStrategy.fetch(file, copyLocation, CheckSumType.NONE);
logger.info("Completed fetch : " + sourceFileUrl);
isCompleteFetch = true;
return destination;
} else {
logger.error("Source " + rootPath.toString() + " should be a directory");
return null;
}
} catch (Exception e) {
if(stats != null) {
stats.reportError("File fetcher failed for destination " + destinationFile, e);
}
// Since AuthenticationException may happen before stats object initialization (HadoopUtils.getHadoopFileSystem),
// we use the static method to capture all the exceptions here.
HdfsCopyStats.reportExceptionForStats(e);
if(e instanceof VoldemortException) {
throw e;
} else {
throw new VoldemortException("Error thrown while trying to get data from Hadoop filesystem: " + e.getMessage(), e);
}
} finally {
if(jmxName != null)
JmxUtils.unregisterMbean(jmxName);
if(stats != null) {
stats.complete();
}
if (!isCompleteFetch) {
HdfsCopyStats.incompleteFetch();
}
if(fs != null) {
try {
fs.close();
} catch(Exception e) {
String errorMessage = "Caught " + e.getClass().getSimpleName() +
" while trying to close the filesystem instance (harmless).";
if(stats != null) {
stats.reportError(errorMessage, e);
}
logger.debug(errorMessage, e);
}
}
}
}
/**
* @return the set of partitions which need to be served (and thus fetched) by the current node.
*/
private Set<Integer> getPartitionsForCurrentNode(MetadataStore metadataStore, String storeName) {
Set<Integer> partitions = Sets.newHashSet();
StoreDefinition storeDefinition = metadataStore.getStoreDef(storeName);
Cluster cluster = metadataStore.getCluster();
List<Integer> partitionsMasteredByCurrentNode = cluster.getNodeById(metadataStore.getNodeId()).getPartitionIds();
RoutingStrategy routingStrategy = new RoutingStrategyFactory().updateRoutingStrategy(storeDefinition, cluster);
// For each partition in the cluster, determine if it needs to be served by the current node
for (int partitionId = 0; partitionId < cluster.getNumberOfPartitions(); partitionId++) {
boolean partitionIdIsServedByCurrentNode = false;
for (Integer replicatingPartition: routingStrategy.getReplicatingPartitionList(partitionId)) {
if (partitionsMasteredByCurrentNode.contains(replicatingPartition)) {
partitionIdIsServedByCurrentNode = true;
break;
}
}
if (partitionIdIsServedByCurrentNode) {
partitions.add(partitionId);
} else {
logger.debug("Partition " + partitionId + " is not served by this node, so it will be skipped.");
}
}
return partitions;
}
/**
* Only check quota for those stores:that are listed in the
* System store - voldsys$_store_quotas and have non -1 values.
* Others are either:
*
* 1. already existing non quota-ed store, that will be
* converted to quota-ed stores in future. (or)
* 2. new stores that do not want to be affected by the
* disk quota feature at all. -1 represents no Quota
*/
private void checkIfQuotaExceeded(Long diskQuotaSizeInKB,
String storeName,
File dest,
Long expectedDiskSize) {
if(diskQuotaSizeInKB != null
&& diskQuotaSizeInKB != VoldemortConfig.DEFAULT_DEFAULT_STORAGE_SPACE_QUOTA_IN_KB) {
String logMessage = "Store: " + storeName + ", Destination: " + dest.getAbsolutePath()
+ ", Expected disk size in KB: "
+ (expectedDiskSize / ByteUtils.BYTES_PER_KB)
+ ", Disk quota size in KB: " + diskQuotaSizeInKB;
logger.debug(logMessage);
if(diskQuotaSizeInKB == 0L) {
String errorMessage = "Not able to find store (" + storeName +
") in this cluster according to the push URL. BnP job is not able to create new stores now." +
"Please reach out to a Voldemort admin if you think this is the correct cluster you want to push.";
logger.error(errorMessage);
throw new UnauthorizedStoreException(errorMessage);
}
// check if there is still sufficient quota left for this push
Long estimatedDiskSizeNeeded = (expectedDiskSize / ByteUtils.BYTES_PER_KB);
if(estimatedDiskSizeNeeded >= diskQuotaSizeInKB) {
String errorMessage = "Quota Exceeded for " + logMessage;
logger.error(errorMessage);
throw new QuotaExceededException(errorMessage);
}
} else {
logger.debug("store: " + storeName + " is a Non Quota type store.");
}
}
private boolean isFile(FileSystem fs, Path rootPath) {
for (int attempt = 1; attempt <= getMaxAttempts(); attempt++) {
try {
return fs.isFile(rootPath);
} catch (IOException e) {
logger.error("Error while calling isFile for path:" + rootPath.toString() + " Attempt: #" + attempt + "/"
+ getMaxAttempts());
if (getRetryDelayMs() > 0) {
try {
Thread.sleep(getRetryDelayMs());
} catch (InterruptedException ie) {
logger.error("Fetcher is interrupted while wating to retry.", ie);
}
}
}
}
throw new VoldemortException(
"After retrying " + getMaxAttempts() + "times, can not get result from filesystem for isFile.");
}
public Long getReportingIntervalBytes() {
return reportingIntervalBytes;
}
public EventThrottler getThrottler() {
return throttler;
}
public long getRetryDelayMs() {
return retryDelayMs;
}
public int getMaxAttempts() {
return maxAttempts;
}
/**
* Main method for testing fetching
*/
public static void main(String[] args) throws Exception {
if(args.length < 1)
Utils.croak("USAGE: java " + HdfsFetcher.class.getName()
+ " url [keytab-location kerberos-username hadoop-config-path [destDir]]");
String url = args[0];
VoldemortConfig config = new VoldemortConfig(-1, "");
HdfsFetcher fetcher = new HdfsFetcher(config);
String destDir = null;
Long diskQuotaSizeInKB;
if(args.length >= 4) {
fetcher.voldemortConfig.setReadOnlyKeytabPath(args[1]);
fetcher.voldemortConfig.setReadOnlyKerberosUser(args[2]);
fetcher.voldemortConfig.setHadoopConfigPath(args[3]);
}
if(args.length >= 5)
destDir = args[4];
if(args.length >= 6)
diskQuotaSizeInKB = Long.parseLong(args[5]);
else
diskQuotaSizeInKB = null;
// for testing we want to be able to download a single file
allowFetchingOfSingleFile = true;
FileSystem fs = HadoopUtils.getHadoopFileSystem(fetcher.voldemortConfig, url);
Path p = new Path(url);
FileStatus status = fs.listStatus(p)[0];
long size = status.getLen();
long start = System.currentTimeMillis();
if(destDir == null)
destDir = System.getProperty("java.io.tmpdir") + File.separator + start;
File location = fetcher.fetch(url, destDir, null, null, -1, null, diskQuotaSizeInKB);
double rate = size * Time.MS_PER_SECOND / (double) (System.currentTimeMillis() - start);
NumberFormat nf = NumberFormat.getInstance();
nf.setMaximumFractionDigits(2);
System.out.println("Fetch to " + location + " completed: "
+ nf.format(rate / (1024.0 * 1024.0)) + " MB/sec.");
fs.close();
}
}
| {'content_hash': '23ac359ae95c7fcdbe7b55e589957ca1', 'timestamp': '', 'source': 'github', 'line_count': 519, 'max_line_length': 226, 'avg_line_length': 46.67437379576108, 'alnum_prop': 0.5740587846763541, 'repo_name': 'FelixGV/voldemort', 'id': '4931555ceffd5fa38d6606aa86e95eead12f42be', 'size': '24821', 'binary': False, 'copies': '5', 'ref': 'refs/heads/master', 'path': 'contrib/hadoop-store-builder/src/java/voldemort/store/readonly/fetcher/HdfsFetcher.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '10582'}, {'name': 'C++', 'bytes': '206626'}, {'name': 'CSS', 'bytes': '1078'}, {'name': 'HTML', 'bytes': '13143'}, {'name': 'Java', 'bytes': '8343444'}, {'name': 'M4', 'bytes': '36267'}, {'name': 'Makefile', 'bytes': '7338'}, {'name': 'PHP', 'bytes': '1479'}, {'name': 'Protocol Buffer', 'bytes': '20298'}, {'name': 'Python', 'bytes': '85654'}, {'name': 'Ruby', 'bytes': '52094'}, {'name': 'Shell', 'bytes': '73253'}, {'name': 'Thrift', 'bytes': '837'}]} |
namespace gpu {
using testing::Return;
using testing::Mock;
using testing::Truly;
using testing::Sequence;
using testing::DoAll;
using testing::Invoke;
using testing::_;
class BaseRingBufferTest : public testing::Test {
protected:
static const unsigned int kBaseOffset = 128;
static const unsigned int kBufferSize = 1024;
virtual void SetUp() {
api_mock_.reset(new AsyncAPIMock);
// ignore noops in the mock - we don't want to inspect the internals of the
// helper.
EXPECT_CALL(*api_mock_, DoCommand(cmd::kNoop, 0, _))
.WillRepeatedly(Return(error::kNoError));
// Forward the SetToken calls to the engine
EXPECT_CALL(*api_mock_.get(), DoCommand(cmd::kSetToken, 1, _))
.WillRepeatedly(DoAll(Invoke(api_mock_.get(), &AsyncAPIMock::SetToken),
Return(error::kNoError)));
{
TransferBufferManager* manager = new TransferBufferManager();
transfer_buffer_manager_.reset(manager);
EXPECT_TRUE(manager->Initialize());
}
command_buffer_.reset(
new CommandBufferService(transfer_buffer_manager_.get()));
EXPECT_TRUE(command_buffer_->Initialize());
gpu_scheduler_.reset(new GpuScheduler(
command_buffer_.get(), api_mock_.get(), NULL));
command_buffer_->SetPutOffsetChangeCallback(base::Bind(
&GpuScheduler::PutChanged, base::Unretained(gpu_scheduler_.get())));
command_buffer_->SetGetBufferChangeCallback(base::Bind(
&GpuScheduler::SetGetBuffer, base::Unretained(gpu_scheduler_.get())));
api_mock_->set_engine(gpu_scheduler_.get());
helper_.reset(new CommandBufferHelper(command_buffer_.get()));
helper_->Initialize(kBufferSize);
}
int32 GetToken() {
return command_buffer_->GetState().token;
}
#if defined(OS_MACOSX)
base::mac::ScopedNSAutoreleasePool autorelease_pool_;
#endif
MessageLoop message_loop_;
scoped_ptr<AsyncAPIMock> api_mock_;
scoped_ptr<TransferBufferManagerInterface> transfer_buffer_manager_;
scoped_ptr<CommandBufferService> command_buffer_;
scoped_ptr<GpuScheduler> gpu_scheduler_;
scoped_ptr<CommandBufferHelper> helper_;
};
#ifndef _MSC_VER
const unsigned int BaseRingBufferTest::kBaseOffset;
const unsigned int BaseRingBufferTest::kBufferSize;
#endif
// Test fixture for RingBuffer test - Creates a RingBuffer, using a
// CommandBufferHelper with a mock AsyncAPIInterface for its interface (calling
// it directly, not through the RPC mechanism), making sure Noops are ignored
// and SetToken are properly forwarded to the engine.
class RingBufferTest : public BaseRingBufferTest {
protected:
virtual void SetUp() {
BaseRingBufferTest::SetUp();
allocator_.reset(new RingBuffer(kBaseOffset, kBufferSize, helper_.get()));
}
virtual void TearDown() {
// If the GpuScheduler posts any tasks, this forces them to run.
MessageLoop::current()->RunUntilIdle();
BaseRingBufferTest::TearDown();
}
scoped_ptr<RingBuffer> allocator_;
};
// Checks basic alloc and free.
TEST_F(RingBufferTest, TestBasic) {
const unsigned int kSize = 16;
EXPECT_EQ(kBufferSize, allocator_->GetLargestFreeOrPendingSize());
EXPECT_EQ(kBufferSize, allocator_->GetLargestFreeSizeNoWaiting());
RingBuffer::Offset offset = allocator_->Alloc(kSize);
EXPECT_GE(kBufferSize, offset - kBaseOffset + kSize);
EXPECT_EQ(kBufferSize, allocator_->GetLargestFreeOrPendingSize());
EXPECT_EQ(kBufferSize - kSize, allocator_->GetLargestFreeSizeNoWaiting());
int32 token = helper_->InsertToken();
allocator_->FreePendingToken(offset, token);
}
// Checks the free-pending-token mechanism.
TEST_F(RingBufferTest, TestFreePendingToken) {
const unsigned int kSize = 16;
const unsigned int kAllocCount = kBufferSize / kSize;
CHECK(kAllocCount * kSize == kBufferSize);
// Allocate several buffers to fill in the memory.
int32 tokens[kAllocCount];
for (unsigned int ii = 0; ii < kAllocCount; ++ii) {
RingBuffer::Offset offset = allocator_->Alloc(kSize);
EXPECT_GE(kBufferSize, offset - kBaseOffset + kSize);
tokens[ii] = helper_->InsertToken();
allocator_->FreePendingToken(offset, tokens[ii]);
}
EXPECT_EQ(kBufferSize - (kSize * kAllocCount),
allocator_->GetLargestFreeSizeNoWaiting());
// This allocation will need to reclaim the space freed above, so that should
// process the commands until a token is passed.
RingBuffer::Offset offset1 = allocator_->Alloc(kSize);
EXPECT_EQ(kBaseOffset, offset1);
// Check that the token has indeed passed.
EXPECT_LE(tokens[0], GetToken());
allocator_->FreePendingToken(offset1, helper_->InsertToken());
}
// Tests GetLargestFreeSizeNoWaiting
TEST_F(RingBufferTest, TestGetLargestFreeSizeNoWaiting) {
EXPECT_EQ(kBufferSize, allocator_->GetLargestFreeSizeNoWaiting());
RingBuffer::Offset offset = allocator_->Alloc(kBufferSize);
EXPECT_EQ(0u, allocator_->GetLargestFreeSizeNoWaiting());
allocator_->FreePendingToken(offset, helper_->InsertToken());
}
TEST_F(RingBufferTest, TestFreeBug) {
// The first and second allocations must not match.
const unsigned int kAlloc1 = 10;
const unsigned int kAlloc2 = 20;
RingBuffer::Offset offset = allocator_->Alloc(kAlloc1);
EXPECT_EQ(kBufferSize - kAlloc1, allocator_->GetLargestFreeSizeNoWaiting());
allocator_->FreePendingToken(offset, helper_.get()->InsertToken());
offset = allocator_->Alloc(kAlloc2);
EXPECT_EQ(kBufferSize - kAlloc1 - kAlloc2,
allocator_->GetLargestFreeSizeNoWaiting());
allocator_->FreePendingToken(offset, helper_.get()->InsertToken());
offset = allocator_->Alloc(kBufferSize);
EXPECT_EQ(0u, allocator_->GetLargestFreeSizeNoWaiting());
allocator_->FreePendingToken(offset, helper_.get()->InsertToken());
}
// Test fixture for RingBufferWrapper test - Creates a
// RingBufferWrapper, using a CommandBufferHelper with a mock
// AsyncAPIInterface for its interface (calling it directly, not through the
// RPC mechanism), making sure Noops are ignored and SetToken are properly
// forwarded to the engine.
class RingBufferWrapperTest : public BaseRingBufferTest {
protected:
virtual void SetUp() {
BaseRingBufferTest::SetUp();
// Though allocating this buffer isn't strictly necessary, it makes
// allocations point to valid addresses, so they could be used for
// something.
buffer_.reset(new int8[kBufferSize + kBaseOffset]);
buffer_start_ = buffer_.get() + kBaseOffset;
allocator_.reset(new RingBufferWrapper(
kBaseOffset, kBufferSize, helper_.get(), buffer_start_));
}
virtual void TearDown() {
// If the GpuScheduler posts any tasks, this forces them to run.
MessageLoop::current()->RunUntilIdle();
BaseRingBufferTest::TearDown();
}
scoped_ptr<RingBufferWrapper> allocator_;
scoped_array<int8> buffer_;
int8* buffer_start_;
};
// Checks basic alloc and free.
TEST_F(RingBufferWrapperTest, TestBasic) {
const unsigned int kSize = 16;
void* pointer = allocator_->Alloc(kSize);
ASSERT_TRUE(pointer);
EXPECT_LE(buffer_start_, static_cast<int8*>(pointer));
EXPECT_GE(kBufferSize, static_cast<int8*>(pointer) - buffer_start_ + kSize);
allocator_->FreePendingToken(pointer, helper_->InsertToken());
int8* pointer_int8 = allocator_->AllocTyped<int8>(kSize);
ASSERT_TRUE(pointer_int8);
EXPECT_LE(buffer_start_, pointer_int8);
EXPECT_GE(buffer_start_ + kBufferSize, pointer_int8 + kSize);
allocator_->FreePendingToken(pointer_int8, helper_->InsertToken());
unsigned int* pointer_uint = allocator_->AllocTyped<unsigned int>(kSize);
ASSERT_TRUE(pointer_uint);
EXPECT_LE(buffer_start_, reinterpret_cast<int8*>(pointer_uint));
EXPECT_GE(buffer_start_ + kBufferSize,
reinterpret_cast<int8* >(pointer_uint + kSize));
// Check that it did allocate kSize * sizeof(unsigned int). We can't tell
// directly, except from the remaining size.
EXPECT_EQ(kBufferSize - kSize - kSize - kSize * sizeof(*pointer_uint),
allocator_->GetLargestFreeSizeNoWaiting());
allocator_->FreePendingToken(pointer_uint, helper_->InsertToken());
}
// Checks the free-pending-token mechanism.
TEST_F(RingBufferWrapperTest, TestFreePendingToken) {
const unsigned int kSize = 16;
const unsigned int kAllocCount = kBufferSize / kSize;
CHECK(kAllocCount * kSize == kBufferSize);
// Allocate several buffers to fill in the memory.
int32 tokens[kAllocCount];
for (unsigned int ii = 0; ii < kAllocCount; ++ii) {
void* pointer = allocator_->Alloc(kSize);
EXPECT_TRUE(pointer != NULL);
tokens[ii] = helper_->InsertToken();
allocator_->FreePendingToken(pointer, helper_->InsertToken());
}
EXPECT_EQ(kBufferSize - (kSize * kAllocCount),
allocator_->GetLargestFreeSizeNoWaiting());
// This allocation will need to reclaim the space freed above, so that should
// process the commands until the token is passed.
void* pointer1 = allocator_->Alloc(kSize);
EXPECT_EQ(buffer_start_, static_cast<int8*>(pointer1));
// Check that the token has indeed passed.
EXPECT_LE(tokens[0], GetToken());
allocator_->FreePendingToken(pointer1, helper_->InsertToken());
EXPECT_LE(command_buffer_->GetState().token, helper_->InsertToken());
}
} // namespace gpu
| {'content_hash': 'ea324925a1deb7ddcfb64b1107b620e7', 'timestamp': '', 'source': 'github', 'line_count': 247, 'max_line_length': 79, 'avg_line_length': 37.2914979757085, 'alnum_prop': 0.7185973292802085, 'repo_name': 'nacl-webkit/chrome_deps', 'id': '4633e795779e12b6e7c7c4c77b0693f24ef805a7', 'size': '10045', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'gpu/command_buffer/client/ring_buffer_test.cc', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'ASP', 'bytes': '853'}, {'name': 'AppleScript', 'bytes': '6973'}, {'name': 'Arduino', 'bytes': '464'}, {'name': 'Assembly', 'bytes': '1173441'}, {'name': 'Awk', 'bytes': '9519'}, {'name': 'C', 'bytes': '74568368'}, {'name': 'C#', 'bytes': '1132'}, {'name': 'C++', 'bytes': '156174457'}, {'name': 'DOT', 'bytes': '1559'}, {'name': 'F#', 'bytes': '381'}, {'name': 'Java', 'bytes': '3088381'}, {'name': 'JavaScript', 'bytes': '18179048'}, {'name': 'Logos', 'bytes': '4517'}, {'name': 'M', 'bytes': '2190'}, {'name': 'Matlab', 'bytes': '3044'}, {'name': 'Objective-C', 'bytes': '6965520'}, {'name': 'PHP', 'bytes': '97817'}, {'name': 'Perl', 'bytes': '932725'}, {'name': 'Python', 'bytes': '8458718'}, {'name': 'R', 'bytes': '262'}, {'name': 'Ragel in Ruby Host', 'bytes': '3621'}, {'name': 'Shell', 'bytes': '1526176'}, {'name': 'Tcl', 'bytes': '277077'}, {'name': 'XSLT', 'bytes': '13493'}]} |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Struct p_square_cumulative_distribution</title>
<link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="../../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../../../accumulators/reference.html#header.boost.accumulators.statistics.p_square_cumul_dist_hpp" title="Header <boost/accumulators/statistics/p_square_cumul_dist.hpp>">
<link rel="prev" href="../extract/p_square_cumul_idp65137072.html" title="Global p_square_cumulative_distribution">
<link rel="next" href="../as_weighted_fe_idp65132624.html" title="Struct as_weighted_feature<tag::p_square_cumulative_distribution>">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
<td align="center"><a href="../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../extract/p_square_cumul_idp65137072.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../accumulators/reference.html#header.boost.accumulators.statistics.p_square_cumul_dist_hpp"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../as_weighted_fe_idp65132624.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.accumulators.tag.p_square_cumul_idp65140128"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Struct p_square_cumulative_distribution</span></h2>
<p>boost::accumulators::tag::p_square_cumulative_distribution</p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: <<a class="link" href="../../../accumulators/reference.html#header.boost.accumulators.statistics.p_square_cumul_dist_hpp" title="Header <boost/accumulators/statistics/p_square_cumul_dist.hpp>">boost/accumulators/statistics/p_square_cumul_dist.hpp</a>>
</span>
<span class="keyword">struct</span> <a class="link" href="p_square_cumul_idp65140128.html" title="Struct p_square_cumulative_distribution">p_square_cumulative_distribution</a> <span class="special">:</span> <span class="keyword">public</span> boost::accumulators::depends_on< count >,
<span class="keyword">public</span> p_square_cumulative_distribution_num_cells
<span class="special">{</span>
<span class="special">}</span><span class="special">;</span></pre></div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2005, 2006 Eric Niebler<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../extract/p_square_cumul_idp65137072.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../accumulators/reference.html#header.boost.accumulators.statistics.p_square_cumul_dist_hpp"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../as_weighted_fe_idp65132624.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
| {'content_hash': '1444b6d51914dde7e754247192f37ccc', 'timestamp': '', 'source': 'github', 'line_count': 54, 'max_line_length': 548, 'avg_line_length': 85.51851851851852, 'alnum_prop': 0.6695539194456475, 'repo_name': 'mitreaadrian/Soccersim', 'id': 'b694937ba26080a8dfdbdbc29ad4f3bd4bf3c32a', 'size': '4618', 'binary': False, 'copies': '5', 'ref': 'refs/heads/master', 'path': 'boost/boost_1_59_0/doc/html/boost/accumulators/tag/p_square_cumul_idp65140128.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Assembly', 'bytes': '207316'}, {'name': 'Batchfile', 'bytes': '9258'}, {'name': 'C', 'bytes': '823756'}, {'name': 'C#', 'bytes': '40804'}, {'name': 'C++', 'bytes': '171147574'}, {'name': 'CMake', 'bytes': '16644'}, {'name': 'CSS', 'bytes': '253358'}, {'name': 'Cuda', 'bytes': '26521'}, {'name': 'FORTRAN', 'bytes': '1856'}, {'name': 'HTML', 'bytes': '152513473'}, {'name': 'JavaScript', 'bytes': '170422'}, {'name': 'Lex', 'bytes': '1231'}, {'name': 'Makefile', 'bytes': '188826'}, {'name': 'Max', 'bytes': '36857'}, {'name': 'Objective-C', 'bytes': '2764'}, {'name': 'Objective-C++', 'bytes': '421'}, {'name': 'PHP', 'bytes': '59030'}, {'name': 'Perl', 'bytes': '36132'}, {'name': 'Perl6', 'bytes': '2053'}, {'name': 'Python', 'bytes': '454175'}, {'name': 'QMake', 'bytes': '16692'}, {'name': 'Rebol', 'bytes': '354'}, {'name': 'Shell', 'bytes': '67448'}, {'name': 'Tcl', 'bytes': '1172'}, {'name': 'TeX', 'bytes': '32117'}, {'name': 'XSLT', 'bytes': '548899'}]} |
<?php
/**
* Product Low Stock Report Collection
*
* @category Mage
* @package Mage_Reports
* @author Magento Core Team <[email protected]>
*/
class Mage_Reports_Model_Mysql4_Product_Lowstock_Collection
extends Mage_Reports_Model_Resource_Product_Lowstock_Collection
{
}
| {'content_hash': 'd0fe5ad95a1518adc3f946eab9dd8d7c', 'timestamp': '', 'source': 'github', 'line_count': 15, 'max_line_length': 67, 'avg_line_length': 20.133333333333333, 'alnum_prop': 0.7119205298013245, 'repo_name': 'melvyn-sopacua/magedepot', 'id': '681086595134e9190e100d8ab9f52b25b8c8e575', 'size': '1258', 'binary': False, 'copies': '10', 'ref': 'refs/heads/master', 'path': 'magento/app/code/core/Mage/Reports/Model/Mysql4/Product/Lowstock/Collection.php', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'PHP', 'bytes': '25548654'}, {'name': 'Shell', 'bytes': '642'}]} |
from mezzanine.twitter.templatetags.twitter_tags import tweets_for
from mezzanine.conf import settings
from mezzanine import template
register = template.Library()
@register.as_tag
def tweets_default(*args):
"""
Tweets for the default settings.
"""
settings.use_editable()
query_type = settings.TWITTER_DEFAULT_QUERY_TYPE
args = (settings.TWITTER_DEFAULT_QUERY,
settings.TWITTER_DEFAULT_NUM_TWEETS)
return tweets_for(query_type, args)
| {'content_hash': '3f7e7c925299ea06b63f9a42af83347b', 'timestamp': '', 'source': 'github', 'line_count': 16, 'max_line_length': 66, 'avg_line_length': 29.8125, 'alnum_prop': 0.7295597484276729, 'repo_name': 'tjetzinger/mezzanine-recipes', 'id': 'ac8b807367c4fa3fb49f5501db32f9dbf28250d0', 'size': '478', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'mezzanine_recipes/templatetags/twitter_tags.py', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Python', 'bytes': '70883'}]} |
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="match_parent"
android:background="#e2b9ddff"
>
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="30dp"
android:text="微扫"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="25sp" />
<TextView
android:id="@+id/historyData"
android:layout_width="250dp"
android:layout_height="300dp"
android:layout_below="@+id/textView"
android:layout_centerHorizontal="true"
android:layout_marginTop="30dp"
android:background="@drawable/shape"
android:padding="7dp"
android:scrollbars="vertical"
android:textSize="20sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/historyDate"
android:layout_below="@+id/historyData"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_marginRight="50dp"
android:textSize="16sp"
android:layout_marginTop="30dp" />
<Button
android:id="@+id/audioPlay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="播放"
android:textSize="18sp"
android:background="@drawable/bt_seleter"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_marginBottom="50dp"
android:layout_alignParentEnd="false"
android:layout_centerHorizontal="true"
android:layout_marginRight="80dp" />
</RelativeLayout> | {'content_hash': 'f6febc5e414b14f3867f5fed6b316a83', 'timestamp': '', 'source': 'github', 'line_count': 56, 'max_line_length': 76, 'avg_line_length': 35.339285714285715, 'alnum_prop': 0.6533602829711975, 'repo_name': 'VictorXianwu/vscan', 'id': '4c948629cb3df87827dcd18f0679875baf058bf8', 'size': '1987', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'splash/splash/src/main/res/layout/activity_history.xml', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '3223'}, {'name': 'HTML', 'bytes': '10091'}, {'name': 'Java', 'bytes': '292381'}, {'name': 'Python', 'bytes': '125494'}]} |
/*
* l2cap.h
*
* Logical Link Control and Adaption Protocl (L2CAP)
*
* Created by Matthias Ringwald on 5/16/09.
*/
#pragma once
#include "hci.h"
#include "l2cap_signaling.h"
#include <btstack/utils.h>
#include <btstack/btstack.h>
#if defined __cplusplus
extern "C" {
#endif
#define L2CAP_SIG_ID_INVALID 0
#define L2CAP_HEADER_SIZE 4
// size of HCI ACL + L2CAP Header for regular data packets (8)
#define COMPLETE_L2CAP_HEADER (HCI_ACL_HEADER_SIZE + L2CAP_HEADER_SIZE)
// minimum signaling MTU
#define L2CAP_MINIMAL_MTU 48
#define L2CAP_DEFAULT_MTU 672
// check L2CAP MTU
#if (L2CAP_MINIMAL_MTU + L2CAP_HEADER_SIZE) > HCI_ACL_PAYLOAD_SIZE
#error "HCI_ACL_PAYLOAD_SIZE too small for minimal L2CAP MTU of 48 bytes"
#endif
void l2cap_init(void);
void l2cap_register_packet_handler(void (*handler)(void * connection, uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size));
void l2cap_create_channel_internal(void * connection, btstack_packet_handler_t packet_handler, bd_addr_t address, uint16_t psm, uint16_t mtu);
void l2cap_disconnect_internal(uint16_t local_cid, uint8_t reason);
int l2cap_send_internal(uint16_t local_cid, uint8_t *data, uint16_t len);
uint16_t l2cap_get_remote_mtu_for_local_cid(uint16_t local_cid);
uint16_t l2cap_max_mtu(void);
void l2cap_block_new_credits(uint8_t blocked);
int l2cap_can_send_packet_now(uint16_t local_cid); // non-blocking UART write
// get outgoing buffer and prepare data
uint8_t *l2cap_get_outgoing_buffer(void);
int l2cap_send_prepared(uint16_t local_cid, uint16_t len);
void l2cap_close_connection(void *connection);
void l2cap_register_service_internal(void *connection, btstack_packet_handler_t packet_handler, uint16_t psm, uint16_t mtu);
void l2cap_unregister_service_internal(void *connection, uint16_t psm);
void l2cap_accept_connection_internal(uint16_t local_cid);
void l2cap_decline_connection_internal(uint16_t local_cid, uint8_t reason);
// private structs
typedef enum {
L2CAP_STATE_CLOSED = 1, // no baseband
L2CAP_STATE_WILL_SEND_CREATE_CONNECTION,
L2CAP_STATE_WAIT_CONNECTION_COMPLETE,
L2CAP_STATE_WAIT_CLIENT_ACCEPT_OR_REJECT,
L2CAP_STATE_WAIT_CONNECT_RSP, // from peer
L2CAP_STATE_CONFIG,
L2CAP_STATE_OPEN,
L2CAP_STATE_WAIT_DISCONNECT, // from application
L2CAP_STATE_WILL_SEND_CONNECTION_REQUEST,
L2CAP_STATE_WILL_SEND_CONNECTION_RESPONSE_DECLINE,
L2CAP_STATE_WILL_SEND_CONNECTION_RESPONSE_ACCEPT,
L2CAP_STATE_WILL_SEND_DISCONNECT_REQUEST,
L2CAP_STATE_WILL_SEND_DISCONNECT_RESPONSE,
} L2CAP_STATE;
typedef enum {
L2CAP_CHANNEL_STATE_VAR_NONE = 0,
L2CAP_CHANNEL_STATE_VAR_RCVD_CONF_REQ = 1 << 0,
L2CAP_CHANNEL_STATE_VAR_RCVD_CONF_RSP = 1 << 1,
L2CAP_CHANNEL_STATE_VAR_SEND_CONF_REQ = 1 << 2,
L2CAP_CHANNEL_STATE_VAR_SEND_CONF_RSP = 1 << 3,
L2CAP_CHANNEL_STATE_VAR_SENT_CONF_REQ = 1 << 4,
L2CAP_CHANNEL_STATE_VAR_SENT_CONF_RSP = 1 << 5,
} L2CAP_CHANNEL_STATE_VAR;
// info regarding an actual coneection
typedef struct {
// linked list - assert: first field
linked_item_t item;
L2CAP_STATE state;
L2CAP_CHANNEL_STATE_VAR state_var;
bd_addr_t address;
hci_con_handle_t handle;
uint8_t remote_sig_id; // used by other side, needed for delayed response
uint8_t local_sig_id; // own signaling identifier
uint16_t local_cid;
uint16_t remote_cid;
uint16_t local_mtu;
uint16_t remote_mtu;
uint16_t psm;
uint8_t packets_granted; // number of L2CAP/ACL packets client is allowed to send
uint8_t reason; // used in decline internal
// client connection
void * connection;
// internal connection
btstack_packet_handler_t packet_handler;
} l2cap_channel_t;
// info regarding potential connections
typedef struct {
// linked list - assert: first field
linked_item_t item;
// service id
uint16_t psm;
// incoming MTU
uint16_t mtu;
// client connection
void *connection;
// internal connection
btstack_packet_handler_t packet_handler;
} l2cap_service_t;
typedef struct l2cap_signaling_response {
hci_con_handle_t handle;
uint8_t sig_id;
uint8_t code;
uint16_t data; // infoType for INFORMATION REQUEST, result for CONNECTION request
} l2cap_signaling_response_t;
#if defined __cplusplus
}
#endif
| {'content_hash': '0c0ae595c188b9b3b248da7ddbcde71b', 'timestamp': '', 'source': 'github', 'line_count': 155, 'max_line_length': 142, 'avg_line_length': 28.903225806451612, 'alnum_prop': 0.690625, 'repo_name': 'fblumenberg/MKCommunikationBTStack', 'id': 'cf9a47236c72ace493cc7825f2ae7ff7251c43b4', 'size': '6041', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'MKCommunicationBTStack/l2cap.h', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C', 'bytes': '170046'}, {'name': 'Objective-C', 'bytes': '15634'}, {'name': 'Ruby', 'bytes': '2706'}]} |
from pathlib import Path
from textwrap import dedent
from plumbum import local
from plumbum.cmd import git
from copier import copy
from copier.cli import CopierApp
from .helpers import PROJECT_TEMPLATE, build_file_tree
REPO_BUNDLE_PATH = Path(f"{PROJECT_TEMPLATE}_updatediff_repo.bundle").absolute()
def test_updatediff(tmpdir):
tmp_path = Path(tmpdir)
target = tmp_path / "target"
readme = target / "README.txt"
answers = target / ".copier-answers.yml"
commit = git["commit", "--all"]
# Run copier 1st time, with specific tag
CopierApp.invoke(
"copy", str(REPO_BUNDLE_PATH), str(target), force=True, vcs_ref="v0.0.1"
)
# Check it's copied OK
assert answers.read_text() == dedent(
f"""
# Changes here will be overwritten by Copier
_commit: v0.0.1
_src_path: {REPO_BUNDLE_PATH}
author_name: Guybrush
project_name: to become a pirate
"""
)
assert readme.read_text() == dedent(
"""
Let me introduce myself.
My name is Guybrush, and my project is to become a pirate.
Thanks for your attention.
"""
)
# Init destination as a new independent git repo
with local.cwd(target):
git("init")
# Configure git in case you're running in CI
git("config", "user.name", "Copier Test")
git("config", "user.email", "test@copier")
# Commit changes
git("add", ".")
commit("-m", "hello world")
# Emulate the user modifying the README by hand
with open(readme, "w") as readme_fd:
readme_fd.write(
dedent(
"""
Let me introduce myself.
My name is Guybrush, and my project is to become a pirate.
Thanks for your grog.
"""
)
)
commit("-m", "I prefer grog")
# Update target to latest tag and check it's updated in answers file
CopierApp.invoke(force=True)
assert answers.read_text() == dedent(
f"""
# Changes here will be overwritten by Copier
_commit: v0.0.2
_src_path: {REPO_BUNDLE_PATH}
author_name: Guybrush
project_name: to become a pirate
"""
)
# Check migrations were executed properly
assert not (target / "before-v0.0.1").is_file()
assert not (target / "after-v0.0.1").is_file()
assert (target / "before-v0.0.2").is_file()
assert (target / "after-v0.0.2").is_file()
(target / "before-v0.0.2").unlink()
(target / "after-v0.0.2").unlink()
assert not (target / "before-v1.0.0").is_file()
assert not (target / "after-v1.0.0").is_file()
commit("-m", "Update template to v0.0.2")
# Update target to latest commit, which is still untagged
CopierApp.invoke(force=True, vcs_ref="HEAD")
# Check no new migrations were executed
assert not (target / "before-v0.0.1").is_file()
assert not (target / "after-v0.0.1").is_file()
assert not (target / "before-v0.0.2").is_file()
assert not (target / "after-v0.0.2").is_file()
assert not (target / "before-v1.0.0").is_file()
assert not (target / "after-v1.0.0").is_file()
# Check it's updated OK
assert answers.read_text() == dedent(
f"""
# Changes here will be overwritten by Copier
_commit: v0.0.2-1-g81c335d
_src_path: {REPO_BUNDLE_PATH}
author_name: Guybrush
project_name: to become a pirate
"""
)
assert readme.read_text() == dedent(
"""
Let me introduce myself.
My name is Guybrush.
My project is to become a pirate.
Thanks for your grog.
"""
)
commit("-m", "Update template to v0.0.2-1-g81c335d")
assert not git("status", "--porcelain")
# No more updates exist, so updating again should change nothing
CopierApp.invoke(force=True, vcs_ref="HEAD")
assert not git("status", "--porcelain")
# If I change an option, it updates properly
copy(
data={"author_name": "Largo LaGrande", "project_name": "to steal a lot"},
force=True,
vcs_ref="HEAD",
)
assert readme.read_text() == dedent(
"""
Let me introduce myself.
My name is Largo LaGrande.
My project is to steal a lot.
Thanks for your grog.
"""
)
def test_commit_hooks_respected(tmp_path: Path):
"""Commit hooks are taken into account when producing the update diff."""
# Prepare source template v1
src, tmp_path = tmp_path / "src", tmp_path / "tmp_path"
src.mkdir()
with local.cwd(src):
build_file_tree(
{
"copier.yml": """
_tasks:
- git init
- pre-commit install
- pre-commit run -a || true
what: grog
""",
"[[ _copier_conf.answers_file ]].tmpl": """
[[ _copier_answers|to_nice_yaml ]]
""",
".pre-commit-config.yaml": r"""
repos:
- repo: https://github.com/prettier/prettier
rev: 2.0.4
hooks:
- id: prettier
- repo: local
hooks:
- id: forbidden-files
name: forbidden files
entry: found forbidden files; remove them
language: fail
files: "\\.rej$"
""",
"life.yml.tmpl": """
# Following code should be reformatted by pre-commit after copying
Line 1: hello
Line 2: [[ what ]]
Line 3: bye
""",
}
)
git("init")
git("add", ".")
git("commit", "-m", "commit 1")
git("tag", "v1")
# Copy source template
copy(src_path=str(src), dst_path=tmp_path, force=True)
with local.cwd(tmp_path):
life = Path("life.yml")
git("add", ".")
# 1st commit fails because pre-commit reformats life.yml
git("commit", "-am", "failed commit", retcode=1)
# 2nd commit works because it's already formatted
git("commit", "-am", "copied v1")
assert life.read_text() == dedent(
"""\
# Following code should be reformatted by pre-commit after copying
Line 1: hello
Line 2: grog
Line 3: bye
"""
)
# Evolve source template to v2
with local.cwd(src):
build_file_tree(
{
"life.yml.tmpl": """
# Following code should be reformatted by pre-commit after copying
Line 1: hello world
Line 2: grow up
Line 3: [[ what ]]
Line 4: grow old
Line 5: bye bye world
""",
}
)
git("init")
git("add", ".")
git("commit", "-m", "commit 2")
git("tag", "v2")
# Update subproject to v2
copy(dst_path=tmp_path, force=True)
with local.cwd(tmp_path):
git("commit", "-am", "copied v2")
assert life.read_text() == dedent(
"""\
# Following code should be reformatted by pre-commit after copying
Line 1: hello world
Line 2: grow up
Line 3: grog
Line 4: grow old
Line 5: bye bye world
"""
)
# No .rej files created (update diff was smart)
assert not git("status", "--porcelain")
# Subproject evolves
life.write_text(
dedent(
"""\
Line 1: hello world
Line 2: grow up
Line 2.5: make friends
Line 3: grog
Line 4: grow old
Line 4.5: no more work
Line 5: bye bye world
"""
)
)
git("commit", "-am", "subproject is evolved")
# Subproject re-updates just to change some values
copy(data={"what": "study"}, force=True)
git("commit", "-am", "re-updated to change values after evolving")
# Subproject evolution was respected up to sane possibilities.
# In an ideal world, this file would be exactly the same as what's written
# a few lines above, just changing "grog" for "study". However, that's nearly
# impossible to achieve, because each change hunk needs at least 1 line of
# context to let git apply that patch smartly, and that context couldn't be
# found because we changed data when updating, so the sanest thing we can
# do is to provide a .rej file to notify those
# unresolvable diffs. OTOH, some other changes are be applied.
# If some day you are able to produce that ideal result, you should be
# happy to modify these asserts.
assert life.read_text() == dedent(
"""\
Line 1: hello world
Line 2: grow up
Line 3: study
Line 4: grow old
Line 4.5: no more work
Line 5: bye bye world
"""
)
# This time a .rej file is unavoidable
assert Path(f"{life}.rej").is_file()
| {'content_hash': '8a8ef50553c83b0d00b4a70e1d196cad', 'timestamp': '', 'source': 'github', 'line_count': 276, 'max_line_length': 85, 'avg_line_length': 35.42391304347826, 'alnum_prop': 0.5064948348164059, 'repo_name': 'lucuma/Voodoo', 'id': 'aa48c11216b9b4626dc0441d2bafaec7586a742d', 'size': '9777', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'tests/test_updatediff.py', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'Makefile', 'bytes': '1153'}, {'name': 'Python', 'bytes': '27929'}]} |
package org.apache.weex.ui.action;
import org.apache.weex.WXSDKInstance;
import android.text.TextUtils;
import org.apache.weex.WXSDKManager;
import org.apache.weex.ui.component.WXComponent;
import org.apache.weex.ui.component.WXVContainer;
public class GraphicActionMoveElement extends BasicGraphicAction {
private String mParentref;
private int mIndex;
public GraphicActionMoveElement(WXSDKInstance instance, String ref, String parentRef, int index) {
super(instance, ref);
this.mParentref = parentRef;
this.mIndex = index;
}
@Override
public void executeAction() {
WXComponent component = WXSDKManager
.getInstance().getWXRenderManager().getWXComponent(getPageId(), getRef());
if(component == null) {
return;
}
WXVContainer oldParent = component.getParent();
WXComponent newParent = WXSDKManager.getInstance().getWXRenderManager().getWXComponent(getPageId(), mParentref);
if (oldParent == null
|| newParent == null || !(newParent instanceof WXVContainer)) {
return;
}
if (component.getHostView() != null && !TextUtils.equals(component.getComponentType(), "video") && !TextUtils.equals(component.getComponentType(), "videoplus")) {
int[] location = new int[2] ;
component.getHostView().getLocationInWindow(location);
}
oldParent.remove(component, false);
((WXVContainer) newParent).addChild(component, mIndex);
if (component.getHostView() != null && !TextUtils.equals(component.getComponentType(), "video") && !TextUtils.equals(component.getComponentType(), "videoplus")) {
int[] location = new int[2] ;
component.getHostView().getLocationInWindow(location);
}
if (!component.isVirtualComponent()) {
((WXVContainer) newParent).addSubView(component.getHostView(), mIndex);
}
}
}
| {'content_hash': 'b8f307c63af41ef134a094cf30d6ae9e', 'timestamp': '', 'source': 'github', 'line_count': 54, 'max_line_length': 166, 'avg_line_length': 34.092592592592595, 'alnum_prop': 0.7088538837588267, 'repo_name': 'alibaba/weex', 'id': '4c38840e8d2c13856a893a05d4ebd2fd2a2a3d85', 'size': '2649', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'android/sdk/src/main/java/org/apache/weex/ui/action/GraphicActionMoveElement.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Awk', 'bytes': '1100'}, {'name': 'C', 'bytes': '2394315'}, {'name': 'C++', 'bytes': '10574606'}, {'name': 'CMake', 'bytes': '94330'}, {'name': 'Java', 'bytes': '3428925'}, {'name': 'JavaScript', 'bytes': '4162443'}, {'name': 'Makefile', 'bytes': '27'}, {'name': 'Objective-C', 'bytes': '1645742'}, {'name': 'Objective-C++', 'bytes': '733199'}, {'name': 'Python', 'bytes': '53147'}, {'name': 'Ruby', 'bytes': '8073'}, {'name': 'Shell', 'bytes': '24472'}, {'name': 'Vue', 'bytes': '111308'}]} |
'use strict';
/**
* Module dependencies.
*/
var EventEmitter = require('events').EventEmitter;
var Hook = require('./hook');
var utils = require('./utils');
var inherits = utils.inherits;
var debug = require('debug')('mocha:suite');
var milliseconds = require('./ms');
/**
* Expose `Suite`.
*/
exports = module.exports = Suite;
/**
* Create a new `Suite` with the given `title` and parent `Suite`. When a suite
* with the same title is already present, that suite is returned to provide
* nicer reporter and more flexible meta-testing.
*
* @api public
* @param {Suite} parent
* @param {string} title
* @return {Suite}
*/
exports.create = function (parent, title) {
var suite = new Suite(title, parent.ctx);
suite.parent = parent;
title = suite.fullTitle();
parent.addSuite(suite);
return suite;
};
/**
* Initialize a new `Suite` with the given `title` and `ctx`.
*
* @api private
* @param {string} title
* @param {Context} parentContext
*/
function Suite (title, parentContext) {
if (!utils.isString(title)) {
throw new Error('Suite `title` should be a "string" but "' + typeof title + '" was given instead.');
}
this.title = title;
function Context () {}
Context.prototype = parentContext;
this.ctx = new Context();
this.suites = [];
this.tests = [];
this.pending = false;
this._beforeEach = [];
this._beforeAll = [];
this._afterEach = [];
this._afterAll = [];
this.root = !title;
this._timeout = 2000;
this._enableTimeouts = true;
this._slow = 75;
this._bail = false;
this._retries = -1;
this._onlyTests = [];
this._onlySuites = [];
this.delayed = false;
}
/**
* Inherit from `EventEmitter.prototype`.
*/
inherits(Suite, EventEmitter);
/**
* Return a clone of this `Suite`.
*
* @api private
* @return {Suite}
*/
Suite.prototype.clone = function () {
var suite = new Suite(this.title);
debug('clone');
suite.ctx = this.ctx;
suite.timeout(this.timeout());
suite.retries(this.retries());
suite.enableTimeouts(this.enableTimeouts());
suite.slow(this.slow());
suite.bail(this.bail());
return suite;
};
/**
* Set timeout `ms` or short-hand such as "2s".
*
* @api private
* @param {number|string} ms
* @return {Suite|number} for chaining
*/
Suite.prototype.timeout = function (ms) {
if (!arguments.length) {
return this._timeout;
}
if (ms.toString() === '0') {
this._enableTimeouts = false;
}
if (typeof ms === 'string') {
ms = milliseconds(ms);
}
debug('timeout %d', ms);
this._timeout = parseInt(ms, 10);
return this;
};
/**
* Set number of times to retry a failed test.
*
* @api private
* @param {number|string} n
* @return {Suite|number} for chaining
*/
Suite.prototype.retries = function (n) {
if (!arguments.length) {
return this._retries;
}
debug('retries %d', n);
this._retries = parseInt(n, 10) || 0;
return this;
};
/**
* Set timeout to `enabled`.
*
* @api private
* @param {boolean} enabled
* @return {Suite|boolean} self or enabled
*/
Suite.prototype.enableTimeouts = function (enabled) {
if (!arguments.length) {
return this._enableTimeouts;
}
debug('enableTimeouts %s', enabled);
this._enableTimeouts = enabled;
return this;
};
/**
* Set slow `ms` or short-hand such as "2s".
*
* @api private
* @param {number|string} ms
* @return {Suite|number} for chaining
*/
Suite.prototype.slow = function (ms) {
if (!arguments.length) {
return this._slow;
}
if (typeof ms === 'string') {
ms = milliseconds(ms);
}
debug('slow %d', ms);
this._slow = ms;
return this;
};
/**
* Sets whether to bail after first error.
*
* @api private
* @param {boolean} bail
* @return {Suite|number} for chaining
*/
Suite.prototype.bail = function (bail) {
if (!arguments.length) {
return this._bail;
}
debug('bail %s', bail);
this._bail = bail;
return this;
};
/**
* Check if this suite or its parent suite is marked as pending.
*
* @api private
*/
Suite.prototype.isPending = function () {
return this.pending || (this.parent && this.parent.isPending());
};
/**
* Run `fn(test[, done])` before running tests.
*
* @api private
* @param {string} title
* @param {Function} fn
* @return {Suite} for chaining
*/
Suite.prototype.beforeAll = function (title, fn) {
if (this.isPending()) {
return this;
}
if (typeof title === 'function') {
fn = title;
title = fn.name;
}
title = '"before all" hook' + (title ? ': ' + title : '');
var hook = new Hook(title, fn);
hook.parent = this;
hook.timeout(this.timeout());
hook.retries(this.retries());
hook.enableTimeouts(this.enableTimeouts());
hook.slow(this.slow());
hook.ctx = this.ctx;
this._beforeAll.push(hook);
this.emit('beforeAll', hook);
return this;
};
/**
* Run `fn(test[, done])` after running tests.
*
* @api private
* @param {string} title
* @param {Function} fn
* @return {Suite} for chaining
*/
Suite.prototype.afterAll = function (title, fn) {
if (this.isPending()) {
return this;
}
if (typeof title === 'function') {
fn = title;
title = fn.name;
}
title = '"after all" hook' + (title ? ': ' + title : '');
var hook = new Hook(title, fn);
hook.parent = this;
hook.timeout(this.timeout());
hook.retries(this.retries());
hook.enableTimeouts(this.enableTimeouts());
hook.slow(this.slow());
hook.ctx = this.ctx;
this._afterAll.push(hook);
this.emit('afterAll', hook);
return this;
};
/**
* Run `fn(test[, done])` before each test case.
*
* @api private
* @param {string} title
* @param {Function} fn
* @return {Suite} for chaining
*/
Suite.prototype.beforeEach = function (title, fn) {
if (this.isPending()) {
return this;
}
if (typeof title === 'function') {
fn = title;
title = fn.name;
}
title = '"before each" hook' + (title ? ': ' + title : '');
var hook = new Hook(title, fn);
hook.parent = this;
hook.timeout(this.timeout());
hook.retries(this.retries());
hook.enableTimeouts(this.enableTimeouts());
hook.slow(this.slow());
hook.ctx = this.ctx;
this._beforeEach.push(hook);
this.emit('beforeEach', hook);
return this;
};
/**
* Run `fn(test[, done])` after each test case.
*
* @api private
* @param {string} title
* @param {Function} fn
* @return {Suite} for chaining
*/
Suite.prototype.afterEach = function (title, fn) {
if (this.isPending()) {
return this;
}
if (typeof title === 'function') {
fn = title;
title = fn.name;
}
title = '"after each" hook' + (title ? ': ' + title : '');
var hook = new Hook(title, fn);
hook.parent = this;
hook.timeout(this.timeout());
hook.retries(this.retries());
hook.enableTimeouts(this.enableTimeouts());
hook.slow(this.slow());
hook.ctx = this.ctx;
this._afterEach.push(hook);
this.emit('afterEach', hook);
return this;
};
/**
* Add a test `suite`.
*
* @api private
* @param {Suite} suite
* @return {Suite} for chaining
*/
Suite.prototype.addSuite = function (suite) {
suite.parent = this;
suite.timeout(this.timeout());
suite.retries(this.retries());
suite.enableTimeouts(this.enableTimeouts());
suite.slow(this.slow());
suite.bail(this.bail());
this.suites.push(suite);
this.emit('suite', suite);
return this;
};
/**
* Add a `test` to this suite.
*
* @api private
* @param {Test} test
* @return {Suite} for chaining
*/
Suite.prototype.addTest = function (test) {
test.parent = this;
test.timeout(this.timeout());
test.retries(this.retries());
test.enableTimeouts(this.enableTimeouts());
test.slow(this.slow());
test.ctx = this.ctx;
this.tests.push(test);
this.emit('test', test);
return this;
};
/**
* Return the full title generated by recursively concatenating the parent's
* full title.
*
* @api public
* @return {string}
*/
Suite.prototype.fullTitle = function () {
return this.titlePath().join(' ');
};
/**
* Return the title path generated by recursively concatenating the parent's
* title path.
*
* @api public
* @return {string}
*/
Suite.prototype.titlePath = function () {
var result = [];
if (this.parent) {
result = result.concat(this.parent.titlePath());
}
if (!this.root) {
result.push(this.title);
}
return result;
};
/**
* Return the total number of tests.
*
* @api public
* @return {number}
*/
Suite.prototype.total = function () {
return this.suites.reduce(function (sum, suite) {
return sum + suite.total();
}, 0) + this.tests.length;
};
/**
* Iterates through each suite recursively to find all tests. Applies a
* function in the format `fn(test)`.
*
* @api private
* @param {Function} fn
* @return {Suite}
*/
Suite.prototype.eachTest = function (fn) {
this.tests.forEach(fn);
this.suites.forEach(function (suite) {
suite.eachTest(fn);
});
return this;
};
/**
* This will run the root suite if we happen to be running in delayed mode.
*/
Suite.prototype.run = function run () {
if (this.root) {
this.emit('run');
}
};
| {'content_hash': '51b896e1eceefd9e906790a565c298b6', 'timestamp': '', 'source': 'github', 'line_count': 414, 'max_line_length': 104, 'avg_line_length': 21.731884057971016, 'alnum_prop': 0.6279871068133822, 'repo_name': 'amongouser/mocha-mongoose-hang', 'id': 'f5dca4cfa5d745b4fcad3e3c7c87c2a6dc9ec424', 'size': '8997', 'binary': False, 'copies': '9', 'ref': 'refs/heads/master', 'path': 'node_modules/mocha/lib/suite.js', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'JavaScript', 'bytes': '298'}]} |
default_app_config = 'polls.apps.PollsConfig'
| {'content_hash': '78c9d721b98e1538cb93ddf668427adf', 'timestamp': '', 'source': 'github', 'line_count': 1, 'max_line_length': 45, 'avg_line_length': 46.0, 'alnum_prop': 0.782608695652174, 'repo_name': 'moonfruit/yysite', 'id': '519cd1dbe056cf984c9a04c38f5ca5442ddfefa4', 'size': '71', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'polls/__init__.py', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '115'}, {'name': 'HTML', 'bytes': '2157'}, {'name': 'Python', 'bytes': '63298'}, {'name': 'Shell', 'bytes': '110'}]} |
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | {'content_hash': '6b177a2770e3a2decc9245eb33fa7019', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 31, 'avg_line_length': 9.692307692307692, 'alnum_prop': 0.7063492063492064, 'repo_name': 'mdoering/backbone', 'id': '4cd4a97b64ba048020ef4577f33e86300b44a7f8', 'size': '175', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'life/Plantae/Magnoliophyta/Magnoliopsida/Lamiales/Acanthaceae/Barleria/Barleria schmitti/README.md', 'mode': '33188', 'license': 'apache-2.0', 'language': []} |
@interface OrdersManager()
{
NSMutableArray *_orders;
}
@end
@implementation OrdersManager
-(instancetype)init
{
self = [super init];
if(self)
{
_orders = [NSMutableArray arrayWithArray:[self restoreOrders]];
}
return self;
}
-(OrderModel *)lastOrder // last in time but not in order
{
OrderModel *newOrder = nil;
if( [_orders firstObject] ) {
newOrder = [[OrderModel alloc] initWithOrder:[_orders firstObject]];
}
return newOrder;
}
-(NSArray *)activeOrdersList
{
NSMutableArray *arr = [NSMutableArray arrayWithCapacity:[_orders count]];
NSDate *today = [NSDate date];
for (OrderModel *oneOrder in _orders)
{
NSComparisonResult result = [[oneOrder scheduleDate] compare:today];
if( result == NSOrderedAscending || result == NSOrderedSame) {
[arr addObject:oneOrder];
}
}
return arr;
}
-(NSArray *)ordersList
{
return [NSArray arrayWithArray:_orders];
}
-(void)addNewOrder:(OrderModel *)newOrder
{
// store orders in reverse order. Orders in order. LOL
[_orders insertObject:newOrder atIndex:0];
[self storeOrders:_orders];
}
-(void)updateOrder:(OrderModel *)order
{
OrderModel *orderToUpdate = nil;
for (OrderModel *oneOrder in _orders) {
if( [[order orderID] isEqualToString:[oneOrder orderID]] )
{
orderToUpdate = oneOrder;
break;
}
}
if( orderToUpdate )
{
NSUInteger idx = [_orders indexOfObject:orderToUpdate];
[_orders removeObject:orderToUpdate];
[_orders insertObject:order atIndex:idx];
[self storeOrders:_orders];
}
}
-(void)storeOrders:(NSArray *)orders
{
NSUserDefaults *def = [NSUserDefaults standardUserDefaults];
NSMutableArray *dataArray = [[NSMutableArray alloc] initWithCapacity:[orders count]];
for (OrderModel *oneOrder in orders) {
[dataArray addObject:[NSKeyedArchiver archivedDataWithRootObject:oneOrder]];
}
[def setObject:dataArray forKey:kUserDefsKeyOrders];
dataArray = nil;
}
-(NSArray *)restoreOrders
{
NSUserDefaults *def = [NSUserDefaults standardUserDefaults];
NSArray *dataArray = [def valueForKey:kUserDefsKeyOrders];
NSMutableArray *orders = [NSMutableArray new];
if( dataArray )
{
for (NSData *oneData in dataArray) {
[orders addObject:[NSKeyedUnarchiver unarchiveObjectWithData:oneData]];
}
}
return orders;
}
-(void)removeOrder:(OrderModel *)order
{
[_orders removeObject:order];
[self storeOrders:_orders];
}
@end
| {'content_hash': '536d5e96686575887cdfc51332d97adc', 'timestamp': '', 'source': 'github', 'line_count': 111, 'max_line_length': 89, 'avg_line_length': 23.63063063063063, 'alnum_prop': 0.6496378192908883, 'repo_name': 'RettPop/OrderClearWater', 'id': 'a13a47f5feaa882eb80b90f37156ee0589bcc33b', 'size': '2810', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'ClearWater/ClearWater/OrdersManager.m', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Objective-C', 'bytes': '376077'}]} |
<?php
namespace CoreBundle\Form\Battle;
use CoreBundle\Model\Request\Battle\BattleReadRequest;
use NorseDigital\Symfony\RestBundle\Form\AbstractFormType;
/**
* Class BattleReadType
*/
class BattleReadType extends AbstractFormType
{
use BattleSingleTypeTrait;
const DATA_CLASS = BattleReadRequest::class;
}
| {'content_hash': '59c589910ff8fab22d8bba4740cbef84', 'timestamp': '', 'source': 'github', 'line_count': 16, 'max_line_length': 58, 'avg_line_length': 20.0, 'alnum_prop': 0.790625, 'repo_name': 'zuevAlexander/Battle', 'id': '75a7a489f314038982b3303859b8c26a043861a7', 'size': '320', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/CoreBundle/Form/Battle/BattleReadType.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'ApacheConf', 'bytes': '3605'}, {'name': 'PHP', 'bytes': '246777'}]} |
package fr.insee.rmes.metadata.repository;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import fr.insee.rmes.config.MetaDataRootContext;
@Service
public class GroupRepositoryImpl implements GroupRepository {
@Autowired
MetaDataRootContext metaDataRootContext;
@Override
public List<String> getRootIds() throws Exception {
return metaDataRootContext.getSubGroupIds();
}
@Override
public List<String> getRessourcePackageIds() {
return metaDataRootContext.getRessourcePackageIds();
}
}
| {'content_hash': '2029041622543fce8099a683f03393b3', 'timestamp': '', 'source': 'github', 'line_count': 27, 'max_line_length': 62, 'avg_line_length': 21.925925925925927, 'alnum_prop': 0.8141891891891891, 'repo_name': 'InseeFr/DDI-Access-Services', 'id': '769acb65224c3d8a4f1b5d45001d06a597e0d138', 'size': '592', 'binary': False, 'copies': '1', 'ref': 'refs/heads/main', 'path': 'src/main/java/fr/insee/rmes/metadata/repository/GroupRepositoryImpl.java', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Dockerfile', 'bytes': '221'}, {'name': 'Java', 'bytes': '265952'}]} |
<?php
use yii\helpers\Html;
/* @var $this yii\web\View */
$this->title = 'About';
$this->params['breadcrumbs'][] = $this->title;
$session = new \yii\web\Session;
$session->open();
$session['testing'] = 'OK';
?>
<div class="site-about">
<h1><?= Html::encode($this->title) ?></h1>
<p>This is the About page. You may modify the following file to customize its content:</p>
<code><?= __FILE__ ?></code>
</div>
| {'content_hash': 'cde3b4484b3fd8b24aa8bd66863c07b9', 'timestamp': '', 'source': 'github', 'line_count': 18, 'max_line_length': 94, 'avg_line_length': 23.444444444444443, 'alnum_prop': 0.6042654028436019, 'repo_name': 'hscstudio/osyawwal2', 'id': 'ccf21d76038fc7dae663de84e4355c3f52a4bb6a', 'size': '422', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'frontend/views/site/about.php', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'ApacheConf', 'bytes': '520'}, {'name': 'CSS', 'bytes': '2728'}, {'name': 'HTML', 'bytes': '114'}, {'name': 'PHP', 'bytes': '12901535'}, {'name': 'Shell', 'bytes': '1552'}]} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>buchberger: Not compatible 👼</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.5.3 / buchberger - 8.14.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
buchberger
<small>
8.14.0
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-09-09 17:35:02 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-09-09 17:35:02 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-num base Num library distributed with the OCaml compiler
base-threads base
base-unix base
camlp5 7.14 Preprocessor-pretty-printer of OCaml
conf-findutils 1 Virtual package relying on findutils
conf-perl 2 Virtual package relying on perl
coq 8.5.3 Formal proof management system
num 0 The Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.05.0 The OCaml compiler (virtual package)
ocaml-base-compiler 4.05.0 Official 4.05.0 release
ocaml-config 1 OCaml Switch Configuration
# opam file:
opam-version: "2.0"
maintainer: "[email protected]"
homepage: "https://github.com/coq-community/buchberger"
dev-repo: "git+https://github.com/coq-community/buchberger.git"
bug-reports: "https://github.com/coq-community/buchberger/issues"
license: "LGPL-2.1-or-later"
synopsis: "Verified implementation in Coq of Buchberger's algorithm for computing Gröbner bases"
description: """
A verified implementation of Buchberger's algorithm in Coq,
which computes the Gröbner basis associated with a polynomial ideal.
Also includes a constructive proof of Dickson's lemma."""
build: [make "-j%{jobs}%"]
install: [make "install"]
depends: [
"coq" {>= "8.12" & < "8.16~"}
]
tags: [
"category:Mathematics/Algebra"
"category:Miscellaneous/Extracted Programs/Combinatorics"
"keyword:Gröbner basis"
"keyword:polynomial ideal"
"keyword:Buchberger's algorithm"
"logpath:Buchberger"
"date:2021-12-12"
]
authors: [
"Laurent Théry"
"Henrik Persson"
]
url {
src: "https://github.com/coq-community/buchberger/archive/v8.14.0.tar.gz"
checksum: "sha512=bb38c3b1e658698fe457a91b8507f19797dbb82214edf58166880c6e0e1fe0b8093b8c67c9dfeac2495db118bf83322139c4518458e63004b7693d58f8b84fd8"
}
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install 🏜️</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-buchberger.8.14.0 coq.8.5.3</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.5.3).
The following dependencies couldn't be met:
- coq-buchberger -> coq >= 8.12
Your request can't be satisfied:
- No available version of coq satisfies the constraints
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-buchberger.8.14.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
| {'content_hash': '83dd75098521227e7144ff8c851982bc', 'timestamp': '', 'source': 'github', 'line_count': 174, 'max_line_length': 159, 'avg_line_length': 41.224137931034484, 'alnum_prop': 0.5575073191133417, 'repo_name': 'coq-bench/coq-bench.github.io', 'id': '0447367fefac99bf0d929e70f102f1b903974856', 'size': '7202', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'clean/Linux-x86_64-4.05.0-2.0.1/released/8.5.3/buchberger/8.14.0.html', 'mode': '33188', 'license': 'mit', 'language': []} |
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {'content_hash': '1e78484e9be6bc50ea8679411c77aae7', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 39, 'avg_line_length': 10.23076923076923, 'alnum_prop': 0.6917293233082706, 'repo_name': 'mdoering/backbone', 'id': '2391e38f0c10b959fc6c460ab8c955d14b9a2d8c', 'size': '190', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'life/Plantae/Magnoliophyta/Liliopsida/Asparagales/Orchidaceae/Pleurothallis/Pleurothallis glossopogon/ Syn. Humboltia insignis/README.md', 'mode': '33188', 'license': 'apache-2.0', 'language': []} |
var exports = module.exports = {};
var index = require('./index');
exports.spamcounter = 0;
// Spamblock and emptystriper
exports.blockRepeated = function (msg, username, callback) {
var spam = true;
var lastMessage = "";
index.userManagement.getUserByName(username, function(err, user) {
if(typeof user !== "undefined")
{
lastMessage = user['lastMessage'];
}
if (msg !== lastMessage && msg !== '') {
spam = false;
} else if (msg !== '') {
spam = true;
module.exports.spamcounter++;
}
callback(spam);
});
}; | {'content_hash': '4fc9c6d94cd167a3898df85a75192783', 'timestamp': '', 'source': 'github', 'line_count': 27, 'max_line_length': 68, 'avg_line_length': 21.296296296296298, 'alnum_prop': 0.5930434782608696, 'repo_name': 'Teranas/de.teranas.rbb.chat', 'id': '1a5ad2b8b2a7a016bcf384c093dc9e3454af9a6c', 'size': '575', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'spamfilter.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '3013'}, {'name': 'HTML', 'bytes': '4404'}, {'name': 'JavaScript', 'bytes': '16117'}]} |
import {Component, DebugElement} from '@angular/core';
import {By} from '@angular/platform-browser';
import {waitForAsync, ComponentFixture, TestBed} from '@angular/core/testing';
import {MatLegacyChip, MatLegacyChipsModule} from './index';
import {dispatchMouseEvent} from '@angular/cdk/testing/private';
describe('Chip Remove', () => {
let fixture: ComponentFixture<TestChip>;
let testChip: TestChip;
let chipDebugElement: DebugElement;
let chipNativeElement: HTMLElement;
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [MatLegacyChipsModule],
declarations: [TestChip],
});
TestBed.compileComponents();
}));
beforeEach(waitForAsync(() => {
fixture = TestBed.createComponent(TestChip);
testChip = fixture.debugElement.componentInstance;
fixture.detectChanges();
chipDebugElement = fixture.debugElement.query(By.directive(MatLegacyChip))!;
chipNativeElement = chipDebugElement.nativeElement;
}));
describe('basic behavior', () => {
it('should apply a CSS class to the remove icon', () => {
const buttonElement = chipNativeElement.querySelector('button')!;
expect(buttonElement.classList).toContain('mat-chip-remove');
});
it('should ensure that the button cannot submit its parent form', () => {
const buttonElement = chipNativeElement.querySelector('button')!;
expect(buttonElement.getAttribute('type')).toBe('button');
});
it('should not set the `type` attribute on non-button elements', () => {
const buttonElement = chipNativeElement.querySelector('span.mat-chip-remove')!;
expect(buttonElement.hasAttribute('type')).toBe(false);
});
it('should emit (removed) on click', () => {
const buttonElement = chipNativeElement.querySelector('button')!;
testChip.removable = true;
fixture.detectChanges();
spyOn(testChip, 'didRemove');
buttonElement.click();
fixture.detectChanges();
expect(testChip.didRemove).toHaveBeenCalled();
});
it('should not remove if parent chip is disabled', () => {
const buttonElement = chipNativeElement.querySelector('button')!;
testChip.disabled = true;
testChip.removable = true;
fixture.detectChanges();
spyOn(testChip, 'didRemove');
buttonElement.click();
fixture.detectChanges();
expect(testChip.didRemove).not.toHaveBeenCalled();
});
it('should prevent the default click action', () => {
const buttonElement = chipNativeElement.querySelector('button')!;
const event = dispatchMouseEvent(buttonElement, 'click');
fixture.detectChanges();
expect(event.defaultPrevented).toBe(true);
});
});
});
@Component({
template: `
<mat-chip
[removable]="removable"
[disabled]="disabled"
(removed)="didRemove()">
<button matChipRemove></button>
<span matChipRemove></span>
</mat-chip>
`,
})
class TestChip {
removable: boolean;
disabled = false;
didRemove() {}
}
| {'content_hash': 'f0c0e7b6c67418111b83452e9d56b51f', 'timestamp': '', 'source': 'github', 'line_count': 105, 'max_line_length': 85, 'avg_line_length': 28.97142857142857, 'alnum_prop': 0.6715976331360947, 'repo_name': 'crisbeto/material2', 'id': '1d5ba0309ddb368b2c2ca005ea1ae762d77ae5cd', 'size': '3042', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'src/material/legacy-chips/chip-remove.spec.ts', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '66255'}, {'name': 'HTML', 'bytes': '871851'}, {'name': 'JavaScript', 'bytes': '89800'}, {'name': 'SCSS', 'bytes': '873339'}, {'name': 'Shell', 'bytes': '16309'}, {'name': 'Starlark', 'bytes': '445234'}, {'name': 'TypeScript', 'bytes': '11048110'}]} |
//
// SDLTurnSignal.h
// SmartDeviceLink
//
// Created by Nicole on 7/19/18.
// Copyright © 2018 smartdevicelink. All rights reserved.
//
#import "SDLEnum.h"
/**
* Enumeration that describes the status of the turn light indicator.
*/
typedef SDLEnum SDLTurnSignal NS_TYPED_ENUM;
/**
* Turn signal is OFF
*/
extern SDLTurnSignal const SDLTurnSignalOff;
/**
* Left turn signal is on
*/
extern SDLTurnSignal const SDLTurnSignalLeft;
/**
* Right turn signal is on
*/
extern SDLTurnSignal const SDLTurnSignalRight;
/**
* Both signals (left and right) are on
*/
extern SDLTurnSignal const SDLTurnSignalBoth;
| {'content_hash': 'e74eb653d166aa6901bd9e75b86b6585', 'timestamp': '', 'source': 'github', 'line_count': 34, 'max_line_length': 70, 'avg_line_length': 18.441176470588236, 'alnum_prop': 0.7145135566188198, 'repo_name': 'smartdevicelink/sdl_ios', 'id': '34c9e7ea9221eba55e6ee4f02490bbba55c71f12', 'size': '628', 'binary': False, 'copies': '1', 'ref': 'refs/heads/develop', 'path': 'SmartDeviceLink/public/SDLTurnSignal.h', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'C', 'bytes': '1311'}, {'name': 'Jinja', 'bytes': '9097'}, {'name': 'Mustache', 'bytes': '1587'}, {'name': 'Objective-C', 'bytes': '6802591'}, {'name': 'Python', 'bytes': '95846'}, {'name': 'Ruby', 'bytes': '1875'}, {'name': 'Shell', 'bytes': '25862'}, {'name': 'Swift', 'bytes': '112020'}]} |
/*
* 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.
*/
/*
* This code was generated by https://github.com/googleapis/google-api-java-client-services/
* Modify at your own risk.
*/
package com.google.api.services.directory.model;
/**
* The template that returns individual ASP (Access Code) data.
*
* <p> This is the Java data model class that specifies how to parse/serialize into the JSON that is
* transmitted over HTTP when working with the Admin Directory API. For a detailed explanation see:
* <a href="https://developers.google.com/api-client-library/java/google-http-java-client/json">https://developers.google.com/api-client-library/java/google-http-java-client/json</a>
* </p>
*
* @author Google, Inc.
*/
@SuppressWarnings("javadoc")
public final class Asp extends com.google.api.client.json.GenericJson {
/**
* The unique ID of the ASP.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.Integer codeId;
/**
* The time when the ASP was created. Expressed in Unix time format.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key @com.google.api.client.json.JsonString
private java.lang.Long creationTime;
/**
* ETag of the ASP.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String etag;
/**
* The type of the API resource. This is always admin#directory#asp.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String kind;
/**
* The time when the ASP was last used. Expressed in Unix time format.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key @com.google.api.client.json.JsonString
private java.lang.Long lastTimeUsed;
/**
* The name of the application that the user, represented by their userId, entered when the ASP
* was created.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String name;
/**
* The unique ID of the user who issued the ASP.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String userKey;
/**
* The unique ID of the ASP.
* @return value or {@code null} for none
*/
public java.lang.Integer getCodeId() {
return codeId;
}
/**
* The unique ID of the ASP.
* @param codeId codeId or {@code null} for none
*/
public Asp setCodeId(java.lang.Integer codeId) {
this.codeId = codeId;
return this;
}
/**
* The time when the ASP was created. Expressed in Unix time format.
* @return value or {@code null} for none
*/
public java.lang.Long getCreationTime() {
return creationTime;
}
/**
* The time when the ASP was created. Expressed in Unix time format.
* @param creationTime creationTime or {@code null} for none
*/
public Asp setCreationTime(java.lang.Long creationTime) {
this.creationTime = creationTime;
return this;
}
/**
* ETag of the ASP.
* @return value or {@code null} for none
*/
public java.lang.String getEtag() {
return etag;
}
/**
* ETag of the ASP.
* @param etag etag or {@code null} for none
*/
public Asp setEtag(java.lang.String etag) {
this.etag = etag;
return this;
}
/**
* The type of the API resource. This is always admin#directory#asp.
* @return value or {@code null} for none
*/
public java.lang.String getKind() {
return kind;
}
/**
* The type of the API resource. This is always admin#directory#asp.
* @param kind kind or {@code null} for none
*/
public Asp setKind(java.lang.String kind) {
this.kind = kind;
return this;
}
/**
* The time when the ASP was last used. Expressed in Unix time format.
* @return value or {@code null} for none
*/
public java.lang.Long getLastTimeUsed() {
return lastTimeUsed;
}
/**
* The time when the ASP was last used. Expressed in Unix time format.
* @param lastTimeUsed lastTimeUsed or {@code null} for none
*/
public Asp setLastTimeUsed(java.lang.Long lastTimeUsed) {
this.lastTimeUsed = lastTimeUsed;
return this;
}
/**
* The name of the application that the user, represented by their userId, entered when the ASP
* was created.
* @return value or {@code null} for none
*/
public java.lang.String getName() {
return name;
}
/**
* The name of the application that the user, represented by their userId, entered when the ASP
* was created.
* @param name name or {@code null} for none
*/
public Asp setName(java.lang.String name) {
this.name = name;
return this;
}
/**
* The unique ID of the user who issued the ASP.
* @return value or {@code null} for none
*/
public java.lang.String getUserKey() {
return userKey;
}
/**
* The unique ID of the user who issued the ASP.
* @param userKey userKey or {@code null} for none
*/
public Asp setUserKey(java.lang.String userKey) {
this.userKey = userKey;
return this;
}
@Override
public Asp set(String fieldName, Object value) {
return (Asp) super.set(fieldName, value);
}
@Override
public Asp clone() {
return (Asp) super.clone();
}
}
| {'content_hash': 'ca6dc4f107814df639bda0c1fc0d6a83', 'timestamp': '', 'source': 'github', 'line_count': 213, 'max_line_length': 182, 'avg_line_length': 26.971830985915492, 'alnum_prop': 0.6675369886858138, 'repo_name': 'googleapis/google-api-java-client-services', 'id': '4f3f5090767b5c792edf506aed11bef7760006ca', 'size': '5745', 'binary': False, 'copies': '3', 'ref': 'refs/heads/main', 'path': 'clients/google-api-services-admin/directory_v1/1.30.1/com/google/api/services/directory/model/Asp.java', 'mode': '33188', 'license': 'apache-2.0', 'language': []} |
from django import forms
from django.conf import settings
from django.http import HttpResponse, HttpResponseRedirect, Http404
from manager import models as pmod
from . import templater
from django.conf import settings
import decimal, datetime
# This view allows an employee to return a rental from a customer. They will be able to input the damage note and fees if necessary, as well as record the return condition
def process_request(request):
if not request.user.is_authenticated():
return HttpResponseRedirect('/manager/login')
if request.user.is_staff == False:
return HttpResponseRedirect('/manager/')
if request.urlparams[0]:
rental = pmod.Rental.objects.get(id = request.urlparams[0])
days_late = datetime.datetime.now().replace(tzinfo=None) - rental.expected_date.replace(tzinfo=None)
if days_late.days > 0:
late_fees = rental.daily_rate * 2 * days_late.days
else:
late_fees = 0
'''Shows the list of users'''
form = ReturnRental(initial ={
'user': rental.user.first_name + " " + rental.user.last_name,
'serial_number': rental.serialized.serialNumber,
'description': rental.serialized.catalogID.name,
'checkout_date': rental.checkout_date.strftime('%b %d, %Y'),
'expected_date': rental.expected_date.strftime('%b %d, %Y'),
'checkout_condition': rental.checkout_condition,
'return_condition': "",
'regular_charge': "$" + str(rental.daily_rate * rental.days_to_rent),
'late_fees': "$" + str(late_fees),
'damage_note': "",
'damage_fees': "",
})
if request.method == 'POST':
form = ReturnRental(request.POST)
if form.is_valid():
rental = pmod.Rental.objects.get(id = request.urlparams[0])
rental.return_date = datetime.datetime.today()
rental.before_fees = rental.daily_rate * rental.days_to_rent
days_late = rental.return_date.replace(tzinfo=None) - rental.expected_date.replace(tzinfo=None)
if days_late.days > 0:
rental.late_fees = rental.daily_rate * 2 * days_late.days
else:
rental.late_fees = 0
rental.damage_fees = form.cleaned_data['damage_fees']
rental.damage_note = form.cleaned_data['damage_note']
rental.return_condition = form.cleaned_data['return_condition']
rental.save()
rental.serialized.is_available = True
rental.serialized.save()
redirect = "/employee/rental_checkout/" + str(rental.user.id)
return HttpResponseRedirect(redirect)
tvars = {
'form': form,
}
return templater.render_to_response(request, 'return_rental.html', tvars)
class ReturnRental(forms.Form):
user = forms.CharField( widget=forms.TextInput(attrs={'class':'form-control', 'readonly':'readonly'}))
serial_number = forms.CharField( widget=forms.TextInput(attrs={'class':'form-control', 'readonly':'readonly'}))
description = forms.CharField( widget=forms.TextInput(attrs={'class':'form-control', 'readonly':'readonly'}))
checkout_date = forms.CharField( widget=forms.TextInput(attrs={'class':'form-control', 'readonly':'readonly'}))
expected_date = forms.CharField( widget=forms.TextInput(attrs={'class':'form-control', 'readonly':'readonly'}))
checkout_condition = forms.CharField( widget=forms.TextInput(attrs={'class':'form-control', 'readonly':'readonly'}))
return_condition = forms.CharField(required=False, widget=forms.TextInput(attrs={'class':'form-control'}))
regular_charge = forms.CharField( widget=forms.TextInput(attrs={'class':'form-control', 'readonly':'readonly'}))
late_fees = forms.CharField( widget=forms.TextInput(attrs={'class':'form-control', 'readonly':'readonly'}))
damage_note = forms.CharField(required=False, widget=forms.TextInput(attrs={'class':'form-control'}))
damage_fees = forms.DecimalField(required=False, label='Damage Fee', widget=forms.TextInput(attrs={'class':'form-control'}))
#def clean_user_text(self): | {'content_hash': '3880976af677f6d7058d02f15d63ce01', 'timestamp': '', 'source': 'github', 'line_count': 86, 'max_line_length': 171, 'avg_line_length': 45.093023255813954, 'alnum_prop': 0.7037132542547705, 'repo_name': 'odrolliv13/Hex-Photos', 'id': '480998249861d2155a49b853aceed2d2a63fad9b', 'size': '3878', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'employee/views/return_rental.py', 'mode': '33261', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '54125'}, {'name': 'HTML', 'bytes': '127551'}, {'name': 'JavaScript', 'bytes': '97543'}, {'name': 'Python', 'bytes': '239701'}]} |
require 'stringio'
require 'erubis'
require 'tilt'
module Spontaneous
module Rack
class Reloader
include Spontaneous::Rack::Helpers
def initialize(app, *args)
@app = app
config = args.first || {}
@cooldown = config[:cooldown] || 3
@last = (Time.now - @cooldown)
end
def call(env)
if @cooldown and Time.now > @last + @cooldown
if Thread.list.size > 1
Thread.exclusive{ reload! }
else
reload!
end
@last = Time.now
end
@app.call(env)
rescue Spontaneous::SchemaModificationError => error
template = Tilt::ErubisTemplate.new(File.expand_path('../../../../application/views/schema_modification_error.html.erb', __FILE__))
html = template.render(self, :modification => error.modification, :env => env)
[412, {'Content-type' => ::Rack::Mime.mime_type('.html')}, StringIO.new(html)].tap do |response|
end
end
def reload!
Spontaneous.reload!
end
end # Reloader
end # Rack
end # Spontaneous
| {'content_hash': 'cfdbe0dc4b303318984534ba08ec4e3f', 'timestamp': '', 'source': 'github', 'line_count': 43, 'max_line_length': 139, 'avg_line_length': 25.767441860465116, 'alnum_prop': 0.5731046931407943, 'repo_name': 'magnetised/spontaneous', 'id': '2d519c442bd2d021aa184a8eff1813496b21956a', 'size': '1127', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'lib/spontaneous/rack/reloader.rb', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '110378'}, {'name': 'JavaScript', 'bytes': '921512'}, {'name': 'Ruby', 'bytes': '1233284'}, {'name': 'Shell', 'bytes': '156'}]} |
package org.apache.fineract.portfolio.loanaccount.domain;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
import org.apache.fineract.portfolio.loanaccount.data.LoanTermVariationsData;
import org.apache.fineract.portfolio.loanproduct.service.LoanEnumerations;
import org.joda.time.LocalDate;
import org.springframework.data.jpa.domain.AbstractPersistable;
@Entity
@Table(name = "m_loan_term_variations")
public class LoanTermVariations extends AbstractPersistable<Long> {
@ManyToOne(optional = false)
@JoinColumn(name = "loan_id", nullable = false)
private Loan loan;
@Column(name = "term_type", nullable = false)
private Integer termType;
@Temporal(TemporalType.DATE)
@Column(name = "applicable_date", nullable = false)
private Date termApplicableFrom;
@Column(name = "decimal_value", scale = 6, precision = 19)
private BigDecimal decimalValue;
@Temporal(TemporalType.DATE)
@Column(name = "date_value")
private Date dateValue;
@Column(name = "is_specific_to_installment", nullable = false)
private boolean isSpecificToInstallment;
@Column(name = "applied_on_loan_status", nullable = false)
private Integer onLoanStatus;
@Column(name = "is_active", nullable = false)
private Boolean isActive;
@OneToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "parent_id")
private LoanTermVariations parent;
public LoanTermVariations(final Integer termType, final Date termApplicableFrom, final BigDecimal decimalValue, final Date dateValue,
final boolean isSpecificToInstallment, final Loan loan) {
this.loan = loan;
this.termApplicableFrom = termApplicableFrom;
this.termType = termType;
this.decimalValue = decimalValue;
this.dateValue = dateValue;
this.isSpecificToInstallment = isSpecificToInstallment;
this.onLoanStatus = loan.status().getValue();
this.isActive = true;
this.parent = null;
}
public LoanTermVariations(final Integer termType, final Date termApplicableFrom, final BigDecimal decimalValue, final Date dateValue,
final boolean isSpecificToInstallment, final Loan loan, final Integer loanStatus) {
this.loan = loan;
this.termApplicableFrom = termApplicableFrom;
this.termType = termType;
this.decimalValue = decimalValue;
this.dateValue = dateValue;
this.isSpecificToInstallment = isSpecificToInstallment;
this.onLoanStatus = loanStatus;
this.isActive = true;
this.parent = null;
}
public LoanTermVariations(final Integer termType, final Date termApplicableFrom, final BigDecimal decimalValue, final Date dateValue,
final boolean isSpecificToInstallment, final Loan loan, final Integer loanStatus, final Boolean isActive, final LoanTermVariations parent) {
this.loan = loan;
this.termApplicableFrom = termApplicableFrom;
this.termType = termType;
this.decimalValue = decimalValue;
this.dateValue = dateValue;
this.isSpecificToInstallment = isSpecificToInstallment;
this.onLoanStatus = loanStatus;
this.isActive = isActive;
this.parent = parent;
}
protected LoanTermVariations() {
}
public LoanTermVariationType getTermType() {
return LoanTermVariationType.fromInt(this.termType);
}
public LoanTermVariationsData toData() {
LocalDate termStartDate = new LocalDate(this.termApplicableFrom);
LocalDate dateValue = null;
if (this.dateValue != null) {
dateValue = new LocalDate(this.dateValue);
}
EnumOptionData type = LoanEnumerations.loanvariationType(this.termType);
return new LoanTermVariationsData(getId(), type, termStartDate, this.decimalValue, dateValue, this.isSpecificToInstallment);
}
public Date getTermApplicableFrom() {
return this.termApplicableFrom;
}
public LocalDate fetchTermApplicaDate() {
return new LocalDate(this.termApplicableFrom);
}
public BigDecimal getTermValue() {
return this.decimalValue;
}
public Date getDateValue() {
return this.dateValue;
}
public LocalDate fetchDateValue() {
return this.dateValue == null ? null : new LocalDate(this.dateValue);
}
public void setTermApplicableFrom(Date termApplicableFrom) {
this.termApplicableFrom = termApplicableFrom;
}
public void setDecimalValue(BigDecimal decimalValue) {
this.decimalValue = decimalValue;
}
public Integer getOnLoanStatus() {
return this.onLoanStatus;
}
public Boolean isActive() {
return this.isActive;
}
public LoanTermVariations parent() {
return this.parent;
}
public void updateIsActive(final Boolean isActive){
this.isActive = isActive;
}
public void markAsInactive() {
this.isActive = false;
}
}
| {'content_hash': 'dbb01fab20f80c4e7f06ad8a6e8843b2', 'timestamp': '', 'source': 'github', 'line_count': 163, 'max_line_length': 152, 'avg_line_length': 33.11042944785276, 'alnum_prop': 0.7040948675189921, 'repo_name': 'Vishwa1311/incubator-fineract', 'id': '6dbadad9f331752e3cc0972ffb15bc4b7f196331', 'size': '6199', 'binary': False, 'copies': '2', 'ref': 'refs/heads/develop', 'path': 'fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTermVariations.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '1053'}, {'name': 'CSS', 'bytes': '14524'}, {'name': 'HTML', 'bytes': '1447980'}, {'name': 'Java', 'bytes': '15808920'}, {'name': 'SQLPL', 'bytes': '11331'}, {'name': 'Shell', 'bytes': '6098'}]} |
<footer class="site-footer">
<span class="site-footer-owner">
<a href="https://github.com/openchattanooga/chamap">ChaMap</a> is project built with love by <a href="https://github.com/openchattanooga">openchattanooga</a> for Chattanooga.
</span>
</footer>
| {'content_hash': '6d27c3eea1a2aa4eed877a8164c3bf1d', 'timestamp': '', 'source': 'github', 'line_count': 5, 'max_line_length': 178, 'avg_line_length': 52.6, 'alnum_prop': 0.7224334600760456, 'repo_name': 'openchattanooga/chamap', 'id': '92e371b2e3e1368d0a2e6ccbf280dd016fe16090', 'size': '263', 'binary': False, 'copies': '1', 'ref': 'refs/heads/gh-pages', 'path': '_includes/footer.html', 'mode': '33188', 'license': 'mit', 'language': []} |
package li.strolch.persistence.postgresql;
import java.sql.Connection;
import li.strolch.persistence.api.TransactionResult;
public class ArchivePostgreSqlActivityDao extends PostgreSqlActivityDao {
public static final String TABLE_NAME = "archive_activities";
public ArchivePostgreSqlActivityDao(DataType dataType, Connection connection, TransactionResult txResult,
boolean versioningEnabled) {
super(dataType, connection, txResult, versioningEnabled);
}
@Override
protected String getTableName() {
return TABLE_NAME;
}
}
| {'content_hash': '69dab4c28c01cbd6e83f53edd0f531dc', 'timestamp': '', 'source': 'github', 'line_count': 20, 'max_line_length': 106, 'avg_line_length': 27.05, 'alnum_prop': 0.8114602587800369, 'repo_name': '4treesCH/strolch', 'id': '94454f5802874a172f8cf89516e15c57d8e84060', 'size': '541', 'binary': False, 'copies': '2', 'ref': 'refs/heads/develop', 'path': 'li.strolch.persistence.postgresql/src/main/java/li/strolch/persistence/postgresql/ArchivePostgreSqlActivityDao.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'ANTLR', 'bytes': '2003'}, {'name': 'CSS', 'bytes': '2486'}, {'name': 'HTML', 'bytes': '383752'}, {'name': 'Java', 'bytes': '4122045'}, {'name': 'JavaScript', 'bytes': '2831'}, {'name': 'PLSQL', 'bytes': '3323'}, {'name': 'Shell', 'bytes': '14167'}, {'name': 'Smarty', 'bytes': '878'}, {'name': 'TSQL', 'bytes': '29111'}]} |
package it.unibas.bartgui.view.panel.editor.database.visual;
import java.util.Iterator;
import java.util.Set;
import org.netbeans.api.visual.action.EditProvider;
import org.netbeans.api.visual.widget.Widget;
import org.netbeans.core.api.multiview.MultiViewHandler;
import org.netbeans.core.api.multiview.MultiViewPerspective;
import org.netbeans.core.api.multiview.MultiViews;
import org.openide.windows.TopComponent;
import org.openide.windows.WindowManager;
import speedy.model.database.ITable;
/**
*
* @author Grandinetti Giovanni <[email protected]>
*/
public class TableEditProvider implements EditProvider {
private String topCompName;
private ITable table;
public TableEditProvider(String topCompName, ITable table) {
this.topCompName = topCompName;
this.table = table;
}
@Override
public void edit(Widget widget) {
Set<TopComponent> set = WindowManager.getDefault().getRegistry().getOpened();
Iterator<TopComponent> it = set.iterator();
TopComponent tableView = null;
while(it.hasNext()) {
TopComponent tmp = it.next();
if(tmp.getName().equals(topCompName)) {
tableView = tmp;
break;
}
}
if(tableView !=null) {
MultiViewHandler mvh = MultiViews.findMultiViewHandler(tableView);
MultiViewPerspective[] mp = mvh.getPerspectives();
for(MultiViewPerspective xxx : mp) {
if(table.getName().equals(xxx.preferredID())) {
mvh.requestActive(xxx);
return;
}
}
TableDataView panel = new TableDataView(table);
mvh.addMultiViewDescription(
new TableDataViewDescription(table.getName(), table.getName(), panel), 30);
panel.requestFocus();
}
}
}
| {'content_hash': '248150f09680238d264cf4316aef4f01', 'timestamp': '', 'source': 'github', 'line_count': 57, 'max_line_length': 95, 'avg_line_length': 34.07017543859649, 'alnum_prop': 0.6333676622039135, 'repo_name': 'dbunibas/BART', 'id': '252ea34c3c2ef99c9b2d96125ab043b574d2d1a6', 'size': '1942', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Bart_GUI/View/src/it/unibas/bartgui/view/panel/editor/database/visual/TableEditProvider.java', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Batchfile', 'bytes': '31'}, {'name': 'GAP', 'bytes': '8027'}, {'name': 'Java', 'bytes': '1990494'}, {'name': 'Shell', 'bytes': '1147'}]} |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-GB" xml:lang="en-GB" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Statistics of aux in UD_Livvi-KKPP</title>
<link rel="root" href=""/> <!-- for JS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="../../css/jquery-ui-redmond.css"/>
<link rel="stylesheet" type="text/css" href="../../css/style.css"/>
<link rel="stylesheet" type="text/css" href="../../css/style-vis.css"/>
<link rel="stylesheet" type="text/css" href="../../css/hint.css"/>
<script type="text/javascript" src="../../lib/ext/head.load.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/anchor-js/3.2.2/anchor.min.js"></script>
<script>document.addEventListener("DOMContentLoaded", function(event) {anchors.add();});</script>
<!-- Set up this custom Google search at https://cse.google.com/cse/business/settings?cx=001145188882102106025:dl1mehhcgbo -->
<!-- DZ 2021-01-22: I am temporarily hiding the search field to find out whether it slows down loading of the title page.
<script>
(function() {
var cx = '001145188882102106025:dl1mehhcgbo';
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = 'https://cse.google.com/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);
})();
</script> -->
<!-- <link rel="shortcut icon" href="favicon.ico"/> -->
</head>
<body>
<div id="main" class="center">
<div id="hp-header">
<table width="100%"><tr><td width="50%">
<span class="header-text"><a href="http://universaldependencies.org/#language-">home</a></span>
<span class="header-text"><a href="https://github.com/universaldependencies/docs/edit/pages-source/treebanks/olo_kkpp/olo_kkpp-dep-aux.md" target="#">edit page</a></span>
<span class="header-text"><a href="https://github.com/universaldependencies/docs/issues">issue tracker</a></span>
</td><td>
<gcse:search></gcse:search>
</td></tr></table>
</div>
<hr/>
<div class="v2complete">
This page pertains to UD version 2.
</div>
<div id="content">
<noscript>
<div id="noscript">
It appears that you have Javascript disabled.
Please consider enabling Javascript for this page to see the visualizations.
</div>
</noscript>
<!-- The content may include scripts and styles, hence we must load the shared libraries before the content. -->
<script type="text/javascript">
console.time('loading libraries');
var root = '../../'; // filled in by jekyll
head.js(
// External libraries
// DZ: Copied from embedding.html. I don't know which one is needed for what, so I'm currently keeping them all.
root + 'lib/ext/jquery.min.js',
root + 'lib/ext/jquery.svg.min.js',
root + 'lib/ext/jquery.svgdom.min.js',
root + 'lib/ext/jquery.timeago.js',
root + 'lib/ext/jquery-ui.min.js',
root + 'lib/ext/waypoints.min.js',
root + 'lib/ext/jquery.address.min.js'
);
</script>
<h2 id="treebank-statistics-ud_livvi-kkpp-relations-aux">Treebank Statistics: UD_Livvi-KKPP: Relations: <code class="language-plaintext highlighter-rouge">aux</code></h2>
<p>This relation is universal.</p>
<p>35 nodes (2%) are attached to their parents as <code class="language-plaintext highlighter-rouge">aux</code>.</p>
<p>34 instances of <code class="language-plaintext highlighter-rouge">aux</code> (97%) are right-to-left (child precedes parent).
Average distance between parent and child is 1.2.</p>
<p>The following 3 pairs of parts of speech are connected with <code class="language-plaintext highlighter-rouge">aux</code>: <tt><a href="olo_kkpp-pos-VERB.html">VERB</a></tt>-<tt><a href="olo_kkpp-pos-AUX.html">AUX</a></tt> (33; 94% instances), <tt><a href="olo_kkpp-pos-AUX.html">AUX</a></tt>-<tt><a href="olo_kkpp-pos-AUX.html">AUX</a></tt> (1; 3% instances), <tt><a href="olo_kkpp-pos-PRON.html">PRON</a></tt>-<tt><a href="olo_kkpp-pos-AUX.html">AUX</a></tt> (1; 3% instances).</p>
<pre><code class="language-conllu"># visual-style 3 bgColor:blue
# visual-style 3 fgColor:white
# visual-style 5 bgColor:blue
# visual-style 5 fgColor:white
# visual-style 5 3 aux color:blue
1 Enzimäine enzimäine ADJ ADJ Case=Acc|Number=Sing|NumType=Ord 2 amod _ _
2 matku matku NOUN NOUN Case=Nom|Number=Sing 5 nsubj _ _
3 oli olla AUX AUX Mood=Ind|Number=Sing|Person=3|Tense=Past|VerbForm=Fin|Voice=Act 5 aux _ _
4 jo jo ADV ADV _ 5 advmod _ _
5 mennyt mennä VERB VERB VerbForm=Part 0 root _ _
6 pyhänpiän pyhänpiän ADV ADV _ 5 advmod _ SpaceAfter=No|PronType=Temp
7 , , PUNCT PUNCT _ 5 punct _ _
8 23. 23. ADJ ADJ NumType=Ord 9 amod _ _
9 sulakuudu sulakuu NOUN NOUN Case=Par|Number=Sing 5 obl _ SpaceAfter=No
10 . . PUNCT PUNCT _ 5 punct _ SpaceAfter=No
</code></pre>
<pre><code class="language-conllu"># visual-style 2 bgColor:blue
# visual-style 2 fgColor:white
# visual-style 3 bgColor:blue
# visual-style 3 fgColor:white
# visual-style 3 2 aux color:blue
1 Illal illal ADV ADV _ 4 advmod _ PronType=Temp
2 ei ei AUX AUX Number=Sing|Person=3|Polarity=Neg 3 aux _ _
3 suannuh suaha AUX AUX Number=Sing|Tense=Past|VerbForm=Part 0 root _ _
4 arbailla arbailla VERB VERB Connegative=Yes|Mood=Ind|Tense=Pres|VerbForm=Fin|Voice=Act 3 xcomp _ _
5 – – PUNCT PUNCT _ 6 punct _ _
6 varattih varata VERB VERB Mood=Ind|Number=Plur|Person=3|Tense=Past|VerbForm=Fin|Voice=Act 3 parataxis _ _
7 Arbaituksen Arbaitus NOUN NOUN Case=Gen|Number=Sing 8 nmod:poss _ _
8 akkua akku NOUN NOUN Case=Par|Number=Sing 6 obj _ SpaceAfter=No
9 , , PUNCT PUNCT _ 12 punct _ _
10 ku ku SCONJ SCONJ _ 12 mark _ _
11 häi häi PRON PRON Case=Nom|Number=Sing|Person=3|PronType=Prs 12 nsubj _ _
12 tulou tulla VERB VERB Mood=Ind|Number=Sing|Person=3|Tense=Pres|VerbForm=Fin|Voice=Act 6 advcl _ _
13 yön yö NOUN NOUN Case=Gen|Number=Sing 14 nmod:poss _ _
14 aigua aigu NOUN NOUN Case=Par|Number=Sing 12 obl _ _
15 da da CCONJ CCONJ _ 16 cc _ _
16 ähkiäy ähkie VERB X Mood=Ind|Number=Sing|Person=3|Tense=Pres|VerbForm=Fin|Voice=Act 12 conj _ _
17 bokkah bokku NOUN NOUN Case=Ill|Number=Sing 16 obl _ SpaceAfter=No
18 . . PUNCT PUNCT _ 3 punct _ SpaceAfter=No
</code></pre>
<pre><code class="language-conllu"># visual-style 2 bgColor:blue
# visual-style 2 fgColor:white
# visual-style 1 bgColor:blue
# visual-style 1 fgColor:white
# visual-style 1 2 aux color:blue
1 Heil Hyö PRON PRON Case=All|Number=Plur|Person=3|PronType=Prs 0 root _ _
2 ei ei AUX AUX Mood=Ind|Number=Sing|Person=3 1 aux _ _
3 ole olla AUX AUX Connegative=Yes|Mood=Ind|Tense=Pres|VerbForm=Fin|Voice=Act 1 cop:own _ _
4 ovvostustu ovvostus NOUN NOUN Case=Par|Number=Sing 1 nsubj:cop _ _
5 sit sit PRON PRON Case=Par|Number=Sing 4 nmod _ SpaceAfter=No
6 , , PUNCT PUNCT _ 9 punct _ _
7 ken ken PRON PRON Case=Nom|Number=Sing 9 nsubj _ PronType=Interr
8 sen se PRON PRON Case=Gen|Number=Sing|PronType=Dem 9 obj _ _
9 kirjutti kirjuttua VERB VERB Mood=Ind|Number=Sing|Person=3|Tense=Past|VerbForm=Fin|Voice=Act 5 acl:relcl _ SpaceAfter=No
10 . . PUNCT PUNCT _ 1 punct _ _
</code></pre>
</div>
<!-- support for embedded visualizations -->
<script type="text/javascript">
var root = '../../'; // filled in by jekyll
head.js(
// We assume that external libraries such as jquery.min.js have already been loaded outside!
// (See _layouts/base.html.)
// brat helper modules
root + 'lib/brat/configuration.js',
root + 'lib/brat/util.js',
root + 'lib/brat/annotation_log.js',
root + 'lib/ext/webfont.js',
// brat modules
root + 'lib/brat/dispatcher.js',
root + 'lib/brat/url_monitor.js',
root + 'lib/brat/visualizer.js',
// embedding configuration
root + 'lib/local/config.js',
// project-specific collection data
root + 'lib/local/collections.js',
// Annodoc
root + 'lib/annodoc/annodoc.js',
// NOTE: non-local libraries
'https://spyysalo.github.io/conllu.js/conllu.js'
);
var webFontURLs = [
// root + 'static/fonts/Astloch-Bold.ttf',
root + 'static/fonts/PT_Sans-Caption-Web-Regular.ttf',
root + 'static/fonts/Liberation_Sans-Regular.ttf'
];
var setupTimeago = function() {
jQuery("time.timeago").timeago();
};
head.ready(function() {
setupTimeago();
// mark current collection (filled in by Jekyll)
Collections.listing['_current'] = '';
// perform all embedding and support functions
Annodoc.activate(Config.bratCollData, Collections.listing);
});
</script>
<!-- google analytics -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-55233688-1', 'auto');
ga('send', 'pageview');
</script>
<div id="footer">
<p class="footer-text">© 2014–2021
<a href="http://universaldependencies.org/introduction.html#contributors" style="color:gray">Universal Dependencies contributors</a>.
Site powered by <a href="http://spyysalo.github.io/annodoc" style="color:gray">Annodoc</a> and <a href="http://brat.nlplab.org/" style="color:gray">brat</a></p>.
</div>
</div>
</body>
</html>
| {'content_hash': 'bb5ba3f39c450cc96313d12978a877ab', 'timestamp': '', 'source': 'github', 'line_count': 226, 'max_line_length': 486, 'avg_line_length': 44.676991150442475, 'alnum_prop': 0.6505892839457265, 'repo_name': 'UniversalDependencies/universaldependencies.github.io', 'id': '0b9585a989b5358ad5c9d7031558219072592c77', 'size': '10118', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'treebanks/olo_kkpp/olo_kkpp-dep-aux.html', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '64420'}, {'name': 'HTML', 'bytes': '383191916'}, {'name': 'JavaScript', 'bytes': '687350'}, {'name': 'Perl', 'bytes': '7788'}, {'name': 'Python', 'bytes': '21203'}, {'name': 'Shell', 'bytes': '7253'}]} |
<!-- Font Awesome -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">
<!-- JQuery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script src="{{asset('ckeditor/ckeditor.js')}}"></script>
<!-- Estilo -->
<link rel="stylesheet" href="{{asset('css/estilo.css')}}">
<script type="text/javascript">
var roxyFileman = "{{asset('fileman/index.html')}}";
</script> | {'content_hash': 'c18b665eb8b26b0f4fe504188247adbf', 'timestamp': '', 'source': 'github', 'line_count': 23, 'max_line_length': 106, 'avg_line_length': 38.56521739130435, 'alnum_prop': 0.6933483652762119, 'repo_name': 'villagres/website', 'id': '04a24be63878fdde652c08ea2884498103c65cb5', 'size': '887', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'public/administracao/app/views/layout/links.blade.php', 'mode': '33261', 'license': 'bsd-3-clause', 'language': [{'name': 'ASP', 'bytes': '6273'}, {'name': 'CSS', 'bytes': '185684'}, {'name': 'ColdFusion', 'bytes': '17785'}, {'name': 'HTML', 'bytes': '1052628'}, {'name': 'JavaScript', 'bytes': '396741'}, {'name': 'Lasso', 'bytes': '3841'}, {'name': 'PHP', 'bytes': '419883'}, {'name': 'Perl', 'bytes': '3363'}, {'name': 'Python', 'bytes': '4211'}, {'name': 'Ruby', 'bytes': '1232'}]} |
layout: post
title: Network Simulator open-sourced
titleinfo: Bidhan Neupane
desc: Network Simulator (Free browser-based network diagram and subnetting tool) is now open-sourced on GitHub.
---
![Network Simulator Demo]({{ site.baseurl }}/images/posts/network-simulator-demo-jan-2016.PNG)
Background
-----------------
[Network Simulator](https://github.com/nbidhan/Network-Simulator) was built as a part of my initial university project as a free browser-based network diagram and subnetting tool. The primary aim was to provide an easy to use and free alternative to network simulating tools like [Packet Tracer](https://www.netacad.com/about-networking-academy/packet-tracer/) from cisco. Since it was built for university course-work (first/second year networking students), we thought it would be a good idea to open source it while we are still working on it.
Purpose of the Software:
------------
* Free browser-based network diagram and subnetting tool
* Simulate Ping and TraceRoute network tests
* Save diagrams to and Load diagrams from localStorage and text file
Target Audience:
--------------
* Beginner Students enrolled in computer networking
* Users looking for a free network diagram and subnetting tool
Current limitations:
----------------------
* `Computers` are limited to 1 Ethernet Interface;
* `Routers`: 3 interfaces;
* `Switches`: 5 interfaces;
{% highlight CSharp %}
{% endhighlight %}
Features:
------------------
The features are currently pretty straight forward but if there is enough interest in the project, I will make a walk-through video for the tool.
| {'content_hash': 'c01aa6c01031b32f0b3d1f2d5ec03ccd', 'timestamp': '', 'source': 'github', 'line_count': 35, 'max_line_length': 546, 'avg_line_length': 45.542857142857144, 'alnum_prop': 0.7478042659974906, 'repo_name': 'nbidhan/nbidhan.github.io', 'id': 'b790ab25a9b928b249bf0b154c8f61122cd3df6c', 'size': '1598', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': '_posts/2016-01-07-network-simulator.md', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '18073'}, {'name': 'HTML', 'bytes': '8107'}, {'name': 'JavaScript', 'bytes': '1581'}, {'name': 'Ruby', 'bytes': '3395'}, {'name': 'Shell', 'bytes': '167'}]} |
typedef enum : NSUInteger {
HQDynamicTypeSnap = 0,
HQDynamicTypePush,
HQDynamicTypeAttachment,
HQDynamicTypeSpring,
} HQDynamicType;
@interface SimpleDemoDetailController : RootViewController
@property (assign, nonatomic) HQDynamicType type;
@end
| {'content_hash': '220d4866a074d851ec59c5d6754399d8', 'timestamp': '', 'source': 'github', 'line_count': 12, 'max_line_length': 58, 'avg_line_length': 22.166666666666668, 'alnum_prop': 0.7781954887218046, 'repo_name': 'HQforC/Graduation', 'id': 'e3ce7f824bd7248d3ea721ceaf02c4e4f2bcedec', 'size': '442', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'CoreAnimation/CoreAnimation/Classes/ViewControllers/AmusingExamples/SimpleDemoDetailController.h', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C', 'bytes': '698'}, {'name': 'C++', 'bytes': '54683'}, {'name': 'Objective-C', 'bytes': '336852'}, {'name': 'Objective-C++', 'bytes': '83180'}]} |
using System;
using System.Runtime.InteropServices;
namespace Avalonia.Win32.Interop.Automation
{
[ComVisible(true)]
[Guid("b9734fa6-771f-4d78-9c90-2517999349cd")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface ITableItemProvider : IGridItemProvider
{
IRawElementProviderSimple [] GetRowHeaderItems();
IRawElementProviderSimple [] GetColumnHeaderItems();
}
}
| {'content_hash': '47dc39b0e2c1d279246aed00e4584ec7', 'timestamp': '', 'source': 'github', 'line_count': 14, 'max_line_length': 60, 'avg_line_length': 30.285714285714285, 'alnum_prop': 0.75, 'repo_name': 'AvaloniaUI/Avalonia', 'id': '36751122d14388cf8fdd1403a99b8110376e42dd', 'size': '424', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'src/Windows/Avalonia.Win32/Interop/Automation/ITableItemProvider.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Batchfile', 'bytes': '207'}, {'name': 'C', 'bytes': '3251'}, {'name': 'C#', 'bytes': '15264329'}, {'name': 'C++', 'bytes': '6193'}, {'name': 'HTML', 'bytes': '295'}, {'name': 'JavaScript', 'bytes': '1326'}, {'name': 'Objective-C', 'bytes': '15646'}, {'name': 'Objective-C++', 'bytes': '166876'}, {'name': 'PowerShell', 'bytes': '4336'}, {'name': 'Shell', 'bytes': '3792'}, {'name': 'TypeScript', 'bytes': '55219'}]} |
require 'spec_helper'
describe SportsApi::Fetcher::Score::NFL do
describe '#find' do
let(:date) { Date.new(2015, 9, 11) }
let(:find) { SportsApi::Fetcher::Score::NFL.find(date) }
describe 'pregame' do
let(:json_stub) { StubbedJson.get('pregame.json') }
before { expect_any_instance_of(SportsApi::Fetcher::Score::NFL).to receive(:get).with('football', 'nfl', dates: 20150911).and_return(json_stub) }
context 'basic league info' do
it { expect(find.calendar.size).to eq(27) }
it { expect(find.name).to eq('National Football League') }
end
context 'event info' do
let(:event) { find.events.detect { |event| event.status.pregame? } }
it { expect(event.date.to_date).to eq(Date.new(2015, 9, 11)) }
it { expect(event.competitors.first.name).to eq('Patriots') }
# it { expect(event.competitors.first.record.summary).to eq('0-0') }
it { expect(event.score).to eq('0 - 0') }
end
end
describe 'inprogress' do
let(:date) { Date.new(2015, 8, 10) }
let(:json_stub) { StubbedJson.get('inprogress.json') }
before { expect_any_instance_of(SportsApi::Fetcher::Score::NFL).to receive(:get).with('football', 'nfl', dates: 20150810).and_return(json_stub) }
context 'event info' do
let(:event) { find.events.detect { |event| event.status.inprogress? } }
it { expect(event.date).to eq(Date.new(2015, 8, 10)) }
it { expect(event.competitors.first.name).to eq('Vikings') }
it { expect(event.competitors.first.record.summary).to eq('0-0') }
it { expect(event.score).to eq('7 - 3') }
end
end
describe 'postgame' do
let(:date) { Date.new(2015, 8, 16) }
let(:json_stub) { StubbedJson.get('postgame.json') }
let(:find) { SportsApi::Fetcher::Score::NFL.find(date) }
before { expect_any_instance_of(SportsApi::Fetcher::Score::NFL).to receive(:get).with('football', 'nfl', dates: 20150816).and_return(json_stub) }
context 'event info' do
let(:event) { find.events.detect { |event| event.status.final? } }
let(:thumbnail_url) { 'http://a.espncdn.com/media/motion/2015/0816/dm_150816_nfl_eagles_colts_highlight/dm_150816_nfl_eagles_colts_highlight.jpg' }
it { expect(event.date.to_date).to eq(Date.new(2015, 8, 16)) }
it { expect(event.headline.photo).to eq(thumbnail_url) }
end
end
end
end
| {'content_hash': '07cb1964ec35278f583528935bc2f100', 'timestamp': '', 'source': 'github', 'line_count': 50, 'max_line_length': 155, 'avg_line_length': 48.54, 'alnum_prop': 0.6246394725999176, 'repo_name': 'austinarchibald/sports_api', 'id': '621d75cccd7572bddc272725b911aaa514088b31', 'size': '2427', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'spec/fetchers/scores/leagues/nfl_spec.rb', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Ruby', 'bytes': '45734'}, {'name': 'Shell', 'bytes': '115'}]} |
package org.cam.core.domain;
import com.google.common.collect.Sets;
import org.cam.core.cache.Copyable;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
/**
* Created by wuyaohui on 14-9-30.
*/
public class StringSet implements Copyable{
private Set<String> idSet;
public StringSet() {
}
public StringSet(Set<String> roleIdSet) {
this.idSet = roleIdSet;
}
public Set<String> getIdSet() {
return idSet;
}
@Override
public Copyable copy() {
if(idSet.isEmpty()){
return new StringSet(Collections.EMPTY_SET);
}
Set<String> setCpy = new HashSet<>(idSet.size());
setCpy.addAll(idSet);
return new StringSet(setCpy);
}
public static Set<String> safeGet(StringSet set){
return set !=null ? set.getIdSet() : null;
}
@Override
public String toString() {
return "StringSet{" +
"idSet=" + idSet +
'}';
}
}
| {'content_hash': 'fc8e9d44c075f1e042f7f1e45af68444', 'timestamp': '', 'source': 'github', 'line_count': 48, 'max_line_length': 57, 'avg_line_length': 21.041666666666668, 'alnum_prop': 0.597029702970297, 'repo_name': 'yaohuiwu/CAM', 'id': 'a87273e848b42bed755f4ffe59e1016a409d2bad', 'size': '1010', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'cam-core/src/main/java/org/cam/core/domain/StringSet.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'ANTLR', 'bytes': '23108'}, {'name': 'Java', 'bytes': '800896'}]} |
@value main-yellow, main-orange, main-gray from "../../../common/variables.module.css";
.container {
position: relative;
border: 1px solid transparent;
&:hover {
border-color: main-yellow;
> .remove__btn {
visibility: visible;
}
}
}
.remove__btn {
position: absolute;
top: 0;
right: 0;
transform: translate(50%, -50%);
visibility: hidden;
}
.property__title {
color: main-orange;
font-size: 1.25rem;
width: 30px;
}
.input {
color: #969696;
border: none;
&::placeholder {
color: main-gray;
}
}
.textarea {
&::placeholder {
color: main-gray;
font-weight: 300;
}
}
| {'content_hash': 'd90a68ecb0cf497d8b317b765bae7a63', 'timestamp': '', 'source': 'github', 'line_count': 43, 'max_line_length': 87, 'avg_line_length': 14.767441860465116, 'alnum_prop': 0.6015748031496063, 'repo_name': 'goodjoblife/GoodJobShare', 'id': 'd2eeaf19a4cfcce5af7b19ec54518f308e63d7b2', 'size': '635', 'binary': False, 'copies': '1', 'ref': 'refs/heads/dev', 'path': 'src/components/ShareExperience/InterviewForm/InterviewExperience/InterviewQa.module.css', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '151436'}, {'name': 'Dockerfile', 'bytes': '791'}, {'name': 'JavaScript', 'bytes': '904052'}]} |
<?php
/**
* Defines the HomePage page type
*/
class CollectionsPage extends Page {
static $db = array(
'CollectionsTitle' => 'Text',
'CollectionsText' => 'HTMLText',
'CollectionsImageCaption' => 'HTMLText',
);
static $has_one = array(
'CollectionsImage' => 'Image',
);
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->removeFieldFromTab("Root.Content.Main","Content");
$fields->addFieldToTab('Root.Content.PageContent', new ImageField('CollectionsImage', 'Collections Image (width must be 348 pixels)'));
$fields->addFieldToTab('Root.Content.PageContent', new TextField('CollectionsTitle','Collections Title'));
$fields->addFieldToTab('Root.Content.PageContent', new HTMLEditorField('CollectionsImageCaption','Collections Image Caption'));
$fields->addFieldToTab('Root.Content.PageContent', new HTMLEditorField('CollectionsText','Collections HTML Text'));
return $fields;
}
}
class CollectionsPage_Controller extends Page_Controller {
}
?> | {'content_hash': 'e90c5aae9839a3165a4434b03dd2c163', 'timestamp': '', 'source': 'github', 'line_count': 45, 'max_line_length': 139, 'avg_line_length': 23.4, 'alnum_prop': 0.6904083570750238, 'repo_name': 'StudentLifeMarketingAndDesign/uima-legacy', 'id': '3b764cd0cd0a3d57af5ee575c152681e56bcea6a', 'size': '1053', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'mysite/code/CollectionsPage.php', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'ActionScript', 'bytes': '17461'}, {'name': 'ApacheConf', 'bytes': '648'}, {'name': 'CSS', 'bytes': '60016'}, {'name': 'HTML', 'bytes': '122'}, {'name': 'JavaScript', 'bytes': '61305'}, {'name': 'Makefile', 'bytes': '271'}, {'name': 'PHP', 'bytes': '1854789'}, {'name': 'Scheme', 'bytes': '51462'}]} |
class Pending < Webmachine::Resource
class << self
attr_accessor :redis
end
def content_types_provided
[
['text/plain', :to_text]
]
end
def to_text
seen = {}
# Collect queues
self.class.redis.scan_each(:match => "pending*") do |queue|
next if seen[queue]
seen[queue] = true
end
# "pending" sorts before "pending-*" and "pending:*", and "-" sorts before ":", so no special treatment needed to get the desired sorting.
buffer = []
seen.keys.sort_by(&:downcase).each do |queue|
b = []
b << queue
idents = self.class.redis.lrange(queue, 0, -1).reverse
urls = self.class.redis.pipelined do
idents.each { |ident| self.class.redis.hget(ident, 'url') }
end
idents.zip(urls).each.with_index do |(ident, url), i|
b << " #{i+1}. #{url} (#{ident})"
end
buffer << b.join("\n")
end
buffer.join("\n\n")
end
end
| {'content_hash': '492bc6af75b2b989dde193b2f137f21d', 'timestamp': '', 'source': 'github', 'line_count': 43, 'max_line_length': 142, 'avg_line_length': 22.069767441860463, 'alnum_prop': 0.5669125395152792, 'repo_name': 'ArchiveTeam/ArchiveBot', 'id': 'b0ebcbd21d8fe5bd3a41bcf942e571769b0b195a', 'size': '949', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'dashboard/resources/pending.rb', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '927'}, {'name': 'Dockerfile', 'bytes': '474'}, {'name': 'HTML', 'bytes': '81862'}, {'name': 'Haxe', 'bytes': '16435'}, {'name': 'JavaScript', 'bytes': '6838'}, {'name': 'Makefile', 'bytes': '79'}, {'name': 'Python', 'bytes': '138681'}, {'name': 'Ruby', 'bytes': '98065'}, {'name': 'Shell', 'bytes': '1762'}]} |
from distutils.core import setup
setup(
name="yelluw_matches",
packages=["yelluw_matches"],
version="0.1.1",
description="matches is a simple and tiny pattern matching library",
author="Pablo Rivera",
author_email="[email protected]",
url="https://github.com/yelluw/matches",
download_url="https://github.com/yelluw/matches/archive/0.1.1.tar.gz",
keywords=["pattern matching", "Python 3", "Yelluw"],
classifiers=[
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
],
)
| {'content_hash': 'd8b6f1344abfad8f4a9a8ef49fdf567b', 'timestamp': '', 'source': 'github', 'line_count': 18, 'max_line_length': 74, 'avg_line_length': 31.22222222222222, 'alnum_prop': 0.6405693950177936, 'repo_name': 'yelluw/matches', 'id': 'a2e7430aa74c1d6bc7fa3003c7171a800ad2c3aa', 'size': '562', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'setup.py', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Python', 'bytes': '3318'}]} |
"""
Genetic Algorithm class for global optimization.
This class contains the API and interface for performing
Genetic Algorithm-based optimization. Multiple strategies for
mutations, cross-overs, etc. are available.
Created June,3,2020
@authors: Mohammad Abdo, Diego Mandelli, Andrea Alfonsi
References
----------
.. [1] Holland, John H. "Genetic algorithms." Scientific American 267.1 (1992): 66-73.
[2] Z. Michalewicz, "Genetic Algorithms. + Data Structures. = Evolution Programs," Third, Revised
and Extended Edition, Springer (1996).
"""
# External Modules----------------------------------------------------------------------------------
from collections import deque, defaultdict
import numpy as np
from scipy.special import comb
import xarray as xr
# External Modules End------------------------------------------------------------------------------
# Internal Modules----------------------------------------------------------------------------------
from ..utils import mathUtils, InputData, InputTypes
from ..utils.gaUtils import dataArrayToDict, datasetToDataArray
from .RavenSampled import RavenSampled
from .parentSelectors.parentSelectors import returnInstance as parentSelectionReturnInstance
from .crossOverOperators.crossovers import returnInstance as crossoversReturnInstance
from .mutators.mutators import returnInstance as mutatorsReturnInstance
from .survivorSelectors.survivorSelectors import returnInstance as survivorSelectionReturnInstance
from .fitness.fitness import returnInstance as fitnessReturnInstance
from .repairOperators.repair import returnInstance as repairReturnInstance
# Internal Modules End------------------------------------------------------------------------------
class GeneticAlgorithm(RavenSampled):
"""
This class performs Genetic Algorithm optimization ...
"""
convergenceOptions = {'objective': r""" provides the desired value for the convergence criterion of the objective function
($\epsilon^{obj}$). In essence this is solving the inverse problem of finding the design variable
at a given objective value, i.e., convergence is reached when: $$ Objective = \epsilon^{obj}$$.
\default{1e-6}, if no criteria specified""",
'AHDp': r""" provides the desired value for the Average Hausdorff Distance between populations""",
'AHD': r""" provides the desired value for the Hausdorff Distance between populations"""}
def __init__(self):
"""
Constructor.
@ In, None
@ Out, None
"""
RavenSampled.__init__(self)
self._parentSelection = None # mechanism for parent selection
self._convergenceCriteria = defaultdict(mathUtils.giveZero) # names and values for convergence checks
self._acceptHistory = {} # acceptability
self._acceptRerun = {} # by traj, if True then override accept for point rerun
self._convergenceInfo = {} # by traj, the persistence and convergence information for most recent opt
self._requiredPersistence = 0 # consecutive persistence required to mark convergence
self.needDenormalized() # the default in all optimizers is to normalize the data which is not the case here
self.batchId = 0
self.population = None # panda Dataset container containing the population at the beginning of each generation iteration
self.popAge = None # population age
self.fitness = None # population fitness
self.ahdp = np.NaN # p-Average Hausdorff Distance between populations
self.ahd = np.NaN # Hausdorff Distance between populations
self.bestPoint = None
self.bestFitness = None
self.bestObjective = None
self.objectiveVal = None
self._populationSize = None
self._parentSelectionType = None
self._parentSelectionInstance = None
self._nParents = None
self._nChildren = None
self._crossoverType = None
self._crossoverPoints = None
self._crossoverProb = None
self._crossoverInstance = None
self._mutationType = None
self._mutationLocs = None
self._mutationProb = None
self._mutationInstance = None
self._survivorSelectionType = None
self._survivorSelectionInstance = None
self._fitnessType = None
self._objCoeff = None
self._penaltyCoeff = None
self._fitnessInstance = None
self._repairInstance = None
##########################
# Initialization Methods #
##########################
@classmethod
def getInputSpecification(cls):
"""
Method to get a reference to a class that specifies the input data for class cls.
@ In, cls, the class for which we are retrieving the specification
@ Out, specs, InputData.ParameterInput, class to use for specifying input of cls.
"""
specs = super(GeneticAlgorithm, cls).getInputSpecification()
specs.description = r"""The \xmlNode{GeneticAlgorithm} optimizer is a metaheuristic approach
to perform a global search in large design spaces. The methodology rose
from the process of natural selection, and like others in the large class
of the evolutionary algorithms, it utilizes genetic operations such as
selection, crossover, and mutations to avoid being stuck in local minima
and hence facilitates finding the global minima. More information can
be found in:
Holland, John H. "Genetic algorithms." Scientific American 267.1 (1992): 66-73."""
# GA Params
GAparams = InputData.parameterInputFactory('GAparams', strictMode=True,
printPriority=108,
descr=r""" Genetic Algorithm Parameters:\begin{itemize}
\item populationSize.
\item parentSelectors:
\begin{itemize}
\item rouletteWheel.
\item tournamentSelection.
\item rankSelection.
\end{itemize}
\item Reproduction:
\begin{itemize}
\item crossover:
\begin{itemize}
\item onePointCrossover.
\item twoPointsCrossover.
\item uniformCrossover
\end{itemize}
\item mutators:
\begin{itemize}
\item swapMutator.
\item scrambleMutator.
\item inversionMutator.
\item bitFlipMutator.
\end{itemize}
\end{itemize}
\item survivorSelectors:
\begin{itemize}
\item ageBased.
\item fitnessBased.
\end{itemize}
\end{itemize}""")
# Population Size
populationSize = InputData.parameterInputFactory('populationSize', strictMode=True,
contentType=InputTypes.IntegerType,
printPriority=108,
descr=r"""The number of chromosomes in each population.""")
GAparams.addSub(populationSize)
# Parent Selection
parentSelection = InputData.parameterInputFactory('parentSelection', strictMode=True,
contentType=InputTypes.StringType,
printPriority=108,
descr=r"""A node containing the criterion based on which the parents are selected. This can be a
fitness proportional selection such as:
a. \textbf{\textit{rouletteWheel}},
b. \textbf{\textit{tournamentSelection}},
c. \textbf{\textit{rankSelection}}
for all methods nParents is computed such that the population size is kept constant.
$nChildren = 2 \times {nParents \choose 2} = nParents \times (nParents-1) = popSize$
solving for nParents we get:
$nParents = ceil(\frac{1 + \sqrt{1+4*popSize}}{2})$
This will result in a popSize a little larger than the initial one, these excessive children will be later thrawn away and only the first popSize child will be kept""")
GAparams.addSub(parentSelection)
# Reproduction
reproduction = InputData.parameterInputFactory('reproduction', strictMode=True,
printPriority=108,
descr=r"""a node containing the reproduction methods.
This accepts subnodes that specifies the types of crossover and mutation.""")
# 1. Crossover
crossover = InputData.parameterInputFactory('crossover', strictMode=True,
contentType=InputTypes.StringType,
printPriority=108,
descr=r"""a subnode containing the implemented crossover mechanisms.
This includes: a. onePointCrossover,
b. twoPointsCrossover,
c. uniformCrossover.""")
crossover.addParam("type", InputTypes.StringType, True,
descr="type of crossover operation to be used (e.g., OnePoint, MultiPoint, or Uniform)")
crossoverPoint = InputData.parameterInputFactory('points', strictMode=True,
contentType=InputTypes.IntegerListType,
printPriority=108,
descr=r""" point/gene(s) at which crossover will occur.""")
crossover.addSub(crossoverPoint)
crossoverProbability = InputData.parameterInputFactory('crossoverProb', strictMode=True,
contentType=InputTypes.FloatType,
printPriority=108,
descr=r""" The probability governing the crossover step, i.e., the probability that if exceeded crossover will occur.""")
crossover.addSub(crossoverProbability)
reproduction.addSub(crossover)
# 2. Mutation
mutation = InputData.parameterInputFactory('mutation', strictMode=True,
contentType=InputTypes.StringType,
printPriority=108,
descr=r"""a subnode containing the implemented mutation mechanisms.
This includes: a. bitFlipMutation,
b. swapMutation,
c. scrambleMutation, or
d. inversionMutation.""")
mutation.addParam("type", InputTypes.StringType, True,
descr="type of mutation operation to be used (e.g., bit, swap, or scramble)")
mutationLocs = InputData.parameterInputFactory('locs', strictMode=True,
contentType=InputTypes.IntegerListType,
printPriority=108,
descr=r""" locations at which mutation will occur.""")
mutation.addSub(mutationLocs)
mutationProbability = InputData.parameterInputFactory('mutationProb', strictMode=True,
contentType=InputTypes.FloatType,
printPriority=108,
descr=r""" The probability governing the mutation step, i.e., the probability that if exceeded mutation will occur.""")
mutation.addSub(mutationProbability)
reproduction.addSub(mutation)
GAparams.addSub(reproduction)
# Survivor Selection
survivorSelection = InputData.parameterInputFactory('survivorSelection', strictMode=True,
contentType=InputTypes.StringType,
printPriority=108,
descr=r"""a subnode containing the implemented survivor selection mechanisms.
This includes: a. ageBased, or
b. fitnessBased.""")
GAparams.addSub(survivorSelection)
# Fitness
fitness = InputData.parameterInputFactory('fitness', strictMode=True,
contentType=InputTypes.StringType,
printPriority=108,
descr=r"""a subnode containing the implemented fitness functions.
This includes: a. invLinear: $fitness = -a \times obj - b \times \sum_{j=1}^{nConstraint} max(0,-penalty\_j) $.
b. logistic: $fitness = \frac{1}{1+e^{a\times(obj-b)}}$.
c. feasibleFirst: $fitness = \left\{\begin{matrix} -obj & g_j(x)\geq 0 \; \forall j \\ -obj_{worst}- \Sigma_{j=1}^{J}<g_j(x)> & otherwise \\ \end{matrix}\right.$""")
fitness.addParam("type", InputTypes.StringType, True,
descr=r"""[invLin, logistic, feasibleFirst]""")
objCoeff = InputData.parameterInputFactory('a', strictMode=True,
contentType=InputTypes.FloatType,
printPriority=108,
descr=r""" a: coefficient of objective function.""")
fitness.addSub(objCoeff)
penaltyCoeff = InputData.parameterInputFactory('b', strictMode=True,
contentType=InputTypes.FloatType,
printPriority=108,
descr=r""" b: coefficient of constraint penalty.""")
fitness.addSub(penaltyCoeff)
GAparams.addSub(fitness)
specs.addSub(GAparams)
# convergence
conv = InputData.parameterInputFactory('convergence', strictMode=True,
printPriority=108,
descr=r"""a node containing the desired convergence criteria for the optimization algorithm.
Note that convergence is met when any one of the convergence criteria is met. If no convergence
criteria are given, then the defaults are used.""")
specs.addSub(conv)
for name, descr in cls.convergenceOptions.items():
conv.addSub(InputData.parameterInputFactory(name, contentType=InputTypes.FloatType,descr=descr,printPriority=108 ))
# Persistence
conv.addSub(InputData.parameterInputFactory('persistence', contentType=InputTypes.IntegerType,
printPriority = 109,
descr=r"""provides the number of consecutive times convergence should be reached before a trajectory
is considered fully converged. This helps in preventing early false convergence."""))
specs.addSub(conv)
return specs
@classmethod
def getSolutionExportVariableNames(cls):
"""
Compiles a list of acceptable SolutionExport variable options.
@ In, cls, the class for which we are retrieving the solution export
@ Out, ok, dict, {varName: description} for valid solution export variable names
"""
# cannot be determined before run-time due to variables and prefixes.
ok = super(GeneticAlgorithm, cls).getSolutionExportVariableNames()
new = {}
# new = {'': 'the size of step taken in the normalized input space to arrive at each optimal point'}
new['conv_{CONV}'] = 'status of each given convergence criteria'
new['fitness'] = 'fitness of the current chromosome'
new['age'] = 'age of current chromosome'
new['batchId'] = 'Id of the batch to whom the chromosome belongs'
new['AHDp'] = 'p-Average Hausdorff Distance between populations'
new['AHD'] = 'Hausdorff Distance between populations'
new['ConstraintEvaluation_{CONSTRAINT}'] = 'Constraint function evaluation (negative if violating and positive otherwise)'
ok.update(new)
return ok
def handleInput(self, paramInput):
"""
Read input specs
@ In, paramInput, InputData.ParameterInput, parameter specs interpreted
@ Out, None
"""
RavenSampled.handleInput(self, paramInput)
# GAparams
gaParamsNode = paramInput.findFirst('GAparams')
# populationSize
populationSizeNode = gaParamsNode.findFirst('populationSize')
self._populationSize = populationSizeNode.value
# parent selection
parentSelectionNode = gaParamsNode.findFirst('parentSelection')
self._parentSelectionType = parentSelectionNode.value
self._parentSelectionInstance = parentSelectionReturnInstance(self, name=parentSelectionNode.value)
# reproduction node
reproductionNode = gaParamsNode.findFirst('reproduction')
self._nParents = int(np.ceil(1/2 + np.sqrt(1+4*self._populationSize)/2))
self._nChildren = int(2*comb(self._nParents,2))
# crossover node
crossoverNode = reproductionNode.findFirst('crossover')
self._crossoverType = crossoverNode.parameterValues['type']
if crossoverNode.findFirst('points') is None:
self._crossoverPoints = None
else:
self._crossoverPoints = crossoverNode.findFirst('points').value
self._crossoverProb = crossoverNode.findFirst('crossoverProb').value
self._crossoverInstance = crossoversReturnInstance(self,name = self._crossoverType)
# mutation node
mutationNode = reproductionNode.findFirst('mutation')
self._mutationType = mutationNode.parameterValues['type']
if mutationNode.findFirst('locs') is None:
self._mutationLocs = None
else:
self._mutationLocs = mutationNode.findFirst('locs').value
self._mutationProb = mutationNode.findFirst('mutationProb').value
self._mutationInstance = mutatorsReturnInstance(self,name = self._mutationType)
# Survivor selection
survivorSelectionNode = gaParamsNode.findFirst('survivorSelection')
self._survivorSelectionType = survivorSelectionNode.value
self._survivorSelectionInstance = survivorSelectionReturnInstance(self,name = self._survivorSelectionType)
# Fitness
fitnessNode = gaParamsNode.findFirst('fitness')
self._fitnessType = fitnessNode.parameterValues['type']
# Check if the fitness requested is among the constrained optimization fitnesses
# Currently, only InvLin and feasibleFirst Fitnesses deal with constrained optimization
# TODO: @mandd, please explore the possibility to convert the logistic fitness into a constrained optimization fitness.
if 'Constraint' in self.assemblerObjects and self._fitnessType not in ['invLinear','feasibleFirst']:
self.raiseAnError(IOError, f'Currently constrained Genetic Algorithms only support invLinear and feasibleFirst fitnesses, whereas provided fitness is {self._fitnessType}')
self._objCoeff = fitnessNode.findFirst('a').value if fitnessNode.findFirst('a') is not None else None
self._penaltyCoeff = fitnessNode.findFirst('b').value if fitnessNode.findFirst('b') is not None else None
self._fitnessInstance = fitnessReturnInstance(self,name = self._fitnessType)
self._repairInstance = repairReturnInstance(self,name='replacementRepair') # currently only replacement repair is implemented.
# Convergence Criterion
convNode = paramInput.findFirst('convergence')
if convNode is not None:
for sub in convNode.subparts:
if sub.getName() == 'persistence':
self._requiredPersistence = sub.value
else:
self._convergenceCriteria[sub.name] = sub.value
if not self._convergenceCriteria:
self.raiseAWarning('No convergence criteria given; using defaults.')
self._convergenceCriteria['objective'] = 1e-6
if self._requiredPersistence is None:
self.raiseADebug('No persistence given; setting to 1.')
self._requiredPersistence = 1
def initialize(self, externalSeeding=None, solutionExport=None):
"""
This function should be called every time a clean optimizer is needed. Called before takeAstep in <Step>
@ In, externalSeeding, int, optional, external seed
@ In, solutionExport, DataObject, optional, a PointSet to hold the solution
@ Out, None
"""
RavenSampled.initialize(self, externalSeeding=externalSeeding, solutionExport=solutionExport)
meta = ['batchId']
self.addMetaKeys(meta)
self.batch = self._populationSize
if self._populationSize != len(self._initialValues):
self.raiseAnError(IOError, f'Number of initial values provided for each variable is {len(self._initialValues)}, while the population size is {self._populationSize}')
for _, init in enumerate(self._initialValues):
self._submitRun(init, 0, self.getIteration(0) + 1)
def initializeTrajectory(self, traj=None):
"""
Handles the generation of a trajectory.
@ In, traj, int, optional, label to use
@ Out, traj, int, new trajectory number
"""
traj = RavenSampled.initializeTrajectory(self)
self._acceptHistory[traj] = deque(maxlen=self._maxHistLen)
self._acceptRerun[traj] = False
self._convergenceInfo[traj] = {'persistence': 0}
for criteria in self._convergenceCriteria:
self._convergenceInfo[traj][criteria] = False
return traj
def needDenormalized(self):
"""
Determines if the currently used algorithms should be normalizing the input space or not
@ In, None
@ Out, needDenormalized, bool, True if normalizing should NOT be performed
"""
# overload as needed in inheritors
return True
###############
# Run Methods #
###############
def _useRealization(self, info, rlz):
"""
Used to feedback the collected runs into actionable items within the sampler.
This is called by localFinalizeActualSampling, and hence should contain the main skeleton.
@ In, info, dict, identifying information about the realization
@ In, rlz, xr.Dataset, new batched realizations
@ Out, None
"""
# The whole skeleton should be here, this should be calling all classes and _private methods.
traj = info['traj']
for t in self._activeTraj[1:]:
self._closeTrajectory(t, 'cancel', 'Currently GA is single trajectory', 0)
self.incrementIteration(traj)
info['step'] = self.counter
# Developer note: each algorithm step is indicated by a number followed by the generation number
# e.g., '5 @ n-1' refers to step 5 for generation n-1 (i.e., previous generation)
# for more details refer to GRP-Raven-development/Disceret_opt channel on MS Teams
# 5 @ n-1: Survivor Selection from previous iteration (children+parents merging from previous generation)
# 5.1 @ n-1: fitnessCalculation(rlz)
# perform fitness calculation for newly obtained children (rlz)
offSprings = datasetToDataArray(rlz, list(self.toBeSampled))
objectiveVal = list(np.atleast_1d(rlz[self._objectiveVar].data))
# collect parameters that the constraints functions need (neglecting the default params such as inputs and objective functions)
constraintData = {}
if self._constraintFunctions or self._impConstraintFunctions:
params = []
for y in (self._constraintFunctions + self._impConstraintFunctions):
params += y.parameterNames()
for p in list(set(params) -set([self._objectiveVar]) -set(list(self.toBeSampled.keys()))):
constraintData[p] = list(np.atleast_1d(rlz[p].data))
# Compute constraint function g_j(x) for all constraints (j = 1 .. J)
# and all x's (individuals) in the population
g0 = np.zeros((np.shape(offSprings)[0],len(self._constraintFunctions)+len(self._impConstraintFunctions)))
g = xr.DataArray(g0,
dims=['chromosome','Constraint'],
coords={'chromosome':np.arange(np.shape(offSprings)[0]),
'Constraint':[y.name for y in (self._constraintFunctions + self._impConstraintFunctions)]})
# FIXME The constraint handling is following the structure of the RavenSampled.py,
# there are many utility functions that can be simplified and/or merged together
# _check, _handle, and _apply, for explicit and implicit constraints.
# This can be simplified in the near future in GradientDescent, SimulatedAnnealing, and here in GA
for index,individual in enumerate(offSprings):
newOpt = individual
opt = {self._objectiveVar:objectiveVal[index]}
for p, v in constraintData.items():
opt[p] = v[index]
for constIndex, constraint in enumerate(self._constraintFunctions + self._impConstraintFunctions):
if constraint in self._constraintFunctions:
g.data[index, constIndex] = self._handleExplicitConstraints(newOpt, constraint)
else:
g.data[index, constIndex] = self._handleImplicitConstraints(newOpt, opt, constraint)
offSpringFitness = self._fitnessInstance(rlz,
objVar=self._objectiveVar,
a=self._objCoeff,
b=self._penaltyCoeff,
penalty=None,
constraintFunction=g,
type=self._minMax)
self._collectOptPoint(rlz, offSpringFitness, objectiveVal,g)
self._resolveNewGeneration(traj, rlz, objectiveVal, offSpringFitness, g, info)
if self._activeTraj:
# 5.2@ n-1: Survivor selection(rlz)
# update population container given obtained children
if self.counter > 1:
self.population,self.fitness,age,self.objectiveVal = self._survivorSelectionInstance(age=self.popAge,
variables=list(self.toBeSampled),
population=self.population,
fitness=self.fitness,
newRlz=rlz,
offSpringsFitness=offSpringFitness,
popObjectiveVal=self.objectiveVal)
self.popAge = age
else:
self.population = offSprings
self.fitness = offSpringFitness
self.objectiveVal = rlz[self._objectiveVar].data
# 1 @ n: Parent selection from population
# pair parents together by indexes
parents = self._parentSelectionInstance(self.population,
variables=list(self.toBeSampled),
fitness=self.fitness,
nParents=self._nParents)
# 2 @ n: Crossover from set of parents
# create childrenCoordinates (x1,...,xM)
childrenXover = self._crossoverInstance(parents=parents,
variables=list(self.toBeSampled),
crossoverProb=self._crossoverProb,
points=self._crossoverPoints)
# 3 @ n: Mutation
# perform random directly on childrenCoordinates
childrenMutated = self._mutationInstance(offSprings=childrenXover,
distDict=self.distDict,
locs=self._mutationLocs,
mutationProb=self._mutationProb,
variables=list(self.toBeSampled))
# 4 @ n: repair/replacement
# repair should only happen if multiple genes in a single chromosome have the same values (),
# and at the same time the sampling of these genes should be with Out replacement.
needsRepair = False
for chrom in range(self._nChildren):
unique = set(childrenMutated.data[chrom, :])
if len(childrenMutated.data[chrom,:]) != len(unique):
for var in self.toBeSampled: # TODO: there must be a smarter way to check if a variables strategy is without replacement
if (hasattr(self.distDict[var], 'strategy') and self.distDict[var].strategy == 'withoutReplacement'):
needsRepair = True
break
if needsRepair:
children = self._repairInstance(childrenMutated,variables=list(self.toBeSampled),distInfo=self.distDict)
else:
children = childrenMutated
# Make sure no children are exactly similar to parents
flag = True
counter = 0
while flag and counter < self._populationSize:
counter += 1
repeated = []
for i in range(np.shape(self.population.data)[0]):
for j in range(i,np.shape(children.data)[0]):
if all(self.population.data[i,:]==children.data[j,:]):
repeated.append(j)
repeated = list(set(repeated))
if repeated:
if len(repeated)> children.shape[0] - self._populationSize:
newChildren = self._mutationInstance(offSprings=children[repeated,:], distDict=self.distDict, locs=self._mutationLocs, mutationProb=self._mutationProb, variables=list(self.toBeSampled))
children.data[repeated,:] = newChildren.data
else:
children = children.drop_sel(chromosome=repeated)
else:
flag = False
# keeping the population size constant by ignoring the excessive children
children = children[:self._populationSize, :]
daChildren = xr.DataArray(children,
dims=['chromosome','Gene'],
coords={'chromosome': np.arange(np.shape(children)[0]),
'Gene':list(self.toBeSampled)})
# 5 @ n: Submit children batch
# submit children coordinates (x1,...,xm), i.e., self.childrenCoordinates
for i in range(self.batch):
newRlz = {}
for _, var in enumerate(self.toBeSampled.keys()):
newRlz[var] = float(daChildren.loc[i, var].values)
self._submitRun(newRlz, traj, self.getIteration(traj))
def _submitRun(self, point, traj, step, moreInfo=None):
"""
Submits a single run with associated info to the submission queue
@ In, point, dict, point to submit
@ In, traj, int, trajectory identifier
@ In, step, int, iteration number identifier
@ In, moreInfo, dict, optional, additional run-identifying information to track
@ Out, None
"""
info = {}
if moreInfo is not None:
info.update(moreInfo)
info.update({'traj': traj,
'step': step
})
# NOTE: Currently, GA treats explicit and implicit constraints similarly
# while box constraints (Boundary constraints) are automatically handled via limits of the distribution
#
self.raiseADebug(f'Adding run to queue: {self.denormalizeData(point)} | {info}')
self._submissionQueue.append((point, info))
def flush(self):
"""
Reset Optimizer attributes to allow rerunning a workflow
@ In, None
@ Out, None
"""
super().flush()
self.population = None
self.popAge = None
self.fitness = None
self.ahdp = np.NaN
self.ahd = np.NaN
self.bestPoint = None
self.bestFitness = None
self.bestObjective = None
self.objectiveVal = None
# END queuing Runs
# * * * * * * * * * * * * * * * *
def _resolveNewGeneration(self, traj, rlz, objectiveVal, fitness, g, info):
"""
Store a new Generation after checking convergence
@ In, traj, int, trajectory for this new point
@ In, rlz, dict, realized realization
@ In, objectiveVal, list, objective values at each chromosome of the realization
@ In, fitness, xr.DataArray, fitness values at each chromosome of the realization
@ In, g, xr.DataArray, the constraint evaluation function
@ In, info, dict, identifying information about the realization
"""
self.raiseADebug('*'*80)
self.raiseADebug(f'Trajectory {traj} iteration {info["step"]} resolving new state ...')
# note the collection of the opt point
self._stepTracker[traj]['opt'] = (rlz, info)
acceptable = 'accepted' if self.counter > 1 else 'first'
old = self.population
converged = self._updateConvergence(traj, rlz, old, acceptable)
if converged:
self._closeTrajectory(traj, 'converge', 'converged', self.bestObjective)
# NOTE: the solution export needs to be updated BEFORE we run rejectOptPoint or extend the opt
# point history.
if self._writeSteps == 'every':
for i in range(rlz.sizes['RAVEN_sample_ID']):
varList = self._solutionExport.getVars('input') + self._solutionExport.getVars('output') + list(self.toBeSampled.keys())
rlzDict = dict((var,np.atleast_1d(rlz[var].data)[i]) for var in set(varList) if var in rlz.data_vars)
rlzDict[self._objectiveVar] = np.atleast_1d(rlz[self._objectiveVar].data)[i]
rlzDict['fitness'] = np.atleast_1d(fitness.data)[i]
for ind, consName in enumerate(g['Constraint'].values):
rlzDict['ConstraintEvaluation_'+consName] = g[i,ind]
self._updateSolutionExport(traj, rlzDict, acceptable, None)
# decide what to do next
if acceptable in ['accepted', 'first']:
# record history
bestRlz = {}
bestRlz[self._objectiveVar] = self.bestObjective
bestRlz['fitness'] = self.bestFitness
bestRlz.update(self.bestPoint)
self._optPointHistory[traj].append((bestRlz, info))
elif acceptable == 'rejected':
self._rejectOptPoint(traj, info, old)
else: # e.g. rerun
pass # nothing to do, just keep moving
def _collectOptPoint(self, rlz, fitness, objectiveVal, g):
"""
Collects the point (dict) from a realization
@ In, population, Dataset, container containing the population
@ In, objectiveVal, list, objective values at each chromosome of the realization
@ In, fitness, xr.DataArray, fitness values at each chromosome of the realization
@ Out, point, dict, point used in this realization
"""
varList = list(self.toBeSampled.keys()) + self._solutionExport.getVars('input') + self._solutionExport.getVars('output')
varList = set(varList)
selVars = [var for var in varList if var in rlz.data_vars]
population = datasetToDataArray(rlz, selVars)
optPoints,fit,obj,gOfBest = zip(*[[x,y,z,w] for x, y, z,w in sorted(zip(np.atleast_2d(population.data),np.atleast_1d(fitness.data),objectiveVal,np.atleast_2d(g.data)),reverse=True,key=lambda x: (x[1]))])
point = dict((var,float(optPoints[0][i])) for i, var in enumerate(selVars) if var in rlz.data_vars)
gOfBest = dict(('ConstraintEvaluation_'+name,float(gOfBest[0][i])) for i, name in enumerate(g.coords['Constraint'].values))
if (self.counter > 1 and obj[0] <= self.bestObjective and fit[0] >= self.bestFitness) or self.counter == 1:
point.update(gOfBest)
self.bestPoint = point
self.bestFitness = fit[0]
self.bestObjective = obj[0]
return point
def _checkAcceptability(self, traj):
"""
This is an abstract method for all RavenSampled Optimizer, whereas for GA all children are accepted
@ In, traj, int, identifier
"""
return
def checkConvergence(self, traj, new, old):
"""
Check for trajectory convergence
@ In, traj, int, trajectory to consider
@ In, new, xr.DataSet, new children realization
@ In, old, xr.DataArray, old population
@ Out, any(convs.values()), bool, True of any of the convergence criteria was reached
@ Out, convs, dict, on the form convs[conv] = bool, where conv is in self._convergenceCriteria
"""
convs = {}
for conv in self._convergenceCriteria:
fName = conv[:1].upper() + conv[1:]
# get function from lookup
f = getattr(self, f'_checkConv{fName}')
# check convergence function
okay = f(traj, new=new, old=old)
# store and update
convs[conv] = okay
return any(convs.values()), convs
def _checkConvObjective(self, traj, **kwargs):
"""
Checks the change in objective for convergence
@ In, traj, int, trajectory identifier
@ In, kwargs, dict, dictionary of parameters for convergence criteria
@ Out, converged, bool, convergence state
"""
if len(self._optPointHistory[traj]) < 2:
return False
o1, _ = self._optPointHistory[traj][-1]
obj = o1[self._objectiveVar]
converged = (obj == self._convergenceCriteria['objective'])
self.raiseADebug(self.convFormat.format(name='objective',
conv=str(converged),
got=obj,
req=self._convergenceCriteria['objective']))
return converged
def _checkConvAHDp(self, traj, **kwargs):
"""
Computes the Average Hausdorff Distance as the termination criteria
@ In, traj, int, trajectory identifier
@ In, kwargs, dict, dictionary of parameters for AHDp termination criteria:
old, np.array, old generation
new, np.array, new generation
p, float or integer, Minkowski norm order, (default 3)
@ Out, converged, bool, convergence state
"""
old = kwargs['old'].data
new = datasetToDataArray(kwargs['new'], list(self.toBeSampled)).data
if ('p' not in kwargs or kwargs['p'] is None):
p = 3
else:
p = kwargs['p']
ahdp = self._ahdp(old, new, p)
self.ahdp = ahdp
converged = (ahdp <= self._convergenceCriteria['AHDp'])
self.raiseADebug(self.convFormat.format(name='AHDp',
conv=str(converged),
got=ahdp,
req=self._convergenceCriteria['AHDp']))
return converged
def _checkConvAHD(self, traj, **kwargs):
"""
Computes the Hausdorff Distance as the termination criteria
@ In, traj, int, trajectory identifier
@ In, kwargs, dict, dictionary of parameters for AHDp termination criteria:
old, np.array, old generation
new, np.array, new generation
@ Out, converged, bool, convergence state
"""
old = kwargs['old'].data
new = datasetToDataArray(kwargs['new'], list(self.toBeSampled)).data
ahd = self._ahd(old,new)
self.ahd = ahd
converged = (ahd < self._convergenceCriteria['AHD'])
self.raiseADebug(self.convFormat.format(name='AHD',
conv=str(converged),
got=ahd,
req=self._convergenceCriteria['AHD']))
return converged
def _ahdp(self, a, b, p):
"""
p-average Hausdorff Distance for generation convergence
@ In, a, np.array, old population A
@ In, b, np.array, new population B
@ Out, _AHDp, float, average Hausdorff distance
"""
return max(self._GDp(a, b, p), self._GDp(b, a, p))
def _GDp(self, a, b, p):
r"""
Modified Generational Distance Indicator
@ In, a, np.array, old population A
@ In, b, np.array, new population B
@ In, p, float, the order of norm
@ Out, _GDp, float, the modified generational distance $\frac{1}{n_A} \Sigma_{i=1}^{n_A}min_{b \in B} dist(ai,B)$
"""
s = 0
n = np.shape(a)[0]
for i in range(n):
s += self._popDist(a[i,:],b)**p
return (1/n * s)**(1/p)
def _popDist(self,ai,b,q=2):
r"""
Minimum Minkowski distance from a_i to B (nearest point in B)
@ In, ai, 1d array, the ith chromosome in the generation A
@ In, b, np.array, population B
@ In, q, integer, order of the norm
@ Out, _popDist, float, the minimum distance from ai to B $inf_(\|ai-bj\|_q)**\frac{1}{q}$
"""
nrm = []
for j in range(np.shape(b)[0]):
nrm.append(np.linalg.norm(ai-b[j,:], q))
return min(nrm)
def _ahd(self, a, b):
"""
Hausdorff Distance for generation convergence
@ In, a, np.array, old population A
@ In, b, np.array, new population B
@ Out, _AHD, float, Hausdorff distance
"""
return max(self._GD(a,b),self._GD(b,a))
def _GD(self,a,b):
r"""
Generational Distance Indicator
@ In, a, np.array, old population A
@ In, b, np.array, new population B
@ Out, _GD, float, the generational distance $\frac{1}{n_A} \max_{i \in A}min_{b \in B} dist(ai,B)$
"""
s = []
n = np.shape(a)[0]
for i in range(n):
s.append(self._popDist(a[i,:],b))
return max(s)
def _updateConvergence(self, traj, new, old, acceptable):
"""
Updates convergence information for trajectory
@ In, traj, int, identifier
@ In, new, xr.DataSet, new children
@ In, old, xr.DataArray, old population
@ In, acceptable, str, condition of new point
@ Out, converged, bool, True if converged on ANY criteria
"""
# NOTE we have multiple "if acceptable" trees here, as we need to update soln export regardless
if acceptable == 'accepted':
self.raiseADebug(f'Convergence Check for Trajectory {traj}:')
# check convergence
converged, convDict = self.checkConvergence(traj, new, old)
else:
converged = False
convDict = dict((var, False) for var in self._convergenceInfo[traj])
self._convergenceInfo[traj].update(convDict)
return converged
def _updatePersistence(self, traj, converged, optVal):
"""
Update persistence tracking state variables
@ In, traj, int, identifier
@ In, converged, bool, convergence check result
@ In, optVal, float, new optimal value
@ Out, None
"""
# This is not required for the genetic algorithms as it's handled in the probabilistic acceptance criteria
# But since it is an abstract method it has to exist
return
def _checkForImprovement(self, new, old):
"""
Determine if the new value is sufficient improved over the old.
@ In, new, float, new optimization value
@ In, old, float, previous optimization value
@ Out, improved, bool, True if "sufficiently" improved or False if not.
"""
# This is not required for the genetic algorithms as it's handled in the probabilistic acceptance criteria
# But since it is an abstract method it has to exist
return
def _rejectOptPoint(self, traj, info, old):
"""
Having rejected the suggested opt point, take actions so we can move forward
@ In, traj, int, identifier
@ In, info, dict, meta information about the opt point
@ In, old, dict, previous optimal point (to resubmit)
"""
return
# * * * * * * * * * * * *
# Constraint Handling
def _handleExplicitConstraints(self, point, constraint):
"""
Computes explicit (i.e. input-based) constraints
@ In, point, xr.DataArray, the DataArray containing the chromosome (point)
@ In, constraint, external function, explicit constraint function
@ out, g, float, the value g_j(x) is the value of the constraint function number j when fed with the chromosome (point)
if $g_j(x)<0$, then the constraint is violated
"""
return self._applyFunctionalConstraints(point, constraint)
def _handleImplicitConstraints(self, point, opt,constraint):
"""
Computes implicit (i.e. output- or output-input-based) constraints
@ In, point, xr.DataArray, the DataArray containing the chromosome (point)
@ In, opt, float, the objective value at this chromosome (point)
@ In, constraint, external function, implicit constraint function
@ out, g, float,the value g_j(x) is the value of the constraint function number j when fed with the chromosome (point)
if $g_j(x)<0$, then the constraint is violated
"""
return self._checkImpFunctionalConstraints(point, opt, constraint)
def _applyFunctionalConstraints(self, point, constraint):
"""
fixes functional constraints of variables in "point" -> DENORMED point expected!
@ In, point, xr.DataArray, the dataArray containing potential point to apply constraints to
@ In, constraint, external function, constraint function
@ out, g, float, the value g_j(x) is the value of the constraint function number j when fed with the chromosome (point)
if $g_j(x)<0$, then the constraint is violated
"""
# are we violating functional constraints?
return self._checkFunctionalConstraints(point, constraint)
def _checkFunctionalConstraints(self, point, constraint):
"""
evaluates the provided constraint at the provided point
@ In, point, dict, the dictionary containing the chromosome (point)
@ In, constraint, external function, explicit constraint function
@ out, g, float, the value g_j(x) is the value of the constraint function number j when fed with the chromosome (point)
if $g_j(x)<0$, then the constraint is violated
"""
inputs = dataArrayToDict(point)
inputs.update(self.constants)
g = constraint.evaluate('constrain', inputs)
return g
def _checkImpFunctionalConstraints(self, point, opt, impConstraint):
"""
evaluates the provided implicit constraint at the provided point
@ In, point, dict, the dictionary containing the chromosome (point)
@ In, opt, dict, the dictionary containing the chromosome (point)
@ In, impConstraint, external function, implicit constraint function
@ out, g, float, the value g_j(x, objVar) is the value of the constraint function number j when fed with the chromosome (point)
if $g_j(x, objVar)<0$, then the constraint is violated
"""
inputs = dataArrayToDict(point)
inputs.update(self.constants)
inputs.update(opt)
g = impConstraint.evaluate('implicitConstraint', inputs)
return g
# END constraint handling
# * * * * * * * * * * * *
def _addToSolutionExport(self, traj, rlz, acceptable):
"""
Contributes additional entries to the solution export.
@ In, traj, int, trajectory which should be written
@ In, rlz, dict, collected point
@ In, acceptable, bool, acceptability of opt point
@ Out, toAdd, dict, additional entries
"""
# meta variables
toAdd = {'age': 0 if self.popAge is None else self.popAge,
'batchId': self.batchId,
'fitness': rlz['fitness'],
'AHDp': self.ahdp,
'AHD': self.ahd}
for var, val in self.constants.items():
toAdd[var] = val
toAdd = dict((key, np.atleast_1d(val)) for key, val in toAdd.items())
for key, val in self._convergenceInfo[traj].items():
toAdd[f'conv_{key}'] = bool(val)
return toAdd
def _formatSolutionExportVariableNames(self, acceptable):
"""
Does magic formatting for variables, based on this class's needs.
Extend in inheritors as needed.
@ In, acceptable, set, set of acceptable entries for solution export for this entity
@ Out, new, set, modified set of acceptable variables with all formatting complete
"""
# remaking the list is easier than using the existing one
acceptable = RavenSampled._formatSolutionExportVariableNames(self, acceptable)
new = []
while acceptable:
template = acceptable.pop()
if '{CONV}' in template:
new.extend([template.format(CONV=conv) for conv in self._convergenceCriteria])
elif '{VAR}' in template:
new.extend([template.format(VAR=var) for var in self.toBeSampled])
elif '{CONSTRAINT}' in template:
new.extend([template.format(CONSTRAINT=constraint.name) for constraint in self._constraintFunctions + self._impConstraintFunctions])
else:
new.append(template)
return set(new)
| {'content_hash': 'e4243b48408385a1ff38814e9f2bfc5e', 'timestamp': '', 'source': 'github', 'line_count': 990, 'max_line_length': 207, 'avg_line_length': 49.05858585858586, 'alnum_prop': 0.6184936583758853, 'repo_name': 'joshua-cogliati-inl/raven', 'id': '475791f60ce15dc7bd858622dbc9623a58a64858', 'size': '49157', 'binary': False, 'copies': '1', 'ref': 'refs/heads/devel', 'path': 'ravenframework/Optimizers/GeneticAlgorithm.py', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Assembly', 'bytes': '1556080'}, {'name': 'Batchfile', 'bytes': '1095'}, {'name': 'C', 'bytes': '148504'}, {'name': 'C++', 'bytes': '48279546'}, {'name': 'CMake', 'bytes': '9998'}, {'name': 'Jupyter Notebook', 'bytes': '84202'}, {'name': 'MATLAB', 'bytes': '202335'}, {'name': 'Makefile', 'bytes': '2399'}, {'name': 'Perl', 'bytes': '1297'}, {'name': 'Python', 'bytes': '6952659'}, {'name': 'R', 'bytes': '67'}, {'name': 'SWIG', 'bytes': '8574'}, {'name': 'Shell', 'bytes': '124279'}, {'name': 'TeX', 'bytes': '479725'}]} |
<?php
class pakeFunctionTest extends UnitTestCase
{
protected $test_dir;
public function setUp()
{
pakeApp::get_instance()->do_option('quiet', null);
$dir = dirname(__FILE__);
$this->test_dir = $dir.DIRECTORY_SEPARATOR.'temporary-files';
if (!is_dir($this->test_dir)) {
mkdir($this->test_dir);
}
$this->_cleanup();
}
function tearDown()
{
$this->_cleanup();
rmdir($this->test_dir);
}
private function _cleanup()
{
foreach (scandir($this->test_dir) as $entry) {
$full_path = $this->test_dir.DIRECTORY_SEPARATOR.$entry;
if (is_file($full_path)) {
unlink($full_path);
}
}
}
public function test_pake_replace_tokens()
{
$test_file_name = 'file1.tpl';
file_put_contents($this->test_dir.DIRECTORY_SEPARATOR.$test_file_name, '{token} {token2}');
pake_replace_tokens($test_file_name, $this->test_dir, '{', '}', array('token' => 'hello', 'token2' => 'world'));
$test_file = $this->test_dir.DIRECTORY_SEPARATOR.$test_file_name;
$replaced = file_get_contents($test_file);
$this->assertEqual('hello world', $replaced);
}
public function test_pake_replace_tokens_finder()
{
$test_file_names = array('file1.tpl', 'file2.tpl', 'file3.tpl');
foreach ($test_file_names as $test_file_name) {
file_put_contents($this->test_dir.DIRECTORY_SEPARATOR.$test_file_name, '{token} {token2}');
}
$files = pakeFinder::type('file')->relative()->in($this->test_dir);
pake_replace_tokens($files, $this->test_dir, '{', '}', array('token' => 'hello', 'token2' => 'world'));
foreach ($test_file_names as $test_file_name) {
$test_file = $this->test_dir.DIRECTORY_SEPARATOR.$test_file_name;
$replaced = file_get_contents($test_file);
$this->assertEqual('hello world', $replaced);
}
}
}
| {'content_hash': 'e1af998ab61857102ca036fdff4b8079', 'timestamp': '', 'source': 'github', 'line_count': 66, 'max_line_length': 120, 'avg_line_length': 30.651515151515152, 'alnum_prop': 0.5546218487394958, 'repo_name': 'indeyets/pake', 'id': '1501b5b15388a0633c9a57d89c4bf782d7c256a0', 'size': '2023', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'test/pakeFunctionTest.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'PHP', 'bytes': '212791'}]} |
<?php
namespace Shoperti\Tests\PayMe\Functional\Webhooks;
class OpenPayTest extends AbstractTest
{
protected $gatewayData = [
'config' => 'open_pay',
];
/** @test */
public function it_should_create_get_and_delete_a_webhook()
{
$url = 'https://httpbin.org/post';
$gateway = $this->getPayMe();
$payload = [
'url' => $url,
'event_types' => [
'charge.refunded',
'charge.failed',
'charge.cancelled',
'charge.created',
'charge.succeeded',
'charge.rescored.to.decline',
'subscription.charge.failed',
'payout.created',
'payout.succeeded',
'payout.failed',
'transfer.succeeded',
'fee.succeeded',
'fee.refund.succeeded',
'spei.received',
'chargeback.created',
'chargeback.rejected',
'chargeback.accepted',
'order.created',
'order.activated',
'order.payment.received',
'order.completed',
'order.expired',
'order.cancelled',
'order.payment.cancelled',
],
];
/** @var \Shoperti\PayMe\Contracts\WebhookInterface $openPayHooks */
$openPayHooks = $gateway->webhooks();
/** @var \Shoperti\PayMe\Contracts\ResponseInterface $response */
$response = $openPayHooks->create($payload);
$this->assertTrue($response->success());
$data = $response->data();
$webhook = $openPayHooks->find($data['id']);
$openPayHooks->delete($data['id']);
$this->assertSame($data['url'], $webhook->data()['url']);
}
}
| {'content_hash': 'df23597be991ab5c2b4cbc03ac728985', 'timestamp': '', 'source': 'github', 'line_count': 64, 'max_line_length': 76, 'avg_line_length': 28.9375, 'alnum_prop': 0.48758099352051837, 'repo_name': 'Shoperti/Payme', 'id': '6915f1e0c005a608779a43dce07c780bec382cbc', 'size': '1852', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'tests/Functional/Webhooks/OpenPayTest.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'PHP', 'bytes': '354551'}]} |
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using MB.Algodat;
using PoESkillTree.Engine.GameModel.StatTranslation;
using PoESkillTree.Utils;
using PoESkillTree.Model.Items.Mods;
using static MoreLinq.Extensions.EquiZipExtension;
namespace PoESkillTree.ViewModels.Crafting
{
/// <summary>
/// Pair of a stat id and a associated value. Used for translation.
/// </summary>
public struct StatIdValuePair
{
public string StatId { get; }
public int Value { get; }
public StatIdValuePair(string statId, int value)
{
StatId = statId;
Value = value;
}
}
/// <summary>
/// View model for selecting a mod out of a list of affixes and selecting their values.
/// </summary>
public class ModSelectorViewModel : Notifier
{
private static readonly Affix EmptySelection = new Affix();
private readonly StatTranslator _statTranslator;
public bool CanDeselct { get; }
private IReadOnlyList<Affix> _affixes = new[] { EmptySelection };
public IReadOnlyList<Affix> Affixes
{
get => _affixes;
set
{
var v = (value ?? new Affix[0]).Prepend(EmptySelection).ToList();
SetProperty(ref _affixes, v, () =>
{
if (!CanDeselct && Affixes.Count > 1)
{
SelectedAffix = Affixes[1];
return;
}
if (Affixes.Contains(SelectedAffix))
{
return;
}
if (SelectedAffix != null)
{
// Assigned Affixes are created anew each time the crafted base changes.
// Try to select an Affix that matches the previously selected one.
var matchingAffix = Affixes.FirstOrDefault(a => a.Name == SelectedAffix.Name);
if (matchingAffix != null)
{
var valuesBefore = SelectedValues.ToList();
SelectedAffix = matchingAffix;
// Try to assign the old values
if (SelectedValues.Count() == valuesBefore.Count
&& matchingAffix.QueryMods(valuesBefore).Any())
{
foreach (var (slider, valueTuple) in _sliders.Zip(valuesBefore, Tuple.Create))
{
slider.Value = valueTuple.value;
}
}
return;
}
}
SelectedAffix = EmptySelection;
});
}
}
private Affix _selectedAffix = default!; // Initialized when setting Affixes for the first time
public Affix SelectedAffix
{
get => _selectedAffix;
set => SetProperty(ref _selectedAffix, value, OnSelectedAffixChanged);
}
public bool IsEmptySelection => _selectedAffix == EmptySelection;
private string? _affixText;
public string? AffixText
{
get => _affixText;
private set => SetProperty(ref _affixText, value);
}
public IEnumerable<(int valueIndex, int value)> SelectedValues => _sliders.Select(s => (s.ValueIndex, s.Value));
private readonly ObservableCollection<SliderGroupViewModel> _sliderGroups =
new ObservableCollection<SliderGroupViewModel>();
public IEnumerable<SliderGroupViewModel> SliderGroups => _sliderGroups;
private readonly List<SliderViewModel> _sliders = new List<SliderViewModel>();
private bool _updatingSliders;
public ModSelectorViewModel(StatTranslator statTranslator, bool canDeselect = true)
{
_statTranslator = statTranslator;
CanDeselct = canDeselect;
}
private void OnSelectedAffixChanged()
{
_sliders.ForEach(s => s.ValueChanged -= SliderOnValueChanged);
_sliders.Clear();
_sliderGroups.Clear();
if (SelectedAffix != null && !IsEmptySelection)
{
var ids = new List<string>();
var idToIndex = new Dictionary<string, int>();
for (var i = 0; i < SelectedAffix.StatIds.Count; i++)
{
var statId = SelectedAffix.StatIds[i];
ids.Add(statId);
idToIndex[statId] = i;
}
var translations = _statTranslator.GetTranslations(ids);
var groups = new List<IReadOnlyList<int>>();
foreach (var translation in translations)
{
var translatedIndices = translation.Ids
.Where(id => idToIndex.ContainsKey(id))
.Select(id => idToIndex[id]).ToList();
groups.Add(translatedIndices);
}
foreach (var group in groups)
{
var sliderGroup = new List<SliderViewModel>();
foreach (var valueIndex in group)
{
var ranges = SelectedAffix.GetRanges(valueIndex);
var ticks = ranges.SelectMany(r => Enumerable.Range(r.From, r.To - r.From + 1))
.OrderBy(i => i).Distinct();
var slider = new SliderViewModel(valueIndex, ticks);
sliderGroup.Add(slider);
_sliders.Add(slider);
}
var translation = new DynamicTranslation(_statTranslator, SelectedAffix, group);
_sliderGroups.Add(new SliderGroupViewModel(sliderGroup, translation));
}
}
_sliders.ForEach(s => s.ValueChanged += SliderOnValueChanged);
if (_sliders.Count > 0)
{
SliderOnValueChanged(_sliders[0], new SliderValueChangedEventArgs(_sliders[0].Value, _sliders[0].Value));
}
else
{
AffixText = "";
}
}
private void SliderOnValueChanged(object? sender, SliderValueChangedEventArgs e)
{
if (_updatingSliders || sender is null)
return;
var slider = (SliderViewModel) sender;
IMod[] tiers = SelectedAffix.QueryModsSingleValue(slider.ValueIndex, e.NewValue)
.OrderBy(m => m.RequiredLevel).ToArray();
_updatingSliders = true;
foreach (var other in _sliders.Where(s => s != slider))
{
var iValue = other.ValueIndex;
if (!SelectedAffix.QueryModsSingleValue(iValue, other.Value).Intersect(tiers).Any())
{
// slider isn't inside current tier
Range<int> moveto = SelectedAffix.SelectStat(tiers[0], iValue).Range;
other.Value = (e.NewValue > e.OldValue) ? moveto.From : moveto.To;
}
}
_updatingSliders = false;
OnPropertyChanged("SelectedValues");
AffixText = string.Join("/", SelectedAffix.QueryMods(SelectedValues).Select(s => $"{s.Name}").Distinct());
}
public IMod Query()
=> SelectedAffix.QueryMods(SelectedValues).DefaultIfEmpty(SelectedAffix.DefaultMod).First();
public IEnumerable<StatIdValuePair> GetStatValues()
{
var firstMatch = SelectedAffix.QueryMods(SelectedValues).FirstOrDefault();
if (firstMatch == null)
{
return Enumerable.Empty<StatIdValuePair>();
}
return
from t in SelectedValues
let valueIndex = t.valueIndex
let value = t.value
let stat = SelectedAffix.SelectStat(firstMatch, valueIndex)
select new StatIdValuePair(stat.Id, value);
}
/// <summary>
/// Translation implementation that dynamically selects the stat id to translate based on the given values.
/// </summary>
private class DynamicTranslation : ITranslation
{
private readonly StatTranslator _statTranslator;
private readonly Affix _affix;
private readonly IReadOnlyList<int> _valueIndices;
public DynamicTranslation(StatTranslator statTranslator, Affix affix, IEnumerable<int> valueIndices)
{
_statTranslator = statTranslator;
_affix = affix;
_valueIndices = valueIndices.ToList();
}
public string? Translate(IReadOnlyList<int> values)
{
if (_valueIndices.Count != values.Count)
{
throw new ArgumentException("Number of values must match number of value indices");
}
var firstMatch = _valueIndices
.EquiZip(values, (i, v) => _affix.QueryModsSingleValue(i, v))
.Aggregate((a, ms) => a.Intersect(ms))
.FirstOrDefault();
if (firstMatch == null)
{
return null;
}
var idValueDict = _valueIndices
.Select(i => _affix.SelectStat(firstMatch, i).Id)
.EquiZip(values, Tuple.Create)
.ToDictionary(t => t.Item1, t => t.Item2);
return _statTranslator.GetTranslations(idValueDict).First();
}
}
}
} | {'content_hash': '89da04706f1cab3f76c19cc6428d06c0', 'timestamp': '', 'source': 'github', 'line_count': 264, 'max_line_length': 121, 'avg_line_length': 37.821969696969695, 'alnum_prop': 0.5202804206309464, 'repo_name': 'EmmittJ/PoESkillTree', 'id': '5aa423de851d909533cd905a1320faa4ecf25cb3', 'size': '9987', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'WPFSKillTree/ViewModels/Crafting/ModSelectorViewModel.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Batchfile', 'bytes': '3735'}, {'name': 'C#', 'bytes': '1827967'}, {'name': 'Inno Setup', 'bytes': '19895'}]} |
package rx;
import java.util.concurrent.TimeUnit;
import rx.functions.Action1;
/**
* Represents an object that schedules units of work.
* <p>
* The methods left to implement are:
* <ul>
* <li>{@code <T> Subscription schedule(T state, Func2<Scheduler, T, Subscription> action, long delayTime, TimeUnit unit)}</li>
* <li>{@code <T> Subscription schedule(T state, Func2<Scheduler, T, Subscription> action)}</li>
* </ul>
* <p>
* Why is this an abstract class instead of an interface?
* <p>
* <ol>
* <li>Java doesn't support extension methods and there are many overload methods needing default implementations.</li>
* <li>Virtual extension methods aren't available until Java8 which RxJava will not set as a minimum target for a long time.</li>
* <li>If only an interface were used Scheduler implementations would then need to extend from an AbstractScheduler pair that gives all of the functionality unless they intend on copy/pasting the
* functionality.</li>
* <li>Without virtual extension methods even additive changes are breaking and thus severely impede library maintenance.</li>
* </ol>
*/
public abstract class Scheduler {
/**
* Schedules an Action on a new Scheduler instance (typically another thread) for execution.
*
* @param action
* Action to schedule.
* @return a subscription to be able to unsubscribe from action.
*/
public abstract Subscription schedule(Action1<Scheduler.Inner> action);
/**
* Schedules an Action on a new Scheduler instance (typically another thread) for execution at some point in the future.
*
* @param action
* @param delayTime
* @param unit
* @return
*/
public abstract Subscription schedule(final Action1<Scheduler.Inner> action, final long delayTime, final TimeUnit unit);
/**
* Schedules a cancelable action to be executed periodically.
* This default implementation schedules recursively and waits for actions to complete (instead of potentially executing
* long-running actions concurrently). Each scheduler that can do periodic scheduling in a better way should override this.
*
* @param state
* State to pass into the action.
* @param action
* The action to execute periodically.
* @param initialDelay
* Time to wait before executing the action for the first time.
* @param period
* The time interval to wait each time in between executing the action.
* @param unit
* The time unit the interval above is given in.
* @return A subscription to be able to unsubscribe from action.
*/
public Subscription schedulePeriodically(final Action1<Scheduler.Inner> action, long initialDelay, long period, TimeUnit unit) {
final long periodInNanos = unit.toNanos(period);
final Action1<Scheduler.Inner> recursiveAction = new Action1<Scheduler.Inner>() {
@Override
public void call(Inner inner) {
if (!inner.isUnsubscribed()) {
long startedAt = now();
action.call(inner);
long timeTakenByActionInNanos = TimeUnit.MILLISECONDS.toNanos(now() - startedAt);
inner.schedule(this, periodInNanos - timeTakenByActionInNanos, TimeUnit.NANOSECONDS);
}
}
};
return schedule(recursiveAction, initialDelay, unit);
}
public final Subscription scheduleRecursive(final Action1<Recurse> action) {
return schedule(new Action1<Inner>() {
@Override
public void call(Inner inner) {
action.call(new Recurse(inner, action));
}
});
}
public static final class Recurse {
private final Action1<Recurse> action;
private final Inner inner;
private Recurse(Inner inner, Action1<Recurse> action) {
this.inner = inner;
this.action = action;
}
/**
* Schedule the current function for execution immediately.
*/
public final void schedule() {
final Recurse self = this;
inner.schedule(new Action1<Inner>() {
@Override
public void call(Inner _inner) {
action.call(self);
}
});
}
/**
* Schedule the current function for execution in the future.
*/
public final void schedule(long delay, TimeUnit unit) {
final Recurse self = this;
inner.schedule(new Action1<Inner>() {
@Override
public void call(Inner _inner) {
action.call(self);
}
}, delay, unit);
}
}
public abstract static class Inner implements Subscription {
/**
* Schedules an action to be executed in delayTime.
*
* @param delayTime
* Time the action is to be delayed before executing.
* @param unit
* Time unit of the delay time.
*/
public abstract void schedule(Action1<Scheduler.Inner> action, long delayTime, TimeUnit unit);
/**
* Schedules a cancelable action to be executed in delayTime.
*
*/
public abstract void schedule(Action1<Scheduler.Inner> action);
/**
* @return the scheduler's notion of current absolute time in milliseconds.
*/
public long now() {
return System.currentTimeMillis();
}
}
/**
* Parallelism available to a Scheduler.
* <p>
* This defaults to {@code Runtime.getRuntime().availableProcessors()} but can be overridden for use cases such as scheduling work on a computer cluster.
*
* @return the scheduler's available degree of parallelism.
*/
public int degreeOfParallelism() {
return Runtime.getRuntime().availableProcessors();
}
/**
* @return the scheduler's notion of current absolute time in milliseconds.
*/
public long now() {
return System.currentTimeMillis();
}
}
| {'content_hash': 'c25c06e5ee618189247477755825bf44', 'timestamp': '', 'source': 'github', 'line_count': 178, 'max_line_length': 195, 'avg_line_length': 35.061797752808985, 'alnum_prop': 0.6165678577151098, 'repo_name': 'devisnik/RxJava', 'id': '21d4791f44545b5843b4af480c96600cfe8e685d', 'size': '6837', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'rxjava-core/src/main/java/rx/Scheduler.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '2171'}, {'name': 'Clojure', 'bytes': '118625'}, {'name': 'Groovy', 'bytes': '62285'}, {'name': 'Java', 'bytes': '2864731'}, {'name': 'Kotlin', 'bytes': '25477'}, {'name': 'Ruby', 'bytes': '12912'}, {'name': 'Scala', 'bytes': '242959'}, {'name': 'Shell', 'bytes': '7394'}]} |
package org.geojson.jackson;
import static org.junit.Assert.*;
import java.util.List;
import org.geojson.LineString;
import org.geojson.LngLatAlt;
import org.geojson.MultiPoint;
import org.junit.Test;
import com.fasterxml.jackson.databind.ObjectMapper;
public class LineStringTest {
private ObjectMapper mapper = new ObjectMapper();
@Test
public void itShouldSerializeMultiPoint() throws Exception {
MultiPoint lineString = new LineString(new LngLatAlt(100, 0), new LngLatAlt(101, 1));
assertEquals("{\"type\":\"LineString\",\"coordinates\":[[100.0,0.0],[101.0,1.0]]}",
mapper.writeValueAsString(lineString));
}
@Test
public void itShouldDeserializeLineString() throws Exception {
LineString lineString = mapper.readValue("{\"type\":\"LineString\",\"coordinates\":[[100.0,0.0],[101.0,1.0]]}",
LineString.class);
assertNotNull(lineString);
List<LngLatAlt> coordinates = lineString.getCoordinates();
PointTest.assertLngLatAlt(100, 0, Double.NaN, coordinates.get(0));
PointTest.assertLngLatAlt(101, 1, Double.NaN, coordinates.get(1));
}
}
| {'content_hash': 'c38f24b1853f3a6cfabe550d013fa0c0', 'timestamp': '', 'source': 'github', 'line_count': 34, 'max_line_length': 113, 'avg_line_length': 31.558823529411764, 'alnum_prop': 0.7427772600186393, 'repo_name': 'opendatalab-de/gemeinde-api-mockup', 'id': '01dcc747a96777c89396ddf5d501e489589bb3ca', 'size': '1073', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'gemeinde-api-mockup/src/test/java/org/geojson/jackson/LineStringTest.java', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '14769'}, {'name': 'Java', 'bytes': '39981'}, {'name': 'JavaScript', 'bytes': '339654'}]} |
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
Blumea 43:372. 1998
#### Original name
null
### Remarks
null | {'content_hash': '2678af8d4002f41d20e9e09ae63b06d2', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 39, 'avg_line_length': 11.461538461538462, 'alnum_prop': 0.697986577181208, 'repo_name': 'mdoering/backbone', 'id': '84ae558e3cc04ad07d140cc16a7535567317e42f', 'size': '196', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'life/Plantae/Cycadophyta/Cycadopsida/Cycadales/Cycadaceae/Cycas/Cycas edentata/README.md', 'mode': '33188', 'license': 'apache-2.0', 'language': []} |
// Copyright (c) The Perspex Project. All rights reserved.
// Licensed under the MIT license. See licence.md file in the project root for full license information.
using Perspex.Markup.Data;
using Xunit;
namespace Perspex.Markup.UnitTests.Binding
{
public class ExpressionNodeBuilderTests_Errors
{
[Fact]
public void Identifier_Cannot_Start_With_Digit()
{
Assert.Throws<ExpressionParseException>(
() => ExpressionNodeBuilder.Build("1Foo"));
}
[Fact]
public void Identifier_Cannot_Start_With_Symbol()
{
Assert.Throws<ExpressionParseException>(
() => ExpressionNodeBuilder.Build("Foo.%Bar"));
}
[Fact]
public void Expression_Cannot_End_With_Period()
{
Assert.Throws<ExpressionParseException>(
() => ExpressionNodeBuilder.Build("Foo.Bar."));
}
[Fact]
public void Expression_Cannot_Have_Empty_Indexer()
{
Assert.Throws<ExpressionParseException>(
() => ExpressionNodeBuilder.Build("Foo.Bar[]"));
}
[Fact]
public void Expression_Cannot_Have_Extra_Comma_At_Start_Of_Indexer()
{
Assert.Throws<ExpressionParseException>(
() => ExpressionNodeBuilder.Build("Foo.Bar[,3,4]"));
}
[Fact]
public void Expression_Cannot_Have_Extra_Comma_In_Indexer()
{
Assert.Throws<ExpressionParseException>(
() => ExpressionNodeBuilder.Build("Foo.Bar[3,,4]"));
}
[Fact]
public void Expression_Cannot_Have_Extra_Comma_At_End_Of_Indexer()
{
Assert.Throws<ExpressionParseException>(
() => ExpressionNodeBuilder.Build("Foo.Bar[3,4,]"));
}
[Fact]
public void Expression_Cannot_Have_Digit_After_Indexer()
{
Assert.Throws<ExpressionParseException>(
() => ExpressionNodeBuilder.Build("Foo.Bar[3,4]5"));
}
[Fact]
public void Expression_Cannot_Have_Letter_After_Indexer()
{
Assert.Throws<ExpressionParseException>(
() => ExpressionNodeBuilder.Build("Foo.Bar[3,4]A"));
}
}
}
| {'content_hash': 'ec8a56dab7133c161ac17f12ceaf731f', 'timestamp': '', 'source': 'github', 'line_count': 74, 'max_line_length': 104, 'avg_line_length': 31.027027027027028, 'alnum_prop': 0.5722996515679443, 'repo_name': 'kekekeks/Perspex', 'id': '05af5175b6d1fe0ea3415e832fbae41fa6f8c685', 'size': '2298', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'tests/Perspex.Markup.UnitTests/Binding/ExpressionNodeBuilderTests_Errors.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C#', 'bytes': '2410185'}, {'name': 'PowerShell', 'bytes': '5349'}, {'name': 'Shell', 'bytes': '107'}, {'name': 'Smalltalk', 'bytes': '58936'}]} |
package org.gradle.test.performance.mediummonolithicjavaproject.p332;
public class Production6646 {
private String property0;
public String getProperty0() {
return property0;
}
public void setProperty0(String value) {
property0 = value;
}
private String property1;
public String getProperty1() {
return property1;
}
public void setProperty1(String value) {
property1 = value;
}
private String property2;
public String getProperty2() {
return property2;
}
public void setProperty2(String value) {
property2 = value;
}
private String property3;
public String getProperty3() {
return property3;
}
public void setProperty3(String value) {
property3 = value;
}
private String property4;
public String getProperty4() {
return property4;
}
public void setProperty4(String value) {
property4 = value;
}
private String property5;
public String getProperty5() {
return property5;
}
public void setProperty5(String value) {
property5 = value;
}
private String property6;
public String getProperty6() {
return property6;
}
public void setProperty6(String value) {
property6 = value;
}
private String property7;
public String getProperty7() {
return property7;
}
public void setProperty7(String value) {
property7 = value;
}
private String property8;
public String getProperty8() {
return property8;
}
public void setProperty8(String value) {
property8 = value;
}
private String property9;
public String getProperty9() {
return property9;
}
public void setProperty9(String value) {
property9 = value;
}
} | {'content_hash': '2ffde861ed63c29c87cbd13b31b7b04f', 'timestamp': '', 'source': 'github', 'line_count': 105, 'max_line_length': 69, 'avg_line_length': 18.00952380952381, 'alnum_prop': 0.6171337916446324, 'repo_name': 'oehme/analysing-gradle-performance', 'id': '99d65f8899ec38f94cd05d1716bb67a0fad2a14c', 'size': '1891', 'binary': False, 'copies': '1', 'ref': 'refs/heads/before', 'path': 'my-app/src/main/java/org/gradle/test/performance/mediummonolithicjavaproject/p332/Production6646.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '40770723'}]} |
@implementation SHKBuffer
#pragma mark -
#pragma mark Configuration : Service Defination
+ (NSString *)sharerTitle
{
return @"Buffer";
}
+ (BOOL)canShareURL
{
return YES;
}
+ (BOOL)canShareText
{
return YES;
}
+ (BOOL)canShareImage
{
return NO;
}
+ (BOOL)canShareOffline
{
// Offline sharing is built into the Buffer iOS SDK, plan to get this working within ShareKit soon!
return NO;
}
#pragma mark -
#pragma mark Configuration : Dynamic Enable
- (BOOL)shouldAutoShare
{
return NO;
}
- (BOOL)requiresShortenedURL
{
return !SHKCONFIG(bufferShouldShortenURLS);
}
#pragma mark -
#pragma mark Authorization
- (BOOL)isAuthorized {
// Buffer SDK handles authrorisation with Buffer.
return [BufferSDK isLoggedIn];
}
- (void)promptAuthorization {
// Buffer SDK handles authrorisation with Buffer, so display sheet even if not logged in.
BOOL shouldShortenURL = self.item.URL;
if (shouldShortenURL && [self requiresShortenedURL]) {
[self shortenURL];
return;
}
[self show];
}
+ (BOOL)handleOpenURL:(NSURL*)url {
[[BufferSDK sharedAPI] handleOpenURL:url];
return YES;
}
+(void)logout {
// Buffer SDK handles authrorisation with Buffer, call logout method on BufferSDK
[BufferSDK logout];
}
#pragma mark -
#pragma mark Show UI Methods
- (BOOL)send {
NSString *updateText = @"";
if (self.item.shareType == SHKShareTypeURL) {
NSString *url = [self.item.URL absoluteString];
if (self.item.text){
updateText = [NSString stringWithFormat:@"%@ %@", self.item.text, url];
} else if(self.item.title){
updateText = [NSString stringWithFormat:@"%@ %@", self.item.title, url];
} else {
updateText = url;
}
} else if (self.item.shareType == SHKShareTypeText) {
updateText = self.item.text;
}
[[BufferSDK sharedAPI] setClientID:SHKCONFIG(bufferClientID) andClientSecret:SHKCONFIG(bufferClientSecret)];
[[BufferSDK sharedAPI] shouldShortenURLS:SHKCONFIG(bufferShouldShortenURLS)];
// BufferSDKResources.bundle is contained within ShareKit.bundle so pass this to BufferSDK.
NSString *bundleRoot = [[NSBundle mainBundle] pathForResource:@"ShareKit" ofType:@"bundle"];
bundleRoot = [NSString stringWithFormat:@"%@/BufferSDKResources.bundle", bundleRoot];
[[BufferSDK sharedAPI] setResourceBundlePath:bundleRoot];
// Buffer presents the view using addChildViewController to display transparent modal.
[BufferSDK presentBufferSheetWithText:updateText completionBlock:^(NSDictionary *response) {
[self sendDidFinish];
}];
return YES;
}
@end
| {'content_hash': '40d350c9f7dce5499ca33f77c5b09f83', 'timestamp': '', 'source': 'github', 'line_count': 114, 'max_line_length': 112, 'avg_line_length': 23.50877192982456, 'alnum_prop': 0.683955223880597, 'repo_name': 'liuslevis/Gooru-iOS', 'id': '46a2d13c6654e693258d2dac37a9a540c5a28a37', 'size': '2890', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Submodules/ShareKit/Classes/ShareKit/Sharers/Services/Buffer/SHKBuffer.m', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C', 'bytes': '232143'}, {'name': 'C++', 'bytes': '5852'}, {'name': 'CSS', 'bytes': '3986'}, {'name': 'HTML', 'bytes': '3521724'}, {'name': 'Objective-C', 'bytes': '10510300'}, {'name': 'Python', 'bytes': '2080'}, {'name': 'Ruby', 'bytes': '7695'}, {'name': 'Shell', 'bytes': '35857'}]} |
@implementation SDCat
@end
| {'content_hash': '645066b5f9b32f0d7c1d1f6b9f03c887', 'timestamp': '', 'source': 'github', 'line_count': 3, 'max_line_length': 21, 'avg_line_length': 9.333333333333334, 'alnum_prop': 0.7857142857142857, 'repo_name': 'jisudong555/SDModelHandle', 'id': '06db483fcebc77cd402a0576ff6f64407d66a5b6', 'size': '172', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'SDModelHandle/SDCat.m', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Objective-C', 'bytes': '12923'}, {'name': 'Ruby', 'bytes': '1001'}]} |
<!-- This comment will put IE 6, 7 and 8 in quirks mode -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.6.3 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main Page</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<img id="MSearchSelect" src="search/search.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</div>
</li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="classes.html"><span>Class Index</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
</div>
<div class="contents">
<h1>tetramesh_stats_t Member List</h1>This is the complete list of members for <a class="el" href="structtetramesh__stats__t.html">tetramesh_stats_t</a>, including all inherited members.<table>
<tr class="memlist"><td><a class="el" href="structtetramesh__stats__t.html#a1bda0dc1342c6129540352be52225899">avg_edge_len</a></td><td><a class="el" href="structtetramesh__stats__t.html">tetramesh_stats_t</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="structtetramesh__stats__t.html#aa73891c1f7b2e88fb4f097e813e4ea9c">avg_skewness</a></td><td><a class="el" href="structtetramesh__stats__t.html">tetramesh_stats_t</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="structtetramesh__stats__t.html#a6a39a6301b2257aba7e438f8087340da">avg_volume</a></td><td><a class="el" href="structtetramesh__stats__t.html">tetramesh_stats_t</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="structtetramesh__stats__t.html#adc9d72666ebb6eae6e3f85aab6c24216">max_edge_len</a></td><td><a class="el" href="structtetramesh__stats__t.html">tetramesh_stats_t</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="structtetramesh__stats__t.html#a4ec194b967fa534a6f0ce194399166b1">max_skewness</a></td><td><a class="el" href="structtetramesh__stats__t.html">tetramesh_stats_t</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="structtetramesh__stats__t.html#affe8b399e5ea71886bf947afb971afd0">max_volume</a></td><td><a class="el" href="structtetramesh__stats__t.html">tetramesh_stats_t</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="structtetramesh__stats__t.html#a7131c4aa8b3d666903351244a5fe2179">min_edge_len</a></td><td><a class="el" href="structtetramesh__stats__t.html">tetramesh_stats_t</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="structtetramesh__stats__t.html#ab8fca538ff420261d9b95f5fa9ddea1e">min_skewness</a></td><td><a class="el" href="structtetramesh__stats__t.html">tetramesh_stats_t</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="structtetramesh__stats__t.html#a3da25e8cfd25d3c5db9797dfa56ba830">min_volume</a></td><td><a class="el" href="structtetramesh__stats__t.html">tetramesh_stats_t</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="structtetramesh__stats__t.html#ad06580f872ca515cd1c04d754bb5ac77">num_edges</a></td><td><a class="el" href="structtetramesh__stats__t.html">tetramesh_stats_t</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="structtetramesh__stats__t.html#ab6de8284b2d47a329cb4643a63cf6b93">num_tetrahedra</a></td><td><a class="el" href="structtetramesh__stats__t.html">tetramesh_stats_t</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="structtetramesh__stats__t.html#afecaa443ff6ccbc339cd48489fd7d951">num_vertices</a></td><td><a class="el" href="structtetramesh__stats__t.html">tetramesh_stats_t</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="structtetramesh__stats__t.html#aaa14821109fcd2cdf49ed8e4cc368167">std_edge_len</a></td><td><a class="el" href="structtetramesh__stats__t.html">tetramesh_stats_t</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="structtetramesh__stats__t.html#a57c699b5d94bebb33b726773fa8e7997">std_skewness</a></td><td><a class="el" href="structtetramesh__stats__t.html">tetramesh_stats_t</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="structtetramesh__stats__t.html#a398e67e0fff1c301ce3be6b840518851">std_volume</a></td><td><a class="el" href="structtetramesh__stats__t.html">tetramesh_stats_t</a></td><td></td></tr>
</table></div>
<!--- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Defines</a></div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<hr class="footer"/><address style="text-align: right;"><small>Generated on Wed Apr 18 11:36:55 2012 by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>
</body>
</html>
| {'content_hash': '52762e2688daecf102017e9bb2b8b02e', 'timestamp': '', 'source': 'github', 'line_count': 82, 'max_line_length': 957, 'avg_line_length': 91.0609756097561, 'alnum_prop': 0.6844783715012722, 'repo_name': 'madratman/riss_bingham', 'id': '66766c2b30dd2b469df03799a222655f70e7155c', 'size': '7467', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'c/doc/html/structtetramesh__stats__t-members.html', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'C', 'bytes': '17198129'}, {'name': 'C++', 'bytes': '22178342'}, {'name': 'CSS', 'bytes': '14525'}, {'name': 'Fortran', 'bytes': '285254'}, {'name': 'HTML', 'bytes': '3452018'}, {'name': 'Java', 'bytes': '36102'}, {'name': 'JavaScript', 'bytes': '22349'}, {'name': 'Lua', 'bytes': '29317'}, {'name': 'M', 'bytes': '3179'}, {'name': 'Makefile', 'bytes': '7138'}, {'name': 'Mathematica', 'bytes': '465'}, {'name': 'Matlab', 'bytes': '3540588'}, {'name': 'Mercury', 'bytes': '201'}, {'name': 'Perl', 'bytes': '2698'}, {'name': 'R', 'bytes': '2166'}]} |
/* Layout helpers
----------------------------------*/
.ui-helper-hidden {
display: none;
}
.ui-helper-hidden-accessible {
border: 0;
clip: rect(0 0 0 0);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
}
.ui-helper-reset {
margin: 0;
padding: 0;
border: 0;
outline: 0;
line-height: 1.3;
text-decoration: none;
font-size: 100%;
list-style: none;
}
.ui-helper-clearfix:before,
.ui-helper-clearfix:after {
content: "";
display: table;
border-collapse: collapse;
}
.ui-helper-clearfix:after {
clear: both;
}
.ui-helper-clearfix {
min-height: 0; /* support: IE7 */
}
.ui-helper-zfix {
width: 100%;
height: 100%;
top: 0;
left: 0;
position: absolute;
opacity: 0;
filter:Alpha(Opacity=0);
}
.ui-front {
z-index: 100;
}
/* Interaction Cues
----------------------------------*/
.ui-state-disabled {
cursor: default !important;
}
/* Icons
----------------------------------*/
/* states and images */
.ui-icon {
display: block;
text-indent: -99999px;
overflow: hidden;
background-repeat: no-repeat;
}
/* Misc visuals
----------------------------------*/
/* Overlays */
.ui-widget-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.ui-resizable {
position: relative;
}
.ui-resizable-handle {
position: absolute;
font-size: 0.1px;
display: block;
}
.ui-resizable-disabled .ui-resizable-handle,
.ui-resizable-autohide .ui-resizable-handle {
display: none;
}
.ui-resizable-n {
cursor: n-resize;
height: 7px;
width: 100%;
top: -5px;
left: 0;
}
.ui-resizable-s {
cursor: s-resize;
height: 7px;
width: 100%;
bottom: -5px;
left: 0;
}
.ui-resizable-e {
cursor: e-resize;
width: 7px;
right: -5px;
top: 0;
height: 100%;
}
.ui-resizable-w {
cursor: w-resize;
width: 7px;
left: -5px;
top: 0;
height: 100%;
}
.ui-resizable-se {
cursor: se-resize;
width: 12px;
height: 12px;
right: 1px;
bottom: 1px;
}
.ui-resizable-sw {
cursor: sw-resize;
width: 9px;
height: 9px;
left: -5px;
bottom: -5px;
}
.ui-resizable-nw {
cursor: nw-resize;
width: 9px;
height: 9px;
left: -5px;
top: -5px;
}
.ui-resizable-ne {
cursor: ne-resize;
width: 9px;
height: 9px;
right: -5px;
top: -5px;
}
.ui-selectable-helper {
position: absolute;
z-index: 100;
border: 1px dotted black;
}
.ui-accordion .ui-accordion-header {
display: block;
cursor: pointer;
position: relative;
margin-top: 2px;
padding: .5em .5em .5em .7em;
min-height: 0; /* support: IE7 */
}
.ui-accordion .ui-accordion-icons {
padding-left: 2.2em;
}
.ui-accordion .ui-accordion-noicons {
padding-left: .7em;
}
.ui-accordion .ui-accordion-icons .ui-accordion-icons {
padding-left: 2.2em;
}
.ui-accordion .ui-accordion-header .ui-accordion-header-icon {
position: absolute;
left: .5em;
top: 50%;
margin-top: -8px;
}
.ui-accordion .ui-accordion-content {
padding: 1em 2.2em;
border-top: 0;
overflow: auto;
}
.ui-autocomplete {
position: absolute;
top: 0;
left: 0;
cursor: default;
}
.ui-button {
display: inline-block;
position: relative;
padding: 0;
line-height: normal;
margin-right: .1em;
cursor: pointer;
vertical-align: middle;
text-align: center;
overflow: visible; /* removes extra width in IE */
}
.ui-button,
.ui-button:link,
.ui-button:visited,
.ui-button:hover,
.ui-button:active {
text-decoration: none;
}
/* to make room for the icon, a width needs to be set here */
.ui-button-icon-only {
width: 2.2em;
}
/* button elements seem to need a little more width */
button.ui-button-icon-only {
width: 2.4em;
}
.ui-button-icons-only {
width: 3.4em;
}
button.ui-button-icons-only {
width: 3.7em;
}
/* button text element */
.ui-button .ui-button-text {
display: block;
line-height: normal;
}
.ui-button-text-only .ui-button-text {
padding: .4em 1em;
}
.ui-button-icon-only .ui-button-text,
.ui-button-icons-only .ui-button-text {
padding: .4em;
text-indent: -9999999px;
}
.ui-button-text-icon-primary .ui-button-text,
.ui-button-text-icons .ui-button-text {
padding: .4em 1em .4em 2.1em;
}
.ui-button-text-icon-secondary .ui-button-text,
.ui-button-text-icons .ui-button-text {
padding: .4em 2.1em .4em 1em;
}
.ui-button-text-icons .ui-button-text {
padding-left: 2.1em;
padding-right: 2.1em;
}
/* no icon support for input elements, provide padding by default */
input.ui-button {
padding: .4em 1em;
}
/* button icon element(s) */
.ui-button-icon-only .ui-icon,
.ui-button-text-icon-primary .ui-icon,
.ui-button-text-icon-secondary .ui-icon,
.ui-button-text-icons .ui-icon,
.ui-button-icons-only .ui-icon {
position: absolute;
top: 50%;
margin-top: -8px;
}
.ui-button-icon-only .ui-icon {
left: 50%;
margin-left: -8px;
}
.ui-button-text-icon-primary .ui-button-icon-primary,
.ui-button-text-icons .ui-button-icon-primary,
.ui-button-icons-only .ui-button-icon-primary {
left: .5em;
}
.ui-button-text-icon-secondary .ui-button-icon-secondary,
.ui-button-text-icons .ui-button-icon-secondary,
.ui-button-icons-only .ui-button-icon-secondary {
right: .5em;
}
/* button sets */
.ui-buttonset {
margin-right: 7px;
}
.ui-buttonset .ui-button {
margin-left: 0;
margin-right: -.3em;
}
/* workarounds */
/* reset extra padding in Firefox, see h5bp.com/l */
input.ui-button::-moz-focus-inner,
button.ui-button::-moz-focus-inner {
border: 0;
padding: 0;
}
.ui-datepicker {
width: 17em;
padding: .2em .2em 0;
display: none;
}
.ui-datepicker .ui-datepicker-header {
position: relative;
padding: .2em 0;
}
.ui-datepicker .ui-datepicker-prev,
.ui-datepicker .ui-datepicker-next {
position: absolute;
top: 2px;
width: 1.8em;
height: 1.8em;
}
.ui-datepicker .ui-datepicker-prev-hover,
.ui-datepicker .ui-datepicker-next-hover {
top: 1px;
}
.ui-datepicker .ui-datepicker-prev {
left: 2px;
}
.ui-datepicker .ui-datepicker-next {
right: 2px;
}
.ui-datepicker .ui-datepicker-prev-hover {
left: 1px;
}
.ui-datepicker .ui-datepicker-next-hover {
right: 1px;
}
.ui-datepicker .ui-datepicker-prev span,
.ui-datepicker .ui-datepicker-next span {
display: block;
position: absolute;
left: 50%;
margin-left: -8px;
top: 50%;
margin-top: -8px;
}
.ui-datepicker .ui-datepicker-title {
margin: 0 2.3em;
line-height: 1.8em;
text-align: center;
}
.ui-datepicker .ui-datepicker-title select {
font-size: 1em;
margin: 1px 0;
}
.ui-datepicker select.ui-datepicker-month-year {
width: 100%;
}
.ui-datepicker select.ui-datepicker-month,
.ui-datepicker select.ui-datepicker-year {
width: 49%;
}
.ui-datepicker table {
width: 100%;
font-size: .9em;
border-collapse: collapse;
margin: 0 0 .4em;
}
.ui-datepicker th {
padding: .7em .3em;
text-align: center;
font-weight: normal;
border: 0;
}
.ui-datepicker td {
border: 0;
padding: 1px;
}
.ui-datepicker td span,
.ui-datepicker td a {
display: block;
padding: .2em;
text-align: right;
text-decoration: none;
}
.ui-datepicker .ui-datepicker-buttonpane {
background-image: none;
margin: .7em 0 0 0;
padding: 0 .2em;
border-left: 0;
border-right: 0;
border-bottom: 0;
}
.ui-datepicker .ui-datepicker-buttonpane button {
float: right;
margin: .5em .2em .4em;
cursor: pointer;
padding: .2em .6em .3em .6em;
width: auto;
overflow: visible;
}
.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current {
float: left;
}
/* with multiple calendars */
.ui-datepicker.ui-datepicker-multi {
width: auto;
}
.ui-datepicker-multi .ui-datepicker-group {
float: left;
}
.ui-datepicker-multi .ui-datepicker-group table {
width: 95%;
margin: 0 auto .4em;
}
.ui-datepicker-multi-2 .ui-datepicker-group {
width: 50%;
}
.ui-datepicker-multi-3 .ui-datepicker-group {
width: 33.3%;
}
.ui-datepicker-multi-4 .ui-datepicker-group {
width: 25%;
}
.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,
.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header {
border-left-width: 0;
}
.ui-datepicker-multi .ui-datepicker-buttonpane {
clear: left;
}
.ui-datepicker-row-break {
clear: both;
width: 100%;
font-size: 0;
}
/* RTL support */
.ui-datepicker-rtl {
direction: rtl;
}
.ui-datepicker-rtl .ui-datepicker-prev {
right: 2px;
left: auto;
}
.ui-datepicker-rtl .ui-datepicker-next {
left: 2px;
right: auto;
}
.ui-datepicker-rtl .ui-datepicker-prev:hover {
right: 1px;
left: auto;
}
.ui-datepicker-rtl .ui-datepicker-next:hover {
left: 1px;
right: auto;
}
.ui-datepicker-rtl .ui-datepicker-buttonpane {
clear: right;
}
.ui-datepicker-rtl .ui-datepicker-buttonpane button {
float: left;
}
.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,
.ui-datepicker-rtl .ui-datepicker-group {
float: right;
}
.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,
.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header {
border-right-width: 0;
border-left-width: 1px;
}
.ui-dialog {
position: absolute;
top: 0;
left: 0;
padding: .2em;
outline: 0;
}
.ui-dialog .ui-dialog-titlebar {
padding: .4em 1em;
position: relative;
}
.ui-dialog .ui-dialog-title {
float: left;
margin: .1em 0;
white-space: nowrap;
width: 90%;
overflow: hidden;
text-overflow: ellipsis;
}
.ui-dialog .ui-dialog-titlebar-close {
position: absolute;
right: .3em;
top: 50%;
width: 21px;
margin: -10px 0 0 0;
padding: 1px;
height: 20px;
}
.ui-dialog .ui-dialog-content {
position: relative;
border: 0;
padding: .5em 1em;
background: none;
overflow: auto;
}
.ui-dialog .ui-dialog-buttonpane {
text-align: left;
border-width: 1px 0 0 0;
background-image: none;
margin-top: .5em;
padding: .3em 1em .5em .4em;
}
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
float: right;
}
.ui-dialog .ui-dialog-buttonpane button {
margin: .5em .4em .5em 0;
cursor: pointer;
}
.ui-dialog .ui-resizable-se {
width: 12px;
height: 12px;
right: -5px;
bottom: -5px;
background-position: 16px 16px;
}
.ui-draggable .ui-dialog-titlebar {
cursor: move;
}
.ui-menu {
list-style: none;
padding: 2px;
margin: 0;
display: block;
outline: none;
}
.ui-menu .ui-menu {
margin-top: -3px;
position: absolute;
}
.ui-menu .ui-menu-item {
margin: 0;
padding: 0;
width: 100%;
/* support: IE10, see #8844 */
list-style-image: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);
}
.ui-menu .ui-menu-divider {
margin: 5px -2px 5px -2px;
height: 0;
font-size: 0;
line-height: 0;
border-width: 1px 0 0 0;
}
.ui-menu .ui-menu-item a {
text-decoration: none;
display: block;
padding: 2px .4em;
line-height: 1.5;
min-height: 0; /* support: IE7 */
font-weight: normal;
}
.ui-menu .ui-menu-item a.ui-state-focus,
.ui-menu .ui-menu-item a.ui-state-active {
font-weight: normal;
margin: -1px;
}
.ui-menu .ui-state-disabled {
font-weight: normal;
margin: .4em 0 .2em;
line-height: 1.5;
}
.ui-menu .ui-state-disabled a {
cursor: default;
}
/* icon support */
.ui-menu-icons {
position: relative;
}
.ui-menu-icons .ui-menu-item a {
position: relative;
padding-left: 2em;
}
/* left-aligned */
.ui-menu .ui-icon {
position: absolute;
top: .2em;
left: .2em;
}
/* right-aligned */
.ui-menu .ui-menu-icon {
position: static;
float: right;
}
.ui-progressbar {
height: 2em;
text-align: left;
overflow: hidden;
}
.ui-progressbar .ui-progressbar-value {
margin: -1px;
height: 100%;
}
.ui-progressbar .ui-progressbar-overlay {
background: url("images/animated-overlay.gif");
height: 100%;
filter: alpha(opacity=25);
opacity: 0.25;
}
.ui-progressbar-indeterminate .ui-progressbar-value {
background-image: none;
}
.ui-slider {
position: relative;
text-align: left;
}
.ui-slider .ui-slider-handle {
position: absolute;
z-index: 2;
width: 1.2em;
height: 1.2em;
cursor: default;
}
.ui-slider .ui-slider-range {
position: absolute;
z-index: 1;
font-size: .7em;
display: block;
border: 0;
background-position: 0 0;
}
/* For IE8 - See #6727 */
.ui-slider.ui-state-disabled .ui-slider-handle,
.ui-slider.ui-state-disabled .ui-slider-range {
filter: inherit;
}
.ui-slider-horizontal {
height: .8em;
}
.ui-slider-horizontal .ui-slider-handle {
top: -.3em;
margin-left: -.6em;
}
.ui-slider-horizontal .ui-slider-range {
top: 0;
height: 100%;
}
.ui-slider-horizontal .ui-slider-range-min {
left: 0;
}
.ui-slider-horizontal .ui-slider-range-max {
right: 0;
}
.ui-slider-vertical {
width: .8em;
height: 100px;
}
.ui-slider-vertical .ui-slider-handle {
left: -.3em;
margin-left: 0;
margin-bottom: -.6em;
}
.ui-slider-vertical .ui-slider-range {
left: 0;
width: 100%;
}
.ui-slider-vertical .ui-slider-range-min {
bottom: 0;
}
.ui-slider-vertical .ui-slider-range-max {
top: 0;
}
.ui-spinner {
position: relative;
display: inline-block;
overflow: hidden;
padding: 0;
vertical-align: middle;
}
.ui-spinner-input {
border: none;
background: none;
color: inherit;
padding: 0;
margin: .2em 0;
vertical-align: middle;
margin-left: .4em;
margin-right: 22px;
}
.ui-spinner-button {
width: 16px;
height: 50%;
font-size: .5em;
padding: 0;
margin: 0;
text-align: center;
position: absolute;
cursor: default;
display: block;
overflow: hidden;
right: 0;
}
/* more specificity required here to overide default borders */
.ui-spinner a.ui-spinner-button {
border-top: none;
border-bottom: none;
border-right: none;
}
/* vertical centre icon */
.ui-spinner .ui-icon {
position: absolute;
margin-top: -8px;
top: 50%;
left: 0;
}
.ui-spinner-up {
top: 0;
}
.ui-spinner-down {
bottom: 0;
}
/* TR overrides */
.ui-spinner .ui-icon-triangle-1-s {
/* need to fix icons sprite */
background-position: -65px -16px;
}
.ui-tabs {
position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
padding: .2em;
}
.ui-tabs .ui-tabs-nav {
margin: 0;
padding: .2em .2em 0;
}
.ui-tabs .ui-tabs-nav li {
list-style: none;
float: left;
position: relative;
top: 0;
margin: 1px .2em 0 0;
border-bottom-width: 0;
padding: 0;
white-space: nowrap;
}
.ui-tabs .ui-tabs-nav li a {
float: left;
padding: .5em 1em;
text-decoration: none;
}
.ui-tabs .ui-tabs-nav li.ui-tabs-active {
margin-bottom: -1px;
padding-bottom: 1px;
}
.ui-tabs .ui-tabs-nav li.ui-tabs-active a,
.ui-tabs .ui-tabs-nav li.ui-state-disabled a,
.ui-tabs .ui-tabs-nav li.ui-tabs-loading a {
cursor: text;
}
.ui-tabs .ui-tabs-nav li a, /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active a {
cursor: pointer;
}
.ui-tabs .ui-tabs-panel {
display: block;
border-width: 0;
padding: 1em 1.4em;
background: none;
}
.ui-tooltip {
padding: 8px;
position: absolute;
z-index: 9999;
max-width: 300px;
-webkit-box-shadow: 0 0 5px #aaa;
box-shadow: 0 0 5px #aaa;
}
body .ui-tooltip {
border-width: 2px;
}
/* Component containers
----------------------------------*/
.ui-widget {
font-family: Trebuchet MS,Tahoma,Verdana,Arial,sans-serif;
font-size: 1.1em;
}
.ui-widget .ui-widget {
font-size: 1em;
}
.ui-widget input,
.ui-widget select,
.ui-widget textarea,
.ui-widget button {
font-family: Trebuchet MS,Tahoma,Verdana,Arial,sans-serif;
font-size: 1em;
}
.ui-widget-content {
/* change by John */
border: 1px solid #e3e3e3;
background: #ffffff 50% 50% repeat-x;
color: #222222;
}
.ui-widget-content a {
color: #222222;
}
.ui-widget-header {
/* change by John */
border: 1px solid #e3e3e3;
background: #cccccc 50% 50% repeat-x;
color: #222222;
font-weight: normal;
}
.ui-widget-header a {
color: #222222;
}
/* Interaction states
----------------------------------*/
.ui-state-default,
.ui-widget-content .ui-state-default,
.ui-widget-header .ui-state-default {
/* change by John */
border: 1px solid #e3e3e3;
background: #f5f5f5 50% 50% repeat-x;
font-weight: normal;
color: #555555;
}
.ui-state-default a,
.ui-state-default a:link,
.ui-state-default a:visited {
color: #555555;
text-decoration: none;
}
.ui-state-hover,
.ui-widget-content .ui-state-hover,
.ui-widget-header .ui-state-hover,
.ui-state-focus,
.ui-widget-content .ui-state-focus,
.ui-widget-header .ui-state-focus {
/* change by John */
border: 1px solid #e3e3e3;
background: #dadada 50% 50% repeat-x !important;
font-weight: normal;
color: #212121;
}
.ui-state-hover a,
.ui-state-hover a:hover,
.ui-state-hover a:link,
.ui-state-hover a:visited {
color: #212121;
text-decoration: none;
}
.ui-state-active,
.ui-widget-content .ui-state-active,
.ui-widget-header .ui-state-active {
/* change by John */
border: 1px solid #e3e3e3;
background:#ffffff 50% 50% repeat-x;
font-weight: normal;
color: #212121;
}
.ui-state-active a,
.ui-state-active a:link,
.ui-state-active a:visited {
color: #212121;
text-decoration: none;
}
/* Interaction Cues
----------------------------------*/
.ui-state-highlight,
.ui-widget-content .ui-state-highlight,
.ui-widget-header .ui-state-highlight {
/* change by John */
border: 1px solid #dadada;
background: #ABA0FD 50% 50% repeat-x !important;
color: #363636;
}
.ui-state-highlight a,
.ui-widget-content .ui-state-highlight a,
.ui-widget-header .ui-state-highlight a {
color: #363636;
}
.ui-state-error,
.ui-widget-content .ui-state-error,
.ui-widget-header .ui-state-error {
/* change by John */
border: 1px solid #cd0a0a;
background: #fef1ec 50% 50% repeat-x;
color: #cd0a0a;
}
.ui-state-error a,
.ui-widget-content .ui-state-error a,
.ui-widget-header .ui-state-error a {
color: #cd0a0a;
}
.ui-state-error-text,
.ui-widget-content .ui-state-error-text,
.ui-widget-header .ui-state-error-text {
color: #cd0a0a;
}
.ui-priority-primary,
.ui-widget-content .ui-priority-primary,
.ui-widget-header .ui-priority-primary {
font-weight: normal;
}
/* change by John */
/* .ui-priority-secondary, */
/* .ui-widget-content .ui-priority-secondary, */
/* .ui-widget-header .ui-priority-secondary { */
/* opacity: .7; */
/* filter:Alpha(Opacity=70); */
/* font-weight: normal; */
/* } */
.ui-priority-secondary,
.ui-widget-content
.ui-priority-secondary {
font-weight: normal;
background: #f9f9f9 50% 50% repeat-x;
}
/*-----chengkun-----------*/
.altclass, .ui-widget-content .altclass { font-weight: normal; background: #d9edf7 50% 50% repeat-x; }
.ui-state-disabled,
.ui-widget-content .ui-state-disabled,
.ui-widget-header .ui-state-disabled {
opacity: .35;
filter:Alpha(Opacity=35);
background-image: none;
}
.ui-state-disabled .ui-icon {
filter:Alpha(Opacity=35); /* For IE8 - See #6059 */
}
/* Icons
----------------------------------*/
/* states and images */
.ui-icon {
width: 16px;
height: 16px;
}
.ui-icon,
.ui-widget-content .ui-icon {
background-image: url(images/ui-icons_222222_256x240.png);
}
.ui-widget-header .ui-icon {
background-image: url(images/ui-icons_ffffff_256x240.png);
}
.ui-state-default .ui-icon {
background-image: url(images/ui-icons_228ef1_256x240.png);
}
.ui-state-hover .ui-icon,
.ui-state-focus .ui-icon {
background-image: url(images/ui-icons_228ef1_256x240.png);
}
.ui-state-active .ui-icon {
background-image: url(images/ui-icons_228ef1_256x240.png);
}
.ui-state-highlight .ui-icon {
background-image: url(images/ui-icons_228ef1_256x240.png);
}
.ui-state-error .ui-icon,
.ui-state-error-text .ui-icon {
background-image: url(images/ui-icons_ffd27a_256x240.png);
}
/* positioning */
.ui-icon-blank { background-position: 16px 16px; }
.ui-icon-carat-1-n { background-position: 0 0; }
.ui-icon-carat-1-ne { background-position: -16px 0; }
.ui-icon-carat-1-e { background-position: -32px 0; }
.ui-icon-carat-1-se { background-position: -48px 0; }
.ui-icon-carat-1-s { background-position: -64px 0; }
.ui-icon-carat-1-sw { background-position: -80px 0; }
.ui-icon-carat-1-w { background-position: -96px 0; }
.ui-icon-carat-1-nw { background-position: -112px 0; }
.ui-icon-carat-2-n-s { background-position: -128px 0; }
.ui-icon-carat-2-e-w { background-position: -144px 0; }
.ui-icon-triangle-1-n { background-position: 0 -16px; }
.ui-icon-triangle-1-ne { background-position: -16px -16px; }
.ui-icon-triangle-1-e { background-position: -32px -16px; }
.ui-icon-triangle-1-se { background-position: -48px -16px; }
.ui-icon-triangle-1-s { background-position: -64px -16px; }
.ui-icon-triangle-1-sw { background-position: -80px -16px; }
.ui-icon-triangle-1-w { background-position: -96px -16px; }
.ui-icon-triangle-1-nw { background-position: -112px -16px; }
.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
.ui-icon-arrow-1-n { background-position: 0 -32px; }
.ui-icon-arrow-1-ne { background-position: -16px -32px; }
.ui-icon-arrow-1-e { background-position: -32px -32px; }
.ui-icon-arrow-1-se { background-position: -48px -32px; }
.ui-icon-arrow-1-s { background-position: -64px -32px; }
.ui-icon-arrow-1-sw { background-position: -80px -32px; }
.ui-icon-arrow-1-w { background-position: -96px -32px; }
.ui-icon-arrow-1-nw { background-position: -112px -32px; }
.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
.ui-icon-arrow-4 { background-position: 0 -80px; }
.ui-icon-arrow-4-diag { background-position: -16px -80px; }
.ui-icon-extlink { background-position: -32px -80px; }
.ui-icon-newwin { background-position: -48px -80px; }
.ui-icon-refresh { background-position: -64px -80px; }
.ui-icon-shuffle { background-position: -80px -80px; }
.ui-icon-transfer-e-w { background-position: -96px -80px; }
.ui-icon-transferthick-e-w { background-position: -112px -80px; }
.ui-icon-folder-collapsed { background-position: 0 -96px; }
.ui-icon-folder-open { background-position: -16px -96px; }
.ui-icon-document { background-position: -32px -96px; }
.ui-icon-document-b { background-position: -48px -96px; }
.ui-icon-note { background-position: -64px -96px; }
.ui-icon-mail-closed { background-position: -80px -96px; }
.ui-icon-mail-open { background-position: -96px -96px; }
.ui-icon-suitcase { background-position: -112px -96px; }
.ui-icon-comment { background-position: -128px -96px; }
.ui-icon-person { background-position: -144px -96px; }
.ui-icon-print { background-position: -160px -96px; }
.ui-icon-trash { background-position: -176px -96px; }
.ui-icon-locked { background-position: -192px -96px; }
.ui-icon-unlocked { background-position: -208px -96px; }
.ui-icon-bookmark { background-position: -224px -96px; }
.ui-icon-tag { background-position: -240px -96px; }
.ui-icon-home { background-position: 0 -112px; }
.ui-icon-flag { background-position: -16px -112px; }
.ui-icon-calendar { background-position: -32px -112px; }
.ui-icon-cart { background-position: -48px -112px; }
.ui-icon-pencil { background-position: -64px -112px; }
.ui-icon-clock { background-position: -80px -112px; }
.ui-icon-disk { background-position: -96px -112px; }
.ui-icon-calculator { background-position: -112px -112px; }
.ui-icon-zoomin { background-position: -128px -112px; }
.ui-icon-zoomout { background-position: -144px -112px; }
.ui-icon-search { background-position: -160px -112px; }
.ui-icon-wrench { background-position: -176px -112px; }
.ui-icon-gear { background-position: -192px -112px; }
.ui-icon-heart { background-position: -208px -112px; }
.ui-icon-star { background-position: -224px -112px; }
.ui-icon-link { background-position: -240px -112px; }
.ui-icon-cancel { background-position: 0 -128px; }
.ui-icon-plus { background-position: -16px -128px; }
.ui-icon-plusthick { background-position: -32px -128px; }
.ui-icon-minus { background-position: -48px -128px; }
.ui-icon-minusthick { background-position: -64px -128px; }
.ui-icon-close { background-position: -80px -128px; }
.ui-icon-closethick { background-position: -96px -128px; }
.ui-icon-key { background-position: -112px -128px; }
.ui-icon-lightbulb { background-position: -128px -128px; }
.ui-icon-scissors { background-position: -144px -128px; }
.ui-icon-clipboard { background-position: -160px -128px; }
.ui-icon-copy { background-position: -176px -128px; }
.ui-icon-contact { background-position: -192px -128px; }
.ui-icon-image { background-position: -208px -128px; }
.ui-icon-video { background-position: -224px -128px; }
.ui-icon-script { background-position: -240px -128px; }
.ui-icon-alert { background-position: 0 -144px; }
.ui-icon-info { background-position: -16px -144px; }
.ui-icon-notice { background-position: -32px -144px; }
.ui-icon-help { background-position: -48px -144px; }
.ui-icon-check { background-position: -64px -144px; }
.ui-icon-bullet { background-position: -80px -144px; }
.ui-icon-radio-on { background-position: -96px -144px; }
.ui-icon-radio-off { background-position: -112px -144px; }
.ui-icon-pin-w { background-position: -128px -144px; }
.ui-icon-pin-s { background-position: -144px -144px; }
.ui-icon-play { background-position: 0 -160px; }
.ui-icon-pause { background-position: -16px -160px; }
.ui-icon-seek-next { background-position: -32px -160px; }
.ui-icon-seek-prev { background-position: -48px -160px; }
.ui-icon-seek-end { background-position: -64px -160px; }
.ui-icon-seek-start { background-position: -80px -160px; }
/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
.ui-icon-seek-first { background-position: -80px -160px; }
.ui-icon-stop { background-position: -96px -160px; }
.ui-icon-eject { background-position: -112px -160px; }
.ui-icon-volume-off { background-position: -128px -160px; }
.ui-icon-volume-on { background-position: -144px -160px; }
.ui-icon-power { background-position: 0 -176px; }
.ui-icon-signal-diag { background-position: -16px -176px; }
.ui-icon-signal { background-position: -32px -176px; }
.ui-icon-battery-0 { background-position: -48px -176px; }
.ui-icon-battery-1 { background-position: -64px -176px; }
.ui-icon-battery-2 { background-position: -80px -176px; }
.ui-icon-battery-3 { background-position: -96px -176px; }
.ui-icon-circle-plus { background-position: 0 -192px; }
.ui-icon-circle-minus { background-position: -16px -192px; }
.ui-icon-circle-close { background-position: -32px -192px; }
.ui-icon-circle-triangle-e { background-position: -48px -192px; }
.ui-icon-circle-triangle-s { background-position: -64px -192px; }
.ui-icon-circle-triangle-w { background-position: -80px -192px; }
.ui-icon-circle-triangle-n { background-position: -96px -192px; }
.ui-icon-circle-arrow-e { background-position: -112px -192px; }
.ui-icon-circle-arrow-s { background-position: -128px -192px; }
.ui-icon-circle-arrow-w { background-position: -144px -192px; }
.ui-icon-circle-arrow-n { background-position: -160px -192px; }
.ui-icon-circle-zoomin { background-position: -176px -192px; }
.ui-icon-circle-zoomout { background-position: -192px -192px; }
.ui-icon-circle-check { background-position: -208px -192px; }
.ui-icon-circlesmall-plus { background-position: 0 -208px; }
.ui-icon-circlesmall-minus { background-position: -16px -208px; }
.ui-icon-circlesmall-close { background-position: -32px -208px; }
.ui-icon-squaresmall-plus { background-position: -48px -208px; }
.ui-icon-squaresmall-minus { background-position: -64px -208px; }
.ui-icon-squaresmall-close { background-position: -80px -208px; }
.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
/* Misc visuals
----------------------------------*/
/* Corner radius */
.ui-corner-all,
.ui-corner-top,
.ui-corner-left,
.ui-corner-tl {
border-top-left-radius: 4px;
}
.ui-corner-all,
.ui-corner-top,
.ui-corner-right,
.ui-corner-tr {
border-top-right-radius: 4px;
}
.ui-corner-all,
.ui-corner-bottom,
.ui-corner-left,
.ui-corner-bl {
border-bottom-left-radius: 4px;
}
.ui-corner-all,
.ui-corner-bottom,
.ui-corner-right,
.ui-corner-br {
border-bottom-right-radius: 4px;
}
/* Overlays */
.ui-widget-overlay {
/* change by John */
background:#e3e3e3 50% 50% repeat-x;
opacity: .5;
filter: Alpha(Opacity=50);
}
.ui-widget-shadow {
margin: -5px 0 0 -5px;
padding: 5px;
/* change by John */
background: #e3e3e3 50% 50% repeat-x;
opacity: .2;
filter: Alpha(Opacity=20);
border-radius: 5px;
}
| {'content_hash': '8c02f3f12240d857ddeddab36f5dc556', 'timestamp': '', 'source': 'github', 'line_count': 1193, 'max_line_length': 165, 'avg_line_length': 25.522212908633698, 'alnum_prop': 0.6859892275354703, 'repo_name': 'javahuang/rp', 'id': '6112c4d212b9a58761ba63741663e795cd3d7354', 'size': '32325', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'rp-web/src/main/webapp/WEB-INF/static/comp/jquery/css/jquery-ui-1.10.3.custom.css', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '587173'}, {'name': 'HTML', 'bytes': '518031'}, {'name': 'Java', 'bytes': '656339'}, {'name': 'JavaScript', 'bytes': '3211065'}, {'name': 'PHP', 'bytes': '9366'}]} |
* Based on/uses the official [Debian Docker image](https://hub.docker.com/_/debian/).
* Configures default global credentials: root/mysql
## Creating an Image
```bash
docker build -t mysql:latest .
```
## Creating a Container
```bash
docker run -d --name mysql -p 0.0.0.0:4306:3306 mysql:latest
```
| {'content_hash': '627dfbae8f88256e1619c6f426fa585c', 'timestamp': '', 'source': 'github', 'line_count': 14, 'max_line_length': 85, 'avg_line_length': 21.642857142857142, 'alnum_prop': 0.6996699669966997, 'repo_name': 'jjcosgrove/docker-mysql', 'id': '29d51c068b40fd95b23027d235ef727ff76672f6', 'size': '339', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'README.md', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Shell', 'bytes': '165'}]} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Code Coverage for /home/administrateur/Projects/Money/src/currency/MYR.php</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="../css/bootstrap.min.css" rel="stylesheet">
<link href="../css/style.css" rel="stylesheet">
<!--[if lt IE 9]>
<script src="../js/html5shiv.min.js"></script>
<script src="../js/respond.min.js"></script>
<![endif]-->
</head>
<body>
<header>
<div class="container">
<div class="row">
<div class="col-md-12">
<ol class="breadcrumb">
<li><a href="../index.html">/home/administrateur/Projects/Money/src</a></li>
<li><a href="index.html">currency</a></li>
<li class="active">MYR.php</li>
</ol>
</div>
</div>
</div>
</header>
<div class="container">
<table class="table table-bordered">
<thead>
<tr>
<td> </td>
<td colspan="10"><div align="center"><strong>Code Coverage</strong></div></td>
</tr>
<tr>
<td> </td>
<td colspan="3"><div align="center"><strong>Classes and Traits</strong></div></td>
<td colspan="4"><div align="center"><strong>Functions and Methods</strong></div></td>
<td colspan="3"><div align="center"><strong>Lines</strong></div></td>
</tr>
</thead>
<tbody>
<tr>
<td class="success">Total</td>
<td class="success big"> <div class="progress">
<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="100.00" aria-valuemin="0" aria-valuemax="100" style="width: 100.00%">
<span class="sr-only">100.00% covered (success)</span>
</div>
</div>
</td>
<td class="success small"><div align="right">100.00%</div></td>
<td class="success small"><div align="right">1 / 1</div></td>
<td class="success big"> <div class="progress">
<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="100.00" aria-valuemin="0" aria-valuemax="100" style="width: 100.00%">
<span class="sr-only">100.00% covered (success)</span>
</div>
</div>
</td>
<td class="success small"><div align="right">100.00%</div></td>
<td class="success small"><div align="right">0 / 0</div></td>
<td class="success small"><abbr title="Change Risk Anti-Patterns (CRAP) Index">CRAP</abbr></td>
<td class="success big"> <div class="progress">
<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="100.00" aria-valuemin="0" aria-valuemax="100" style="width: 100.00%">
<span class="sr-only">100.00% covered (success)</span>
</div>
</div>
</td>
<td class="success small"><div align="right">100.00%</div></td>
<td class="success small"><div align="right">0 / 0</div></td>
</tr>
<tr>
<td class="success">MYR</td>
<td class="success big"> <div class="progress">
<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="100.00" aria-valuemin="0" aria-valuemax="100" style="width: 100.00%">
<span class="sr-only">100.00% covered (success)</span>
</div>
</div>
</td>
<td class="success small"><div align="right">100.00%</div></td>
<td class="success small"><div align="right">1 / 1</div></td>
<td class="success big"> <div class="progress">
<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="100.00" aria-valuemin="0" aria-valuemax="100" style="width: 100.00%">
<span class="sr-only">100.00% covered (success)</span>
</div>
</div>
</td>
<td class="success small"><div align="right">100.00%</div></td>
<td class="success small"><div align="right">1 / 1</div></td>
<td class="success small">1</td>
<td class="success big"> <div class="progress">
<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="100.00" aria-valuemin="0" aria-valuemax="100" style="width: 100.00%">
<span class="sr-only">100.00% covered (success)</span>
</div>
</div>
</td>
<td class="success small"><div align="right">100.00%</div></td>
<td class="success small"><div align="right">0 / 0</div></td>
</tr>
<tr>
<td class="success" colspan="4"> <a href="#23"><abbr title="__construct($amount)">__construct</abbr></a></td>
<td class="success big"> <div class="progress">
<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="100.00" aria-valuemin="0" aria-valuemax="100" style="width: 100.00%">
<span class="sr-only">100.00% covered (success)</span>
</div>
</div>
</td>
<td class="success small"><div align="right">100.00%</div></td>
<td class="success small"><div align="right">1 / 1</div></td>
<td class="success small">1</td>
<td class="success big"> <div class="progress">
<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="100.00" aria-valuemin="0" aria-valuemax="100" style="width: 100.00%">
<span class="sr-only">100.00% covered (success)</span>
</div>
</div>
</td>
<td class="success small"><div align="right">100.00%</div></td>
<td class="success small"><div align="right">0 / 0</div></td>
</tr>
</tbody>
</table>
<table id="code" class="table table-borderless table-condensed">
<tbody>
<tr><td><div align="right"><a name="1"></a><a href="#1">1</a></div></td><td class="codeLine"><span class="default"><?php</span></td></tr>
<tr><td><div align="right"><a name="2"></a><a href="#2">2</a></div></td><td class="codeLine"><span class="comment"></span></td></tr>
<tr><td><div align="right"><a name="10"></a><a href="#10">10</a></div></td><td class="codeLine"></td></tr>
<tr><td><div align="right"><a name="11"></a><a href="#11">11</a></div></td><td class="codeLine"><span class="keyword">namespace</span><span class="default"> </span><span class="default">SebastianBergmann</span><span class="default">\</span><span class="default">Money</span><span class="keyword">;</span></td></tr>
<tr><td><div align="right"><a name="12"></a><a href="#12">12</a></div></td><td class="codeLine"></td></tr>
<tr><td><div align="right"><a name="13"></a><a href="#13">13</a></div></td><td class="codeLine"><span class="comment">/**</span></td></tr>
<tr><td><div align="right"><a name="14"></a><a href="#14">14</a></div></td><td class="codeLine"><span class="comment"> * @package Money</span></td></tr>
<tr><td><div align="right"><a name="15"></a><a href="#15">15</a></div></td><td class="codeLine"><span class="comment"> * @author Sebastian Bergmann <[email protected]></span></td></tr>
<tr><td><div align="right"><a name="16"></a><a href="#16">16</a></div></td><td class="codeLine"><span class="comment"> * @copyright Sebastian Bergmann <[email protected]></span></td></tr>
<tr><td><div align="right"><a name="17"></a><a href="#17">17</a></div></td><td class="codeLine"><span class="comment"> * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License</span></td></tr>
<tr><td><div align="right"><a name="18"></a><a href="#18">18</a></div></td><td class="codeLine"><span class="comment"> * @since Class available since Release 1.3.0</span></td></tr>
<tr><td><div align="right"><a name="19"></a><a href="#19">19</a></div></td><td class="codeLine"><span class="comment"> * @codeCoverageIgnore</span></td></tr>
<tr><td><div align="right"><a name="20"></a><a href="#20">20</a></div></td><td class="codeLine"><span class="comment"> */</span></td></tr>
<tr><td><div align="right"><a name="21"></a><a href="#21">21</a></div></td><td class="codeLine"><span class="keyword">class</span><span class="default"> </span><span class="default">MYR</span><span class="default"> </span><span class="keyword">extends</span><span class="default"> </span><span class="default">Money</span></td></tr>
<tr><td><div align="right"><a name="22"></a><a href="#22">22</a></div></td><td class="codeLine"><span class="keyword">{</span></td></tr>
<tr><td><div align="right"><a name="23"></a><a href="#23">23</a></div></td><td class="codeLine"><span class="default"> </span><span class="keyword">public</span><span class="default"> </span><span class="keyword">function</span><span class="default"> </span><span class="default">__construct</span><span class="keyword">(</span><span class="default">$amount</span><span class="keyword">)</span></td></tr>
<tr><td><div align="right"><a name="24"></a><a href="#24">24</a></div></td><td class="codeLine"><span class="default"> </span><span class="keyword">{</span></td></tr>
<tr><td><div align="right"><a name="25"></a><a href="#25">25</a></div></td><td class="codeLine"><span class="default"> </span><span class="default">parent</span><span class="default">::</span><span class="default">__construct</span><span class="keyword">(</span><span class="default">$amount</span><span class="keyword">,</span><span class="default"> </span><span class="keyword">new</span><span class="default"> </span><span class="default">Currency</span><span class="keyword">(</span><span class="default">'MYR'</span><span class="keyword">)</span><span class="keyword">)</span><span class="keyword">;</span></td></tr>
<tr><td><div align="right"><a name="26"></a><a href="#26">26</a></div></td><td class="codeLine"><span class="default"> </span><span class="keyword">}</span></td></tr>
<tr><td><div align="right"><a name="27"></a><a href="#27">27</a></div></td><td class="codeLine"><span class="keyword">}</span></td></tr>
</tbody>
</table>
<footer>
<hr/>
<h4>Legend</h4>
<p>
<span class="success"><strong>Executed</strong></span>
<span class="danger"><strong>Not Executed</strong></span>
<span class="warning"><strong>Dead Code</strong></span>
</p>
<p>
<small>Generated by <a href="http://github.com/sebastianbergmann/php-code-coverage" target="_top">PHP_CodeCoverage 3.3.0</a> using <a href="http://php.net/" target="_top">PHP 5.6.4-4ubuntu6.4</a> and <a href="https://phpunit.de/">PHPUnit 5.3.1</a> at Thu Apr 14 14:28:15 CEST 2016.</small>
</p>
<a title="Back to the top" id="toplink" href="#"><span class="glyphicon glyphicon-arrow-up"></span></a>
</footer>
</div>
<script src="../js/jquery.min.js" type="text/javascript"></script>
<script src="../js/bootstrap.min.js" type="text/javascript"></script>
<script src="../js/holder.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
var $window = $(window)
, $top_link = $('#toplink')
, $body = $('body, html')
, offset = $('#code').offset().top;
$top_link.hide().click(function(event) {
event.preventDefault();
$body.animate({scrollTop:0}, 800);
});
$window.scroll(function() {
if($window.scrollTop() > offset) {
$top_link.fadeIn();
} else {
$top_link.fadeOut();
}
}).scroll();
$('.popin').popover({trigger: 'hover'});
});
</script>
</body>
</html>
| {'content_hash': 'd7c8b052e19850d13c937ef0d3ee2e52', 'timestamp': '', 'source': 'github', 'line_count': 192, 'max_line_length': 683, 'avg_line_length': 61.484375, 'alnum_prop': 0.6012706480304956, 'repo_name': 'fey89/Money', 'id': '60cba7fc29de4adba64b24d995667f6e25e939c6', 'size': '13191', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'build/coverage/currency/MYR.php.html', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'CSS', 'bytes': '14670'}, {'name': 'HTML', 'bytes': '3524520'}, {'name': 'JavaScript', 'bytes': '41952'}, {'name': 'PHP', 'bytes': '225819'}, {'name': 'Smarty', 'bytes': '743'}]} |
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.schema;
import com.yahoo.config.model.test.MockApplicationPackage;
import com.yahoo.documentmodel.NewDocumentReferenceDataType;
import com.yahoo.schema.document.SDDocumentType;
import com.yahoo.schema.document.SDField;
import com.yahoo.schema.document.TemporarySDField;
import org.junit.jupiter.api.Test;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static java.util.stream.Collectors.toList;
import static org.junit.jupiter.api.Assertions.*;
/**
* @author bjorncs
*/
public class DocumentGraphValidatorTest {
@Test
void simple_ref_dag_is_allowed() {
Schema advertiserSchema = createSearchWithName("advertiser");
Schema campaignSchema = createSearchWithName("campaign");
Schema adSchema = createSearchWithName("ad");
createDocumentReference(adSchema, advertiserSchema, "advertiser_ref");
createDocumentReference(adSchema, campaignSchema, "campaign_ref");
DocumentGraphValidator validator = new DocumentGraphValidator();
validator.validateDocumentGraph(documentListOf(advertiserSchema, campaignSchema, adSchema));
}
@Test
void simple_inheritance_dag_is_allowed() {
Schema grandfather = createSearchWithName("grandfather");
Schema father = createSearchWithName("father", grandfather);
Schema son = createSearchWithName("son", father);
DocumentGraphValidator validator = new DocumentGraphValidator();
validator.validateDocumentGraph(documentListOf(son, father, grandfather));
}
@Test
void complex_dag_is_allowed() {
Schema grandfather = createSearchWithName("grandfather");
Schema father = createSearchWithName("father", grandfather);
Schema mother = createSearchWithName("mother", grandfather);
createDocumentReference(father, mother, "wife_ref");
Schema son = createSearchWithName("son", father, mother);
Schema daughter = createSearchWithName("daughter", father, mother);
createDocumentReference(daughter, son, "brother_ref");
Schema randomGuy1 = createSearchWithName("randomguy1");
Schema randomGuy2 = createSearchWithName("randomguy2");
createDocumentReference(randomGuy1, mother, "secret_ref");
DocumentGraphValidator validator = new DocumentGraphValidator();
validator.validateDocumentGraph(documentListOf(son, father, grandfather, son, daughter, randomGuy1, randomGuy2));
}
@Test
void ref_cycle_is_forbidden() {
Throwable exception = assertThrows(DocumentGraphValidator.DocumentGraphException.class, () -> {
Schema schema1 = createSearchWithName("doc1");
Schema schema2 = createSearchWithName("doc2");
Schema schema3 = createSearchWithName("doc3");
createDocumentReference(schema1, schema2, "ref_2");
createDocumentReference(schema2, schema3, "ref_3");
createDocumentReference(schema3, schema1, "ref_1");
DocumentGraphValidator validator = new DocumentGraphValidator();
validator.validateDocumentGraph(documentListOf(schema1, schema2, schema3));
});
assertTrue(exception.getMessage().contains("Document dependency cycle detected: doc1->doc2->doc3->doc1."));
}
@Test
void inherit_cycle_is_forbidden() {
Throwable exception = assertThrows(DocumentGraphValidator.DocumentGraphException.class, () -> {
Schema schema1 = createSearchWithName("doc1");
Schema schema2 = createSearchWithName("doc2", schema1);
Schema schema3 = createSearchWithName("doc3", schema2);
schema1.getDocument().inherit(schema3.getDocument());
DocumentGraphValidator validator = new DocumentGraphValidator();
validator.validateDocumentGraph(documentListOf(schema1, schema2, schema3));
});
assertTrue(exception.getMessage().contains("Document dependency cycle detected: doc1->doc3->doc2->doc1."));
}
@Test
void combined_inherit_and_ref_cycle_is_forbidden() {
Throwable exception = assertThrows(DocumentGraphValidator.DocumentGraphException.class, () -> {
Schema schema1 = createSearchWithName("doc1");
Schema schema2 = createSearchWithName("doc2", schema1);
Schema schema3 = createSearchWithName("doc3", schema2);
createDocumentReference(schema1, schema3, "ref_1");
DocumentGraphValidator validator = new DocumentGraphValidator();
validator.validateDocumentGraph(documentListOf(schema1, schema2, schema3));
});
assertTrue(exception.getMessage().contains("Document dependency cycle detected: doc1->doc3->doc2->doc1."));
}
@Test
void self_reference_is_forbidden() {
Throwable exception = assertThrows(DocumentGraphValidator.DocumentGraphException.class, () -> {
Schema adSchema = createSearchWithName("ad");
createDocumentReference(adSchema, adSchema, "ad_ref");
DocumentGraphValidator validator = new DocumentGraphValidator();
validator.validateDocumentGraph(documentListOf(adSchema));
});
assertTrue(exception.getMessage().contains("Document dependency cycle detected: ad->ad."));
}
/**
* Self inheritance is checked early because it is possible, and because it otherwise
* produces a stack overflow before getting to graph validation.
*/
@Test
void self_inheritance_forbidden() {
try {
Schema adSchema = createSearchWithName("ad");
SDDocumentType document = adSchema.getDocument();
document.inherit(document);
fail("Expected exception");
}
catch (IllegalArgumentException e) {
assertEquals("Document type 'ad' cannot inherit itself", e.getMessage());
}
}
private static List<SDDocumentType> documentListOf(Schema... schemas) {
return Arrays.stream(schemas).map(Schema::getDocument).collect(toList());
}
private static Schema createSearchWithName(String name, Schema... parents) {
Schema campaignSchema = new Schema(name, MockApplicationPackage.createEmpty());
SDDocumentType document = new SDDocumentType(name);
campaignSchema.addDocument(document);
document.setDocumentReferences(new DocumentReferences(Collections.emptyMap()));
Arrays.stream(parents)
.map(Schema::getDocument)
.forEach(document::inherit);
return campaignSchema;
}
@SuppressWarnings("deprecation")
private static void createDocumentReference(Schema from, Schema to, String refFieldName) {
SDDocumentType fromDocument = from.getDocument();
SDField refField = new TemporarySDField(fromDocument, refFieldName, NewDocumentReferenceDataType.forDocumentName(to.getName()));
fromDocument.addField(refField);
Map<String, DocumentReference> originalMap = fromDocument.getDocumentReferences().get().referenceMap();
HashMap<String, DocumentReference> modifiedMap = new HashMap<>(originalMap);
modifiedMap.put(refFieldName, new DocumentReference(refField, to));
fromDocument.setDocumentReferences(new DocumentReferences(modifiedMap));
}
}
| {'content_hash': 'ac407bf2caab802e9cf8a6778136cbc1', 'timestamp': '', 'source': 'github', 'line_count': 163, 'max_line_length': 136, 'avg_line_length': 45.75460122699386, 'alnum_prop': 0.7007240547063556, 'repo_name': 'vespa-engine/vespa', 'id': 'ccfa5c51a169a0a967f2d0fda58aba00839a27de', 'size': '7458', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'config-model/src/test/java/com/yahoo/schema/DocumentGraphValidatorTest.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'ANTLR', 'bytes': '8130'}, {'name': 'C', 'bytes': '60315'}, {'name': 'C++', 'bytes': '29580035'}, {'name': 'CMake', 'bytes': '593981'}, {'name': 'Emacs Lisp', 'bytes': '91'}, {'name': 'GAP', 'bytes': '3312'}, {'name': 'Go', 'bytes': '560664'}, {'name': 'HTML', 'bytes': '54520'}, {'name': 'Java', 'bytes': '40814190'}, {'name': 'JavaScript', 'bytes': '73436'}, {'name': 'LLVM', 'bytes': '6152'}, {'name': 'Lex', 'bytes': '11499'}, {'name': 'Makefile', 'bytes': '5553'}, {'name': 'Objective-C', 'bytes': '12369'}, {'name': 'Perl', 'bytes': '23134'}, {'name': 'Python', 'bytes': '52392'}, {'name': 'Roff', 'bytes': '17506'}, {'name': 'Ruby', 'bytes': '10690'}, {'name': 'Shell', 'bytes': '268737'}, {'name': 'Yacc', 'bytes': '14735'}]} |
package org.wso2.developerstudio.eclipse.gmf.esb.impl;
import org.eclipse.emf.ecore.EClass;
import org.wso2.developerstudio.eclipse.gmf.esb.EsbPackage;
import org.wso2.developerstudio.eclipse.gmf.esb.SendMediatorOutputConnector;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Send Mediator Output Connector</b></em>'.
* <!-- end-user-doc -->
*
* @generated
*/
public class SendMediatorOutputConnectorImpl extends OutputConnectorImpl implements SendMediatorOutputConnector {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected SendMediatorOutputConnectorImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return EsbPackage.Literals.SEND_MEDIATOR_OUTPUT_CONNECTOR;
}
} //SendMediatorOutputConnectorImpl
| {'content_hash': 'b52ceebd483f1e31679b0a6f90349440', 'timestamp': '', 'source': 'github', 'line_count': 37, 'max_line_length': 113, 'avg_line_length': 23.89189189189189, 'alnum_prop': 0.7013574660633484, 'repo_name': 'susinda/devstudio-tooling-esb', 'id': 'fcbac44f99b9b8b2594580487a4eb388422db4cd', 'size': '933', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'plugins/org.wso2.developerstudio.eclipse.gmf.esb/src/org/wso2/developerstudio/eclipse/gmf/esb/impl/SendMediatorOutputConnectorImpl.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '41190583'}, {'name': 'Shell', 'bytes': '6640'}]} |
'''
Original author: XY Feng
Edited by: Ishank Sharma
'''
import dlib
import numpy as np
import os
import glob
import cv2
FOLDER_PATH = "/normal"
IMAGE_FORMAT = "jpg"
REFERENCE_PATH = "resz0.jpg"
SCALE_FACTOR = 1
PREDICTOR_PATH = "face_landmarks.dat"
#FACE_POINTS = list(range(17, 68))
RIGHT_EYE_POINTS = list(range(36, 42))
LEFT_EYE_POINTS = list(range(42, 48))
NOSE_POINTS = list(range(27, 35))
#JAW_POINTS = list(range(0, 17))
#MOUTH_POINTS = list(range(48, 61))
#RIGHT_BROW_POINTS = list(range(17, 22))
#LEFT_BROW_POINTS = list(range(22, 27))
ALIGN_POINTS = (RIGHT_EYE_POINTS + LEFT_EYE_POINTS + NOSE_POINTS)
detector=dlib.get_frontal_face_detector()
predictor=dlib.shape_predictor(PREDICTOR_PATH)
def get_landmarks(im,fname):
rects = detector(im, 1)
maxbb=max(rects, key=lambda rect: rect.width() * rect.height())
return np.matrix([[p.x, p.y] for p in predictor(im, maxbb).parts()])
def transformation_from_points(points1, points2):
"""
Return an affine transformation [s * R | T] such that:
sum ||s*R*p1,i + T - p2,i||^2
is minimized.
"""
# Solve the procrustes problem by subtracting centroids, scaling by the
# standard deviation, and then using the SVD to calculate the rotation. See
# the following for more details:
# https://en.wikipedia.org/wiki/Orthogonal_Procrustes_problem
points1 = points1.astype(np.float64)
points2 = points2.astype(np.float64)
c1 = np.mean(points1, axis=0)
c2 = np.mean(points2, axis=0)
points1 -= c1
points2 -= c2
s1 = np.std(points1)
s2 = np.std(points2)
points1 /= s1
points2 /= s2
U, S, Vt = np.linalg.svd(points1.T * points2)
R = (U * Vt).T
return np.vstack([np.hstack(((s2 / s1) * R,c2.T - (s2 / s1) * R * c1.T)),np.matrix([0., 0., 1.])])
def read_im_and_landmarks(fname):
im = cv2.imread(fname, cv2.IMREAD_COLOR)
try:
s = get_landmarks(im,fname)
return im, s
except:
return im,fname
def nobox(img):
cv2.imwrite('g_nor_nobox_'+ str(img_index)+'.jpg', img)
def warp_im(im, M, dshape):
output_im = np.zeros(dshape, dtype=im.dtype)
cv2.warpAffine(im,M[:2],(dshape[1], dshape[0]),dst=output_im,borderMode=cv2.BORDER_TRANSPARENT,flags=cv2.WARP_INVERSE_MAP)
return output_im
img_ref, landmark_ref = read_im_and_landmarks(REFERENCE_PATH)
img_index = 0
for f in glob.glob(os.path.join(FOLDER_PATH, "*." + IMAGE_FORMAT)):
print("Processing file: {}".format(f))
img_index += 1
img, landmark = read_im_and_landmarks(f)
try:
M = transformation_from_points(landmark_ref[ALIGN_POINTS],landmark[ALIGN_POINTS])
warped_im2 = warp_im(img, M, img_ref.shape)
cv2.imwrite('g_nor_align_'+str(img_index)+'.jpg', warped_im2)
except:
nobox(img)
| {'content_hash': '5523e5d10223eb1a6f42890852caf0d5', 'timestamp': '', 'source': 'github', 'line_count': 104, 'max_line_length': 126, 'avg_line_length': 27.08653846153846, 'alnum_prop': 0.6435924742634008, 'repo_name': 'ishank26/Kutils', 'id': 'd989a50c7a8c54cc75ba60e2833ee9f1b7291d65', 'size': '2817', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'img/preprocess/face_align2.py', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Python', 'bytes': '22620'}]} |
<?php
include('controller.php');
class ExaminationController extends Controller
{
protected function index()
{
GLOBAL $user;
GLOBAL $objPDO;
$student=new student($objPDO,$user->getuserId());
$headMenu=array(
"username"=>$student->getName(),
);
if($user->checkAdmin()==true)
{
include($_SERVER['DOCUMENT_ROOT'].'/cloud/view/examination_home.php');
}
else if($student->checkTeacher())
{
include($_SERVER['DOCUMENT_ROOT'].'/cloud/view/employee_examination_home.php');
}
else
{
header('Location:http://localhost/cloud');
}
}
protected function marksplit()
{
GLOBAL $user;
GLOBAL $objPDO;
$student=new student($objPDO,$user->getuserId());
$headMenu=array(
"username"=>$student->getName(),
);
if($user->checkAdmin()==true)
{
include($_SERVER['DOCUMENT_ROOT'].'/cloud/view/mark_split_view.php');
}
else
{
header('Location:http://localhost/cloud');
}
}
protected function savesplitup()
{
$required=array(
"exam_id"=>"Examination Name",
);
GLOBAL $user;
if($user->checkAdmin()==true)
{
if(isset($_POST))
{
foreach($required as $key=>$value)
{
if(!isset($_POST[$key]) || $_POST[$key]=='' || $_POST[$key]=='select')
{
echo $value.' is Required<br/>';
return;
}
}
echo 'Saving...';
GLOBAL $objPDO;
require_once($_SERVER['DOCUMENT_ROOT'].'/cloud/model/marks_splitup_class.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/cloud/model/examination_section_subject_class.php');
$rel=new ExaminationSectionSubject($objPDO);
$exam_id=$_POST['exam_id'];
$section_id=$_POST['section'];
$subject_id=$_POST['subject'];
$rel->setExaminationId($exam_id);
$rel->setSectionId($section_id);
$rel->setSubjectId($subject_id);
$sub_exam_id=$rel->getIDByElems();
foreach($_POST['split'] as $key=>$value)
{
$split=new MarksSplitUp($objPDO);
$split->setExamSubjectId($sub_exam_id);
$split->setSplitUpValue($value);
$split->setSplitUpName($_POST['split_name'][$key]);
$split->save();
}
echo '<meta http-equiv="Refresh" content="0;url=http://localhost/cloud/examination/selectsubjects"/>';
}
}
else
{
header('Location:http://localhost/cloud');
}
}
protected function timetableview()
{
GLOBAL $user;
GLOBAL $objPDO;
$student=new student($objPDO,$user->getuserId());
$headMenu=array(
"username"=>$student->getName(),
);
if($user->checkAdmin()==true || $student->checkTeacher())
{
$role=$student->getacctType();
include($_SERVER['DOCUMENT_ROOT'].'/cloud/view/examination_timetable_view.php');
}
else
{
header('Location:http://localhost/cloud');
}
}
protected function marking()
{
GLOBAL $user;
GLOBAL $objPDO;
$student=new student($objPDO,$user->getuserId());
$headMenu=array(
"username"=>$student->getName(),
);
if($user->checkAdmin()==true || $student->checkTeacher())
{
$role=$student->getacctType();
include($_SERVER['DOCUMENT_ROOT'].'/cloud/model/examination_section_subject_class.php');
include($_SERVER['DOCUMENT_ROOT'].'/cloud/model/subject_class.php');
include($_SERVER['DOCUMENT_ROOT'].'/cloud/model/section_class.php');
include($_SERVER['DOCUMENT_ROOT'].'/cloud/view/examination_marking.php');
}
else
{
header('Location:http://localhost/cloud');
}
}
protected function getsectionlist()
{
GLOBAL $user;
GLOBAL $objPDO;
$student=new student($objPDO,$user->getuserId());
$headMenu=array(
"username"=>$student->getName(),
);
if(($user->checkAdmin()==true || $student->checkTeacher())&& isset($_GET['uid']))
{
$role=$student->getacctType();
include($_SERVER['DOCUMENT_ROOT'].'/cloud/model/examination_section_subject_class.php');
include($_SERVER['DOCUMENT_ROOT'].'/cloud/model/section_class.php');
$rel=new ExaminationSectionSubject($objPDO);
$exam_id=$_GET['uid'];
$sec_sub=$rel->getByExamId($exam_id);
$sections=array();
$sec=new Section($objPDO);
$section_name=$sec->getSectionArray();
foreach($sec_sub as $key=>$value)
{
$sections[$key]=$section_name[$key];
}
include($_SERVER['DOCUMENT_ROOT'].'/cloud/view/examination_section_subject_lists.php');
}
else
{
header('Location:http://localhost/cloud');
}
}
protected function getsubjectlist()
{
GLOBAL $user;
GLOBAL $objPDO;
$student=new student($objPDO,$user->getuserId());
$headMenu=array(
"username"=>$student->getName(),
);
if(($user->checkAdmin()==true|| $student->checkTeacher()) && isset($_GET['uid'])&& isset($_GET['ref']))
{
$role=$student->getacctType();
include($_SERVER['DOCUMENT_ROOT'].'/cloud/model/examination_section_subject_class.php');
include($_SERVER['DOCUMENT_ROOT'].'/cloud/controller/utility_class.php');
include($_SERVER['DOCUMENT_ROOT'].'/cloud/model/subject_class.php');
$rel=new ExaminationSectionSubject($objPDO);
$exam_id=$_GET['uid'];
$section_id=$_GET['ref'];
$sec_sub=$rel->getSectionExams($exam_id,$section_id);
$sub=new Subject($objPDO);
$subject_name=$sub->getSubjectArray();
$subjects=array();
foreach($sec_sub as $key=>$value)
{
$subjects[$value]=$subject_name[$value];
}
Utility::dropDownList('subject','subject','','text',$subjects);
}
else
{
header('Location:http://localhost/cloud');
}
}
protected function markinglist()
{
GLOBAL $user;
GLOBAL $objPDO;
$student=new student($objPDO,$user->getuserId());
$headMenu=array(
"username"=>$student->getName(),
);
if(($user->checkAdmin()==true || $student->checkTeacher())&& isset($_POST['exam_id'])&& isset($_POST['section']) && isset($_POST['subject']) )
{
$role=$student->getacctType();
include($_SERVER['DOCUMENT_ROOT'].'/cloud/model/student_section_class.php');
include($_SERVER['DOCUMENT_ROOT'].'/cloud/model/examination_section_subject_class.php');
include($_SERVER['DOCUMENT_ROOT'].'/cloud/model/marks_splitup_class.php');
include($_SERVER['DOCUMENT_ROOT'].'/cloud/model/student_profile_class.php');
$rel=new ExaminationSectionSubject($objPDO);
$exam_id=$_POST['exam_id'];
$section_id=$_POST['section'];
$subject_id=$_POST['subject'];
$rel->setExaminationId($exam_id);
$rel->setSectionId($section_id);
$rel->setSubjectId($subject_id);
$id=$rel->getIDByElems();
$rel->setID($id);
$rel->load();
$total_marks=$rel->getTotalMarks();
$sec=new StudentSection($objPDO);
$student=array();
$student=$sec->getBySectionId($section_id);
$students=array();
$stupro=new StudentProfile($objPDO);
$roll_numbers=array();
foreach($student as $key=>$value)
{
$stupro->setID($value['student_id']);
$stupro->load();
$students[$value['student_id']]=$stupro->getName();
$roll_numbers[$value['student_id']]=$stupro->getRollNo();
}
$split=new MarksSplitup($objPDO);
$split_ups=$split->getByExamSubjectId($id);
include($_SERVER['DOCUMENT_ROOT'].'/cloud/view/marking_list_view.php');
}
else
{
header('Location:http://localhost/cloud');
}
}
protected function savemarks()
{
$required=array(
"exam_subject_id"=>"Examination",
"student"=>"Student Id",
"total_marks"=>"Total Marks",
);
GLOBAL $user;
GLOBAL $objPDO;
$student=new Student($objPDO,$user->getuserId());
if($user->checkAdmin()==true || $student->checkTeacher())
{
if(isset($_POST))
{
foreach($required as $key=>$value)
{
if(!isset($_POST[$key]) || $_POST[$key]=='' || $_POST[$key]=='select')
{
echo $value.' is Required<br/>';
return;
}
}
$flag=true;
foreach($_POST['student'] as $key=>$value)
{
if(!isset($_POST['total_marks'][$key]) || !is_numeric($_POST['total_marks'][$key]))
{
$flag=false;
}
}
if($flag==false)
{
echo 'Enter All Students Marks (you may use -1 for not attended)';
return;
}
require_once($_SERVER['DOCUMENT_ROOT'].'/cloud/model/marks_splitup_class.php');
$split_ups=new MarksSplitup($objPDO);
$split=$split_ups->getByExamSubjectId($_POST['exam_subject_id']);
$split_marks=array();
foreach($split as $key=>$value)
{
if(!isset($_POST[$value['id']]))
{
echo 'Marks Split Up Required (If Not Needed Change Marks Split Up Settings)';
return;
}
else
{
foreach($_POST[$value['id']] as $k=>$v)
{
if($v=="" || !is_numeric($v))
{
echo 'Marks Split Up Required (If Not Needed Change Marks Split Up Settings)';
return;
}
else
{
$split_marks[$k][$value['id']]=$v;
}
}
}
}
echo 'Saving...';
require_once($_SERVER['DOCUMENT_ROOT'].'/cloud/model/exam_marks_class.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/cloud/model/splitup_marks_class.php');
$total_marks=$_POST['total_marks'];
$student=$_POST['student'];
foreach($student as $key=>$value)
{
$exam=new ExamMarks($objPDO);
$exam->setExamSubjectId($_POST['exam_subject_id']);
$exam->setStudentId($value);
$exam->setByExamStudentID($_POST['exam_subject_id'],$value);
$exam->setMarks($total_marks[$key]);
$exam->autoGrade();
$exam->save();
$exam_marks_id=$exam->getID();
if($split_marks)
{
foreach($split_marks[$key] as $k=>$v)
{
$split=new SplitupMarks($objPDO);
$split->setExamMarksId($exam_marks_id);
$split->setSplitUpId($k);
$split->setMarks($v);
$split->save();
}
}
}
echo '<meta http-equiv="Refresh" content="0;url=http://localhost/cloud/examination"/>';
}
}
else
{
header('Location:http://localhost/cloud');
}
}
protected function subjectreport()
{
GLOBAL $user;
GLOBAL $objPDO;
$student=new student($objPDO,$user->getuserId());
$headMenu=array(
"username"=>$student->getName(),
);
if($user->checkAdmin()==true || $student->checkTeacher())
{
$role=$student->getacctType();
include($_SERVER['DOCUMENT_ROOT'].'/cloud/view/subject_report.php');
}
else
{
header('Location:http://localhost/cloud');
}
}
protected function subjectreportlist()
{
GLOBAL $user;
GLOBAL $objPDO;
$student=new student($objPDO,$user->getuserId());
$headMenu=array(
"username"=>$student->getName(),
);
if(($user->checkAdmin()==true || $student->checkTeacher()) && isset($_POST['exam_id'])&& isset($_POST['section']) && isset($_POST['subject']) )
{
$role=$student->getacctType();
include($_SERVER['DOCUMENT_ROOT'].'/cloud/model/student_section_class.php');
include($_SERVER['DOCUMENT_ROOT'].'/cloud/model/examination_section_subject_class.php');
include($_SERVER['DOCUMENT_ROOT'].'/cloud/model/marks_splitup_class.php');
include($_SERVER['DOCUMENT_ROOT'].'/cloud/model/student_profile_class.php');
include($_SERVER['DOCUMENT_ROOT'].'/cloud/model/exam_marks_class.php');
$rel=new ExaminationSectionSubject($objPDO);
$exam_id=$_POST['exam_id'];
$section_id=$_POST['section'];
$subject_id=$_POST['subject'];
$rel->setExaminationId($exam_id);
$rel->setSectionId($section_id);
$rel->setSubjectId($subject_id);
$id=$rel->getIDByElems();
$mark=new ExamMarks($objPDO);
$mark_list=$mark->getByExamSubjectId($id);
$rel->setID($id);
$rel->load();
$total_marks=$rel->getTotalMarks();
$sec=new StudentSection($objPDO);
$student=array();
$student=$sec->getBySectionId($section_id);
$students=array();
$stupro=new StudentProfile($objPDO);
$roll_numbers=array();
foreach($student as $key=>$value)
{
$stupro->setID($value['student_id']);
$stupro->load();
$students[$value['student_id']]=$stupro->getName();
$roll_numbers[$value['student_id']]=$stupro->getRollNo();
}
$split=new MarksSplitup($objPDO);
$split_ups=$split->getByExamSubjectId($id);
include($_SERVER['DOCUMENT_ROOT'].'/cloud/view/section_subject_report_view.php');
}
else
{
header('Location:http://localhost/cloud');
}
}
protected function getmarkinglist()
{
GLOBAL $user;
GLOBAL $objPDO;
$student=new student($objPDO,$user->getuserId());
$headMenu=array(
"username"=>$student->getName(),
);
if($user->checkAdmin()==true && isset($_GET['uid'])&& isset($_GET['ref']))
{
$role=$student->getacctType();
include($_SERVER['DOCUMENT_ROOT'].'/cloud/model/examination_section_subject_class.php');
include($_SERVER['DOCUMENT_ROOT'].'/cloud/controller/utility_class.php');
include($_SERVER['DOCUMENT_ROOT'].'/cloud/model/subject_class.php');
$rel=new ExaminationSectionSubject($objPDO);
$exam_id=$_GET['uid'];
$section_id=$_GET['ref'];
$sec_sub=$rel->getSectionExams($exam_id,$section_id);
$sub=new Subject($objPDO);
$subject_name=$sub->getSubjectArray();
$subjects=array();
foreach($sec_sub as $key=>$value)
{
$subjects[$value]=$subject_name[$value];
}
Utility::dropDownList('subject','subject','','text',$subjects);
}
else
{
header('Location:http://localhost/cloud');
}
}
protected function gettimetable()
{
GLOBAL $user;
GLOBAL $objPDO;
$student=new student($objPDO,$user->getuserId());
$headMenu=array(
"username"=>$student->getName(),
);
if(($user->checkAdmin()==true || $student->checkTeacher()) && isset($_GET['uid']) && isset($_GET['ref']))
{
$role=$student->getacctType();
include($_SERVER['DOCUMENT_ROOT'].'/cloud/model/examination_section_subject_class.php');
include($_SERVER['DOCUMENT_ROOT'].'/cloud/model/exam_timetable_class.php');
include($_SERVER['DOCUMENT_ROOT'].'/cloud/model/subject_class.php');
$sub=new Subject($objPDO);
$sub_names=$sub->getSubjectArray();
$section_id=$_GET['ref'];
$exam_id=$_GET['uid'];
$rel=new ExaminationSectionSubject($objPDO);
$sub_exam_id=$rel->getSectionExams($exam_id,$section_id);
$tt=new ExamTimetable($objPDO);
$dates=array();
$slots=array();
foreach($sub_exam_id as $key=>$value)
{
$res=$tt->getByExamSubjectId($key);
$date=$res['date'];
if($date!=NULL)
{
$dates[$key]=date('d-m-Y',strtotime($date));
}
else
{
$dates[$key]='N/A';
}
$slots[$key]=$res['slot'];
}
include($_SERVER['DOCUMENT_ROOT'].'/cloud/view/examination_timetable_list.php');
}
else
{
header('Location:http://localhost/cloud');
}
}
protected function selectsubjects()
{
GLOBAL $user;
GLOBAL $objPDO;
$student=new student($objPDO,$user->getuserId());
$headMenu=array(
"username"=>$student->getName(),
);
if($user->checkAdmin()==true)
{
include($_SERVER['DOCUMENT_ROOT'].'/cloud/model/section_class.php');
include($_SERVER['DOCUMENT_ROOT'].'/cloud/model/subject_relations_class.php');
include($_SERVER['DOCUMENT_ROOT'].'/cloud/model/subject_class.php');
$sec=new Section($objPDO);
$sections=$sec->getSectionArray();
$rel=new SubjectRelations($objPDO);
$subjects=array();
foreach($sections as $key=>$value)
{
$subjects[$key]=$rel->getByClassId($key);
}
$sub=new Subject($objPDO);
$subject_name=$sub->getSubjectArray();
include($_SERVER['DOCUMENT_ROOT'].'/cloud/view/examination_subjects.php');
}
else
{
header('Location:http://localhost/cloud');
}
}
protected function timetable()
{
GLOBAL $user;
GLOBAL $objPDO;
$student=new student($objPDO,$user->getuserId());
$headMenu=array(
"username"=>$student->getName(),
);
if($user->checkAdmin()==true)
{
include($_SERVER['DOCUMENT_ROOT'].'/cloud/view/examination_timetable.php');
}
else
{
header('Location:http://localhost/cloud');
}
}
protected function gettimetablecreate()
{
GLOBAL $user;
GLOBAL $objPDO;
$student=new student($objPDO,$user->getuserId());
$headMenu=array(
"username"=>$student->getName(),
);
if($user->checkAdmin()==true && isset($_GET['uid']))
{
include($_SERVER['DOCUMENT_ROOT'].'/cloud/model/examination_section_subject_class.php');
include($_SERVER['DOCUMENT_ROOT'].'/cloud/model/examination_class.php');
include($_SERVER['DOCUMENT_ROOT'].'/cloud/model/section_class.php');
include($_SERVER['DOCUMENT_ROOT'].'/cloud/model/subject_class.php');
$exam_id=$_GET['uid'];
$exam=new Examination($objPDO,$exam_id);
$slots=$exam->getFnAn();
if($slots==2)
{
$slots=1;
}
else if($slots==3)
{
$slots=2;
}
else
{
$slots=1;
}
$startTime=strtotime($exam->getStartDate());
$endTime=strtotime($exam->getEndDate());
$day = 86400;
$format = 'd-m-Y';
$numDays = round(($endTime - $startTime) / $day) + 1;
$days = array();
for ($i = 0; $i < $numDays; $i++)
{
$days[] = date($format, ($startTime + ($i * $day)));
}
$rel=new ExaminationSectionSubject($objPDO);
$section_array=$rel->getByExamId($exam_id);
$section_name=array();
$subject_array=array();
$section=new Section($objPDO);
$subject=new Subject($objPDO);
foreach($section_array as $key=>$value)
{
$section->setID($key);
$section->load();
$section_name[$key]=$section->getCode();
foreach($value as $k=>$v)
{
$subject->setID($v);
$subject->load();
$subject_array[$key][$v]=$subject->getName();
}
$subject_array[$key][0]="--None--";
}
include($_SERVER['DOCUMENT_ROOT'].'/cloud/view/exam_timetable_create.php');
}
else
{
header('Location:http://localhost/cloud');
}
}
protected function create()
{
GLOBAL $user;
GLOBAL $objPDO;
$student=new student($objPDO,$user->getuserId());
$headMenu=array(
"username"=>$student->getName(),
);
if($user->checkAdmin()==true)
{
include($_SERVER['DOCUMENT_ROOT'].'/cloud/view/examination_create.php');
}
else
{
header('Location:http://localhost/cloud');
}
}
protected function createexam()
{
$required=array(
"name"=>"Examination Name",
"start_date"=>"Start Date",
"end_date"=>"End Date",
"fn_an"=>"Sessions",
);
GLOBAL $user;
if($user->checkAdmin()==true)
{
if(isset($_POST))
{
foreach($required as $key=>$value)
{
if(!isset($_POST[$key]) || $_POST[$key]=='' || $_POST[$key]=='select')
{
echo $value.' is Required<br/>';
return;
}
}
echo 'Saving...';
GLOBAL $objPDO;
require_once($_SERVER['DOCUMENT_ROOT'].'/cloud/model/examination_class.php');
$exam=new Examination($objPDO);
$exam->setName($_POST['name']);
$exam->setStartDate(date('Y-m-d H:i:s T', strtotime($_POST['start_date'])));
$exam->setEndDate(date('Y-m-d H:i:s T', strtotime($_POST['end_date'])));
$exam->setFnAn($_POST['fn_an']);
$exam->save();
echo '<meta http-equiv="Refresh" content="0;url=http://localhost/cloud/examination/selectsubjects"/>';
}
}
else
{
header('Location:http://localhost/cloud');
}
}
protected function savetimetable()
{
$required=array(
"exam_id"=>"Examination Name",
"check" =>"Exam Timetable"
);
GLOBAL $user;
if($user->checkAdmin()==true)
{
if(isset($_POST))
{
foreach($required as $key=>$value)
{
if(!isset($_POST[$key]) || $_POST[$key]=='' || $_POST[$key]=='select')
{
echo $value.' is Required<br/>';
return;
}
}
GLOBAL $objPDO;
require_once($_SERVER['DOCUMENT_ROOT'].'/cloud/model/exam_timetable_class.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/cloud/model/examination_section_subject_class.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/cloud/model/section_class.php');
$exam_id=$_POST['exam_id'];
$sec=new Section($objPDO);
$fn_an=array("0"=>"FN","1"=>"AN");
$sec_name=$sec->getSectionArray();
foreach($_POST as $k=>$v)
{
if($k!='exam_id' && $k!='check' && $k!='save_timetable' )
{
$parts_1=explode('_',$k);
$section_id_1=$parts_1[2];
foreach($_POST as $r=>$s)
{
if($r!='exam_id' && $r!='check' && $r!='save_timetable' )
{
$parts_2=explode('_',$r);
$section_id_2=$parts_2[2];
if($s==$v && $k!=$r && $v!=0 && $section_id_1==$section_id_2)
{
echo 'Exam Clash.. Please Check Section [['.$sec_name[$section_id_1].']] on '.$parts_1[0].'-'.$fn_an[$parts_1[1]].' and '.$parts_2[0].'-'.$fn_an[$parts_2[1]];
return;
}
}
}
}
}
echo 'Saving...';
foreach($_POST as $key=>$value)
{
if($key!='exam_id' && $key!='check' && $key!='save_timetable' )
{
$parts=explode('_',$key);
$date=date('Y-m-d H:i:s T',strtotime($parts[0]));
$slot=$parts[1];
$section_id=$parts[2];
$subject_id=$value;
if($subject_id==0)
{
continue;
}
else
{
$rel=new ExaminationSectionSubject($objPDO);
$rel->setSectionId($section_id);
$rel->setSubjectId($subject_id);
$rel->setExaminationId($exam_id);
$sub_rel_id=$rel->getIDByElems();
$tt=new ExamTimetable($objPDO);
if($tt->checkExamSubjectId($sub_rel_id))
{
$tt->deleteByExamSubjectId($sub_rel_id);
}
$tt->setSlot($slot);
$tt->setDate($date);
$tt->setExamSubjectId($sub_rel_id);
$tt->save();
}
}
}
echo '<meta http-equiv="Refresh" content="0;url=http://localhost/cloud/examination/"/>';
}
}
else
{
header('Location:http://localhost/cloud');
}
}
protected function subjectssave()
{
$required=array(
"exam_id"=>"Examination",
);
GLOBAL $user;
if($user->checkAdmin()==true)
{
if(isset($_POST))
{
foreach($required as $key=>$value)
{
if(!isset($_POST[$key]) || $_POST[$key]=='' || $_POST[$key]=='select')
{
echo $value.' is Required<br/>';
return;
}
}
echo 'Saving...';
GLOBAL $objPDO;
require_once($_SERVER['DOCUMENT_ROOT'].'/cloud/model/examination_section_subject_class.php');
$exam=new ExaminationSectionSubject($objPDO);
$exam->deleteByExamId($_POST['exam_id']);
foreach($_POST as $key=>$value)
{
if($key!='save_subjects' && $key!='exam_id')
{
$exam=new ExaminationSectionSubject($objPDO);
$exam->setExaminationId($_POST['exam_id']);
$parts=explode('-',$key);
$section_id=$parts[0];
$subject_id=$parts[1];
$exam->setSectionId($section_id);
$exam->setSubjectId($subject_id);
$exam->save();
}
}
echo '<meta http-equiv="Refresh" content="0;url=http://localhost/cloud/examination/"/>';
}
}
else
{
header('Location:http://localhost/cloud');
}
}
}; | {'content_hash': 'ec4d46076df3d54bc690a9c92255a3a0', 'timestamp': '', 'source': 'github', 'line_count': 863, 'max_line_length': 158, 'avg_line_length': 24.221320973348785, 'alnum_prop': 0.6485193512892886, 'repo_name': 'srinivasans/educloud', 'id': '8a69ea36a7bd4d916e84c3adace6bfb883f917fc', 'size': '20903', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'controller/examinationController.php', 'mode': '33261', 'license': 'apache-2.0', 'language': [{'name': 'ApacheConf', 'bytes': '797'}, {'name': 'CSS', 'bytes': '85185'}, {'name': 'ColdFusion', 'bytes': '6234'}, {'name': 'HTML', 'bytes': '374091'}, {'name': 'JavaScript', 'bytes': '88109'}, {'name': 'PHP', 'bytes': '3546410'}, {'name': 'Perl', 'bytes': '4842'}]} |
html{color:#000;background:#FFF;}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var,optgroup{font-style:inherit;font-weight:inherit;}del,ins{text-decoration:none;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym{border:0;font-variant:normal;}sup{vertical-align:baseline;}sub{vertical-align:baseline;}legend{color:#000;}input,button,textarea,select,optgroup,option{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;}input,button,textarea,select{*font-size:100%;}
body{margin:10px;}h1{font-size:138.5%;}h2{font-size:123.1%;}h3{font-size:108%;}h1,h2,h3{margin:0.8em 0;}h1,h2,h3,h4,h5,h6,strong,dt{font-weight:bold;}optgroup{font-weight:normal;}abbr,acronym{border-bottom:1px dotted #000;cursor:help;}em{font-style:italic;}del{text-decoration:line-through;}blockquote,ul,ol,dl{margin:1em;}ol,ul,dl{margin-left:2em;}ol li{list-style:decimal outside;}ul li{list-style:disc outside;}dl dd{margin-left:1em;}th,td{border:1px solid #000;padding:.5em;}th{font-weight:bold;text-align:center;}caption{margin-bottom:.5em;text-align:center;}sup{vertical-align:super;}sub{vertical-align:sub;}p,fieldset,table,pre{margin-bottom:1em;}button,input[type="checkbox"],input[type="radio"],input[type="reset"],input[type="submit"]{padding:1px;}
/* Make some HTML5 elements behave */
header, footer, nav, section, article {display:block;}
/* Start the styles proper */
html {
background:url(../images/background.jpg) #000 no-repeat;
background-position:top center;
color:#f1f1f1;
letter-spacing:0.05em;
font-family: "Segoe UI", Candara, "Bitstream Vera Sans", "DejaVu Sans", "Bitstream Vera Sans", "Trebuchet MS", Verdana, "Verdana Ref", sans-serif;
font-size:16px;
line-height:1.4em;
overflow-y: scroll;
}
body {
margin:0;
}
header,
section#body {
width:600px;
margin:0 auto;
position: relative;
}
section#body nav {
position:relative;
text-transform: uppercase;
margin-top:20px;
}
section#body nav .nav-next {
float:right;
}
section#body nav .nav-prev {
float:left;
}
ol.archive,
ol.archive li{
list-style-type: none;
margin: 0;
}
ol.archive li {
margin-bottom: 0.5em;
}
ol.archive .title a,
ol.archive .title a:visited {
opacity:0.8;
}
ol.archive .title a:hover {
opacity:1;
text-decoration: none;
}
ol.archive time {
color: #ccc;
float: right;
opacity: 0.4;
}
#body article.home {
overflow: hidden;
visibility: hidden;
}
#body-more {
display: block;
width: 100%;
padding: 70px 0 10px 0;
height: 20px;
text-align: center;
background: url(../images/mask.png) repeat-x bottom;
position: absolute;
bottom: 20px;
left: 0;
-moz-border-radius: 0 0 20px 20px;
-webkit-border-radius: 0 0 20px 20px;
border-radius: 0 0 20px 20px;
}
#body-more a,
#body-more a:visited {
background: #111;
text-transform: uppercase;
font-weight: bold;
color: #fff;
padding: 2px 8px 2px 10px;
-moz-border-radius: 7px;
-webkit-border-radius: 7px;
border-radius: 7px;
}
#body-more a:hover {
background: #5EDC23;
color: #000;
text-decoration: none;
}
body>footer {
width:800px;
margin:0 auto;
font-size:80%;
position: relative;
}
body>footer>div.extras:first-child {
border-top:1px solid #23241e;
padding:5px 0;
}
#extras-switch {
display: block;
position: absolute;
top: -13px;
right: -30px;
outline: none;
width: 25px;
height: 25px;
text-indent: -5000px;
background-image: url(../images/power.png);
}
#bio {
font-size:18px;
color: #595b4e;
border-top:1px solid #23241e;
padding:5px 0;
}
#bio a,
#bio a:visited {
text-decoration: none;
}
body>footer a,
body>footer a:visited,
body>footer a:hover {
color:#fff;
}
#tag-cloud a,
#tag-cloud a:visited,
a.tag,
a.tag:visited {
color: #fff;
-webkit-text-shadow: 1px 1px 1px #000;
text-shadow: 1px 1px 1px #000;
text-decoration: none;
background: #111;
-webkit-border-radius: 2px;
-moz-border-radius: 4px;
border-radius: 2px;
padding: 0px 4px 2px;
}
#tag-cloud a,
#tag-cloud a:hover {
padding-bottom: 0;
}
#tag-cloud a:hover,
a.tag:hover {
color: #000;
-webkit-text-shadow: 1px 1px 1px #595b4e;
text-shadow: 1px 1px 1px #595b4e;
background: #5EDC23;
text-decoration: none;
}
body>footer div section {
width:176px;
float:left;
padding:0 10px;
border-left:1px solid #23241e;
text-transform:uppercase;
height:100%;
}
body>footer div section#tag-cloud,
body>footer div section#tweets {
width:376px;
}
body>footer div section:first-child {
border-left:none;
}
body>footer div section h3 {
margin-top:0;
font-size:140%;
color:#fff;
text-transform: capitalize;
}
body>footer ul,
body>footer ul li {
list-style-type:none;
margin:0;
padding:0;
line-height:1.2em;
padding-left: 4px;
text-indent: -8px;
}
header {
height:230px;
}
section article header h1 {
margin-right:20px;
}
section article:first-child header h1,
section h1:first-child {
margin-top:0px;
}
section article h1:first-child {
margin:0.8em 0;
}
#site-title {
padding:0;
margin:0;
}
#site-title a {
display:block;
height:160px;
margin:0 100px 0px 100px;
padding:0;
text-indent:-5000px;
background: url(../images/home.png) no-repeat;
background-position:0 10px;
outline:none;
}
section#body{
background:url(../images/opaque.png);
padding: 20px;
-moz-border-radius: 20px 20px 0 0;
-webkit-border-radius: 20px 20px 0 0;
}
section header {
height:auto;
width:auto;
position:relative;
}
a, a:visited {
color:#5edc23;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
a.permalink {
opacity:0.3;
position:absolute;
top:0;
right:0;
}
a.permalink:hover {
opacity:1;
}
#comments {
font-size:85%;
}
#comments a.permalink {
position:relative;
}
#comments img.gravatar {
float:right;
margin:5px;
}
#comments article {
border-bottom:1px solid #23241e;
margin-top: 2em;
}
#comments article footer {
border:none;
margin-top: -1em;
}
article {
position:relative;
}
article footer {
font-size:85%;
color:#414141;
margin-top:5px;
border-top: 1px solid #111;
}
article footer p {
margin:0;
}
form#search {
font-size:12px;
width:200px;
margin:15px auto;
padding: 0;
}
form#search input,
form#search input:focus {
margin: 0 0 0 30px;
width: 170px;
padding: 0;
line-height: 22px;
vertical-align: middle;
border:0px solid #000;
background:transparent;
outline:none;
-webkit-appearance: textfield;
display: inline;
}
textarea {
width:100%;
}
input, textarea, select {
margin-bottom:4px;
}
#submit {
text-align: right;
}
.syntax_highlight {
overflow: auto;
background: #fff;
color: #000;
}
.syntax_highlight ol,
.syntax_highlight ol li {
margin: 0;
list-style: none;
}
ol.footnotes {
font-size: 90%;
color: #414141;
line-height: 1.1em;
}
/***************************************************************
* Clear some floats!
**************************************************************/
/* float clearing for IE6 */
* html .clearfix,
* html #navigation li.sub-level-0 {
height: 1%;
overflow: visible;
}
/* float clearing for IE7 */
*+html .clearfix,
*+html #navigation li.sub-level-0 {
min-height: 1%;
}
/* float clearing for everyone else */
.clearfix:after,
#navigation li.sub-level-0:after {
clear: both;
content: ".";
display: block;
height: 0;
visibility: hidden;
}
::-webkit-scrollbar
{
width: 10px;
}
::-webkit-scrollbar-track-piece
{
background-color: #333;
-webkit-border-radius: 5px;
margin-top: 20px;
margin-bottom: 20px;
}
::-webkit-scrollbar-thumb:vertical
{
height: 50px;
background-color: #666;
-webkit-border-radius: 5px;
}
::-webkit-scrollbar-thumb:vertical:hover
{
height: 50px;
background-color: #777;
-webkit-border-radius: 5px;
}
::-webkit-scrollbar-thumb:horizontal
{
width: 50px;
background-color: #666;
-webkit-border-radius: 5px;
} | {'content_hash': '215e78bbdf28e147b6d7dc1271b44180', 'timestamp': '', 'source': 'github', 'line_count': 428, 'max_line_length': 786, 'avg_line_length': 18.672897196261683, 'alnum_prop': 0.6940690690690691, 'repo_name': 'drzax/elvery.net-drzax', 'id': 'b93785515f5d478e5e0e70fce2975c80ff940e5c', 'size': '8173', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'user/themes/simplicity/styles/all.css', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'ApacheConf', 'bytes': '383'}, {'name': 'CSS', 'bytes': '10384'}, {'name': 'JavaScript', 'bytes': '164664'}, {'name': 'PHP', 'bytes': '2391092'}]} |
@interface PodsDummy_Gloss_OSX : NSObject
@end
@implementation PodsDummy_Gloss_OSX
@end
| {'content_hash': '85987049e6edea04733f3e11e32c0eef', 'timestamp': '', 'source': 'github', 'line_count': 4, 'max_line_length': 41, 'avg_line_length': 22.0, 'alnum_prop': 0.8068181818181818, 'repo_name': 'FuckBoilerplate/RxCache', 'id': '22301524a04f7f3ce37e9459c5f1869a088a3ec1', 'size': '122', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Examples/Pods/Target Support Files/Gloss-OSX/Gloss-OSX-dummy.m', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Objective-C', 'bytes': '38980'}, {'name': 'Ruby', 'bytes': '1838'}, {'name': 'Shell', 'bytes': '33727'}, {'name': 'Swift', 'bytes': '2171263'}]} |
module VORLON {
export class _Core {
_clientPlugins = new Array<ClientPlugin>();
_dashboardPlugins = new Array<DashboardPlugin>();
_messenger: ClientMessenger;
_sessionID: string;
_listenClientId: string;
_side: RuntimeSide;
_errorNotifier: any;
_messageNotifier: any;
_socketIOWaitCount = 0;
public debug: boolean = false;
_RetryTimeout = 1002;
public get Messenger(): ClientMessenger {
return Core._messenger;
}
public get ClientPlugins(): Array<ClientPlugin> {
return Core._clientPlugins;
}
public get DashboardPlugins(): Array<DashboardPlugin> {
return Core._dashboardPlugins;
}
public RegisterClientPlugin(plugin: ClientPlugin): void {
Core._clientPlugins.push(plugin);
}
public RegisterDashboardPlugin(plugin: DashboardPlugin): void {
Core._dashboardPlugins.push(plugin);
}
public StopListening(): void {
if (Core._messenger) {
Core._messenger.stopListening();
delete Core._messenger;
}
}
public StartClientSide(serverUrl = "'http://localhost:1337/'", sessionId = "", listenClientId = ""): void {
Core._side = RuntimeSide.Client;
Core._sessionID = sessionId;
Core._listenClientId = listenClientId;
// Checking socket.io
if (Tools.IsWindowAvailable && (<any>window).io === undefined) {
if (this._socketIOWaitCount < 10) {
this._socketIOWaitCount++;
// Let's wait a bit just in case socket.io was loaded asynchronously
setTimeout(function() {
console.log("Vorlon.js: waiting for socket.io to load...");
Core.StartClientSide(serverUrl, sessionId, listenClientId);
}, 1000);
} else {
console.log("Vorlon.js: please load socket.io before referencing vorlon.js or use includeSocketIO = true in your catalog.json file.");
Core.ShowError("Vorlon.js: please load socket.io before referencing vorlon.js or use includeSocketIO = true in your catalog.json file.", 0);
}
return;
}
// Cookie
var clientId;
if(Tools.IsWindowAvailable){
clientId = Tools.ReadCookie("vorlonJS_clientId");
if (!clientId) {
clientId = Tools.CreateGUID();
Tools.CreateCookie("vorlonJS_clientId", clientId, 1);
}
}
else {
clientId = Tools.CreateGUID();
}
// Creating the messenger
if (Core._messenger) {
Core._messenger.stopListening();
delete Core._messenger;
}
Core._messenger = new ClientMessenger(Core._side, serverUrl, sessionId, clientId, listenClientId);
// Connect messenger to dispatcher
Core.Messenger.onRealtimeMessageReceived = Core._Dispatch;
Core.Messenger.onHeloReceived = Core._OnIdentificationReceived;
Core.Messenger.onIdentifyReceived = Core._OnIdentifyReceived;
Core.Messenger.onStopListenReceived = Core._OnStopListenReceived;
Core.Messenger.onError = Core._OnError;
Core.Messenger.onReload = Core._OnReloadClient;
this.sendHelo();
// Launch plugins
for (var index = 0; index < Core._clientPlugins.length; index++) {
var plugin = Core._clientPlugins[index];
plugin.startClientSide();
}
// Handle client disconnect
if (Tools.IsWindowAvailable) {
window.addEventListener("beforeunload", function() {
Core.Messenger.sendRealtimeMessage("", { socketid: Core.Messenger.socketId }, Core._side, "clientclosed");
}, false);
}
else {
process.stdin.resume();//so the program will not close instantly
var exitMessageWritten = false;
function exitHandler(options, err) {
if(!exitMessageWritten){
Core.Messenger.sendRealtimeMessage("", { socketid: Core.Messenger.socketId }, Core._side, "clientclosed");
console.log('Disconnected from Vorlon.js instance');
exitMessageWritten = true;
}
process.exit(0);
}
//do something when app is closing
process.on('exit', exitHandler.bind(null,{cleanup:true}));
//catches ctrl+c event
process.on('SIGINT', exitHandler.bind(null, {exit:true}));
//catches uncaught exceptions
process.on('uncaughtException', exitHandler.bind(null, {exit:true}));
}
// Start global dirty check, at this point document is not ready,
// little timeout to defer starting dirtycheck
setTimeout(() => {
this.startClientDirtyCheck();
}, 500);
}
public sendHelo(){
// Say 'helo'
var heloMessage = {};
if(Tools.IsWindowAvailable){
heloMessage = {
ua: navigator.userAgent,
identity : sessionStorage["vorlonClientIdentity"] || localStorage["vorlonClientIdentity"]
};
}
else {
heloMessage = {
ua: "Node.js",
identity : "",
noWindow: true
};
}
Core.Messenger.sendRealtimeMessage("", heloMessage, Core._side, "helo");
}
public startClientDirtyCheck() {
//sometimes refresh is called before document was loaded
if (Tools.IsWindowAvailable && !document.body) {
setTimeout(() => {
this.startClientDirtyCheck();
}, 200);
return;
}
var mutationObserver = Tools.IsWindowAvailable && ((<any>window).MutationObserver || (<any>window).WebKitMutationObserver);
if (mutationObserver) {
if (!document.body.__vorlon)
document.body.__vorlon = {};
var config = { attributes: true, childList: true, subtree: true, characterData: true };
document.body.__vorlon._observerMutationObserver = new mutationObserver((mutations) => {
var sended = false;
var cancelSend = false;
var sendComandId = [];
mutations.forEach((mutation) => {
if (cancelSend) {
for (var i = 0; i < sendComandId.length; i++) {
clearTimeout(sendComandId[i]);
}
cancelSend = false;
}
if (mutation.target && mutation.target.__vorlon && mutation.target.__vorlon.ignore) {
cancelSend = true;
return;
}
if (mutation.previousSibling && mutation.previousSibling.__vorlon && mutation.previousSibling.__vorlon.ignore) {
cancelSend = true;
return;
}
if (mutation.target && !sended && mutation.target.__vorlon && mutation.target.parentNode && mutation.target.parentNode.__vorlon && mutation.target.parentNode.__vorlon.internalId) {
sendComandId.push(setTimeout(() => {
var internalId = null;
if (mutation && mutation.target && mutation.target.parentNode && mutation.target.parentNode.__vorlon && mutation.target.parentNode.__vorlon.internalId)
internalId = mutation.target.parentNode.__vorlon.internalId;
Core.Messenger.sendRealtimeMessage('ALL_PLUGINS', {
type: 'contentchanged',
internalId: internalId
}, Core._side, 'message');
}, 300));
}
sended = true;
});
});
document.body.__vorlon._observerMutationObserver.observe(document.body, config);
} else if (Tools.IsWindowAvailable) {
console.log("dirty check using html string");
var content;
if (document.body)
content = document.body.innerHTML;
setInterval(() => {
var html = document.body.innerHTML;
if (content != html) {
content = html;
Core.Messenger.sendRealtimeMessage('ALL_PLUGINS', {
type: 'contentchanged'
}, Core._side, 'message');
}
}, 2000);
}
}
public StartDashboardSide(serverUrl = "'http://localhost:1337/'", sessionId = "", listenClientId = "", divMapper: (string) => HTMLDivElement = null): void {
Core._side = RuntimeSide.Dashboard;
Core._sessionID = sessionId;
Core._listenClientId = listenClientId;
/* Notification elements */
Core._errorNotifier = document.createElement('x-notify');
Core._errorNotifier.setAttribute('type', 'error');
Core._errorNotifier.setAttribute('position', 'top');
Core._errorNotifier.setAttribute('duration', 5000);
Core._messageNotifier = document.createElement('x-notify');
Core._messageNotifier.setAttribute('position', 'top');
Core._messageNotifier.setAttribute('duration', 4000);
document.body.appendChild(Core._errorNotifier);
document.body.appendChild(Core._messageNotifier);
// Checking socket.io
if (Tools.IsWindowAvailable && (<any>window).io === undefined) {
if (this._socketIOWaitCount < 10) {
this._socketIOWaitCount++;
// Let's wait a bit just in case socket.io was loaded asynchronously
setTimeout(function() {
console.log("Vorlon.js: waiting for socket.io to load...");
Core.StartDashboardSide(serverUrl, sessionId, listenClientId, divMapper);
}, 1000);
} else {
console.log("Vorlon.js: please load socket.io before referencing vorlon.js or use includeSocketIO = true in your catalog.json file.");
Core.ShowError("Vorlon.js: please load socket.io before referencing vorlon.js or use includeSocketIO = true in your catalog.json file.", 0);
}
return;
}
// Cookie
var clientId = Tools.ReadCookie("vorlonJS_clientId");
if (!clientId) {
clientId = Tools.CreateGUID();
Tools.CreateCookie("vorlonJS_clientId", clientId, 1);
}
// Creating the messenger
if (Core._messenger) {
Core._messenger.stopListening();
delete Core._messenger;
}
Core._messenger = new ClientMessenger(Core._side, serverUrl, sessionId, clientId, listenClientId);
// Connect messenger to dispatcher
Core.Messenger.onRealtimeMessageReceived = Core._Dispatch;
Core.Messenger.onHeloReceived = Core._OnIdentificationReceived;
Core.Messenger.onIdentifyReceived = Core._OnIdentifyReceived;
Core.Messenger.onStopListenReceived = Core._OnStopListenReceived;
Core.Messenger.onError = Core._OnError;
// Say 'helo'
var heloMessage = {
ua: navigator.userAgent
};
Core.Messenger.sendRealtimeMessage("", heloMessage, Core._side, "helo");
// Launch plugins
for (var index = 0; index < Core._dashboardPlugins.length; index++) {
var plugin = Core._dashboardPlugins[index];
plugin.startDashboardSide(divMapper ? divMapper(plugin.getID()) : null);
}
}
private _OnStopListenReceived(): void {
Core._listenClientId = "";
}
private _OnIdentifyReceived(message: string): void {
//console.log('identify ' + message);
if (Core._side === RuntimeSide.Dashboard) {
Core._messageNotifier.innerHTML = message;
Core._messageNotifier.show();
}
else if (Tools.IsWindowAvailable) {
var div = document.createElement("div");
div.className = "vorlonIdentifyNumber";
div.style.position = "absolute";
div.style.left = "0";
div.style.top = "50%";
div.style.marginTop = "-150px";
div.style.width = "100%";
div.style.height = "300px";
div.style.fontFamily = "Arial";
div.style.fontSize = "300px";
div.style.textAlign = "center";
div.style.color = "white";
div.style.textShadow = "2px 2px 5px black";
div.style.zIndex = "100";
div.innerHTML = message;
document.body.appendChild(div);
setTimeout(() => {
document.body.removeChild(div);
}, 4000);
}
}
private ShowError(message: string, timeout = 5000) {
if (Core._side === RuntimeSide.Dashboard) {
Core._errorNotifier.innerHTML = message;
Core._errorNotifier.setAttribute('duration', timeout);
Core._errorNotifier.show();
}
else if (Tools.IsWindowAvailable) {
var divError = document.createElement("div");
divError.style.position = "absolute";
divError.style.top = "0";
divError.style.left = "0";
divError.style.width = "100%";
divError.style.height = "100px";
divError.style.backgroundColor = "red";
divError.style.textAlign = "center";
divError.style.fontSize = "30px";
divError.style.paddingTop = "20px";
divError.style.color = "white";
divError.style.fontFamily = "consolas";
divError.style.zIndex = "1001";
divError.innerHTML = message;
document.body.appendChild(divError);
if (timeout) {
setTimeout(() => {
document.body.removeChild(divError);
}, timeout);
}
}
}
private _OnError(err: Error): void {
Core.ShowError("Error while connecting to server. Server may be offline.<BR>Error message: " + err.message);
}
private _OnIdentificationReceived(id: string): void {
Core._listenClientId = id;
if (Core._side === RuntimeSide.Client) {
// Refresh plugins
for (var index = 0; index < Core._clientPlugins.length; index++) {
var plugin = Core._clientPlugins[index];
plugin.refresh();
}
}
}
private _OnReloadClient(id: string): void {
if (Tools.IsWindowAvailable) {
document.location.reload();
}
}
private _RetrySendingRealtimeMessage(plugin: DashboardPlugin, message: VorlonMessage) {
setTimeout(() => {
if (plugin.isReady()) {
Core._DispatchFromClientPluginMessage(plugin, message);
return;
}
Core._RetrySendingRealtimeMessage(plugin, message);
}, Core._RetryTimeout);
}
private _Dispatch(message: VorlonMessage): void {
if (!message.metadata) {
console.error('invalid message ' + JSON.stringify(message));
return;
}
if (message.metadata.pluginID == 'ALL_PLUGINS') {
Core._clientPlugins.forEach((plugin) => {
Core._DispatchPluginMessage(plugin, message);
});
Core._dashboardPlugins.forEach((plugin) => {
Core._DispatchPluginMessage(plugin, message);
});
}
else {
Core._clientPlugins.forEach((plugin) => {
if (plugin.getID() === message.metadata.pluginID) {
Core._DispatchPluginMessage(plugin, message);
return;
}
});
Core._dashboardPlugins.forEach((plugin) => {
if (plugin.getID() === message.metadata.pluginID) {
Core._DispatchPluginMessage(plugin, message);
return;
}
});
}
}
private _DispatchPluginMessage(plugin: BasePlugin, message: VorlonMessage): void {
plugin.trace('received ' + JSON.stringify(message));
if (message.metadata.side === RuntimeSide.Client) {
if (!plugin.isReady()) { // Plugin is not ready, let's try again later
Core._RetrySendingRealtimeMessage(<DashboardPlugin>plugin, message);
} else {
Core._DispatchFromClientPluginMessage(<DashboardPlugin>plugin, message);
}
} else {
Core._DispatchFromDashboardPluginMessage(<ClientPlugin>plugin, message);
}
}
private _DispatchFromClientPluginMessage(plugin: DashboardPlugin, message: VorlonMessage): void {
if (message.command && plugin.DashboardCommands) {
var command = plugin.DashboardCommands[message.command];
if (command) {
command.call(plugin, message.data);
return;
}
}
plugin.onRealtimeMessageReceivedFromClientSide(message.data);
}
private _DispatchFromDashboardPluginMessage(plugin: ClientPlugin, message: VorlonMessage): void {
if (message.command && plugin.ClientCommands) {
var command = plugin.ClientCommands[message.command];
if (command) {
command.call(plugin, message.data);
return;
}
}
plugin.onRealtimeMessageReceivedFromDashboardSide(message.data);
}
}
export var Core = new _Core();
}
| {'content_hash': '3d92b7e0f7019bbd64ea8ba95fd9a8a7', 'timestamp': '', 'source': 'github', 'line_count': 469, 'max_line_length': 204, 'avg_line_length': 41.727078891257996, 'alnum_prop': 0.5082779764946347, 'repo_name': 'gleborgne/Vorlonjs', 'id': '7acbd188ba75f9218ce72c9cb2aac81385c45a83', 'size': '19572', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'Plugins/Vorlon/vorlon.core.ts', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Batchfile', 'bytes': '5983'}, {'name': 'C#', 'bytes': '1350'}, {'name': 'CSS', 'bytes': '91314'}, {'name': 'HTML', 'bytes': '90368'}, {'name': 'JavaScript', 'bytes': '507731'}, {'name': 'NSIS', 'bytes': '3769'}, {'name': 'PowerShell', 'bytes': '2763'}, {'name': 'TypeScript', 'bytes': '898492'}]} |
package com.thoughtworks.go.config;
import java.util.ArrayList;
import java.util.List;
import com.thoughtworks.go.helper.PipelineTemplateConfigMother;
import com.thoughtworks.go.helper.StageConfigMother;
import org.junit.Test;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.nullValue;
import static org.junit.Assert.assertThat;
public class TemplatesConfigTest {
@Test
public void shouldRemoveATemplateByName() {
PipelineTemplateConfig template2 = template("template2");
TemplatesConfig templates = new TemplatesConfig(template("template1"), template2);
templates.removeTemplateNamed(new CaseInsensitiveString("template1"));
assertThat(templates.size(), is(1));
assertThat(templates.get(0), is(template2));
}
@Test
public void shouldIgnoreTryingToRemoveNonExistentTemplate() {
TemplatesConfig templates = new TemplatesConfig(template("template1"), template("template2"));
templates.removeTemplateNamed(new CaseInsensitiveString("sachin"));
assertThat(templates.size(), is(2));
}
@Test
public void shouldReturnTemplateByName() {
PipelineTemplateConfig template1 = template("template1");
TemplatesConfig templates = new TemplatesConfig(template1, template("template2"));
assertThat(templates.templateByName(new CaseInsensitiveString("template1")), is(template1));
}
@Test
public void shouldReturnNullIfTemplateIsNotFound() {
PipelineTemplateConfig template1 = template("template1");
TemplatesConfig templates = new TemplatesConfig(template1);
assertThat(templates.templateByName(new CaseInsensitiveString("some_invalid_template")), is(nullValue()));
}
@Test
public void shouldErrorOutIfTemplateNameIsAlreadyPresent() {
PipelineTemplateConfig template = template("template1");
TemplatesConfig templates = new TemplatesConfig(template);
PipelineTemplateConfig duplicateTemplate = template("template1");
templates.add(duplicateTemplate);
templates.validate(null);
assertThat(template.errors().isEmpty(), is(false));
assertThat(duplicateTemplate.errors().isEmpty(), is(false));
assertThat(template.errors().on(PipelineTemplateConfig.NAME), is(String.format("Template name '%s' is not unique", template.name())));
assertThat(duplicateTemplate.errors().on(PipelineTemplateConfig.NAME), is(String.format("Template name '%s' is not unique", template.name())));
}
@Test
public void shouldErrorOutIfTemplateNameIsAlreadyPresent_CaseInsensitiveMap() {
PipelineTemplateConfig template = template("TEmplatE1");
TemplatesConfig templates = new TemplatesConfig(template);
PipelineTemplateConfig duplicateTemplate = template("template1");
templates.add(duplicateTemplate);
templates.validate(null);
assertThat(template.errors().isEmpty(), is(false));
assertThat(duplicateTemplate.errors().isEmpty(), is(false));
}
@Test
public void shouldReturnTrueIfUserCanViewAndEditAtLeastOneTemplate() throws Exception {
CaseInsensitiveString templateAdmin = new CaseInsensitiveString("template-admin");
TemplatesConfig templates = configForUserWhoCanViewATemplate();
templates.add(PipelineTemplateConfigMother.createTemplate("template200", new Authorization(new AdminsConfig(new AdminUser(templateAdmin))), StageConfigMother.manualStage("stage-name")));
assertThat(templates.canViewAndEditTemplate(templateAdmin, null), is(true));
}
@Test
public void shouldReturnFalseIfUserCannotViewAndEditAtLeastOneTemplate() throws Exception {
CaseInsensitiveString templateAdmin = new CaseInsensitiveString("template-admin");
CaseInsensitiveString nonTemplateAdmin = new CaseInsensitiveString("some-random-user");
TemplatesConfig templates = configForUserWhoCanViewATemplate();
templates.add(PipelineTemplateConfigMother.createTemplate("template200", new Authorization(new AdminsConfig(new AdminUser(templateAdmin))), StageConfigMother.manualStage("stage-name")));
assertThat(templates.canViewAndEditTemplate(nonTemplateAdmin, null), is(false));
}
@Test
public void shouldReturnTrueIfUserCanViewAtLeastOneTemplate() {
CaseInsensitiveString templateViewUser = new CaseInsensitiveString("template-view");
TemplatesConfig templates = configForUserWhoCanViewATemplate();
templates.add(PipelineTemplateConfigMother.createTemplate("template200", new Authorization(new ViewConfig(new AdminUser(templateViewUser))), StageConfigMother.manualStage("stage-name")));
assertThat(templates.canUserViewTemplates(templateViewUser, null, false), is(true));
}
@Test
public void shouldReturnFalseIfUserCannotViewAtLeastOneTemplate() {
CaseInsensitiveString templateViewUser = new CaseInsensitiveString("template-view");
TemplatesConfig templates = configForUserWhoCanViewATemplate();
assertThat(templates.canUserViewTemplates(templateViewUser, null, false), is(false));
}
@Test
public void shouldReturnTrueIfUserWithinARoleCanViewAndEditTemplates() {
CaseInsensitiveString templateAdmin = new CaseInsensitiveString("template-admin");
Role securityConfigRole = getSecurityConfigRole(templateAdmin);
List<Role> roles = setupRoles(securityConfigRole);
ArrayList<PipelineTemplateConfig> templateList = new ArrayList<>();
templateList.add(PipelineTemplateConfigMother.createTemplate("templateName", new Authorization(new AdminsConfig(new AdminRole(securityConfigRole))), StageConfigMother.manualStage("some-random-stage")));
TemplatesConfig templates = new TemplatesConfig(templateList.toArray(new PipelineTemplateConfig[0]));
assertThat(templates.canViewAndEditTemplate(templateAdmin, roles), is(true));
}
@Test
public void shouldReturnFalseIfUserWithinARoleCannotViewAndEditTemplates() {
CaseInsensitiveString templateAdmin = new CaseInsensitiveString("template-admin");
Role securityConfigRole = getSecurityConfigRole(templateAdmin);
List<Role> roles = setupRoles(securityConfigRole);
ArrayList<PipelineTemplateConfig> templateList = new ArrayList<>();
templateList.add(PipelineTemplateConfigMother.createTemplate("templateName", new Authorization(new AdminsConfig(new AdminUser(new CaseInsensitiveString("random-user")))), StageConfigMother.manualStage("stage-name")));
TemplatesConfig templates = new TemplatesConfig(templateList.toArray(new PipelineTemplateConfig[0]));
assertThat(templates.canViewAndEditTemplate(templateAdmin, roles), is(false));
}
@Test
public void shouldReturnTrueIfUserCanEditTemplate() {
CaseInsensitiveString templateAdmin = new CaseInsensitiveString("template-admin");
String templateName = "template1";
PipelineTemplateConfig template = PipelineTemplateConfigMother.createTemplate(templateName, new Authorization(new AdminsConfig(new AdminUser(templateAdmin))),
StageConfigMother.manualStage("stage-name"));
TemplatesConfig templates = new TemplatesConfig(template);
assertThat(templates.canUserEditTemplate(template, templateAdmin, null), is(true));
}
@Test
public void shouldReturnFalseIfUserCannotEditTemplate() {
CaseInsensitiveString templateAdmin = new CaseInsensitiveString("template-admin");
CaseInsensitiveString templateAdminWhoDoesNotHavePermissionToThisTemplate = new CaseInsensitiveString("user");
String templateName = "template1";
PipelineTemplateConfig template = PipelineTemplateConfigMother.createTemplate(templateName, new Authorization(new AdminsConfig(new AdminUser(templateAdmin))),
StageConfigMother.manualStage("stage-name"));
TemplatesConfig templates = new TemplatesConfig(template);
assertThat(templates.canUserEditTemplate(template, templateAdminWhoDoesNotHavePermissionToThisTemplate, null), is(false));
}
@Test
public void shouldReturnTrueIfUserWithinARoleCanEditTemplate() {
CaseInsensitiveString templateAdmin = new CaseInsensitiveString("template-admin");
Role securityConfigRole = getSecurityConfigRole(templateAdmin);
List<Role> roles = setupRoles(securityConfigRole);
String templateName = "template1";
PipelineTemplateConfig template = PipelineTemplateConfigMother.createTemplate(templateName, new Authorization(new AdminsConfig(new AdminRole(securityConfigRole))),
StageConfigMother.manualStage("random-stage-name"));
TemplatesConfig templates = new TemplatesConfig(template);
assertThat(templates.canUserEditTemplate(template, templateAdmin, roles), is(true));
}
@Test
public void shouldReturnFalseIfUserWithinARoleCannotEditTemplate() {
CaseInsensitiveString templateAdmin = new CaseInsensitiveString("template-admin");
Role securityConfigRole = getSecurityConfigRole(templateAdmin);
List<Role> roles = setupRoles(securityConfigRole);
String templateName = "template1";
PipelineTemplateConfig template = PipelineTemplateConfigMother.createTemplate(templateName, new Authorization(new AdminsConfig(new AdminRole(new CaseInsensitiveString("another-role")))),
StageConfigMother.manualStage("random-stage"));
TemplatesConfig templates = new TemplatesConfig(template);
assertThat(templates.canUserEditTemplate(template, templateAdmin, roles), is(false));
}
@Test
public void shouldReturnTrueIfUserCanViewTemplate() {
CaseInsensitiveString templateViewUser = new CaseInsensitiveString("view");
String templateName = "template";
PipelineTemplateConfig template = PipelineTemplateConfigMother.createTemplate(templateName, StageConfigMother.manualStage("stage"));
template.setAuthorization(new Authorization(new ViewConfig(new AdminUser(templateViewUser))));
TemplatesConfig templates = new TemplatesConfig(template);
assertThat(templates.hasViewAccessToTemplate(template, templateViewUser, null, false), is(true));
}
@Test
public void shouldReturnTrueIfGroupAdminCanViewTemplate() {
CaseInsensitiveString templateViewUser = new CaseInsensitiveString("view");
String templateName = "template";
PipelineTemplateConfig template = PipelineTemplateConfigMother.createTemplate(templateName, StageConfigMother.manualStage("stage"));
TemplatesConfig templates = new TemplatesConfig(template);
assertThat(templates.hasViewAccessToTemplate(template, templateViewUser, null, true), is(true));
}
@Test
public void shouldReturnTrueIfUserWithinARoleCanViewTemplate() {
CaseInsensitiveString templateViewUser = new CaseInsensitiveString("template-admin");
Role securityConfigRole = getSecurityConfigRole(templateViewUser);
List<Role> roles = setupRoles(securityConfigRole);
String templateName = "template1";
PipelineTemplateConfig template = PipelineTemplateConfigMother.createTemplate(templateName, StageConfigMother.manualStage("stage"));
template.setAuthorization(new Authorization(new ViewConfig(new AdminRole(securityConfigRole))));
TemplatesConfig templates = new TemplatesConfig(template);
assertThat(templates.hasViewAccessToTemplate(template, templateViewUser, roles, false), is(true));
}
@Test
public void shouldReturnFalseIfUserCannotViewTemplate() {
CaseInsensitiveString templateViewUser = new CaseInsensitiveString("view");
String templateName = "template";
PipelineTemplateConfig template = PipelineTemplateConfigMother.createTemplate(templateName, StageConfigMother.manualStage("stage"));
TemplatesConfig templates = new TemplatesConfig(template);
assertThat(templates.hasViewAccessToTemplate(template, templateViewUser, null, false), is(false));
}
@Test
public void shouldReturnFalseIfGroupAdminCanViewTemplate() {
CaseInsensitiveString templateViewUser = new CaseInsensitiveString("view");
String templateName = "template";
PipelineTemplateConfig template = PipelineTemplateConfigMother.createTemplate(templateName, StageConfigMother.manualStage("stage"));
template.getAuthorization().setAllowGroupAdmins(false);
TemplatesConfig templates = new TemplatesConfig(template);
assertThat(templates.hasViewAccessToTemplate(template, templateViewUser, null, true), is(false));
}
@Test
public void shouldReturnFalseIfUserWithinARoleCannotViewTemplate() {
CaseInsensitiveString templateViewUser = new CaseInsensitiveString("template-admin");
Role securityConfigRole = getSecurityConfigRole(templateViewUser);
List<Role> roles = setupRoles(securityConfigRole);
String templateName = "template1";
PipelineTemplateConfig template = PipelineTemplateConfigMother.createTemplate(templateName, StageConfigMother.manualStage("stage"));
template.setAuthorization(new Authorization(new ViewConfig(new AdminRole(new CaseInsensitiveString("another-role")))));
TemplatesConfig templates = new TemplatesConfig(template);
assertThat(templates.hasViewAccessToTemplate(template, templateViewUser, roles, false), is(false));
}
private PipelineTemplateConfig template(final String name) {
return new PipelineTemplateConfig(new CaseInsensitiveString(name), StageConfigMother.stageConfig("stage1"));
}
private Role getSecurityConfigRole(CaseInsensitiveString templateAdmin) {
return new RoleConfig(new CaseInsensitiveString("role1"), new RoleUser(templateAdmin));
}
private List<Role> setupRoles(Role securityConfigRole) {
List<Role> roles = new ArrayList<>();
roles.add(securityConfigRole);
return roles;
}
private TemplatesConfig configForUserWhoCanViewATemplate() {
ArrayList<PipelineTemplateConfig> templateList = new ArrayList<>();
templateList.add(PipelineTemplateConfigMother.createTemplate("template100", StageConfigMother.manualStage("stage-name")));
return new TemplatesConfig(templateList.toArray(new PipelineTemplateConfig[0]));
}
}
| {'content_hash': '8a9f450147094be86726f947fdad291b', 'timestamp': '', 'source': 'github', 'line_count': 281, 'max_line_length': 225, 'avg_line_length': 51.29893238434164, 'alnum_prop': 0.7544918487686437, 'repo_name': 'marques-work/gocd', 'id': 'a68d6138753c2f4741815e7c04b7fe350980cbf2', 'size': '15016', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'config/config-api/src/test/java/com/thoughtworks/go/config/TemplatesConfigTest.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '466'}, {'name': 'CSS', 'bytes': '807605'}, {'name': 'FreeMarker', 'bytes': '9759'}, {'name': 'Groovy', 'bytes': '2317159'}, {'name': 'HTML', 'bytes': '641338'}, {'name': 'Java', 'bytes': '21014983'}, {'name': 'JavaScript', 'bytes': '2539248'}, {'name': 'NSIS', 'bytes': '23525'}, {'name': 'PowerShell', 'bytes': '691'}, {'name': 'Ruby', 'bytes': '1907011'}, {'name': 'Shell', 'bytes': '169586'}, {'name': 'TSQL', 'bytes': '200114'}, {'name': 'TypeScript', 'bytes': '3423163'}, {'name': 'XSLT', 'bytes': '203240'}]} |
using System;
namespace Refly.CodeDom.Collections
{
/// <summary>
/// A collection of elements of type ThrowedExceptionDeclaration
/// </summary>
public class ThrowedExceptionDeclarationCollection: System.Collections.CollectionBase
{
/// <summary>
/// Initializes a new empty instance of the ThrowedExceptionDeclarationCollection class.
/// </summary>
public ThrowedExceptionDeclarationCollection()
{
// empty
}
/// <summary>
/// Initializes a new instance of the ThrowedExceptionDeclarationCollection class, containing elements
/// copied from an array.
/// </summary>
/// <param name="items">
/// The array whose elements are to be added to the new ThrowedExceptionDeclarationCollection.
/// </param>
public ThrowedExceptionDeclarationCollection(ThrowedExceptionDeclaration[] items)
{
this.AddRange(items);
}
/// <summary>
/// Initializes a new instance of the ThrowedExceptionDeclarationCollection class, containing elements
/// copied from another instance of ThrowedExceptionDeclarationCollection
/// </summary>
/// <param name="items">
/// The ThrowedExceptionDeclarationCollection whose elements are to be added to the new ThrowedExceptionDeclarationCollection.
/// </param>
public ThrowedExceptionDeclarationCollection(ThrowedExceptionDeclarationCollection items)
{
this.AddRange(items);
}
/// <summary>
/// Adds the elements of an array to the end of this ThrowedExceptionDeclarationCollection.
/// </summary>
/// <param name="items">
/// The array whose elements are to be added to the end of this ThrowedExceptionDeclarationCollection.
/// </param>
public virtual void AddRange(ThrowedExceptionDeclaration[] items)
{
foreach (ThrowedExceptionDeclaration item in items)
{
this.List.Add(item);
}
}
/// <summary>
/// Adds the elements of another ThrowedExceptionDeclarationCollection to the end of this ThrowedExceptionDeclarationCollection.
/// </summary>
/// <param name="items">
/// The ThrowedExceptionDeclarationCollection whose elements are to be added to the end of this ThrowedExceptionDeclarationCollection.
/// </param>
public virtual void AddRange(ThrowedExceptionDeclarationCollection items)
{
foreach (ThrowedExceptionDeclaration item in items)
{
this.List.Add(item);
}
}
/// <summary>
/// Adds an instance of type ThrowedExceptionDeclaration to the end of this ThrowedExceptionDeclarationCollection.
/// </summary>
/// <param name="value">
/// The ThrowedExceptionDeclaration to be added to the end of this ThrowedExceptionDeclarationCollection.
/// </param>
public virtual void Add(ThrowedExceptionDeclaration value)
{
this.List.Add(value);
}
/// <summary>
/// Determines whether a specfic ThrowedExceptionDeclaration value is in this ThrowedExceptionDeclarationCollection.
/// </summary>
/// <param name="value">
/// The ThrowedExceptionDeclaration value to locate in this ThrowedExceptionDeclarationCollection.
/// </param>
/// <returns>
/// true if value is found in this ThrowedExceptionDeclarationCollection;
/// false otherwise.
/// </returns>
public virtual bool Contains(ThrowedExceptionDeclaration value)
{
return this.List.Contains(value);
}
/// <summary>
/// Return the zero-based index of the first occurrence of a specific value
/// in this ThrowedExceptionDeclarationCollection
/// </summary>
/// <param name="value">
/// The ThrowedExceptionDeclaration value to locate in the ThrowedExceptionDeclarationCollection.
/// </param>
/// <returns>
/// The zero-based index of the first occurrence of the _ELEMENT value if found;
/// -1 otherwise.
/// </returns>
public virtual int IndexOf(ThrowedExceptionDeclaration value)
{
return this.List.IndexOf(value);
}
/// <summary>
/// Inserts an element into the ThrowedExceptionDeclarationCollection at the specified index
/// </summary>
/// <param name="index">
/// The index at which the ThrowedExceptionDeclaration is to be inserted.
/// </param>
/// <param name="value">
/// The ThrowedExceptionDeclaration to insert.
/// </param>
public virtual void Insert(int index, ThrowedExceptionDeclaration value)
{
this.List.Insert(index, value);
}
/// <summary>
/// Gets or sets the ThrowedExceptionDeclaration at the given index in this ThrowedExceptionDeclarationCollection.
/// </summary>
public virtual ThrowedExceptionDeclaration this[int index]
{
get
{
return (ThrowedExceptionDeclaration) this.List[index];
}
set
{
this.List[index] = value;
}
}
/// <summary>
/// Removes the first occurrence of a specific ThrowedExceptionDeclaration from this ThrowedExceptionDeclarationCollection.
/// </summary>
/// <param name="value">
/// The ThrowedExceptionDeclaration value to remove from this ThrowedExceptionDeclarationCollection.
/// </param>
public virtual void Remove(ThrowedExceptionDeclaration value)
{
this.List.Remove(value);
}
/// <summary>
/// Type-specific enumeration class, used by ThrowedExceptionDeclarationCollection.GetEnumerator.
/// </summary>
public class Enumerator: System.Collections.IEnumerator
{
private System.Collections.IEnumerator wrapped;
public Enumerator(ThrowedExceptionDeclarationCollection collection)
{
this.wrapped = ((System.Collections.CollectionBase)collection).GetEnumerator();
}
public ThrowedExceptionDeclaration Current
{
get
{
return (ThrowedExceptionDeclaration) (this.wrapped.Current);
}
}
object System.Collections.IEnumerator.Current
{
get
{
return (ThrowedExceptionDeclaration) (this.wrapped.Current);
}
}
public bool MoveNext()
{
return this.wrapped.MoveNext();
}
public void Reset()
{
this.wrapped.Reset();
}
}
/// <summary>
/// Returns an enumerator that can iterate through the elements of this ThrowedExceptionDeclarationCollection.
/// </summary>
/// <returns>
/// An object that implements System.Collections.IEnumerator.
/// </returns>
public new virtual ThrowedExceptionDeclarationCollection.Enumerator GetEnumerator()
{
return new ThrowedExceptionDeclarationCollection.Enumerator(this);
}
}
}
| {'content_hash': '74084b4d883217a53fc76b9d57c7b529', 'timestamp': '', 'source': 'github', 'line_count': 204, 'max_line_length': 136, 'avg_line_length': 31.764705882352942, 'alnum_prop': 0.7003086419753086, 'repo_name': 'Gallio/mbunit-v2', 'id': 'e612856e07833466776670ee3fa78c6ad58a12c7', 'size': '7479', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/refly/Refly/CodeDom/Collections/ThrowedExceptionDeclarationCollection.cs', 'mode': '33188', 'license': 'apache-2.0', 'language': []} |
package com.winterwell.maths.matrix;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import com.winterwell.maths.datastorage.Index;
import com.winterwell.utils.containers.ArrayMap;
import com.winterwell.utils.containers.Containers;
import com.winterwell.utils.containers.Pair2;
import com.winterwell.utils.web.IHasJson;
import com.winterwell.utils.web.SimpleJson;
import no.uib.cipr.matrix.Matrix;
/**
* A matrix indexed by objects. null is allowed as an index. Designed for
* low-intensity and/or sparse use.
*
* ??Using an {@link Index} with a {@link Matrix} may be better.
*
* Not thread safe (uses HashMap)
*
* @author Daniel
* @testedby ObjectMatrixTest}
*/
public class ObjectMatrix<Row, Col> implements Serializable, IHasJson {
/**
* @param klass A row name
* @return the total true instances of klass (sum the values in the row)
*/
public double getRowTotal(Row klass) {
double total = 0;
Map<Col, Double> row = getRow(klass);
for (Double d : row.values()) {
total += d;
}
return total;
}
public double getColumnTotal(Col klass) {
double t = 0;
for (Row k : getRowValues()) {
t += get(k, klass);
}
return t;
}
private static final long serialVersionUID = 1L;
private final Map<Pair2<Row, Col>, Double> backing = new HashMap<Pair2<Row, Col>, Double>();
// TODO
Map<Row,Double> mult(Map<Col,Double> objectVector) {
Map ax = new HashMap();
for(Map.Entry<Col, Double> vi : objectVector.entrySet()) {
Map<Row, Double> col = getColumn(vi.getKey());
// TODO
}
return ax;
}
public ObjectMatrix() {
}
/**
* @return Iterable over (row-key, col-key) pairs
*/
public Iterable<Pair2<Row, Col>> entries() {
return Containers.iterable(backing.keySet().iterator());
}
public double get(Row row, Col col) {
Pair2<Row, Col> k = new Pair2<Row, Col>(row, col);
Double d = backing.get(k);
return d == null ? 0 : d;
}
/**
* @param col
* @return NB: This is a fresh Map which can be edited without affect.
*/
public Map<Row, Double> getColumn(Col col) {
Set<Row> rvs = getRowValues();
Map<Row, Double> colmn = new HashMap();
for (Row row : rvs) {
double cell = get(row, col);
colmn.put(row, cell);
}
return colmn;
}
public Set<Col> getColumnValues() {
Set<Col> cols = new HashSet<Col>();
for (Pair2<Row, Col> k : backing.keySet()) {
cols.add(k.second);
}
return cols;
}
public Map<Col, Double> getRow(Row row) {
Set<Col> cols = getColumnValues();
HashMap<Col, Double> r = new HashMap<Col, Double>();
for (Col col : cols) {
r.put(col, get(row, col));
}
return r;
}
/**
* The order is not guaranteed to remain the same.
*
* @return
*/
public Set<Row> getRowValues() {
Set<Row> cols = new HashSet<Row>();
for (Pair2<Row, Col> k : backing.keySet()) {
cols.add(k.first);
}
return cols;
}
/**
* Update the matrix
*
* @param row Can be null
* @param col Can be null
* @param dx
* The weighted update.
* @return
*/
public double plus(Row row, Col col, double dx) {
Pair2<Row, Col> k = new Pair2<Row, Col>(row, col);
return Containers.plus(backing, k, dx);
}
public void removeColumn(Col c) {
Pair2[] keys = backing.keySet().toArray(new Pair2[0]);
for (Pair2<Row, Col> k : keys) {
if (c.equals(k.second)) {
backing.remove(k);
}
}
}
public void removeRow(Row r) {
Pair2[] keys = backing.keySet().toArray(new Pair2[0]);
for (Pair2<Row, Col> k : keys) {
if (r.equals(k.first)) {
backing.remove(k);
}
}
}
public void set(Row row, Col col, double value) {
Pair2<Row, Col> k = new Pair2<Row, Col>(row, col);
if (value == 0) {
backing.remove(k);
} else {
backing.put(k, value);
}
}
@Override
public String toString() {
return toString(6);
}
public String toString(int maxItems) {
StringBuilder sb = new StringBuilder();
List<Col> cols = new ArrayList<Col>(getColumnValues());
List<Row> rows = new ArrayList<Row>(getRowValues());
boolean cdots = false, rdots = false;
// Protect against giant matrices
if (cols.size() > maxItems) {
cols = cols.subList(0, 6);
cdots = true;
}
if (rows.size() > maxItems) {
rows = rows.subList(0, 6);
rdots = true;
}
// header
for (Col c : cols) {
sb.append(c);
sb.append('\t');
}
if (cdots) {
sb.append("...");
}
sb.append('\n');
// body
for (Row r : rows) {
for (Col c : cols) {
sb.append(get(r, c));
sb.append('\t');
}
sb.append(r);
sb.append('\n');
}
if (rdots) {
sb.append("...\n");
}
return sb.toString();
}
@Override
public void appendJson(StringBuilder sb) {
sb.append(toJSONString());
}
@Override
public String toJSONString() {
return new SimpleJson().toJson(toJson2());
}
/**
* Note: _not_ good for large sparse matrices.
*
* @return row -> col -> value
*/
@Override
public Map<Row,Map<Col,Double>> toJson2() {
Set<Row> rows = getRowValues();
Set<Col> cols = getColumnValues();
Map<Row, Map<Col, Double>> map = new ArrayMap();
for (Row row : rows) {
Map<Col, Double> rowMap = new ArrayMap();
for(Col col : cols) {
rowMap.put(col, get(row, col));
}
map.put(row, rowMap);
}
return map;
}
public int size() {
return backing.size();
}
}
| {'content_hash': '345f584604971d2339e7a71481746e5d', 'timestamp': '', 'source': 'github', 'line_count': 250, 'max_line_length': 93, 'avg_line_length': 21.64, 'alnum_prop': 0.6275415896487985, 'repo_name': 'sodash/open-code', 'id': '52f31bebf41af4e744431f3e3212c8480b008864', 'size': '5410', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'winterwell.maths/src/com/winterwell/maths/matrix/ObjectMatrix.java', 'mode': '33261', 'license': 'mit', 'language': [{'name': 'Batchfile', 'bytes': '22'}, {'name': 'CSS', 'bytes': '773'}, {'name': 'DIGITAL Command Language', 'bytes': '1427'}, {'name': 'HTML', 'bytes': '405784'}, {'name': 'Java', 'bytes': '4191013'}, {'name': 'JavaScript', 'bytes': '101870'}, {'name': 'Perl', 'bytes': '516'}, {'name': 'Python', 'bytes': '696'}, {'name': 'Shell', 'bytes': '16371'}]} |
import datetime
import os
import sys
from pydotplus import graphviz
import sadisplay
import octavia.db.models as models
sys.path.insert(0, os.path.abspath('../..'))
sys.path.insert(0, os.path.abspath('.'))
from tools import create_flow_docs
# Generate our flow diagrams
create_flow_docs.generate(
'tools/flow-list.txt', 'doc/source/contributor/devref/flow_diagrams')
create_flow_docs.generate(
'tools/flow-list-v2.txt', 'doc/source/contributor/devref/flow_diagrams_v2')
# Generate entity relationship diagram
desc = sadisplay.describe(
[getattr(models, attr) for attr in dir(models)],
show_methods=True,
show_properties=True,
show_indexes=True,
)
graph = graphviz.graph_from_dot_data(sadisplay.dot(desc).encode('utf-8'))
graph.write('contributor/devref/erd.svg', format='svg')
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
# sys.path.insert(0, os.path.abspath('.'))
# -- General configuration ----------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
# needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be
# extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.todo',
'sphinx.ext.viewcode',
'sphinxcontrib.blockdiag',
'sphinxcontrib.actdiag',
'sphinxcontrib.seqdiag',
'sphinxcontrib.nwdiag',
'sphinx.ext.graphviz',
'sphinx_feature_classification.support_matrix',
'openstackdocstheme',
'oslo_config.sphinxext',
'oslo_policy.sphinxpolicygen',
'sphinxcontrib.apidoc',
'sphinxcontrib.rsvgconverter',
]
todo_include_todos = True
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix of source filenames.
source_suffix = '.rst'
# The encoding of source files.
# source_encoding = 'utf-8-sig'
# The master toctree document.
master_doc = 'index'
# General information about the project.
copyright = '2014-2019, OpenStack Octavia Team'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
# language = None
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
# today = ''
# Else, today_fmt is used as the format for a strftime call.
# today_fmt = '%B %d, %Y'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = [
'_build',
'contributor/specs/skeleton.rst',
'contributor/specs/template.rst'
]
# The reST default role (used for this markup: `text`) to use for all
# documents.
# default_role = None
# If true, '()' will be appended to :func: etc. cross-reference text.
# add_function_parentheses = True
# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
add_module_names = False
# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
show_authors = False
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'native'
# A list of ignored prefixes for module index sorting.
modindex_common_prefix = ['octavia.']
# -- Options for man page output ----------------------------------------------
man_pages = []
# -- Options for HTML output --------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'openstackdocs'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
# html_theme_options = {}
html_theme_options = {'show_other_versions': True}
# Add any paths that contain custom themes here, relative to this directory.
# html_theme_path = []
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
# html_title = None
# A shorter title for the navigation bar. Default is the same as html_title.
# html_short_title = None
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
# html_logo = None
# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
# html_favicon = None
html_static_path = ['_static']
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
# html_use_smartypants = True
# Custom sidebar templates, maps document names to template names.
# html_sidebars = {}
# Additional templates that should be rendered to pages, maps page names to
# template names.
# html_additional_pages = {}
# If false, no module index is generated.
html_domain_indices = True
# If false, no index is generated.
html_use_index = True
# If true, the index is split into individual pages for each letter.
# html_split_index = False
# If true, links to the reST sources are added to the pages.
# html_show_sourcelink = True
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
# html_show_sphinx = True
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
# html_show_copyright = True
# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
# html_use_opensearch = ''
# This is the file name suffix for HTML files (e.g. ".xhtml").
# html_file_suffix = None
# Output file base name for HTML help builder.
htmlhelp_basename = 'Octavia-Specsdoc'
# -- Options for LaTeX output -------------------------------------------------
# Fix Unicode character for sphinx_feature_classification
# Sphinx default latex engine (pdflatex) doesn't know much unicode
latex_preamble = r"""
\usepackage{newunicodechar}
\newunicodechar{✖}{\sffamily X}
\setcounter{tocdepth}{2}
\authoraddress{\textcopyright %s OpenStack Foundation}
""" % datetime.datetime.now().year
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
# openany: Skip blank pages in generated PDFs
'extraclassoptions': 'openany,oneside',
'makeindex': '',
'printindex': '',
'preamble': latex_preamble
}
# Disable usage of xindy https://bugzilla.redhat.com/show_bug.cgi?id=1643664
# Some distros are missing xindy
latex_use_xindy = False
# Fix missing apostrophe
smartquotes_excludes = {'builders': ['latex']}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass
# [howto/manual]).
latex_documents = [(
'index',
'doc-octavia.tex',
'Octavia Documentation',
'OpenStack Octavia Team',
'manual'
)]
# The name of an image file (relative to this directory) to place at the top of
# the title page.
# latex_logo = None
# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
# latex_use_parts = False
# If true, show page references after internal links.
# latex_show_pagerefs = False
# If true, show URL addresses after external links.
# latex_show_urls = False
# Documents to append as an appendix to all manuals.
# latex_appendices = []
# If false, no module index is generated.
latex_domain_indices = False
# -- Options for Texinfo output -----------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [(
'index',
'Octavia-specs',
'Octavia Design Specs',
'OpenStack Octavia Team',
'octavia-specs',
'Design specifications for the Octavia project.',
'Miscellaneous'
)]
# Documents to append as an appendix to all manuals.
# texinfo_appendices = []
# If false, no module index is generated.
# texinfo_domain_indices = True
# How to display URL addresses: 'footnote', 'no', or 'inline'.
# texinfo_show_urls = 'footnote'
# -- Options for Epub output --------------------------------------------------
# Bibliographic Dublin Core info.
epub_title = 'Octavia Specs'
epub_author = 'OpenStack Octavia Team'
epub_publisher = 'OpenStack Octavia Team'
epub_copyright = '2014, OpenStack Octavia Team'
# The language of the text. It defaults to the language option
# or en if the language is not set.
# epub_language = ''
# The scheme of the identifier. Typical schemes are ISBN or URL.
# epub_scheme = ''
# The unique identifier of the text. This can be an ISBN number
# or the project homepage.
# epub_identifier = ''
# A unique identification for the text.
# epub_uid = ''
# A tuple containing the cover image and cover page html template filenames.
# epub_cover = ()
# HTML files that should be inserted before the pages created by sphinx.
# The format is a list of tuples containing the path and title.
# epub_pre_files = []
# HTML files shat should be inserted after the pages created by sphinx.
# The format is a list of tuples containing the path and title.
# epub_post_files = []
# A list of files that should not be packed into the epub file.
# epub_exclude_files = []
# The depth of the table of contents in toc.ncx.
# epub_tocdepth = 3
# Allow duplicate toc entries.
# epub_tocdup = True
# RBAC sample policy file generation
policy_generator_config_file = '../../etc/policy/octavia-policy-generator.conf'
sample_policy_basename = 'configuration/_static/octavia'
openstackdocs_repo_name = 'openstack/octavia'
openstackdocs_pdf_link = True
openstackdocs_bug_project = '908'
openstackdocs_bug_tag = 'docs'
apidoc_output_dir = 'contributor/modules'
apidoc_module_dir = '../../octavia'
apidoc_excluded_paths = [
'tests',
'db/migration'
]
| {'content_hash': '7e256f632ba727f94257ac9ab938c241', 'timestamp': '', 'source': 'github', 'line_count': 339, 'max_line_length': 79, 'avg_line_length': 30.404129793510325, 'alnum_prop': 0.7008828951198215, 'repo_name': 'openstack/octavia', 'id': '17e52265f93573ca545ffd41bb29d925d2c2b4cb', 'size': '10729', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'doc/source/conf.py', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Jinja', 'bytes': '60600'}, {'name': 'Mako', 'bytes': '922'}, {'name': 'Python', 'bytes': '6651664'}, {'name': 'Ruby', 'bytes': '531'}, {'name': 'Shell', 'bytes': '117966'}]} |
[![NPM Version](https://img.shields.io/npm/v/vscode-languageserver.svg)](https://npmjs.org/package/vscode-languageserver)
[![NPM Downloads](https://img.shields.io/npm/dm/vscode-languageserver.svg)](https://npmjs.org/package/vscode-languageserver)
[![Build Status](https://travis-ci.org/Microsoft/vscode-languageserver-node.svg?branch=master)](https://travis-ci.org/Microsoft/vscode-languageserver-node)
Npm module to implement a VSCode language server using [Node.js](https://nodejs.org/) as a runtime.
Click [here](https://code.visualstudio.com/docs/extensions/example-language-server) for a detailed document on how to use this npm module
to implement language servers for [VSCode](https://code.visualstudio.com/). | {'content_hash': '8e8493dea45a7a948e65a640d7a3ebe7', 'timestamp': '', 'source': 'github', 'line_count': 8, 'max_line_length': 155, 'avg_line_length': 89.75, 'alnum_prop': 0.7813370473537604, 'repo_name': 'liwangqian/IntelliLua', 'id': 'd44636537738a8858c5ac5cafafbcd21467a507a', 'size': '744', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'server/node_modules/vscode-languageserver/README.md', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Batchfile', 'bytes': '470'}, {'name': 'JavaScript', 'bytes': '57793'}, {'name': 'Shell', 'bytes': '728'}]} |
ScenarioUtils 是为spring boot bean对象做输出过滤编写的一个简单工具集。该工具支持让你编写的服务不再需要根据不同需求编写新的Bean。少编写点些胶水代码身心才健康。
使用方法:
```Java
public class Project extends ScenarioModel implements Serializable {
private Integer id;
private String name;
static public final String LIST_SCENARIO = "LIST_SCENARIO";
static public final String DETAIL_SCENARIO = "DETAIL_SCENARIO";
@Override
public HashMap<String, List<String>> scenarios(){
HashMap<String, List<String>> scenarios = super.scenarios();
List<String> fields = new ArrayList<String>();
String[] attrs = {"id"};
Collections.addAll(fields, attrs);
scenarios.put(Project.LIST_SCENARIO, fields);
fields = new ArrayList<String>();
String[] attrs1 = {"id", "name"};
Collections.addAll(fields, attrs1);
scenarios.put(Project.DETAIL_SCENARIO, fields);
return scenarios;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
}
```
使用场景:
```Java
@RestController
class ProjectController {
@RequestMapping(value = "/list", method = RequestMethod.GET)
public @ResponseBody RestResponse<Project> list(){
Project project = new Project();
project.id = 1;
project.name = "hello";
project.setScenario(Project.LIST_SCENARIO);
return new RestResponse<Project>(project, 1, "ok");
}
@RequestMapping(value = "/detail", method = RequestMethod.GET)
public @ResponseBody RestResponse<Project> detail(){
Project project = new Project();
project.id = 1;
project.name = "hello";
project.setScenario(Project.DETAIL_SCENARIO);
return new RestResponse<Project>(project, 1, "ok");
}
}
```
输出结果:
/list 输出为:
{code:1,message:"ok",data:{id:1} }
/detail 输出为:
{code:1,message:"ok",data:{id:1,name:"hello"} }
赞赏支持请点击地址:http://www.jianshu.com/p/5c6615a9b244
| {'content_hash': '97c0b6c08307bef91f5fcd6012785ba5', 'timestamp': '', 'source': 'github', 'line_count': 89, 'max_line_length': 96, 'avg_line_length': 24.39325842696629, 'alnum_prop': 0.6448641179180101, 'repo_name': 'linwaiwai/ScenarioUtils', 'id': '7bb88ab04b0b6017558c3c1ce60c8008fe13b599', 'size': '2378', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'README.md', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '12188'}]} |
package org.zalando.baigan.service.github;
/**
* This class had a typo in its name and is being kept for backwards compatibility only
*
* @deprecated use {@link GitConfigurationRepository} instead.
*/
@Deprecated
public final class GitConfigurationRespository extends GitConfigurationRepository {
@Deprecated
public GitConfigurationRespository(long refreshIntervalInMinutes, GitConfig gitConfig) {
super(refreshIntervalInMinutes, gitConfig);
}
}
| {'content_hash': 'a315b37da30ab39b0f3c3c2dcf7ff3bb', 'timestamp': '', 'source': 'github', 'line_count': 15, 'max_line_length': 92, 'avg_line_length': 31.466666666666665, 'alnum_prop': 0.7796610169491526, 'repo_name': 'zalando/baigan-config', 'id': '0eba10ddd46ce0a791eaf57e3aaa8548918b9b84', 'size': '472', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/main/java/org/zalando/baigan/service/github/GitConfigurationRespository.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '111608'}]} |
@interface SSUDetailTableViewController ()
@property (weak, nonatomic) SSUDetailTableViewController* container;
@property (strong, nonatomic) NSString* entityName;
@property (strong, nonatomic) NSString* attributeName;
@property (strong, nonatomic) id attributeValue;
@property (strong, nonatomic) NSManagedObjectContext* context;
@property (strong, nonatomic) NSManagedObject* object;
@property (strong, nonatomic) NSMutableSet * hiddenIndices;
@end
@implementation SSUDetailTableViewController
- (void) loadObject:(NSManagedObject*)object inContext:(NSManagedObjectContext*)context {
[self setContext:context];
[self setObject:object];
[self updateObject];
}
- (void) setObject:(NSManagedObject *)object {
_object = object;
if ([_container respondsToSelector:@selector(setObject:)]) {
SSULogDebug(@"Updating Container: %@", NSStringFromClass([_container class]));
[_container performSelector:@selector(setObject:) withObject:_object];
}
_entityName = object.entity.name;
_attributeName = @"self";
_attributeValue = object;
}
- (void)viewDidLoad
{
[super viewDidLoad];
[self updateObject];
}
- (void) viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
if ([self.delegate respondsToSelector:@selector(detailTableViewDidAppear:)])
[self.delegate detailTableViewDidAppear:self];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (NSMutableSet *) hiddenIndices {
if (_hiddenIndices) {
return _hiddenIndices;
}
_hiddenIndices = [NSMutableSet new];
return _hiddenIndices;
}
- (void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
if ([segue.identifier isEqualToString:@"container"]) {
[self setContainer:(SSUDetailTableViewController*)segue.destinationViewController];
return;
}
else {
SSULogDebug(@"%@: Unknown Segue: %@", NSStringFromClass([self class]), segue.identifier);
}
}
- (void) setContainer:(SSUDetailTableViewController *)container {
_container = container;
[_container setObject:_object];
}
- (void) updateObject {
SSULogDebug(@"Update Object");
[_container updateObject];
}
- (void) fetchObject {
SSULogDebug(@"Fetching Object");
[self setObject:[self managedObjectForEntity:_object.entity.name withAttributeName:@"self" attributeValue:_object]];
[self updateObject];
}
- (void) tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
if ([self cellHiddenAtIndexPath:indexPath]) {
cell.hidden = YES;
}
}
- (CGFloat) tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
if ([self cellHiddenAtIndexPath:indexPath]) {
return 0;
}
return UITableViewAutomaticDimension;
}
- (BOOL)tableView:(UITableView *)tableView shouldShowMenuForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell* cell = [tableView cellForRowAtIndexPath:indexPath];
return cell.tag ? cell.textLabel.enabled : NO;
}
#pragma mark - IBActions
- (BOOL)tableView:(UITableView *)tableView canPerformAction:(SEL)action forRowAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender
{
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
return (action == @selector(copy:) && (cell.textLabel || cell.detailTextLabel));
}
- (void)tableView:(UITableView *)tableView performAction:(SEL)action forRowAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender
{
if (action == @selector(copy:)) {
UIPasteboard *board = [UIPasteboard generalPasteboard];
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
NSString * pasteData = cell.textLabel.text;
if (pasteData) {
board.string = pasteData;
}
else if ((pasteData = cell.detailTextLabel.text)) {
board.string = pasteData;
}
[tableView deselectRowAtIndexPath:indexPath animated:YES];
}
}
- (NSManagedObject*) managedObjectForEntity:(NSString*)entityName withAttributeName:(NSString*)attributeName attributeValue:(id)attributeValue {
NSManagedObjectContext* context = _context;
NSFetchRequest *request = [[NSFetchRequest alloc] init];
[request setIncludesSubentities:NO];
request.entity = [NSEntityDescription entityForName:entityName inManagedObjectContext:context];
request.predicate = [NSPredicate predicateWithFormat:@"%K == %@", _attributeName, _attributeValue];
SSULogDebug(@"Fetching object...");
NSError *error = nil;
NSArray* results = [context executeFetchRequest:request error:&error];
if (error) {
SSULogError(@"Error: %@", error.debugDescription);
}
return (NSManagedObject*)[results lastObject];
}
#pragma mark - Cell Hiding
- (void) hideCellAtIndexPath:(NSIndexPath *)indexPath {
// indexPath is not guaranteed to be an NSIndexPath, ie can be a UIMutableIndexPath etc.
// so the [NSMutableSet containsObject:] method will fail since isEqual: will always be false
// To work around this, create a new NSIndexPath
NSIndexPath * path = [NSIndexPath indexPathForRow:indexPath.row inSection:indexPath.section];
[self.hiddenIndices addObject:path];
}
- (void) unhideCellAtIndexPath:(NSIndexPath *)indexPath {
NSIndexPath * path = [NSIndexPath indexPathForRow:indexPath.row inSection:indexPath.section];
[self.hiddenIndices removeObject:path];
}
- (void) unhideAllCells {
[self.hiddenIndices removeAllObjects];
}
- (BOOL) cellHiddenAtIndexPath:(NSIndexPath *)indexPath {
NSIndexPath * path = [NSIndexPath indexPathForRow:indexPath.row inSection:indexPath.section];
return [self.hiddenIndices containsObject:path];
}
@end
| {'content_hash': '0f152249332d8cc86218560a47d4812f', 'timestamp': '', 'source': 'github', 'line_count': 178, 'max_line_length': 144, 'avg_line_length': 32.938202247191015, 'alnum_prop': 0.7168684973563022, 'repo_name': 'SSU-CS-Department/ssumobile-ios', 'id': '0b1a7966ea933081f0fde81ceecea4140f4245c7', 'size': '6126', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'SSUMobile/Modules/Core/View Controllers/SSUDetailTableViewController.m', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'C', 'bytes': '261'}, {'name': 'Objective-C', 'bytes': '317367'}, {'name': 'Ruby', 'bytes': '1231'}, {'name': 'Swift', 'bytes': '230777'}]} |
.image_menu a {
width: 100%;
height: 22px;
display: block;
text-decoration: none;
color: #000000;
text-indent: 3px;
}
.image_menu a:hover {
color: #000000;
background: url("../img/image_menu_active_bg.gif") repeat-x;
text-decoration: none;
}
.image_menu ul {
display: inline;
}
.image_menu li {
list-style: none;
display: inline;
} | {'content_hash': '8aa17d8b34370b0f3a0f49139a06ec46', 'timestamp': '', 'source': 'github', 'line_count': 23, 'max_line_length': 60, 'avg_line_length': 14.521739130434783, 'alnum_prop': 0.688622754491018, 'repo_name': 'NickTaporuk/cloth', 'id': '30cb1571aa51920d75a0289c46fea9971a7a5937', 'size': '334', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'simpla/design/js/tiny_mce/plugins/smimage/css/menu.css', 'mode': '33261', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '185669'}, {'name': 'Java', 'bytes': '35588'}, {'name': 'JavaScript', 'bytes': '3052880'}, {'name': 'LiveScript', 'bytes': '6103'}, {'name': 'PHP', 'bytes': '3417639'}, {'name': 'Perl', 'bytes': '67663'}, {'name': 'Shell', 'bytes': '334'}]} |
<section>
<h2>data-include-sync</h2>
<p>
Inclusion is normally asynchronous, which means that the content may or may not get further
processed by ReSpec depending on the point at which it gets inserted (which isn't
deterministic). If you need to ensure that content gets injected before the rest of the
pipeline runs, set this to any truthy value.
</p>
<p>
Be warned that there is a steep performance penalty in doing so, since all ReSpec processing
will effectively pause until the content has been fully fetched and inserted.
</p>
</section>
| {'content_hash': 'a25e3abe3ce31da3d10f15477a8af4eb', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 96, 'avg_line_length': 44.53846153846154, 'alnum_prop': 0.7357512953367875, 'repo_name': 'stevefaulkner/respec-docs', 'id': 'c55fc5724cf0e47721cd42dbf2b5a5ec4bb672af', 'size': '579', 'binary': False, 'copies': '2', 'ref': 'refs/heads/gh-pages', 'path': 'src/attrs/data-include-sync.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '3069'}, {'name': 'HTML', 'bytes': '240257'}, {'name': 'JavaScript', 'bytes': '4144'}]} |
package com.stelinno.uddi.search;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class VersionController {
@Autowired
private String version;
@RequestMapping(value="/version", method=RequestMethod.GET)
public String version() {
return version;
}
}
| {'content_hash': '8c1f79025beba9aa2dff841da6f257e0', 'timestamp': '', 'source': 'github', 'line_count': 18, 'max_line_length': 62, 'avg_line_length': 27.055555555555557, 'alnum_prop': 0.8172484599589322, 'repo_name': 'michaelringholm/gcloud-demo', 'id': 'aad1ea0d2392e1fbc8ef5683b660d501cbbf3d6f', 'size': '487', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'search/src/main/java/com/stelinno/uddi/search/VersionController.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '1631'}, {'name': 'HTML', 'bytes': '3287'}, {'name': 'Java', 'bytes': '115419'}, {'name': 'JavaScript', 'bytes': '1040'}, {'name': 'Shell', 'bytes': '4108'}]} |
> [Docker hub](https://hub.docker.com/_/postgres)
```
$ docker pull postgres:<tag>
```
### Run
```
$ docker run -d --name <container_name> -d -p 5432:5432 -v <local_path>:/var/lib/postgresql/data -e POSTGRES_DB=<db_name> -e POSTGRES_USER='<user_name>' -e POSTGRES_PASSWORD='<user_pwd>' postgres[:<tag>]
```
Environment variables ([Reference](https://github.com/GoogleCloudPlatform/postgresql-docker/blob/master/9/README.md#environment-variables)):
| Variable | Description | Required | Default value |
|:---------|:------------|:--------:|:--------------|
| POSTGRES_DB | Specifies the name of the default database to be created when the image is first started | | The value of $POSTGRES_USER |
| POSTGRES_USER | Superuser's name | | `postgres` |
| POSTGRES_PASSWORD | Password | Yes | |
| POSTGRES_INITDB_ARGS | Arguments to postgres initdb. For example, `--data-checksums --encoding=UTF8` | | |
For example,
```
$ docker run -d --name demo-postgres -d -p 5432:5432 -v /postgres:/var/lib/postgresql/data -e POSTGRES_DB=Demo -e POSTGRES_USER=admin -e POSTGRES_PASSWORD='12qwaszx' postgres:10
$ docker start demo-postgres
$ docker port demo-postgres
5432/tcp -> 0.0.0.0:5432
```
## pgAdmin 4
> [Docker hub](https://hub.docker.com/r/dpage/pgadmin4/)
```
$ docker pull dpage/pgadmin4:<tag>
```
### Run
```
$ docker -d run -p <port>:80 --name <container_name> \
-e "PGADMIN_DEFAULT_EMAIL=<your_email_address>" \
-e "PGADMIN_DEFAULT_PASSWORD=<your_password>" \
dpage/pgadmin4:<tag>
```
Environment variables ([Reference](https://hub.docker.com/r/dpage/pgadmin4/)):
| Variable | Description | Required | Default value |
|:---------|:------------|:--------:|:--------------|
| PGADMIN_DEFAULT_EMAIL | The initial administrator account to login to pgAdmin | Yes | |
| PGADMIN_DEFAULT_PASSWORD | the initial administrator account's password | | |
| PGADMIN_ENABLE_TLS | If set to any value, the container will listen on port 443 for TLS connections | | `null` |
| PGADMIN_LISTEN_PORT | Port | | `80` or `443`(if `PGADMIN_ENABLE_TLS` is enabled) |
| GUNICORN_THREADS | The number of threads for handling incoming requests in Gunicorn (web server). Increase it in a highly-loaded environment | | `25` |
> Notice if the TLS connection is enabled, a certificate and key must be provided and mounted to container's
> - /certs/server.crt
> - /certs/server.key
For example,
```
$ docker run -d -p 5431:80 --name demo-pgadmin \
-v /postgres/pgadmin/data:/var/lib/pgadmin \
-v "/postgres/pgadmin/servers.json:/servers.json" \
-e "[email protected]" \
-e "PGADMIN_DEFAULT_PASSWORD=12qwaszx" \
dpage/pgadmin4:4
$ docker start demo-pgadmin
$ docker port demo-pgadmin
```
Enable TLS connection:
```
docker run -p 443:443 \
-v "/path/to/certificate.cert:/certs/server.cert" \
-v "/path/to/certificate.key:/certs/server.key" \
-v "/tmp/servers.json:/servers.json" \
-e "[email protected]" \
-e "PGADMIN_DEFAULT_PASSWORD=xxxxxxx" \
-e "PGADMIN_ENABLE_TLS=True" \
-d dpage/pgadmin4:4
```
![](assets/001.png)
### Docker compose
![docker-compose.yml](https://github.com/KarateJB/Dockerfiles/blob/master/PostgreSQL/docker-compose.yml)
| {'content_hash': '58607850fb78317aad7481393e42c5ce', 'timestamp': '', 'source': 'github', 'line_count': 107, 'max_line_length': 203, 'avg_line_length': 30.990654205607477, 'alnum_prop': 0.6544028950542823, 'repo_name': 'KarateJB/eBooks', 'id': 'd1560e9b89880919dce5036940fcadad0f397084', 'size': '3351', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'DevOps/Docker/09. DB Server/PostgreSQL/README.md', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Dockerfile', 'bytes': '898'}, {'name': 'HTML', 'bytes': '43752'}, {'name': 'JavaScript', 'bytes': '52301'}, {'name': 'Vue', 'bytes': '63324'}]} |
package internal
import (
"context"
"sync"
"sync/atomic"
"unsafe"
"go.opentelemetry.io/otel/api/kv"
"go.opentelemetry.io/otel/api/metric"
"go.opentelemetry.io/otel/api/metric/registry"
)
// This file contains the forwarding implementation of metric.Provider
// used as the default global instance. Metric events using instruments
// provided by this implementation are no-ops until the first Meter
// implementation is set as the global provider.
//
// The implementation here uses Mutexes to maintain a list of active
// Meters in the Provider and Instruments in each Meter, under the
// assumption that these interfaces are not performance-critical.
//
// We have the invariant that setDelegate() will be called before a
// new metric.Provider implementation is registered as the global
// provider. Mutexes in the Provider and Meters ensure that each
// instrument has a delegate before the global provider is set.
//
// Bound instrument operations are implemented by delegating to the
// instrument after it is registered, with a sync.Once initializer to
// protect against races with Release().
//
// Metric uniqueness checking is implemented by calling the exported
// methods of the api/metric/registry package.
type meterKey struct {
Name, Version string
}
type meterProvider struct {
delegate metric.Provider
// lock protects `delegate` and `meters`.
lock sync.Mutex
// meters maintains a unique entry for every named Meter
// that has been registered through the global instance.
meters map[meterKey]*meterEntry
}
type meterImpl struct {
delegate unsafe.Pointer // (*metric.MeterImpl)
lock sync.Mutex
syncInsts []*syncImpl
asyncInsts []*asyncImpl
}
type meterEntry struct {
unique metric.MeterImpl
impl meterImpl
}
type instrument struct {
descriptor metric.Descriptor
}
type syncImpl struct {
delegate unsafe.Pointer // (*metric.SyncImpl)
instrument
}
type asyncImpl struct {
delegate unsafe.Pointer // (*metric.AsyncImpl)
instrument
runner metric.AsyncRunner
}
// SyncImpler is implemented by all of the sync metric
// instruments.
type SyncImpler interface {
SyncImpl() metric.SyncImpl
}
// AsyncImpler is implemented by all of the async
// metric instruments.
type AsyncImpler interface {
AsyncImpl() metric.AsyncImpl
}
type syncHandle struct {
delegate unsafe.Pointer // (*metric.HandleImpl)
inst *syncImpl
labels []kv.KeyValue
initialize sync.Once
}
var _ metric.Provider = &meterProvider{}
var _ metric.MeterImpl = &meterImpl{}
var _ metric.InstrumentImpl = &syncImpl{}
var _ metric.BoundSyncImpl = &syncHandle{}
var _ metric.AsyncImpl = &asyncImpl{}
func (inst *instrument) Descriptor() metric.Descriptor {
return inst.descriptor
}
// Provider interface and delegation
func newMeterProvider() *meterProvider {
return &meterProvider{
meters: map[meterKey]*meterEntry{},
}
}
func (p *meterProvider) setDelegate(provider metric.Provider) {
p.lock.Lock()
defer p.lock.Unlock()
p.delegate = provider
for key, entry := range p.meters {
entry.impl.setDelegate(key.Name, key.Version, provider)
}
p.meters = nil
}
func (p *meterProvider) Meter(instrumentationName string, opts ...metric.MeterOption) metric.Meter {
p.lock.Lock()
defer p.lock.Unlock()
if p.delegate != nil {
return p.delegate.Meter(instrumentationName, opts...)
}
key := meterKey{
Name: instrumentationName,
Version: metric.ConfigureMeter(opts).InstrumentationVersion,
}
entry, ok := p.meters[key]
if !ok {
entry = &meterEntry{}
entry.unique = registry.NewUniqueInstrumentMeterImpl(&entry.impl)
p.meters[key] = entry
}
return metric.WrapMeterImpl(entry.unique, key.Name, metric.WithInstrumentationVersion(key.Version))
}
// Meter interface and delegation
func (m *meterImpl) setDelegate(name, version string, provider metric.Provider) {
m.lock.Lock()
defer m.lock.Unlock()
d := new(metric.MeterImpl)
*d = provider.Meter(name, metric.WithInstrumentationVersion(version)).MeterImpl()
m.delegate = unsafe.Pointer(d)
for _, inst := range m.syncInsts {
inst.setDelegate(*d)
}
m.syncInsts = nil
for _, obs := range m.asyncInsts {
obs.setDelegate(*d)
}
m.asyncInsts = nil
}
func (m *meterImpl) NewSyncInstrument(desc metric.Descriptor) (metric.SyncImpl, error) {
m.lock.Lock()
defer m.lock.Unlock()
if meterPtr := (*metric.MeterImpl)(atomic.LoadPointer(&m.delegate)); meterPtr != nil {
return (*meterPtr).NewSyncInstrument(desc)
}
inst := &syncImpl{
instrument: instrument{
descriptor: desc,
},
}
m.syncInsts = append(m.syncInsts, inst)
return inst, nil
}
// Synchronous delegation
func (inst *syncImpl) setDelegate(d metric.MeterImpl) {
implPtr := new(metric.SyncImpl)
var err error
*implPtr, err = d.NewSyncInstrument(inst.descriptor)
if err != nil {
// TODO: There is no standard way to deliver this error to the user.
// See https://github.com/open-telemetry/opentelemetry-go/issues/514
// Note that the default SDK will not generate any errors yet, this is
// only for added safety.
panic(err)
}
atomic.StorePointer(&inst.delegate, unsafe.Pointer(implPtr))
}
func (inst *syncImpl) Implementation() interface{} {
if implPtr := (*metric.SyncImpl)(atomic.LoadPointer(&inst.delegate)); implPtr != nil {
return (*implPtr).Implementation()
}
return inst
}
func (inst *syncImpl) Bind(labels []kv.KeyValue) metric.BoundSyncImpl {
if implPtr := (*metric.SyncImpl)(atomic.LoadPointer(&inst.delegate)); implPtr != nil {
return (*implPtr).Bind(labels)
}
return &syncHandle{
inst: inst,
labels: labels,
}
}
func (bound *syncHandle) Unbind() {
bound.initialize.Do(func() {})
implPtr := (*metric.BoundSyncImpl)(atomic.LoadPointer(&bound.delegate))
if implPtr == nil {
return
}
(*implPtr).Unbind()
}
// Async delegation
func (m *meterImpl) NewAsyncInstrument(
desc metric.Descriptor,
runner metric.AsyncRunner,
) (metric.AsyncImpl, error) {
m.lock.Lock()
defer m.lock.Unlock()
if meterPtr := (*metric.MeterImpl)(atomic.LoadPointer(&m.delegate)); meterPtr != nil {
return (*meterPtr).NewAsyncInstrument(desc, runner)
}
inst := &asyncImpl{
instrument: instrument{
descriptor: desc,
},
runner: runner,
}
m.asyncInsts = append(m.asyncInsts, inst)
return inst, nil
}
func (obs *asyncImpl) Implementation() interface{} {
if implPtr := (*metric.AsyncImpl)(atomic.LoadPointer(&obs.delegate)); implPtr != nil {
return (*implPtr).Implementation()
}
return obs
}
func (obs *asyncImpl) setDelegate(d metric.MeterImpl) {
implPtr := new(metric.AsyncImpl)
var err error
*implPtr, err = d.NewAsyncInstrument(obs.descriptor, obs.runner)
if err != nil {
// TODO: There is no standard way to deliver this error to the user.
// See https://github.com/open-telemetry/opentelemetry-go/issues/514
// Note that the default SDK will not generate any errors yet, this is
// only for added safety.
panic(err)
}
atomic.StorePointer(&obs.delegate, unsafe.Pointer(implPtr))
}
// Metric updates
func (m *meterImpl) RecordBatch(ctx context.Context, labels []kv.KeyValue, measurements ...metric.Measurement) {
if delegatePtr := (*metric.MeterImpl)(atomic.LoadPointer(&m.delegate)); delegatePtr != nil {
(*delegatePtr).RecordBatch(ctx, labels, measurements...)
}
}
func (inst *syncImpl) RecordOne(ctx context.Context, number metric.Number, labels []kv.KeyValue) {
if instPtr := (*metric.SyncImpl)(atomic.LoadPointer(&inst.delegate)); instPtr != nil {
(*instPtr).RecordOne(ctx, number, labels)
}
}
// Bound instrument initialization
func (bound *syncHandle) RecordOne(ctx context.Context, number metric.Number) {
instPtr := (*metric.SyncImpl)(atomic.LoadPointer(&bound.inst.delegate))
if instPtr == nil {
return
}
var implPtr *metric.BoundSyncImpl
bound.initialize.Do(func() {
implPtr = new(metric.BoundSyncImpl)
*implPtr = (*instPtr).Bind(bound.labels)
atomic.StorePointer(&bound.delegate, unsafe.Pointer(implPtr))
})
if implPtr == nil {
implPtr = (*metric.BoundSyncImpl)(atomic.LoadPointer(&bound.delegate))
}
// This may still be nil if instrument was created and bound
// without a delegate, then the instrument was set to have a
// delegate and unbound.
if implPtr == nil {
return
}
(*implPtr).RecordOne(ctx, number)
}
func AtomicFieldOffsets() map[string]uintptr {
return map[string]uintptr{
"meterProvider.delegate": unsafe.Offsetof(meterProvider{}.delegate),
"meterImpl.delegate": unsafe.Offsetof(meterImpl{}.delegate),
"syncImpl.delegate": unsafe.Offsetof(syncImpl{}.delegate),
"asyncImpl.delegate": unsafe.Offsetof(asyncImpl{}.delegate),
"syncHandle.delegate": unsafe.Offsetof(syncHandle{}.delegate),
}
}
| {'content_hash': '34fcd26c6ac0495605ec62ba87b72f13', 'timestamp': '', 'source': 'github', 'line_count': 333, 'max_line_length': 112, 'avg_line_length': 26.00900900900901, 'alnum_prop': 0.7284378247315553, 'repo_name': 'knative-sandbox/async-component', 'id': '43f28227c6dcea9594114242e2fc8739fef493ae', 'size': '9259', 'binary': False, 'copies': '3', 'ref': 'refs/heads/main', 'path': 'vendor/go.opentelemetry.io/otel/api/global/internal/meter.go', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Dockerfile', 'bytes': '1002'}, {'name': 'Go', 'bytes': '51152'}, {'name': 'Shell', 'bytes': '15621'}]} |
<!--[if !mso]><!-->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!--<![endif]-->
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, maximum-scale=1.0">
<meta name="format-detection" content="telephone=no">
<title></title>
<style type="text/css">
body {
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
}
img {
-ms-interpolation-mode: bicubic;
}
table {
mso-table-lspace: 0pt !important;
mso-table-rspace: 0pt !important;
}
* {
mso-line-height-rule: exactly;
-webkit-text-size-adjust: none;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
a {
text-decoration: none;
color: inherit;
}
a:hover {
text-decoration: underline;
}
a,
a.aapl-link,
a.aapl-link:link {
text-decoration: none
}
a.aapl-link:hover {
text-decoration: underline
}
.aap_body_padding {
padding-left: 10px;
padding-right: 10px;
}
h1 {
font-weight: 200 !important;
}
@media only screen and (max-width: 480px) {
.deviceWidth {
width: 100% !important;
padding: 0;
min-width: 280px !important;
margin: auto !important;
}
.resellmobile {
text-align: center !important;
padding: 25px 10px 10px !important;
}
.resellmobile img {
margin: auto !important;
}
.aap_section_padding {
padding-left: 6% !important;
padding-right: 6% !important;
}
.aap_body_padding {
padding-left: 0 !important;
padding-right: 0 !important;
padding-top: 0 !important;
}
.appl_mobile {
display: block !important;
max-height: 100% !important;
max-width: 100% !important;
height: auto !important;
width: 100% !important;
}
.appl_desktop {
display: none !important;
}
h1 {
font-weight: 200 !important;
font-size: 36px !important;
line-height: 38px;
!important;
}
p,
h3 {
font-size: 14px !important;
line-height: 21px !important;
}
p.legal {
font-size: 10px !important;
line-height: 13px !important;
}
}
</style>
<!-- hide from outlook -->
<!--[if !mso]><!-->
<style type="text/css">
.aap_container {
max-width: 740px;
width: 100% !important;
}
.aap_container2 {
max-width: 640px;
width: 100% !important;
}
#aap_mainimage_container *,
#aap_mainimage_container {
overflow: visible
}
object#aap_main,
#aap_main {
max-width: 740px !important;
width: 100% !important;
height: auto !important;
-webkit-logical-width: 100%;
-webkit-max-logical-width: 740px
}
object#aap_main2,
#aap_main2 {
max-width: 558px !important;
width: 100% !important;
height: auto !important;
-webkit-logical-width: 100%;
-webkit-max-logical-width: 558px
}
object#aap_main3,
#aap_main3 {
max-width: 218px !important;
width: 100% !important;
height: auto !important;
-webkit-logical-width: 100%;
-webkit-max-logical-width: 218px
}
object#aap_main4,
#aap_main4 {
max-width: 136px !important;
width: 100% !important;
height: auto !important;
-webkit-logical-width: 100%;
-webkit-max-logical-width: 136px
}
</style>
<!--<![endif]-->
<!--[if lt mso 12]>
<style type="text/css">
#aap_main{width:740px !important}
#aap_main2{width:558px !important}
#aap_main3{width:218px !important}
#aap_main4{width:136px !important}
.aap_container{
width:740px !important;
}
.aap_container2{
width:640px !important;
}
</style>
<![endif]-->
<!--[if gte mso 12]>
<style type="text/css">
#aap_main{width:740px !important}
#aap_main2{width:558px !important}
#aap_main3{width:218px !important}
#aap_main4{width:136px !important}
.aap_container{
width:740px !important;
}
.aap_container2{
width:640px !important;
}
</style>
<![endif]-->
<style>
@media only screen and (max-width: 480px) {
.deviceWidth {
width: 100% !important;
padding: 0;
min-width: 280px !important;
margin: auto !important;
}
.resellmobile {
text-align: center !important;
padding: 25px 10px 10px !important;
}
.resellmobile img {
margin: auto !important;
}
.aap_section_padding {
padding-left: 6% !important;
padding-right: 6% !important;
}
.aap_body_padding {
padding-left: 0 !important;
padding-right: 0 !important;
padding-top: 0 !important;
}
.appl_mobile {
display: block !important;
max-height: 100% !important;
max-width: 100% !important;
height: auto !important;
width: 100% !important;
}
.appl_desktop {
display: none !important;
}
h1 {
font-weight: 200 !important;
font-size: 36px !important;
line-height: 38px;
!important;
}
p,
h3 {
font-size: 14px !important;
line-height: 21px !important;
}
p.legal {
font-size: 10px !important;
line-height: 13px !important;
}
}
</style>
<table width="100%" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td bgcolor="#f2f2f2" align="center" valign="top" style="min-width:280px; padding-top: 15px; padding-bottom: 15px; padding-left: 15px; padding-right: 15px;" class="aap_body_padding">
<center>
<div class="aap_container" style="max-width:740px;">
<table width="740" cellpadding="0" cellspacing="0" style="width:100% !important;max-width:740px" class="aap_container">
<tbody>
<tr>
<td width="100%" bgcolor="#ffffff" align="center" valign="top" style="width:100% !important;max-width:740px;" class="aap_container">
<table width="100%" cellpadding="0" cellspacing="0" class="deviceWidth">
<tbody>
<tr>
<td valign="top" style="padding-top: 30px; padding-bottom: -300px;">
<table width="100%" align="center" cellpadding="0" cellspacing="0" class="deviceWidth">
<tbody>
<tr>
<td align="right" valign="top" style="padding-left: 55px; padding-right: 55px;" class="resellmobile">
<img src="https://github.com/EUCTechTopics/euc-samples/blob/master/Communication-Samples/Compliancy%20Warnings/Images/organization-logo.png?raw=true" width="56" alt="" border="0" style="margin: 0; display: block;">
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td width="100%" align="center" valign="top" style="padding-left: 6%; padding-right: 6%; padding-bottom: 0px " class="resellmobile-herinnering">
<h1 style="margin: 0; font-size: 35px; line-height: 45px; font-family: Segoe UI, Helvetica, Arial, sans-serif; font-weight: 200!important; font-weight: normal; color: #000000;">Last reminder</h1>
</td>
</tr>
<tr>
<td width="100%" align="center" valign="top" style="padding-left: 6%; padding-right: 6%; padding-bottom: 30px;" class="aap_section_padding">
<h1 style="margin: 0; font-size: 42px; line-height: 45px; font-family: Segoe UI, Helvetica, Arial, sans-serif; font-weight: 200!important; font-weight: normal; color: #000000;">We need your help</h1>
</td>
</tr>
<tr>
<td valign="top" align="center">
<table width="100%" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td align="center" valign="top" class="aap_section_padding" style="padding-left: 40%; padding-right: 40%;">
<img src="https://github.com/EUCTechTopics/euc-samples/blob/master/Communication-Samples/Compliancy%20Warnings/Images/phone-warning.png?raw=true" width="100" alt="" border="0" style="margin: 0; display: block; max-width:300px; height:auto !important;" id="aap_main2" class="aap_img_flex">
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td valign="top" align="center" style="padding-left: 6%; padding-right: 6%;">
<table cellpadding="0" cellspacing="0" class="deviceWidth">
<tbody>
<tr>
<td width="530" align="center" valign="top" class="aap_section_padding deviceWidth" style="padding-top: 30px; padding-bottom: 30px; max-width: 530px;">
<h2 style="margin: 0;font-family: Helvetica, Arial, sans-serif;font-size: 15px;line-height: 22px;color: #000000; font-weight: bold;">Dear {FirstName},</h2>
<div><span style="font-size: x-small;"><br></span></div>
<h2 style="margin: 0; font-family: Helvetica, Arial, sans-serif; font-size: 15px; line-height: 22px; color: #000000; font-weight: 400!important; font-weight: normal;">We noticed that your {DeviceModel} is still not compliant. We will give your {DeviceModel} a final check tomorrow. If your device remains in this state, you will loose access to some or all company resources. Below is a list of things to check. If you need some assistance, feel free to call Corporate IT Support.</h2>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td width="100%" bgcolor="#ffffff" align="center" valign="top" style="width:100% !important; padding-left: 45px; padding-right: 45px; padding-bottom: 15px;" class="aap_container2 aap_body_padding">
<table width="100%" cellpadding="0" cellspacing="0" style="width:100% !important">
<tbody>
<tr>
<td width="100%" align="left" valign="top" style="border-top: 1px solid #cdcdcd; padding-top: 30px; width: 100% !important;">
<table cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td width="100%" align="left" valign="top" class="aap_section_padding" style="max-width: 600px;">
<h3 style="margin-top: 0; margin-bottom: 8px; font-family: Helvetica, Arial, sans-serif; font-size: 12px; line-height: 15px; color: #999999; text-transform: uppercase; letter-spacing: 0.2em;">Things to check:</h3>
<p style="margin-top: 0; margin-bottom: 8px; font-family: Helvetica, Arial, sans-serif; font-size: 13px; line-height: 18px; color: #000000;">If you're not sure what might be wrong with your device, here's a list of most frequent issues:</p>
<ul style="margin-top: 0; margin-bottom: 8px; font-family: Helvetica, Arial, sans-serif; font-size: 13px; line-height: 18px; color: #000000;">
<li>Make sure your device is not jailbroken.</li>
<li>Check that there aren't any malicious apps on your device.</li>
<li>Check that you didn't accidentally remove the Intelligent Hub application.</li>
<li>Ensure your device is checking in on a regular basis.</li>
<li>Verify that your device has a working Internet connection.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td width="100%" align="left" valign="top" style="border-top: 1px solid #cdcdcd; padding-top: 30px; width: 100% !important;">
<table width="222" align="left" cellpadding="0" cellspacing="0" style="padding-right: 27px;" class="deviceWidth aap_section_padding">
<tbody>
<tr>
<td align="left" valign="top" style="padding-top: 2px; padding-bottom: 2px;">
<h3 style="margin-top: 0; margin-bottom: 8px; font-family: Helvetica, Arial, sans-serif; font-size: 12px; line-height: 15px; color: #999999; text-transform: uppercase; letter-spacing: 0.2em;">SERIAL NUMBER</h3>
<p style="margin: 0; font-family: Helvetica, Arial, sans-serif; font-size: 12px; line-height: 18px; color: #000000;">{DeviceSerialNumber}</p>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td valign="top" align="center" style="">
<table cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td width="500" align="center" valign="top" class="deviceWidth aap_section_padding" style="padding-top: 30px; padding-bottom: 10px; max-width: 500px;">
<p style="margin: 0; font-family: Helvetica, Arial, sans-serif; font-size: 13px; line-height: 18px; color: #000000;">Corporate IT Support phone number: <a href="tel:{ComplianceSupportPhone}">{ComplianceSupportPhone}</a>.</p>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td align="center" valign="top" style="padding-top:25px; padding-bottom:20px; padding-left: 45px; padding-right: 45px; font-family: Helvetica, Arial, sans-serif; font-size: 10px; line-height: 15px; color: #999999;" class="aap_section_padding" id="aap_footer">
<p class="legal" style="margin: 0;">World Wide Enterprises</p>
</td>
</tr>
</tbody>
</table>
</div>
</center>
</td>
</tr>
</tbody>
</table>
| {'content_hash': 'ce5c8946785d77f15917a4d4ddf4e292', 'timestamp': '', 'source': 'github', 'line_count': 432, 'max_line_length': 557, 'avg_line_length': 45.7037037037037, 'alnum_prop': 0.398652755267423, 'repo_name': 'vmwaresamples/AirWatch-samples', 'id': '27f0079d7031b64ccdc9ed43505bdb03397a5c45', 'size': '19744', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Communication-Samples/Compliancy Warnings/Compliancy Violation - Final Warning - English.html', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'Batchfile', 'bytes': '77061'}, {'name': 'C#', 'bytes': '13915'}, {'name': 'JavaScript', 'bytes': '6693'}, {'name': 'PowerShell', 'bytes': '230169'}, {'name': 'Python', 'bytes': '11707'}, {'name': 'Shell', 'bytes': '20285'}]} |
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | {'content_hash': 'eb8de0c4d5e1f1a3cf91be3716a2281e', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 31, 'avg_line_length': 9.692307692307692, 'alnum_prop': 0.7063492063492064, 'repo_name': 'mdoering/backbone', 'id': '735f10a2714b109698e6115f9adedcfd3a1509a6', 'size': '176', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'life/Plantae/Pteridophyta/Polypodiopsida/Cyatheales/Cyatheaceae/Cyathea/Cyathea squamicosta/README.md', 'mode': '33188', 'license': 'apache-2.0', 'language': []} |
@class BaseResponse, NSString;
@interface GetAddressResponse : WXPBGeneratedMessage
{
}
+ (void)initialize;
// Remaining properties
@property(retain, nonatomic) BaseResponse *baseResponse; // @dynamic baseResponse;
@property(retain, nonatomic) NSString *retJson; // @dynamic retJson;
@end
| {'content_hash': '464b5eef6257068047455505a2cbde91', 'timestamp': '', 'source': 'github', 'line_count': 14, 'max_line_length': 82, 'avg_line_length': 21.0, 'alnum_prop': 0.7687074829931972, 'repo_name': 'walkdianzi/DashengHook', 'id': '1d0fa0d3dbb25413ac2b6164670902862043b084', 'size': '467', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'WeChat-Headers/GetAddressResponse.h', 'mode': '33261', 'license': 'mit', 'language': [{'name': 'C', 'bytes': '986'}, {'name': 'Objective-C', 'bytes': '10153542'}, {'name': 'Objective-C++', 'bytes': '18332'}, {'name': 'Shell', 'bytes': '1459'}]} |
book_path: /mobile/_book.yaml
project_path: /mobile/_project.yaml
# Preparing models for mobile deployment
The requirements for storing model information during training are very
different from when you want to release it as part of a mobile app. This section
covers the tools involved in converting from a training model to something
releasable in production.
## What is up with all the different saved file formats?
You may find yourself getting very confused by all the different ways that
TensorFlow can save out graphs. To help, here’s a rundown of some of the
different components, and what they are used for. The objects are mostly defined
and serialized as protocol buffers:
- [NodeDef](https://www.tensorflow.org/code/tensorflow/core/framework/node_def.proto):
Defines a single operation in a model. It has a unique name, a list of the
names of other nodes it pulls inputs from, the operation type it implements
(for example `Add`, or `Mul`), and any attributes that are needed to control
that operation. This is the basic unit of computation for TensorFlow, and all
work is done by iterating through a network of these nodes, applying each one
in turn. One particular operation type that’s worth knowing about is `Const`,
since this holds information about a constant. This may be a single, scalar
number or string, but it can also hold an entire multi-dimensional tensor
array. The values for a `Const` are stored inside the `NodeDef`, and so large
constants can take up a lot of room when serialized.
- [Checkpoint](https://www.tensorflow.org/code/tensorflow/core/util/tensor_bundle/tensor_bundle.h). Another
way of storing values for a model is by using `Variable` ops. Unlike `Const`
ops, these don’t store their content as part of the `NodeDef`, so they take up
very little space within the `GraphDef` file. Instead their values are held in
RAM while a computation is running, and then saved out to disk as checkpoint
files periodically. This typically happens as a neural network is being
trained and weights are updated, so it’s a time-critical operation, and it may
happen in a distributed fashion across many workers, so the file format has to
be both fast and flexible. They are stored as multiple checkpoint files,
together with metadata files that describe what’s contained within the
checkpoints. When you’re referring to a checkpoint in the API (for example
when passing a filename in as a command line argument), you’ll use the common
prefix for a set of related files. If you had these files:
/tmp/model/model-chkpt-1000.data-00000-of-00002
/tmp/model/model-chkpt-1000.data-00001-of-00002
/tmp/model/model-chkpt-1000.index
/tmp/model/model-chkpt-1000.meta
You would refer to them as `/tmp/model/chkpt-1000`.
- [GraphDef](https://www.tensorflow.org/code/tensorflow/core/framework/graph.proto):
Has a list of `NodeDefs`, which together define the computational graph to
execute. During training, some of these nodes will be `Variables`, and so if
you want to have a complete graph you can run, including the weights, you’ll
need to call a restore operation to pull those values from
checkpoints. Because checkpoint loading has to be flexible to deal with all of
the training requirements, this can be tricky to implement on mobile and
embedded devices, especially those with no proper file system available like
iOS. This is where
the
[`freeze_graph.py`](https://www.tensorflow.org/code/tensorflow/python/tools/freeze_graph.py) script
comes in handy. As mentioned above, `Const` ops store their values as part of
the `NodeDef`, so if all the `Variable` weights are converted to `Const` nodes,
then we only need a single `GraphDef` file to hold the model architecture and
the weights. Freezing the graph handles the process of loading the
checkpoints, and then converts all Variables to Consts. You can then load the
resulting file in a single call, without having to restore variable values
from checkpoints. One thing to watch out for with `GraphDef` files is that
sometimes they’re stored in text format for easy inspection. These versions
usually have a ‘.pbtxt’ filename suffix, whereas the binary files end with
‘.pb’.
- [FunctionDefLibrary](https://www.tensorflow.org/code/tensorflow/core/framework/function.proto):
This appears in `GraphDef`, and is effectively a set of sub-graphs, each with
information about their input and output nodes. Each sub-graph can then be
used as an op in the main graph, allowing easy instantiation of different
nodes, in a similar way to how functions encapsulate code in other languages.
- [MetaGraphDef](https://www.tensorflow.org/code/tensorflow/core/protobuf/meta_graph.proto):
A plain `GraphDef` only has information about the network of computations, but
doesn’t have any extra information about the model or how it can be
used. `MetaGraphDef` contains a `GraphDef` defining the computation part of
the model, but also includes information like ‘signatures’, which are
suggestions about which inputs and outputs you may want to call the model
with, data on how and where any checkpoint files are saved, and convenience
tags for grouping ops together for ease of use.
- [SavedModel](https://www.tensorflow.org/code/tensorflow/core/protobuf/saved_model.proto):
It’s common to want to have different versions of a graph that rely on a
common set of variable checkpoints. For example, you might need a GPU and a
CPU version of the same graph, but keep the same weights for both. You might
also need some extra files (like label names) as part of your
model. The
[SavedModel](https://www.tensorflow.org/code/tensorflow/python/saved_model/README.md) format
addresses these needs by letting you save multiple versions of the same graph
without duplicating variables, and also storing asset files in the same
bundle. Under the hood, it uses `MetaGraphDef` and checkpoint files, along
with extra metadata files. It’s the format that you’ll want to use if you’re
deploying a web API using TensorFlow Serving, for example.
## How do you get a model you can use on mobile?
In most situations, training a model with TensorFlow will give you a folder
containing a `GraphDef` file (usually ending with the `.pb` or `.pbtxt` extension) and
a set of checkpoint files. What you need for mobile or embedded deployment is a
single `GraphDef` file that’s been ‘frozen’, or had its variables converted into
inline constants so everything’s in one file. To handle the conversion, you’ll
need the `freeze_graph.py` script, that’s held in
[`tensorflow/python/tools/freeze_graph.py`](https://www.tensorflow.org/code/tensorflow/python/tools/freeze_graph.py). You’ll run it like this:
bazel build tensorflow/python/tools:freeze_graph
bazel-bin/tensorflow/python/tools/freeze_graph \
--input_graph=/tmp/model/my_graph.pb \
--input_checkpoint=/tmp/model/model.ckpt-1000 \
--output_graph=/tmp/frozen_graph.pb \
--output_node_names=output_node \
The `input_graph` argument should point to the `GraphDef` file that holds your
model architecture. It’s possible that your `GraphDef` has been stored in a text
format on disk, in which case it’s likely to end in `.pbtxt` instead of `.pb`,
and you should add an extra `--input_binary=false` flag to the command.
The `input_checkpoint` should be the most recent saved checkpoint. As mentioned
in the checkpoint section, you need to give the common prefix to the set of
checkpoints here, rather than a full filename.
`output_graph` defines where the resulting frozen `GraphDef` will be
saved. Because it’s likely to contain a lot of weight values that take up a
large amount of space in text format, it’s always saved as a binary protobuf.
`output_node_names` is a list of the names of the nodes that you want to extract
the results of your graph from. This is needed because the freezing process
needs to understand which parts of the graph are actually needed, and which are
artifacts of the training process, like summarization ops. Only ops that
contribute to calculating the given output nodes will be kept. If you know how
your graph is going to be used, these should just be the names of the nodes you
pass into `Session::Run()` as your fetch targets. The easiest way to find the
node names is to inspect the Node objects while building your graph in python.
Inspecting your graph in TensorBoard is another simple way. You can get some
suggestions on likely outputs by running the [`summarize_graph` tool](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/tools/graph_transforms/README.md#inspecting-graphs).
Because the output format for TensorFlow has changed over time, there are a
variety of other less commonly used flags available too, like `input_saver`, but
hopefully you shouldn’t need these on graphs trained with modern versions of the
framework.
## Using the Graph Transform Tool
A lot of the things you need to do to efficiently run a model on device are
available through the [Graph Transform
Tool](https://www.tensorflow.org/code/tensorflow/tools/graph_transforms/README.md). This
command-line tool takes an input `GraphDef` file, applies the set of rewriting
rules you request, and then writes out the result as a `GraphDef`. See the
documentation for more information on how to build and run this tool.
### Removing training-only nodes
TensorFlow `GraphDefs` produced by the training code contain all of the
computation that’s needed for back-propagation and updates of weights, as well
as the queuing and decoding of inputs, and the saving out of checkpoints. All of
these nodes are no longer needed during inference, and some of the operations
like checkpoint saving aren’t even supported on mobile platforms. To create a
model file that you can load on devices you need to delete those unneeded
operations by running the `strip_unused_nodes` rule in the Graph Transform Tool.
The trickiest part of this process is figuring out the names of the nodes you
want to use as inputs and outputs during inference. You'll need these anyway
once you start to run inference, but you also need them here so that the
transform can calculate which nodes are not needed on the inference-only
path. These may not be obvious from the training code. The easiest way to
determine the node name is to explore the graph with TensorBoard.
Remember that mobile applications typically gather their data from sensors and
have it as arrays in memory, whereas training typically involves loading and
decoding representations of the data stored on disk. In the case of Inception v3
for example, there’s a `DecodeJpeg` op at the start of the graph that’s designed
to take JPEG-encoded data from a file retrieved from disk and turn it into an
arbitrary-sized image. After that there’s a `BilinearResize` op to scale it to
the expected size, followed by a couple of other ops that convert the byte data
into float and scale the value magnitudes it in the way the rest of the graph
expects. A typical mobile app will skip most of these steps because it’s getting
its input directly from a live camera, so the input node you will actually
supply will be the output of the `Mul` node in this case.
<img src ="../images/inception_input.png" width="300">
You’ll need to do a similar process of inspection to figure out the correct
output nodes.
If you’ve just been given a frozen `GraphDef` file, and are not sure about the
contents, try using the `summarize_graph` tool to print out information
about the inputs and outputs it finds from the graph structure. Here’s an
example with the original Inception v3 file:
bazel run tensorflow/tools/graph_transforms:summarize_graph --
--in_graph=tensorflow_inception_graph.pb
Once you have an idea of what the input and output nodes are, you can feed them
into the graph transform tool as the `--input_names` and `--output_names`
arguments, and call the `strip_unused_nodes` transform, like this:
bazel run tensorflow/tools/graph_transforms:transform_graph --
--in_graph=tensorflow_inception_graph.pb
--out_graph=optimized_inception_graph.pb --inputs='Mul' --outputs='softmax'
--transforms='
strip_unused_nodes(type=float, shape="1,299,299,3")
fold_constants(ignore_errors=true)
fold_batch_norms
fold_old_batch_norms'
One thing to look out for here is that you need to specify the size and type
that you want your inputs to be. This is because any values that you’re going to
be passing in as inputs to inference need to be fed to special `Placeholder` op
nodes, and the transform may need to create them if they don’t already exist. In
the case of Inception v3 for example, a `Placeholder` node replaces the old
`Mul` node that used to output the resized and rescaled image array, since we’re
going to be doing that processing ourselves before we call TensorFlow. It keeps
the original name though, which is why we always feed in inputs to `Mul` when we
run a session with our modified Inception graph.
After you’ve run this process, you’ll have a graph that only contains the actual
nodes you need to run your prediction process. This is the point where it
becomes useful to run metrics on the graph, so it’s worth running
`summarize_graph` again to understand what’s in your model.
## What ops should you include on mobile?
There are hundreds of operations available in TensorFlow, and each one has
multiple implementations for different data types. On mobile platforms, the size
of the executable binary that’s produced after compilation is important, because
app download bundles need to be as small as possible for the best user
experience. If all of the ops and data types are compiled into the TensorFlow
library then the total size of the compiled library can be tens of megabytes, so
by default only a subset of ops and data types are included.
That means that if you load a model file that’s been trained on a desktop
machine, you may see the error “No OpKernel was registered to support Op” when
you load it on mobile. The first thing to try is to make sure you’ve stripped
out any training-only nodes, since the error will occur at load time even if the
op is never executed. If you’re still hitting the same problem once that’s done,
you’ll need to look at adding the op to your built library.
The criteria for including ops and types fall into several categories:
- Are they only useful in back-propagation, for gradients? Since mobile is
focused on inference, we don’t include these.
- Are they useful mainly for other training needs, such as checkpoint saving?
These we leave out.
- Do they rely on frameworks that aren’t always available on mobile, such as
libjpeg? To avoid extra dependencies we don’t include ops like `DecodeJpeg`.
- Are there types that aren’t commonly used? We don’t include boolean variants
of ops for example, since we don’t see much use of them in typical inference
graphs.
These ops are trimmed by default to optimize for inference on mobile, but it is
possible to alter some build files to change the default. After alternating the
build files, you will need to recompile TensorFlow. See below for more details
on how to do this, and also see <a href="./optimizing.md">optimizing binary size</a>
for more on reducing your binary size.
### Locate the implementation
Operations are broken into two parts. The first is the op definition, which
declares the signature of the operation, which inputs, outputs, and attributes
it has. These take up very little space, and so all are included by default. The
implementations of the op computations are done in kernels, which live in the
`tensorflow/core/kernels` folder. You need to compile the C++ file containing
the kernel implementation of the op you need into the library. To figure out
which file that is, you can search for the operation name in the source
files.
[Here’s an example search in github](https://github.com/search?utf8=%E2%9C%93&q=repo%3Atensorflow%2Ftensorflow+extension%3Acc+path%3Atensorflow%2Fcore%2Fkernels+REGISTER+Mul&type=Code&ref=searchresults).
You’ll see that this search is looking for the `Mul` op implementation, and it
finds it in `tensorflow/core/kernels/cwise_op_mul_1.cc`. You need to look for
macros beginning with `REGISTER`, with the op name you care about as one of the
string arguments.
In this case, the implementations are actually broken up across multiple `.cc`
files, so you’d need to include all of them in your build. If you’re more
comfortable using the command line for code search, here’s a grep command that
also locates the right files if you run it from the root of your TensorFlow
repository:
`grep 'REGISTER.*"Mul"' tensorflow/core/kernels/*.cc`
### Add the implementation to the build
If you’re using Bazel, and building for Android, you’ll want to add the files
you’ve found to
the
[`android_extended_ops_group1`](https://www.tensorflow.org/code/tensorflow/core/kernels/BUILD#L3565) or
[`android_extended_ops_group2`](https://www.tensorflow.org/code/tensorflow/core/kernels/BUILD#L3632) targets. You
may also need to include any .cc files they depend on in there. If the build
complains about missing header files, add the .h’s that are needed into
the
[`android_extended_ops`](https://www.tensorflow.org/code/tensorflow/core/kernels/BUILD#L3525) target.
If you’re using a makefile targeting iOS, Raspberry Pi, etc, go to
[`tensorflow/contrib/makefile/tf_op_files.txt`](https://www.tensorflow.org/code/tensorflow/contrib/makefile/tf_op_files.txt) and
add the right implementation files there.
| {'content_hash': '504d97e0e07b42b2316f136625a1dd6f', 'timestamp': '', 'source': 'github', 'line_count': 304, 'max_line_length': 203, 'avg_line_length': 58.12171052631579, 'alnum_prop': 0.7779727205840739, 'repo_name': 'manipopopo/tensorflow', 'id': '6b4e4a92bd9262139be3cf650b7d16714ee3a277', 'size': '17813', 'binary': False, 'copies': '4', 'ref': 'refs/heads/master', 'path': 'tensorflow/contrib/lite/g3doc/tfmobile/prepare_models.md', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '9258'}, {'name': 'C', 'bytes': '324704'}, {'name': 'C#', 'bytes': '8215'}, {'name': 'C++', 'bytes': '46405377'}, {'name': 'CMake', 'bytes': '206720'}, {'name': 'Dockerfile', 'bytes': '6905'}, {'name': 'Go', 'bytes': '1210133'}, {'name': 'HTML', 'bytes': '4680032'}, {'name': 'Java', 'bytes': '830061'}, {'name': 'Jupyter Notebook', 'bytes': '2632416'}, {'name': 'LLVM', 'bytes': '6536'}, {'name': 'Makefile', 'bytes': '52525'}, {'name': 'Objective-C', 'bytes': '15650'}, {'name': 'Objective-C++', 'bytes': '99271'}, {'name': 'PHP', 'bytes': '2140'}, {'name': 'Perl', 'bytes': '7536'}, {'name': 'PureBasic', 'bytes': '25356'}, {'name': 'Python', 'bytes': '39882449'}, {'name': 'Ruby', 'bytes': '551'}, {'name': 'Shell', 'bytes': '447049'}, {'name': 'Smarty', 'bytes': '6976'}]} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_26) on Sat Jun 21 06:31:08 UTC 2014 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
org.apache.hadoop.yarn.sls.web (Apache Hadoop Main 2.4.1 API)
</TITLE>
<META NAME="date" CONTENT="2014-06-21">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="org.apache.hadoop.yarn.sls.web (Apache Hadoop Main 2.4.1 API)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Package</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-use.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../org/apache/hadoop/yarn/sls/utils/package-summary.html"><B>PREV PACKAGE</B></A>
<A HREF="../../../../../../org/apache/hadoop/yarn/state/package-summary.html"><B>NEXT PACKAGE</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../index.html?org/apache/hadoop/yarn/sls/web/package-summary.html" target="_top"><B>FRAMES</B></A>
<A HREF="package-summary.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>
<H2>
Package org.apache.hadoop.yarn.sls.web
</H2>
<DL>
</DL>
<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="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Package</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-use.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../org/apache/hadoop/yarn/sls/utils/package-summary.html"><B>PREV PACKAGE</B></A>
<A HREF="../../../../../../org/apache/hadoop/yarn/state/package-summary.html"><B>NEXT PACKAGE</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../index.html?org/apache/hadoop/yarn/sls/web/package-summary.html" target="_top"><B>FRAMES</B></A>
<A HREF="package-summary.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
Copyright © 2014 <a href="http://www.apache.org">Apache Software Foundation</a>. All Rights Reserved.
</BODY>
</HTML>
| {'content_hash': '015afae44c8ff14e9a484da0ac0854db', 'timestamp': '', 'source': 'github', 'line_count': 144, 'max_line_length': 162, 'avg_line_length': 42.96527777777778, 'alnum_prop': 0.6069177307257152, 'repo_name': 'gsoundar/mambo-ec2-deploy', 'id': 'da8179f300aa0d7aecf8c71d8fd7b17078bd03fd', 'size': '6187', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'packages/hadoop-2.4.1/share/doc/hadoop/api/org/apache/hadoop/yarn/sls/web/package-summary.html', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '23179'}, {'name': 'CSS', 'bytes': '39965'}, {'name': 'HTML', 'bytes': '263271260'}, {'name': 'Java', 'bytes': '103085'}, {'name': 'JavaScript', 'bytes': '1347'}, {'name': 'Python', 'bytes': '4101'}, {'name': 'Ruby', 'bytes': '262588'}, {'name': 'Shell', 'bytes': '118548'}]} |