text
stringlengths
2
1.04M
meta
dict
// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team // // Permission is hereby granted, free of charge, to any person obtaining a copy of this // software and associated documentation files (the "Software"), to deal in the Software // without restriction, including without limitation the rights to use, copy, modify, merge, // publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons // to whom the Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all copies or // substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE // FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. using System; using System.Collections.Generic; using Mono.Cecil; using Mono.Cecil.Cil; namespace ICSharpCode.Decompiler.Disassembler { public enum ILNameSyntax { /// <summary> /// class/valuetype + TypeName (built-in types use keyword syntax) /// </summary> Signature, /// <summary> /// Like signature, but always refers to type parameters using their position /// </summary> SignatureNoNamedTypeParameters, /// <summary> /// [assembly]Full.Type.Name (even for built-in types) /// </summary> TypeName, /// <summary> /// Name (but built-in types use keyword syntax) /// </summary> ShortTypeName } public static class DisassemblerHelpers { public static void WriteOffsetReference(ITextOutput writer, Instruction instruction) { writer.WriteReference(CecilExtensions.OffsetToString(instruction.Offset), instruction); } public static void WriteTo(this ExceptionHandler exceptionHandler, ITextOutput writer) { writer.Write("Try "); WriteOffsetReference(writer, exceptionHandler.TryStart); writer.Write('-'); WriteOffsetReference(writer, exceptionHandler.TryEnd); writer.Write(' '); writer.Write(exceptionHandler.HandlerType.ToString()); if (exceptionHandler.FilterStart != null) { writer.Write(' '); WriteOffsetReference(writer, exceptionHandler.FilterStart); writer.Write(" handler "); } if (exceptionHandler.CatchType != null) { writer.Write(' '); exceptionHandler.CatchType.WriteTo(writer); } writer.Write(' '); WriteOffsetReference(writer, exceptionHandler.HandlerStart); writer.Write('-'); WriteOffsetReference(writer, exceptionHandler.HandlerEnd); } public static void WriteTo(this Instruction instruction, ITextOutput writer) { writer.WriteDefinition(CecilExtensions.OffsetToString(instruction.Offset), instruction); writer.Write(": "); writer.WriteReference(instruction.OpCode.Name, instruction.OpCode); if (instruction.Operand != null) { writer.Write(' '); if (instruction.OpCode == OpCodes.Ldtoken) { if (instruction.Operand is MethodReference) writer.Write("method "); else if (instruction.Operand is FieldReference) writer.Write("field "); } WriteOperand(writer, instruction.Operand); } } static void WriteLabelList(ITextOutput writer, Instruction[] instructions) { writer.Write("("); for(int i = 0; i < instructions.Length; i++) { if(i != 0) writer.Write(", "); WriteOffsetReference(writer, instructions[i]); } writer.Write(")"); } static string ToInvariantCultureString(object value) { IConvertible convertible = value as IConvertible; return(null != convertible) ? convertible.ToString(System.Globalization.CultureInfo.InvariantCulture) : value.ToString(); } public static void WriteTo(this MethodReference method, ITextOutput writer) { if (method.ExplicitThis) { writer.Write("instance explicit "); } else if (method.HasThis) { writer.Write("instance "); } method.ReturnType.WriteTo(writer, ILNameSyntax.SignatureNoNamedTypeParameters); writer.Write(' '); if (method.DeclaringType != null) { method.DeclaringType.WriteTo(writer, ILNameSyntax.TypeName); writer.Write("::"); } MethodDefinition md = method as MethodDefinition; if (md != null && md.IsCompilerControlled) { writer.WriteReference(Escape(method.Name + "$PST" + method.MetadataToken.ToInt32().ToString("X8")), method); } else { writer.WriteReference(Escape(method.Name), method); } GenericInstanceMethod gim = method as GenericInstanceMethod; if (gim != null) { writer.Write('<'); for (int i = 0; i < gim.GenericArguments.Count; i++) { if (i > 0) writer.Write(", "); gim.GenericArguments[i].WriteTo(writer); } writer.Write('>'); } writer.Write("("); var parameters = method.Parameters; for(int i = 0; i < parameters.Count; ++i) { if (i > 0) writer.Write(", "); parameters[i].ParameterType.WriteTo(writer, ILNameSyntax.SignatureNoNamedTypeParameters); } writer.Write(")"); } static void WriteTo(this FieldReference field, ITextOutput writer) { field.FieldType.WriteTo(writer, ILNameSyntax.SignatureNoNamedTypeParameters); writer.Write(' '); field.DeclaringType.WriteTo(writer, ILNameSyntax.TypeName); writer.Write("::"); writer.WriteReference(Escape(field.Name), field); } static bool IsValidIdentifierCharacter(char c) { return c == '_' || c == '$' || c == '@' || c == '?' || c == '`'; } static bool IsValidIdentifier(string identifier) { if (string.IsNullOrEmpty(identifier)) return false; if (!(char.IsLetter(identifier[0]) || IsValidIdentifierCharacter(identifier[0]))) { // As a special case, .ctor and .cctor are valid despite starting with a dot return identifier == ".ctor" || identifier == ".cctor"; } for (int i = 1; i < identifier.Length; i++) { if (!(char.IsLetterOrDigit(identifier[i]) || IsValidIdentifierCharacter(identifier[i]) || identifier[i] == '.')) return false; } return true; } static readonly HashSet<string> ilKeywords = BuildKeywordList( "abstract", "algorithm", "alignment", "ansi", "any", "arglist", "array", "as", "assembly", "assert", "at", "auto", "autochar", "beforefieldinit", "blob", "blob_object", "bool", "brnull", "brnull.s", "brzero", "brzero.s", "bstr", "bytearray", "byvalstr", "callmostderived", "carray", "catch", "cdecl", "cf", "char", "cil", "class", "clsid", "const", "currency", "custom", "date", "decimal", "default", "demand", "deny", "endmac", "enum", "error", "explicit", "extends", "extern", "false", "famandassem", "family", "famorassem", "fastcall", "fault", "field", "filetime", "filter", "final", "finally", "fixed", "float", "float32", "float64", "forwardref", "fromunmanaged", "handler", "hidebysig", "hresult", "idispatch", "il", "illegal", "implements", "implicitcom", "implicitres", "import", "in", "inheritcheck", "init", "initonly", "instance", "int", "int16", "int32", "int64", "int8", "interface", "internalcall", "iunknown", "lasterr", "lcid", "linkcheck", "literal", "localloc", "lpstr", "lpstruct", "lptstr", "lpvoid", "lpwstr", "managed", "marshal", "method", "modopt", "modreq", "native", "nested", "newslot", "noappdomain", "noinlining", "nomachine", "nomangle", "nometadata", "noncasdemand", "noncasinheritance", "noncaslinkdemand", "noprocess", "not", "not_in_gc_heap", "notremotable", "notserialized", "null", "nullref", "object", "objectref", "opt", "optil", "out", "permitonly", "pinned", "pinvokeimpl", "prefix1", "prefix2", "prefix3", "prefix4", "prefix5", "prefix6", "prefix7", "prefixref", "prejitdeny", "prejitgrant", "preservesig", "private", "privatescope", "protected", "public", "record", "refany", "reqmin", "reqopt", "reqrefuse", "reqsecobj", "request", "retval", "rtspecialname", "runtime", "safearray", "sealed", "sequential", "serializable", "special", "specialname", "static", "stdcall", "storage", "stored_object", "stream", "streamed_object", "string", "struct", "synchronized", "syschar", "sysstring", "tbstr", "thiscall", "tls", "to", "true", "typedref", "unicode", "unmanaged", "unmanagedexp", "unsigned", "unused", "userdefined", "value", "valuetype", "vararg", "variant", "vector", "virtual", "void", "wchar", "winapi", "with", "wrapper", // These are not listed as keywords in spec, but ILAsm treats them as such "property", "type", "flags", "callconv", "strict" ); static HashSet<string> BuildKeywordList(params string[] keywords) { HashSet<string> s = new HashSet<string>(keywords); foreach (var field in typeof(OpCodes).GetFields()) { s.Add(((OpCode)field.GetValue(null)).Name); } return s; } public static string Escape(string identifier) { if (IsValidIdentifier(identifier) && !ilKeywords.Contains(identifier)) { return identifier; } else { // The ECMA specification says that ' inside SQString should be ecaped using an octal escape sequence, // but we follow Microsoft's ILDasm and use \'. return "'" + NRefactory.CSharp.TextWriterTokenWriter.ConvertString(identifier).Replace("'", "\\'") + "'"; } } public static void WriteTo(this TypeReference type, ITextOutput writer, ILNameSyntax syntax = ILNameSyntax.Signature) { ILNameSyntax syntaxForElementTypes = syntax == ILNameSyntax.SignatureNoNamedTypeParameters ? syntax : ILNameSyntax.Signature; if (type is PinnedType) { ((PinnedType)type).ElementType.WriteTo(writer, syntaxForElementTypes); writer.Write(" pinned"); } else if (type is ArrayType) { ArrayType at = (ArrayType)type; at.ElementType.WriteTo(writer, syntaxForElementTypes); writer.Write('['); writer.Write(string.Join(", ", at.Dimensions)); writer.Write(']'); } else if (type is GenericParameter) { writer.Write('!'); if (((GenericParameter)type).Owner.GenericParameterType == GenericParameterType.Method) writer.Write('!'); if (string.IsNullOrEmpty(type.Name) || type.Name[0] == '!' || syntax == ILNameSyntax.SignatureNoNamedTypeParameters) writer.Write(((GenericParameter)type).Position.ToString()); else writer.Write(Escape(type.Name)); } else if (type is ByReferenceType) { ((ByReferenceType)type).ElementType.WriteTo(writer, syntaxForElementTypes); writer.Write('&'); } else if (type is PointerType) { ((PointerType)type).ElementType.WriteTo(writer, syntaxForElementTypes); writer.Write('*'); } else if (type is GenericInstanceType) { type.GetElementType().WriteTo(writer, syntaxForElementTypes); writer.Write('<'); var arguments = ((GenericInstanceType)type).GenericArguments; for (int i = 0; i < arguments.Count; i++) { if (i > 0) writer.Write(", "); arguments[i].WriteTo(writer, syntaxForElementTypes); } writer.Write('>'); } else if (type is OptionalModifierType) { ((OptionalModifierType)type).ElementType.WriteTo(writer, syntax); writer.Write(" modopt("); ((OptionalModifierType)type).ModifierType.WriteTo(writer, ILNameSyntax.TypeName); writer.Write(") "); } else if (type is RequiredModifierType) { ((RequiredModifierType)type).ElementType.WriteTo(writer, syntax); writer.Write(" modreq("); ((RequiredModifierType)type).ModifierType.WriteTo(writer, ILNameSyntax.TypeName); writer.Write(") "); } else { string name = PrimitiveTypeName(type.FullName); if (syntax == ILNameSyntax.ShortTypeName) { if (name != null) writer.Write(name); else writer.WriteReference(Escape(type.Name), type); } else if ((syntax == ILNameSyntax.Signature || syntax == ILNameSyntax.SignatureNoNamedTypeParameters) && name != null) { writer.Write(name); } else { if (syntax == ILNameSyntax.Signature || syntax == ILNameSyntax.SignatureNoNamedTypeParameters) writer.Write(type.IsValueType ? "valuetype " : "class "); if (type.DeclaringType != null) { type.DeclaringType.WriteTo(writer, ILNameSyntax.TypeName); writer.Write('/'); writer.WriteReference(Escape(type.Name), type); } else { if (!type.IsDefinition && type.Scope != null && !(type is TypeSpecification)) writer.Write("[{0}]", Escape(type.Scope.Name)); writer.WriteReference(Escape(type.FullName), type); } } } } public static void WriteOperand(ITextOutput writer, object operand) { if (operand == null) throw new ArgumentNullException("operand"); Instruction targetInstruction = operand as Instruction; if (targetInstruction != null) { WriteOffsetReference(writer, targetInstruction); return; } Instruction[] targetInstructions = operand as Instruction[]; if (targetInstructions != null) { WriteLabelList(writer, targetInstructions); return; } VariableReference variableRef = operand as VariableReference; if (variableRef != null) { if (string.IsNullOrEmpty(variableRef.Name)) writer.WriteReference(variableRef.Index.ToString(), variableRef); else writer.WriteReference(Escape(variableRef.Name), variableRef); return; } ParameterReference paramRef = operand as ParameterReference; if (paramRef != null) { if (string.IsNullOrEmpty(paramRef.Name)) writer.WriteReference(paramRef.Index.ToString(), paramRef); else writer.WriteReference(Escape(paramRef.Name), paramRef); return; } MethodReference methodRef = operand as MethodReference; if (methodRef != null) { methodRef.WriteTo(writer); return; } TypeReference typeRef = operand as TypeReference; if (typeRef != null) { typeRef.WriteTo(writer, ILNameSyntax.TypeName); return; } FieldReference fieldRef = operand as FieldReference; if (fieldRef != null) { fieldRef.WriteTo(writer); return; } string s = operand as string; if (s != null) { writer.Write("\"" + NRefactory.CSharp.TextWriterTokenWriter.ConvertString(s) + "\""); } else if (operand is char) { writer.Write(((int)(char)operand).ToString()); } else if (operand is float) { float val = (float)operand; if (val == 0) { if (1 / val == float.NegativeInfinity) { // negative zero is a special case writer.Write('-'); } writer.Write("0.0"); } else if (float.IsInfinity(val) || float.IsNaN(val)) { byte[] data = BitConverter.GetBytes(val); writer.Write('('); for (int i = 0; i < data.Length; i++) { if (i > 0) writer.Write(' '); writer.Write(data[i].ToString("X2")); } writer.Write(')'); } else { writer.Write(val.ToString("R", System.Globalization.CultureInfo.InvariantCulture)); } } else if (operand is double) { double val = (double)operand; if (val == 0) { if (1 / val == double.NegativeInfinity) { // negative zero is a special case writer.Write('-'); } writer.Write("0.0"); } else if (double.IsInfinity(val) || double.IsNaN(val)) { byte[] data = BitConverter.GetBytes(val); writer.Write('('); for (int i = 0; i < data.Length; i++) { if (i > 0) writer.Write(' '); writer.Write(data[i].ToString("X2")); } writer.Write(')'); } else { writer.Write(val.ToString("R", System.Globalization.CultureInfo.InvariantCulture)); } } else if (operand is bool) { writer.Write((bool)operand ? "true" : "false"); } else { s = ToInvariantCultureString(operand); writer.Write(s); } } public static string PrimitiveTypeName(string fullName) { switch (fullName) { case "System.SByte": return "int8"; case "System.Int16": return "int16"; case "System.Int32": return "int32"; case "System.Int64": return "int64"; case "System.Byte": return "uint8"; case "System.UInt16": return "uint16"; case "System.UInt32": return "uint32"; case "System.UInt64": return "uint64"; case "System.Single": return "float32"; case "System.Double": return "float64"; case "System.Void": return "void"; case "System.Boolean": return "bool"; case "System.String": return "string"; case "System.Char": return "char"; case "System.Object": return "object"; case "System.IntPtr": return "native int"; default: return null; } } } }
{ "content_hash": "529199f67c5441ac8c12e11125e764f5", "timestamp": "", "source": "github", "line_count": 447, "max_line_length": 128, "avg_line_length": 37.2751677852349, "alnum_prop": 0.6628255911655263, "repo_name": "xjpeter/Xamarin.Forms", "id": "ea6e54dbeaac6776e6efda37a5acbac6a3a4c15b", "size": "16664", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "ICSharpCode.Decompiler/Disassembler/DisassemblerHelpers.cs", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "1991" }, { "name": "C#", "bytes": "6039333" }, { "name": "CSS", "bytes": "3290" }, { "name": "HTML", "bytes": "591" }, { "name": "Java", "bytes": "2022" }, { "name": "JavaScript", "bytes": "167" }, { "name": "Makefile", "bytes": "3794" }, { "name": "PowerShell", "bytes": "8514" }, { "name": "Shell", "bytes": "1748" } ], "symlink_target": "" }
include(hunter_add_version) #include(hunter_cacheable) include(hunter_download) include(hunter_pick_scheme) hunter_add_version( PACKAGE_NAME turbojpeg VERSION "1.5.0-p2" URL "https://github.com/ConfusedReality/pkg_images_libjpeg-turbo/archive/1.5.0-p2.tar.gz" SHA1 4eee74a69e5849ea0180e615afb2fbd9462040a2 ) #hunter_pick_scheme(DEFAULT url_sha1_autotools) hunter_pick_scheme(DEFAULT url_sha1_turbojpeg_autogen_autotools) #hunter_cacheable(turbojpeg) hunter_download( PACKAGE_NAME turbojpeg )
{ "content_hash": "9309a07a208d3dfe237cbb5880cb5013", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 89, "avg_line_length": 20.692307692307693, "alnum_prop": 0.7490706319702602, "repo_name": "lucmichalski/hunter", "id": "7a27db1c5420150a44d1da66b431a97451810ad9", "size": "641", "binary": false, "copies": "1", "ref": "refs/heads/hunter2", "path": "cmake/projects/turbojpeg/hunter.cmake", "mode": "33261", "license": "bsd-2-clause", "language": [ { "name": "Batchfile", "bytes": "1193" }, { "name": "C++", "bytes": "55684" }, { "name": "CMake", "bytes": "1519759" }, { "name": "Python", "bytes": "67178" }, { "name": "Shell", "bytes": "20036" } ], "symlink_target": "" }
<head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}</title> <meta name="viewport" content="width=device-width"> <meta name="description" content="{{ site.description }}"> <link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}"> <!-- Custom CSS --> <link rel="stylesheet" href="{{ "/css/main.css" | prepend: site.baseurl }}"> <!-- Google fonts --> <link href='http://fonts.googleapis.com/css?family=Roboto:400,300' rel='stylesheet' type='text/css'> <!-- Google tracking --> <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','https://www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-84541453-1', 'auto'); ga('send', 'pageview'); </script> </head>
{ "content_hash": "8083852cee64a9d89e499ce23a3019d3", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 118, "avg_line_length": 44, "alnum_prop": 0.6013986013986014, "repo_name": "machine-learning-basics/machine-learning-basics.github.io", "id": "2e0891dd4ef8d7e158b5a298f9269136c59a48cc", "size": "1144", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "_includes/head.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "22546" }, { "name": "HTML", "bytes": "29600" }, { "name": "JavaScript", "bytes": "6646" }, { "name": "Ruby", "bytes": "8600" } ], "symlink_target": "" }
class MyTime{ public: static double getNowSecs(); static double getNowMSecs(); static std::string getNowTime(); static std::string getNowTime(unsigned long nowTime); };
{ "content_hash": "f0fcbd17a870760e1e247d31a6e4d298", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 54, "avg_line_length": 24.571428571428573, "alnum_prop": 0.7616279069767442, "repo_name": "Lang4/net", "id": "9877f00a67098cf95b1e40b58fabfd04fb4e48f9", "size": "203", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "engine/server/MyTime.h", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "5082777" }, { "name": "C++", "bytes": "900715" }, { "name": "Objective-C", "bytes": "1593" } ], "symlink_target": "" }
SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
{ "content_hash": "72ac2cab8006f64ce11155f5184af608", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 10.23076923076923, "alnum_prop": 0.6917293233082706, "repo_name": "mdoering/backbone", "id": "ff2cdafd9f4d2d205280a3f764d1301acbd8d4c2", "size": "187", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Fabales/Fabaceae/Coursetia/Coursetia caribaea/ Syn. Benthamantha microphylla/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
package com.github.jlinq; /** * A function that takes one input an argument. * @author Marcel Singer * * @param <I> The type of the accepted input argument. * @param <O> The type of the result. */ public interface Function<I, O> { O perform(I value); }
{ "content_hash": "c4e931ace905871c9fa3c483c9ea1e4f", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 54, "avg_line_length": 20.153846153846153, "alnum_prop": 0.6755725190839694, "repo_name": "JLinq/JLinq", "id": "9c6839ca17df12b3446113b286e530137b6f68dc", "size": "262", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/com/github/jlinq/Function.java", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "60440" } ], "symlink_target": "" }
#pragma once #define WAWL_CURSOR_BASE_TYPE_HPP #include "BaseType.hpp" namespace wawl { namespace wnd { using CursorHandle = ::HCURSOR; // default cursor icon struct OEMCursor { static constexpr Tchar* Arrow = IDC_ARROW; static constexpr Tchar* Cross = IDC_CROSS; static constexpr Tchar* IBeam = IDC_IBEAM; static constexpr Tchar* Wait = IDC_WAIT; }; } // ::wawl::wnd } // ::wawl
{ "content_hash": "9c285a8d2ac0194ab49069fdf601f79a", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 45, "avg_line_length": 20.35, "alnum_prop": 0.6805896805896806, "repo_name": "azaika/wawl", "id": "bef750276d0cc4fe8388b031323d6a1195904085", "size": "409", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "wawl/CursorBaseType.hpp", "mode": "33188", "license": "mit", "language": [ { "name": "C++", "bytes": "91773" } ], "symlink_target": "" }
title: Simple Binding page_title: Simple Binding - RadOrgChart description: Check our Web Forms article about Simple Binding. slug: orgchart/data-binding/simple-binding tags: simple,binding published: True position: 1 --- # Simple Binding In order to support a simple, straight-forward binding to a self-referenced data, without complex relations such as groups, RadOrgChart supports 2 different kinds of binding, first of which we called **Simple Data Binding**. Second one is called **Group-Enabled Binding** (see the [Group-Enabled Binding]({%slug orgchart/data-binding/group-enabled-binding%}) article) ## This binding is no different from what you have already used with other hiearchical controls from and outside the RadControls suite. For example, having a RadTreeView bound to a self referenced data with specified DataFieldID, DataFieldParentID and DataTextField, one can switch the opening and closing tag names with telerik:RadOrgChart and the result would be an Org Chart bound to the data of RadTreeView: ````ASPNET <telerik:RadTreeView RenderMode="Lightweight" runat="server" ID="RadTreeView1" DataSource="RadTreeViewDataSource1" DataFieldID="ID" DataFieldParentID="ParentID" DataTextField="Text"> </telerik:RadTreeView> <telerik:RadOrgChart RenderMode="Lightweight" runat="server" ID="RadOrgChart1" DataSource="RadTreeViewDataSource1" DataFieldID="ID" DataFieldParentID="ParentID" DataTextField="Text"> </telerik:RadOrgChart> ```` We try to keep our API consistent and to make the learning curve involved with every new control as smooth as possible. With that said, here are demonstrations of the various supported data sources using the Simple Data Binding: * [Declarative Datasources](https://demos.telerik.com/aspnet-ajax/orgchart/examples/populatingwithdata/declarativedatasources/defaultcs.aspx) * [Entity Datasource](https://demos.telerik.com/aspnet-ajax/orgchart/examples/populatingwithdata/entitydatasource/defaultcs.aspx) * [Linq Datasource](https://demos.telerik.com/aspnet-ajax/orgchart/examples/populatingwithdata/linqdatasource/defaultcs.aspx) * [Programatic Data Binding](https://demos.telerik.com/aspnet-ajax/orgchart/examples/populatingwithdata/programaticdatabinding/defaultcs.aspx) * [Load from XML](https://demos.telerik.com/aspnet-ajax/orgchart/examples/populatingwithdata/xmlfile/defaultcs.aspx)
{ "content_hash": "73ba35f991434eb80fc565dc89bfec50", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 367, "avg_line_length": 49.125, "alnum_prop": 0.8074639525021204, "repo_name": "telerik/ajax-docs", "id": "20e40faad2b45d389dbfd7524cacd95a137a200b", "size": "2362", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "controls/orgchart/data-binding/simple-binding.md", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ASP.NET", "bytes": "2253" }, { "name": "C#", "bytes": "6026" }, { "name": "HTML", "bytes": "2240" }, { "name": "JavaScript", "bytes": "3052" }, { "name": "Ruby", "bytes": "3275" } ], "symlink_target": "" }
// // SceneNode.cpp // CGP-Ex4 // // Created by Amir Blum on 4/27/15. // Copyright (c) 2015 Amir Blum. All rights reserved. // #include "SceneNode.h" #include <algorithm> /** * Constructor */ SceneNode::SceneNode(vec3 position, quat rotation, vec3 scale) : _childNodes(0), _parentNode(NULL), _position(position), _rotation(rotation), _scale(scale), _positionInvariant(false), _rotationInvariant(false), _scaleInvariant(false), _localTransform(1.0f), _worldTransform(1.0f), _visible(true) { rebuildTransforms(true); } /** * Destructor */ SceneNode::~SceneNode() { for (Script *script : _scripts) { delete script; } for (SceneNode *child : _childNodes) { delete child; } } /** * Add a script to this node */ void SceneNode::addScript(Script *script) { _scripts.push_back(script); } /** * Add a child to the tree under this node */ void SceneNode::addChild(SceneNode *child) { _childNodes.push_back(child); child->setParent(this); child->rebuildTransforms(false); } /** * Add a child to the tree under this node at the given order */ void SceneNode::addChild(SceneNode *child, int order) { // _childNodes.push_back(child); _childNodes.insert(_childNodes.begin() + order, child); child->setParent(this); child->rebuildTransforms(false); } /** * Remove a child by index */ void SceneNode::removeChild(unsigned int i) { if (i >= _childNodes.size()) { return; } delete _childNodes[i]; _childNodes.erase(_childNodes.begin() + i); } /** * Remove a child by value */ void SceneNode::removeChild(SceneNode *childToRemove) { auto childIterator = std::find(_childNodes.begin(), _childNodes.end(), childToRemove); if (childIterator != _childNodes.end()) { _childNodes.erase(childIterator); delete childToRemove; } } /** * Set this node's parent */ void SceneNode::setParent(SceneNode *parentNode) { _parentNode = parentNode; } /** * Get position */ vec3 SceneNode::getPosition() const { return _position; } /** * Get rotation */ quat SceneNode::getRotation() const { return _rotation; } /** * Get scale */ vec3 SceneNode::getScale() const { return _scale; } /** * Get world position */ vec3 SceneNode::getWorldPosition() const { vec4 affinePosition = vec4(vec3(0.0f), 1.0f); vec4 worldPosition = _worldTransform * affinePosition; return vec3(worldPosition); } /** * Get world rotation */ quat SceneNode::getWorldRotation() const { return toQuat(_worldTransform); } /** * Get world scale */ vec3 SceneNode::getWorldScale() const { vec4 worldScale = _worldTransform * vec4(1.0f); return vec3(worldScale); } /** * Get local transformation */ mat4 SceneNode::getLocalTransform() const { return _localTransform; } /** * Get world transformation */ mat4 SceneNode::getWorldTransform() const { return _worldTransform; } /** * Set position */ void SceneNode::setPosition(vec3 position) { _position = position; rebuildTransforms(true); } /** * Get rotation */ void SceneNode::setRotation(quat rotation) { _rotation = rotation; rebuildTransforms(true); } /** * Get scale */ void SceneNode::setScale(vec3 scale) { _scale = scale; rebuildTransforms(true); } void SceneNode::setVisibility(bool visible) { _visible = visible; } void SceneNode::togglePositionInvariance() { _positionInvariant = !_positionInvariant; } void SceneNode::toggleRotationInvariance() { _rotationInvariant = !_rotationInvariant; } void SceneNode::toggleScaleInvariance() { _scaleInvariant = !_scaleInvariant; } /** * Rebuild the local transform, then call rebuild on all children recursively. * localChanged: If this is false it means only the parent changed, so no * need to rebuild localTransform, only world. */ void SceneNode::rebuildTransforms(bool localChanged) { // Rebuild local transform if (localChanged) { _localTransform = mat4(1.0f); _localTransform = scale(mat4(1.0f), _scale) * _localTransform; _localTransform = toMat4(_rotation) * _localTransform; _localTransform = translate(mat4(1.0f), _position) * _localTransform; } // Rebuild world transform if (_parentNode) { if (!(_positionInvariant || _rotationInvariant || _scaleInvariant)) { _worldTransform = _parentNode->getWorldTransform() * _localTransform; } else { mat4 parentInvariantTransform(1.0f); if (!_scaleInvariant) { parentInvariantTransform = scale(mat4(1.0f), _parentNode->getWorldScale()) * parentInvariantTransform; } if (!_rotationInvariant) { parentInvariantTransform = toMat4(_parentNode->getWorldRotation()) * parentInvariantTransform; } if (!_positionInvariant) { parentInvariantTransform = translate(mat4(1.0f), _parentNode->getWorldPosition()); } _worldTransform = parentInvariantTransform * _localTransform; } } // Update all the kiddies for (SceneNode *child : _childNodes) { child->rebuildTransforms(false); } } /** * First, call virtual update method on self to perform any of the node's * personal fixedUpdates, then recursively call fixedUpdate on all the children. */ void SceneNode::recursiveFixedUpdate(float dt) { // Update all children for (SceneNode *child : _childNodes) { child->recursiveFixedUpdate(dt); } // Update myself fixedUpdate(dt); // Update all scripts for (Script *script : _scripts) { script->fixedUpdate(dt); } } /** * First, call virtual update method on self to perform any of the node's * personal updates, then recursively call update on all the children. */ void SceneNode::recursiveUpdate(float dt) { // Update all children for (SceneNode *child : _childNodes) { child->recursiveUpdate(dt); } // Update myself update(dt); // Update all scripts for (Script *script : _scripts) { script->update(dt); } } /** * First, call virtual render method on self to perform any of the node's * personal renders, then recursively call render on all the children. */ void SceneNode::recursiveRender() { if (!_visible) { return; } // Render myself render(); // Render all children for (SceneNode *child : _childNodes) { child->recursiveRender(); } } /** * Empty implementation for personal fixedUpdate */ void SceneNode::fixedUpdate(float dt) {} /** * Empty implementation for personal update */ void SceneNode::update(float dt) {} /** * Empty implementation for personal render */ void SceneNode::render() {}
{ "content_hash": "c3118662703ff7784ba0634bccb87425", "timestamp": "", "source": "github", "line_count": 328, "max_line_length": 118, "avg_line_length": 20.807926829268293, "alnum_prop": 0.6470329670329671, "repo_name": "amirblum/Game-Programming-Course", "id": "19331a22b6300b5058b02bf19593b09747886b80", "size": "6825", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Ex4/src/SceneNode.cpp", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "407619" }, { "name": "C++", "bytes": "558255" }, { "name": "GLSL", "bytes": "38956" }, { "name": "Makefile", "bytes": "11811" } ], "symlink_target": "" }
module Integrated class AmountInAccountsController < FormsController def self.skip_rule_sets(application) super << SkipRules.must_be_applying_for_food_assistance(application) end def self.custom_skip_rule_set(application) !application.navigator.money_in_accounts? end def update_models current_application.update!(params_for(:application)) end end end
{ "content_hash": "182776b611f29d66883a04170b053fa7", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 74, "avg_line_length": 26.666666666666668, "alnum_prop": 0.73, "repo_name": "codeforamerica/michigan-benefits", "id": "93689562ba9bef0fa354d846c369803e2b4ab5c1", "size": "400", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/controllers/integrated/amount_in_accounts_controller.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "79482" }, { "name": "Dockerfile", "bytes": "104" }, { "name": "HTML", "bytes": "337282" }, { "name": "JavaScript", "bytes": "2108" }, { "name": "Ruby", "bytes": "1336395" }, { "name": "Shell", "bytes": "3660" } ], "symlink_target": "" }
package com.javarush.task.task36.task3612; import java.util.Date; import java.util.HashSet; import java.util.Set; /* Почему сет не содержит элемент? */ public class Solution { private Set<Date> dates; private Date lastDate; public static void main(String[] args) { Solution solution = new Solution(); solution.initializeDates(); solution.updateLastDate(3_600_000L); System.out.println(solution.isLastDateContainsInDates()); } public boolean isLastDateContainsInDates() { return dates.contains(lastDate); } private void initializeDates() { dates = new HashSet<>(); lastDate = new Date(9999999L); dates.add(lastDate); dates.add(new Date(2222222L)); dates.add(new Date(3333333L)); dates.add(new Date(4444444L)); dates.add(new Date(5555555L)); } protected void updateLastDate(long delta) { //Здесь была проблема в том, что HashSet ищет элементы по hash, //а так-как Хэш объекта Date зависит от хранимого значения (long ht = this.getTime(); return (int) ht ^ (int) (ht >> 32);) //и мы его поменяли, значит хэш тоже поменялся. Естественно по новому значению ничего не находилось. //Исправил и все работает... dates.remove(lastDate); lastDate.setTime(lastDate.getTime() + delta); dates.add(lastDate); } }
{ "content_hash": "6574016586c232973dbe94a6b1530a05", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 130, "avg_line_length": 31.044444444444444, "alnum_prop": 0.6506800286327845, "repo_name": "Sukora-Stas/JavaRushTasks", "id": "ff321b2a8c19f73402b5b69f2bf8fd24b59b5ee5", "size": "1605", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "4.JavaCollections/src/com/javarush/task/task36/task3612/Solution.java", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "317223" }, { "name": "Java", "bytes": "1322306" } ], "symlink_target": "" }
<?php /** * The default template for displaying content, overridden by content-_____.php templates. * * @package Reddle * @since Reddle 1.0 */ ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <?php if ( '' != get_the_post_thumbnail() ) : $thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), full ); ?> <div class="entry-image"> <a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'reddle' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"> <img class="featured-image" src="<?php echo $thumbnail[0]; ?>" alt=""> </a> </div> <?php endif; ?> <header class="entry-header"> <h1 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'reddle' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h1> <?php if ( 'post' == get_post_type() ) : ?> <div class="entry-meta"> <?php reddle_posted_on(); ?> </div><!-- .entry-meta --> <?php endif; ?> <?php if ( comments_open() || ( '0' != get_comments_number() && ! comments_open() ) ) : ?> <p class="comments-link"><?php comments_popup_link( '<span class="no-reply">' . __( '0', 'reddle' ) . '</span>', __( '1', 'reddle' ), __( '%', 'reddle' ) ); ?></p> <?php endif; ?> </header><!-- .entry-header --> <?php if ( is_search() ) : // Only display Excerpts for Search ?> <div class="entry-summary"> <?php the_excerpt(); ?> </div><!-- .entry-summary --> <?php else : ?> <div class="entry-content"> <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'reddle' ) ); ?> <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'reddle' ), 'after' => '</div>' ) ); ?> </div><!-- .entry-content --> <?php endif; ?> <?php // translators: used between list items, there is a space after the comma $categories_list = get_the_category_list( __( ', ', 'reddle' ) ); // translators: used between list items, there is a space after the comma $tags_list = get_the_tag_list( '', __( ', ', 'reddle' ) ); // Check to see if there is a need for an article footer if ( 'post' == get_post_type() || $categories_list && reddle_categorized_blog() ) : ?> <footer class="entry-meta"> <?php if ( 'post' == get_post_type() ) : // Hide category and tag text for pages on Search ?> <?php if ( $categories_list && reddle_categorized_blog() ) : ?> <p class="cat-links taxonomy-links"> <?php printf( __( 'Posted in %1$s', 'reddle' ), $categories_list ); ?> </p> <?php endif; // End if categories ?> <?php if ( $tags_list ) : ?> <p class="tag-links taxonomy-links"> <?php printf( __( 'Tagged %1$s', 'reddle' ), $tags_list ); ?> </p> <?php endif; // End if $tags_list ?> <?php endif; // End if 'post' == get_post_type() ?> <p class="date-link"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'reddle' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark" class="permalink"><span class="month"><?php the_time( 'M' ); ?></span><span class="sep">&middot;</span><span class="day"><?php the_time( 'd' ); ?></span></a></p> <?php edit_post_link( __( 'Edit', 'reddle' ), '<p class="edit-link">', '</p>' ); ?> </footer><!-- #entry-meta --> <?php endif; // check to see if there is a need for an article footer ?> </article><!-- #post-<?php the_ID(); ?> -->
{ "content_hash": "6341601dcceca8c1101a523b0399a46e", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 338, "avg_line_length": 43.54430379746835, "alnum_prop": 0.5630813953488372, "repo_name": "NewWorldOrderly/portfolio", "id": "be2e5a9a68e799b81ec51c1401043d79abdfb5ca", "size": "3440", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "old-site/wp-content/themes/reddle/content.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "4763840" }, { "name": "JavaScript", "bytes": "2613430" }, { "name": "PHP", "bytes": "15794892" }, { "name": "Shell", "bytes": "406" } ], "symlink_target": "" }
@class TBGameAppDelegate; @interface TBGameScene : CCLayer { TBGameAppDelegate* gameDelegate; TBGameState *gameState; bool pause; bool ballOverBasket; bool gameOver; CGPoint ballMovementDelta; float ballRadius; CCMenuItem *leftControl; CCMenuItem *rightControl; //CCMenuItem *start; CCMenu *Backmenu; CCSprite *goLabel3; CCSprite *goLabel2; CCSprite *goLabel1; CCSprite *goLabelGO; int startTime; int characterIdx; int computerIdx; bool showingGoLabel; bool computerJumping; bool playerJumping; bool moveLeft; bool moveRight; int playerScore; int computerScore; int timer; CCLabelTTF *playerScoreLabel; CCLabelTTF *computerScoreLabel; CCLabelTTF *timerLabel; CCSprite *ball; CCSprite *player; CCSprite *computer; CCSprite *leftBasket; CCSprite *rightBasket; // instructions CCSprite *instructionsBg; CCSprite *charactersBg; CCSprite *playerSelectionBg; CCMenu *menuInstructions; CCMenu *menuPlayerSelection; CCSprite *gameOverBg; CCSprite *pauseBg; CCSprite *selectedCharacterBg; } +(id) scene; - (void) showGoLabel; - (void) updateGoLabel; - (void) showInstructions; - (void) instructionsEnded; - (void) addGameObjects; - (void) startClicked; - (void) backClicked; - (void) nextClicked; - (void) updateTimer; // game specific -(int) detectOverBasket; -(bool) detectBallBoundaryCheck; -(bool) detectBallPlayerCollision:(CCSprite *)cPlayer; -(void) resetBallPosition; -(void) updateBallPosition; @end
{ "content_hash": "d010a8b421bad70b39ac5174f4675cdd", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 54, "avg_line_length": 18.3875, "alnum_prop": 0.7593473827328348, "repo_name": "ranahammad/slamDunk", "id": "4f24cc933348574bd43305a70a537e886a41b619", "size": "1654", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Classes/TBGameScene.h", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "205367" }, { "name": "Objective-C", "bytes": "1499896" } ], "symlink_target": "" }
#ifndef STANDBY_H #define STANDBY_H #include "access/xlog.h" #include "storage/lock.h" #include "storage/procsignal.h" #include "storage/relfilenode.h" /* User-settable GUC parameters */ extern int vacuum_defer_cleanup_age; extern int max_standby_archive_delay; extern int max_standby_streaming_delay; extern void InitRecoveryTransactionEnvironment(void); extern void ShutdownRecoveryTransactionEnvironment(void); extern void ResolveRecoveryConflictWithSnapshot(TransactionId latestRemovedXid, RelFileNode node); extern void ResolveRecoveryConflictWithTablespace(Oid tsid); extern void ResolveRecoveryConflictWithDatabase(Oid dbid); extern void ResolveRecoveryConflictWithBufferPin(void); extern void SendRecoveryConflictWithBufferPin(ProcSignalReason reason); extern void CheckRecoveryConflictDeadlock(void); /* * Standby Rmgr (RM_STANDBY_ID) * * Standby recovery manager exists to perform actions that are required * to make hot standby work. That includes logging AccessExclusiveLocks taken * by transactions and running-xacts snapshots. */ extern void StandbyAcquireAccessExclusiveLock(TransactionId xid, Oid dbOid, Oid relOid); extern void StandbyReleaseLockTree(TransactionId xid, int nsubxids, TransactionId *subxids); extern void StandbyReleaseAllLocks(void); extern void StandbyReleaseOldLocks(int nxids, TransactionId *xids); /* * XLOG message types */ #define XLOG_STANDBY_LOCK 0x00 #define XLOG_RUNNING_XACTS 0x10 typedef struct xl_standby_locks { int nlocks; /* number of entries in locks array */ xl_standby_lock locks[1]; /* VARIABLE LENGTH ARRAY */ } xl_standby_locks; /* * When we write running xact data to WAL, we use this structure. */ typedef struct xl_running_xacts { int xcnt; /* # of xact ids in xids[] */ bool subxid_overflow; /* snapshot overflowed, subxids missing */ TransactionId nextXid; /* copy of ShmemVariableCache->nextXid */ TransactionId oldestRunningXid; /* *not* oldestXmin */ TransactionId latestCompletedXid; /* so we can set xmax */ TransactionId xids[1]; /* VARIABLE LENGTH ARRAY */ } xl_running_xacts; #define MinSizeOfXactRunningXacts offsetof(xl_running_xacts, xids) /* Recovery handlers for the Standby Rmgr (RM_STANDBY_ID) */ extern void standby_redo(XLogRecPtr lsn, XLogRecord *record); extern void standby_desc(StringInfo buf, uint8 xl_info, char *rec); /* * Declarations for GetRunningTransactionData(). Similar to Snapshots, but * not quite. This has nothing at all to do with visibility on this server, * so this is completely separate from snapmgr.c and snapmgr.h. * This data is important for creating the initial snapshot state on a * standby server. We need lots more information than a normal snapshot, * hence we use a specific data structure for our needs. This data * is written to WAL as a separate record immediately after each * checkpoint. That means that wherever we start a standby from we will * almost immediately see the data we need to begin executing queries. */ typedef struct RunningTransactionsData { int xcnt; /* # of xact ids in xids[] */ bool subxid_overflow; /* snapshot overflowed, subxids missing */ TransactionId nextXid; /* copy of ShmemVariableCache->nextXid */ TransactionId oldestRunningXid; /* *not* oldestXmin */ TransactionId latestCompletedXid; /* so we can set xmax */ TransactionId *xids; /* array of (sub)xids still running */ } RunningTransactionsData; typedef RunningTransactionsData *RunningTransactions; extern void LogAccessExclusiveLock(Oid dbOid, Oid relOid); extern void LogAccessExclusiveLockPrepare(void); extern void LogStandbySnapshot(void); #endif /* STANDBY_H */
{ "content_hash": "8030202a0bfaa52120972f81e7a77a55", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 88, "avg_line_length": 35.601941747572816, "alnum_prop": 0.7725661303517862, "repo_name": "ArcherCraftStore/ArcherVMPeridot", "id": "4b69be077b1bc2a6f5b617e74c1b0f43b8590a0c", "size": "4067", "binary": false, "copies": "6", "ref": "refs/heads/master", "path": "pgsql/include/server/storage/standby.h", "mode": "33261", "license": "apache-2.0", "language": [], "symlink_target": "" }
ACCEPTED #### According to Index Fungorum #### Published in null #### Original name Lecanora lentigera var. pseudocrassa Mattick ### Remarks null
{ "content_hash": "48630ec08c0da0eac1089d1e14aefc2b", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 44, "avg_line_length": 11.461538461538462, "alnum_prop": 0.7315436241610739, "repo_name": "mdoering/backbone", "id": "6e42436485993b999ec8e54adec3039b9b314c34", "size": "218", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Fungi/Ascomycota/Lecanoromycetes/Lecanorales/Stereocaulaceae/Squamarina/Squamarina cartilaginea/Squamarina crassa pseudocrassa/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
<?php class Vesti extends CI_Model { public function get_records(){ $sql = "SELECT * FROM vesti ORDER BY id DESC"; $query = $query = $this->db->query($sql); return $query->result(); } public function get_records_where($id){ $query = $this->db->get_where('vesti',array('id' => $id)); return $query->result(); } public function dodaj_vest($data){ $this->db->insert('vesti',$data); return; } public function azuriraj_vest($vest,$id){ $this->db->where('id',$id); $this->db->update('vesti',$vest); } public function obrisi_vest ($id){ $this->db->where('id',$id); $this->db->delete('vesti'); } } ?>
{ "content_hash": "fd96609c7323d2006e64af7d1717091c", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 61, "avg_line_length": 20.75, "alnum_prop": 0.5783132530120482, "repo_name": "mln4you/tornadoAjvar", "id": "24f672268abf54b6af053c6f6b44ab4d7f399f49", "size": "664", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "application/models/Vesti.php", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "476" }, { "name": "CSS", "bytes": "253820" }, { "name": "HTML", "bytes": "8347227" }, { "name": "JavaScript", "bytes": "68295" }, { "name": "PHP", "bytes": "1927962" } ], "symlink_target": "" }
Test posix_access() function : parameter validation --DESCRIPTION-- cases: no params, wrong param1, wrong param2, null directory, wrong directory, --CREDITS-- Moritz Neuhaeuser, info@xcompile.net PHP Testfest Berlin 2009-05-10 --SKIPIF-- <?php if (!extension_loaded('posix')) { die('SKIP The posix extension is not loaded.'); } if (posix_geteuid() == 0) { die('SKIP Cannot run test as root.'); } if (PHP_VERSION_ID < 503099) { die('SKIP Safe mode is no longer available.'); } ?> --FILE-- <?php var_dump( posix_access() ); var_dump( posix_access(array()) ); var_dump( posix_access('foo',array()) ); var_dump( posix_access(null) ); var_dump(posix_access('./foobar')); ?> ===DONE=== --EXPECTF-- Warning: posix_access() expects at least 1 parameter, 0 given in %s on line %d bool(false) Warning: posix_access() expects parameter 1 to be string, array given in %s on line %d bool(false) Warning: posix_access() expects parameter 2 to be long, array given in %s on line %d bool(false) bool(false) bool(false) ===DONE===
{ "content_hash": "a5f0eb2ecea4f9b85d0ae8b8b9ae10d1", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 86, "avg_line_length": 24.547619047619047, "alnum_prop": 0.6838021338506305, "repo_name": "xhava/hippyvm", "id": "0cd96c349e88bee25ccd74c08e50ead4ff02823e", "size": "1040", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "test_phpt/ext/posix/posix_access_error_wrongparams.phpt", "mode": "33188", "license": "mit", "language": [ { "name": "Assembly", "bytes": "1559" }, { "name": "C", "bytes": "2544055" }, { "name": "C++", "bytes": "255972" }, { "name": "HTML", "bytes": "415" }, { "name": "JavaScript", "bytes": "453641" }, { "name": "Makefile", "bytes": "4793" }, { "name": "PHP", "bytes": "15041037" }, { "name": "Python", "bytes": "2503719" }, { "name": "Shell", "bytes": "15527" } ], "symlink_target": "" }
package pl.jozwik.mvn2sbt import pl.jozwik.mvn2sbt.PluginConverter.PluginConverter case class PluginDescription( artifactId: String, sbtSetting: Option[String], pluginsSbtPluginConfiguration: String, extraRepository: String, dependencies: Seq[Dependency], pomConfigurationToSbtConfiguration: PluginConverter)
{ "content_hash": "8b75c8ec8e336522f11afa55c981d0b3", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 56, "avg_line_length": 29.363636363636363, "alnum_prop": 0.826625386996904, "repo_name": "ajozwik/mvn2sbt", "id": "34b403be173f53da43a4b9fb4510619b6a0b8246", "size": "323", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "converter/src/main/scala/pl/jozwik/mvn2sbt/PluginDescription.scala", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "2306" }, { "name": "Scala", "bytes": "50495" }, { "name": "Thrift", "bytes": "74" } ], "symlink_target": "" }
package monix.reactive.internal.builders import minitest.TestSuite import monix.execution.schedulers.TestScheduler import monix.reactive.{ Observable, Observer } import concurrent.duration._ object NeverObservableSuite extends TestSuite[TestScheduler] { def setup() = TestScheduler() def tearDown(s: TestScheduler): Unit = { assert(s.state.tasks.isEmpty, "Scheduler should be left with no pending tasks") } test("should never complete") { implicit s => Observable.never.unsafeSubscribeFn(new Observer[Any] { def onNext(elem: Any) = throw new IllegalStateException() def onComplete(): Unit = throw new IllegalStateException() def onError(ex: Throwable) = throw new IllegalStateException() }) s.tick(100.days) assert(s.state.lastReportedError == null) } }
{ "content_hash": "cda5ad84245ac8f9e585d9dab554578b", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 83, "avg_line_length": 31.076923076923077, "alnum_prop": 0.7363861386138614, "repo_name": "monifu/monix", "id": "2ed6be581485e169fe3c77a96cb5d19939816001", "size": "1468", "binary": false, "copies": "2", "ref": "refs/heads/monix-execution-cancelable", "path": "monix-reactive/shared/src/test/scala/monix/reactive/internal/builders/NeverObservableSuite.scala", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Scala", "bytes": "1366167" } ], "symlink_target": "" }
// Utility if (typeof Object.create !== 'function') { Object.create = function(obj) { function F() { } ; F.prototype = obj; return new F(); }; } (function($, window, document, undefined) { var Comment = { init_: function(options, elem) { var self = this; self.elem = elem; self.$elem = $(elem); self.options = $.extend({}, $.fn.comment.options, options); self.refresh_(1); }, buildForm_: function(comment_id, parent_id) { var self = this; var form_elem = $('<form></form>'); if (comment_id != null) form_elem.attr('action', self.options.url_input + '/' + comment_id); else form_elem.attr('action', self.options.url_input); form_elem.attr('method', 'post'); if (parent_id != null) { var parent_id_field = $('<input/>'); parent_id_field.attr('type', 'hidden'); parent_id_field.attr('name', 'parent_id'); parent_id_field.val(parent_id); form_elem.append(parent_id_field); } var textarea = $('<textarea></textarea>'); textarea.attr('name', 'text'); textarea.attr('placeHolder', 'Leave a message...'); textarea.css('overflow', 'hidden'); textarea.autogrow(); textarea.on('keypress', function(e) { e = e || event; if (e.keyCode === 13 && !e.shiftKey && $.trim(this.value).length > 0) { e.preventDefault(); //form_elem.submit(); self.submitForm_(comment_id, form_elem.serialize()); } }); form_elem.append(textarea); return form_elem; }, submitForm_: function(comment_id, form_data) { var self = this; var url_input = self.options.url_input; if (comment_id != null) // form edit mode url_input = self.options.url_input + '/' + comment_id; return $.ajax({ url: url_input, data: form_data, type: 'post', dataType: 'json', beforeSend: function(xhr, opts) { $('textarea', self.$elem).attr("disabled", true); } }).done(function(result) { if (result.success != undefined) { if (result.success === false) { // error $.each(result, function(key, val) { // check error if any if (val.error != undefined) { $show_warning_(val.error); return false; } }); } else { if (comment_id != null) // edit mode { var item = $('#posted-' + comment_id, self.$elem); var item_txt = $('.posted-comment-txt:hidden', item); item_txt.html(result.text); item_txt.toggle(); var item_form_edit = $('.posted-comment-form-edit', item); item_form_edit.toggle(); } else { result.fullname = self.user_info_.fullname; result.picture = self.user_info_.picture; // add new itemlist var itemlist = self.buildItemList_(result); if (result.parent_id === undefined) self.$rootlist.prepend(itemlist); else { if (result.parent_id == 0) self.$rootlist.prepend(itemlist); else { var id = 'posted-comment-child-' + result.parent_id; //prepend the new comment var the_child = $('ul[id="' + id + '"]', self.$elem).prepend(itemlist); // hide the form post $('div.posted-comments-postbox:visible', the_child).hide(); } } // update total comment self.total_comment++; self.$total_comment.html(self.total_comment + ' ' + self.options.title); } // clear and enable textarea $('textarea', self.$elem).val(''); $('textarea', self.$elem).attr("disabled", false); } } }); }, buildPostBox_: function(parent_id) { var self = this; var elem = $('<div></div>'); elem.addClass('posted-comments-postbox'); //self.user_info_ var img_elem = $('<img/>'); img_elem.attr('src', self.user_info_.picture); img_elem.attr('border', 0); img_elem.addClass('ui-corner-all'); img_elem.addClass('curr-user-photo'); var avatar = $('<div></div>'); avatar.addClass('avatar').addClass('pull-left'); avatar.append(img_elem); elem.append(avatar); var form = $('<div></div>'); form.addClass('form').addClass('pull-left'); if (self.user_info_.is_add_allowed) { // form new var form_elem = self.buildForm_(null, parent_id); form.append(form_elem); } elem.append(form); var clear = $('<div></div>'); clear.addClass('clear'); elem.append(clear); return elem; }, buildUl_: function() { var self = this; var ul_elem = $('<ul></ul>'); ul_elem.addClass('posted-comments'); return ul_elem; }, refresh_: function(length) { var self = this; setTimeout(function() { self.fetch_().done(function(results) { //console.log(results); // results['user'] if (results.results.user != undefined) self.user_info_ = results.results.user; // results['comments'] if (results.results.comments != undefined) results_ = results.results.comments; // results = self.limit_( results.results.comments, self.options.limit ); // results['total_comment'] if (results.results.total_comment != undefined) self.total_comment = results.results.total_comment; self.buildList_(results_); self.display_(); if (typeof self.options.onComplete === 'function') { self.options.onComplete.apply(self.elem, arguments); } if (self.options.refresh && self.options.auto_refresh) { self.refresh_(); } }); }, length || self.options.refresh); }, fetch_: function() { var self = this; return $.ajax({ url: self.options.url_get, dataType: 'json' }); }, buildList_: function(results) { var self = this; self.comments = $.map(results, function(obj, i) { return self.buildItemList_(obj); }); }, buildItemList_: function(comment_info) { var self = this; var item = $(self.options.wrapEachWith); item.attr('id', 'posted-' + comment_info.comment_id); // avatar-image var avatar = $('<div></div>'); avatar.addClass('avatar').addClass('pull-left'); var img_elem = $('<img/>'); img_elem.attr('src', comment_info.picture); img_elem.attr('border', 0); img_elem.addClass('ui-corner-all'); if (comment_info.created_by == self.user_info_.user_id) img_elem.addClass('curr-user-photo'); avatar.append(img_elem); item.append(avatar); // posted-comment-container var post_container = $('<div></div>'); post_container.addClass('posted-comment-container').addClass('pull-left'); // posted-comment-head var post_head = $('<div></div>'); post_head.addClass('posted-comment-head'); // user-fullname var username = $('<span></span>'); username.addClass('posted-comment-author'); username.html(comment_info.fullname); post_head.append(username); // in reply-to if (comment_info.parent_id != 0) { // in-reply-to var in_reply_to = $('<span></span>'); in_reply_to.addClass('in-reply-to'); in_reply_to.attr('title', 'in reply-to'); // arrow var arrow = $('<i></i>'); arrow.addClass('ui-icon'); arrow.addClass('ui-icon-arrow-1-e'); in_reply_to.append(arrow); post_head.append(in_reply_to); // user-fullname reply var username_reply = $('<span></span>'); username_reply.addClass('posted-comment-author-reply'); username_reply.html(comment_info.in_reply_to); post_head.append(username_reply); } // dot var dot = $('<span></span>'); dot.addClass('dot'); dot.html('&bull;'); post_head.append(dot); // posted time var posted_date = $('<span></span>'); posted_date.addClass('real-time'); posted_date.attr('title', self.timeStringToABBR_(comment_info.posted_date)); posted_date.html(comment_info.posted_date); posted_date.timeago(); post_head.append(posted_date); post_container.append(post_head); // posted-comment-body var post_body = $('<div></div>'); post_body.addClass('posted-comment-body'); // posted-comment-txt var post_txt = $('<div></div>'); post_txt.addClass('posted-comment-txt'); post_txt.html(comment_info.text); post_body.append(post_txt); post_container.append(post_body); // posted-comment-foot var post_foot = $('<div></div>'); post_foot.addClass('posted-comment-foot'); // Like button var like_container = $('<span></span>'); like_container.addClass('post-like'); var text = self.options.buttons.like; if (comment_info.liked == true) { text = self.options.buttons.unlike; } var like = $('<a>' + comment_info.total_like + '&nbsp;' + text + '</a>'); like.attr('href', '#'); like.attr('status', comment_info.liked); like.attr('title', self.options.buttons.like); like_container.append(like); $(like).click(function() { // Ex: posted-Comment_54aee1bf4395 var that = this; $.get( self.options.url_like + "&comment_id=" + comment_id, function(data) { if (self.options.onLike != undefined) { self.options.onLike(data); if (data.status == 'OK') { var comment_id = $(that).parent().parent().parent().parent().attr("id"); comment_id = comment_id.split("posted-")[1]; if ($(that).attr('status') == "true") { $(that).text(data.total + " " + self.options.buttons.like); $(that).attr('status', false); } else { $(that).text(data.total + " " + self.options.buttons.unlike); $(that).attr('status', true); } } else { alert(data.error); } } }, 'json' ); }); var comment_id = comment_info.comment_id; comments[comment_id] = {likes: comment_info.total_like}; post_foot.append(like_container); var dot = $('<span></span>'); dot.addClass('dot'); dot.html('&bull;'); post_foot.append(dot); // edit if (self.user_info_.is_edit_allowed && (comment_info.created_by == self.user_info_.user_id)) { // form edit var form_edit_container = $('<div></div>'); form_edit_container.addClass('posted-comment-form-edit'); form_edit_container.hide(); var form_edit_elem = self.buildForm_(comment_info.comment_id, comment_info.parent_id); form_edit_container.append(form_edit_elem); post_body.append(form_edit_container); var edit_container = $('<span></span>'); edit_container.addClass('post-edit'); var edit = $('<a>' + self.options.buttons.edit + '</a>'); edit.attr('href', '#'); edit.attr('title', self.options.buttons.edit); edit_container.append(edit); post_foot.append(edit_container); var dot = $('<span></span>'); dot.addClass('dot'); dot.html('&bull;'); post_foot.append(dot); // edit events-apply edit.on('click', function(e) { e.preventDefault(); post_txt.toggle(); form_edit_container.toggle(); var textarea = $('textarea', form_edit_container); textarea.val(post_txt.html()); textarea.autogrow(); textarea.focus(); }); } // delete if (self.user_info_.is_edit_allowed && (comment_info.created_by == self.user_info_.user_id)) { var delete_container = $('<span></span>'); delete_container.addClass('post-delete'); var delete_ = $('<a>' + self.options.buttons.delete + '</a>'); delete_.attr('href', '#'); delete_.attr('title', self.options.buttons.delete); delete_container.append(delete_); post_foot.append(delete_container); var dot = $('<span></span>'); dot.addClass('dot'); dot.html('&bull;'); post_foot.append(dot); // delete events-apply delete_.on('click', function(e) { e.preventDefault(); self.buildDeleteConfirm_(comment_info.comment_id); }); } // reply if (self.user_info_.is_add_allowed) { var reply_container = $('<span></span>'); reply_container.addClass('post-reply'); var reply = $('<a>' + self.options.buttons.reply + '</a>'); reply.attr('href', '#'); reply.attr('title', self.options.buttons.reply); reply_container.append(reply); post_foot.append(reply_container); } post_container.append(post_foot); item.append(post_container); var clear = $('<div></div>'); clear.addClass('clear'); item.append(clear); var ul_child_elem = $('<ul></ul>'); ul_child_elem.addClass('posted-comment-childs'); ul_child_elem.attr('id', 'posted-comment-child-' + comment_info.comment_id); // postbox reply will be toggled show/hide by reply event if (self.user_info_.is_add_allowed) { var postbox = self.buildPostBox_(comment_info.comment_id); postbox.hide(); ul_child_elem.append(postbox); // reply events-apply reply.on('click', function(e) { e.preventDefault(); postbox.toggle(); }); } // check if has childrens if (comment_info.childrens.length > 0) { for (var i = 0; i < comment_info.childrens.length; i++) { var child = self.buildItemList_(comment_info.childrens[i]); ul_child_elem.append(child); } } item.append(ul_child_elem); return item[0]; }, buildCountList_: function(total_comment) { var self = this; if (self.$total_comment === undefined) { self.$total_comment = $('<div></div>'); self.$total_comment.addClass('comment-length'); } self.$total_comment.html(self.total_comment + ' ' + self.options.title); return self.$total_comment; }, removeItemList_: function(comment_id) { var self = this; // find target var target = $('#posted-' + comment_id, self.$elem); // remove target target.remove(); }, display_: function() { var self = this; self.$comment_display = $('<div></div>'); self.$comment_display.addClass('comments-display'); var tc = self.buildCountList_(self.total_comment); self.$comment_display.append(tc); // default comment post form reply var postbox = self.buildPostBox_(null); self.$comment_display.append(postbox); self.$rootlist = self.buildUl_(); self.$rootlist.append(self.comments); self.$comment_display.append(self.$rootlist); if (self.options.transition === 'none' || !self.options.transition) { self.$elem.html(self.$comment_display); } else { self.$elem[ self.options.transition ](500, function() { self.$elem.html(self.$comment_display)[ self.options.transition ](500); }); } }, timeStringToABBR_: function(time_string) { var abbr_str = ''; var split = time_string.split(' '); if (split.length == 0) return abbr_str; abbr_str = split[0] + 'T'; if (split.length == 2) abbr_str += split[1] + 'Z'; return abbr_str; }, buildDeleteConfirm_: function(comment_id) { var self = this; var delete_confirm = $('div[id="dialog-delete-comment-confirm"]'); if (delete_confirm.length == 0) { delete_confirm = $('<div></div>'); delete_confirm.attr('id', 'dialog-delete-comment-confirm'); delete_confirm.attr('title', 'Confirmation'); var p = $('<p></p>'); var icon_alert = $('<span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 50px 0;"></span>'); var message = $('<span>Are You sure want to delete this data?</span>'); p.append(icon_alert); p.append(message); delete_confirm.append(p); delete_confirm.hide().appendTo('body'); } return delete_confirm.dialog({ autoOpen: true, modal: true, buttons: { Yes: function() { var form_data = {'comment_id': comment_id}; $.ajax({ url: self.options.url_delete, data: form_data, type: 'post', dataType: 'json', }).done(function(result) { if (result.success != undefined) { if (result.success === false) { // error $.each(result, function(key, val) { // check error if any if (val.error != undefined) { $show_warning_(val.error); return false; } }); } else { self.removeItemList_(comment_id); self.total_comment = result.total_comment; self.$total_comment.html(self.total_comment + ' ' + self.options.title); delete_confirm.dialog("close"); } } }); }, No: function() { delete_confirm.dialog("close"); } } }); }, limit_: function(obj, count) { return obj.slice(0, count); } }; $.fn.comment = function(options) { return this.each(function() { var comment = Object.create(Comment); comment.init_(options, this); $.data(this, 'comment', comment); }); }; // options $.fn.comment.options = { title: 'Notes', url_get: '#', url_input: '#', url_delete: '#', url_like: '#', wrapEachWith: '<li></li>', limit: 10, auto_refresh: true, refresh: null, onComplete: null, transition: 'fadeToggle', onSubmitSuccess: null, onLike: null, buttons: null, }; })(jQuery, window, document);
{ "content_hash": "398dec670b9dcb71d29665f254830185", "timestamp": "", "source": "github", "line_count": 695, "max_line_length": 115, "avg_line_length": 27.75251798561151, "alnum_prop": 0.5156574035669846, "repo_name": "backden/yii_freelectics", "id": "d5d2e4d1fa6fcf15ebfdc66918f1a4ea70b94eb8", "size": "19475", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "freeletics/js/jquery.comment.js", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "ApacheConf", "bytes": "1874" }, { "name": "Batchfile", "bytes": "1715" }, { "name": "CSS", "bytes": "465681" }, { "name": "Go", "bytes": "7076" }, { "name": "HTML", "bytes": "12543" }, { "name": "JavaScript", "bytes": "2248679" }, { "name": "PHP", "bytes": "18376643" }, { "name": "Python", "bytes": "5845" } ], "symlink_target": "" }
package org.koherent.variance; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @Target(ElementType.METHOD) @Retention(RetentionPolicy.CLASS) public @interface Ignored { }
{ "content_hash": "76a5f57bdd5bf2f334a225087ee1eaef", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 44, "avg_line_length": 23.916666666666668, "alnum_prop": 0.8257839721254355, "repo_name": "koher/Variance4J", "id": "5c3f8ef0e3f84eda9147cf0fe3e98ca4531858bc", "size": "287", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/org/koherent/variance/Ignored.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "43343" } ], "symlink_target": "" }
class ApplicationController < ActionController::Base protect_from_forgery # Rescue from rescue_from ActionController::RoutingError, :with => :render_http_error rescue_from ArgumentError, :with => :render_http_error rescue_from RSolr::Error::Http, :with => :render_internal_server_error rescue_from Errno::ECONNREFUSED, :with => :render_internal_server_error helper_method :current_user def authenticate unless session[:user_id] session[:return_url] ||= request.url redirect_to polymorphic_url(:new_user_session) and return end unless Rails.application.config.authorized_users.include?(current_user) unauthorized end end def current_user session[:user_id] end # Call this to bail out quickly and easily when something is not found. # It will be rescued and rendered as a 404 # Raise 404 def not_found raise ActionController::RoutingError.new 'Not found' end # Raise 401 def unauthorized raise ActionController::RoutingError.new 'Unauthorized' end # Raise 400 def bad_request raise ArgumentError.new 'Bad request' end # Raise 415 def unsupported_media_type raise ArgumentError.new 'Unsupported media type' end # Raise 501 def not_implemented raise ArgumentError.new 'Not implemented' end def render_error(code=nil) if code == 400 bad_request elsif code == 404 not_found else not_found # Render 404 in case of unknown error code. end end def render_http_error(exception) case exception.message when 'Not found' render :file => 'public/404', :format => :html, :status => :not_found, :layout => false when 'Unauthorized' render :file => 'public/401', :format => :html, :status => :unauthorized, :layout => false when 'Bad request' render :file => 'public/400', :format => :html, :status => :bad_request, :layout => false when 'Unsupported media type' render :file => 'public/415', :format => :html, :status => :unsupported_media_type, :layout => false when 'Not implemented' render :file => 'public/501', :format => :html, :status => :not_implemented, :layout => false else # Default error choice is 404 Not Found. render :file => 'public/404', :format => :html, :status => :not_found, :layout => false end end # Render 500 def render_internal_server_error render :file => 'public/500', :format => :html, :status => :internal_server_error, :layout => false end end
{ "content_hash": "7aa846a00a6a0c4b0b3fcc298701bed5", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 106, "avg_line_length": 28.839080459770116, "alnum_prop": 0.6711837385412515, "repo_name": "dtulibrary/gazo", "id": "289d1a87945f7ab0ee1f43ada562620114179679", "size": "2509", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/controllers/application_controller.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "983" }, { "name": "CoffeeScript", "bytes": "458" }, { "name": "JavaScript", "bytes": "599" }, { "name": "Puppet", "bytes": "185" }, { "name": "Ruby", "bytes": "93423" } ], "symlink_target": "" }
package org.elasticsearch.xpack.core.security.authz.privilege; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.transport.TransportRequest; import org.elasticsearch.xpack.core.security.action.GetApiKeyRequest; import org.elasticsearch.xpack.core.security.action.InvalidateApiKeyRequest; import org.elasticsearch.xpack.core.security.authc.Authentication; import org.elasticsearch.xpack.core.security.authz.permission.ClusterPermission; import org.elasticsearch.xpack.core.security.user.User; import java.util.Map; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; public class ManageOwnApiKeyClusterPrivilegeTests extends ESTestCase { public void testAuthenticationWithApiKeyAllowsAccessToApiKeyActionsWhenItIsOwner() { final ClusterPermission clusterPermission = ManageOwnApiKeyClusterPrivilege.INSTANCE.buildPermission(ClusterPermission.builder()).build(); final String apiKeyId = randomAlphaOfLengthBetween(4, 7); final Authentication authentication = createMockAuthentication("joe","_es_api_key", "_es_api_key", Map.of("_security_api_key_id", apiKeyId)); final TransportRequest getApiKeyRequest = GetApiKeyRequest.usingApiKeyId(apiKeyId, randomBoolean()); final TransportRequest invalidateApiKeyRequest = InvalidateApiKeyRequest.usingApiKeyId(apiKeyId, randomBoolean()); assertTrue(clusterPermission.check("cluster:admin/xpack/security/api_key/get", getApiKeyRequest, authentication)); assertTrue(clusterPermission.check("cluster:admin/xpack/security/api_key/invalidate", invalidateApiKeyRequest, authentication)); assertFalse(clusterPermission.check("cluster:admin/something", mock(TransportRequest.class), authentication)); } public void testAuthenticationWithApiKeyDeniesAccessToApiKeyActionsWhenItIsNotOwner() { final ClusterPermission clusterPermission = ManageOwnApiKeyClusterPrivilege.INSTANCE.buildPermission(ClusterPermission.builder()).build(); final String apiKeyId = randomAlphaOfLengthBetween(4, 7); final Authentication authentication = createMockAuthentication("joe","_es_api_key", "_es_api_key", Map.of("_security_api_key_id", randomAlphaOfLength(7))); final TransportRequest getApiKeyRequest = GetApiKeyRequest.usingApiKeyId(apiKeyId, randomBoolean()); final TransportRequest invalidateApiKeyRequest = InvalidateApiKeyRequest.usingApiKeyId(apiKeyId, randomBoolean()); assertFalse(clusterPermission.check("cluster:admin/xpack/security/api_key/get", getApiKeyRequest, authentication)); assertFalse(clusterPermission.check("cluster:admin/xpack/security/api_key/invalidate", invalidateApiKeyRequest, authentication)); } public void testAuthenticationWithUserAllowsAccessToApiKeyActionsWhenItIsOwner() { final ClusterPermission clusterPermission = ManageOwnApiKeyClusterPrivilege.INSTANCE.buildPermission(ClusterPermission.builder()).build(); final Authentication authentication = createMockAuthentication("joe","realm1", "native", Map.of()); final TransportRequest getApiKeyRequest = GetApiKeyRequest.usingRealmAndUserName("realm1", "joe"); final TransportRequest invalidateApiKeyRequest = InvalidateApiKeyRequest.usingRealmAndUserName("realm1", "joe"); assertTrue(clusterPermission.check("cluster:admin/xpack/security/api_key/get", getApiKeyRequest, authentication)); assertTrue(clusterPermission.check("cluster:admin/xpack/security/api_key/invalidate", invalidateApiKeyRequest, authentication)); assertFalse(clusterPermission.check("cluster:admin/something", mock(TransportRequest.class), authentication)); } public void testAuthenticationWithUserAllowsAccessToApiKeyActionsWhenItIsOwner_WithOwnerFlagOnly() { final ClusterPermission clusterPermission = ManageOwnApiKeyClusterPrivilege.INSTANCE.buildPermission(ClusterPermission.builder()).build(); final Authentication authentication = createMockAuthentication("joe","realm1", "native", Map.of()); final TransportRequest getApiKeyRequest = GetApiKeyRequest.forOwnedApiKeys(); final TransportRequest invalidateApiKeyRequest = InvalidateApiKeyRequest.forOwnedApiKeys(); assertTrue(clusterPermission.check("cluster:admin/xpack/security/api_key/get", getApiKeyRequest, authentication)); assertTrue(clusterPermission.check("cluster:admin/xpack/security/api_key/invalidate", invalidateApiKeyRequest, authentication)); assertFalse(clusterPermission.check("cluster:admin/something", mock(TransportRequest.class), authentication)); } public void testAuthenticationWithUserDeniesAccessToApiKeyActionsWhenItIsNotOwner() { final ClusterPermission clusterPermission = ManageOwnApiKeyClusterPrivilege.INSTANCE.buildPermission(ClusterPermission.builder()).build(); final Authentication authentication = createMockAuthentication("joe", "realm1", "native", Map.of()); final TransportRequest getApiKeyRequest = randomFrom( GetApiKeyRequest.usingRealmAndUserName("realm1", randomAlphaOfLength(7)), GetApiKeyRequest.usingRealmAndUserName(randomAlphaOfLength(5), "joe"), new GetApiKeyRequest(randomAlphaOfLength(5), randomAlphaOfLength(7), null, null, false)); final TransportRequest invalidateApiKeyRequest = randomFrom( InvalidateApiKeyRequest.usingRealmAndUserName("realm1", randomAlphaOfLength(7)), InvalidateApiKeyRequest.usingRealmAndUserName(randomAlphaOfLength(5), "joe"), new InvalidateApiKeyRequest(randomAlphaOfLength(5), randomAlphaOfLength(7), null, null, false)); assertFalse(clusterPermission.check("cluster:admin/xpack/security/api_key/get", getApiKeyRequest, authentication)); assertFalse(clusterPermission.check("cluster:admin/xpack/security/api_key/invalidate", invalidateApiKeyRequest, authentication)); } private Authentication createMockAuthentication(String username, String realmName, String realmType, Map<String, Object> metadata) { final User user = new User(username); final Authentication authentication = mock(Authentication.class); final Authentication.RealmRef authenticatedBy = mock(Authentication.RealmRef.class); when(authentication.getUser()).thenReturn(user); when(authentication.getAuthenticatedBy()).thenReturn(authenticatedBy); when(authenticatedBy.getName()).thenReturn(realmName); when(authenticatedBy.getType()).thenReturn(realmType); when(authentication.getMetadata()).thenReturn(metadata); return authentication; } }
{ "content_hash": "0ad89ed18cd8d4f8a86da918fd1d5430", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 137, "avg_line_length": 64.76923076923077, "alnum_prop": 0.7734560570071259, "repo_name": "coding0011/elasticsearch", "id": "c6d67b9e00b5844980d87c4157a2296b47b0df5c", "size": "6983", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/privilege/ManageOwnApiKeyClusterPrivilegeTests.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ANTLR", "bytes": "11081" }, { "name": "Batchfile", "bytes": "18064" }, { "name": "Emacs Lisp", "bytes": "3341" }, { "name": "FreeMarker", "bytes": "45" }, { "name": "Groovy", "bytes": "312193" }, { "name": "HTML", "bytes": "5519" }, { "name": "Java", "bytes": "41505710" }, { "name": "Perl", "bytes": "7271" }, { "name": "Python", "bytes": "55163" }, { "name": "Shell", "bytes": "119286" } ], "symlink_target": "" }
package us.theatr.akka.quartz import org.specs2.execute._ import org.specs2.mutable._ import akka.testkit.TestActorRef import akka.actor.{Props, ActorSystem, Actor} import akka.util.Timeout import akka.pattern.ask import scala.concurrent.duration.Duration import scala.util.{Success} class QuartzActor$Test extends Specification { object SpecActors { case class Tickle(id: Int) case class PopTickle() class RecvActor extends Actor { var lastMsg : Option[Tickle] = None def receive = { case a : Tickle => lastMsg = Some(a) case PopTickle() => { context.sender ! lastMsg lastMsg = None } case c => println("Unknown message on the recvactor!!" + c) } } } def withSystem(b : ActorSystem => ResultLike) = { implicit val system = ActorSystem("GAT") try { b(system).toResult } finally { system.shutdown() } } "Basic single actors should" should { implicit val timeout = Timeout(Duration(5, "seconds")) "add a cron job" in { withSystem { implicit system => val ar = TestActorRef(new QuartzActor) val recv = TestActorRef(new SpecActors.RecvActor) val f = (ar ? AddCronSchedule(recv, "* * * * * ?", SpecActors.Tickle(100), true)) f.value.get must beLike { case Success(t : AddCronScheduleResult) => ok } Thread.sleep(5000) (recv ? SpecActors.PopTickle()).value.get must beLike { case Success(Some(SpecActors.Tickle(100))) => ok } } } "add a cron job with open spigot" in { withSystem { implicit system => val ar = TestActorRef(new QuartzActor) val recv = TestActorRef(new SpecActors.RecvActor) ar ? AddCronSchedule(recv, "* * * * * ?", SpecActors.Tickle(150), true, new Spigot(){val open = true}) Thread.sleep(5000) (recv ? SpecActors.PopTickle()).value.get must beLike { case Success(Some(SpecActors.Tickle(150))) => ok } } } "add a cron job with closed spigot" in { withSystem { implicit system => val ar = TestActorRef(new QuartzActor) val recv = TestActorRef(new SpecActors.RecvActor) val f = (ar ? AddCronSchedule(recv, "* * * * * ?", SpecActors.Tickle(100), true, new Spigot(){val open = false})) f.value.get must beLike { case Success(t : AddCronScheduleResult) => ok } Thread.sleep(3000) (recv ? SpecActors.PopTickle()).value.get must beLike { case Success(None) => ok } } } "add then cancel messages" in { withSystem { implicit system => val ar = TestActorRef(new QuartzActor) val recv = TestActorRef(new SpecActors.RecvActor) val d = ar ? AddCronSchedule(recv, "4 4 * * * ?", SpecActors.Tickle(200), true) val cancel = d.value.get match { case Success(AddCronScheduleSuccess(cancel)) => cancel } cancel.cancel() Thread.sleep(100) cancel.isCancelled must beEqualTo(true) } } "fail with invalid cron expressions" in { withSystem { implicit system => val ar = TestActorRef(new QuartzActor) val recv = TestActorRef(new SpecActors.RecvActor) (ar ? AddCronSchedule(recv, "clearly invalid", SpecActors.Tickle(300), true)).value.get must beLike { case Success(AddCronScheduleFailure(e)) => ok } } } } }
{ "content_hash": "76f86f177d791df7fde9ccbf8d5e456d", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 117, "avg_line_length": 29.376146788990827, "alnum_prop": 0.6599000624609619, "repo_name": "theatrus/akka-quartz", "id": "8685af45ddc56de55c33afa61d647dc86df1fcbf", "size": "3202", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/test/scala/us/theatr/akka/quartz/QuartzActor$Test.scala", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Scala", "bytes": "10233" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <Button android:id="@+id/host_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/host_table_button" android:onClick="host_new_table" /> <Button android:id="@+id/join_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/join_table_button" android:onClick="join_existing_table" /> </LinearLayout>
{ "content_hash": "871326ad48affbf1cffa290e59bbf236", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 72, "avg_line_length": 34.476190476190474, "alnum_prop": 0.6519337016574586, "repo_name": "UWSysLab/Sapphire", "id": "f6551ee1b4650a0520a6f9d719c194ff39120dea", "size": "724", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "example_apps/WordScrambleWithFriends/res/layout/player_options.xml", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "13818" }, { "name": "Java", "bytes": "1224198" }, { "name": "Python", "bytes": "6344" }, { "name": "Shell", "bytes": "98" } ], "symlink_target": "" }
Vyotiainen::Application.config.session_store :cookie_store, key: '_vyotiainen_session'
{ "content_hash": "5027507101b3a71862e5fead5cadcf0e", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 86, "avg_line_length": 87, "alnum_prop": 0.8045977011494253, "repo_name": "juhakaja/vyotiainen", "id": "55c901d8737aeb85cfa1dca03621b86d97315fe7", "size": "148", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "config/initializers/session_store.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "901" }, { "name": "CoffeeScript", "bytes": "633" }, { "name": "JavaScript", "bytes": "682" }, { "name": "Ruby", "bytes": "25789" } ], "symlink_target": "" }
<?php use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Debug\Debug; // If you don't want to setup permissions the proper way, just uncomment the following PHP line // read http://symfony.com/doc/current/book/installation.html#configuration-and-setup for more information //umask(0000); // This check prevents access to debug front controllers that are deployed by accident to production servers. // Feel free to remove this, extend it, or make something more sophisticated. /*if (isset($_SERVER['HTTP_CLIENT_IP']) || isset($_SERVER['HTTP_X_FORWARDED_FOR']) || !(in_array(@$_SERVER['REMOTE_ADDR'], array('127.0.0.1', 'fe80::1', '::1')) || php_sapi_name() === 'cli-server' || True) ) { header('HTTP/1.0 403 Forbidden'); exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.'); } */ $loader = require_once __DIR__.'/../app/bootstrap.php.cache'; Debug::enable(); require_once __DIR__.'/../app/AppKernel.php'; $kernel = new AppKernel('dev', true); $kernel->loadClassCache(); $request = Request::createFromGlobals(); $response = $kernel->handle($request); $response->send(); $kernel->terminate($request, $response);
{ "content_hash": "1e99cb3fe3a9ac0089eeb28515ad9921", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 126, "avg_line_length": 39.8, "alnum_prop": 0.695142378559464, "repo_name": "crzskll/applicationFrais", "id": "a1dcc16dca3fc86bbac2ba5c199967cbef702c00", "size": "1194", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "web/app_dev.php", "mode": "33261", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "3073" }, { "name": "Batchfile", "bytes": "385" }, { "name": "CSS", "bytes": "39232" }, { "name": "HTML", "bytes": "64014" }, { "name": "JavaScript", "bytes": "292" }, { "name": "PHP", "bytes": "235504" }, { "name": "Shell", "bytes": "617" } ], "symlink_target": "" }
#ifndef TENSORFLOW_TSL_PLATFORM_CLOUD_RAM_FILE_BLOCK_CACHE_H_ #define TENSORFLOW_TSL_PLATFORM_CLOUD_RAM_FILE_BLOCK_CACHE_H_ #include <functional> #include <list> #include <map> #include <memory> #include <string> #include <vector> #include "tsl/platform/cloud/file_block_cache.h" #include "tsl/platform/env.h" #include "tsl/platform/mutex.h" #include "tsl/platform/notification.h" #include "tsl/platform/status.h" #include "tsl/platform/stringpiece.h" #include "tsl/platform/thread_annotations.h" #include "tsl/platform/types.h" namespace tsl { /// \brief An LRU block cache of file contents, keyed by {filename, offset}. /// /// This class should be shared by read-only random access files on a remote /// filesystem (e.g. GCS). class RamFileBlockCache : public FileBlockCache { public: /// The callback executed when a block is not found in the cache, and needs to /// be fetched from the backing filesystem. This callback is provided when the /// cache is constructed. The returned Status should be OK as long as the /// read from the remote filesystem succeeded (similar to the semantics of the /// read(2) system call). typedef std::function<Status(const string& filename, size_t offset, size_t buffer_size, char* buffer, size_t* bytes_transferred)> BlockFetcher; RamFileBlockCache(size_t block_size, size_t max_bytes, uint64 max_staleness, BlockFetcher block_fetcher, Env* env = Env::Default()) : block_size_(block_size), max_bytes_(max_bytes), max_staleness_(max_staleness), block_fetcher_(block_fetcher), env_(env) { if (max_staleness_ > 0) { pruning_thread_.reset(env_->StartThread(ThreadOptions(), "TF_prune_FBC", [this] { Prune(); })); } VLOG(1) << "GCS file block cache is " << (IsCacheEnabled() ? "enabled" : "disabled"); } ~RamFileBlockCache() override { if (pruning_thread_) { stop_pruning_thread_.Notify(); // Destroying pruning_thread_ will block until Prune() receives the above // notification and returns. pruning_thread_.reset(); } } /// Read `n` bytes from `filename` starting at `offset` into `out`. This /// method will return: /// /// 1) The error from the remote filesystem, if the read from the remote /// filesystem failed. /// 2) PRECONDITION_FAILED if the read from the remote filesystem succeeded, /// but the read returned a partial block, and the LRU cache contained a /// block at a higher offset (indicating that the partial block should have /// been a full block). /// 3) OUT_OF_RANGE if the read from the remote filesystem succeeded, but /// the file contents do not extend past `offset` and thus nothing was /// placed in `out`. /// 4) OK otherwise (i.e. the read succeeded, and at least one byte was placed /// in `out`). Status Read(const string& filename, size_t offset, size_t n, char* buffer, size_t* bytes_transferred) override; // Validate the given file signature with the existing file signature in the // cache. Returns true if the signature doesn't change or the file doesn't // exist before. If the signature changes, update the existing signature with // the new one and remove the file from cache. bool ValidateAndUpdateFileSignature(const string& filename, int64_t file_signature) override TF_LOCKS_EXCLUDED(mu_); /// Remove all cached blocks for `filename`. void RemoveFile(const string& filename) override TF_LOCKS_EXCLUDED(mu_); /// Remove all cached data. void Flush() override TF_LOCKS_EXCLUDED(mu_); /// Accessors for cache parameters. size_t block_size() const override { return block_size_; } size_t max_bytes() const override { return max_bytes_; } uint64 max_staleness() const override { return max_staleness_; } /// The current size (in bytes) of the cache. size_t CacheSize() const override TF_LOCKS_EXCLUDED(mu_); // Returns true if the cache is enabled. If false, the BlockFetcher callback // is always executed during Read. bool IsCacheEnabled() const override { return block_size_ > 0 && max_bytes_ > 0; } private: /// The size of the blocks stored in the LRU cache, as well as the size of the /// reads from the underlying filesystem. const size_t block_size_; /// The maximum number of bytes (sum of block sizes) allowed in the LRU cache. const size_t max_bytes_; /// The maximum staleness of any block in the LRU cache, in seconds. const uint64 max_staleness_; /// The callback to read a block from the underlying filesystem. const BlockFetcher block_fetcher_; /// The Env from which we read timestamps. Env* const env_; // not owned /// \brief The key type for the file block cache. /// /// The file block cache key is a {filename, offset} pair. typedef std::pair<string, size_t> Key; /// \brief The state of a block. /// /// A block begins in the CREATED stage. The first thread will attempt to read /// the block from the filesystem, transitioning the state of the block to /// FETCHING. After completing, if the read was successful the state should /// be FINISHED. Otherwise the state should be ERROR. A subsequent read can /// re-fetch the block if the state is ERROR. enum class FetchState { CREATED, FETCHING, FINISHED, ERROR, }; /// \brief A block of a file. /// /// A file block consists of the block data, the block's current position in /// the LRU cache, the timestamp (seconds since epoch) at which the block /// was cached, a coordination lock, and state & condition variables. /// /// Thread safety: /// The iterator and timestamp fields should only be accessed while holding /// the block-cache-wide mu_ instance variable. The state variable should only /// be accessed while holding the Block's mu lock. The data vector should only /// be accessed after state == FINISHED, and it should never be modified. /// /// In order to prevent deadlocks, never grab the block-cache-wide mu_ lock /// AFTER grabbing any block's mu lock. It is safe to grab mu without locking /// mu_. struct Block { /// The block data. std::vector<char> data; /// A list iterator pointing to the block's position in the LRU list. std::list<Key>::iterator lru_iterator; /// A list iterator pointing to the block's position in the LRA list. std::list<Key>::iterator lra_iterator; /// The timestamp (seconds since epoch) at which the block was cached. uint64 timestamp; /// Mutex to guard state variable mutex mu; /// The state of the block. FetchState state TF_GUARDED_BY(mu) = FetchState::CREATED; /// Wait on cond_var if state is FETCHING. condition_variable cond_var; }; /// \brief The block map type for the file block cache. /// /// The block map is an ordered map from Key to Block. typedef std::map<Key, std::shared_ptr<Block>> BlockMap; /// Prune the cache by removing files with expired blocks. void Prune() TF_LOCKS_EXCLUDED(mu_); bool BlockNotStale(const std::shared_ptr<Block>& block) TF_EXCLUSIVE_LOCKS_REQUIRED(mu_); /// Look up a Key in the block cache. std::shared_ptr<Block> Lookup(const Key& key) TF_LOCKS_EXCLUDED(mu_); Status MaybeFetch(const Key& key, const std::shared_ptr<Block>& block) TF_LOCKS_EXCLUDED(mu_); /// Trim the block cache to make room for another entry. void Trim() TF_EXCLUSIVE_LOCKS_REQUIRED(mu_); /// Update the LRU iterator for the block at `key`. Status UpdateLRU(const Key& key, const std::shared_ptr<Block>& block) TF_LOCKS_EXCLUDED(mu_); /// Remove all blocks of a file, with mu_ already held. void RemoveFile_Locked(const string& filename) TF_EXCLUSIVE_LOCKS_REQUIRED(mu_); /// Remove the block `entry` from the block map and LRU list, and update the /// cache size accordingly. void RemoveBlock(BlockMap::iterator entry) TF_EXCLUSIVE_LOCKS_REQUIRED(mu_); /// The cache pruning thread that removes files with expired blocks. std::unique_ptr<Thread> pruning_thread_; /// Notification for stopping the cache pruning thread. Notification stop_pruning_thread_; /// Guards access to the block map, LRU list, and cached byte count. mutable mutex mu_; /// The block map (map from Key to Block). BlockMap block_map_ TF_GUARDED_BY(mu_); /// The LRU list of block keys. The front of the list identifies the most /// recently accessed block. std::list<Key> lru_list_ TF_GUARDED_BY(mu_); /// The LRA (least recently added) list of block keys. The front of the list /// identifies the most recently added block. /// /// Note: blocks are added to lra_list_ only after they have successfully been /// fetched from the underlying block store. std::list<Key> lra_list_ TF_GUARDED_BY(mu_); /// The combined number of bytes in all of the cached blocks. size_t cache_size_ TF_GUARDED_BY(mu_) = 0; // A filename->file_signature map. std::map<string, int64_t> file_signature_map_ TF_GUARDED_BY(mu_); }; } // namespace tsl #endif // TENSORFLOW_TSL_PLATFORM_CLOUD_RAM_FILE_BLOCK_CACHE_H_
{ "content_hash": "7f43af0b78f2183c799d243ac41615aa", "timestamp": "", "source": "github", "line_count": 237, "max_line_length": 80, "avg_line_length": 39.143459915611814, "alnum_prop": 0.6793144335453272, "repo_name": "google/tsl", "id": "76cf7eb237dc53f32f91fb5412bc35a9d40f4653", "size": "9945", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "tsl/platform/cloud/ram_file_block_cache.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "55" }, { "name": "C", "bytes": "77550" }, { "name": "C++", "bytes": "10452747" }, { "name": "Shell", "bytes": "6507" }, { "name": "Smarty", "bytes": "88448" }, { "name": "Starlark", "bytes": "1703332" } ], "symlink_target": "" }
package com.intellij.historyIntegrTests.ui; import com.intellij.history.integration.ui.models.DirectoryHistoryDialogModel; import com.intellij.history.integration.ui.models.FileDifferenceModel; import com.intellij.history.integration.ui.models.HistoryDialogModel; import com.intellij.history.integration.ui.models.NullRevisionsProgress; import com.intellij.history.integration.ui.views.DirectoryChange; import com.intellij.history.integration.ui.views.DirectoryHistoryDialog; import com.intellij.openapi.diff.DiffContent; import com.intellij.openapi.diff.DocumentContent; import com.intellij.openapi.vfs.VirtualFile; import org.junit.Test; import java.io.IOException; import java.util.Collections; public class DirectoryHistoryDialogTest extends LocalHistoryUITestCase { public void testDialogWorks() throws IOException { DirectoryHistoryDialog d = new DirectoryHistoryDialog(gateway, root); d.close(0); } public void testFileDifference() throws IOException { VirtualFile f = root.createChildData(null, "f.txt"); f.setBinaryContent("old".getBytes()); f.setBinaryContent("new".getBytes()); f.setBinaryContent("current".getBytes()); HistoryDialogModel m = createModelAndSelectRevisions(1, 2); DirectoryChange c = (DirectoryChange)m.getChanges().get(0); DiffContent left = c.getFileDifferenceModel().getLeftDiffContent(new NullRevisionsProgress()); DiffContent right = c.getFileDifferenceModel().getRightDiffContent(new NullRevisionsProgress()); assertEquals("old", new String(left.getBytes())); assertEquals("new", new String(right.getBytes())); m.selectRevisions(0, 1); c = (DirectoryChange)m.getChanges().get(0); right = c.getFileDifferenceModel().getRightDiffContent(new NullRevisionsProgress()); assertEquals("current", new String(right.getBytes())); assertTrue(right instanceof DocumentContent); } @Test public void testFileDifferenceModelWhenOneOfTheEntryIsNull() throws IOException { root.createChildData(null, "dummy.txt"); getVcs().beginChangeSet(); VirtualFile f = root.createChildData(null, "f.txt"); f.setBinaryContent("content".getBytes(), -1, 123); getVcs().endChangeSet(null); f.delete(null); HistoryDialogModel dm = createModelAndSelectRevisions(0, 1); FileDifferenceModel m = ((DirectoryChange)dm.getChanges().get(0)).getFileDifferenceModel(); assertTrue(m.getTitle(), m.getTitle().endsWith("f.txt")); assertTrue(m.getLeftTitle(new NullRevisionsProgress()).endsWith("f.txt")); assertEquals("File does not exist", m.getRightTitle(new NullRevisionsProgress())); assertContents(m, "content", ""); dm.selectRevisions(1, 2); m = ((DirectoryChange)dm.getChanges().get(0)).getFileDifferenceModel(); assertTrue(m.getTitle(), m.getTitle().endsWith("f.txt")); assertEquals("File does not exist", m.getLeftTitle(new NullRevisionsProgress())); assertTrue(m.getRightTitle(new NullRevisionsProgress()).endsWith("f.txt")); assertContents(m, "", "content"); } private void assertContents(FileDifferenceModel m, String expectedLeft, String expectedRight) throws IOException { assertEquals(expectedLeft, new String(m.getLeftDiffContent(new NullRevisionsProgress()).getBytes())); assertEquals(expectedRight, new String(m.getRightDiffContent(new NullRevisionsProgress()).getBytes())); } public void testRevertion() throws Exception { root.createChildData(null, "f.txt"); HistoryDialogModel m = createModelAndSelectRevision(1); m.createReverter().revert(); assertNull(root.findChild("f.txt")); } public void testSelectionRevertion() throws Exception { root.createChildData(null, "f1.txt"); root.createChildData(null, "f2.txt"); DirectoryHistoryDialogModel m = createModelAndSelectRevision(2); DirectoryChange c = (DirectoryChange)m.getChanges().get(0); m.createRevisionReverter(Collections.singletonList(c.getDifference())).revert(); assertNull(root.findChild("f1.txt")); assertNotNull(root.findChild("f2.txt")); } public void testChangeRevertion() throws Exception { VirtualFile dir = root.createChildDirectory(null, "oldDir"); VirtualFile f = dir.createChildData(null, "f.txt"); dir.rename(null, "newDir"); f.move(null, root); HistoryDialogModel m = new DirectoryHistoryDialogModel(gateway, getVcs(), dir); m.selectChanges(1, 1); // rename m.createReverter().revert(); assertEquals("oldDir", dir.getName()); assertEquals(dir, f.getParent()); } private DirectoryHistoryDialogModel createModelAndSelectRevision(int rev) { return createModelAndSelectRevisions(rev, rev); } private DirectoryHistoryDialogModel createModelAndSelectRevisions(int first, int second) { DirectoryHistoryDialogModel m = new DirectoryHistoryDialogModel(gateway, getVcs(), root); m.selectRevisions(first, second); return m; } }
{ "content_hash": "d3fc6c58011ee5ac67cb7745453ca65c", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 116, "avg_line_length": 38.98412698412698, "alnum_prop": 0.7471498371335505, "repo_name": "jexp/idea2", "id": "0a8331debe8d4993547d7415c400d7ebd5116a8a", "size": "5512", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "platform/lvcs-impl/testSrc/com/intellij/historyIntegrTests/ui/DirectoryHistoryDialogTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "6350" }, { "name": "C#", "bytes": "103" }, { "name": "C++", "bytes": "30760" }, { "name": "Erlang", "bytes": "10" }, { "name": "Java", "bytes": "72888555" }, { "name": "JavaScript", "bytes": "910" }, { "name": "PHP", "bytes": "133" }, { "name": "Perl", "bytes": "6523" }, { "name": "Shell", "bytes": "4068" } ], "symlink_target": "" }
<?php namespace Oro\Bundle\ConfigBundle\Tests\Functional\Controller; use Oro\Bundle\TestFrameworkBundle\Test\WebTestCase; abstract class AbstractConfigurationControllerTest extends WebTestCase { /** * @param array $parameters * @return string */ abstract protected function getRequestUrl(array $parameters); protected function setUp() { $this->initClient([], $this->generateBasicAuthHeader()); } /** * @param array $parameters * @param array $expected * * @dataProvider getParameters */ public function testSystemActionDesktopVersion($parameters, array $expected) { $crawler = $this->client->request('GET', $this->getRequestUrl($parameters)); $result = $this->client->getResponse(); $this->assertHtmlResponseStatusCodeEquals($result, 200); $this->assertNotContains( 'System configuration is not available in mobile version. Please open the page on the desktop.', $crawler->html() ); foreach ($expected as $value) { $this->assertContains($value, $crawler->html()); } } /** * @param array $parameters * * @dataProvider getParameters */ public function testSystemActionMobileVersion($parameters) { $crawler = $this->client->request( 'GET', $this->getRequestUrl($parameters), [], [], [ 'HTTP_USER_AGENT' => 'Mozilla/5.0 (iPhone; CPU iPhone OS 10_0 like Mac OS X) '. 'AppleWebKit/602.1.38 (KHTML, like Gecko) Version/10.0 Mobile/14A300 Safari/602.1' ] ); $result = $this->client->getResponse(); $this->assertHtmlResponseStatusCodeEquals($result, 200); $this->assertContains( 'System configuration is not available in mobile version. Please open the page on the desktop.', $crawler->html() ); } /** * @return array */ public function getParameters() { return [ 'main user configuration page' => [ 'parameters' => [ 'activeGroup' => null, 'activeSubGroup' => null, ], 'expected' => ['Application Settings', 'Application URL'] ], 'user configuration sub page' => [ 'parameters' => [ 'activeGroup' => 'platform', 'activeSubGroup' => 'localization', ], 'expected' => ['Location options', 'Primary Location'] ], ]; } }
{ "content_hash": "4bab1813aac0dd08f49fd74dce1e36be", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 108, "avg_line_length": 30.386363636363637, "alnum_prop": 0.5452505609573672, "repo_name": "orocrm/platform", "id": "f8bdf1c458d15fb564cd850fa79f9b7bb949c942", "size": "2674", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Oro/Bundle/ConfigBundle/Tests/Functional/Controller/AbstractConfigurationControllerTest.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "618485" }, { "name": "Gherkin", "bytes": "158217" }, { "name": "HTML", "bytes": "1648915" }, { "name": "JavaScript", "bytes": "3326127" }, { "name": "PHP", "bytes": "37828618" } ], "symlink_target": "" }
<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>com.github.inari-soft</groupId> <artifactId>inari-experimental</artifactId> <version>1.0-SNAPSHOT</version> <repositories> <repository> <id>jitpack.io</id> <url>https://jitpack.io</url> </repository> </repositories> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-release-plugin</artifactId> <version>2.4</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.7</source> <target>1.7</target> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-source-plugin</artifactId> <executions> <execution> <id>attach-sources</id> <goals> <goal>jar</goal> </goals> </execution> </executions> </plugin> </plugins> </build> <dependencies> <!-- <dependency> --> <!-- <groupId>com.badlogicgames.gdx</groupId> --> <!-- <artifactId>gdx-platform</artifactId> --> <!-- <version>1.6.5</version> --> <!-- <classifier>natives-desktop</classifier> --> <!-- </dependency> --> <!-- <dependency> --> <!-- <groupId>com.badlogicgames.gdx</groupId> --> <!-- <artifactId>gdx-backend-lwjgl</artifactId> --> <!-- <version>1.6.5</version> --> <!-- </dependency> --> <dependency> <groupId>com.github.Inari-Soft</groupId> <artifactId>inari-firefly-libGDX</artifactId> <version>-SNAPSHOT</version> </dependency> <dependency> <groupId>com.github.Inari-Soft</groupId> <artifactId>inari-firefly-lib</artifactId> <version>-SNAPSHOT</version> </dependency> </dependencies> </project>
{ "content_hash": "7feb4a8d796bb91476434a2fc27838fe", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 204, "avg_line_length": 33.45454545454545, "alnum_prop": 0.572463768115942, "repo_name": "Inari-Soft/inari-experimental", "id": "6ac9b6e9a5e7e78d298651524bf62d8f527dcf04", "size": "2208", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "pom.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "111313" } ], "symlink_target": "" }
Openshift Token Generator Bot === > If you have to ask, you can't afford it. > > &mdash; J. P. Morgan
{ "content_hash": "797af0b812d59c30ada51c9890e306d2", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 42, "avg_line_length": 17.166666666666668, "alnum_prop": 0.6601941747572816, "repo_name": "connyay/token-gen-bot", "id": "43cc99dd2c444e611ee563eaf335e7ff0d9e77dc", "size": "103", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "2093" }, { "name": "Shell", "bytes": "189" } ], "symlink_target": "" }
namespace Microsoft.DocAsCode.Metadata.ManagedReference.Tests { using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Reflection; using Xunit; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.VisualBasic; using Microsoft.CodeAnalysis.Emit; using Microsoft.CodeAnalysis.MSBuild; using Microsoft.DocAsCode.DataContracts.ManagedReference; using static Microsoft.DocAsCode.Metadata.ManagedReference.ExtractMetadataWorker; [Trait("Owner", "vwxyzh")] [Trait("Language", "VB")] [Trait("EntityType", "Model")] [Collection("docfx STA")] public class GenerateMetadataFromVBUnitTest { private static readonly MSBuildWorkspace Workspace = MSBuildWorkspace.Create(); [Trait("Related", "Generic")] [Fact] public void TestGenereateMetadataWithClass() { string code = @" Imports System.Collections.Generic Namespace Test1 Public Class Class1 End Class Public Class Class2(Of T) Inherits List(Of T) End Class Public Class Class3(Of T1, T2 As T1) End Class Public Class Class4(Of T1 As { Structure, IEnumerable(Of T2) }, T2 As { Class, New }) End Class End Namespace "; MetadataItem output = GenerateYamlMetadata(CreateCompilationFromVBCode(code)); Assert.Equal(1, output.Items.Count); { var type = output.Items[0].Items[0]; Assert.NotNull(type); Assert.Equal("Class1", type.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Class1", type.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Class1", type.Name); Assert.Equal(@"Public Class Class1", type.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "Class" }, type.Modifiers[SyntaxLanguage.VB]); } { var type = output.Items[0].Items[1]; Assert.NotNull(type); Assert.Equal("Class2(Of T)", type.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Class2(Of T)", type.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Class2`1", type.Name); Assert.Equal(@"Public Class Class2(Of T) Inherits List(Of T) Implements IList(Of T), ICollection(Of T), IList, ICollection, IReadOnlyList(Of T), IReadOnlyCollection(Of T), IEnumerable(Of T), IEnumerable", type.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "Class" }, type.Modifiers[SyntaxLanguage.VB]); } { var type = output.Items[0].Items[2]; Assert.NotNull(type); Assert.Equal("Class3(Of T1, T2)", type.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Class3(Of T1, T2)", type.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Class3`2", type.Name); Assert.Equal(@"Public Class Class3(Of T1, T2 As T1)", type.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "Class" }, type.Modifiers[SyntaxLanguage.VB]); } { var type = output.Items[0].Items[3]; Assert.NotNull(type); Assert.Equal("Class4(Of T1, T2)", type.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Class4(Of T1, T2)", type.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Class4`2", type.Name); Assert.Equal(@"Public Class Class4(Of T1 As {Structure, IEnumerable(Of T2)}, T2 As {Class, New})", type.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "Class" }, type.Modifiers[SyntaxLanguage.VB]); } } [Fact] public void TestGenereateMetadataWithEnum() { string code = @" Namespace Test1 Public Enum Enum1 End Enum Public Enum Enum2 As Byte End Enum Public Enum Enum3 As Integer End Enum End Namespace "; MetadataItem output = GenerateYamlMetadata(CreateCompilationFromVBCode(code)); Assert.Equal(1, output.Items.Count); { var type = output.Items[0].Items[0]; Assert.NotNull(type); Assert.Equal("Enum1", type.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Enum1", type.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Enum1", type.Name); Assert.Equal(@"Public Enum Enum1", type.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "Enum" }, type.Modifiers[SyntaxLanguage.VB]); } { var type = output.Items[0].Items[1]; Assert.NotNull(type); Assert.Equal("Enum2", type.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Enum2", type.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Enum2", type.Name); Assert.Equal(@"Public Enum Enum2 As Byte", type.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "Enum" }, type.Modifiers[SyntaxLanguage.VB]); } { var type = output.Items[0].Items[2]; Assert.NotNull(type); Assert.Equal("Enum3", type.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Enum3", type.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Enum3", type.Name); Assert.Equal(@"Public Enum Enum3", type.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "Enum" }, type.Modifiers[SyntaxLanguage.VB]); } } [Trait("Related", "Generic")] [Fact] public void TestGenereateMetadataWithInterface() { string code = @" Namespace Test1 Public Interface IA End Interface Public Interface IB(Of T As Class) End Interface Public Interface IC(Of TItem As {IA, New}) Inherits IA, IB(Of TItem()) End Interface End Namespace "; MetadataItem output = GenerateYamlMetadata(CreateCompilationFromVBCode(code)); Assert.Equal(1, output.Items.Count); { var type = output.Items[0].Items[0]; Assert.NotNull(type); Assert.Equal("IA", type.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.IA", type.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.IA", type.Name); Assert.Equal(@"Public Interface IA", type.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "Interface" }, type.Modifiers[SyntaxLanguage.VB]); } { var type = output.Items[0].Items[1]; Assert.NotNull(type); Assert.Equal("IB(Of T)", type.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.IB(Of T)", type.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.IB`1", type.Name); Assert.Equal(@"Public Interface IB(Of T As Class)", type.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "Interface" }, type.Modifiers[SyntaxLanguage.VB]); } { var type = output.Items[0].Items[2]; Assert.NotNull(type); Assert.Equal("IC(Of TItem)", type.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.IC(Of TItem)", type.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.IC`1", type.Name); Assert.Equal(@"Public Interface IC(Of TItem As {IA, New}) Inherits IA, IB(Of TItem())", type.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "Interface" }, type.Modifiers[SyntaxLanguage.VB]); } } [Trait("Related", "Generic")] [Fact] public void TestGenereateMetadataWithStructure() { string code = @" Namespace Test1 Public Structure S1 End Structure Public Structure S2(Of T As Class) End Structure Public Structure S3(Of T1 As {Class, IA, New}, T2 As IB(Of T1)) Implements IA, IB(Of T1()) End Structure Public Interface IA End Interface Public Interface IB(Of T As Class) End Interface End Namespace "; MetadataItem output = GenerateYamlMetadata(CreateCompilationFromVBCode(code)); Assert.Equal(1, output.Items.Count); { var type = output.Items[0].Items[0]; Assert.NotNull(type); Assert.Equal("S1", type.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.S1", type.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.S1", type.Name); Assert.Equal(@"Public Structure S1", type.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "Structure" }, type.Modifiers[SyntaxLanguage.VB]); } { var type = output.Items[0].Items[1]; Assert.NotNull(type); Assert.Equal("S2(Of T)", type.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.S2(Of T)", type.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.S2`1", type.Name); Assert.Equal(@"Public Structure S2(Of T As Class)", type.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "Structure" }, type.Modifiers[SyntaxLanguage.VB]); } { var type = output.Items[0].Items[2]; Assert.NotNull(type); Assert.Equal("S3(Of T1, T2)", type.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.S3(Of T1, T2)", type.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.S3`2", type.Name); Assert.Equal(@"Public Structure S3(Of T1 As {Class, IA, New}, T2 As IB(Of T1)) Implements IA, IB(Of T1())", type.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "Structure" }, type.Modifiers[SyntaxLanguage.VB]); } } [Trait("Related", "Generic")] [Fact] public void TestGenereateMetadataWithDelegate() { string code = @" Namespace Test1 Public Delegate Sub D1 Public Delegate Sub D2(Of T As Class)(x() as integer) Public Delegate Function D3(Of T1 As Class, T2 As {T1, New})(ByRef x As T1) As T2 End Namespace "; MetadataItem output = GenerateYamlMetadata(CreateCompilationFromVBCode(code)); Assert.Equal(1, output.Items.Count); { var type = output.Items[0].Items[0]; Assert.NotNull(type); Assert.Equal("D1", type.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.D1", type.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.D1", type.Name); Assert.Equal(@"Public Delegate Sub D1", type.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "Delegate" }, type.Modifiers[SyntaxLanguage.VB]); } { var type = output.Items[0].Items[1]; Assert.NotNull(type); Assert.Equal("D2(Of T)", type.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.D2(Of T)", type.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.D2`1", type.Name); Assert.Equal(@"Public Delegate Sub D2(Of T As Class)(x As Integer())", type.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "Delegate" }, type.Modifiers[SyntaxLanguage.VB]); } { var type = output.Items[0].Items[2]; Assert.NotNull(type); Assert.Equal("D3(Of T1, T2)", type.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.D3(Of T1, T2)", type.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.D3`2", type.Name); Assert.Equal(@"Public Delegate Function D3(Of T1 As Class, T2 As {T1, New})(ByRef x As T1) As T2", type.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "Delegate" }, type.Modifiers[SyntaxLanguage.VB]); } } [Fact] public void TestGenereateMetadataWithModule() { string code = @" Namespace Test1 Public Module M1 End Module End Namespace "; MetadataItem output = GenerateYamlMetadata(CreateCompilationFromVBCode(code)); Assert.Equal(1, output.Items.Count); { var type = output.Items[0].Items[0]; Assert.NotNull(type); Assert.Equal("M1", type.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.M1", type.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.M1", type.Name); Assert.Equal(@"Public Module M1", type.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "Module" }, type.Modifiers[SyntaxLanguage.VB]); } } [Trait("Related", "Generic")] [Trait("Related", "Inheritance")] [Fact] public void TestGenereateMetadataWithMethod() { string code = @" Namespace Test1 Public MustInherit Class Foo(Of T) Public Overridable Sub M1(x As Integer, ParamArray y() As Integer) End Sub Public MustOverride Sub M2(Of T1 As Class, T2 As Foo(Of T1))(x As T1, ByRef y As T2()) Public Sub M3 End Sub Protected Friend Shared Function M4(Of T1 As Class)(x As T) As T1 Return Nothing End Function End Class Public MustInherit Class Bar Inherits Foo(Of String) Implements IFooBar Public Overrides Sub M1(x As Integer, y() As Integer) End Sub Public NotOverridable Overrides Sub M2(Of T1 As Class, T2 As Foo(Of T1))(x As T1, ByRef y() As T2) End Sub Public Shadows Sub M3() End Sub End Class Public Interface IFooBar Sub M1(x As Integer, ParamArray y() As Integer) Sub M2(Of T1 As Class, T2 As Foo(Of T1))(x As T1, ByRef y() As T2) Sub M3() End Interface End Namespace "; MetadataItem output = GenerateYamlMetadata(CreateCompilationFromVBCode(code)); Assert.Equal(1, output.Items.Count); // Foo<T> { var method = output.Items[0].Items[0].Items[0]; Assert.NotNull(method); Assert.Equal("M1(Int32, Int32())", method.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo(Of T).M1(System.Int32, System.Int32())", method.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo`1.M1(System.Int32,System.Int32[])", method.Name); Assert.Equal("Public Overridable Sub M1(x As Integer, ParamArray y As Integer())", method.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "Overridable" }, method.Modifiers[SyntaxLanguage.VB]); } { var method = output.Items[0].Items[0].Items[1]; Assert.NotNull(method); Assert.Equal("M2(Of T1, T2)(T1, ByRef T2())", method.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo(Of T).M2(Of T1, T2)(T1, ByRef T2())", method.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo`1.M2``2(``0,``1[]@)", method.Name); Assert.Equal("Public MustOverride Sub M2(Of T1 As Class, T2 As Foo(Of T1))(x As T1, ByRef y As T2())", method.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "MustOverride" }, method.Modifiers[SyntaxLanguage.VB]); } { var method = output.Items[0].Items[0].Items[2]; Assert.NotNull(method); Assert.Equal("M3()", method.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo(Of T).M3()", method.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo`1.M3", method.Name); Assert.Equal("Public Sub M3", method.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public" }, method.Modifiers[SyntaxLanguage.VB]); } { var method = output.Items[0].Items[0].Items[3]; Assert.NotNull(method); Assert.Equal("M4(Of T1)(T)", method.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo(Of T).M4(Of T1)(T)", method.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo`1.M4``1(`0)", method.Name); Assert.Equal("Protected Shared Function M4(Of T1 As Class)(x As T) As T1", method.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Protected", "Shared" }, method.Modifiers[SyntaxLanguage.VB]); } // Bar { var method = output.Items[0].Items[1].Items[0]; Assert.NotNull(method); Assert.Equal("M1(Int32, Int32())", method.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Bar.M1(System.Int32, System.Int32())", method.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Bar.M1(System.Int32,System.Int32[])", method.Name); Assert.Equal("Public Overrides Sub M1(x As Integer, y As Integer())", method.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "Overrides" }, method.Modifiers[SyntaxLanguage.VB]); } { var method = output.Items[0].Items[1].Items[1]; Assert.NotNull(method); Assert.Equal("M2(Of T1, T2)(T1, ByRef T2())", method.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Bar.M2(Of T1, T2)(T1, ByRef T2())", method.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Bar.M2``2(``0,``1[]@)", method.Name); Assert.Equal("Public NotOverridable Overrides Sub M2(Of T1 As Class, T2 As Foo(Of T1))(x As T1, ByRef y As T2())", method.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "Overrides", "NotOverridable" }, method.Modifiers[SyntaxLanguage.VB]); } { var method = output.Items[0].Items[1].Items[2]; Assert.NotNull(method); Assert.Equal("M3()", method.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Bar.M3()", method.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Bar.M3", method.Name); Assert.Equal("Public Sub M3", method.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public" }, method.Modifiers[SyntaxLanguage.VB]); } // IFooBar { var method = output.Items[0].Items[2].Items[0]; Assert.NotNull(method); Assert.Equal("M1(Int32, Int32())", method.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.IFooBar.M1(System.Int32, System.Int32())", method.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.IFooBar.M1(System.Int32,System.Int32[])", method.Name); Assert.Equal("Sub M1(x As Integer, ParamArray y As Integer())", method.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new string[0], method.Modifiers[SyntaxLanguage.VB]); } { var method = output.Items[0].Items[2].Items[1]; Assert.NotNull(method); Assert.Equal("M2(Of T1, T2)(T1, ByRef T2())", method.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.IFooBar.M2(Of T1, T2)(T1, ByRef T2())", method.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.IFooBar.M2``2(``0,``1[]@)", method.Name); Assert.Equal("Sub M2(Of T1 As Class, T2 As Foo(Of T1))(x As T1, ByRef y As T2())", method.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new string[0], method.Modifiers[SyntaxLanguage.VB]); } { var method = output.Items[0].Items[2].Items[2]; Assert.NotNull(method); Assert.Equal("M3()", method.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.IFooBar.M3()", method.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.IFooBar.M3", method.Name); Assert.Equal("Sub M3", method.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new string[0], method.Modifiers[SyntaxLanguage.VB]); } // inheritance of Foo<T> { var inheritedMembers = output.Items[0].Items[0].InheritedMembers; Assert.NotNull(inheritedMembers); Assert.Equal( new string[] { "System.Object.ToString", "System.Object.Equals(System.Object)", "System.Object.Equals(System.Object,System.Object)", "System.Object.ReferenceEquals(System.Object,System.Object)", "System.Object.GetHashCode", "System.Object.GetType", "System.Object.Finalize", "System.Object.MemberwiseClone", }.OrderBy(s => s), inheritedMembers.OrderBy(s => s)); } // inheritance of Bar { var inheritedMembers = output.Items[0].Items[1].InheritedMembers; Assert.NotNull(inheritedMembers); Assert.Equal( new string[] { "Test1.Foo{System.String}.M4``1(System.String)", "System.Object.ToString", "System.Object.Equals(System.Object)", "System.Object.Equals(System.Object,System.Object)", "System.Object.ReferenceEquals(System.Object,System.Object)", "System.Object.GetHashCode", "System.Object.GetType", "System.Object.Finalize", "System.Object.MemberwiseClone", }.OrderBy(s => s), inheritedMembers.OrderBy(s => s)); } } [Fact] public void TestGenereateMetadataWithOperator() { string code = @" Namespace Test1 Public Class Foo Public Shared Operator +(x As Foo) As Foo Return x End Operator Public Shared Operator -(x As Foo) As Foo Return x End Operator Public Shared Operator Not(x As Foo) As Foo Return x End Operator Public Shared Operator IsTrue(x As Foo) As Boolean Return True End Operator Public Shared Operator IsFalse(x As Foo) As Boolean Return False End Operator Public Shared Operator +(x As Foo, y As Foo) As Foo Return x End Operator Public Shared Operator -(x As Foo, y As Foo) As Foo Return x End Operator Public Shared Operator *(x As Foo, y As Foo) As Foo Return x End Operator Public Shared Operator /(x As Foo, y As Foo) As Foo Return x End Operator Public Shared Operator Mod(x As Foo, y As Foo) As Foo Return x End Operator Public Shared Operator And(x As Foo, y As Foo) As Foo Return x End Operator Public Shared Operator Or(x As Foo, y As Foo) As Foo Return x End Operator Public Shared Operator Xor(x As Foo, y As Foo) As Foo Return x End Operator Public Shared Operator >>(x As Foo, y As Integer) As Foo Return x End Operator Public Shared Operator <<(x As Foo, y As Integer) As Foo Return x End Operator Public Shared Operator =(x As Foo, y As Integer) As Boolean Return True End Operator Public Shared Operator <>(x As Foo, y As Integer) As Boolean Return True End Operator Public Shared Operator >(x As Foo, y As Integer) As Boolean Return True End Operator Public Shared Operator <(x As Foo, y As Integer) As Boolean Return True End Operator Public Shared Operator >=(x As Foo, y As Integer) As Boolean Return True End Operator Public Shared Operator <=(x As Foo, y As Integer) As Boolean Return True End Operator Public Shared Widening Operator CType(x As Integer) As Foo Return Nothing End Operator Public Shared Narrowing Operator CType(x As Foo) As Integer Return 1 End Operator End Class End Namespace "; MetadataItem output = GenerateYamlMetadata(CreateCompilationFromVBCode(code)); Assert.Equal(1, output.Items.Count); // unary { var method = output.Items[0].Items[0].Items[0]; Assert.NotNull(method); Assert.Equal("UnaryPlus(Foo)", method.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo.UnaryPlus(Test1.Foo)", method.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo.op_UnaryPlus(Test1.Foo)", method.Name); Assert.Equal(@"Public Shared Operator +(x As Foo) As Foo", method.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "Shared" }, method.Modifiers[SyntaxLanguage.VB]); } { var method = output.Items[0].Items[0].Items[1]; Assert.NotNull(method); Assert.Equal("UnaryNegation(Foo)", method.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo.UnaryNegation(Test1.Foo)", method.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo.op_UnaryNegation(Test1.Foo)", method.Name); Assert.Equal(@"Public Shared Operator -(x As Foo) As Foo", method.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "Shared" }, method.Modifiers[SyntaxLanguage.VB]); } { var method = output.Items[0].Items[0].Items[2]; Assert.NotNull(method); Assert.Equal("OnesComplement(Foo)", method.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo.OnesComplement(Test1.Foo)", method.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo.op_OnesComplement(Test1.Foo)", method.Name); Assert.Equal(@"Public Shared Operator Not(x As Foo) As Foo", method.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "Shared" }, method.Modifiers[SyntaxLanguage.VB]); } { var method = output.Items[0].Items[0].Items[3]; Assert.NotNull(method); Assert.Equal("True(Foo)", method.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo.True(Test1.Foo)", method.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo.op_True(Test1.Foo)", method.Name); Assert.Equal(@"Public Shared Operator IsTrue(x As Foo) As Boolean", method.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "Shared" }, method.Modifiers[SyntaxLanguage.VB]); } { var method = output.Items[0].Items[0].Items[4]; Assert.NotNull(method); Assert.Equal("False(Foo)", method.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo.False(Test1.Foo)", method.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo.op_False(Test1.Foo)", method.Name); Assert.Equal(@"Public Shared Operator IsFalse(x As Foo) As Boolean", method.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "Shared" }, method.Modifiers[SyntaxLanguage.VB]); } // binary { var method = output.Items[0].Items[0].Items[5]; Assert.NotNull(method); Assert.Equal("Addition(Foo, Foo)", method.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo.Addition(Test1.Foo, Test1.Foo)", method.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo.op_Addition(Test1.Foo,Test1.Foo)", method.Name); Assert.Equal(@"Public Shared Operator +(x As Foo, y As Foo) As Foo", method.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "Shared" }, method.Modifiers[SyntaxLanguage.VB]); } { var method = output.Items[0].Items[0].Items[6]; Assert.NotNull(method); Assert.Equal("Subtraction(Foo, Foo)", method.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo.Subtraction(Test1.Foo, Test1.Foo)", method.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo.op_Subtraction(Test1.Foo,Test1.Foo)", method.Name); Assert.Equal(@"Public Shared Operator -(x As Foo, y As Foo) As Foo", method.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "Shared" }, method.Modifiers[SyntaxLanguage.VB]); } { var method = output.Items[0].Items[0].Items[7]; Assert.NotNull(method); Assert.Equal("Multiply(Foo, Foo)", method.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo.Multiply(Test1.Foo, Test1.Foo)", method.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo.op_Multiply(Test1.Foo,Test1.Foo)", method.Name); Assert.Equal(@"Public Shared Operator *(x As Foo, y As Foo) As Foo", method.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "Shared" }, method.Modifiers[SyntaxLanguage.VB]); } { var method = output.Items[0].Items[0].Items[8]; Assert.NotNull(method); Assert.Equal("Division(Foo, Foo)", method.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo.Division(Test1.Foo, Test1.Foo)", method.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo.op_Division(Test1.Foo,Test1.Foo)", method.Name); Assert.Equal(@"Public Shared Operator /(x As Foo, y As Foo) As Foo", method.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "Shared" }, method.Modifiers[SyntaxLanguage.VB]); } { var method = output.Items[0].Items[0].Items[9]; Assert.NotNull(method); Assert.Equal("Modulus(Foo, Foo)", method.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo.Modulus(Test1.Foo, Test1.Foo)", method.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo.op_Modulus(Test1.Foo,Test1.Foo)", method.Name); Assert.Equal(@"Public Shared Operator Mod(x As Foo, y As Foo) As Foo", method.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "Shared" }, method.Modifiers[SyntaxLanguage.VB]); } { var method = output.Items[0].Items[0].Items[10]; Assert.NotNull(method); Assert.Equal("BitwiseAnd(Foo, Foo)", method.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo.BitwiseAnd(Test1.Foo, Test1.Foo)", method.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo.op_BitwiseAnd(Test1.Foo,Test1.Foo)", method.Name); Assert.Equal(@"Public Shared Operator And(x As Foo, y As Foo) As Foo", method.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "Shared" }, method.Modifiers[SyntaxLanguage.VB]); } { var method = output.Items[0].Items[0].Items[11]; Assert.NotNull(method); Assert.Equal("BitwiseOr(Foo, Foo)", method.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo.BitwiseOr(Test1.Foo, Test1.Foo)", method.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo.op_BitwiseOr(Test1.Foo,Test1.Foo)", method.Name); Assert.Equal(@"Public Shared Operator Or(x As Foo, y As Foo) As Foo", method.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "Shared" }, method.Modifiers[SyntaxLanguage.VB]); } { var method = output.Items[0].Items[0].Items[12]; Assert.NotNull(method); Assert.Equal("ExclusiveOr(Foo, Foo)", method.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo.ExclusiveOr(Test1.Foo, Test1.Foo)", method.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo.op_ExclusiveOr(Test1.Foo,Test1.Foo)", method.Name); Assert.Equal(@"Public Shared Operator Xor(x As Foo, y As Foo) As Foo", method.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "Shared" }, method.Modifiers[SyntaxLanguage.VB]); } { var method = output.Items[0].Items[0].Items[13]; Assert.NotNull(method); Assert.Equal("RightShift(Foo, Int32)", method.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo.RightShift(Test1.Foo, System.Int32)", method.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo.op_RightShift(Test1.Foo,System.Int32)", method.Name); Assert.Equal(@"Public Shared Operator >>(x As Foo, y As Integer) As Foo", method.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "Shared" }, method.Modifiers[SyntaxLanguage.VB]); } { var method = output.Items[0].Items[0].Items[14]; Assert.NotNull(method); Assert.Equal("LeftShift(Foo, Int32)", method.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo.LeftShift(Test1.Foo, System.Int32)", method.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo.op_LeftShift(Test1.Foo,System.Int32)", method.Name); Assert.Equal(@"Public Shared Operator <<(x As Foo, y As Integer) As Foo", method.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "Shared" }, method.Modifiers[SyntaxLanguage.VB]); } // comparison { var method = output.Items[0].Items[0].Items[15]; Assert.NotNull(method); Assert.Equal("Equality(Foo, Int32)", method.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo.Equality(Test1.Foo, System.Int32)", method.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo.op_Equality(Test1.Foo,System.Int32)", method.Name); Assert.Equal(@"Public Shared Operator =(x As Foo, y As Integer) As Boolean", method.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "Shared" }, method.Modifiers[SyntaxLanguage.VB]); } { var method = output.Items[0].Items[0].Items[16]; Assert.NotNull(method); Assert.Equal("Inequality(Foo, Int32)", method.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo.Inequality(Test1.Foo, System.Int32)", method.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo.op_Inequality(Test1.Foo,System.Int32)", method.Name); Assert.Equal(@"Public Shared Operator <>(x As Foo, y As Integer) As Boolean", method.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "Shared" }, method.Modifiers[SyntaxLanguage.VB]); } { var method = output.Items[0].Items[0].Items[17]; Assert.NotNull(method); Assert.Equal("GreaterThan(Foo, Int32)", method.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo.GreaterThan(Test1.Foo, System.Int32)", method.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo.op_GreaterThan(Test1.Foo,System.Int32)", method.Name); Assert.Equal(@"Public Shared Operator>(x As Foo, y As Integer) As Boolean", method.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "Shared" }, method.Modifiers[SyntaxLanguage.VB]); } { var method = output.Items[0].Items[0].Items[18]; Assert.NotNull(method); Assert.Equal("LessThan(Foo, Int32)", method.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo.LessThan(Test1.Foo, System.Int32)", method.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo.op_LessThan(Test1.Foo,System.Int32)", method.Name); Assert.Equal(@"Public Shared Operator <(x As Foo, y As Integer) As Boolean", method.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "Shared" }, method.Modifiers[SyntaxLanguage.VB]); } { var method = output.Items[0].Items[0].Items[19]; Assert.NotNull(method); Assert.Equal("GreaterThanOrEqual(Foo, Int32)", method.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo.GreaterThanOrEqual(Test1.Foo, System.Int32)", method.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo.op_GreaterThanOrEqual(Test1.Foo,System.Int32)", method.Name); Assert.Equal(@"Public Shared Operator >=(x As Foo, y As Integer) As Boolean", method.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "Shared" }, method.Modifiers[SyntaxLanguage.VB]); } { var method = output.Items[0].Items[0].Items[20]; Assert.NotNull(method); Assert.Equal("LessThanOrEqual(Foo, Int32)", method.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo.LessThanOrEqual(Test1.Foo, System.Int32)", method.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo.op_LessThanOrEqual(Test1.Foo,System.Int32)", method.Name); Assert.Equal(@"Public Shared Operator <=(x As Foo, y As Integer) As Boolean", method.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "Shared" }, method.Modifiers[SyntaxLanguage.VB]); } // conversion { var method = output.Items[0].Items[0].Items[21]; Assert.NotNull(method); Assert.Equal("Widening(Int32 to Foo)", method.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo.Widening(System.Int32 to Test1.Foo)", method.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo.op_Implicit(System.Int32)~Test1.Foo", method.Name); Assert.Equal(@"Public Shared Widening Operator CType(x As Integer) As Foo", method.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "Shared" }, method.Modifiers[SyntaxLanguage.VB]); } { var method = output.Items[0].Items[0].Items[22]; Assert.NotNull(method); Assert.Equal("Narrowing(Foo to Int32)", method.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo.Narrowing(Test1.Foo to System.Int32)", method.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo.op_Explicit(Test1.Foo)~System.Int32", method.Name); Assert.Equal(@"Public Shared Narrowing Operator CType(x As Foo) As Integer", method.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "Shared" }, method.Modifiers[SyntaxLanguage.VB]); } } [Trait("Related", "Generic")] [Fact] public void TestGenereateMetadataWithConstructor() { string code = @" Namespace Test1 Public MustInherit Class Foo(Of T) Protected Sub New(x As T()) End Sub End Class Public Class Bar Inherits Foo(Of String) Protected Friend Sub New() MyBase.New(New String() {}) End Sub Public Sub New(x As String()) End Sub End Class End Namespace "; MetadataItem output = GenerateYamlMetadata(CreateCompilationFromVBCode(code)); Assert.Equal(1, output.Items.Count); // Foo<T> { var method = output.Items[0].Items[0].Items[0]; Assert.NotNull(method); Assert.Equal("Foo(T())", method.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo(Of T).Foo(T())", method.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo`1.#ctor(`0[])", method.Name); Assert.Equal("Protected Sub New(x As T())", method.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Protected" }, method.Modifiers[SyntaxLanguage.VB]); } // Bar { var method = output.Items[0].Items[1].Items[0]; Assert.NotNull(method); Assert.Equal("Bar()", method.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Bar.Bar()", method.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Bar.#ctor", method.Name); Assert.Equal("Protected Sub New", method.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Protected" }, method.Modifiers[SyntaxLanguage.VB]); } { var method = output.Items[0].Items[1].Items[1]; Assert.NotNull(method); Assert.Equal("Bar(String())", method.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Bar.Bar(System.String())", method.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Bar.#ctor(System.String[])", method.Name); Assert.Equal("Public Sub New(x As String())", method.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public" }, method.Modifiers[SyntaxLanguage.VB]); } } [Trait("Related", "Generic")] [Fact] public void TestGenereateMetadataWithField() { string code = @" Namespace Test1 Public Class Foo(Of T) Public X As Integer Protected Shared ReadOnly Y As Foo(Of T) = Nothing Protected Friend Const Z As String = """" End Class Public Enum Bar Black, Red, Blue = 2, Green = 4, White = Red Or Blue Or Green, End Enum End Namespace "; MetadataItem output = GenerateYamlMetadata(CreateCompilationFromVBCode(code)); Assert.Equal(1, output.Items.Count); { var field = output.Items[0].Items[0].Items[0]; Assert.NotNull(field); Assert.Equal("X", field.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo(Of T).X", field.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo`1.X", field.Name); Assert.Equal("Public X As Integer", field.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public" }, field.Modifiers[SyntaxLanguage.VB]); } { var field = output.Items[0].Items[0].Items[1]; Assert.NotNull(field); Assert.Equal("Y", field.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo(Of T).Y", field.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo`1.Y", field.Name); Assert.Equal("Protected Shared ReadOnly Y As Foo(Of T)", field.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Protected", "Shared", "ReadOnly" }, field.Modifiers[SyntaxLanguage.VB]); } { var field = output.Items[0].Items[0].Items[2]; Assert.NotNull(field); Assert.Equal("Z", field.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo(Of T).Z", field.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo`1.Z", field.Name); Assert.Equal(@"Protected Const Z As String = """"", field.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Protected", "Const" }, field.Modifiers[SyntaxLanguage.VB]); } { var field = output.Items[0].Items[1].Items[0]; Assert.NotNull(field); Assert.Equal("Black", field.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Bar.Black", field.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Bar.Black", field.Name); Assert.Equal("Black = 0", field.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "Const" }, field.Modifiers[SyntaxLanguage.VB]); } { var field = output.Items[0].Items[1].Items[1]; Assert.NotNull(field); Assert.Equal("Red", field.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Bar.Red", field.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Bar.Red", field.Name); Assert.Equal("Red = 1", field.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "Const" }, field.Modifiers[SyntaxLanguage.VB]); } { var field = output.Items[0].Items[1].Items[2]; Assert.NotNull(field); Assert.Equal("Blue", field.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Bar.Blue", field.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Bar.Blue", field.Name); Assert.Equal(@"Blue = 2", field.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "Const" }, field.Modifiers[SyntaxLanguage.VB]); } { var field = output.Items[0].Items[1].Items[3]; Assert.NotNull(field); Assert.Equal("Green", field.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Bar.Green", field.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Bar.Green", field.Name); Assert.Equal("Green = 4", field.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "Const" }, field.Modifiers[SyntaxLanguage.VB]); } { var field = output.Items[0].Items[1].Items[4]; Assert.NotNull(field); Assert.Equal("White", field.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Bar.White", field.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Bar.White", field.Name); Assert.Equal(@"White = 7", field.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "Const" }, field.Modifiers[SyntaxLanguage.VB]); } } [Trait("Related", "Generic")] [Fact] public void TestGenereateMetadataWithEvent() { string code = @" Imports System Namespace Test1 Public MustInherit Class Foo(Of T As EventArgs) Implements IFooBar(Of T) Public Event A As EventHandler Protected Shared Custom Event B As EventHandler AddHandler(value As EventHandler) End AddHandler RemoveHandler(value As EventHandler) End RemoveHandler RaiseEvent(sender As Object, e As EventArgs) End RaiseEvent End Event Private Event C As EventHandler(Of T) Implements IFooBar(Of T).Bar End Class Public Interface IFooBar(Of TEventArgs As EventArgs) Event Bar As EventHandler(Of TEventArgs) End Interface End Namespace "; MetadataItem output = GenerateYamlMetadata(CreateCompilationFromVBCode(code)); Assert.Equal(1, output.Items.Count); { var a = output.Items[0].Items[0].Items[0]; Assert.NotNull(a); Assert.Equal("A", a.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo(Of T).A", a.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo`1.A", a.Name); Assert.Equal("Public Event A As EventHandler", a.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public" }, a.Modifiers[SyntaxLanguage.VB]); } { var b = output.Items[0].Items[0].Items[1]; Assert.NotNull(b); Assert.Equal("B", b.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo(Of T).B", b.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo`1.B", b.Name); Assert.Equal("Protected Shared Event B As EventHandler", b.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Protected", "Shared" }, b.Modifiers[SyntaxLanguage.VB]); } { var c = output.Items[0].Items[0].Items[2]; Assert.NotNull(c); Assert.Equal("C", c.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo(Of T).C", c.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo`1.C", c.Name); Assert.Equal("Event C As EventHandler(Of T) Implements IFooBar(Of T).Bar", c.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new string[0], c.Modifiers[SyntaxLanguage.VB]); } { var a = output.Items[0].Items[1].Items[0]; Assert.NotNull(a); Assert.Equal("Bar", a.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.IFooBar(Of TEventArgs).Bar", a.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.IFooBar`1.Bar", a.Name); Assert.Equal("Event Bar As EventHandler(Of TEventArgs)", a.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new string[0], a.Modifiers[SyntaxLanguage.VB]); } } [Trait("Related", "Generic")] [Fact] public void TestGenereateMetadataWithProperty() { string code = @" Namespace Test1 Public MustInherit Class Foo(Of T As Class) Public Property A As Integer Public Overridable ReadOnly Property B As Integer Get Return 1 End Get End Property Public MustOverride WriteOnly Property C As Integer Protected Property D As Integer Get Return 1 End Get Private Set(value As Integer) End Set End Property Public Property E As T Get Return Nothing End Get Protected Set(value As T) End Set End Property Protected Friend Shared Property F As Integer Get Return 1 End Get Protected Set(value As Integer) End Set End Property End Class Public Class Bar Inherits Foo(Of String) Public Overridable Shadows Property A As Integer Public Overrides ReadOnly Property B As Integer Get Return 2 End Get End Property Public Overrides WriteOnly Property C As Integer Set(value As Integer) End Set End Property End Class Public Interface IFooBar Property A As Integer ReadOnly Property B As Integer WriteOnly Property C As Integer End Interface End Namespace "; MetadataItem output = GenerateYamlMetadata(CreateCompilationFromVBCode(code)); Assert.Equal(1, output.Items.Count); // Foo { var a = output.Items[0].Items[0].Items[0]; Assert.NotNull(a); Assert.Equal("A", a.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo(Of T).A", a.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo`1.A", a.Name); Assert.Equal("Public Property A As Integer", a.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public" }, a.Modifiers[SyntaxLanguage.VB]); } { var b = output.Items[0].Items[0].Items[1]; Assert.NotNull(b); Assert.Equal("B", b.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo(Of T).B", b.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo`1.B", b.Name); Assert.Equal("Public Overridable ReadOnly Property B As Integer", b.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "Overridable", "ReadOnly" }, b.Modifiers[SyntaxLanguage.VB]); } { var c = output.Items[0].Items[0].Items[2]; Assert.NotNull(c); Assert.Equal("C", c.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo(Of T).C", c.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo`1.C", c.Name); Assert.Equal("Public MustOverride WriteOnly Property C As Integer", c.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "MustOverride", "WriteOnly" }, c.Modifiers[SyntaxLanguage.VB]); } { var d = output.Items[0].Items[0].Items[3]; Assert.NotNull(d); Assert.Equal("D", d.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo(Of T).D", d.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo`1.D", d.Name); Assert.Equal(@"Protected ReadOnly Property D As Integer", d.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Protected", "ReadOnly" }, d.Modifiers[SyntaxLanguage.VB]); } { var e = output.Items[0].Items[0].Items[4]; Assert.NotNull(e); Assert.Equal("E", e.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo(Of T).E", e.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo`1.E", e.Name); Assert.Equal(@"Public Property E As T", e.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "Get", "Protected Set" }, e.Modifiers[SyntaxLanguage.VB]); } { var f = output.Items[0].Items[0].Items[5]; Assert.NotNull(f); Assert.Equal("F", f.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo(Of T).F", f.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo`1.F", f.Name); Assert.Equal(@"Protected Shared Property F As Integer", f.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Protected", "Shared" }, f.Modifiers[SyntaxLanguage.VB]); } // Bar { var a = output.Items[0].Items[1].Items[0]; Assert.NotNull(a); Assert.Equal("A", a.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Bar.A", a.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Bar.A", a.Name); Assert.Equal("Public Overridable Property A As Integer", a.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "Overridable" }, a.Modifiers[SyntaxLanguage.VB]); } { var b = output.Items[0].Items[1].Items[1]; Assert.NotNull(b); Assert.Equal("B", b.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Bar.B", b.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Bar.B", b.Name); Assert.Equal("Public Overrides ReadOnly Property B As Integer", b.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "Overrides", "ReadOnly" }, b.Modifiers[SyntaxLanguage.VB]); } { var c = output.Items[0].Items[1].Items[2]; Assert.NotNull(c); Assert.Equal("C", c.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Bar.C", c.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Bar.C", c.Name); Assert.Equal("Public Overrides WriteOnly Property C As Integer", c.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "Overrides", "WriteOnly" }, c.Modifiers[SyntaxLanguage.VB]); } // IFooBar { var a = output.Items[0].Items[2].Items[0]; Assert.NotNull(a); Assert.Equal("A", a.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.IFooBar.A", a.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.IFooBar.A", a.Name); Assert.Equal("Property A As Integer", a.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new string[0], a.Modifiers[SyntaxLanguage.VB]); } { var b = output.Items[0].Items[2].Items[1]; Assert.NotNull(b); Assert.Equal("B", b.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.IFooBar.B", b.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.IFooBar.B", b.Name); Assert.Equal("ReadOnly Property B As Integer", b.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "ReadOnly" }, b.Modifiers[SyntaxLanguage.VB]); } { var c = output.Items[0].Items[2].Items[2]; Assert.NotNull(c); Assert.Equal("C", c.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.IFooBar.C", c.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.IFooBar.C", c.Name); Assert.Equal("WriteOnly Property C As Integer", c.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "WriteOnly" }, c.Modifiers[SyntaxLanguage.VB]); } } [Trait("Related", "Generic")] [Fact] public void TestGenereateMetadataWithIndex() { string code = @" Imports System Namespace Test1 Public MustInherit Class Foo(Of T As Class) Public Property A(x As Integer) As Integer Get Return 0 End Get Set(value As Integer) End Set End Property Public Overridable ReadOnly Property B(x As String) As Integer Get Return 1 End Get End Property Public MustOverride WriteOnly Property C(x As Object) As Integer Protected Property D(x As Date) As Integer Get Return 1 End Get Private Set(value As Integer) End Set End Property Public Property E(t As T) As Integer Get Return 0 End Get Protected Set(value As Integer) End Set End Property Protected Friend Shared Property F(x As Integer, t As T) As Integer Get Return 1 End Get Protected Set(value As Integer) End Set End Property End Class Public Class Bar Inherits Foo(Of String) Public Overridable Shadows Property A(x As Integer) As Integer Get Return 1 End Get Set(value As Integer) End Set End Property Public Overrides ReadOnly Property B(x As String) As Integer Get Return 2 End Get End Property Public Overrides WriteOnly Property C(x As Object) As Integer Set(value As Integer) End Set End Property End Class Public Interface IFooBar Property A(x As Integer) As Integer ReadOnly Property B(x As String) As Integer WriteOnly Property C(x As Object) As Integer End Interface End Namespace "; MetadataItem output = GenerateYamlMetadata(CreateCompilationFromVBCode(code)); Assert.Equal(1, output.Items.Count); // Foo { var a = output.Items[0].Items[0].Items[0]; Assert.NotNull(a); Assert.Equal("A(Int32)", a.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo(Of T).A(System.Int32)", a.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo`1.A(System.Int32)", a.Name); Assert.Equal("Public Property A(x As Integer) As Integer", a.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public" }, a.Modifiers[SyntaxLanguage.VB]); } { var b = output.Items[0].Items[0].Items[1]; Assert.NotNull(b); Assert.Equal("B(String)", b.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo(Of T).B(System.String)", b.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo`1.B(System.String)", b.Name); Assert.Equal("Public Overridable ReadOnly Property B(x As String) As Integer", b.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "Overridable", "ReadOnly" }, b.Modifiers[SyntaxLanguage.VB]); } { var c = output.Items[0].Items[0].Items[2]; Assert.NotNull(c); Assert.Equal("C(Object)", c.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo(Of T).C(System.Object)", c.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo`1.C(System.Object)", c.Name); Assert.Equal("Public MustOverride WriteOnly Property C(x As Object) As Integer", c.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "MustOverride", "WriteOnly" }, c.Modifiers[SyntaxLanguage.VB]); } { var d = output.Items[0].Items[0].Items[3]; Assert.NotNull(d); Assert.Equal("D(DateTime)", d.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo(Of T).D(System.DateTime)", d.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo`1.D(System.DateTime)", d.Name); Assert.Equal(@"Protected ReadOnly Property D(x As Date) As Integer", d.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Protected", "ReadOnly" }, d.Modifiers[SyntaxLanguage.VB]); } { var e = output.Items[0].Items[0].Items[4]; Assert.NotNull(e); Assert.Equal("E(T)", e.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo(Of T).E(T)", e.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo`1.E(`0)", e.Name); Assert.Equal(@"Public Property E(t As T) As Integer", e.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "Get", "Protected Set" }, e.Modifiers[SyntaxLanguage.VB]); } { var f = output.Items[0].Items[0].Items[5]; Assert.NotNull(f); Assert.Equal("F(Int32, T)", f.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo(Of T).F(System.Int32, T)", f.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo`1.F(System.Int32,`0)", f.Name); Assert.Equal(@"Protected Shared Property F(x As Integer, t As T) As Integer", f.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Protected", "Shared" }, f.Modifiers[SyntaxLanguage.VB]); } // Bar { var a = output.Items[0].Items[1].Items[0]; Assert.NotNull(a); Assert.Equal("A(Int32)", a.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Bar.A(System.Int32)", a.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Bar.A(System.Int32)", a.Name); Assert.Equal("Public Overridable Property A(x As Integer) As Integer", a.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "Overridable" }, a.Modifiers[SyntaxLanguage.VB]); } { var b = output.Items[0].Items[1].Items[1]; Assert.NotNull(b); Assert.Equal("B(String)", b.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Bar.B(System.String)", b.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Bar.B(System.String)", b.Name); Assert.Equal("Public Overrides ReadOnly Property B(x As String) As Integer", b.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "Overrides", "ReadOnly" }, b.Modifiers[SyntaxLanguage.VB]); } { var c = output.Items[0].Items[1].Items[2]; Assert.NotNull(c); Assert.Equal("C(Object)", c.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Bar.C(System.Object)", c.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Bar.C(System.Object)", c.Name); Assert.Equal("Public Overrides WriteOnly Property C(x As Object) As Integer", c.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "Public", "Overrides", "WriteOnly" }, c.Modifiers[SyntaxLanguage.VB]); } // IFooBar { var a = output.Items[0].Items[2].Items[0]; Assert.NotNull(a); Assert.Equal("A(Int32)", a.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.IFooBar.A(System.Int32)", a.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.IFooBar.A(System.Int32)", a.Name); Assert.Equal("Property A(x As Integer) As Integer", a.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new string[0], a.Modifiers[SyntaxLanguage.VB]); } { var b = output.Items[0].Items[2].Items[1]; Assert.NotNull(b); Assert.Equal("B(String)", b.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.IFooBar.B(System.String)", b.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.IFooBar.B(System.String)", b.Name); Assert.Equal("ReadOnly Property B(x As String) As Integer", b.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "ReadOnly" }, b.Modifiers[SyntaxLanguage.VB]); } { var c = output.Items[0].Items[2].Items[2]; Assert.NotNull(c); Assert.Equal("C(Object)", c.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.IFooBar.C(System.Object)", c.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.IFooBar.C(System.Object)", c.Name); Assert.Equal("WriteOnly Property C(x As Object) As Integer", c.Syntax.Content[SyntaxLanguage.VB]); Assert.Equal(new[] { "WriteOnly" }, c.Modifiers[SyntaxLanguage.VB]); } } [Trait("Related", "Generic")] [Trait("Related", "Multilanguage")] [Fact] public void TestGenereateMetadataAsyncWithMultilanguage() { string code = @" Namespace Test1 Public Class Foo(Of T) Public Sub Bar(Of K)(i as Integer) End Sub End Class End Namespace "; MetadataItem output = GenerateYamlMetadata(CreateCompilationFromVBCode(code)); var type = output.Items[0].Items[0]; Assert.NotNull(type); Assert.Equal("Foo<T>", type.DisplayNames[SyntaxLanguage.CSharp]); Assert.Equal("Foo(Of T)", type.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo<T>", type.DisplayQualifiedNames[SyntaxLanguage.CSharp]); Assert.Equal("Test1.Foo(Of T)", type.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo`1", type.Name); var method = output.Items[0].Items[0].Items[0]; Assert.NotNull(method); Assert.Equal("Bar<K>(Int32)", method.DisplayNames[SyntaxLanguage.CSharp]); Assert.Equal("Bar(Of K)(Int32)", method.DisplayNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo<T>.Bar<K>(System.Int32)", method.DisplayQualifiedNames[SyntaxLanguage.CSharp]); Assert.Equal("Test1.Foo(Of T).Bar(Of K)(System.Int32)", method.DisplayQualifiedNames[SyntaxLanguage.VB]); Assert.Equal("Test1.Foo`1.Bar``1(System.Int32)", method.Name); Assert.Equal(1, output.Items.Count); var parameter = method.Syntax.Parameters[0]; Assert.Equal("i", parameter.Name); Assert.Equal("System.Int32", parameter.Type); var returnValue = method.Syntax.Return; Assert.Null(returnValue); } [Trait("Related", "Attribute")] [Fact] public void TestGenereateMetadataWithAttribute() { string code = @" Imports System Imports System.ComponentModel Namespace Test1 <Serializable> <AttributeUsage(AttributeTargets.All, Inherited := true, AllowMultiple := true)> <TypeConverter(GetType(TestAttribute))> <Test(""test"")> <Test(New Integer(){1,2,3})> <Test(New Object(){Nothing, ""abc"", ""d""c, 1.1f, 1.2, CType(2, SByte), CType(3, Byte), 4s, 5us, 6, 8L, 9UL, New Integer(){ 10, 11, 12 }})> Public Class TestAttribute Inherits Attribute <Test(1)> <Test(2)> Public Sub New(o As Object) End Sub End Class End Namespace "; MetadataItem output = GenerateYamlMetadata(CreateCompilationFromVBCode(code, MetadataReference.CreateFromFile(typeof(System.ComponentModel.TypeConverterAttribute).Assembly.Location))); Assert.Equal(1, output.Items.Count); var type = output.Items[0].Items[0]; Assert.NotNull(type); Assert.Equal(@"<Serializable> <AttributeUsage(AttributeTargets.Assembly Or AttributeTargets.Module Or AttributeTargets.Class Or AttributeTargets.Struct Or AttributeTargets.Enum Or AttributeTargets.Constructor Or AttributeTargets.Method Or AttributeTargets.Property Or AttributeTargets.Field Or AttributeTargets.Event Or AttributeTargets.Interface Or AttributeTargets.Parameter Or AttributeTargets.Delegate Or AttributeTargets.ReturnValue Or AttributeTargets.GenericParameter Or AttributeTargets.All, Inherited:=True, AllowMultiple:=True)> <TypeConverter(GetType(TestAttribute))> <Test(""test"")> <Test(New Integer() {1, 2, 3})> <Test(New Object() {Nothing, ""abc"", ""d""c, 1.1F, 1.2, CType(2, SByte), CType(3, Byte), CType(4, Short), CType(5, UShort), 6, 8L, 9UL, New Integer() {10, 11, 12}})> Public Class TestAttribute Inherits Attribute Implements _Attribute", type.Syntax.Content[SyntaxLanguage.VB]); var ctor = type.Items[0]; Assert.NotNull(type); Assert.Equal(@"<Test(1)> <Test(2)> Public Sub New(o As Object)", ctor.Syntax.Content[SyntaxLanguage.VB]); } private static Compilation CreateCompilationFromVBCode(string code, params MetadataReference[] references) { return CreateCompilationFromVBCode(code, "test.dll", references); } private static Compilation CreateCompilationFromVBCode(string code, string assemblyName, params MetadataReference[] references) { var tree = SyntaxFactory.ParseSyntaxTree(code); var defaultReferences = new List<MetadataReference> { MetadataReference.CreateFromFile(typeof(object).Assembly.Location) }; if (references != null) { defaultReferences.AddRange(references); } var compilation = VisualBasicCompilation.Create( assemblyName, options: new VisualBasicCompilationOptions(OutputKind.DynamicallyLinkedLibrary), syntaxTrees: new[] { tree }, references: defaultReferences); return compilation; } private static Assembly CreateAssemblyFromVBCode(string code, string assemblyName) { // MemoryStream fails when MetadataReference.CreateFromAssembly with error: Empty path name is not legal var compilation = CreateCompilationFromVBCode(code); EmitResult result; using (FileStream stream = new FileStream(assemblyName, FileMode.Create)) { result = compilation.Emit(stream); } Assert.True(result.Success, string.Join(",", result.Diagnostics.Select(s => s.GetMessage()))); return Assembly.LoadFile(Path.GetFullPath(assemblyName)); } } }
{ "content_hash": "c97925e82809f7f37b816062c7e9eb1a", "timestamp": "", "source": "github", "line_count": 1444, "max_line_length": 508, "avg_line_length": 52.16274238227147, "alnum_prop": 0.5784687280113644, "repo_name": "sergey-vershinin/docfx", "id": "a4b335bfa2ffcd8acede926d539e52f1826a9c95", "size": "75475", "binary": false, "copies": "1", "ref": "refs/heads/dev", "path": "test/Microsoft.DocAsCode.Metadata.ManagedReference.Tests/GenerateMetadataFromVBUnitTest.cs", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "7298" }, { "name": "C#", "bytes": "2209212" }, { "name": "CSS", "bytes": "161946" }, { "name": "Groff", "bytes": "5644" }, { "name": "HTML", "bytes": "26161" }, { "name": "JavaScript", "bytes": "78667" }, { "name": "PowerShell", "bytes": "11617" }, { "name": "XSLT", "bytes": "4009" } ], "symlink_target": "" }
package com.microsoft.azure.management.datamigration.v2018_07_15_preview; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; /** * Defines values for ServerLevelPermissionsGroup. */ public enum ServerLevelPermissionsGroup { /** Enum value Default. */ DEFAULT("Default"), /** Enum value MigrationFromSqlServerToAzureDB. */ MIGRATION_FROM_SQL_SERVER_TO_AZURE_DB("MigrationFromSqlServerToAzureDB"), /** Enum value MigrationFromSqlServerToAzureMI. */ MIGRATION_FROM_SQL_SERVER_TO_AZURE_MI("MigrationFromSqlServerToAzureMI"), /** Enum value MigrationFromMySQLToAzureDBForMySQL. */ MIGRATION_FROM_MY_SQLTO_AZURE_DBFOR_MY_SQL("MigrationFromMySQLToAzureDBForMySQL"); /** The actual serialized value for a ServerLevelPermissionsGroup instance. */ private String value; ServerLevelPermissionsGroup(String value) { this.value = value; } /** * Parses a serialized value to a ServerLevelPermissionsGroup instance. * * @param value the serialized value to parse. * @return the parsed ServerLevelPermissionsGroup object, or null if unable to parse. */ @JsonCreator public static ServerLevelPermissionsGroup fromString(String value) { ServerLevelPermissionsGroup[] items = ServerLevelPermissionsGroup.values(); for (ServerLevelPermissionsGroup item : items) { if (item.toString().equalsIgnoreCase(value)) { return item; } } return null; } @JsonValue @Override public String toString() { return this.value; } }
{ "content_hash": "e190779d6c23824f50acde83de7fd7d9", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 89, "avg_line_length": 31.18867924528302, "alnum_prop": 0.7017543859649122, "repo_name": "selvasingh/azure-sdk-for-java", "id": "a1b0508b4c23fc0061f65005bd9365362fef4906", "size": "1883", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "sdk/datamigration/mgmt-v2018_07_15_preview/src/main/java/com/microsoft/azure/management/datamigration/v2018_07_15_preview/ServerLevelPermissionsGroup.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "29891970" }, { "name": "JavaScript", "bytes": "6198" }, { "name": "PowerShell", "bytes": "160" }, { "name": "Shell", "bytes": "609" } ], "symlink_target": "" }
package org.apache.camel.cdi.se; import org.apache.camel.cdi.CdiCamelExtension; import org.apache.camel.cdi.se.bean.BeanInjectBean; import org.apache.camel.cdi.se.bean.NamedCamelBean; import org.apache.camel.cdi.se.bean.PropertyInjectBean; import org.apache.camel.component.properties.PropertiesComponent; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit.Arquillian; import org.jboss.shrinkwrap.api.Archive; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.spec.JavaArchive; import org.junit.Test; import org.junit.runner.RunWith; import javax.enterprise.context.ApplicationScoped; import javax.enterprise.inject.Produces; import javax.inject.Inject; import javax.inject.Named; import java.util.Properties; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.notNullValue; import static org.junit.Assert.assertThat; @RunWith(Arquillian.class) public class BeanInjectTest { @Deployment public static Archive<?> deployment() { return ShrinkWrap.create(JavaArchive.class) // Camel CDI .addPackage(CdiCamelExtension.class.getPackage()) // Test classes .addClasses(BeanInjectBean.class, PropertyInjectBean.class, NamedCamelBean.class) // Bean archive deployment descriptor .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); } @Produces @ApplicationScoped @Named("properties") private static PropertiesComponent configuration() { Properties properties = new Properties(); properties.put("property", "value"); PropertiesComponent component = new PropertiesComponent(); component.setInitialProperties(properties); return component; } @Inject private BeanInjectBean bean; @Test public void beanInjectField() { assertThat(bean.getInjectBeanField(), is(notNullValue())); assertThat(bean.getInjectBeanField().getProperty(), is(equalTo("value"))); } @Test public void beanInjectMethod() { assertThat(bean.getInjectBeanMethod(), is(notNullValue())); assertThat(bean.getInjectBeanMethod().getProperty(), is(equalTo("value"))); } @Test public void beanInjectNamed() { assertThat(bean.getInjectBeanNamed(), is(notNullValue())); } }
{ "content_hash": "f2d8193f187cc4f83699c63a12c270e8", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 93, "avg_line_length": 34.68493150684932, "alnum_prop": 0.7109004739336493, "repo_name": "astefanutti/camel-cdi", "id": "31d929e01939218966cf18ca48b86b434fc35e0f", "size": "3350", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "envs/se/src/test/java/org/apache/camel/cdi/se/BeanInjectTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "698295" } ], "symlink_target": "" }
from abc import abstractmethod, ABCMeta from .NoElementException import NoElementException class AbstractChainElement: """ Абстрактный класс для элементов цепочки обязанностей """ __metaclass__ = ABCMeta def __init__(self, action_type, next_element=None): self._action_type = action_type self._next_element = next_element def _do_next(self, action_type): next_el = self.next # если цепочка закончилась, вызовем исключение if next_el is None: raise NoElementException() next_el.do(action_type) @abstractmethod def do(self, action_type): """ Выполнить действие для этого элемента """ @abstractmethod def get_info(self): """ Получить информацию об элементе цепочки """ @property def next(self): return self._next_element @next.setter def next(self, other): self._next_element = other
{ "content_hash": "4505bcb14ad75e91b3cb1d79d688fba2", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 64, "avg_line_length": 26.86111111111111, "alnum_prop": 0.6204756980351603, "repo_name": "SergeyStaroletov/Patterns17", "id": "95be9e20441c0f25ed1ca91c30fa468b947b0976", "size": "1121", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "CourseWorkReports/Курсовой проект Киреков ПИ-42/Исходный код/Chain/AbstractChainElement.py", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "686" }, { "name": "C#", "bytes": "191622" }, { "name": "C++", "bytes": "331486" }, { "name": "CSS", "bytes": "37948" }, { "name": "HTML", "bytes": "50254" }, { "name": "Java", "bytes": "286862" }, { "name": "JavaScript", "bytes": "160083" }, { "name": "PHP", "bytes": "76324" }, { "name": "Python", "bytes": "32929" }, { "name": "QMake", "bytes": "5034" }, { "name": "Smalltalk", "bytes": "6020" }, { "name": "Swift", "bytes": "15731" } ], "symlink_target": "" }
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; using SimpleFileBrowser; public class SceneLoader : MonoBehaviour { public void LoadMenuScene() { SceneManager.LoadSceneAsync("menu"); } public void LoadScene(string scene_name) { Debug.Log(scene_name); SceneManager.LoadSceneAsync(scene_name); } public void QuitApplication() { Application.Quit(); } public void SetLogDir() { // Show a select folder dialog // onSuccess event: print the selected folder's path // onCancel event: print "Canceled" // Load file/folder: folder, Initial path: default (Documents), Title: "Select Folder", submit button text: "Select" FileBrowser.ShowLoadDialog((path) => { OnSetLogDir(path); }, () => { Debug.Log("Canceled"); }, true, null, "Select Log Folder", "Select"); } public void OnSetLogDir(string path) { Debug.Log("Selected: " + path); GlobalState.log_path = path; } public string[] LoadScenePathsFromFile(string directoryPath) { List<string> scenePaths = new List<string>(); // search in the directory string[] paths = System.IO.Directory.GetFiles(directoryPath, "*", System.IO.SearchOption.AllDirectories); foreach (string path in paths) { string extension = System.IO.Path.GetExtension(path); if (extension != "") { continue; } // get only bundle Assets (no file extension) AssetBundle bundle = AssetBundle.LoadFromFile(path); if (GlobalState.bundleScenes != null) { scenePaths.AddRange(bundle.GetAllScenePaths()); GlobalState.bundleScenes.Add(bundle); } } return scenePaths.ToArray(); } }
{ "content_hash": "cdf86efcb284dcff005e75f7728877fc", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 124, "avg_line_length": 30.138461538461538, "alnum_prop": 0.5962225625319041, "repo_name": "tawnkramer/sdsandbox", "id": "d185078b4f042246a89c2d2057ec8f96e856c5e4", "size": "1961", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "sdsim/Assets/Scripts/SceneLoader.cs", "mode": "33261", "license": "bsd-3-clause", "language": [ { "name": "C#", "bytes": "1117254" }, { "name": "HLSL", "bytes": "216130" }, { "name": "OpenSCAD", "bytes": "357" }, { "name": "Python", "bytes": "33800" }, { "name": "ShaderLab", "bytes": "182929" } ], "symlink_target": "" }
cd .. bash updateLib.sh cd OnAxisImg/ python onaxis.py
{ "content_hash": "904de90c289a78f617a3288b794e09f9", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 17, "avg_line_length": 13.75, "alnum_prop": 0.7636363636363637, "repo_name": "nextBillyonair/compVision", "id": "e72bfc7fbb68a706d5feb64ad1e31aa314454011", "size": "76", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "IXS/OnAxisImg/update.sh", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "95899" }, { "name": "Python", "bytes": "2305806" }, { "name": "Shell", "bytes": "3118" } ], "symlink_target": "" }
ACCEPTED #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
{ "content_hash": "de9bac847a34ce08f8f7bb6161f5be40", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 10.307692307692308, "alnum_prop": 0.6940298507462687, "repo_name": "mdoering/backbone", "id": "3a81e32bc3f3b0030ac8e500ee85c6a53abe33ee", "size": "185", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Gentianales/Rubiaceae/Gynochthodes/Gynochthodes coriacea/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
import pytest import properties_user_links_batch_create FAKE_PROPERTY_ID = "1" FAKE_EMAIL_ADDRESS = "test@google.com" def test_properties_user_links_batch_create(): transports = ["grpc", "rest"] for transport in transports: # This test ensures that the call is valid and reaches the server, even # though the operation does not succeed due to permission error. with pytest.raises(Exception, match="The caller does not have permission"): properties_user_links_batch_create.batch_create_property_user_link( FAKE_PROPERTY_ID, FAKE_EMAIL_ADDRESS, transport=transport )
{ "content_hash": "0bc98f4149c197ac4307db82ad9203af", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 83, "avg_line_length": 37.705882352941174, "alnum_prop": 0.6926677067082684, "repo_name": "googleapis/python-analytics-admin", "id": "b463cbb1f4868d1b692a97390930106c41e0d948", "size": "1237", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "samples/properties_user_links_batch_create_test.py", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Dockerfile", "bytes": "2050" }, { "name": "Python", "bytes": "5576405" }, { "name": "Shell", "bytes": "30687" } ], "symlink_target": "" }
using System; using ReactiveUI; using System.Runtime.Serialization; using Splat; using Xamarin.Forms; using System.Reactive.Linq; namespace Time2Brew.Core { [DataContract] public class MashTimerViewModel : ReactiveObject, IRoutableViewModel { public MashTimerViewModel (IScreen hostScreen, BrewData data) { HostScreen = hostScreen ?? Locator.Current.GetService<IScreen> (); CurrentTimeRemaining = (int)data.MashTime.TotalSeconds; var canStartOrReset = this.WhenAnyValue (x => x.IsTimerRunning).Where (x => !x); StartTimer = ReactiveCommand.Create (canStartOrReset); var start = StartTimer.Select (x => true); PauseTimer = ReactiveCommand.Create (this.WhenAnyValue (x => x.IsTimerRunning).Where (x => x)); var pause = PauseTimer.Select (x => false); Observable.Merge (start, pause) .StartWith (false) .ToProperty (this, vm => vm.IsTimerRunning, out _IsTimerRunning); ResetTimer = ReactiveCommand.Create (canStartOrReset); ResetTimer.Subscribe (_ => { CurrentTimeRemaining = (int)data.MashTime.TotalSeconds; }); this.WhenAnyValue (x => x.IsTimerRunning) .Where (x => x == true) .Subscribe (_ => Device.StartTimer (TimeSpan.FromSeconds (1), () => { if (CurrentTimeRemaining > 0) CurrentTimeRemaining -= 1; return IsTimerRunning; })); this.WhenAnyValue (x => x.CurrentTimeRemaining) .Select (x => TimeSpan.FromSeconds (x).ToString ()) .ToProperty (this, vm => vm.ClockText, out _ClockText); } [IgnoreDataMember] public string UrlPathSegment { get { return "Mash Timer"; } } [IgnoreDataMember] public IScreen HostScreen { get; protected set; } [IgnoreDataMember] public ReactiveCommand<object> StartTimer { get; private set; } [IgnoreDataMember] public ReactiveCommand<object> PauseTimer { get; private set; } [IgnoreDataMember] public ReactiveCommand<object> ResetTimer { get; private set; } private ObservableAsPropertyHelper<bool> _IsTimerRunning; public bool IsTimerRunning { get { return _IsTimerRunning.Value; } } private int _CurrentTimeRemaining; /// <summary> /// Gets or sets the current time remaining. Seconds remaining /// </summary> /// <value>The current time remaining.</value> public int CurrentTimeRemaining { get { return _CurrentTimeRemaining; } set { this.RaiseAndSetIfChanged (ref _CurrentTimeRemaining, value); } } private ObservableAsPropertyHelper<string> _ClockText; public string ClockText { get { return _ClockText.Value; } } } }
{ "content_hash": "2227485d37739b96632cb556d65d7760", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 98, "avg_line_length": 26, "alnum_prop": 0.7044740973312402, "repo_name": "pdoh00/Time2Brew", "id": "3f654824a0068ec95588bf867954307e335b3ace", "size": "2550", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Time2Brew/MashTimerViewModel.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "46479" } ], "symlink_target": "" }
ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
{ "content_hash": "4149c9a1a41acdf83e2d82b5bf1bde70", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 31, "avg_line_length": 9.692307692307692, "alnum_prop": 0.7063492063492064, "repo_name": "mdoering/backbone", "id": "a7193880db215a83f95553493270d2f2c152d4d7", "size": "174", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Lamiales/Phrymaceae/Mazus/Mazus neriifolius/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
<?php defined('BASEPATH') OR exit('No direct script access allowed'); /* | ------------------------------------------------------------------- | DATABASE CONNECTIVITY SETTINGS | ------------------------------------------------------------------- | This file will contain the settings needed to access your database. | | For complete instructions please consult the 'Database Connection' | page of the User Guide. | | ------------------------------------------------------------------- | EXPLANATION OF VARIABLES | ------------------------------------------------------------------- | | ['dsn'] The full DSN string describe a connection to the database. | ['hostname'] The hostname of your database server. | ['username'] The username used to connect to the database | ['password'] The password used to connect to the database | ['database'] The name of the database you want to connect to | ['dbdriver'] The database driver. e.g.: mysqli. | Currently supported: | cubrid, ibase, mssql, mysql, mysqli, oci8, | odbc, pdo, postgre, sqlite, sqlite3, sqlsrv | ['dbprefix'] You can add an optional prefix, which will be added | to the table name when using the Query Builder class | ['pconnect'] TRUE/FALSE - Whether to use a persistent connection | ['db_debug'] TRUE/FALSE - Whether database errors should be displayed. | ['cache_on'] TRUE/FALSE - Enables/disables query caching | ['cachedir'] The path to the folder where cache files should be stored | ['char_set'] The character set used in communicating with the database | ['dbcollat'] The character collation used in communicating with the database | NOTE: For MySQL and MySQLi databases, this setting is only used | as a backup if your server is running PHP < 5.2.3 or MySQL < 5.0.7 | (and in table creation queries made with DB Forge). | There is an incompatibility in PHP with mysql_real_escape_string() which | can make your site vulnerable to SQL injection if you are using a | multi-byte character set and are running versions lower than these. | Sites using Latin-1 or UTF-8 database character set and collation are unaffected. | ['swap_pre'] A default table prefix that should be swapped with the dbprefix | ['encrypt'] Whether or not to use an encrypted connection. | | 'mysql' (deprecated), 'sqlsrv' and 'pdo/sqlsrv' drivers accept TRUE/FALSE | 'mysqli' and 'pdo/mysql' drivers accept an array with the following options: | | 'ssl_key' - Path to the private key file | 'ssl_cert' - Path to the public key certificate file | 'ssl_ca' - Path to the certificate authority file | 'ssl_capath' - Path to a directory containing trusted CA certificats in PEM format | 'ssl_cipher' - List of *allowed* ciphers to be used for the encryption, separated by colons (':') | 'ssl_verify' - TRUE/FALSE; Whether verify the server certificate or not ('mysqli' only) | | ['compress'] Whether or not to use client compression (MySQL only) | ['stricton'] TRUE/FALSE - forces 'Strict Mode' connections | - good for ensuring strict SQL while developing | ['ssl_options'] Used to set various SSL options that can be used when making SSL connections. | ['failover'] array - A array with 0 or more data for connections if the main should fail. | ['save_queries'] TRUE/FALSE - Whether to "save" all executed queries. | NOTE: Disabling this will also effectively disable both | $this->db->last_query() and profiling of DB queries. | When you run a query, with this setting set to TRUE (default), | CodeIgniter will store the SQL statement for debugging purposes. | However, this may cause high memory usage, especially if you run | a lot of SQL queries ... disable this to avoid that problem. | | The $active_group variable lets you choose which connection group to | make active. By default there is only one group (the 'default' group). | | The $query_builder variables lets you determine whether or not to load | the query builder class. */ $active_group = 'default'; $query_builder = TRUE; $db['default'] = array( 'dsn' => '', 'hostname' => 'localhost', 'username' => 'root', 'password' => 'root', 'database' => 'jocomunico', 'dbdriver' => 'mysqli', 'dbprefix' => '', 'pconnect' => FALSE, 'db_debug' => (ENVIRONMENT !== 'production'), 'cache_on' => FALSE, 'cachedir' => '', 'char_set' => 'utf8', 'dbcollat' => 'utf8_unicode_ci', 'swap_pre' => '', 'encrypt' => FALSE, 'compress' => FALSE, 'stricton' => FALSE, 'failover' => array(), 'save_queries' => TRUE );
{ "content_hash": "b5d79801444290ca082e89ab532ac790", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 102, "avg_line_length": 47.208333333333336, "alnum_prop": 0.6579876434245366, "repo_name": "narum/jocomunicoLAB", "id": "97b16a95990b39681f78feb1d8a5882e22e82c36", "size": "4532", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "application/config/database.php", "mode": "33261", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "1415" }, { "name": "CSS", "bytes": "32129" }, { "name": "HTML", "bytes": "8144139" }, { "name": "JavaScript", "bytes": "103739" }, { "name": "PHP", "bytes": "2467810" } ], "symlink_target": "" }
<?php return [ 'adminEmail' => 'hrizantema31@yandex.ru', 'key'=>'salfkjsdklfslk', 'uploadPath'=>dirname(__DIR__) .'/public_html/images/users', 'uploadUrl'=>'images/users' ];
{ "content_hash": "2dec195ce33791da4f8888373cc6b1ed", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 64, "avg_line_length": 23.875, "alnum_prop": 0.612565445026178, "repo_name": "vorobyev/hrizantema", "id": "c2773eb530334afefef3422d254d3d67bf90da01", "size": "191", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "config/params.php", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "ApacheConf", "bytes": "459" }, { "name": "Batchfile", "bytes": "1030" }, { "name": "CSS", "bytes": "12332" }, { "name": "JavaScript", "bytes": "7796" }, { "name": "PHP", "bytes": "373082" } ], "symlink_target": "" }
using System; using System.Collections.Generic; using System.Runtime.CompilerServices; using System.Text; using BenchmarkDotNet.Attributes; using MeteoSharp.Measurements; namespace MeteoSharp.Benchmarks.Measurements { public class MeasurementConversion { private Pressure _pressure; public MeasurementConversion() { _pressure = 760 * Pressure.MillimeterOfMercury; } [Benchmark] [MethodImpl(MethodImplOptions.NoOptimization)] public void Convert() { _pressure.ValueIn(PressureUnit.HektoPascal); } } }
{ "content_hash": "fd618967f4f471e22ef38fdd049fe5cb", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 59, "avg_line_length": 23.53846153846154, "alnum_prop": 0.673202614379085, "repo_name": "fedarovich/meteo-sharp", "id": "11c8ec494189edfe74d8e6eaaf3c270b4a17a029", "size": "614", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Source/MeteoSharp/MeteoSharp.Benchmarks/Measurements/MeasurementConversion.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "211150" } ], "symlink_target": "" }
Graph Schema ============
{ "content_hash": "bb5bbbc968015c8ae0b174fdb35b2ff8", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 12, "avg_line_length": 13, "alnum_prop": 0.4230769230769231, "repo_name": "cassandra-dataset-manager/cdm", "id": "b5743bff77fc5823c11d551ddb01c01723787a01", "size": "26", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "docs/schema/graph.rst", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
The MIT License (MIT) ===================== Copyright © 2017 Teddy Katz Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
{ "content_hash": "370b9d8d0fbdc8c97c52eb7353695c22", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 65, "avg_line_length": 42.23076923076923, "alnum_prop": 0.7868852459016393, "repo_name": "not-an-aardvark/lucky-commit", "id": "196a92a10199fc2f01691f6c18aa4a4e2ed01094", "size": "1107", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "LICENSE.md", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "20835" }, { "name": "Rust", "bytes": "74639" } ], "symlink_target": "" }
'use strict'; const assert = require('assert'); const nmea = require('../../../index'); const sentences = require('../../fixtures/getSentences'); describe('nmea', function() { describe('#gprmc()', function() { it('should decode RMC Object from sentence', function() { assert(nmea.gprmc(sentences.RMC[0])); }); }); });
{ "content_hash": "291da68d22647a3ee4ecff564c1d9706", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 61, "avg_line_length": 22.666666666666668, "alnum_prop": 0.6088235294117647, "repo_name": "protocoolmx/node-nmea", "id": "e42d6c5248e4935ca03c7890bd51754508d714e6", "size": "340", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/integration/main/nmea.test.js", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "5943" } ], "symlink_target": "" }
* Breaking change: Drop support for node v11, v13 and below v10 ## 1.0.0 - 25-11-2015 * Breaking change: enrichActivities and enrichAggregatedActivities no longer accept a callback but return a promise * Breaking change: No longer register a schema to be an ActivitySchema through activitySchema method but build an ActivitySchema object from ActivitySchemaFactory - Creating a FeedManager can now also be done with custom settings (not loaded via getstream.json) through the method feedManagerFactory
{ "content_hash": "d12ac3a1b72ebc5cbe9eff3474ee1445", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 162, "avg_line_length": 63.125, "alnum_prop": 0.8138613861386138, "repo_name": "GetStream/stream-node", "id": "113ea1411ea31cd42943d7a3c751b45daf9b54ab", "size": "541", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "CHANGELOG.md", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "JavaScript", "bytes": "29640" } ], "symlink_target": "" }
package images import ( "encoding/json" "fmt" "io" "net/url" "strings" "github.com/spf13/cobra" "k8s.io/apimachinery/pkg/runtime" kapi "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/credentialprovider" kcmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util" "k8s.io/kubernetes/pkg/kubectl/resource" buildapi "github.com/openshift/origin/pkg/build/api" "github.com/openshift/origin/pkg/client" "github.com/openshift/origin/pkg/cmd/admin/migrate" "github.com/openshift/origin/pkg/cmd/templates" "github.com/openshift/origin/pkg/cmd/util/clientcmd" imageapi "github.com/openshift/origin/pkg/image/api" ) var ( internalMigrateImagesLong = templates.LongDesc(` Migrate references to Docker images This command updates embedded Docker image references on the server in place. By default it will update image streams and images, and may be used to update resources with a pod template (deployments, replication controllers, daemon sets). References are changed by providing a mapping between a source registry and name and the desired registry and name. Either name or registry can be set to '*' to change all values. The registry value "docker.io" is special and will handle any image reference that refers to the DockerHub. You may pass multiple mappings - the first matching mapping will be applied per resource. The following resource types may be migrated by this command: * buildconfigs * daemonsets * deploymentconfigs * images * imagestreams * jobs * pods * replicationcontrollers * secrets (docker) Only images, imagestreams, and secrets are updated by default. Updating images and image streams requires administrative privileges.`) internalMigrateImagesExample = templates.Examples(` # Perform a dry-run of migrating all "docker.io" references to "myregistry.com" %[1]s docker.io/*=myregistry.com/* # To actually perform the migration, the confirm flag must be appended %[1]s docker.io/*=myregistry.com/* --confirm # To see more details of what will be migrated, use the loglevel and output flags %[1]s docker.io/*=myregistry.com/* --loglevel=2 -o yaml # Migrate from a service IP to an internal service DNS name %[1]s 172.30.1.54/*=registry.openshift.svc.cluster.local/* # Migrate from a service IP to an internal service DNS name for all deployment configs and builds %[1]s 172.30.1.54/*=registry.openshift.svc.cluster.local/* --include=buildconfigs,deploymentconfigs`) ) type MigrateImageReferenceOptions struct { migrate.ResourceOptions Client client.Interface Mappings ImageReferenceMappings UpdatePodSpecFn func(obj runtime.Object, fn func(*kapi.PodSpec) error) (bool, error) } // NewCmdMigrateImageReferences implements a MigrateImages command func NewCmdMigrateImageReferences(name, fullName string, f *clientcmd.Factory, in io.Reader, out, errout io.Writer) *cobra.Command { options := &MigrateImageReferenceOptions{ ResourceOptions: migrate.ResourceOptions{ In: in, Out: out, ErrOut: errout, Include: []string{"imagestream", "image", "secrets"}, }, } cmd := &cobra.Command{ Use: fmt.Sprintf("%s REGISTRY/NAME=REGISTRY/NAME [...]", name), Short: "Update embedded Docker image references", Long: internalMigrateImagesLong, Example: fmt.Sprintf(internalMigrateImagesExample, fullName), Run: func(cmd *cobra.Command, args []string) { kcmdutil.CheckErr(options.Complete(f, cmd, args)) kcmdutil.CheckErr(options.Validate()) kcmdutil.CheckErr(options.Run()) }, } options.ResourceOptions.Bind(cmd) return cmd } func (o *MigrateImageReferenceOptions) Complete(f *clientcmd.Factory, c *cobra.Command, args []string) error { var remainingArgs []string for _, s := range args { if !strings.Contains(s, "=") { remainingArgs = append(remainingArgs, s) continue } mapping, err := ParseMapping(s) if err != nil { return err } o.Mappings = append(o.Mappings, mapping) } o.UpdatePodSpecFn = f.UpdatePodSpecForObject if len(remainingArgs) > 0 { return fmt.Errorf("all arguments must be valid FROM=TO mappings") } o.ResourceOptions.SaveFn = o.save if err := o.ResourceOptions.Complete(f, c); err != nil { return err } osclient, _, err := f.Clients() if err != nil { return err } o.Client = osclient return nil } func (o MigrateImageReferenceOptions) Validate() error { if len(o.Mappings) == 0 { return fmt.Errorf("at least one mapping argument must be specified: REGISTRY/NAME=REGISTRY/NAME") } return o.ResourceOptions.Validate() } func (o MigrateImageReferenceOptions) Run() error { return o.ResourceOptions.Visitor().Visit(func(info *resource.Info) (migrate.Reporter, error) { return o.transform(info.Object) }) } // save invokes the API to alter an object. The reporter passed to this method is the same returned by // the migration visitor method (for this type, transformImageReferences). It should return an error // if the input type cannot be saved. It returns migrate.ErrRecalculate if migration should be re-run // on the provided object. func (o *MigrateImageReferenceOptions) save(info *resource.Info, reporter migrate.Reporter) error { switch t := info.Object.(type) { case *imageapi.ImageStream: // update status first so that a subsequent spec update won't pull incorrect values if reporter.(imageChangeInfo).status { updated, err := o.Client.ImageStreams(t.Namespace).UpdateStatus(t) if err != nil { return migrate.DefaultRetriable(info, err) } info.Refresh(updated, true) return migrate.ErrRecalculate } if reporter.(imageChangeInfo).spec { updated, err := o.Client.ImageStreams(t.Namespace).Update(t) if err != nil { return migrate.DefaultRetriable(info, err) } info.Refresh(updated, true) } return nil default: if _, err := resource.NewHelper(info.Client, info.Mapping).Replace(info.Namespace, info.Name, false, info.Object); err != nil { return migrate.DefaultRetriable(info, err) } } return nil } // transform checks image references on the provided object and returns either a reporter (indicating // that the object was recognized and whether it was updated) or an error. func (o *MigrateImageReferenceOptions) transform(obj runtime.Object) (migrate.Reporter, error) { fn := o.Mappings.MapReference switch t := obj.(type) { case *imageapi.Image: var changed bool if updated := fn(t.DockerImageReference); updated != t.DockerImageReference { changed = true t.DockerImageReference = updated } return reporter(changed), nil case *imageapi.ImageStream: var info imageChangeInfo if len(t.Spec.DockerImageRepository) > 0 { info.spec = updateString(&t.Spec.DockerImageRepository, fn) } for _, ref := range t.Spec.Tags { if ref.From == nil || ref.From.Kind != "DockerImage" { continue } info.spec = updateString(&ref.From.Name, fn) || info.spec } for _, events := range t.Status.Tags { for i := range events.Items { info.status = updateString(&events.Items[i].DockerImageReference, fn) || info.status } } return info, nil case *kapi.Secret: switch t.Type { case kapi.SecretTypeDockercfg: var v credentialprovider.DockerConfig if err := json.Unmarshal(t.Data[kapi.DockerConfigKey], &v); err != nil { return nil, err } if !updateDockerConfig(v, o.Mappings.MapDockerAuthKey) { return reporter(false), nil } data, err := json.Marshal(v) if err != nil { return nil, err } t.Data[kapi.DockerConfigKey] = data return reporter(true), nil case kapi.SecretTypeDockerConfigJson: var v credentialprovider.DockerConfigJson if err := json.Unmarshal(t.Data[kapi.DockerConfigJsonKey], &v); err != nil { return nil, err } if !updateDockerConfig(v.Auths, o.Mappings.MapDockerAuthKey) { return reporter(false), nil } data, err := json.Marshal(v) if err != nil { return nil, err } t.Data[kapi.DockerConfigJsonKey] = data return reporter(true), nil default: return reporter(false), nil } case *buildapi.BuildConfig: var changed bool if to := t.Spec.Output.To; to != nil && to.Kind == "DockerImage" { changed = updateString(&to.Name, fn) || changed } for i, image := range t.Spec.Source.Images { if image.From.Kind == "DockerImage" { changed = updateString(&t.Spec.Source.Images[i].From.Name, fn) || changed } } if c := t.Spec.Strategy.CustomStrategy; c != nil && c.From.Kind == "DockerImage" { changed = updateString(&c.From.Name, fn) || changed } if c := t.Spec.Strategy.DockerStrategy; c != nil && c.From.Kind == "DockerImage" { changed = updateString(&c.From.Name, fn) || changed } if c := t.Spec.Strategy.SourceStrategy; c != nil && c.From.Kind == "DockerImage" { changed = updateString(&c.From.Name, fn) || changed } return reporter(changed), nil default: if o.UpdatePodSpecFn != nil { var changed bool supports, err := o.UpdatePodSpecFn(obj, func(spec *kapi.PodSpec) error { changed = updatePodSpec(spec, fn) return nil }) if !supports { return nil, nil } if err != nil { return nil, err } return reporter(changed), nil } } // TODO: implement use of the generic PodTemplate accessor from the factory to handle // any object with a pod template return nil, nil } // reporter implements the Reporter interface for a boolean. type reporter bool func (r reporter) Changed() bool { return bool(r) } // imageChangeInfo indicates whether the spec or status of an image stream was changed. type imageChangeInfo struct { spec, status bool } func (i imageChangeInfo) Changed() bool { return i.spec || i.status } type TransformImageFunc func(in string) string func updateString(value *string, fn TransformImageFunc) bool { result := fn(*value) if result != *value { *value = result return true } return false } func updatePodSpec(spec *kapi.PodSpec, fn TransformImageFunc) bool { var changed bool for i := range spec.Containers { changed = updateString(&spec.Containers[i].Image, fn) || changed } return changed } func updateDockerConfig(cfg credentialprovider.DockerConfig, fn TransformImageFunc) bool { var changed bool for k, v := range cfg { original := k if updateString(&k, fn) { changed = true delete(cfg, original) cfg[k] = v } } return changed } // ImageReferenceMapping represents a transformation of an image reference. type ImageReferenceMapping struct { FromRegistry string FromName string ToRegistry string ToName string } // ParseMapping converts a string in the form "(REGISTRY|*)/(NAME|*)" to an ImageReferenceMapping // or returns a user-facing error. REGISTRY is the image registry value (hostname) or "docker.io". // NAME is the full repository name (the path relative to the registry root). // TODO: handle v2 repository names, which can have multiple segments (must fix // ParseDockerImageReference) func ParseMapping(s string) (ImageReferenceMapping, error) { parts := strings.SplitN(s, "=", 2) from := strings.SplitN(parts[0], "/", 2) to := strings.SplitN(parts[1], "/", 2) if len(from) < 2 || len(to) < 2 { return ImageReferenceMapping{}, fmt.Errorf("all arguments must be of the form REGISTRY/NAME=REGISTRY/NAME, where registry or name may be '*' or a value") } if len(from[0]) == 0 { return ImageReferenceMapping{}, fmt.Errorf("%q is not a valid source: registry must be specified (may be '*')", parts[0]) } if len(from[1]) == 0 { return ImageReferenceMapping{}, fmt.Errorf("%q is not a valid source: name must be specified (may be '*')", parts[0]) } if len(to[0]) == 0 { return ImageReferenceMapping{}, fmt.Errorf("%q is not a valid target: registry must be specified (may be '*')", parts[1]) } if len(to[1]) == 0 { return ImageReferenceMapping{}, fmt.Errorf("%q is not a valid target: name must be specified (may be '*')", parts[1]) } if from[0] == "*" { from[0] = "" } if from[1] == "*" { from[1] = "" } if to[0] == "*" { to[0] = "" } if to[1] == "*" { to[1] = "" } if to[0] == "" && to[1] == "" { return ImageReferenceMapping{}, fmt.Errorf("%q is not a valid target: at least one change must be specified", parts[1]) } if from[0] == to[0] && from[1] == to[1] { return ImageReferenceMapping{}, fmt.Errorf("%q is not valid: must target at least one field to change", s) } return ImageReferenceMapping{ FromRegistry: from[0], FromName: from[1], ToRegistry: to[0], ToName: to[1], }, nil } // ImageReferenceMappings provide a convenience method for transforming an input reference type ImageReferenceMappings []ImageReferenceMapping // MapReference transforms the provided Docker image reference if any mapping matches the // input. If the reference cannot be parsed, it will not be modified. func (m ImageReferenceMappings) MapReference(in string) string { ref, err := imageapi.ParseDockerImageReference(in) if err != nil { return in } registry := ref.DockerClientDefaults().Registry name := ref.RepositoryName() for _, mapping := range m { if len(mapping.FromRegistry) > 0 && mapping.FromRegistry != registry { continue } if len(mapping.FromName) > 0 && mapping.FromName != name { continue } if len(mapping.ToRegistry) > 0 { ref.Registry = mapping.ToRegistry } if len(mapping.ToName) > 0 { ref.Namespace = "" ref.Name = mapping.ToName } return ref.Exact() } return in } // MapDockerAuthKey transforms the provided Docker Config host key if any mapping matches // the input. If the reference cannot be parsed, it will not be modified. func (m ImageReferenceMappings) MapDockerAuthKey(in string) string { value := in if len(value) == 0 { value = imageapi.DockerDefaultV1Registry } if !strings.HasPrefix(value, "https://") && !strings.HasPrefix(value, "http://") { value = "https://" + value } parsed, err := url.Parse(value) if err != nil { return in } // The docker client allows exact matches: // foo.bar.com/namespace // Or hostname matches: // foo.bar.com // It also considers /v2/ and /v1/ equivalent to the hostname // See ResolveAuthConfig in docker/registry/auth.go. registry := parsed.Host name := parsed.Path switch { case name == "/": name = "" case strings.HasPrefix(name, "/v2/") || strings.HasPrefix(name, "/v1/"): name = name[4:] case strings.HasPrefix(name, "/"): name = name[1:] } for _, mapping := range m { if len(mapping.FromRegistry) > 0 && mapping.FromRegistry != registry { continue } if len(mapping.FromName) > 0 && mapping.FromName != name { continue } if len(mapping.ToRegistry) > 0 { registry = mapping.ToRegistry } if len(mapping.ToName) > 0 { name = mapping.ToName } if len(name) > 0 { return registry + "/" + name } return registry } return in }
{ "content_hash": "69bdfd84a944329f20cdded408078885", "timestamp": "", "source": "github", "line_count": 475, "max_line_length": 155, "avg_line_length": 31.174736842105265, "alnum_prop": 0.6992841707185306, "repo_name": "ncdc/origin", "id": "3979853fc53a2523e44323136dc50fd07d7dd621", "size": "14808", "binary": false, "copies": "7", "ref": "refs/heads/master", "path": "pkg/cmd/admin/migrate/images/imagerefs.go", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Awk", "bytes": "921" }, { "name": "DIGITAL Command Language", "bytes": "117" }, { "name": "Go", "bytes": "16664990" }, { "name": "Makefile", "bytes": "8212" }, { "name": "Protocol Buffer", "bytes": "628690" }, { "name": "Python", "bytes": "7821" }, { "name": "Roff", "bytes": "2049" }, { "name": "Ruby", "bytes": "484" }, { "name": "Shell", "bytes": "1550272" } ], "symlink_target": "" }
/* * * This file contains the Karma testing framework for the * client login functionality included in the ChatApp * */ describe('<-- Loading Control -->', function(){ beforeEach(module('ChatApp')); var scope, appService, timeout, ctrl; beforeEach(inject(function(_appService_){ appService = _appService_; })); beforeEach(inject(function($rootScope, $controller){ scope = $rootScope.$new(); timeout = sinon.stub(); sinon.stub(appService, 'updateState', function() {}); ctrl = $controller('loadingCtrl', { $scope: scope, appService: appService, $timeout: timeout }); })); describe('Loading Directive', function(){ beforeEach(inject(function($templateCache) { $templateCache.put("/templates/loading.html", 'CONTENT OF LOADING'); })); var element; beforeEach(inject(function($rootScope, $compile){ element = angular.element('<loading></loading>'); $compile(element)($rootScope); $rootScope.$digest(); })); it('exists', function(){ var html = element.html(); expect(html).to.equal('CONTENT OF LOADING'); }); }); describe('Initial State', function(){ it('is hidden', function(){ expect(scope.showLoading).to.equal(false); }); it('has status text', function(){ expect(scope.status).to.equal('Loading...'); }); }); describe('Show/Hide Capabilities', function(){ it('does not show when logging in', function(){ appService.state = appService.STATUS_LOGIN; scope.$broadcast('appStatusChange'); expect(scope.showLoading).to.equal(false); }); it('does not show when registering', function(){ appService.state = appService.STATUS_REGISTER; scope.$broadcast('appStatusChange'); expect(scope.showLoading).to.equal(false); }); it('shows when loading', function(){ appService.state = appService.STATUS_LOAD; scope.$broadcast('appStatusChange'); expect(scope.showLoading).to.equal(true); }); it('does not show when app is initialized', function(){ appService.state = appService.STATUS_INIT; scope.$broadcast('appStatusChange'); expect(scope.showLoading).to.equal(false); }); it('finishes loading command with $apply', function(){ scope.$broadcast('appStatusChange'); expect(timeout.callCount).to.equal(1); expect(typeof timeout.args[0][0]).to.equal('function'); scope.$apply = sinon.stub(); timeout.args[0][0](); expect(scope.$apply.callCount).to.equal(1); }); }); });
{ "content_hash": "2ba1de7fc29166762e965d8ba9fddd6f", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 80, "avg_line_length": 29.989690721649485, "alnum_prop": 0.5596424888277759, "repo_name": "jonrhall/chat-app", "id": "5dd8747f4325f11b57cda4c393eed91a0ee30e8b", "size": "2909", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/loading.client.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "19567" }, { "name": "JavaScript", "bytes": "127230" } ], "symlink_target": "" }
using System; using System.Collections.Generic; using System.Linq; using CodeModel.Graphs; using NUnit.Framework; using Tests.EntryPointTests; namespace Tests.GraphTests { public class FindCyclesTest : IHaveGraph<FindCyclesTest.SampleNode, FindCyclesTest.SampleLink> { public Graph<FindCyclesTest.SampleNode, FindCyclesTest.SampleLink> Result { get; private set; } [Test] [TestCase("AB,BA", new[] { "A,B" })] [TestCase("AB,BC,CA", new[] { "A,B,C" })] [TestCase("AB,BC,CA,DE,EF,FD", new[] { "A,B,C", "D,E,F" })] [TestCase("AB,BC,CA,DE,EF,FD,BD", new[] { "A,B,C", "D,E,F" })] [TestCase("AB,BC,CD,DE", new string[0])] [TestCase("AB,BC,CA,BD,DE,EF,FC", new[] { "A,B,C", "A,B,D,E,F,C" })] //[TestCase("AB,AC,CF,BF,FA,AG,FD,BG,BD,GD,GE,EB,DH,EH,HA,GC,CJ,KC,KJ,IK,JI,IG,HI,HG", // new[] { "A,B,F", "A,B,D,F,A", "B,D,H,E", "A,B,D,H,G", "A,F,C", "A,G,C,F", "C,J,I,G" } //)] // nice try ;) public void ShouldFindProperCycles(string graphSpec, string[] expectedCycles) { // arrange this.Result = new Graph<SampleNode, SampleLink>(); var nodes = graphSpec.Where(x => x != ',').Distinct().ToDictionary(x => x.ToString(), x => new SampleNode(x.ToString())); foreach (var node in nodes) { this.Result.AddNode(node.Value); } foreach (var linkSpec in graphSpec.Split(',')) { var source = nodes[linkSpec[0].ToString()]; var target = nodes[linkSpec[1].ToString()]; this.Result.AddLink(source, target, new SampleLink()); } var finder = new FindCycles<SampleNode, SampleLink>(); // act var foundCycles = finder.Find(this.Result); // assert Assert.That(foundCycles.Select(x => x.Select(y => y.Id)), Is .EquivalentTo(expectedCycles.Select(x => x.Split(','))) ); } public class SampleNode : Node { public SampleNode(string nodeId) : base(nodeId) { } } public class SampleLink : Link { } } }
{ "content_hash": "a3316a546ee937634408940a1eb8e646", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 133, "avg_line_length": 34.57575757575758, "alnum_prop": 0.5197195442594216, "repo_name": "Novakov/HighLevelCodeAnalysis", "id": "97298ea9742032627aa6db13c547e9dad8d011a3", "size": "2284", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Tests/GraphTests/FindCyclesTest.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C#", "bytes": "875324" }, { "name": "F#", "bytes": "2549" }, { "name": "PowerShell", "bytes": "3473" }, { "name": "Shell", "bytes": "134" }, { "name": "XSLT", "bytes": "13543" } ], "symlink_target": "" }
package ru.job4j.multithreading.monitore.searchtxt; import java.io.*; import java.util.List; /** * TxtSearch Class. * @author Arseniy Kulikov. * @since 01.11.2017. * @version 1. */ public class TxtSearch implements Runnable { /** * Поле класса. */ private int count = 0; /** * Поле класса. */ private BlockingQueue<String> filepaths; /** * Поле класса. */ private List<String> result; /** * Поле класса. */ private String text; /** * Конструктор. * @param result - контейнер для реузльтатов. * @param filePaths - контейнер для файлов. * @param text - текст для поиска. */ public TxtSearch(List<String> result, BlockingQueue<String> filePaths, String text) { this.result = result; this.filepaths = filePaths; this.text = text; } /** * Метод поиска текста в файле. * @param path - путь к файлу. */ public void searching(String path) { try { FileInputStream fstream = new FileInputStream(path); BufferedReader br = new BufferedReader(new InputStreamReader(fstream)); String strLine; while ((strLine = br.readLine()) != null) { if (strLine.contains(this.text)) { result.add(path); count++; } } } catch (IOException e) { e.printStackTrace(); } } @Override public void run() { try { while (filepaths.getWillBeNew() || filepaths.size() != 0) { String path = filepaths.take(); this.searching(path); } System.out.printf("В %s файлах найден указанный текст.%n", this.count); } catch (InterruptedException e) { e.printStackTrace(); } } }
{ "content_hash": "aa86d53a6098d3828a8dd926a27f8bbb", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 89, "avg_line_length": 24.166666666666668, "alnum_prop": 0.5358090185676393, "repo_name": "ArseniyJ4J/akulikov", "id": "6bfe61b3b71b8a7bdab5aa1aff27c3bf59779a7a", "size": "2051", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "chapter_007/src/main/java/ru/job4j/multithreading/monitore/searchtxt/TxtSearch.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "514083" }, { "name": "XSLT", "bytes": "542" } ], "symlink_target": "" }
package org.yield4j.error; import static org.yield4j.YieldSupport.yield_return; //!! ERROR(19) privateMethod() has private access in org.yield4j.error.PreserveModifiersOnMethods public class PreserveModifiersOnMethods { public Iterable<Integer> method() { return privateMethod(); } @org.yield4j.Generator private Iterable<Integer> privateMethod() { yield_return(5); } } class OtherClass { Iterable<Integer> dummy() { return new PreserveModifiersOnMethods().privateMethod(); } }
{ "content_hash": "b8f0e8d7ec4edb75f404564a72fa1a53", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 97, "avg_line_length": 25.238095238095237, "alnum_prop": 0.7132075471698113, "repo_name": "provegard/yield4j", "id": "562ceb735da31ec76c0cde350d6d06b128ac338c", "size": "530", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/test/resources/org/yield4j/error/PreserveModifiersOnMethods.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "321550" }, { "name": "Shell", "bytes": "1085" } ], "symlink_target": "" }
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( "ExporterIfcUtilsWinArea" )] [assembly: AssemblyDescription( "Revit add-in using ExporterIfcUtils to determine window area" )] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Autodesk Inc.")] [assembly: AssemblyProduct( "ExporterIfcUtilsWinArea" )] [assembly: AssemblyCopyright("Copyright 2015 © Peter (Pjohan13) and Jeremy Tammik, Autodesk Inc.")] [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("321044f7-b0b2-4b1c-af18-e71a19252be0")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("2015.0.0.0")] [assembly: AssemblyFileVersion("2015.0.0.0")]
{ "content_hash": "9c9574887fb320a7adef3a5d5c120294", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 99, "avg_line_length": 43.97222222222222, "alnum_prop": 0.7397346809854706, "repo_name": "jeremytammik/ExporterIfcUtilsWinArea", "id": "ac0cf295aeea650b5f25583ff927450e68f4bcba", "size": "1583", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "SampleExpIfcUtilsWinArea/Properties/AssemblyInfo.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "5196" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android" > <item android:id="@+id/one" android:title="Picture" android:icon="@drawable/more_picture" /> <item android:id="@+id/two" android:title="Files" android:icon="@drawable/more_file"/> </menu>
{ "content_hash": "5ffa1fb78122c55f671755b33b3cd185", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 66, "avg_line_length": 23.533333333333335, "alnum_prop": 0.5864022662889519, "repo_name": "xunixH/android_chat_UI", "id": "a90f1f507ba0e0d57190e776ca2afc2078003ec4", "size": "353", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "android_chat/src/main/res/menu/more_menu.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "136022" } ], "symlink_target": "" }
from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'PollQuestion' db.create_table(u'poll_pollquestion', ( (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('image', self.gf('django.db.models.fields.files.ImageField')(max_length=100, blank=True)), ('date_taken', self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True)), ('view_count', self.gf('django.db.models.fields.PositiveIntegerField')(default=0)), ('crop_from', self.gf('django.db.models.fields.CharField')(default='center', max_length=10, blank=True)), ('effect', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='pollquestion_related', null=True, to=orm['photologue.PhotoEffect'])), ('state', self.gf('django.db.models.fields.PositiveSmallIntegerField')(default=0)), ('publish_at', self.gf('django.db.models.fields.DateTimeField')(db_index=True, null=True, blank=True)), ('retract_at', self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True)), ('image_name', self.gf('django.db.models.fields.CharField')(max_length=512, null=True, blank=True)), ('question', self.gf('django.db.models.fields.CharField')(max_length=1024)), ('multiple_choice', self.gf('django.db.models.fields.BooleanField')(default=False)), ('order', self.gf('django.db.models.fields.PositiveIntegerField')(default=0, db_index=True)), )) db.send_create_signal(u'poll', ['PollQuestion']) # Adding M2M table for field sites on 'PollQuestion' m2m_table_name = db.shorten_name(u'poll_pollquestion_sites') db.create_table(m2m_table_name, ( ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)), ('pollquestion', models.ForeignKey(orm[u'poll.pollquestion'], null=False)), ('site', models.ForeignKey(orm[u'sites.site'], null=False)) )) db.create_unique(m2m_table_name, ['pollquestion_id', 'site_id']) # Adding M2M table for field users_answered on 'PollQuestion' m2m_table_name = db.shorten_name(u'poll_pollquestion_users_answered') db.create_table(m2m_table_name, ( ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)), ('pollquestion', models.ForeignKey(orm[u'poll.pollquestion'], null=False)), ('enduser', models.ForeignKey(orm[u'authentication.enduser'], null=False)) )) db.create_unique(m2m_table_name, ['pollquestion_id', 'enduser_id']) # Adding model 'PollAnswer' db.create_table(u'poll_pollanswer', ( (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('state', self.gf('django.db.models.fields.PositiveSmallIntegerField')(default=0)), ('publish_at', self.gf('django.db.models.fields.DateTimeField')(db_index=True, null=True, blank=True)), ('retract_at', self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True)), ('poll', self.gf('django.db.models.fields.related.ForeignKey')(related_name='answers', to=orm['poll.PollQuestion'])), ('answer', self.gf('django.db.models.fields.CharField')(max_length=1024)), ('vote_count', self.gf('django.db.models.fields.PositiveIntegerField')(default=0)), ('order', self.gf('django.db.models.fields.PositiveIntegerField')(default=0, db_index=True)), )) db.send_create_signal(u'poll', ['PollAnswer']) # Adding M2M table for field sites on 'PollAnswer' m2m_table_name = db.shorten_name(u'poll_pollanswer_sites') db.create_table(m2m_table_name, ( ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)), ('pollanswer', models.ForeignKey(orm[u'poll.pollanswer'], null=False)), ('site', models.ForeignKey(orm[u'sites.site'], null=False)) )) db.create_unique(m2m_table_name, ['pollanswer_id', 'site_id']) def backwards(self, orm): # Deleting model 'PollQuestion' db.delete_table(u'poll_pollquestion') # Removing M2M table for field sites on 'PollQuestion' db.delete_table(db.shorten_name(u'poll_pollquestion_sites')) # Removing M2M table for field users_answered on 'PollQuestion' db.delete_table(db.shorten_name(u'poll_pollquestion_users_answered')) # Deleting model 'PollAnswer' db.delete_table(u'poll_pollanswer') # Removing M2M table for field sites on 'PollAnswer' db.delete_table(db.shorten_name(u'poll_pollanswer_sites')) models = { u'auth.group': { 'Meta': {'object_name': 'Group'}, u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) }, u'auth.permission': { 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) }, u'authentication.enduser': { 'Meta': {'object_name': 'EndUser'}, 'city': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), 'company_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'null': 'True', 'blank': 'True'}), 'crop_from': ('django.db.models.fields.CharField', [], {'default': "'center'", 'max_length': '10', 'blank': 'True'}), 'date_joined': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}), 'date_taken': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), 'effect': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'enduser_related'", 'null': 'True', 'to': u"orm['photologue.PhotoEffect']"}), 'email': ('django.db.models.fields.EmailField', [], {'db_index': 'True', 'max_length': '255', 'unique': 'True', 'null': 'True', 'blank': 'True'}), 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}), u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'blank': 'True'}), 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), 'is_admin': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'is_console_user': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'is_regular_user': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'job_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), 'mobile_number': ('django.db.models.fields.CharField', [], {'max_length': '16', 'null': 'True', 'blank': 'True'}), 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), 'phone_number': ('django.db.models.fields.CharField', [], {'max_length': '16', 'null': 'True', 'blank': 'True'}), 'state_province': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), 'street_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), 'title': ('django.db.models.fields.CharField', [], {'max_length': '8', 'null': 'True', 'blank': 'True'}), 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}), 'username': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'unique': 'True', 'null': 'True', 'blank': 'True'}), 'view_count': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), 'web_address': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), 'zip_postal_code': ('django.db.models.fields.CharField', [], {'max_length': '8', 'null': 'True', 'blank': 'True'}) }, u'contenttypes.contenttype': { 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) }, u'photologue.photoeffect': { 'Meta': {'object_name': 'PhotoEffect'}, 'background_color': ('django.db.models.fields.CharField', [], {'default': "'#FFFFFF'", 'max_length': '7'}), 'brightness': ('django.db.models.fields.FloatField', [], {'default': '1.0'}), 'color': ('django.db.models.fields.FloatField', [], {'default': '1.0'}), 'contrast': ('django.db.models.fields.FloatField', [], {'default': '1.0'}), 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), 'filters': ('django.db.models.fields.CharField', [], {'max_length': '200', 'blank': 'True'}), u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}), 'reflection_size': ('django.db.models.fields.FloatField', [], {'default': '0'}), 'reflection_strength': ('django.db.models.fields.FloatField', [], {'default': '0.6'}), 'sharpness': ('django.db.models.fields.FloatField', [], {'default': '1.0'}), 'transpose_method': ('django.db.models.fields.CharField', [], {'max_length': '15', 'blank': 'True'}) }, u'poll.pollanswer': { 'Meta': {'ordering': "['order', 'answer']", 'object_name': 'PollAnswer'}, 'answer': ('django.db.models.fields.CharField', [], {'max_length': '1024'}), u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'order': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0', 'db_index': 'True'}), 'poll': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'answers'", 'to': u"orm['poll.PollQuestion']"}), 'publish_at': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), 'retract_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), 'sites': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': u"orm['sites.Site']", 'null': 'True', 'blank': 'True'}), 'state': ('django.db.models.fields.PositiveSmallIntegerField', [], {'default': '0'}), 'vote_count': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}) }, u'poll.pollquestion': { 'Meta': {'ordering': "['order', '-publish_at']", 'object_name': 'PollQuestion'}, 'crop_from': ('django.db.models.fields.CharField', [], {'default': "'center'", 'max_length': '10', 'blank': 'True'}), 'date_taken': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), 'effect': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'pollquestion_related'", 'null': 'True', 'to': u"orm['photologue.PhotoEffect']"}), u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'blank': 'True'}), 'image_name': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}), 'multiple_choice': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'order': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0', 'db_index': 'True'}), 'publish_at': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), 'question': ('django.db.models.fields.CharField', [], {'max_length': '1024'}), 'retract_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), 'sites': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': u"orm['sites.Site']", 'null': 'True', 'blank': 'True'}), 'state': ('django.db.models.fields.PositiveSmallIntegerField', [], {'default': '0'}), 'users_answered': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'polls_answered'", 'null': 'True', 'symmetrical': 'False', 'to': u"orm['authentication.EndUser']"}), 'view_count': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}) }, u'sites.site': { 'Meta': {'ordering': "(u'domain',)", 'object_name': 'Site', 'db_table': "u'django_site'"}, 'domain': ('django.db.models.fields.CharField', [], {'max_length': '100'}), u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) } } complete_apps = ['poll']
{ "content_hash": "187e153f5db48c3aed78bc8ec51ca265", "timestamp": "", "source": "github", "line_count": 194, "max_line_length": 221, "avg_line_length": 78.85567010309278, "alnum_prop": 0.5800758269054779, "repo_name": "unomena/tunobase", "id": "b6670130388a5576b68a528023ea82fa68201a44", "size": "15322", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tunobase/poll/migrations/0001_initial.py", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "HTML", "bytes": "47213" }, { "name": "Python", "bytes": "780960" } ], "symlink_target": "" }
util::ProgramOption optionReportVoi( util::_module = "sopnet.evaluation", util::_long_name = "reportVoi", util::_description_text = "Compute variation of information for the error report."); util::ProgramOption optionReportRand( util::_module = "sopnet.evaluation", util::_long_name = "reportRand", util::_description_text = "Compute the RAND index for the error report."); util::ProgramOption optionReportTed( util::_module = "sopnet.evaluation", util::_long_name = "reportTed", util::_description_text = "Compute the tolerant edit distance for the error report."); util::ProgramOption optionReportAed( util::_module = "sopnet.evaluation", util::_long_name = "reportAed", util::_description_text = "Compute the anisotropic edit distance for the error report."); util::ProgramOption optionReportHamming( util::_module = "sopnet.evaluation", util::_long_name = "reportHamming", util::_description_text = "Compute the Hamming distance to the gold-standard for the error report."); util::ProgramOption optionGrowSlices( util::_module = "sopnet.evaluation", util::_long_name = "growSlices", util::_description_text = "For the computation of VOI and RAND, grow the reconstruction slices until no background label is present anymore."); logger::LogChannel errorreportlog("errorreportlog", "[ErrorReport] "); ErrorReport::ErrorReport() : _pipelineSetup(false) { registerInput(_groundTruthIdMap, "ground truth"); registerInput(_groundTruth, "ground truth segments"); registerInput(_goldStandard, "gold standard segments"); registerInput(_reconstruction, "reconstruction segments"); if (optionReportVoi) { _reportAssembler->addInput("errors", _voi->getOutput("errors")); registerOutput(_voi->getOutput("errors"), "voi errors"); } if (optionReportRand) { _reportAssembler->addInput("errors", _rand->getOutput("errors")); registerOutput(_rand->getOutput("errors"), "rand errors"); } if (optionReportTed) { _reportAssembler->addInput("errors", _ted->getOutput("errors")); registerOutput(_ted->getOutput("errors"), "ted errors"); } if (optionReportAed) { _reportAssembler->addInput("errors", _aed->getOutput("errors")); registerOutput(_aed->getOutput("errors"), "aed errors"); } if (optionReportHamming) { _reportAssembler->addInput("errors", _hamming->getOutput("errors")); registerOutput(_hamming->getOutput("errors"), "hamming errors"); } registerOutput(_reportAssembler->getOutput("error report header"), "error report header"); registerOutput(_reportAssembler->getOutput("error report"), "error report"); registerOutput(_reportAssembler->getOutput("human readable error report"), "human readable error report"); } void ErrorReport::updateOutputs() { if (_pipelineSetup) return; LOG_DEBUG(errorreportlog) << "setting up internal pipeline" << std::endl; pipeline::Process<NeuronExtractor> neuronExtractor; pipeline::Process<IdMapCreator> idMapCreator; pipeline::Process<> voiRandIdMapProvider; if (optionGrowSlices) { voiRandIdMapProvider = pipeline::Process<GrowSlices>(); voiRandIdMapProvider->setInput(idMapCreator->getOutput()); } else { voiRandIdMapProvider = idMapCreator; } neuronExtractor->setInput(_reconstruction); idMapCreator->setInput("neurons", neuronExtractor->getOutput()); idMapCreator->setInput("reference", _groundTruthIdMap); _voi->setInput("stack 1", _groundTruthIdMap); _voi->setInput("stack 2", voiRandIdMapProvider->getOutput()); _rand->setInput("stack 1", _groundTruthIdMap); _rand->setInput("stack 2", voiRandIdMapProvider->getOutput()); _ted->setInput("ground truth", _groundTruthIdMap); _ted->setInput("reconstruction", idMapCreator->getOutput()); _aed->setInput("ground truth", _groundTruth); _aed->setInput("result", _reconstruction); _hamming->setInput("gold standard", _goldStandard); _hamming->setInput("reconstruction", _reconstruction); _pipelineSetup = true; LOG_DEBUG(errorreportlog) << "internal pipeline set up" << std::endl; } void ErrorReport::GrowSlices::updateOutputs() { if (!_grown) _grown = new ImageStack(); else _grown->clear(); foreach (boost::shared_ptr<Image> image, *_stack) { boost::shared_ptr<Image> grown = boost::make_shared<Image>(image->width(), image->height()); *grown = *image; // perform Euclidean distance transform vigra::MultiArray<2, float> dist(image->width(), image->height()); vigra::distanceTransform(*image, dist, 0, 2); float min, max; image->minmax(&min, &max); // init statistics functor vigra::ArrayOfRegionStatistics<vigra::SeedRgDirectValueFunctor<float> > stats(max); // grow regions vigra::seededRegionGrowing(dist, *grown, *grown, stats); _grown->add(grown); } pipeline::Process<ImageStackDirectoryWriter> writer("result_grown"); writer->setInput(_grown.getSharedPointer()); writer->write(); }
{ "content_hash": "17ac0920f84d5a7a17e36a32a30397ad", "timestamp": "", "source": "github", "line_count": 155, "max_line_length": 145, "avg_line_length": 31.974193548387095, "alnum_prop": 0.7094430992736077, "repo_name": "funkey/sopnet", "id": "16f3d360f39e3015dfed74745e82581e18c4a77b", "size": "5258", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "sopnet/sopnet/evaluation/ErrorReport.cpp", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "2400" }, { "name": "C++", "bytes": "1061230" }, { "name": "CMake", "bytes": "3453" } ], "symlink_target": "" }
/* * (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com> * (C)opyright MMVII Robert Manea <rob dot manea at gmail dot com> * See LICENSE file for license details. * */ #include "dzen.h" #include <stdarg.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/wait.h> #include <unistd.h> #define COLORCACHE_MAX 256 static char *colorcache_names[COLORCACHE_MAX]; static long colorcache_values[COLORCACHE_MAX]; #ifdef DZEN_XFT static char *xftcolorcache_names[COLORCACHE_MAX]; static XftColor xftcolorcache_values[COLORCACHE_MAX]; #endif #define ONEMASK ((size_t)(-1) / 0xFF) void * emalloc(unsigned int size) { void *res = malloc(size); if(!res) eprint("fatal: could not malloc() %u bytes\n", size); return res; } void eprint(const char *errstr, ...) { va_list ap; va_start(ap, errstr); vfprintf(stderr, errstr, ap); va_end(ap); exit(EXIT_FAILURE); } char * estrdup(const char *str) { void *res = strdup(str); if(!res) eprint("fatal: could not malloc() %u bytes\n", strlen(str)); return res; } void spawn(const char *arg) { static const char *shell = NULL; if(!shell && !(shell = getenv("SHELL"))) shell = "/bin/sh"; if(!arg) return; /* The double-fork construct avoids zombie processes and keeps the code * clean from stupid signal handlers. */ if(fork() == 0) { if(fork() == 0) { setsid(); execl(shell, shell, "-c", arg, (char *)NULL); fprintf(stderr, "dzen: execl '%s -c %s'", shell, arg); perror(" failed"); } exit(0); } wait(0); } long colorcache_get(const char *name) { int i; for (i = 0; i < COLORCACHE_MAX; ++i) { if (!colorcache_names[i]) break; if (!strcmp(colorcache_names[i], name)) return colorcache_values[i]; } return -1; } void colorcache_set(const char *name, long value) { int i; for (i = 0; i < COLORCACHE_MAX; ++i) if (!colorcache_names[i]) break; if (i >= COLORCACHE_MAX) return; colorcache_names[i] = strdup(name); colorcache_values[i] = value; } #ifdef DZEN_XFT int xftcolorcache_get(const char *name, XftColor *color) { int i; for (i = 0; i < COLORCACHE_MAX; ++i) { if (!xftcolorcache_names[i]) break; if (!strcmp(xftcolorcache_names[i], name)) { memcpy(color, &xftcolorcache_values[i], sizeof(XftColor)); return 1; } } return 0; } void xftcolorcache_set(const char *name, XftColor *color) { int i; for (i = 0; i < COLORCACHE_MAX; ++i) if (!xftcolorcache_names[i]) break; if (i >= COLORCACHE_MAX) return; xftcolorcache_names[i] = strdup(name); memcpy(&xftcolorcache_values[i], color, sizeof(XftColor)); } #endif
{ "content_hash": "d6896419f6a57b595c6a200981a7f74f", "timestamp": "", "source": "github", "line_count": 132, "max_line_length": 72, "avg_line_length": 19.71212121212121, "alnum_prop": 0.6510376633358954, "repo_name": "doy/dzen", "id": "ef9a95434651e7218981c691a05e1c30b5d337a8", "size": "2602", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "util.c", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "94340" }, { "name": "Shell", "bytes": "2324" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <billStatus> <bill> <policyArea> <name>Foreign Trade and International Finance</name> </policyArea> <committeeReports /> <sponsors> <item> <party>R</party> <bioguideId>B001274</bioguideId> <firstName>Mo</firstName> <byRequestType /> <identifiers> <bioguideId>B001274</bioguideId> <gpoId>7790</gpoId> <lisID>1987</lisID> </identifiers> <district>5</district> <middleName /> <lastName>Brooks</lastName> <state>AL</state> <fullName>Rep. Brooks, Mo [R-AL-5]</fullName> </item> </sponsors> <relatedBills /> <version>1.0.0</version> <recordedVotes /> <createDate>2017-03-23T05:20:01Z</createDate> <billType>HCONRES</billType> <title>Expressing the sense of Congress that Congress and the President should prioritize the reduction and elimination, over a reasonable period of time, of the overall trade deficit of the United States.</title> <notes /> <congress>115</congress> <latestAction> <links /> <actionDate>2017-03-23</actionDate> <text>Referred to the Subcommittee on Trade.</text> </latestAction> <subjects> <billSubjects> <legislativeSubjects> <item> <name>Competitiveness, trade promotion, trade deficits</name> </item> </legislativeSubjects> <policyArea> <name>Foreign Trade and International Finance</name> </policyArea> </billSubjects> </subjects> <cosponsors> <item> <party>D</party> <state>IL</state> <bioguideId>L000563</bioguideId> <fullName>Rep. Lipinski, Daniel [D-IL-3]</fullName> <middleName>William</middleName> <lastName>Lipinski</lastName> <firstName>Daniel</firstName> <isOriginalCosponsor>True</isOriginalCosponsor> <sponsorshipWithdrawnDate /> <sponsorshipDate>2017-03-22</sponsorshipDate> <district>3</district> <identifiers> <gpoId>7923</gpoId> <bioguideId>L000563</bioguideId> <lisID>1781</lisID> </identifiers> </item> <item> <party>R</party> <state>CA</state> <bioguideId>H001048</bioguideId> <fullName>Rep. Hunter, Duncan D. [R-CA-50]</fullName> <middleName>D.</middleName> <lastName>Hunter</lastName> <firstName>Duncan</firstName> <isOriginalCosponsor>False</isOriginalCosponsor> <sponsorshipWithdrawnDate /> <sponsorshipDate>2017-04-26</sponsorshipDate> <district>50</district> <identifiers> <gpoId>7857</gpoId> <bioguideId>H001048</bioguideId> <lisID>1909</lisID> </identifiers> </item> <item> <party>R</party> <state>NC</state> <bioguideId>J000255</bioguideId> <fullName>Rep. Jones, Walter B., Jr. [R-NC-3]</fullName> <middleName>B.</middleName> <lastName>JONES</lastName> <firstName>WALTER</firstName> <isOriginalCosponsor>False</isOriginalCosponsor> <sponsorshipWithdrawnDate /> <sponsorshipDate>2017-06-20</sponsorshipDate> <district>3</district> <identifiers> <gpoId>8026</gpoId> <bioguideId>J000255</bioguideId> <lisID>612</lisID> </identifiers> </item> </cosponsors> <originChamber>House</originChamber> <updateDate>2017-09-19T19:30:10Z</updateDate> <laws /> <actions> <item> <actionDate>2017-03-23</actionDate> <committee> <systemCode>hswm04</systemCode> <name>Trade Subcommittee</name> </committee> <links /> <sourceSystem> <code>1</code> <name>House committee actions</name> </sourceSystem> <text>Referred to the Subcommittee on Trade.</text> <type>Committee</type> </item> <item> <committee> <systemCode>hswm00</systemCode> <name>Ways and Means Committee</name> </committee> <sourceSystem> <code>2</code> <name>House floor actions</name> </sourceSystem> <links /> <actionDate>2017-03-22</actionDate> <text>Referred to the House Committee on Ways and Means.</text> <actionCode>H11100</actionCode> <type>IntroReferral</type> </item> <item> <committee /> <sourceSystem> <code>9</code> <name>Library of Congress</name> </sourceSystem> <links /> <actionDate>2017-03-22</actionDate> <text>Introduced in House</text> <actionCode>Intro-H</actionCode> <type>IntroReferral</type> </item> <item> <committee /> <sourceSystem> <code>9</code> <name>Library of Congress</name> </sourceSystem> <links /> <actionDate>2017-03-22</actionDate> <text>Introduced in House</text> <actionCode>1000</actionCode> <type>IntroReferral</type> </item> <actionByCounts> <houseOfRepresentatives>4</houseOfRepresentatives> </actionByCounts> <actionTypeCounts> <introducedInHouse>1</introducedInHouse> <billReferrals>1</billReferrals> <introducedInTheHouse>1</introducedInTheHouse> <placeholderTextForH>1</placeholderTextForH> </actionTypeCounts> </actions> <cboCostEstimates /> <constitutionalAuthorityStatementText /> <committees> <billCommittees> <item> <name>Ways and Means Committee</name> <chamber>House</chamber> <systemCode>hswm00</systemCode> <activities> <item> <name>Referred to</name> <date>2017-03-22T14:03:00Z</date> </item> </activities> <type>Standing</type> <subcommittees> <item> <systemCode>hswm04</systemCode> <activities> <item> <name>Referred to</name> <date>2017-03-23T13:34:03Z</date> </item> </activities> <name>Trade Subcommittee</name> </item> </subcommittees> </item> </billCommittees> </committees> <billNumber>37</billNumber> <amendments /> <summaries> <billSummaries> <item> <text><![CDATA[<p>Expresses the sense of Congress that Congress and the President should prioritize the reduction and elimination, over a reasonable period of time, of the overall trade deficit of the United States.</p>]]></text> <actionDate>2017-03-22</actionDate> <name>Introduced in House</name> <updateDate>2017-03-22T04:00:00Z</updateDate> <actionDesc>Introduced in House</actionDesc> <lastSummaryUpdateDate>2017-03-27T17:40:34Z</lastSummaryUpdateDate> <versionCode>00</versionCode> </item> </billSummaries> </summaries> <introducedDate>2017-03-22</introducedDate> <calendarNumbers /> <titles> <item> <chamberName /> <chamberCode /> <titleType>Official Title as Introduced</titleType> <parentTitleType /> <title>Expressing the sense of Congress that Congress and the President should prioritize the reduction and elimination, over a reasonable period of time, of the overall trade deficit of the United States.</title> </item> <item> <chamberName /> <chamberCode /> <titleType>Display Title</titleType> <parentTitleType /> <title>Expressing the sense of Congress that Congress and the President should prioritize the reduction and elimination, over a reasonable period of time, of the overall trade deficit of the United States.</title> </item> </titles> </bill> <dublinCore xmlns:dc="http://purl.org/dc/elements/1.1/"> <dc:format>text/xml</dc:format> <dc:language>EN</dc:language> <dc:rights>Pursuant to Title 17 Section 105 of the United States Code, this file is not subject to copyright protection and is in the public domain.</dc:rights> <dc:contributor>Congressional Research Service, Library of Congress</dc:contributor> <dc:description>This file contains bill summaries and statuses for federal legislation. A bill summary describes the most significant provisions of a piece of legislation and details the effects the legislative text may have on current law and federal programs. Bill summaries are authored by the Congressional Research Service (CRS) of the Library of Congress. As stated in Public Law 91-510 (2 USC 166 (d)(6)), one of the duties of CRS is "to prepare summaries and digests of bills and resolutions of a public general nature introduced in the Senate or House of Representatives". For more information, refer to the User Guide that accompanies this file.</dc:description> </dublinCore> </billStatus>
{ "content_hash": "11a9e8348c007fd49a8ee2a812776c67", "timestamp": "", "source": "github", "line_count": 246, "max_line_length": 676, "avg_line_length": 37.16260162601626, "alnum_prop": 0.6119011157295996, "repo_name": "peter765/power-polls", "id": "adb0abd004e05d6e322001a843248f2c00e32896", "size": "9142", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "db/bills/hconres/hconres37/fdsys_billstatus.xml", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "58567" }, { "name": "JavaScript", "bytes": "7370" }, { "name": "Python", "bytes": "22988" } ], "symlink_target": "" }
void fmscError(char *); void fmscErrorS(char *, char *); void fmscErrorI(char *, int); void fmscErrorII(char *, int, int); void fmscErrorO(char *, OBJ); void fmscErrorC(char *, CONT); void fmscErrorIIO(char *, int, int, OBJ); OBJ fmscRead(OBJ); OBJ fmscEval(OBJ, OBJ); OBJ evalByteCode(OBJ, int); void fmscPrint(OBJ); void fmscDisplay(OBJ); CONT cp_print(CONT); CONT cp_eval(CONT); CONT cp_read(CONT); CONT cp_repl(CONT); int listLength(OBJ); long long runtime(); OBJ newInteger(long); OBJ newFloat(float); OBJ newDouble(double); OBJ newSymbol(char *); OBJ newString(char *); OBJ newCons(OBJ, OBJ); OBJ newEnvironment(); OBJ newBuiltinFunction(CONTFUNC, int); OBJ newBuiltinSyntax(CONTFUNC); OBJ newUserDefinedFunction(OBJ, OBJ, OBJ, int); OBJ newVector(int); OBJ newByteVector(int); OBJ newExternalStream(FILE *); OBJ newInternalStream(OBJ); OBJ newFraction(OBJ, OBJ); CONT newContinuation(); OBJ makeSymbol(char *, int); OBJ lookupSymbol(char *); void rememberSymbol(OBJ); CONS addLocalBinding(OBJ env, OBJ key, OBJ value); CONS getLocalBindingCell(OBJ env, OBJ key); OBJ getBindingValueOrNULL(OBJ env, OBJ key); OBJ getBindingCell(OBJ env, OBJ key); CONT cp_runtime(CONT); CONT cp_builtin_plus(CONT); CONT cp_builtin_minus(CONT); CONT cp_builtin_times(CONT); CONT cp_builtin_quotient(CONT); CONT cp_builtin_modulo(CONT); CONT cp_builtin_fraction(CONT); CONT cp_builtin_fraction_numerator(CONT); CONT cp_builtin_fraction_denominator(CONT); CONT cp_builtin_int_to_float(CONT); CONT cp_builtin_sum_floats(CONT); CONT cp_builtin_sub_floats(CONT); CONT cp_builtin_mul_floats(CONT); CONT cp_builtin_div_floats(CONT); CONT cp_builtin_cons(CONT); CONT cp_builtin_eq(CONT); CONT cp_builtin_eqv(CONT); CONT cp_builtin_lt(CONT); CONT cp_builtin_car(CONT); CONT cp_builtin_cdr(CONT); CONT cp_builtin_setcar(CONT); CONT cp_builtin_setcdr(CONT); CONT cp_builtin_display(CONT); CONT cp_builtin_print(CONT); /* CONT cp_builtin_makeVector(CONT); TODO */ /* CONT cp_builtin_makeByteVector(CONT); TODO */ /* CONT cp_builtin_vectorSet(CONT); TODO */ /* CONT cp_builtin_vectorRef(CONT); TODO */ /* CONT cp_builtin_vectorLength(CONT); TODO */ /* CONT cp_builtin_functionArgumentList(CONT); TODO */ /* CONT cp_builtin_functionBodyList(CONT); TODO */ /* CONT cp_builtin_functionSetBytecodeAndLiterals(CONT); TODO */ /* CONT cp_builtin_getBindingCell(CONT); TODO */ CONT cp_builtin_load(CONT); CONT cp_builtin_string_append(CONT); /* CONT cp_builtin_symbolToString(CONT); TODO */ CONT cp_builtin_symbolp(CONT); CONT cp_builtin_integerp(CONT); CONT cp_builtin_consp(CONT); CONT cp_builtin_vectorp(CONT); CONT cp_builtin_stringp(CONT); CONT cp_builtin_fractionp(CONT); CONT cp_builtin_floatp(CONT); CONT cp_builtin_doublep(CONT); CONT cp_builtin_quote(CONT); CONT cp_builtin_lambda(CONT); CONT cp_builtin_define(CONT); CONT cp_builtin_if(CONT); CONT cp_builtin_and(CONT); CONT cp_builtin_or(CONT); CONT cp_builtin_cond(CONT); CONT cp_builtin_set(CONT); CONT cp_builtin_begin(CONT); CONT cp_builtin_let(CONT); CONT cp_builtin_random(CONT); void printContinuation(CONT); void printStack(CONT);
{ "content_hash": "8999b018cfbe4c7abf11df17843e83fc", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 64, "avg_line_length": 29.285714285714285, "alnum_prop": 0.7492682926829268, "repo_name": "mhlopko/femtoscheme", "id": "766e003b94f6ca6c7d846696e521c7439a110c54", "size": "3075", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/functionProtos.h", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "120136" }, { "name": "C++", "bytes": "578" }, { "name": "Makefile", "bytes": "1024" }, { "name": "Ruby", "bytes": "3528" }, { "name": "Scheme", "bytes": "62207" }, { "name": "Shell", "bytes": "38" } ], "symlink_target": "" }
package com.cosylab.distsync; import java.rmi.Remote; import java.rmi.RemoteException; /** * DOCUMENT ME! * * @author $Author: dfugate $ * @version $Revision: 1.1 $ */ public interface RemoteConcurrentFactory extends Remote { /** * DOCUMENT ME! * * @param name DOCUMENT ME! * @param parties DOCUMENT ME! * * @return DOCUMENT ME! * * @throws RemoteException DOCUMENT ME! */ public RemoteCyclicBarrier getCyclicBarrier(String name, int parties) throws RemoteException; } /* __oOo__ */
{ "content_hash": "e31e468ceb8986ae29b42fdbbdd34463", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 70, "avg_line_length": 16.64516129032258, "alnum_prop": 0.6821705426356589, "repo_name": "csrg-utfsm/acscb", "id": "1ed15f4e84611e15f355cdb844c02930e0615cdf", "size": "1166", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "Benchmark/components/src/com/cosylab/distsync/RemoteConcurrentFactory.java", "mode": "33188", "license": "mit", "language": [ { "name": "Awk", "bytes": "633" }, { "name": "Batchfile", "bytes": "2346" }, { "name": "C", "bytes": "751150" }, { "name": "C++", "bytes": "7892598" }, { "name": "CSS", "bytes": "21364" }, { "name": "Elixir", "bytes": "906" }, { "name": "Emacs Lisp", "bytes": "1990066" }, { "name": "FreeMarker", "bytes": "7369" }, { "name": "GAP", "bytes": "14867" }, { "name": "Gnuplot", "bytes": "437" }, { "name": "HTML", "bytes": "1857062" }, { "name": "Haskell", "bytes": "764" }, { "name": "Java", "bytes": "13573740" }, { "name": "JavaScript", "bytes": "19058" }, { "name": "Lex", "bytes": "5101" }, { "name": "Makefile", "bytes": "1624406" }, { "name": "Module Management System", "bytes": "4925" }, { "name": "Objective-C", "bytes": "3223" }, { "name": "PLSQL", "bytes": "9496" }, { "name": "Perl", "bytes": "120411" }, { "name": "Python", "bytes": "4191000" }, { "name": "Roff", "bytes": "9920" }, { "name": "Shell", "bytes": "1198375" }, { "name": "Smarty", "bytes": "21615" }, { "name": "Tcl", "bytes": "227078" }, { "name": "XSLT", "bytes": "100454" }, { "name": "Yacc", "bytes": "5006" } ], "symlink_target": "" }
namespace Mileage.Server.Contracts { /// <summary> /// A marker interface for all service singletons. /// </summary> public interface IService { } }
{ "content_hash": "31718a20a0313d36018dd110a48b1ca7", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 54, "avg_line_length": 18.3, "alnum_prop": 0.5846994535519126, "repo_name": "haefele/Mileage", "id": "c7210b85a42abc7f448d5ca5621db1531b0fd5f0", "size": "185", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/03 Server/Mileage.Server.Contracts/IService.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "380006" }, { "name": "PowerShell", "bytes": "2069" } ], "symlink_target": "" }
@interface XMGVideoViewController : UITableViewController @end
{ "content_hash": "19739de7ac7ffa0d9962477baedb2cfe", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 57, "avg_line_length": 21.333333333333332, "alnum_prop": 0.859375, "repo_name": "MichaelPig/ProblemSister", "id": "46c00d0e4b98c093ed5ce69ff2d1a36764a7257e", "size": "239", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "ProblemSister/Classes/Essence-精华/Controller/XMGVideoViewController.h", "mode": "33188", "license": "mit", "language": [ { "name": "Objective-C", "bytes": "76256" }, { "name": "Ruby", "bytes": "375" } ], "symlink_target": "" }
import { EvaluatedArgs } from '../compiled/expressions/args'; import { DOMChanges } from '../dom/helper'; import { DynamicScope } from '../environment'; import { Destroyable } from '@glimmer/util'; export interface ModifierManager<T> { // Create is meant to only produce the state bucket create(element: Element, args: EvaluatedArgs, dynamicScope: DynamicScope, dom: DOMChanges): T; // At initial render, the modifier gets a chance to install itself on the // element it is managing. It can also return a bucket of state that // it could use at update time. From the perspective of Glimmer, this // is an opaque token. install(modifier: T): void; // When the args have changed, the modifier's `update` hook is called // with its state bucket as well as the updated args. update(modifier: T): void; // Convert the opaque token into an object that implements Destroyable. // If it returns null, the modifier will not be destroyed. getDestructor(modifier: T): Destroyable; }
{ "content_hash": "537bffccdc29ae58c60efc8ede88976c", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 96, "avg_line_length": 45.5, "alnum_prop": 0.7282717282717283, "repo_name": "chadhietala/glimmer", "id": "e56f21624300ae81dbe4a43fda6f40eaa73552d6", "size": "1001", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "packages/@glimmer/runtime/lib/modifier/interfaces.ts", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "112613" }, { "name": "JavaScript", "bytes": "12277" }, { "name": "Shell", "bytes": "1812" }, { "name": "TypeScript", "bytes": "940043" } ], "symlink_target": "" }
namespace Claims.Web.Migrations { using System; using System.Data.Entity.Migrations; public partial class CityProperty : DbMigration { public override void Up() { AddColumn("dbo.AspNetUsers", "City", c => c.Int(nullable: false)); } public override void Down() { DropColumn("dbo.AspNetUsers", "City"); } } }
{ "content_hash": "f2deac5d4b5e580f54be0b2a16c8595c", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 78, "avg_line_length": 22.944444444444443, "alnum_prop": 0.5472154963680388, "repo_name": "7ohnn1/MVC_Security_Authorisation", "id": "84818f1c809bf77a99dca8a52b6554f014bd3ab4", "size": "413", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Presentation/Claims.Web/Migrations/201610220741386_CityProperty.cs", "mode": "33188", "license": "mit", "language": [ { "name": "ASP", "bytes": "101" }, { "name": "C#", "bytes": "44486" }, { "name": "CSS", "bytes": "316" }, { "name": "JavaScript", "bytes": "214014" } ], "symlink_target": "" }
require File.expand_path('../boot', __FILE__) require 'rails/all' Bundler.require(*Rails.groups) require "customer_authentify" module Dummy class Application < Rails::Application # Settings in config/environments/* take precedence over those specified here. # Application configuration should go into files in config/initializers # -- all .rb files in that directory are automatically loaded. # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. # config.time_zone = 'Central Time (US & Canada)' # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] # config.i18n.default_locale = :de end end
{ "content_hash": "ab7d4e9d992d1563b6f020c68f5eb39a", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 99, "avg_line_length": 38.82608695652174, "alnum_prop": 0.7110862262038073, "repo_name": "emclab/customer_authentify", "id": "16296d34609681d31624919e3e2a0e3b9a0523a1", "size": "893", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "spec/dummy/config/application.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "1494" }, { "name": "JavaScript", "bytes": "1345" }, { "name": "Ruby", "bytes": "23391" } ], "symlink_target": "" }
namespace CGAL{ namespace internal { template <class K> typename Intersection_traits<K, typename K::Triangle_2, typename K::Iso_rectangle_2>::result_type intersection(const typename K::Triangle_2 &t, const typename K::Iso_rectangle_2 &r, const K& kk) { typedef typename K::FT FT; typedef typename K::Segment_2 Segment; typedef typename K::Triangle_2 Triangle; typedef typename K::Point_2 Point; FT xr1, yr1, xr2, yr2; bool position[3][4] = {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}; bool is_inside[3] = {false, false, false}; //true when a vertex is inside rectangle xr1 = r.xmin(); xr2 = r.xmax(); yr1 = r.ymax(); yr2 = r.ymin(); Point upper_left, lower_right; Point p[3]; //the vertices of triangle upper_left = Point(xr1, yr1); //upper left lower_right = Point(xr2, yr2); //lower right p[0] = t.vertex(0); p[1] = t.vertex(1); p[2] = t.vertex(2); //check the points of the triangle for(int i=0; i<3; i++){ if(!(compare_x(p[i], upper_left) == SMALLER)) if(!(compare_x(p[i], lower_right) == LARGER)) if(!(compare_y(p[i], upper_left) == LARGER)) if(!(compare_y(p[i], lower_right) == SMALLER)) is_inside[i] = true; //the point is inside else position[i][2] = true; //South else position[i][0] = true; //North else { position[i][3] = true; //East if(compare_y(p[i], upper_left) == LARGER) position[i][0] = true; //North else if(compare_y(p[i], lower_right) == SMALLER) position[i][2] = true; //South } else { position[i][1] = true; //West if(compare_y(p[i], upper_left) == LARGER) position[i][0] = true; //North else if(compare_y(p[i], lower_right) == SMALLER) position[i][2] = true; //South } } //test if the triangle is completely to the left, right, below or above the rectangle bool intersection = true; //true if it could be a intersection with the rectangle for(int j=0; j<4; j++) if(position[0][j] && position[1][j] && position[2][j] ){ intersection = false; break; } if(intersection){ Segment s[4]; //the segments that identify the N, W, S, E bool outside = false; bool status_in_list[3] = {false, false, false}; //true if the triangle's points are in the result vector std::list<int> last_intersected; int last_intersected_segment = 5; //could be 0=N, 1=W, 2=S, 3=E last_intersected.push_back(5); int status_intersected[4] = {0, 0, 0, 0}; //the number of intersections for each segment std::vector<Point> result; //the vector containing the result vertices int next; //the index of the next vertex s[0] = Segment(Point(xr2, yr1), Point(xr1, yr1)); //N s[1] = Segment(Point(xr1, yr1), Point(xr1, yr2)); //W s[2] = Segment(Point(xr1, yr2), Point(xr2, yr2)); //S s[3] = Segment(Point(xr2, yr2), Point(xr2, yr1)); //E //assign to p[i] the vertices of the triangle in ccw order if(t.orientation() == CGAL::CLOCKWISE) { p[0] = t.vertex(2); p[2] = t.vertex(0); is_inside[0] = is_inside[2] ^ is_inside[0]; is_inside[2] = is_inside[2] ^ is_inside[0]; is_inside[0] = is_inside[0] ^ is_inside[2]; for(int i=0; i<4; i++){ position[0][i] = position[2][i] ^ position[0][i]; position[2][i] = position[2][i] ^ position[0][i]; position[0][i] = position[0][i] ^ position[2][i]; } } for(int index=0; index<3; index++) //for each vertex { next=(index+1)%3; if(is_inside[index]){ // true if first is inside if(!status_in_list[index]){ //if is not yet in the list result.push_back(p[index]); status_in_list[index] = true; } if(is_inside[next]){ //true if second is inside //add the points in the vector if(!status_in_list[next]){ // if is not yet in the list result.push_back(p[next]); status_in_list[next] = true; } } else { //I'm going out, the second is outside for(int j=0; j<4; j++) // for all directions if(position[next][j]) // if it's a second point direction { //test for intersection typename Intersection_traits<K, Segment, Segment>::result_type v = internal::intersection(Segment(p[index], p[next]), s[j], kk); if(v) { if(const Point *p_obj = intersect_get<Point>(v)) { //intersection found outside = true; result.push_back(*p_obj); //add the intersection point if(last_intersected.back()!=j) last_intersected.push_back(j); status_intersected[j]++; } } } } } else { //the first point is outside for(int j=0; j<4; j++) // for all directions if(position[index][j]) //watch only the first point directions { //test for intersection typename Intersection_traits<K, Segment, Segment>::result_type v = internal::intersection(Segment(p[index], p[next]), s[j], kk); if(v) { if(const Point *p_obj = intersect_get<Point>(v)) { //intersection found outside = false; last_intersected_segment = last_intersected.back(); if(last_intersected_segment != 5 && last_intersected_segment != j && status_intersected[j] == 0){ //add the target of each rectangle segment in the list if(last_intersected_segment < j) while(last_intersected_segment < j){ result.push_back(s[last_intersected_segment].target()); last_intersected_segment++; } else{ while(last_intersected_segment < 4){ result.push_back(s[last_intersected_segment].target()); last_intersected_segment++; } last_intersected_segment = 0; while(last_intersected_segment < j){ result.push_back(s[last_intersected_segment].target()); last_intersected_segment++; } } } result.push_back(*p_obj); //add the intersection point in the list if(last_intersected.back()!=j) last_intersected.push_back(j); status_intersected[j]++; if(!is_inside[next]){ //if the second point is not inside search a second intersection point for(j=0; j<4; j++) // for all directions if(position[next][j]) { //test for intersection typename Intersection_traits<K, Segment, Segment> ::result_type v = internal::intersection(Segment(p[index], p[next]), s[j], kk); if(v) { if(const Point *p_obj = intersect_get<Point>(v)) //found the second intersection { outside = true; result.push_back(*p_obj); if(last_intersected.back()!=j) last_intersected.push_back(j); status_intersected[j]++; } } } }//end if the second point is not inside } } // end v } }//end else (the first point is outside) }//endfor if(outside){ std::list<int>::const_iterator it = last_intersected.begin(); while(*it == 5) it++; last_intersected_segment = *it; int j = last_intersected.back(); if(last_intersected_segment != 5 && last_intersected_segment != j){ //add the target of each rectangle segment in the list if(last_intersected_segment > j) while(last_intersected_segment > j){ result.push_back(s[j].target()); j++; } else{ while(j<4){ result.push_back(s[j].target()); j++; } j = 0; while(j<last_intersected_segment){ result.push_back(s[j].target()); j++; } } } }//end if(outside) //test if were not intersections //between the triangle and the rectangle if(status_intersected[0] == 0 && status_intersected[1] == 0 && status_intersected[2] == 0 && status_intersected[3] == 0) { //should test if the rectangle is inside the triangle if(t.bounded_side(upper_left) == CGAL::ON_BOUNDED_SIDE){ for(int k=0; k<4; k++) result.push_back(s[k].source()); } } //remove duplicated consecutive points typename std::vector<Point>::iterator last = std::unique(result.begin(),result.end()); result.erase(last,result.end()); switch(result.size()){ case 0: return intersection_return<typename K::Intersect_2, Triangle, typename K::Iso_rectangle_2>(); case 1: return intersection_return<typename K::Intersect_2, Triangle, typename K::Iso_rectangle_2>(result[0]); case 2: return intersection_return<typename K::Intersect_2, Triangle, typename K::Iso_rectangle_2>(Segment(result[0], result[1])); case 3: return intersection_return<typename K::Intersect_2, Triangle, typename K::Iso_rectangle_2>(Triangle(result[0], result[1], result[2])); default: return intersection_return<typename K::Intersect_2, Triangle, typename K::Iso_rectangle_2>(result); } }//end if(intersection) return intersection_return<typename K::Intersect_2, Triangle, typename K::Iso_rectangle_2>(); }//end intersection template <class K> typename Intersection_traits<K, typename K::Triangle_2, typename K::Iso_rectangle_2>::result_type inline intersection(const typename K::Iso_rectangle_2 &r, const typename K::Triangle_2 &t, const K& k) { return intersection(t,r,k); } template <class K> bool do_intersect( const typename K::Triangle_2 &tr, const typename K::Iso_rectangle_2 &ir, const K& k) { //1) check if at least one vertex of tr is not outside ir //2) if not, check if at least on vertex of tr is not outside tr typename K::Has_on_unbounded_side_2 unbounded_side=k.has_on_unbounded_side_2_object(); typename K::Construct_vertex_2 vertex=k.construct_vertex_2_object(); for (int i=0;i<3;++i) if ( !unbounded_side( ir,vertex(tr,i) ) ) return true; for (int i=0;i<4;++i) if ( !unbounded_side( tr,vertex(ir,i) ) ) return true; typename K::Construct_segment_2 segment=k.construct_segment_2_object(); for (int i=0;i<3;++i) if ( do_intersect( segment(vertex(tr,i),vertex(tr,(i+1)%3)), ir, k) ) return true; return false; } template <class K> inline bool do_intersect( const typename K::Iso_rectangle_2 &ir, const typename K::Triangle_2 &tr, const K& k) { return do_intersect(tr,ir,k); } } //namespace internal CGAL_INTERSECTION_FUNCTION(Triangle_2, Iso_rectangle_2, 2) CGAL_DO_INTERSECT_FUNCTION(Triangle_2, Iso_rectangle_2, 2) }//end namespace #endif
{ "content_hash": "d4d72ca3934bfc59d2a668cd88299970", "timestamp": "", "source": "github", "line_count": 304, "max_line_length": 144, "avg_line_length": 39.4671052631579, "alnum_prop": 0.5258376396066011, "repo_name": "hlzz/dotfiles", "id": "3dd2a9fb9c55ff565b78b1bc921fa4f1b453fef6", "size": "13133", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "graphics/cgal/Intersections_2/include/CGAL/Triangle_2_Iso_rectangle_2_intersection.h", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "AppleScript", "bytes": "1240" }, { "name": "Arc", "bytes": "38" }, { "name": "Assembly", "bytes": "449468" }, { "name": "Batchfile", "bytes": "16152" }, { "name": "C", "bytes": "102303195" }, { "name": "C++", "bytes": "155056606" }, { "name": "CMake", "bytes": "7200627" }, { "name": "CSS", "bytes": "179330" }, { "name": "Cuda", "bytes": "30026" }, { "name": "D", "bytes": "2152" }, { "name": "Emacs Lisp", "bytes": "14892" }, { "name": "FORTRAN", "bytes": "5276" }, { "name": "Forth", "bytes": "3637" }, { "name": "GAP", "bytes": "14495" }, { "name": "GLSL", "bytes": "438205" }, { "name": "Gnuplot", "bytes": "327" }, { "name": "Groff", "bytes": "518260" }, { "name": "HLSL", "bytes": "965" }, { "name": "HTML", "bytes": "2003175" }, { "name": "Haskell", "bytes": "10370" }, { "name": "IDL", "bytes": "2466" }, { "name": "Java", "bytes": "219109" }, { "name": "JavaScript", "bytes": "1618007" }, { "name": "Lex", "bytes": "119058" }, { "name": "Lua", "bytes": "23167" }, { "name": "M", "bytes": "1080" }, { "name": "M4", "bytes": "292475" }, { "name": "Makefile", "bytes": "7112810" }, { "name": "Matlab", "bytes": "1582" }, { "name": "NSIS", "bytes": "34176" }, { "name": "Objective-C", "bytes": "65312" }, { "name": "Objective-C++", "bytes": "269995" }, { "name": "PAWN", "bytes": "4107117" }, { "name": "PHP", "bytes": "2690" }, { "name": "Pascal", "bytes": "5054" }, { "name": "Perl", "bytes": "485508" }, { "name": "Pike", "bytes": "1338" }, { "name": "Prolog", "bytes": "5284" }, { "name": "Python", "bytes": "16799659" }, { "name": "QMake", "bytes": "89858" }, { "name": "Rebol", "bytes": "291" }, { "name": "Ruby", "bytes": "21590" }, { "name": "Scilab", "bytes": "120244" }, { "name": "Shell", "bytes": "2266191" }, { "name": "Slash", "bytes": "1536" }, { "name": "Smarty", "bytes": "1368" }, { "name": "Swift", "bytes": "331" }, { "name": "Tcl", "bytes": "1911873" }, { "name": "TeX", "bytes": "11981" }, { "name": "Verilog", "bytes": "3893" }, { "name": "VimL", "bytes": "595114" }, { "name": "XSLT", "bytes": "62675" }, { "name": "Yacc", "bytes": "307000" }, { "name": "eC", "bytes": "366863" } ], "symlink_target": "" }
GF_DEFINE_PLATFORM_CTOR(GfSampler) , m_pSampler(nullptr) { } //////////////////////////////////////////////////////////////////////////////// bool GfSampler_Platform::createRHI(const GfRenderContext& kCtxt) { VkSamplerCreateInfo kSamplerInfo{}; kSamplerInfo.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO; kSamplerInfo.flags = 0; kSamplerInfo.magFilter = ConvertTexFilter(m_kBase.m_eMagFilter); kSamplerInfo.minFilter = ConvertTexFilter(m_kBase.m_eMinFilter); kSamplerInfo.mipmapMode = ConvertTexMipMapMode(m_kBase.m_eMipMapMode); kSamplerInfo.addressModeU = ConvertTexAddressMode(m_kBase.m_eAddrU); kSamplerInfo.addressModeV = ConvertTexAddressMode(m_kBase.m_eAddrV); kSamplerInfo.addressModeW = ConvertTexAddressMode(m_kBase.m_eAddrW); kSamplerInfo.mipLodBias = m_kBase.m_fMipLodBias; kSamplerInfo.anisotropyEnable = m_kBase.m_bUseAnisotropy ? 1 : 0; kSamplerInfo.maxAnisotropy = m_kBase.m_fMaxAnisotropy; kSamplerInfo.compareEnable = 0; // TODO: Needed? //kSamplerInfo.compareOp; kSamplerInfo.minLod = m_kBase.m_fMinLod; kSamplerInfo.maxLod = m_kBase.m_fMaxLod; kSamplerInfo.borderColor = VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK; // TODO: Will I use border anytime? return vkCreateSampler(kCtxt.Plat().m_pDevice, &kSamplerInfo, nullptr, &m_pSampler) == VK_SUCCESS; } //////////////////////////////////////////////////////////////////////////////// void GfSampler_Platform::destroyRHI(const GfRenderContext& kCtxt) { if (m_pSampler) { vkDestroySampler(kCtxt.Plat().m_pDevice, m_pSampler, nullptr); m_pSampler = nullptr; } } //////////////////////////////////////////////////////////////////////////////// // EOF
{ "content_hash": "b7d09023f2e12402b9c1a84e589d7021", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 99, "avg_line_length": 38.13953488372093, "alnum_prop": 0.6615853658536586, "repo_name": "alapontgr/Engine", "id": "89371b643caadb495438019c0ea92957690bfb00", "size": "2163", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Engine/Src/Vulkan/GfRender/GraphicResources/GfSampler_Platform.cpp", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "1017" }, { "name": "C", "bytes": "293959" }, { "name": "C++", "bytes": "2490199" }, { "name": "CMake", "bytes": "2703" }, { "name": "Lua", "bytes": "6500" }, { "name": "Objective-C", "bytes": "39974" } ], "symlink_target": "" }
module Shout class Engine < ::Rails::Engine isolate_namespace Shout end end
{ "content_hash": "38f38c0ec07297ae45ca8bb3b869ca07", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 32, "avg_line_length": 16.8, "alnum_prop": 0.7142857142857143, "repo_name": "saxtonhorne/shout", "id": "df1b010f5759f7fa6484abefdec226f55651559c", "size": "84", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/shout/engine.rb", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "1282" }, { "name": "Ruby", "bytes": "18053" } ], "symlink_target": "" }
package dk.itst.oiosaml.common; import java.io.IOException; import java.util.List; import javax.xml.namespace.QName; import org.opensaml.ws.soap.soap11.Envelope; import org.opensaml.ws.soap.soap11.Fault; import org.opensaml.xml.XMLObject; /** * Representation of a SOAP Fault. * * @author recht * */ public class SOAPException extends IOException { private final String response; private Envelope envelope; private Fault fault; public SOAPException(int responseCode, String response) { super("Server returned error response: " + responseCode); this.response = response; try { envelope = (Envelope) SAMLUtil.unmarshallElementFromString(response); } catch (Exception e) { } } /** * Get the SOAP Envelope. * * @return */ public Envelope getEnvelope() { return envelope; } /** * Get the complete response from the server as a string. * */ public String getResponse() { return response; } /** * Get the SOAP Fault object. * * @param name * @return Can return <code>null</code> if the response did not contain a * fault element. */ public Fault getFault(QName name) { if (fault != null) return fault; if (envelope == null) { return null; } List<XMLObject> faults = envelope.getBody().getUnknownXMLObjects(name); if (faults.isEmpty()) { return null; } return (Fault) faults.get(0); } /** * Get the SOAP Fault object by default name * * @return */ public Fault getFault(){ return getFault(Fault.DEFAULT_ELEMENT_NAME); } /** * Set a specific SOAP fault object to SOAPException * * @param aFault */ public void setFault(Fault aFault){ this.fault = aFault; } }
{ "content_hash": "ca894cdde6c3fdf83c077aed631ae45c", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 81, "avg_line_length": 21.633333333333333, "alnum_prop": 0.5855161787365177, "repo_name": "Safewhere/kombit-service-java", "id": "09a108b133134fe8f16bf439f7ac110f2b3832c8", "size": "2816", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "OIOSaml/src/dk/itst/oiosaml/common/SOAPException.java", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "73985" }, { "name": "Java", "bytes": "5965174" } ], "symlink_target": "" }
<?php namespace mageekguy\atoum\tests\units; use mageekguy\atoum ; require_once __DIR__ . '/../runner.php'; class template extends atoum\test { public function test__construct() { $this ->if($this->newTestedInstance) ->then ->string($this->testedInstance->getData())->isEmpty() ->if($this->newTestedInstance($data = uniqid())) ->then ->string($this->testedInstance->getData())->isEqualTo($data) ; } public function test__toString() { $this ->if($this->newTestedInstance) ->then ->string($this->testedInstance->getData())->isEmpty() ->boolean($this->testedInstance->hasChildren())->isFalse() ->variable($this->testedInstance->getId())->isNull() ->variable($this->testedInstance->getTag())->isNull() ->if($this->newTestedInstance($data = uniqid())) ->then ->string($this->testedInstance->getData())->isEqualTo($data) ->boolean($this->testedInstance->hasChildren())->isFalse() ->variable($this->testedInstance->getId())->isNull() ->variable($this->testedInstance->getTag())->isNull() ; } public function test__get() { $this ->if($this->newTestedInstance) ->then ->object($iterator = $this->testedInstance->{uniqid()})->isInstanceOf(atoum\template\iterator::class) ->sizeOf($iterator)->isZero() ->if($this->testedInstance->addChild($childTag = new atoum\template\tag(uniqid()))) ->then ->object($iterator = $this->testedInstance->{$childTag->getTag()})->isInstanceOf(atoum\template\iterator::class) ->sizeOf($iterator)->isEqualTo(1) ->object($iterator->current())->isIdenticalTo($childTag) ->if($this->testedInstance->addChild($otherChildTag = new atoum\template\tag($childTag->getTag()))) ->then ->object($iterator = $this->testedInstance->{$childTag->getTag()})->isInstanceOf(atoum\template\iterator::class) ->sizeOf($iterator)->isEqualTo(2) ->object($iterator->current())->isIdenticalTo($childTag) ->object($iterator->next()->current())->isIdenticalTo($otherChildTag) ->if($this->testedInstance->addChild($anotherChildTag = new atoum\template\tag(uniqid()))) ->then ->object($iterator = $this->testedInstance->{$childTag->getTag()})->isInstanceOf(atoum\template\iterator::class) ->sizeOf($iterator)->isEqualTo(2) ->object($iterator->current())->isIdenticalTo($childTag) ->object($iterator->next()->current())->isIdenticalTo($otherChildTag) ->object($iterator = $this->testedInstance->{$anotherChildTag->getTag()})->isInstanceOf(atoum\template\iterator::class) ->sizeOf($iterator)->isEqualTo(1) ->object($iterator->current())->isIdenticalTo($anotherChildTag) ->if($childTag->addChild($littleChildTag = new atoum\template\tag($childTag->getTag()))) ->then ->object($iterator = $this->testedInstance->{$childTag->getTag()})->isInstanceOf(atoum\template\iterator::class) ->sizeOf($iterator)->isEqualTo(3) ->object($iterator->current())->isIdenticalTo($childTag) ->object($iterator->next()->current())->isIdenticalTo($littleChildTag) ->object($iterator->next()->current())->isIdenticalTo($otherChildTag) ->object($iterator = $this->testedInstance->{$anotherChildTag->getTag()})->isInstanceOf(atoum\template\iterator::class) ->sizeOf($iterator)->isEqualTo(1) ->object($iterator->current())->isIdenticalTo($anotherChildTag) ; } public function test__set() { $this ->if( $this->newTestedInstance, $this->testedInstance ->addChild($tag = new atoum\template\tag(uniqid())) ->{$tag->getTag()} = $data = uniqid() ) ->then ->string($tag->getData())->isEqualTo($data) ->if( $tag->addChild($childTag = new atoum\template\tag($tag->getTag())), $this->testedInstance->{$tag->getTag()} = $data ) ->then ->string($tag->getData())->isEqualTo($data) ->string($childTag->getData())->isEqualTo($data) ->if( $tag->addChild($otherChildTag = new atoum\template\tag(uniqid())), $this->testedInstance->{$otherChildTag->getTag()} = $otherData = uniqid() ) ->then ->string($tag->getData())->isEqualTo($data) ->string($childTag->getData())->isEqualTo($data) ->string($otherChildTag->getData())->isEqualTo($otherData) ; } public function test__isset() { $this ->if($this->newTestedInstance) ->then ->boolean(isset($this->testedInstance->{uniqid()}))->isFalse() ->if($this->testedInstance->addChild($childTag = new atoum\template\tag(uniqid()))) ->then ->boolean(isset($this->testedInstance->{uniqid()}))->isFalse() ->boolean(isset($this->testedInstance->{$childTag->getTag()}))->isTrue() ->if($childTag->addChild($otherChildTag = new atoum\template\tag(uniqid()))) ->then ->boolean(isset($this->testedInstance->{uniqid()}))->isFalse() ->boolean(isset($this->testedInstance->{$childTag->getTag()}))->isTrue() ->boolean(isset($this->testedInstance->{$otherChildTag->getTag()}))->isTrue() ->if($childTag->addChild($littleChildTag = new atoum\template\tag(uniqid()))) ->then ->boolean(isset($this->testedInstance->{uniqid()}))->isFalse() ->boolean(isset($this->testedInstance->{$childTag->getTag()}))->isTrue() ->boolean(isset($this->testedInstance->{$otherChildTag->getTag()}))->isTrue() ->boolean(isset($this->testedInstance->{$littleChildTag->getTag()}))->isTrue() ; } public function test__unset() { $this ->if( $template = $this->newTestedInstance, $this->testedInstance->addChild($childTag = new atoum\template\tag(uniqid())) ) ->then ->boolean(isset($this->testedInstance->{$childTag->getTag()}))->isTrue() ->string($childTag->getData())->isEmpty() ->when(function () use ($template, $childTag) { unset($template->{$childTag->getTag()}); }) ->then ->boolean(isset($this->testedInstance->{$childTag->getTag()}))->isTrue() ->string($childTag->getData())->isEmpty() ->if($this->testedInstance->{$childTag->getTag()} = uniqid()) ->then ->boolean(isset($this->testedInstance->{$childTag->getTag()}))->isTrue() ->string($childTag->getData())->isNotEmpty() ->when(function () use ($template, $childTag) { unset($template->{$childTag->getTag()}); }) ->then ->boolean(isset($this->testedInstance->{$childTag->getTag()}))->isTrue() ->string($childTag->getData())->isEmpty() ->if($this->testedInstance->addChild($otherChildTag = new atoum\template\tag(uniqid()))) ->then ->boolean(isset($this->testedInstance->{$childTag->getTag()}))->isTrue() ->string($childTag->getData())->isEmpty() ->boolean(isset($this->testedInstance->{$otherChildTag->getTag()}))->isTrue() ->string($otherChildTag->getData())->isEmpty() ->when(function () use ($template, $childTag, $otherChildTag) { unset($template->{$childTag->getTag()}); unset($template->{$otherChildTag->getTag()}); }) ->then ->boolean(isset($this->testedInstance->{$childTag->getTag()}))->isTrue() ->string($childTag->getData())->isEmpty() ->boolean(isset($this->testedInstance->{$otherChildTag->getTag()}))->isTrue() ->string($otherChildTag->getData())->isEmpty() ->if( $this->testedInstance->{$childTag->getTag()} = uniqid(), $this->testedInstance->{$otherChildTag->getTag()} = uniqid() ) ->then ->boolean(isset($this->testedInstance->{$childTag->getTag()}))->isTrue() ->string($childTag->getData())->isNotEmpty() ->boolean(isset($this->testedInstance->{$otherChildTag->getTag()}))->isTrue() ->string($otherChildTag->getData())->isNotEmpty() ->when(function () use ($template, $childTag) { unset($template->{$childTag->getTag()}); }) ->then ->boolean(isset($this->testedInstance->{$childTag->getTag()}))->isTrue() ->string($childTag->getData())->isEmpty() ->boolean(isset($this->testedInstance->{$otherChildTag->getTag()}))->isTrue() ->string($otherChildTag->getData())->isNotEmpty() ->when(function () use ($template, $otherChildTag) { unset($template->{$otherChildTag->getTag()}); }) ->then ->boolean(isset($this->testedInstance->{$childTag->getTag()}))->isTrue() ->string($childTag->getData())->isEmpty() ->boolean(isset($this->testedInstance->{$otherChildTag->getTag()}))->isTrue() ->string($otherChildTag->getData())->isEmpty() ->if($childTag->addChild($littleChildTag = new atoum\template\tag(uniqid()))) ->then ->boolean(isset($this->testedInstance->{$childTag->getTag()}))->isTrue() ->string($childTag->getData())->isEmpty() ->boolean(isset($this->testedInstance->{$otherChildTag->getTag()}))->isTrue() ->string($otherChildTag->getData())->isEmpty() ->boolean(isset($this->testedInstance->{$littleChildTag->getTag()}))->isTrue() ->string($littleChildTag->getData())->isEmpty() ->if( $this->testedInstance->{$childTag->getTag()} = uniqid(), $this->testedInstance->{$otherChildTag->getTag()} = uniqid(), $this->testedInstance->{$littleChildTag->getTag()} = uniqid() ) ->then ->boolean(isset($this->testedInstance->{$childTag->getTag()}))->isTrue() ->string($childTag->getData())->isNotEmpty() ->boolean(isset($this->testedInstance->{$otherChildTag->getTag()}))->isTrue() ->string($otherChildTag->getData())->isNotEmpty() ->boolean(isset($this->testedInstance->{$littleChildTag->getTag()}))->isTrue() ->string($littleChildTag->getData())->isNotEmpty() ->when(function () use ($template, $childTag) { unset($template->{$childTag->getTag()}); }) ->then ->boolean(isset($this->testedInstance->{$childTag->getTag()}))->isTrue() ->string($childTag->getData())->isEmpty() ->boolean(isset($this->testedInstance->{$otherChildTag->getTag()}))->isTrue() ->string($otherChildTag->getData())->isNotEmpty() ->boolean(isset($this->testedInstance->{$littleChildTag->getTag()}))->isTrue() ->string($littleChildTag->getData())->isNotEmpty() ->when(function () use ($template, $otherChildTag) { unset($template->{$otherChildTag->getTag()}); }) ->then ->boolean(isset($this->testedInstance->{$childTag->getTag()}))->isTrue() ->string($childTag->getData())->isEmpty() ->boolean(isset($this->testedInstance->{$otherChildTag->getTag()}))->isTrue() ->string($otherChildTag->getData())->isEmpty() ->boolean(isset($this->testedInstance->{$littleChildTag->getTag()}))->isTrue() ->string($littleChildTag->getData())->isNotEmpty() ->when(function () use ($template, $littleChildTag) { unset($template->{$littleChildTag->getTag()}); }) ->then ->boolean(isset($this->testedInstance->{$childTag->getTag()}))->isTrue() ->string($childTag->getData())->isEmpty() ->boolean(isset($this->testedInstance->{$otherChildTag->getTag()}))->isTrue() ->string($otherChildTag->getData())->isEmpty() ->boolean(isset($this->testedInstance->{$littleChildTag->getTag()}))->isTrue() ->string($littleChildTag->getData())->isEmpty() ; } public function testGetRoot() { $this ->if($this->newTestedInstance) ->then ->object($this->testedInstance->getRoot())->isTestedInstance ->if($this->testedInstance->addChild($childTemplate = new atoum\template())) ->then ->object($this->testedInstance->getRoot())->isTestedInstance ->object($childTemplate->getRoot())->isTestedInstance ->if($childTemplate->addChild($littleChildTemplate = new atoum\template())) ->then ->object($this->testedInstance->getRoot())->isTestedInstance ->object($childTemplate->getRoot())->isTestedInstance ->object($littleChildTemplate->getRoot())->isTestedInstance ; } public function testGetParent() { $this ->if($this->newTestedInstance) ->then ->variable($this->testedInstance->getParent())->isNull() ->if($this->testedInstance->addChild($childTemplate = new atoum\template())) ->then ->variable($this->testedInstance->getParent())->isNull() ->object($childTemplate->getParent())->isTestedInstance ->if($childTemplate->addChild($littleChildTemplate = new atoum\template())) ->then ->variable($this->testedInstance->getParent())->isNull() ->object($childTemplate->getParent())->isTestedInstance ->object($littleChildTemplate->getParent())->isIdenticalTo($childTemplate) ; } public function testParentIsSet() { $this ->if($this->newTestedInstance) ->then ->boolean($this->testedInstance->parentIsSet())->isFalse() ->if($childTemplate = new atoum\template()) ->then ->boolean($this->testedInstance->parentIsSet())->isFalse() ->boolean($childTemplate->parentIsSet())->isFalse() ->if($this->testedInstance->addChild($childTemplate)) ->then ->boolean($this->testedInstance->parentIsSet())->isFalse() ->boolean($childTemplate->parentIsSet())->isTrue() ->if($littleChildTemplate = new atoum\template()) ->then ->boolean($this->testedInstance->parentIsSet())->isFalse() ->boolean($childTemplate->parentIsSet())->isTrue() ->boolean($littleChildTemplate->parentIsSet())->isFalse() ->if($childTemplate->addChild($littleChildTemplate)) ->then ->boolean($this->testedInstance->parentIsSet())->isFalse() ->boolean($childTemplate->parentIsSet())->isTrue() ->boolean($littleChildTemplate->parentIsSet())->isTrue() ; } public function testUnsetParent() { $this ->if($this->newTestedInstance) ->then ->boolean($this->testedInstance->parentIsSet())->isFalse() ->object($this->testedInstance->unsetParent())->isTestedInstance ->boolean($this->testedInstance->parentIsSet())->isFalse() ->if($this->testedInstance->addChild($childTemplate = new atoum\template())) ->then ->boolean($this->testedInstance->parentIsSet())->isFalse() ->boolean($childTemplate->parentIsSet())->isTrue() ->object($this->testedInstance->unsetParent())->isTestedInstance ->object($childTemplate->unsetParent())->isIdenticalTo($childTemplate) ->boolean($this->testedInstance->parentIsSet())->isFalse() ->boolean($childTemplate->parentIsSet())->isFalse() ; } public function testSetParent() { $this ->if($this->newTestedInstance) ->then ->boolean($this->testedInstance->parentIsSet())->isFalse() ->object($this->testedInstance->setParent(new atoum\template()))->isTestedInstance ->boolean($this->testedInstance->parentIsSet())->isTrue() ; } public function testGetData() { $this ->if($this->newTestedInstance) ->then ->string($this->testedInstance->getData())->isEmpty() ->if($this->newTestedInstance($data = uniqid())) ->then ->string($this->testedInstance->getData())->isEqualTo($data) ->if( $this->newTestedInstance, $this->testedInstance->setData($data = uniqid()) ) ->then ->string($this->testedInstance->getData())->isEqualTo($data) ->if($this->testedInstance->addChild(new atoum\template($otherData = uniqid()))) ->then ->string($this->testedInstance->getData())->isEqualTo($data) ->if($this->testedInstance->build()) ->then ->string($this->testedInstance->getData())->isEqualTo($data . $otherData) ; } public function testSetData() { $this ->if($this->newTestedInstance) ->then ->object($this->testedInstance->setData($data = uniqid()))->isTestedInstance ->string($this->testedInstance->getData())->isEqualTo($data) ; } public function testAddData() { $this ->if($this->newTestedInstance) ->then ->object($this->testedInstance->addData($data = uniqid()))->isTestedInstance ->string($this->testedInstance->getData())->isEqualTo($data) ->object($this->testedInstance->addData($data))->isTestedInstance ->string($this->testedInstance->getData())->isEqualTo($data . $data) ->object($this->testedInstance->addData($otherData = uniqid()))->isTestedInstance ->string($this->testedInstance->getData())->isEqualTo($data . $data . $otherData) ; } public function testResetData() { $this ->if($this->newTestedInstance) ->then ->string($this->testedInstance->getData())->isEmpty() ->object($this->testedInstance->resetData())->isTestedInstance ->string($this->testedInstance->getData())->isEmpty() ->if($this->newTestedInstance($data = uniqid())) ->then ->string($this->testedInstance->getData())->isEqualTo($data) ->object($this->testedInstance->resetData())->isTestedInstance ->string($this->testedInstance->getData())->isEmpty() ; } public function testGetId() { $this ->if($this->newTestedInstance) ->then ->variable($this->testedInstance->getId())->isNull() ; } public function testIsRoot() { $this ->if($this->newTestedInstance) ->then ->boolean($this->testedInstance->isRoot())->isTrue() ; } public function testIsChild() { $this ->if( $this->newTestedInstance, $childTemplate = new atoum\template() ) ->then ->boolean($this->testedInstance->isChild($childTemplate))->isFalse() ->if($this->testedInstance->addChild($childTemplate)) ->then ->boolean($this->testedInstance->isChild($childTemplate))->isTrue() ; } public function testGetTag() { $this ->if($this->newTestedInstance) ->then ->variable($this->testedInstance->getTag())->isNull() ; } public function testGetChildren() { $this ->if($this->newTestedInstance) ->then ->array($this->testedInstance->getChildren())->isEmpty() ->if($this->testedInstance->addChild($childTemplate = new atoum\template())) ->then ->array($this->testedInstance->getChildren())->isIdenticalTo([$childTemplate]) ->if($this->testedInstance->addChild($otherChildTemplate = new atoum\template())) ->then ->array($this->testedInstance->getChildren())->isIdenticalTo([$childTemplate, $otherChildTemplate]) ->if($childTemplate->addChild($littleChildTemplate = new atoum\template())) ->then ->array($this->testedInstance->getChildren())->isIdenticalTo([$childTemplate, $otherChildTemplate]) ; } public function testAddChild() { $this ->if($this->newTestedInstance) ->then ->boolean($this->testedInstance->hasChildren())->isFalse() ->object($this->testedInstance->addChild($childTemplate = new atoum\template()))->isTestedInstance ->object($childTemplate->getParent())->isTestedInstance ->array($this->testedInstance->getChildren())->isIdenticalTo([$childTemplate]) ->object($this->testedInstance->addChild($childTemplate))->isTestedInstance ->object($childTemplate->getParent())->isTestedInstance ->array($this->testedInstance->getChildren())->isIdenticalTo([$childTemplate]) ->if( $otherTemplate = new atoum\template(), $otherTemplate->addChild($otherChildTemplate = new atoum\template()) ) ->then ->array($otherTemplate->getChildren())->isIdenticalTo([$otherChildTemplate]) ->object($otherChildTemplate->getParent())->isIdenticalTo($otherTemplate) ->object($this->testedInstance->addChild($otherChildTemplate))->isTestedInstance ->array($otherTemplate->getChildren())->isEmpty() ->object($otherChildTemplate->getParent())->isTestedInstance ->array($this->testedInstance->getChildren())->isIdenticalTo([$childTemplate, $otherChildTemplate]) ->if( $this->newTestedInstance, $templateWithId = new atoum\template\tag(uniqid()), $templateWithId->setId($id = uniqid()), $templateWithSameId = clone $templateWithId ) ->then ->boolean($this->testedInstance->hasChildren())->isFalse() ->object($this->testedInstance->addChild($templateWithId))->isTestedInstance ->array($this->testedInstance->getChildren())->isIdenticalTo([$templateWithId]) ->object($this->testedInstance->addChild($templateWithId))->isTestedInstance ->array($this->testedInstance->getChildren())->isIdenticalTo([$templateWithId]) ->exception(function () use ($templateWithSameId) { $this->testedInstance->addChild($templateWithSameId); }) ->isInstanceOf(atoum\exceptions\runtime::class) ->hasMessage('Id \'' . $id . '\' is already defined') ; } public function testDeleteChild() { $this ->if( $this->newTestedInstance, $this->testedInstance->addChild($childTemplate = new atoum\template()) ) ->then ->object($childTemplate->getParent())->isTestedInstance ->array($this->testedInstance->getChildren())->isIdenticalTo([$childTemplate]) ->object($this->testedInstance->deleteChild($childTemplate))->isTestedInstance ->variable($childTemplate->getParent())->isNull() ->array($this->testedInstance->getChildren())->isEmpty() ; } public function testHasChildren() { $this ->if($this->newTestedInstance) ->then ->boolean($this->testedInstance->hasChildren())->isFalse() ->if($this->testedInstance->addChild($childTemplate = new atoum\template())) ->then ->boolean($this->testedInstance->hasChildren())->isTrue() ->if($this->testedInstance->deleteChild($childTemplate)) ->then ->boolean($this->testedInstance->hasChildren())->isFalse() ; } public function testGetByTag() { $this ->if($this->newTestedInstance) ->then ->object($iterator = $this->testedInstance->getByTag(uniqid()))->isInstanceOf(atoum\template\iterator::class) ->sizeOf($iterator)->isZero() ->if($this->testedInstance->addChild($tag = new atoum\template\tag(uniqid()))) ->then ->object($iterator = $this->testedInstance->getByTag(uniqid()))->isInstanceOf(atoum\template\iterator::class) ->sizeOf($iterator)->isZero() ->object($iterator = $this->testedInstance->getByTag($tag->getTag()))->isInstanceOf(atoum\template\iterator::class) ->sizeOf($iterator)->isEqualTo(1) ->object($iterator->current())->isIdenticalTo($tag) ->if($this->testedInstance->addChild($otherTag = new atoum\template\tag($tag->getTag()))) ->then ->object($iterator = $this->testedInstance->getByTag(uniqid()))->isInstanceOf(atoum\template\iterator::class) ->sizeOf($iterator)->isZero() ->object($iterator = $this->testedInstance->getByTag($tag->getTag()))->isInstanceOf(atoum\template\iterator::class) ->sizeOf($iterator)->isEqualTo(2) ->object($iterator->current())->isIdenticalTo($tag) ->object($iterator->next()->current())->isIdenticalTo($otherTag) ->if($tag->addChild($childTag = new atoum\template\tag($tag->getTag()))) ->then ->object($iterator = $this->testedInstance->getByTag(uniqid()))->isInstanceOf(atoum\template\iterator::class) ->sizeOf($iterator)->isZero() ->object($iterator = $this->testedInstance->getByTag($tag->getTag()))->isInstanceOf(atoum\template\iterator::class) ->sizeOf($iterator)->isEqualTo(3) ->object($iterator->current())->isIdenticalTo($tag) ->object($iterator->next()->current())->isIdenticalTo($childTag) ->object($iterator->next()->current())->isIdenticalTo($otherTag) ; } public function testGetById() { $this ->if($this->newTestedInstance) ->then ->variable($this->testedInstance->getById(uniqid()))->isNull() ->if( $tag = new atoum\template\tag(uniqid()), $this->testedInstance->addChild($tag->setId($id = uniqid())) ) ->then ->variable($this->testedInstance->getById(uniqid()))->isNull() ->object($this->testedInstance->getById($id))->isIdenticalTo($tag) ->if( $childTag = new atoum\template\tag(uniqid()), $tag->addChild($childTag->setId($childId = uniqid())) ) ->then ->variable($this->testedInstance->getById(uniqid()))->isNull() ->object($this->testedInstance->getById($id))->isIdenticalTo($tag) ->object($tag->getById($id))->isIdenticalTo($tag) ->object($this->testedInstance->getById($childId))->isIdenticalTo($childTag) ->object($tag->getById($childId))->isIdenticalTo($childTag) ->object($childTag->getById($childId))->isIdenticalTo($childTag) ->variable($childTag->getById($id, false))->isNull() ; } public function testBuild() { $this ->if($this->newTestedInstance) ->then ->string($this->testedInstance->getData())->isEmpty() ->boolean($this->testedInstance->hasChildren())->isFalse() ->object($this->testedInstance->build())->isTestedInstance ->string($this->testedInstance->getData())->isEmpty() ->if($this->newTestedInstance($data = uniqid())) ->then ->string($this->testedInstance->getData())->isEqualTo($data) ->boolean($this->testedInstance->hasChildren())->isFalse() ->object($this->testedInstance->build())->isTestedInstance ->string($this->testedInstance->getData())->isEqualTo($data) ->object($this->testedInstance->build())->isTestedInstance ->string($this->testedInstance->getData())->isEqualTo($data) ->if($this->testedInstance->addChild($childTemplate = new atoum\template($childData = uniqid()))) ->then ->string($this->testedInstance->getData())->isEqualTo($data) ->string($childTemplate->getData())->isEqualTo($childData) ->array($this->testedInstance->getChildren())->isIdenticalTo([$childTemplate]) ->object($this->testedInstance->build())->isTestedInstance ->string($this->testedInstance->getData())->isEqualTo($data . $childData) ->string($childTemplate->getData())->isEqualTo($childData) ->object($this->testedInstance->build())->isTestedInstance ->string($this->testedInstance->getData())->isEqualTo($data . $childData . $childData) ; } public function testGetChild() { $this ->if($this->newTestedInstance) ->then ->variable($this->testedInstance->getChild(0))->isNull() ->variable($this->testedInstance->getChild(rand(1, PHP_INT_MAX)))->isNull() ->variable($this->testedInstance->getChild(- rand(1, PHP_INT_MAX)))->isNull() ->if($this->testedInstance->addChild($childTemplate = new atoum\template())) ->then ->variable($this->testedInstance->getChild(0))->isIdenticalTo($childTemplate) ->variable($this->testedInstance->getChild(rand(1, PHP_INT_MAX)))->isNull() ->variable($this->testedInstance->getChild(- rand(1, PHP_INT_MAX)))->isNull() ; } }
{ "content_hash": "f803b1b96c3ea0139715d6ba6ac51d51", "timestamp": "", "source": "github", "line_count": 652, "max_line_length": 135, "avg_line_length": 48.56441717791411, "alnum_prop": 0.542066700353714, "repo_name": "allblue-pl-dev/php_espada_ecore", "id": "24929d7f1d6693bf3341b098d06046f90a5c8e12", "size": "31664", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "PDF/3rdparty/PDFParser/vendor/atoum/atoum/tests/units/classes/template.php", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "4825" }, { "name": "Hack", "bytes": "1111" }, { "name": "JavaScript", "bytes": "13160" }, { "name": "Less", "bytes": "15655" }, { "name": "PHP", "bytes": "236459" } ], "symlink_target": "" }
pngcheckr ========= A wrapper around the pngcheck library allowing you to check folders recursively. Note: to download the required pngcheck utility, you can use homebrew ("brew install") or probably another package manager like MacPorts. The pngcheck utility's repo is available at http://sourceforge.net/projects/png-mng/files/pngcheck/2.3.0/
{ "content_hash": "f7187dc85d86a003253509c2189a6e4b", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 137, "avg_line_length": 49.57142857142857, "alnum_prop": 0.7838616714697406, "repo_name": "m3-group/pngcheckr", "id": "f665bb074742cfb697df13148f16f031f7a4ed57", "size": "347", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "Shell", "bytes": "956" } ], "symlink_target": "" }
digicode ======== A little `Zepto/jQuery` plugin to create an iPad or Smartphone digicode in a Webview. ## Features - iPad passcode design - Displays a progress as keys are pressed - Displays a digicode - Handles tap/click events on numbers - When 6 digits are input it sends it's data to an API. - When a delay has passed, the input is reset and you can re-enter your 6 digits all over again. ## Usage - Get Zepto or jQuery. - Get the `js/digicode.js` file. ```javascript $(function() { $("#digicode li").digicode({ api: 'yourapiendpoint', resetDelay: 10, eventType: 'click tap', inputDisplay: '#digicode .password li' // If you want the password to display }); }); ```
{ "content_hash": "886ddd3b99c64f34554b7466ed8959b6", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 96, "avg_line_length": 23.9, "alnum_prop": 0.6694560669456067, "repo_name": "gabriel-dehan/digicode", "id": "c732d11a8a916ab6fe43cfef3d82b3bba8c37072", "size": "717", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "2282" }, { "name": "JavaScript", "bytes": "2197" } ], "symlink_target": "" }
using namespace std::chrono; SCENARIO("should not emit timestamped items if the source never emits any items", "[timestamp][operators]"){ GIVEN("a source"){ typedef rxsc::detail::test_type::clock_type::time_point time_point; auto sc = rxsc::make_test(); auto w = sc.create_worker(); const rxsc::test::messages<int> on; auto xs = sc.make_hot_observable({ on.next(150, 1) }); WHEN("timestamp operator is invoked"){ auto res = w.start( [xs]() { return xs | rxo::timestamp(); } ); THEN("the output is empty"){ auto required = std::vector<rxsc::test::messages<std::pair<int, time_point>>::recorded_type>(); auto actual = res.get_observer().messages(); REQUIRE(required == actual); } THEN("there was 1 subscription/unsubscription to the source"){ auto required = rxu::to_vector({ on.subscribe(200, 1000) }); auto actual = xs.subscriptions(); REQUIRE(required == actual); } } } } SCENARIO("should not emit timestamped items if the source observable is empty", "[timestamp][operators]"){ GIVEN("a source"){ typedef rxsc::detail::test_type::clock_type::time_point time_point; auto sc = rxsc::make_test(); auto so = rx::synchronize_in_one_worker(sc); auto w = sc.create_worker(); const rxsc::test::messages<int> on; const rxsc::test::messages<std::pair<int, time_point>> on_timestamp; auto xs = sc.make_hot_observable({ on.next(150, 1), on.completed(250) }); WHEN("timestamp operator is invoked"){ auto res = w.start( [so, xs]() { return xs.timestamp(); } ); THEN("the output only contains complete message"){ auto required = rxu::to_vector({ on_timestamp.completed(250) }); auto actual = res.get_observer().messages(); REQUIRE(required == actual); } THEN("there was 1 subscription/unsubscription to the source"){ auto required = rxu::to_vector({ on.subscribe(200, 250) }); auto actual = xs.subscriptions(); REQUIRE(required == actual); } } } } SCENARIO("should emit timestamped items for every item in the source observable", "[timestamp][operators]"){ GIVEN("a source"){ typedef rxsc::detail::test_type::clock_type clock_type; typedef clock_type::time_point time_point; auto sc = rxsc::make_test(); auto so = rx::synchronize_in_one_worker(sc); auto w = sc.create_worker(); const rxsc::test::messages<int> on; const rxsc::test::messages<std::pair<int, time_point>> on_timestamp; auto xs = sc.make_hot_observable({ on.next(150, 1), on.next(210, 2), on.next(240, 3), on.completed(250) }); WHEN("timestamp operator is invoked"){ auto res = w.start( [so, xs]() { return xs.timestamp(so); } ); THEN("the output contains the emitted items while subscribed"){ auto required = rxu::to_vector({ on_timestamp.next(210, std::make_pair(2, clock_type::time_point(milliseconds(210)))), on_timestamp.next(240, std::make_pair(3, clock_type::time_point(milliseconds(240)))), on_timestamp.completed(250) }); auto actual = res.get_observer().messages(); REQUIRE(required == actual); } THEN("there was 1 subscription/unsubscription to the source"){ auto required = rxu::to_vector({ on.subscribe(200, 250) }); auto actual = xs.subscriptions(); REQUIRE(required == actual); } } } } SCENARIO("should emit timestamped items and an error if there is an error", "[timestamp][operators]"){ GIVEN("a source"){ typedef rxsc::detail::test_type::clock_type clock_type; typedef clock_type::time_point time_point; auto sc = rxsc::make_test(); auto so = rx::synchronize_in_one_worker(sc); auto w = sc.create_worker(); const rxsc::test::messages<int> on; const rxsc::test::messages<std::pair<int, time_point>> on_timestamp; std::runtime_error ex("on_error from source"); auto xs = sc.make_hot_observable({ on.next(150, 1), on.next(210, 2), on.next(240, 3), on.error(250, ex) }); WHEN("timestamp operator is invoked"){ auto res = w.start( [so, xs]() { return xs.timestamp(so); } ); THEN("the output contains emitted items and an error"){ auto required = rxu::to_vector({ on_timestamp.next(210, std::make_pair(2, clock_type::time_point(milliseconds(210)))), on_timestamp.next(240, std::make_pair(3, clock_type::time_point(milliseconds(240)))), on_timestamp.error(250, ex) }); auto actual = res.get_observer().messages(); REQUIRE(required == actual); } THEN("there was 1 subscription/unsubscription to the source"){ auto required = rxu::to_vector({ on.subscribe(200, 250) }); auto actual = xs.subscriptions(); REQUIRE(required == actual); } } } } SCENARIO("timestamp doesn't provide copies", "[timestamp][operators][copies]"){ GIVEN("observable and subscriber") { typedef rxsc::detail::test_type::clock_type clock_type; typedef clock_type::time_point time_point; auto empty_on_next = [](std::pair<copy_verifier, time_point>) {}; auto sub = rx::make_observer<std::pair<copy_verifier, time_point>>(empty_on_next); copy_verifier verifier{}; auto obs = verifier.get_observable().timestamp(); WHEN("subscribe") { obs.subscribe(sub); THEN("no extra copies") { // 1 copy to pair REQUIRE(verifier.get_copy_count() == 1); // 1 move pair to final lambda REQUIRE(verifier.get_move_count() == 1); } } } } SCENARIO("timestamp doesn't provide copies for move", "[timestamp][operators][copies]"){ GIVEN("observable and subscriber") { typedef rxsc::detail::test_type::clock_type clock_type; typedef clock_type::time_point time_point; auto empty_on_next = [](std::pair<copy_verifier, time_point>) {}; auto sub = rx::make_observer<std::pair<copy_verifier, time_point>>(empty_on_next); copy_verifier verifier{}; auto obs = verifier.get_observable_for_move().timestamp(); WHEN("subscribe") { obs.subscribe(sub); THEN("no extra copies") { REQUIRE(verifier.get_copy_count() == 0); // 1 move to pair + 1 move of pair to final lambda REQUIRE(verifier.get_move_count() == 2); } } } }
{ "content_hash": "7b40e5de59c87ca78c4b433e6fca11fb", "timestamp": "", "source": "github", "line_count": 228, "max_line_length": 111, "avg_line_length": 34.35087719298246, "alnum_prop": 0.5076608784473953, "repo_name": "ReactiveX/RxCpp", "id": "26bd45721e21a0291206ad6f00ee4bf808224ca2", "size": "7898", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "Rx/v2/test/operators/timestamp.cpp", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C++", "bytes": "2174220" }, { "name": "CMake", "bytes": "34374" }, { "name": "HTML", "bytes": "1126" }, { "name": "Makefile", "bytes": "579" }, { "name": "Shell", "bytes": "1901" } ], "symlink_target": "" }
package org.gradle.test.performance.mediummonolithicjavaproject.p280; import org.junit.Test; import static org.junit.Assert.*; public class Test5614 { Production5614 objectUnderTest = new Production5614(); @Test public void testProperty0() { String value = "value"; objectUnderTest.setProperty0(value); assertEquals(value, objectUnderTest.getProperty0()); } @Test public void testProperty1() { String value = "value"; objectUnderTest.setProperty1(value); assertEquals(value, objectUnderTest.getProperty1()); } @Test public void testProperty2() { String value = "value"; objectUnderTest.setProperty2(value); assertEquals(value, objectUnderTest.getProperty2()); } @Test public void testProperty3() { String value = "value"; objectUnderTest.setProperty3(value); assertEquals(value, objectUnderTest.getProperty3()); } @Test public void testProperty4() { String value = "value"; objectUnderTest.setProperty4(value); assertEquals(value, objectUnderTest.getProperty4()); } @Test public void testProperty5() { String value = "value"; objectUnderTest.setProperty5(value); assertEquals(value, objectUnderTest.getProperty5()); } @Test public void testProperty6() { String value = "value"; objectUnderTest.setProperty6(value); assertEquals(value, objectUnderTest.getProperty6()); } @Test public void testProperty7() { String value = "value"; objectUnderTest.setProperty7(value); assertEquals(value, objectUnderTest.getProperty7()); } @Test public void testProperty8() { String value = "value"; objectUnderTest.setProperty8(value); assertEquals(value, objectUnderTest.getProperty8()); } @Test public void testProperty9() { String value = "value"; objectUnderTest.setProperty9(value); assertEquals(value, objectUnderTest.getProperty9()); } }
{ "content_hash": "ea09f216be7c2f8b99d42d83a4879898", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 69, "avg_line_length": 26.72151898734177, "alnum_prop": 0.6447181430601611, "repo_name": "oehme/analysing-gradle-performance", "id": "49889d401596cd5dcf54a0db8c13a3f51c5f9e78", "size": "2111", "binary": false, "copies": "1", "ref": "refs/heads/before", "path": "my-app/src/test/java/org/gradle/test/performance/mediummonolithicjavaproject/p280/Test5614.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "40770723" } ], "symlink_target": "" }
<!DOCTYPE html> <html> <head> <title>submergence:Action:Configuration#context~summary documentation</title> <link rel="stylesheet" type="text/css" href="../../../../../../../../../../index.css" /> <link rel="stylesheet" type="text/css" href="../../../../../../../../../../highlight.css" /> <script type="text/javascript" src="../../../../../../../../../../index.js"></script> </head> <body class="spare" id="component_1037"> <div id="outer"> <div id="header"> <a class="ctype" href="../../../../../../../../../../index.html">spare</a> <span></span> <span class="breadcrumbs"> <span class="delimiter">:</span><a href="../../../../../../../../index.html" class="breadcrumb module">submergence</a><span class="delimiter">.</span><a href="../../../../../../index.html" class="breadcrumb interface">Action</a><span class="delimiter">.</span><a href="../../../../index.html" class="breadcrumb class">Configuration</a><span class="delimiter">#</span><a href="../../index.html" class="breadcrumb member">context</a><span class="delimiter">~</span><a href="index.html" class="breadcrumb spare">summary</a> </span> </div> <div id="content"> <!-- basic document info --> <div id="details"> <div class="markdown"><p>When generating html with a template but never when generating a JSON response, <a href="javascript:return false;"><code>response content</code></a> is non-destructively deep-merged over this Object. To put it another way, <code>context</code> sets default content for html pages.</p> </div> <div class="clear"></div> </div> <div class="children"> </div> </div> </div> <div id="footer"> This document was generated with <a href="https://github.com/shenanigans/node-doczar">doczar</a> at <span class="time">3:55pm</span> on <span class="date">8/14/2015</span> </div> </body> </html>
{ "content_hash": "516d3ae9b32270d0c39542ac5d172f0f", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 536, "avg_line_length": 49.404761904761905, "alnum_prop": 0.5479518072289157, "repo_name": "shenanigans/node-sublayer", "id": "3425bd7105d52285952968a7c5b9c523cfc7d7d6", "size": "2075", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "static/docs/generated/module/submergence/module/action/module/configuration/member/context/spare/summary/index.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "19097" }, { "name": "HTML", "bytes": "7637111" }, { "name": "JavaScript", "bytes": "2783424" } ], "symlink_target": "" }
package org.apache.flink.streaming.api.operators; import org.apache.flink.runtime.checkpoint.OperatorSubtaskState; import org.apache.flink.runtime.checkpoint.StateObjectCollection; import org.apache.flink.runtime.concurrent.FutureUtils; import org.apache.flink.runtime.state.InputChannelStateHandle; import org.apache.flink.runtime.state.KeyedStateHandle; import org.apache.flink.runtime.state.OperatorStateHandle; import org.apache.flink.runtime.state.ResultSubpartitionStateHandle; import org.apache.flink.runtime.state.SnapshotResult; import javax.annotation.Nonnull; import java.util.concurrent.ExecutionException; import static org.apache.flink.runtime.checkpoint.StateObjectCollection.emptyIfNull; import static org.apache.flink.runtime.checkpoint.StateObjectCollection.singletonOrEmpty; /** * This class finalizes {@link OperatorSnapshotFutures}. Each object is created with a {@link * OperatorSnapshotFutures} that is executed. The object can then deliver the results from the * execution as {@link OperatorSubtaskState}. */ public class OperatorSnapshotFinalizer { /** Primary replica of the operator subtask state for report to JM. */ private final OperatorSubtaskState jobManagerOwnedState; /** Secondary replica of the operator subtask state for faster, local recovery on TM. */ private final OperatorSubtaskState taskLocalState; public OperatorSnapshotFinalizer(@Nonnull OperatorSnapshotFutures snapshotFutures) throws ExecutionException, InterruptedException { SnapshotResult<KeyedStateHandle> keyedManaged = FutureUtils.runIfNotDoneAndGet(snapshotFutures.getKeyedStateManagedFuture()); SnapshotResult<KeyedStateHandle> keyedRaw = FutureUtils.runIfNotDoneAndGet(snapshotFutures.getKeyedStateRawFuture()); SnapshotResult<OperatorStateHandle> operatorManaged = FutureUtils.runIfNotDoneAndGet(snapshotFutures.getOperatorStateManagedFuture()); SnapshotResult<OperatorStateHandle> operatorRaw = FutureUtils.runIfNotDoneAndGet(snapshotFutures.getOperatorStateRawFuture()); SnapshotResult<StateObjectCollection<InputChannelStateHandle>> inputChannel = snapshotFutures.getInputChannelStateFuture().get(); SnapshotResult<StateObjectCollection<ResultSubpartitionStateHandle>> resultSubpartition = snapshotFutures.getResultSubpartitionStateFuture().get(); jobManagerOwnedState = OperatorSubtaskState.builder() .setManagedOperatorState( singletonOrEmpty(operatorManaged.getJobManagerOwnedSnapshot())) .setRawOperatorState( singletonOrEmpty(operatorRaw.getJobManagerOwnedSnapshot())) .setManagedKeyedState( singletonOrEmpty(keyedManaged.getJobManagerOwnedSnapshot())) .setRawKeyedState(singletonOrEmpty(keyedRaw.getJobManagerOwnedSnapshot())) .setInputChannelState( emptyIfNull(inputChannel.getJobManagerOwnedSnapshot())) .setResultSubpartitionState( emptyIfNull(resultSubpartition.getJobManagerOwnedSnapshot())) .build(); taskLocalState = OperatorSubtaskState.builder() .setManagedOperatorState( singletonOrEmpty(operatorManaged.getTaskLocalSnapshot())) .setRawOperatorState(singletonOrEmpty(operatorRaw.getTaskLocalSnapshot())) .setManagedKeyedState(singletonOrEmpty(keyedManaged.getTaskLocalSnapshot())) .setRawKeyedState(singletonOrEmpty(keyedRaw.getTaskLocalSnapshot())) .setInputChannelState(emptyIfNull(inputChannel.getTaskLocalSnapshot())) .setResultSubpartitionState( emptyIfNull(resultSubpartition.getTaskLocalSnapshot())) .build(); } public OperatorSubtaskState getTaskLocalState() { return taskLocalState; } public OperatorSubtaskState getJobManagerOwnedState() { return jobManagerOwnedState; } }
{ "content_hash": "671e6fe5447496e480c87f37110d4529", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 100, "avg_line_length": 48.37777777777778, "alnum_prop": 0.6956821313734497, "repo_name": "aljoscha/flink", "id": "e688657b8f15df4d589086f4d602c0fdac7540d5", "size": "5155", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/OperatorSnapshotFinalizer.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "4588" }, { "name": "CSS", "bytes": "58149" }, { "name": "Clojure", "bytes": "93329" }, { "name": "Dockerfile", "bytes": "12142" }, { "name": "FreeMarker", "bytes": "25294" }, { "name": "HTML", "bytes": "108809" }, { "name": "Java", "bytes": "52615568" }, { "name": "JavaScript", "bytes": "1829" }, { "name": "Makefile", "bytes": "5134" }, { "name": "Python", "bytes": "1016891" }, { "name": "Scala", "bytes": "13821841" }, { "name": "Shell", "bytes": "521431" }, { "name": "TSQL", "bytes": "123113" }, { "name": "TypeScript", "bytes": "249103" } ], "symlink_target": "" }
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.34209 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ namespace GARbro.GUI.Strings { using System; /// <summary> /// A strongly-typed resource class, for looking up localized strings, etc. /// </summary> // This class was auto-generated by the StronglyTypedResourceBuilder // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] public class guiStrings { private static global::System.Resources.ResourceManager resourceMan; private static global::System.Globalization.CultureInfo resourceCulture; [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal guiStrings() { } /// <summary> /// Returns the cached ResourceManager instance used by this class. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] public static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("GARbro.GUI.Strings.guiStrings", typeof(guiStrings).Assembly); resourceMan = temp; } return resourceMan; } } /// <summary> /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] public static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } set { resourceCulture = value; } } /// <summary> /// Looks up a localized string similar to Cancel. /// </summary> public static string ButtonCancel { get { return ResourceManager.GetString("ButtonCancel", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Convert. /// </summary> public static string ButtonConvert { get { return ResourceManager.GetString("ButtonConvert", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Extract. /// </summary> public static string ButtonExtract { get { return ResourceManager.GetString("ButtonExtract", resourceCulture); } } /// <summary> /// Looks up a localized string similar to OK. /// </summary> public static string ButtonOK { get { return ResourceManager.GetString("ButtonOK", resourceCulture); } } /// <summary> /// Looks up a localized string similar to _Close. /// </summary> public static string CtxMenuClose { get { return ResourceManager.GetString("CtxMenuClose", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Convert multimedia.... /// </summary> public static string CtxMenuConvert { get { return ResourceManager.GetString("CtxMenuConvert", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Copy. /// </summary> public static string CtxMenuCopy { get { return ResourceManager.GetString("CtxMenuCopy", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Create archive.... /// </summary> public static string CtxMenuCreate { get { return ResourceManager.GetString("CtxMenuCreate", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Cut. /// </summary> public static string CtxMenuCut { get { return ResourceManager.GetString("CtxMenuCut", resourceCulture); } } /// <summary> /// Looks up a localized string similar to _Delete. /// </summary> public static string CtxMenuDelete { get { return ResourceManager.GetString("CtxMenuDelete", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Browse in _Explorer. /// </summary> public static string CtxMenuExplorer { get { return ResourceManager.GetString("CtxMenuExplorer", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Extract. /// </summary> public static string CtxMenuExtract { get { return ResourceManager.GetString("CtxMenuExtract", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Assign file type. /// </summary> public static string CtxMenuFileType { get { return ResourceManager.GetString("CtxMenuFileType", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Open. /// </summary> public static string CtxMenuOpen { get { return ResourceManager.GetString("CtxMenuOpen", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Paste. /// </summary> public static string CtxMenuPaste { get { return ResourceManager.GetString("CtxMenuPaste", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Refresh. /// </summary> public static string CtxMenuRefresh { get { return ResourceManager.GetString("CtxMenuRefresh", resourceCulture); } } /// <summary> /// Looks up a localized string similar to _Rename. /// </summary> public static string CtxMenuRename { get { return ResourceManager.GetString("CtxMenuRename", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Sort by. /// </summary> public static string CtxMenuSortBy { get { return ResourceManager.GetString("CtxMenuSortBy", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Name. /// </summary> public static string CtxMenuSortByName { get { return ResourceManager.GetString("CtxMenuSortByName", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Size. /// </summary> public static string CtxMenuSortBySize { get { return ResourceManager.GetString("CtxMenuSortBySize", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Type. /// </summary> public static string CtxMenuSortByType { get { return ResourceManager.GetString("CtxMenuSortByType", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Unsorted. /// </summary> public static string CtxMenuUnsorted { get { return ResourceManager.GetString("CtxMenuUnsorted", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Name. /// </summary> public static string HeaderName { get { return ResourceManager.GetString("HeaderName", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Size. /// </summary> public static string HeaderSize { get { return ResourceManager.GetString("HeaderSize", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Type. /// </summary> public static string HeaderType { get { return ResourceManager.GetString("HeaderType", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Archive format. /// </summary> public static string LabelArchiveFormat { get { return ResourceManager.GetString("LabelArchiveFormat", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Archive name. /// </summary> public static string LabelArchiveName { get { return ResourceManager.GetString("LabelArchiveName", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Archive options. /// </summary> public static string LabelArchiveOptions { get { return ResourceManager.GetString("LabelArchiveOptions", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Choose destination format for images. /// </summary> public static string LabelDestinationFormat { get { return ResourceManager.GetString("LabelDestinationFormat", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Encoding. /// </summary> public static string LabelEncoding { get { return ResourceManager.GetString("LabelEncoding", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Enter wildcard mask. /// </summary> public static string LabelEnterMask { get { return ResourceManager.GetString("LabelEnterMask", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Extract files from {0} to. /// </summary> public static string LabelExtractAllTo { get { return ResourceManager.GetString("LabelExtractAllTo", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Extract {0} to. /// </summary> public static string LabelExtractFileTo { get { return ResourceManager.GetString("LabelExtractFileTo", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Skip incovertible files.. /// </summary> public static string LabelSkipFailures { get { return ResourceManager.GetString("LabelSkipFailures", resourceCulture); } } /// <summary> /// Looks up a localized string similar to About Game Resource browser. /// </summary> public static string MenuAbout { get { return ResourceManager.GetString("MenuAbout", resourceCulture); } } /// <summary> /// Looks up a localized string similar to E_xit. /// </summary> public static string MenuExit { get { return ResourceManager.GetString("MenuExit", resourceCulture); } } /// <summary> /// Looks up a localized string similar to _File. /// </summary> public static string MenuFile { get { return ResourceManager.GetString("MenuFile", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Fit preview _window to image. /// </summary> public static string MenuFitWindow { get { return ResourceManager.GetString("MenuFitWindow", resourceCulture); } } /// <summary> /// Looks up a localized string similar to _Help. /// </summary> public static string MenuHelp { get { return ResourceManager.GetString("MenuHelp", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Open.... /// </summary> public static string MenuOpen { get { return ResourceManager.GetString("MenuOpen", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Recent files. /// </summary> public static string MenuRecent { get { return ResourceManager.GetString("MenuRecent", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Show/hide main _menu bar. /// </summary> public static string MenuToggleMenuBar { get { return ResourceManager.GetString("MenuToggleMenuBar", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Show/hide _status bar. /// </summary> public static string MenuToggleStatusBar { get { return ResourceManager.GetString("MenuToggleStatusBar", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Show/hide _toolbar. /// </summary> public static string MenuToggleToolBar { get { return ResourceManager.GetString("MenuToggleToolBar", resourceCulture); } } /// <summary> /// Looks up a localized string similar to _View. /// </summary> public static string MenuView { get { return ResourceManager.GetString("MenuView", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Choose files to extract. /// </summary> public static string MsgChooseFiles { get { return ResourceManager.GetString("MsgChooseFiles", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Are you sure you want to delete these files?. /// </summary> public static string MsgConfirmDeleteFiles { get { return ResourceManager.GetString("MsgConfirmDeleteFiles", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Converting file {0}. /// </summary> public static string MsgConvertingFile { get { return ResourceManager.GetString("MsgConvertingFile", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Creating archive {0}. /// </summary> public static string MsgCreatingArchive { get { return ResourceManager.GetString("MsgCreatingArchive", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Deleted {0}. /// </summary> public static string MsgDeletedItem { get { return ResourceManager.GetString("MsgDeletedItem", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Deleted {0} file. /// </summary> public static string MsgDeletedItems1 { get { return ResourceManager.GetString("MsgDeletedItems1", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Deleted {0} files. /// </summary> public static string MsgDeletedItems2 { get { return ResourceManager.GetString("MsgDeletedItems2", resourceCulture); } } /// <summary> /// Looks up a localized string similar to directory not found. /// </summary> public static string MsgDirectoryNotFound { get { return ResourceManager.GetString("MsgDirectoryNotFound", resourceCulture); } } /// <summary> /// Looks up a localized string similar to archive is empty. /// </summary> public static string MsgEmptyArchive { get { return ResourceManager.GetString("MsgEmptyArchive", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Error extracting file. /// </summary> public static string MsgErrorExtracting { get { return ResourceManager.GetString("MsgErrorExtracting", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Error opening file. /// </summary> public static string MsgErrorOpening { get { return ResourceManager.GetString("MsgErrorOpening", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Extracted {0} into {1}. /// </summary> public static string MsgExtractComplete { get { return ResourceManager.GetString("MsgExtractComplete", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Extracted {0} file. /// </summary> public static string MsgExtractedFiles1 { get { return ResourceManager.GetString("MsgExtractedFiles1", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Extracted {0} files. /// </summary> public static string MsgExtractedFiles2 { get { return ResourceManager.GetString("MsgExtractedFiles2", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Extracting files from {0}. /// </summary> public static string MsgExtractingArchive { get { return ResourceManager.GetString("MsgExtractingArchive", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Extracting file from {0}. /// </summary> public static string MsgExtractingFile { get { return ResourceManager.GetString("MsgExtractingFile", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Extracting files from {0} to {1}. /// </summary> public static string MsgExtractingTo { get { return ResourceManager.GetString("MsgExtractingTo", resourceCulture); } } /// <summary> /// Looks up a localized string similar to {0} file. /// </summary> public static string MsgFiles1 { get { return ResourceManager.GetString("MsgFiles1", resourceCulture); } } /// <summary> /// Looks up a localized string similar to {0} files. /// </summary> public static string MsgFiles2 { get { return ResourceManager.GetString("MsgFiles2", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Image {0} x {1} x {2}bpp. /// </summary> public static string MsgImageSize { get { return ResourceManager.GetString("MsgImageSize", resourceCulture); } } /// <summary> /// Looks up a localized string similar to no files to extract. /// </summary> public static string MsgNoFiles { get { return ResourceManager.GetString("MsgNoFiles", resourceCulture); } } /// <summary> /// Looks up a localized string similar to No entries matching &quot;{0}&quot;. /// </summary> public static string MsgNoMatching { get { return ResourceManager.GetString("MsgNoMatching", resourceCulture); } } /// <summary> /// Looks up a localized string similar to No media files selected.. /// </summary> public static string MsgNoMediaFiles { get { return ResourceManager.GetString("MsgNoMediaFiles", resourceCulture); } } /// <summary> /// Looks up a localized string similar to File {0} ///already exists. /// ///Overwrite?. /// </summary> public static string MsgOverwrite { get { return ResourceManager.GetString("MsgOverwrite", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Ready. /// </summary> public static string MsgReady { get { return ResourceManager.GetString("MsgReady", resourceCulture); } } /// <summary> /// Looks up a localized string similar to {0} file added to selection. /// </summary> public static string MsgSelectedFiles1 { get { return ResourceManager.GetString("MsgSelectedFiles1", resourceCulture); } } /// <summary> /// Looks up a localized string similar to {0} files added to selection. /// </summary> public static string MsgSelectedFiles2 { get { return ResourceManager.GetString("MsgSelectedFiles2", resourceCulture); } } /// <summary> /// Looks up a localized string similar to unable to interpret audio format. /// </summary> public static string MsgUnableInterpretAudio { get { return ResourceManager.GetString("MsgUnableInterpretAudio", resourceCulture); } } /// <summary> /// Looks up a localized string similar to unable to interpret image format. /// </summary> public static string MsgUnableInterpretImage { get { return ResourceManager.GetString("MsgUnableInterpretImage", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Version {0}. /// </summary> public static string MsgVersion { get { return ResourceManager.GetString("MsgVersion", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Archives. /// </summary> public static string TextAboutArchives { get { return ResourceManager.GetString("TextAboutArchives", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Audio. /// </summary> public static string TextAboutAudio { get { return ResourceManager.GetString("TextAboutAudio", resourceCulture); } } /// <summary> /// Looks up a localized string similar to [builtin]. /// </summary> public static string TextAboutBuiltin { get { return ResourceManager.GetString("TextAboutBuiltin", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Images. /// </summary> public static string TextAboutImages { get { return ResourceManager.GetString("TextAboutImages", resourceCulture); } } /// <summary> /// Looks up a localized string similar to License. /// </summary> public static string TextAboutLicense { get { return ResourceManager.GetString("TextAboutLicense", resourceCulture); } } /// <summary> /// Looks up a localized string similar to About Game Resource browser. /// </summary> public static string TextAboutTitle { get { return ResourceManager.GetString("TextAboutTitle", resourceCulture); } } /// <summary> /// Looks up a localized string similar to All Files. /// </summary> public static string TextAllFiles { get { return ResourceManager.GetString("TextAllFiles", resourceCulture); } } /// <summary> /// Looks up a localized string similar to as is. /// </summary> public static string TextAsIs { get { return ResourceManager.GetString("TextAsIs", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Audio will be converted to either WAV, MP3 or OGG.. /// </summary> public static string TextAudioConversion { get { return ResourceManager.GetString("TextAudioConversion", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Choose archive location. /// </summary> public static string TextChooseArchive { get { return ResourceManager.GetString("TextChooseArchive", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Choose destination directory. /// </summary> public static string TextChooseDestDir { get { return ResourceManager.GetString("TextChooseDestDir", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Confirm overwrite. /// </summary> public static string TextConfirmOverwrite { get { return ResourceManager.GetString("TextConfirmOverwrite", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Convert audio to common format. /// </summary> public static string TextConvertAudio { get { return ResourceManager.GetString("TextConvertAudio", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Media conversion. /// </summary> public static string TextConvertMedia { get { return ResourceManager.GetString("TextConvertMedia", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Create archive. /// </summary> public static string TextCreateArchive { get { return ResourceManager.GetString("TextCreateArchive", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Archive creation error. /// </summary> public static string TextCreateArchiveError { get { return ResourceManager.GetString("TextCreateArchiveError", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Delete files. /// </summary> public static string TextDeleteFiles { get { return ResourceManager.GetString("TextDeleteFiles", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Text encoding. /// </summary> public static string TextEncoding { get { return ResourceManager.GetString("TextEncoding", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Error occured while extracting file ///{0} ///{1}. /// </summary> public static string TextErrorExtracting { get { return ResourceManager.GetString("TextErrorExtracting", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Extract audio. /// </summary> public static string TextExtractAudio { get { return ResourceManager.GetString("TextExtractAudio", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Extract images. /// </summary> public static string TextExtractImages { get { return ResourceManager.GetString("TextExtractImages", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Extract text. /// </summary> public static string TextExtractText { get { return ResourceManager.GetString("TextExtractText", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Extract from archive. /// </summary> public static string TextExtractTitle { get { return ResourceManager.GetString("TextExtractTitle", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Multimedia conversion error. /// </summary> public static string TextMediaConvertError { get { return ResourceManager.GetString("TextMediaConvertError", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Archive parameters. /// </summary> public static string TextParametersTitle { get { return ResourceManager.GetString("TextParametersTitle", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Save as. /// </summary> public static string TextSaveAs { get { return ResourceManager.GetString("TextSaveAs", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Save images as. /// </summary> public static string TextSaveImagesAs { get { return ResourceManager.GetString("TextSaveImagesAs", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Select files. /// </summary> public static string TextSelectFiles { get { return ResourceManager.GetString("TextSelectFiles", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Game Resource browser. /// </summary> public static string TextTitle { get { return ResourceManager.GetString("TextTitle", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Either WAV, MP3 or OGG. /// </summary> public static string TooltipAudioFormats { get { return ResourceManager.GetString("TooltipAudioFormats", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Back. /// </summary> public static string TooltipBack { get { return ResourceManager.GetString("TooltipBack", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Forward. /// </summary> public static string TooltipForward { get { return ResourceManager.GetString("TooltipForward", resourceCulture); } } /// <summary> /// Looks up a localized string similar to &lt;DIR&gt;. /// </summary> public static string Type_directory { get { return ResourceManager.GetString("Type_directory", resourceCulture); } } /// <summary> /// Looks up a localized string similar to none. /// </summary> public static string Type_NONE { get { return ResourceManager.GetString("Type_NONE", resourceCulture); } } } }
{ "content_hash": "54b959674c0fa69408d62ec4d02b621b", "timestamp": "", "source": "github", "line_count": 1049, "max_line_length": 175, "avg_line_length": 33.7578646329838, "alnum_prop": 0.5231277533039648, "repo_name": "dsp2003/GARbro", "id": "b2955d1f52f8a621a4fc47d090e10ec997e2b456", "size": "35414", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "GUI/Strings/guiStrings.Designer.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "2869357" }, { "name": "HTML", "bytes": "29366" }, { "name": "Perl", "bytes": "2214" } ], "symlink_target": "" }
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <html> <head> <title>PHPXRef 0.7.1 : Unnamed Project : Variable Reference: $backup_folder</title> <link rel="stylesheet" href="../sample.css" type="text/css"> <link rel="stylesheet" href="../sample-print.css" type="text/css" media="print"> <style id="hilight" type="text/css"></style> <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> </head> <body bgcolor="#ffffff" text="#000000" link="#801800" vlink="#300540" alink="#ffffff"> <table class="pagetitle" width="100%"> <tr> <td valign="top" class="pagetitle"> [ <a href="../index.html">Index</a> ] </td> <td align="right" class="pagetitle"> <h2 style="margin-bottom: 0px">PHP Cross Reference of Unnamed Project</h2> </td> </tr> </table> <!-- Generated by PHPXref 0.7.1 at Thu Oct 23 18:57:41 2014 --> <!-- PHPXref (c) 2000-2010 Gareth Watts - gareth@omnipotent.net --> <!-- http://phpxref.sourceforge.net/ --> <script src="../phpxref.js" type="text/javascript"></script> <script language="JavaScript" type="text/javascript"> <!-- ext='.html'; relbase='../'; subdir='_variables'; filename='index.html'; cookiekey='phpxref'; handleNavFrame(relbase, subdir, filename); logVariable('backup_folder'); // --> </script> <script language="JavaScript" type="text/javascript"> if (gwGetCookie('xrefnav')=='off') document.write('<p class="navlinks">[ <a href="javascript:navOn()">Show Explorer<\/a> ]<\/p>'); else document.write('<p class="navlinks">[ <a href="javascript:navOff()">Hide Explorer<\/a> ]<\/p>'); </script> <noscript> <p class="navlinks"> [ <a href="../nav.html" target="_top">Show Explorer</a> ] [ <a href="index.html" target="_top">Hide Navbar</a> ] </p> </noscript> [<a href="../index.html">Top level directory</a>]<br> <script language="JavaScript" type="text/javascript"> <!-- document.writeln('<table align="right" class="searchbox-link"><tr><td><a class="searchbox-link" href="javascript:void(0)" onMouseOver="showSearchBox()">Search</a><br>'); document.writeln('<table border="0" cellspacing="0" cellpadding="0" class="searchbox" id="searchbox">'); document.writeln('<tr><td class="searchbox-title">'); document.writeln('<a class="searchbox-title" href="javascript:showSearchPopup()">Search History +</a>'); document.writeln('<\/td><\/tr>'); document.writeln('<tr><td class="searchbox-body" id="searchbox-body">'); document.writeln('<form name="search" style="margin:0px; padding:0px" onSubmit=\'return jump()\'>'); document.writeln('<a class="searchbox-body" href="../_classes/index.html">Class<\/a>: '); document.writeln('<input type="text" size=10 value="" name="classname"><br>'); document.writeln('<a id="funcsearchlink" class="searchbox-body" href="../_functions/index.html">Function<\/a>: '); document.writeln('<input type="text" size=10 value="" name="funcname"><br>'); document.writeln('<a class="searchbox-body" href="../_variables/index.html">Variable<\/a>: '); document.writeln('<input type="text" size=10 value="" name="varname"><br>'); document.writeln('<a class="searchbox-body" href="../_constants/index.html">Constant<\/a>: '); document.writeln('<input type="text" size=10 value="" name="constname"><br>'); document.writeln('<a class="searchbox-body" href="../_tables/index.html">Table<\/a>: '); document.writeln('<input type="text" size=10 value="" name="tablename"><br>'); document.writeln('<input type="submit" class="searchbox-button" value="Search">'); document.writeln('<\/form>'); document.writeln('<\/td><\/tr><\/table>'); document.writeln('<\/td><\/tr><\/table>'); // --> </script> <div id="search-popup" class="searchpopup"><p id="searchpopup-title" class="searchpopup-title">title</p><div id="searchpopup-body" class="searchpopup-body">Body</div><p class="searchpopup-close"><a href="javascript:gwCloseActive()">[close]</a></p></div> <h3>Variable Cross Reference</h3> <h2><a href="index.html#backup_folder">$backup_folder</a></h2> <b>Defined at:</b><ul> <li><a href="../bonfire/modules/database/controllers/developer.php.html">/bonfire/modules/database/controllers/developer.php</A> -> <a href="../bonfire/modules/database/controllers/developer.php.source.html#l40"> line 40</A></li> </ul> <br><b>Referenced 9 times:</b><ul> <li><a href="../bonfire/modules/database/controllers/developer.php.html">/bonfire/modules/database/controllers/developer.php</a> -> <a href="../bonfire/modules/database/controllers/developer.php.source.html#l40"> line 40</a></li> <li><a href="../bonfire/modules/database/controllers/developer.php.html">/bonfire/modules/database/controllers/developer.php</a> -> <a href="../bonfire/modules/database/controllers/developer.php.source.html#l55"> line 55</a></li> <li><a href="../bonfire/modules/database/controllers/developer.php.html">/bonfire/modules/database/controllers/developer.php</a> -> <a href="../bonfire/modules/database/controllers/developer.php.source.html#l55"> line 55</a></li> <li><a href="../bonfire/modules/database/controllers/developer.php.html">/bonfire/modules/database/controllers/developer.php</a> -> <a href="../bonfire/modules/database/controllers/developer.php.source.html#l168"> line 168</a></li> <li><a href="../bonfire/modules/database/controllers/developer.php.html">/bonfire/modules/database/controllers/developer.php</a> -> <a href="../bonfire/modules/database/controllers/developer.php.source.html#l182"> line 182</a></li> <li><a href="../bonfire/modules/database/controllers/developer.php.html">/bonfire/modules/database/controllers/developer.php</a> -> <a href="../bonfire/modules/database/controllers/developer.php.source.html#l236"> line 236</a></li> <li><a href="../bonfire/modules/database/controllers/developer.php.html">/bonfire/modules/database/controllers/developer.php</a> -> <a href="../bonfire/modules/database/controllers/developer.php.source.html#l295"> line 295</a></li> <li><a href="../bonfire/modules/database/controllers/developer.php.html">/bonfire/modules/database/controllers/developer.php</a> -> <a href="../bonfire/modules/database/controllers/developer.php.source.html#l297"> line 297</a></li> <li><a href="../bonfire/modules/database/controllers/developer.php.html">/bonfire/modules/database/controllers/developer.php</a> -> <a href="../bonfire/modules/database/controllers/developer.php.source.html#l329"> line 329</a></li> </ul> <!-- A link to the phpxref site in your customized footer file is appreciated ;-) --> <br><hr> <table width="100%"> <tr><td>Generated: Thu Oct 23 18:57:41 2014</td> <td align="right"><i>Cross-referenced by <a href="http://phpxref.sourceforge.net/">PHPXref 0.7.1</a></i></td> </tr> </table> </body></html>
{ "content_hash": "4261456ca770e452799552f39b435ab7", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 253, "avg_line_length": 64.72115384615384, "alnum_prop": 0.6958847125241421, "repo_name": "inputx/code-ref-doc", "id": "2678b96a9e08697c12f84567f01eb62e87e623b0", "size": "6731", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "bonfire/_variables/backup_folder.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "17952" }, { "name": "JavaScript", "bytes": "255489" } ], "symlink_target": "" }
package lab.chabingba.eventorganizer.Database; import java.io.Serializable; import lab.chabingba.eventorganizer.Helpers.QueryHelpers; import lab.chabingba.eventorganizer.Helpers.ValidatorHelpers; /** * Created by Tsvetan on 2015-05-25. */ public class Category implements Serializable { private int id; private String name; public Category() { } public Category(String inputName) { this.setName(inputName); } public int getId() { return this.id; } public void setId(int id) { this.id = id; } public String getName() { return this.name; } public String getSQLName() { return QueryHelpers.convertTableNameToSQLConvention(this.name); } public void setName(String name) { this.name = ValidatorHelpers.isNullOrEmptyConverter(name); } }
{ "content_hash": "f2ceb2424bac3eddef4073fb60c8bf85", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 71, "avg_line_length": 20.38095238095238, "alnum_prop": 0.669392523364486, "repo_name": "TsvetanMilanov/Event-Organizer", "id": "0d3f5df85ae030f9cb331d5b2205391d0d5380cf", "size": "856", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Eventorganizer/app/src/main/java/lab/chabingba/eventorganizer/Database/Category.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "166257" } ], "symlink_target": "" }
<?php /** * CLocale represents the data relevant to a locale. * * The data includes the number formatting information and date formatting information. * * @author Qiang Xue <qiang.xue@gmail.com> * @version $Id: CLocale.php 3399 2011-09-16 15:02:53Z alexander.makarow $ * @package system.i18n * @since 1.0 */ class CLocale extends CComponent { /** * @var string the directory that contains the locale data. If this property is not set, * the locale data will be loaded from 'framework/i18n/data'. * @since 1.1.0 */ public static $dataPath; private $_id; private $_data; private $_dateFormatter; private $_numberFormatter; /** * Returns the instance of the specified locale. * Since the constructor of CLocale is protected, you can only use * this method to obtain an instance of the specified locale. * @param string $id the locale ID (e.g. en_US) * @return CLocale the locale instance */ public static function getInstance($id) { static $locales=array(); if(isset($locales[$id])) return $locales[$id]; else return $locales[$id]=new CLocale($id); } /** * @return array IDs of the locales which the framework can recognize */ public static function getLocaleIDs() { static $locales; if($locales===null) { $locales=array(); $dataPath=self::$dataPath===null ? dirname(__FILE__).DIRECTORY_SEPARATOR.'data' : self::$dataPath; $folder=@opendir($dataPath); while(($file=@readdir($folder))!==false) { $fullPath=$dataPath.DIRECTORY_SEPARATOR.$file; if(substr($file,-4)==='.php' && is_file($fullPath)) $locales[]=substr($file,0,-4); } closedir($folder); sort($locales); } return $locales; } /** * Constructor. * Since the constructor is protected, please use {@link getInstance} * to obtain an instance of the specified locale. * @param string $id the locale ID (e.g. en_US) */ protected function __construct($id) { $this->_id=self::getCanonicalID($id); $dataPath=self::$dataPath===null ? dirname(__FILE__).DIRECTORY_SEPARATOR.'data' : self::$dataPath; $dataFile=$dataPath.DIRECTORY_SEPARATOR.$this->_id.'.php'; if(is_file($dataFile)) $this->_data=require($dataFile); else throw new CException(Yii::t('yii','Unrecognized locale "{locale}".',array('{locale}'=>$id))); } /** * Converts a locale ID to its canonical form. * In canonical form, a locale ID consists of only underscores and lower-case letters. * @param string $id the locale ID to be converted * @return string the locale ID in canonical form */ public static function getCanonicalID($id) { return strtolower(str_replace('-','_',$id)); } /** * @return string the locale ID (in canonical form) */ public function getId() { return $this->_id; } /** * @return CNumberFormatter the number formatter for this locale */ public function getNumberFormatter() { if($this->_numberFormatter===null) $this->_numberFormatter=new CNumberFormatter($this); return $this->_numberFormatter; } /** * @return CDateFormatter the date formatter for this locale */ public function getDateFormatter() { if($this->_dateFormatter===null) $this->_dateFormatter=new CDateFormatter($this); return $this->_dateFormatter; } /** * @param string $currency 3-letter ISO 4217 code. For example, the code "USD" represents the US Dollar and "EUR" represents the Euro currency. * @return string the localized currency symbol. Null if the symbol does not exist. */ public function getCurrencySymbol($currency) { return isset($this->_data['currencySymbols'][$currency]) ? $this->_data['currencySymbols'][$currency] : null; } /** * @param string $name symbol name * @return string symbol */ public function getNumberSymbol($name) { return isset($this->_data['numberSymbols'][$name]) ? $this->_data['numberSymbols'][$name] : null; } /** * @return string the decimal format */ public function getDecimalFormat() { return $this->_data['decimalFormat']; } /** * @return string the currency format */ public function getCurrencyFormat() { return $this->_data['currencyFormat']; } /** * @return string the percent format */ public function getPercentFormat() { return $this->_data['percentFormat']; } /** * @return string the scientific format */ public function getScientificFormat() { return $this->_data['scientificFormat']; } /** * @param integer $month month (1-12) * @param string $width month name width. It can be 'wide', 'abbreviated' or 'narrow'. * @param boolean $standAlone whether the month name should be returned in stand-alone format * @return string the month name */ public function getMonthName($month,$width='wide',$standAlone=false) { if($standAlone) return isset($this->_data['monthNamesSA'][$width][$month]) ? $this->_data['monthNamesSA'][$width][$month] : $this->_data['monthNames'][$width][$month]; else return isset($this->_data['monthNames'][$width][$month]) ? $this->_data['monthNames'][$width][$month] : $this->_data['monthNamesSA'][$width][$month]; } /** * Returns the month names in the specified width. * @param string $width month name width. It can be 'wide', 'abbreviated' or 'narrow'. * @param boolean $standAlone whether the month names should be returned in stand-alone format * @return array month names indexed by month values (1-12) * @since 1.0.9 */ public function getMonthNames($width='wide',$standAlone=false) { if($standAlone) return isset($this->_data['monthNamesSA'][$width]) ? $this->_data['monthNamesSA'][$width] : $this->_data['monthNames'][$width]; else return isset($this->_data['monthNames'][$width]) ? $this->_data['monthNames'][$width] : $this->_data['monthNamesSA'][$width]; } /** * @param integer $day weekday (0-6, 0 means Sunday) * @param string $width weekday name width. It can be 'wide', 'abbreviated' or 'narrow'. * @param boolean $standAlone whether the week day name should be returned in stand-alone format * @return string the weekday name */ public function getWeekDayName($day,$width='wide',$standAlone=false) { if($standAlone) return isset($this->_data['weekDayNamesSA'][$width][$day]) ? $this->_data['weekDayNamesSA'][$width][$day] : $this->_data['weekDayNames'][$width][$day]; else return isset($this->_data['weekDayNames'][$width][$day]) ? $this->_data['weekDayNames'][$width][$day] : $this->_data['weekDayNamesSA'][$width][$day]; } /** * Returns the week day names in the specified width. * @param string $width weekday name width. It can be 'wide', 'abbreviated' or 'narrow'. * @param boolean $standAlone whether the week day name should be returned in stand-alone format * @return array the weekday names indexed by weekday values (0-6, 0 means Sunday, 1 Monday, etc.) * @since 1.0.9 */ public function getWeekDayNames($width='wide',$standAlone=false) { if($standAlone) return isset($this->_data['weekDayNamesSA'][$width]) ? $this->_data['weekDayNamesSA'][$width] : $this->_data['weekDayNames'][$width]; else return isset($this->_data['weekDayNames'][$width]) ? $this->_data['weekDayNames'][$width] : $this->_data['weekDayNamesSA'][$width]; } /** * @param integer $era era (0,1) * @param string $width era name width. It can be 'wide', 'abbreviated' or 'narrow'. * @return string the era name */ public function getEraName($era,$width='wide') { return $this->_data['eraNames'][$width][$era]; } /** * @return string the AM name */ public function getAMName() { return $this->_data['amName']; } /** * @return string the PM name */ public function getPMName() { return $this->_data['pmName']; } /** * @param string $width date format width. It can be 'full', 'long', 'medium' or 'short'. * @return string date format */ public function getDateFormat($width='medium') { return $this->_data['dateFormats'][$width]; } /** * @param string $width time format width. It can be 'full', 'long', 'medium' or 'short'. * @return string date format */ public function getTimeFormat($width='medium') { return $this->_data['timeFormats'][$width]; } /** * @return string datetime format, i.e., the order of date and time. */ public function getDateTimeFormat() { return $this->_data['dateTimeFormat']; } /** * @return string the character orientation, which is either 'ltr' (left-to-right) or 'rtl' (right-to-left) * @since 1.1.2 */ public function getOrientation() { return isset($this->_data['orientation']) ? $this->_data['orientation'] : 'ltr'; } /** * @return array plural forms expressions */ public function getPluralRules() { return isset($this->_data['pluralRules']) ? $this->_data['pluralRules'] : array(); } /** * Converts a locale ID to a language ID. * A language ID consists of only the first group of letters before an underscore or dash. * @param string $id the locale ID to be converted * @return string the language ID * @since 1.1.9 */ public function getLanguageID($id) { // normalize id $id = $this->getCanonicalID($id); // remove sub tags if(($underscorePosition=strpos($id, '_'))!== false) { $id = substr($id, 0, $underscorePosition); } return $id; } /** * Converts a locale ID to a script ID. * A script ID consists of only the last four characters after an underscore or dash. * @param string $id the locale ID to be converted * @return string the script ID * @since 1.1.9 */ public function getScriptID($id) { // normalize id $id = $this->getCanonicalID($id); // find sub tags if(($underscorePosition=strpos($id, '_'))!==false) { $subTag = explode('_', $id); // script sub tags can be distigused from territory sub tags by length if (strlen($subTag[1])===4) { $id = $subTag[1]; } else { $id = null; } } else { $id = null; } return $id; } /** * Converts a locale ID to a territory ID. * A territory ID consists of only the last two to three letter or digits after an underscore or dash. * @param string $id the locale ID to be converted * @return string the territory ID * @since 1.1.9 */ public function getTerritoryID($id) { // normalize id $id = $this->getCanonicalID($id); // find sub tags if (($underscorePosition=strpos($id, '_'))!== false) { $subTag = explode('_', $id); // territory sub tags can be distigused from script sub tags by length if (strlen($subTag[1])<4) { $id = $subTag[1]; } else { $id = null; } } else { $id = null; } return $id; } /** * @param string $id Unicode language identifier from IETF BCP 47. For example, the code "en_US" represents U.S. English and "en_GB" represents British English. * @param string $category * @return string the local display name for the language. Null if the language code does not exist. * @since 1.1.9 */ public function getLocaleDisplayName($id=null, $category='languages') { $id = $this->getCanonicalID($id); if (isset($this->_data[$category][$id])) { return $this->_data[$category][$id]; } else if (($category == 'languages') && ($id=$this->getLanguageID($id)) && (isset($this->_data[$category][$id]))) { return $this->_data[$category][$id]; } else if (($category == 'scripts') && ($id=$this->getScriptID($id)) && (isset($this->_data[$category][$id]))) { return $this->_data[$category][$id]; } else if (($category == 'territories') && ($id=$this->getTerritoryID($id)) && (isset($this->_data[$category][$id]))) { return $this->_data[$category][$id]; } else { return null; } } /** * @param string $id Unicode language identifier from IETF BCP 47. For example, the code "en_US" represents U.S. English and "en_GB" represents British English. * @return string the local display name for the language. Null if the language code does not exist. * @since 1.1.9 */ public function getLanguage($id) { return $this->getLocaleDisplayName($id, 'languages'); } /** * @param string $id Unicode script identifier from IETF BCP 47. For example, the code "en_US" represents U.S. English and "en_GB" represents British English. * @return string the local display name for the script. Null if the script code does not exist. * @since 1.1.9 */ public function getScript($id) { return $this->getLocaleDisplayName($id, 'scripts'); } /** * @param string $id Unicode territory identifier from IETF BCP 47. For example, the code "en_US" represents U.S. English and "en_GB" represents British English. * @return string the local display name for the territory. Null if the territory code does not exist. * @since 1.1.9 */ public function getTerritory($id) { return $this->getLocaleDisplayName($id, 'territories'); } }
{ "content_hash": "647b9e0cc13199c372fc2d0591983d9a", "timestamp": "", "source": "github", "line_count": 442, "max_line_length": 162, "avg_line_length": 28.957013574660632, "alnum_prop": 0.6583326822408001, "repo_name": "trungbq06/i-newspaper", "id": "05e14132fbc96aa73acd553ddd00dc3801a5a581", "size": "13020", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "framework/i18n/CLocale.php", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "ApacheConf", "bytes": "656" }, { "name": "CSS", "bytes": "122514" }, { "name": "HTML", "bytes": "22900" }, { "name": "JavaScript", "bytes": "235651" }, { "name": "PHP", "bytes": "17671158" }, { "name": "Shell", "bytes": "2840" }, { "name": "TeX", "bytes": "16114" } ], "symlink_target": "" }
<!DOCTYPE html> <html> <head> <title>Attach menu to icon</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=edge"/> <link rel="stylesheet" type="text/css" href="../../../codebase/dhtmlx.css"/> <script src="../../../codebase/dhtmlx.js"></script> <style> div#winVP { position: relative; height: 350px; border: #a4bed4 1px solid; border-radius: 2px; } </style> <script> var dhxWins, w1, myMenu, myMenu2; function doOnLoad() { dhxWins = new dhtmlXWindows(); dhxWins.attachViewportTo("winVP"); w1 = dhxWins.createWindow("w1", 20, 30, 320, 200); w1.setText("dhtmlxWindow #1"); w1.attachHTMLString("<span style='font-family: Tahoma; font-size: 11px; padding: 0px 5px;'>global context menu attached to icon</span>"); w2 = dhxWins.createWindow("w2", 50, 70, 320, 200); w2.setText("dhtmlxWindow #2"); w2.attachHTMLString("<span style='font-family: Tahoma; font-size: 11px; padding: 0px 5px;'>custom context menu attached to icon</span>"); w3 = dhxWins.createWindow("w3", 80, 110, 320, 200); w3.setText("dhtmlxWindow #3"); w3.attachHTMLString("<span style='font-family: Tahoma; font-size: 11px; padding: 0px 5px;'>global context menu attached to icon</span>"); // global menu myMenu = dhxWins.attachContextMenu({ icons_path: "../common/menu/", xml: "../common/menu/menu.xml" }); // custom menu for window #2 myMenu2 = w2.attachContextMenu({ icons_path: "../common/menu/", xml: "../common/menu/menu2.xml" }); } function doOnUnload() { if (dhxWins != null) { dhxWins.unload(); dhxWins = w1 = myMenu = null; } } </script> </head> <body onload="doOnLoad();" onunload="doOnUnload();"> <div id="winVP"></div> </body>
{ "content_hash": "984ad1b1d047a82263a144ecfdec4257", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 140, "avg_line_length": 30.78688524590164, "alnum_prop": 0.6166134185303515, "repo_name": "FrenzelGmbH/yii2dhtmlx", "id": "9638891af582d15e740b759ef66eca5450d97f7c", "size": "1878", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "assets/samples/dhtmlxWindows/06_icons/03_attach_menu_to_icon.html", "mode": "33188", "license": "mit", "language": [ { "name": "ASP", "bytes": "122" }, { "name": "C#", "bytes": "2182" }, { "name": "CSS", "bytes": "520407" }, { "name": "JavaScript", "bytes": "2418685" }, { "name": "PHP", "bytes": "281424" }, { "name": "Shell", "bytes": "403" } ], "symlink_target": "" }
@interface ThirdViewController : UIViewController @end
{ "content_hash": "7980979eaca10831ac3ff373ac3efde6", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 49, "avg_line_length": 18.666666666666668, "alnum_prop": 0.8392857142857143, "repo_name": "vowed21/HWViewPager", "id": "ca4cd4680af2dc68133bbc42dcfd531d05e179d7", "size": "236", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "HWViewPagerDemo/HWViewPagerDemo/ThirdViewController.h", "mode": "33188", "license": "mit", "language": [ { "name": "Objective-C", "bytes": "17459" } ], "symlink_target": "" }
<?php namespace App\Commands; use App\Entities\File; use Illuminate\Http\UploadedFile; class UploadScanOutput extends Command { /** @var int */ protected $id; /** @var UploadedFile */ protected $uploadedFile; /** @var File */ protected $file; /** * UploadScanOutputCommand constructor. * * @param int $id * @param UploadedFile $uploadedFile * @param File $file */ public function __construct(int $id, UploadedFile $uploadedFile, File $file) { $this->id = $id; $this->uploadedFile = $uploadedFile; $this->file = $file; } /** * @return int */ public function getId() { return $this->id; } /** * @return UploadedFile */ public function getUploadedFile() { return $this->uploadedFile; } /** * @return File */ public function getFile(): File { return $this->file; } }
{ "content_hash": "81e400cc0f8faa86107c043e10942a8d", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 80, "avg_line_length": 17.589285714285715, "alnum_prop": 0.5380710659898477, "repo_name": "Ruggedy-Limited/ruggedy-vma", "id": "a0bd2baf69c840abcdfff2df20bf34feba50bf5e", "size": "985", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/Commands/UploadScanOutput.php", "mode": "33188", "license": "mit", "language": [ { "name": "Dockerfile", "bytes": "4027" }, { "name": "Gherkin", "bytes": "244" }, { "name": "HTML", "bytes": "123087" }, { "name": "JavaScript", "bytes": "16943" }, { "name": "PHP", "bytes": "988175" }, { "name": "Shell", "bytes": "424" }, { "name": "Vue", "bytes": "563" } ], "symlink_target": "" }
declare module '@schwingbat/relative-angle'; type Point = { x: number; y: number; }; export function degrees(objectCoords: Point, targetCoords: Point): number;
{ "content_hash": "2d484d79cdf43ff6ec0cfa372e717d47", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 74, "avg_line_length": 20.75, "alnum_prop": 0.7228915662650602, "repo_name": "toomuchdesign/react-minimal-pie-chart", "id": "da57944934fa7db6c1e8dde8fab6488a49ed10d0", "size": "166", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "@types/@schwingbat/relative-angle/index.d.ts", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "5264" }, { "name": "TypeScript", "bytes": "59581" } ], "symlink_target": "" }
package org.tlacaelelsoftware.pojos2csv.testhelpers; /** * A Simple Plain Old Java Object (POJO) to test * csv conversion */ public class SimplePOJOForTest implements SimplePojo { private String user; private String email; private Long userId; private String phone; public SimplePOJOForTest() { } public SimplePOJOForTest(String user, String email, Long userId, String phone) { this.user = user; this.email = email; this.userId = userId; this.phone = phone; } // This fake constructor is used because we want to test the same values for different // @CSVField annotations on this class, but this is not possible using inheritance in java // since is not possible to override fields or fields annotations. @Override public void fakeConstructor(String user, String email, Long userId, String phone) { this.user = user; this.email = email; this.userId = userId; this.phone = phone; } }
{ "content_hash": "879576c4e6f8e54434399c8db3ea6d7c", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 94, "avg_line_length": 29.735294117647058, "alnum_prop": 0.6745796241345203, "repo_name": "miguelcarrasco/POJOs2CSV", "id": "ca6d4db8f60369d414814a8da54e3502c82be856", "size": "1011", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/test/org/tlacaelelsoftware/pojos2csv/testhelpers/SimplePOJOForTest.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "15006" } ], "symlink_target": "" }
<menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" tools:context=".GarageMainActivity"> <item android:id="@+id/action_settings" android:title="@string/action_settings" android:orderInCategory="100" android:showAsAction="never" /> </menu>
{ "content_hash": "20ba65e2abd0cfd7bdfd1808fcbd64b7", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 87, "avg_line_length": 63, "alnum_prop": 0.7301587301587301, "repo_name": "bzerkboi/WirelessGarageOpener", "id": "ed60b9de7fee2825207c978f2c190d91d5d1ff4e", "size": "315", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Android_WifiGarage/app/src/main/res/menu/menu_garage_main.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Arduino", "bytes": "2450" }, { "name": "Eagle", "bytes": "87192" }, { "name": "Java", "bytes": "84916" } ], "symlink_target": "" }
def repeat_it(string, n): return string * n if isinstance(string, str) else 'Not a string'
{ "content_hash": "01f079121ea374f17119a342e1a2eaff", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 68, "avg_line_length": 47.5, "alnum_prop": 0.6947368421052632, "repo_name": "the-zebulan/CodeWars", "id": "96f0f997e8b1212818676f15e5230c53e58c694d", "size": "95", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "katas/kyu_8/repeat_it.py", "mode": "33188", "license": "mit", "language": [ { "name": "Python", "bytes": "1203000" } ], "symlink_target": "" }
{% load i18n %} <section id="introduction"> <div class="page-header"> <h1>{% trans "Getting Started" %}</h1> </div> <p>{% blocktrans %}formhub aims to make collecting survey data with Android smart phones easy and free.{% endblocktrans %} </p> <p> {% trans "One uses formhub as follows:" %} <ol> <li><a href="./#translate-survey">{% trans "Translate survey into the xsl2xform syntax." %}</a></li> <li><a href="./#publish-form">{% trans "Upload XLSForm file to formhub." %}</a></li> <li><a href="./#use-odk-collect">{% trans "Use" %} ODK Collect {% trans "to download form and submit data." %}</a></li> <li><a href="./#analyze-survey-data">{% trans "Use" %} formhub {% trans "to download and map data submissions." %}</a></li> </ol> {% trans "This tutorial will walk you through each stop of the way." %} </p> </section> <section id="translate-survey"> <div class="page-header"> <h2>{% trans "Translate survey into the XLSForm syntax" %}</h2> </div> <div class="row"> <div class="span6"> <p> {% blocktrans %}The first step in collecting survey data is to actually write the survey. For this tutorial we will be using the following survey:{% endblocktrans %} <ol> <li>{% trans "What is your name?" %}</li> <li>{% trans "How old are you?" %}</li> <li>{% trans "May I take your picture?" %}</li> <li>{% trans "Do you have any children?" %}</li> <li>{% trans "Record your GPS coordinates." %}</li> <li>{% trans "What web browsers do you use?" %}</li> </ol> {% blocktrans %}The second step is writing this survey in the xls2xform syntax. The idea behind this approach is that each question in the survey is a row in the spreadsheet. By using a spreadsheet we can expose most of the XForm features supported by ODK Collect. Check out the images to the right that show the xls2xform syntax for this survey.{% endblocktrans %} </p> </div> <div class="span10"> <img src="{{ STATIC_URL }}tutorial/survey_sheet.png" width="100%" alt="survey sheet" /><br /> <img src="{{ STATIC_URL }}tutorial/choices_sheet.png" width="100%" alt="choices sheet" /><br /> </div> </div> {% url "onadata.apps.main.views.syntax" as syntax_url %} {% blocktrans %}For more in depth information about the XLSForm syntax go <a href="{{ syntax_url }}">here</a>.{% endblocktrans %} </section> <section id="publish-form"> <div class="page-header"> <h2>{% trans "Upload XLSForm file to formhub" %}</h2> </div> <div class="row"> <div class="span6"> <p> {% blocktrans %}After creating an account and signing into the site you can publish forms for use with ODK Collect. On the right, we submit <a href="{{ STATIC_URL }}tutorial/tutorial.xls">tutorial.xls</a>, described above, for publication.{% endblocktrans %} </p> </div> <div class="span10"> <img src="{{ STATIC_URL }}tutorial/publish_survey.png" width="100%" alt="publish survey" /> </div> </div> <div class="row"> <div class="span6"> <p> {% blocktrans %}After publishing our first form, a new table appears showing our new form. Next we need to use ODK Collect to submit data for this form...{% endblocktrans %} </p> </div> <div class="span10"> <img src="{{ STATIC_URL }}tutorial/published_surveys.png" width="100%" alt="published surveys" /> </div> </div> </section> <section id="use-odk-collect"> <div class="page-header"> <h2>{% trans "Use ODK Collect to download form and submit data" %}</h2> </div> <div class="row"> <div class="span4"> <ul class="media-grid"><li><a href=""> <img width="210px" class="thumbnail" src="{{ STATIC_URL }}tutorial/server_preferences.png" alt="server preferences"> </a></li></ul> <p> {% blocktrans %}The url "of" this web application must be given to ODK Collect before it will get forms from and submit data to formhub. In ODK Collect's Main Menu, press the Menu button. Select Server Preferences, then Server. Enter <strong>{{ url }}</strong> as the server.{% endblocktrans %} </p> </div> <div class="span4"> <ul class="media-grid"><li><a href=""> <img width="210px" class="thumbnail" src="{{ STATIC_URL }}tutorial/download.png" alt="download"> </a></li></ul> <p> {% trans "Download your published form to your phone." %} </p> </div> <div class="span4"> <ul class="media-grid"><li><a href=""> <img width="210px" class="thumbnail" src="{{ STATIC_URL }}tutorial/question.png" alt="question"> </a></li></ul> <p> {% trans "Fill out the form on your phone." %} </p> </div> <div class="span4"> <ul class="media-grid"><li><a href=""> <img width="210px" class="thumbnail" src="{{ STATIC_URL }}tutorial/send_finished_data.png" alt="send finished data"> </a></li></ul> <p> {% blocktrans %}After filling out the form on your phone submit the data to the server.{% endblocktrans %} </p> </div> </div> </section> <section id="analyze-survey-data"> <div class="page-header"> <h2>{% trans "Use formhub to download and map data submissions" %}</h2> </div> <div class="row"> <div class="span6"> <p> {% blocktrans %}After submitting data from ODK Collect to the server you can now download the data as a nicely formatted csv or xls file.{% endblocktrans %} </p> </div> <div class="span10"> <img src="{{ STATIC_URL }}tutorial/submitted_data.png" width="100%" alt="submitted data" /> </div> </div> <div class="row"> <div class="span6"> <p> {% trans "And look at submissions on a map:" %} </p> </div> <div class="span10"> <img src="{{ STATIC_URL }}tutorial/map.png" width="100%" alt="map" /><br /> </div> </div> </section>
{ "content_hash": "9561cef3ef978cf2a94d430745519beb", "timestamp": "", "source": "github", "line_count": 147, "max_line_length": 373, "avg_line_length": 40.91156462585034, "alnum_prop": 0.5982707016960426, "repo_name": "ehealthafrica-ci/onadata", "id": "23dbfd1bf7fe391178ce9b0cbbaca364d9e47257", "size": "6014", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "onadata/apps/main/templates/getting_started.html", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "CSS", "bytes": "69975" }, { "name": "HTML", "bytes": "242432" }, { "name": "JavaScript", "bytes": "902865" }, { "name": "Makefile", "bytes": "2286" }, { "name": "Python", "bytes": "1841525" }, { "name": "Shell", "bytes": "9698" } ], "symlink_target": "" }
export default function sortItems(itemA, itemB) { return itemA.name <= itemB.name ? -1 : 1 }
{ "content_hash": "e2a9048b833feb695f640f6b6ca0db31", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 49, "avg_line_length": 31.666666666666668, "alnum_prop": 0.6947368421052632, "repo_name": "garth/cerebral", "id": "1db06e97f102a4705758afa51b8721b4281df2e7", "size": "95", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "packages/demos/demo/src/common/Collection/sort.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "12916" }, { "name": "HTML", "bytes": "2499" }, { "name": "JavaScript", "bytes": "175769" } ], "symlink_target": "" }
A notepad similar to that of Windows in terms of features with functionality to read documents aloud, adapted to several languages. Keywords: Java, Swing ### More details coming soon...
{ "content_hash": "b604c51131f362a12beecda7cb1c38df", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 131, "avg_line_length": 37.6, "alnum_prop": 0.7819148936170213, "repo_name": "haythemkh/advanced-notepad", "id": "095dd0604fb12323f00cd4e97043df8463ca6e42", "size": "208", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "19655" } ], "symlink_target": "" }
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // If directory files changes too often, don't rescan directory more than once // per specified interval const SIMULTANEOUS_RESCAN_INTERVAL = 1000; /** * Data model of the file manager. * * @param {DirectoryEntry} root File system root. * @param {boolean} singleSelection True if only one file could be selected * at the time. * @param {boolean} showGData Defines whether GData root should be should * (regardless of its mounts status). */ function DirectoryModel(root, singleSelection, showGData) { this.root_ = root; this.fileList_ = new cr.ui.ArrayDataModel([]); this.fileListSelection_ = singleSelection ? new cr.ui.ListSingleSelectionModel() : new cr.ui.ListSelectionModel(); this.showGData_ = showGData; this.runningScan_ = null; this.pendingScan_ = null; this.rescanTimeout_ = undefined; this.scanFailures_ = 0; // DirectoryEntry representing the current directory of the dialog. this.currentDirEntry_ = root; this.fileList_.prepareSort = this.prepareSort_.bind(this); this.autoSelectIndex_ = 0; this.rootsList_ = new cr.ui.ArrayDataModel([]); this.rootsListSelection_ = new cr.ui.ListSingleSelectionModel(); this.rootsListSelection_.addEventListener( 'change', this.onRootsSelectionChanged_.bind(this)); // True if we should filter out files that start with a dot. this.filterHidden_ = true; // Readonly status for removable volumes. this.readonly_ = false; } /** * The name of the directory containing externally * mounted removable storage volumes. */ DirectoryModel.REMOVABLE_DIRECTORY = 'removable'; /** * The name of the directory containing externally * mounted archive file volumes. */ DirectoryModel.ARCHIVE_DIRECTORY = 'archive'; /** * Type of a root directory. * @enum */ DirectoryModel.RootType = { DOWNLOADS: 'downloads', ARCHIVE: 'archive', REMOVABLE: 'removable', GDATA: 'gdata' }; /** * The name of the downloads directory. */ DirectoryModel.DOWNLOADS_DIRECTORY = 'Downloads'; /** * The name of the gdata provider directory. */ DirectoryModel.GDATA_DIRECTORY = 'gdata'; DirectoryModel.prototype = { __proto__: cr.EventTarget.prototype, /** * Files in the current directory. * @type {cr.ui.ArrayDataModel} */ get fileList() { return this.fileList_; }, /** * Selection in the fileList. * @type {cr.ui.ListSelectionModel|cr.ui.ListSingleSelectionModel} */ get fileListSelection() { return this.fileListSelection_; }, /** * Top level Directories from user perspective. * @type {cr.ui.ArrayDataModel} */ get rootsList() { return this.rootsList_; }, /** * Selection in the rootsList. * @type {cr.ui.ListSingleSelectionModel} */ get rootsListSelection() { return this.rootsListSelection_; }, /** * Root path for the current directory (parent directory is not navigatable * for the user). * @type {string} */ get rootPath() { return DirectoryModel.getRootPath(this.currentEntry.fullPath); }, get rootType() { return DirectoryModel.getRootType(this.currentEntry.fullPath); }, get rootName() { return DirectoryModel.getRootName(this.currentEntry.fullPath); }, get rootEntry() { return this.rootsList.item(this.rootsListSelection.selectedIndex); }, /** * True if current directory is read only. Value may be set * for directories on a removable device. * @type {boolean} */ get readonly() { switch (this.rootType) { case DirectoryModel.RootType.REMOVABLE: return this.readonly_; case DirectoryModel.RootType.ARCHIVE: return true; case DirectoryModel.RootType.DOWNLOADS: return false; case DirectoryModel.RootType.GDATA: return false; default: return true; } }, set readonly(value) { if (this.rootType == DirectoryModel.RootType.REMOVABLE) { this.readonly_ = !!value; } }, get isSystemDirectoy() { var path = this.currentEntry.fullPath; return path == '/' || path == '/' + DirectoryModel.REMOVABLE_DIRECTORY || path == '/' + DirectoryModel.ARCHIVE_DIRECTORY; }, get filterHidden() { return this.filterHidden_; }, set filterHidden(value) { if (this.filterHidden_ != value) { this.filterHidden_ = value; this.rescan(); } }, /** * Current directory. * @type {DirectoryEntry} */ get currentEntry() { return this.currentDirEntry_; }, set autoSelectIndex(value) { this.autoSelectIndex_ = value; }, /** * Names of selected files. * @type {Array.<string>} */ get selectedNames() { var indexes = this.fileListSelection_.selectedIndexes; var dataModel = this.fileList_; if (dataModel) { return indexes.map(function(i) { return dataModel.item(i).name; }); } return []; }, set selectedNames(value) { var indexes = []; var dataModel = this.fileList_; function safeKey(key) { // The transformation must: // 1. Never generate a reserved name ('__proto__') // 2. Keep different keys different. return '#' + key; } var hash = {}; for (var i = 0; i < value.length; i++) hash[safeKey(value[i])] = 1; for (var i = 0; i < dataModel.length; i++) { if (hash.hasOwnProperty(safeKey(dataModel.item(i).name))) indexes.push(i); } this.fileListSelection_.selectedIndexes = indexes; }, /** * Lead item file name. * @type {string?} */ get leadName() { var index = this.fileListSelection_.leadIndex; return index >= 0 && this.fileList_.item(index).name; }, set leadName(value) { for (var i = 0; i < this.fileList_.length; i++) { if (this.fileList_.item(i).name == value) { this.fileListSelection_.leadIndex = i; return; } } }, /** * Schedule rescan with delay. If another rescan has been scheduled does * nothing. Designed to handle directory change notification. File operation * may cause a few notifications what should cause a single refresh. */ rescanLater: function() { if (this.rescanTimeout_) return; // Rescan already scheduled. var self = this; function onTimeout() { self.rescanTimeout_ = undefined; self.rescan(); } this.rescanTimeout_ = setTimeout(onTimeout, SIMULTANEOUS_RESCAN_INTERVAL); }, /** * Rescan current directory. May be called indirectly through rescanLater or * directly in order to reflect user action. */ rescan: function() { if (this.rescanTimeout_) { clearTimeout(this.rescanTimeout_); this.rescanTimeout_ = undefined; } var fileList = []; var successCallback = (function() { this.replaceFileList_(fileList); cr.dispatchSimpleEvent(this, 'rescan-completed'); }).bind(this); if (this.runningScan_) { if (!this.pendingScan_) this.pendingScan_ = this.createScanner_(fileList, successCallback); return; } this.runningScan_ = this.createScanner_(fileList, successCallback); this.runningScan_.run(); }, createScanner_: function(list, successCallback) { var self = this; function onSuccess() { self.scanFailures_ = 0; successCallback(); if (self.pendingScan_) { self.runningScan_ = self.pendingScan_; self.pendingScan_ = null; self.runningScan_.run(); } else { self.runningScan_ = null; } } function onFailure() { self.scanFailures_++; if (self.scanFailures_ <= 1) self.rescanLater(); } return new DirectoryModel.Scanner( this.currentDirEntry_, list, onSuccess, onFailure, this.prefetchCacheForSorting_.bind(this), this.filterHidden_); }, replaceFileList_: function(entries) { cr.dispatchSimpleEvent(this, 'begin-update-files'); this.fileListSelection_.beginChange(); var selectedNames = this.selectedNames; // Restore leadIndex in case leadName no longer exists. var leadIndex = this.fileListSelection_.leadIndex; var leadName = this.leadName; var spliceArgs = [].slice.call(entries); spliceArgs.unshift(0, this.fileList_.length); this.fileList_.splice.apply(this.fileList_, spliceArgs); this.selectedNames = selectedNames; this.fileListSelection_.leadIndex = leadIndex; this.leadName = leadName; this.fileListSelection_.endChange(); cr.dispatchSimpleEvent(this, 'end-update-files'); }, /** * Cancels waiting and scheduled rescans and starts new scan. * * If the scan completes successfully on the first attempt, the callback will * be invoked and a 'scan-completed' event will be dispatched. If the scan * fails for any reason, we'll periodically retry until it succeeds (and then * send a 'rescan-complete' event) or is cancelled or replaced by another * scan. * * @param {Function} callback Called if scan completes on the first attempt. * Note that this will NOT be called if the scan fails but later succeeds. */ scan_: function(callback) { if (this.rescanTimeout_) { clearTimeout(this.rescanTimeout_); this.rescanTimeout_ = 0; } if (this.runningScan_) { this.runningScan_.cancel(); this.runningScan_ = null; } this.pendingScan_ = null; var onDone = function() { cr.dispatchSimpleEvent(this, 'scan-completed'); callback(); }.bind(this); // Clear the table first. this.fileList_.splice(0, this.fileList_.length); cr.dispatchSimpleEvent(this, 'scan-started'); if (this.currentDirEntry_ == this.unmountedGDataEntry_) { onDone(); return; } this.runningScan_ = this.createScanner_(this.fileList_, onDone); this.runningScan_.run(); }, prefetchCacheForSorting_: function(entries, callback) { var field = this.fileList_.sortStatus.field; if (field) { this.prepareSortEntries_(entries, field, callback); } else { callback(); return; } }, /** * Delete the list of files and directories from filesystem and * update the file list. * @param {Array.<Entry>} entries Entries to delete. * @param {Function} opt_callback Called when finished. */ deleteEntries: function(entries, opt_callback) { var downcount = entries.length + 1; var onComplete = opt_callback ? function() { if (--downcount == 0) opt_callback(); } : function() {}; const fileList = this.fileList_; for (var i = 0; i < entries.length; i++) { var entry = entries[i]; var onSuccess = function(removedEntry) { var index = fileList.indexOf(removedEntry); if (index >= 0) fileList.splice(index, 1); onComplete(); }.bind(null, entry); util.removeFileOrDirectory( entry, onSuccess, util.flog('Error deleting ' + entry.fullPath, onComplete)); } onComplete(); }, /** * Rename the entry in the filesystem and update the file list. * @param {Entry} entry Entry to rename. * @param {string} newName * @param {Function} errorCallback Called on error. * @param {Function} opt_successCallback Called on success. */ renameEntry: function(entry, newName, errorCallback, opt_successCallback) { var self = this; function onSuccess(newEntry) { self.prefetchCacheForSorting_([newEntry], function() { const fileList = self.fileList_; var index = fileList.indexOf(entry); if (index >= 0) fileList.splice(index, 1, newEntry); self.selectEntry(newName); // If the entry doesn't exist in the list it mean that it updated from // outside (probably by directory rescan). if (opt_successCallback) opt_successCallback(); }); } entry.moveTo(this.currentEntry, newName, onSuccess, errorCallback); }, /** * Checks if current directory contains a file or directory with this name. * @param {string} newName Name to check. * @param {function(boolean, boolean?)} callback Called when the result's * available. First parameter is true if the entry exists and second * is true if it's a file. */ doesExist: function(newName, callback) { util.resolvePath(this.currentEntry, newName, function(entry) { callback(true, entry.isFile); }, callback.bind(window, false)); }, /** * Creates directory and updates the file list. */ createDirectory: function(name, successCallback, errorCallback) { const self = this; function onSuccess(newEntry) { self.prefetchCacheForSorting_([newEntry], function() { const fileList = self.fileList_; var existing = fileList.slice().filter( function(e) { return e.name == name; }); if (existing.length) { self.selectEntry(name); successCallback(existing[0]); } else { self.fileListSelection.beginChange(); fileList.splice(0, 0, newEntry); self.selectEntry(name); self.fileListSelection.endChange(); successCallback(newEntry); } }); } this.currentEntry.getDirectory(name, {create: true, exclusive: true}, onSuccess, errorCallback); }, /** * Changes directory. Causes 'directory-change' event. * * @param {string} path New current directory path. */ changeDirectory: function(path) { var onDirectoryResolved = function(dirEntry) { var autoSelect = this.selectIndex.bind(this, this.autoSelectIndex_); this.changeDirectoryEntry_(dirEntry, autoSelect, false); }.bind(this); if (this.unmountedGDataEntry_ && DirectoryModel.getRootType(path) == DirectoryModel.RootType.GDATA) { this.readonly_ = true; // TODO(kaznacheeev): Currently if path points to some GData subdirectory // and GData is not mounted we will change to the fake GData root and // ignore the rest of the path. Consider remembering the path and // changing to it once GDdata is mounted. This is only relevant for cases // when we open the File Manager with an URL pointing to GData (e.g. via // a bookmark). onDirectoryResolved(this.unmountedGDataEntry_); return; } this.readonly_ = false; if (path == '/') return onDirectoryResolved(this.root_); this.root_.getDirectory( path, {create: false}, onDirectoryResolved, function(error) { // TODO(serya): We should show an alert. console.error('Error changing directory to: ' + path + ', ' + error); }); }, /** * Change the current directory to the directory represented by a * DirectoryEntry. * * Dispatches the 'directory-changed' event when the directory is successfully * changed. * * @param {DirectoryEntry} dirEntry The absolute path to the new directory. * @param {function} action Action executed if the directory loads * successfully. By default selects the first item (unless it's a save * dialog). * @param {boolean} initial True if it comes from setupPath and * false if caused by an user action. */ changeDirectoryEntry_: function(dirEntry, action, initial) { var previous = this.currentEntry; this.currentDirEntry_ = dirEntry; function onRescanComplete() { action(); // For tests that open the dialog to empty directories, everything // is loaded at this point. chrome.test.sendMessage('directory-change-complete'); } this.updateRootsListSelection_(); this.scan_(onRescanComplete); var e = new cr.Event('directory-changed'); e.previousDirEntry = previous; e.newDirEntry = dirEntry; e.initial = initial; this.dispatchEvent(e); }, /** * Change the state of the model to reflect the specified path (either a * file or directory). * * @param {string} path The root path to use * @param {Function=} opt_loadedCallback Invoked when the entire directory * has been loaded and any default file selected. If there are any * errors loading the directory this will not get called (even if the * directory loads OK on retry later). Will NOT be called if another * directory change happened while setupPath was in progress. * @param {Function=} opt_pathResolveCallback Invoked as soon as the path has * been resolved, and called with the base and leaf portions of the path * name, and a flag indicating if the entry exists. Will be called even * if another directory change happened while setupPath was in progress, * but will pass |false| as |exist| parameter. */ setupPath: function(path, opt_loadedCallback, opt_pathResolveCallback) { var overridden = false; function onExternalDirChange() { overridden = true } this.addEventListener('directory-changed', onExternalDirChange); var resolveCallback = function(exists) { this.removeEventListener('directory-changed', onExternalDirChange); if (opt_pathResolveCallback) opt_pathResolveCallback(baseName, leafName, exists && !overridden); }.bind(this); var changeDirectoryEntry = function(entry, callback, initial, exists) { resolveCallback(exists); if (!overridden) this.changeDirectoryEntry_(entry, callback, initial); }.bind(this); var INITIAL = true; var EXISTS = true; // Split the dirname from the basename. var ary = path.match(/^(?:(.*)\/)?([^\/]*)$/); var autoSelect = function() { this.selectIndex(this.autoSelectIndex_); if (opt_loadedCallback) opt_loadedCallback(); }.bind(this); if (!ary) { console.warn('Unable to split default path: ' + path); changeDirectoryEntry(this.root_, autoSelect, INITIAL, !EXISTS); return; } var baseName = ary[1]; var leafName = ary[2]; function onLeafFound(baseDirEntry, leafEntry) { if (leafEntry.isDirectory) { baseName = path; leafName = ''; changeDirectoryEntry(leafEntry, autoSelect, INITIAL, EXISTS); return; } // Leaf is an existing file, cd to its parent directory and select it. changeDirectoryEntry(baseDirEntry, function() { this.selectEntry(leafEntry.name); if (opt_loadedCallback) opt_loadedCallback(); }.bind(this), !INITIAL /*HACK*/, EXISTS); // TODO(kaznacheev): Fix history.replaceState for the File Browser and // change !INITIAL to INITIAL. Passing |false| makes things // less ugly for now. } function onLeafError(baseDirEntry, err) { // Usually, leaf does not exist, because it's just a suggested file name. if (err.code != FileError.NOT_FOUND_ERR) console.log('Unexpected error resolving default leaf: ' + err); changeDirectoryEntry(baseDirEntry, autoSelect, INITIAL, !EXISTS); } var onBaseError = function(err) { console.log('Unexpected error resolving default base "' + baseName + '": ' + err); if (path != '/' + DirectoryModel.DOWNLOADS_DIRECTORY) { // Can't find the provided path, let's go to default one instead. resolveCallback(!EXISTS); if (!overridden) this.setupDefaultPath(opt_loadedCallback); } else { // Well, we can't find the downloads dir. Let's just show something, // or we will get an infinite recursion. changeDirectoryEntry(this.root_, opt_loadedCallback, INITIAL, !EXISTS); } }.bind(this); var onBaseFound = function(baseDirEntry) { if (!leafName) { // Default path is just a directory, cd to it and we're done. changeDirectoryEntry(baseDirEntry, autoSelect, INITIAL, !EXISTS); return; } util.resolvePath(this.root_, path, onLeafFound.bind(this, baseDirEntry), onLeafError.bind(this, baseDirEntry)); }.bind(this); var root = this.root_; if (baseName) { root.getDirectory( baseName, {create: false}, onBaseFound, onBaseError); } else { this.getDefaultDirectory_(function(defaultDir) { baseName = defaultDir; root.getDirectory( baseName, {create: false}, onBaseFound, onBaseError); }); } }, setupDefaultPath: function(opt_callback) { var overridden = false; function onExternalDirChange() { overridden = true } this.addEventListener('directory-changed', onExternalDirChange); this.getDefaultDirectory_(function(path) { this.removeEventListener('directory-changed', onExternalDirChange); if (!overridden) this.setupPath(path, opt_callback); }.bind(this)); }, getDefaultDirectory_: function(callback) { function onGetDirectoryComplete(entries, error) { if (entries.length > 0) callback(entries[0].fullPath); else callback('/' + DirectoryModel.DOWNLOADS_DIRECTORY); } // No preset given, find a good place to start. // Check for removable devices, if there are none, go to Downloads. util.readDirectory(this.root_, DirectoryModel.REMOVABLE_DIRECTORY, onGetDirectoryComplete); }, selectEntry: function(name) { var dm = this.fileList_; for (var i = 0; i < dm.length; i++) { if (dm.item(i).name == name) { this.selectIndex(i); return; } } }, selectIndex: function(index) { // this.focusCurrentList_(); if (index >= this.fileList_.length) return; // If a list bound with the model it will do scrollIndexIntoView(index). this.fileListSelection_.selectedIndex = index; }, /** * Cache necessary data before a sort happens. * * This is called by the table code before a sort happens, so that we can * go fetch data for the sort field that we may not have yet. */ prepareSort_: function(field, callback) { this.prepareSortEntries_(this.fileList_.slice(), field, callback); }, prepareSortEntries_: function(entries, field, callback) { var cacheFunction; if (field == 'name' || field == 'cachedMtime_') { // Mtime is the tie-breaker for a name sort, so we need to resolve // it for both mtime and name sorts. cacheFunction = this.cacheEntryDateAndSize; } else if (field == 'cachedSize_') { cacheFunction = this.cacheEntryDateAndSize; } else if (field == 'type') { cacheFunction = this.cacheEntryFileType; } else if (field == 'cachedIconType_') { cacheFunction = this.cacheEntryIconType; } else { setTimeout(callback, 0); return; } // Start one fake wait to prevent calling the callback twice. var waitCount = 1; for (var i = 0; i < entries.length ; i++) { var entry = entries[i]; if (!(field in entry)) { waitCount++; cacheFunction(entry, onCacheDone, onCacheDone); } } onCacheDone(); // Finish the fake callback. function onCacheDone() { waitCount--; // If all caching functions finished synchronously or entries.length = 0 // call the callback synchronously. if (waitCount == 0) setTimeout(callback, 0); } }, /** * Get root entries asynchronously. * @param {function(Array.<Entry>} callback Called when roots are resolved. * @param {boolean} resolveGData See comment for updateRoots. */ resolveRoots_: function(callback, resolveGData) { var groups = { downloads: null, archives: null, removables: null, gdata: null }; metrics.startInterval('Load.Roots'); function done() { for (var i in groups) if (!groups[i]) return; callback(groups.downloads. concat(groups.gdata). concat(groups.archives). concat(groups.removables)); metrics.recordInterval('Load.Roots'); } function append(index, values, opt_error) { groups[index] = values; done(); } function onDownloads(entry) { groups.downloads = [entry]; done(); } function onDownloadsError(error) { groups.downloads = []; done(); } var self = this; function onGData(entry) { console.log('GData found:', entry); self.unmountedGDataEntry_ = null; groups.gdata = [entry]; done(); } function onGDataError(error) { console.log('GData error: ', error); self.unmountedGDataEntry_ = { unmounted: true, // Clients use this field to distinguish a fake root. toURL: function() { return '' }, fullPath: '/' + DirectoryModel.GDATA_DIRECTORY }; groups.gdata = [self.unmountedGDataEntry_]; done(); } var root = this.root_; root.getDirectory(DirectoryModel.DOWNLOADS_DIRECTORY, { create: false }, onDownloads, onDownloadsError); util.readDirectory(root, DirectoryModel.ARCHIVE_DIRECTORY, append.bind(this, 'archives')); util.readDirectory(root, DirectoryModel.REMOVABLE_DIRECTORY, append.bind(this, 'removables')); if (this.showGData_) { if (resolveGData) { root.getDirectory(DirectoryModel.GDATA_DIRECTORY, { create: false }, onGData, onGDataError); } else { onGDataError('lazy mount'); } } else { groups.gdata = []; } }, /** * @param {function} opt_callback Called when all roots are resolved. * @param {boolean} opt_resolveGData If true GData should be resolved for real, * If false a stub entry should be created. */ updateRoots: function(opt_callback, opt_resolveGData) { console.log('resolving roots'); var self = this; this.resolveRoots_(function(rootEntries) { console.log('resolved roots:', rootEntries); var dm = self.rootsList_; var args = [0, dm.length].concat(rootEntries); dm.splice.apply(dm, args); self.updateRootsListSelection_(); if (opt_callback) opt_callback(); }, opt_resolveGData); }, onRootsSelectionChanged_: function(event) { var root = this.rootsList.item(this.rootsListSelection.selectedIndex); if (root && this.rootPath != root.fullPath) this.changeDirectory(root.fullPath); }, updateRootsListSelection_: function() { var roots = this.rootsList_; var rootPath = this.rootPath; for (var index = 0; index < roots.length; index++) { if (roots.item(index).fullPath == rootPath) { this.rootsListSelection.selectedIndex = index; return; } } this.rootsListSelection.selectedIndex = -1; } }; DirectoryModel.getRootPath = function(path) { var type = DirectoryModel.getRootType(path); if (type == DirectoryModel.RootType.DOWNLOADS) return '/' + DirectoryModel.DOWNLOADS_DIRECTORY; if (type == DirectoryModel.RootType.GDATA) return '/' + DirectoryModel.GDATA_DIRECTORY; function subdir(dir) { var end = path.indexOf('/', dir.length + 2); return end == -1 ? path : path.substr(0, end); } if (type == DirectoryModel.RootType.ARCHIVE) return subdir(DirectoryModel.ARCHIVE_DIRECTORY); if (type == DirectoryModel.REMOVABLE_DIRECTORY) return subdir(DirectoryModel.REMOVABLE_DIRECTORY); return '/'; }; DirectoryModel.getRootName = function(path) { var root = DirectoryModel.getRootPath(path); var index = root.lastIndexOf('/'); return index == -1 ? root : root.substring(index + 1); }; DirectoryModel.getRootType = function(path) { function isTop(dir) { return path.substr(1, dir.length) == dir; } if (isTop(DirectoryModel.DOWNLOADS_DIRECTORY)) return DirectoryModel.RootType.DOWNLOADS; else if (isTop(DirectoryModel.GDATA_DIRECTORY)) return DirectoryModel.RootType.GDATA; else if (isTop(DirectoryModel.ARCHIVE_DIRECTORY)) return DirectoryModel.RootType.ARCHIVE; else if(isTop(DirectoryModel.REMOVABLE_DIRECTORY)) return DirectoryModel.RootType.REMOVABLE; return ''; }; DirectoryModel.isRootPath = function(path) { if (path[path.length - 1] == '/') path = path.substring(0, path.length - 1); return DirectoryModel.getRootPath(path) == path; }; /** * @constructor * @param {DirectoryEntry} dir Directory to scan. * @param {Array.<Entry>|cr.ui.ArrayDataModel} list Target to put the files. * @param {Function} successCallback Callback to call when (and if) scan * successfully completed. * @param {Function} errorCallback Callback to call in case of IO error. * @param {function(Array.<Entry>):void, Function)} preprocessChunk * Callback to preprocess each chunk of files. * @param {boolean} filterHidden True if files started with dots are ignored. */ DirectoryModel.Scanner = function(dir, list, successCallback, errorCallback, preprocessChunk, filterHidden) { this.cancelled_ = false; this.list_ = list; this.dir_ = dir; this.reader_ = null; this.filterHidden_ = !!filterHidden; this.preprocessChunk_ = preprocessChunk; this.successCallback_ = successCallback; this.errorCallback_ = errorCallback; }; DirectoryModel.Scanner.prototype = { __proto__: cr.EventTarget.prototype, cancel: function() { this.cancelled_ = true; }, run: function() { metrics.startInterval('DirectoryScan'); this.reader_ = this.dir_.createReader(); this.readNextChunk_(); }, readNextChunk_: function() { this.reader_.readEntries(this.onChunkComplete_.bind(this), this.errorCallback_); }, onChunkComplete_: function(entries) { if (this.cancelled_) return; if (entries.length == 0) { this.successCallback_(); this.recordMetrics_(); return; } // Splice takes the to-be-spliced-in array as individual parameters, // rather than as an array, so we need to perform some acrobatics... var spliceArgs = [].slice.call(entries); // Hide files that start with a dot ('.'). // TODO(rginda): User should be able to override this. Support for other // commonly hidden patterns might be nice too. if (this.filterHidden_) { spliceArgs = spliceArgs.filter(function(e) { return e.name.substr(0, 1) != '.'; }); } var self = this; self.preprocessChunk_(spliceArgs, function() { spliceArgs.unshift(0, 0); // index, deleteCount self.list_.splice.apply(self.list_, spliceArgs); // Keep reading until entries.length is 0. self.readNextChunk_(); }); }, recordMetrics_: function() { metrics.recordInterval('DirectoryScan'); if (this.dir_.fullPath == '/' + DirectoryModel.DOWNLOADS_DIRECTORY) { metrics.recordMediumCount("DownloadsCount", this.list_.length); } } };
{ "content_hash": "7642ba3cca537d8e45758b762b57b3ed", "timestamp": "", "source": "github", "line_count": 1029, "max_line_length": 80, "avg_line_length": 30.451895043731778, "alnum_prop": 0.6375618318174565, "repo_name": "gavinp/chromium", "id": "68031d68acf07bb7b25cc742ca5b5de4730c3b04", "size": "31335", "binary": false, "copies": "1", "ref": "refs/heads/trunk", "path": "chrome/browser/resources/file_manager/js/directory_model.js", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Assembly", "bytes": "1178292" }, { "name": "C", "bytes": "72353788" }, { "name": "C++", "bytes": "117593783" }, { "name": "F#", "bytes": "381" }, { "name": "Go", "bytes": "10440" }, { "name": "Java", "bytes": "24087" }, { "name": "JavaScript", "bytes": "8781314" }, { "name": "Objective-C", "bytes": "5340290" }, { "name": "PHP", "bytes": "97796" }, { "name": "Perl", "bytes": "918286" }, { "name": "Python", "bytes": "5942009" }, { "name": "R", "bytes": "524" }, { "name": "Shell", "bytes": "4149832" }, { "name": "Tcl", "bytes": "255109" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en" class="no-js"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>Kickball/Awesome-Selfhosted</title> <meta name="authors" content="Sheldon Rupp,Blor XYZ,Kickball,Selfhosted"> <meta name="keywords" content="sheldon,rupp,sheldonrupp,ruppsheldon,sheldon rupp,rupp sheldon,kickball,kickball/awesome-selfhosted,awesome-selfhosted,awesome,awesome selfhosted,selfhosted,selfhost,self host,awesome selfhost,hosted,host"> <meta name="description" content="This website is a mirror of GitHub repository for Awesome-Selfhosted maintained by Kickball on. I take no credit."> </head> <?php ini_set('display_errors',1); ini_set('display_startup_errors',1); error_reporting(-1); ?> <style> body { font: normal 0.8764em / 1.5em; margin: 0 } html>body { font-size: 14px } p { margin: 1.3125em 0; font-size: 1.1429em; line-height: 1.3125em } li { font-size: 100% } h1 { margin: 0.6563em 0; font-size: 2.2857em; line-height: 0.6563em } h2 { margin: 0.875em 0; font-size: 1.7143em; line-height: 0.875em } h3 { margin: 1em 0; font-size: 1.5em; line-height: 1em } h4 { margin: 1.1667em 0; font-size: 1.2857em; line-height: 1.1667em } h5 { margin: 1.3125em 0; font-size: 1.1429em; line-height: 1.3125em } h6 { margin: 1.5em 0; font-size: 1em; line-height: 1.5em } body, p, td, div { font-family: "Lucida Grande", Lucida, Verdana, sans-serif; color: #333; word-wrap: break-word; -webkit-font-smoothing: antialiased } h1, h2, h3, h4 { color: #333; line-height: 1.5em } p { margin: 0 0 1.7em 0 } abbr, acronym { border-bottom: 1px dotted #aaa } a { color: #0d6ea1; text-decoration: none; -webkit-transition: color .2s ease-in-out; -moz-transition: color .2s ease-in-out; -o-transition: color .2s ease-in-out; -ms-transition: color .2s ease-in-out; transition: color .2s ease-in-out } a:hover { color: #3593d9 } .footnote { font-size: .8em; vertical-align: super; color: #0d6ea1 } #wrapper img { max-width: 100%; height: auto } dt { font-weight: bold } dd { margin-bottom: 1em } blockquote { margin-left: 10px } .footnotes { -webkit-column-break-inside: avoid-column; -webkit-column-break-before: always } .footnotes li { margin-left: 5px } @media screen { ::selection { background: rgba(157, 193, 200, 0.5) } h1::selection { background-color: rgba(45, 156, 208, 0.3) } h2::selection { background-color: rgba(90, 182, 224, 0.3) } h3::selection, h4::selection, h5::selection, h6::selection, li::selection, ol::selection { background-color: rgba(133, 201, 232, 0.3) } code::selection { background-color: rgba(0, 0, 0, 0.7); color: #eee } code span::selection { background-color: rgba(0, 0, 0, 0.7) !important; color: #eee !important } a::selection { background-color: rgba(255, 230, 102, 0.2) } .inverted a::selection { background-color: rgba(255, 230, 102, 0.6) } td::selection, th::selection, caption::selection { background-color: rgba(180, 237, 95, 0.5) } .inverted { background: #0b2531; background: #111 !important } .inverted #wrapper { background: #111 !important } .inverted p, .inverted td, .inverted li, .inverted h1, .inverted h2, .inverted h3, .inverted h4, .inverted h5, .inverted h6, .inverted pre, .inverted code, .inverted th, .inverted .math, .inverted dd, .inverted dt { color: #eee !important } .inverted pre { background: #ddd } .inverted pre code { color: #333 !important } .inverted a { color: #fff; text-decoration: underline } body { padding: 20px !important } #wrapper { background: transparent; color: #303030; text-indent: 0px; padding: 10px; margin: 10px !important; overflow: visible; -webkit-hyphens: auto; hyphens: auto; max-width: 100% !important } } @media only screen and (min-width: 1101px) { body { font-size: 0.8em; line-height: 1.5em } } @media only screen and (max-width: 1100px) { body { font-size: 0.8em; line-height: 1.5em } } @media only screen and (max-width: 599px) { body { font-size: 0.8em; line-height: 1.5em } } ul, ol { padding: 0; list-style-position: outside; margin-left: 20px } li { margin-bottom: .5em } li>p { margin: 0 0 1em } ul ul, ul ol { margin-top: 1em } caption, col, colgroup, table, tbody, td, tfoot, th, thead, tr { border-spacing: 0 } table { display: table; table-layout: fixed; border-collapse: collapse; empty-cells: hide; margin: 0; padding: 0; margin-bottom: 24px; border: 0 } caption { display: table-caption; font-weight: bold } col { display: table-column } colgroup { display: table-column-group } tbody { display: table-row-group } tfoot { display: table-footer-group } thead { display: table-header-group } td { display: table-cell } th { display: table-cell; font-weight: bold } tr { display: table-row } table { margin-top: -1px; margin-bottom: 23px; border: 1px solid rgba(0, 0, 0, 0.25) } table th, table td { padding: 0 1em; font-size: 1.1em; line-height: 23px } table thead { background-color: rgba(0, 0, 0, 0.15) } table tbody { background-color: rgba(0, 0, 0, 0.05) } table tfoot { background-color: rgba(0, 0, 0, 0.15) } table tr:nth-child(odd) { background-color: rgba(255, 255, 255, 0.06) } table tr:nth-child(even) { background-color: rgba(0, 0, 0, 0.06) } table th:nth-child(odd) { background-color: rgba(255, 255, 255, 0.06) } table td:nth-child(odd) { background-color: rgba(255, 255, 255, 0.06) } table td:nth-child(even) { background-color: rgba(0, 0, 0, 0.06) } table thead { border: 1px solid rgba(0, 0, 0, 0.15); border-bottom: 1px solid rgba(0, 0, 0, 0.2) } table tfoot { border: 1px solid rgba(0, 0, 0, 0.15); border-top: 1px solid rgba(0, 0, 0, 0.2) } figure { position: relative; display: inline-block; margin-bottom: 1.2em; overflow: hidden } figcaption { text-align: center; color: #666 } @media print { body { overflow: auto; max-width: 600px } img, table, figure { page-break-inside: avoid } } pre code { -webkit-column-break-inside: avoid-column } .poetry pre { font-family: Georgia, Garamond, serif !important; font-style: italic; font-size: 110% !important; line-height: 1.6em; display: block; margin-left: 1em } .poetry pre code { font-family: Georgia, Garamond, serif !important; word-break: break-all; word-break: break-word; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; white-space: pre-wrap } sup, sub, a.footnote { font-size: 1.4ex; height: 0; line-height: 1; vertical-align: super; position: relative } sub { vertical-align: sub; top: -1px } .modern #firstdiff { width: 105% !important; background: transparent; text-align: right } @media screen { #wrapper { position: absolute; left: 20px; top: 20px; bottom: 20px } } /* github.com style (c) Vasily Polovnyov <vast@whiteants.net> */ .hljs { display: block; padding: 0.5em; color: #333; background: #f8f8f8 } .hljs-comment, .hljs-template_comment, .diff .hljs-header, .hljs-javadoc { color: #998; font-style: italic } .hljs-keyword, .css .rule .hljs-keyword, .hljs-winutils, .javascript .hljs-title, .nginx .hljs-title, .hljs-subst, .hljs-request, .hljs-status { color: #333; font-weight: bold } .hljs-number, .hljs-hexcolor, .ruby .hljs-constant { color: #099; } .hljs-string, .hljs-tag .hljs-value, .hljs-phpdoc, .tex .hljs-formula { color: #d14 } .hljs-title, .hljs-id, .coffeescript .hljs-params, .scss .hljs-preprocessor { color: #900; font-weight: bold } .javascript .hljs-title, .lisp .hljs-title, .clojure .hljs-title, .hljs-subst { font-weight: normal } .hljs-class .hljs-title, .haskell .hljs-type, .vhdl .hljs-literal, .tex .hljs-command { color: #458; font-weight: bold } .hljs-tag, .hljs-tag .hljs-title, .hljs-rules .hljs-property, .django .hljs-tag .hljs-keyword { color: #000080; font-weight: normal } .hljs-attribute, .hljs-variable, .lisp .hljs-body { color: #008080 } .hljs-regexp { color: #009926 } .hljs-symbol, .ruby .hljs-symbol .hljs-string, .lisp .hljs-keyword, .tex .hljs-special, .hljs-prompt { color: #990073 } .hljs-built_in, .lisp .hljs-title, .clojure .hljs-built_in { color: #0086b3 } .hljs-preprocessor, .hljs-pragma, .hljs-pi, .hljs-doctype, .hljs-shebang, .hljs-cdata { color: #999; font-weight: bold } .hljs-deletion { background: #fdd } .hljs-addition { background: #dfd } .diff .hljs-change { background: #0086b3 } .hljs-chunk { color: #aaa } #mkreplaced-toc { list-style-position: inside; padding: 0; margin: 0 0 0 1rem; list-style-type: none } #mkreplaced-toc li::before { content: '' } #mkreplaced-toc li { font-size: 1.5rem; line-height: 1.5; font-weight: normal } #mkreplaced-toc li ul { font-size: 1.3rem; font-weight: 300; padding: .5rem 0; margin: 0 0 0 1rem } #mkreplaced-toc li.missing { list-style-type: none !important } #mkreplaced-toc.max-1 ul, #mkreplaced-toc.max1 ul { display: none } #mkreplaced-toc.max-2 ul ul, #mkreplaced-toc.max2 ul ul { display: none } #mkreplaced-toc.max-3 ul ul ul, #mkreplaced-toc.max3 ul ul ul { display: none } #mkreplaced-toc.max-4 ul ul ul ul, #mkreplaced-toc.max4 ul ul ul ul { display: none } #mkreplaced-toc.max-5 ul ul ul ul ul, #mkreplaced-toc.max5 ul ul ul ul ul { display: none } @media print { #wrapper #generated-toc-clone, #generated-toc { display: none!important } } #wrapper #generated-toc-clone, #wrapper #mkreplaced-toc, #wrapper #generated-toc-clone ul, #wrapper #mkreplaced-toc ul { list-style-position: inside } #wrapper #generated-toc-clone li.missing, #wrapper #mkreplaced-toc li.missing { list-style-type: none!important } #wrapper #generated-toc-clone, #wrapper #mkreplaced-toc { list-style-type: upper-roman } #wrapper #generated-toc-clone>li>ul, #wrapper #mkreplaced-toc>li>ul { list-style-type: decimal } #wrapper #generated-toc-clone>li>ul>li>ul, #wrapper #mkreplaced-toc>li>ul>li>ul { list-style-type: decimal-leading-zero } #wrapper #generated-toc-clone>li>ul>li>ul>li>ul, #wrapper #mkreplaced-toc>li>ul>li>ul>li>ul { list-style-type: lower-greek } #wrapper #generated-toc-clone>li>ul>li>ul>li>ul>li>ul, #wrapper #mkreplaced-toc>li>ul>li>ul>li>ul>li>ul { list-style-type: disc } #wrapper #generated-toc-clone>li>ul>li>ul>li>ul>li>ul>li>ul, #wrapper #mkreplaced-toc>li>ul>li>ul>li>ul>li>ul>li>ul { list-style-type: square } #wrapper #generated-toc-clone, #wrapper #mkreplaced-toc { list-style-position: outside!important; margin-left: 3rem; }#mkreplaced-toc{list-style-position:inside;padding:0;margin:0 0 0 1rem;list-style-type:none}#mkreplaced-toc li::before{content:''}#mkreplaced-toc li{font-size:1.5rem;line-height:1.5;font-weight:normal}#mkreplaced-toc li ul{font-size:1.3rem;font-weight:300;padding:.5rem 0;margin:0 0 0 1rem}#mkreplaced-toc li.missing{list-style-type:none !important}#mkreplaced-toc.max-1 ul,#mkreplaced-toc.max1 ul{display:none}#mkreplaced-toc.max-2 ul ul,#mkreplaced-toc.max2 ul ul{display:none}#mkreplaced-toc.max-3 ul ul ul,#mkreplaced-toc.max3 ul ul ul{display:none}#mkreplaced-toc.max-4 ul ul ul ul,#mkreplaced-toc.max4 ul ul ul ul{display:none}#mkreplaced-toc.max-5 ul ul ul ul ul,#mkreplaced-toc.max5 ul ul ul ul ul{display:none} @media print{ #wrapper #generated-toc-clone,#generated-toc{display:none!important} } #wrapper #generated-toc-clone, #wrapper #mkreplaced-toc, #wrapper #generated-toc-clone ul, #wrapper #mkreplaced-toc ul { list-style-position: inside } #wrapper #generated-toc-clone li.missing, #wrapper #mkreplaced-toc li.missing { list-style-type: none!important } #wrapper #generated-toc-clone, #wrapper #mkreplaced-toc { list-style-type: upper-roman } #wrapper #generated-toc-clone>li>ul, #wrapper #mkreplaced-toc>li>ul { list-style-type: decimal } #wrapper #generated-toc-clone>li>ul>li>ul, #wrapper #mkreplaced-toc>li>ul>li>ul { list-style-type: decimal-leading-zero } #wrapper #generated-toc-clone>li>ul>li>ul>li>ul, #wrapper #mkreplaced-toc>li>ul>li>ul>li>ul { list-style-type: lower-greek } #wrapper #generated-toc-clone>li>ul>li>ul>li>ul>li>ul, #wrapper #mkreplaced-toc>li>ul>li>ul>li>ul>li>ul { list-style-type: disc } #wrapper #generated-toc-clone>li>ul>li>ul>li>ul>li>ul>li>ul, #wrapper #mkreplaced-toc>li>ul>li>ul>li>ul>li>ul>li>ul { list-style-type: square } #wrapper #generated-toc-clone,#wrapper #mkreplaced-toc{list-style-position:outside!important;margin-left:3rem;} </style> <body> <?php require 'vendor/autoload.php'; ?> <p><strong>NOTE:</strong> I do not take any credit. This is a mirror of <a href="https://github.com/Kickball/Awesome-Selfhosted">Kickball/Awesome-Selfhosted</a>.</p> <p><strong>BUG:</strong> Table of Contents not working at the moment.</p> <?php $mirror_link = file_get_contents("https://raw.githubusercontent.com/Kickball/awesome-selfhosted/master/README.md"); use \Michelf\Markdown; $html = Markdown::defaultTransform($mirror_link); echo $html; ?> </body>
{ "content_hash": "80bf6a841252fa072a1046ee5fbf2531", "timestamp": "", "source": "github", "line_count": 742, "max_line_length": 720, "avg_line_length": 18.858490566037737, "alnum_prop": 0.6372471950260845, "repo_name": "NurdTurd/blor.xyz", "id": "5e4cb41f667dd46fd68f4da61d5272dddd356543", "size": "13993", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "index.php", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "PHP", "bytes": "13993" } ], "symlink_target": "" }
package aws import ( "fmt" "strings" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/helper/schema" "github.com/hashicorp/terraform/helper/validation" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/service/ec2" ) func resourceAwsKeyPair() *schema.Resource { return &schema.Resource{ Create: resourceAwsKeyPairCreate, Read: resourceAwsKeyPairRead, Update: nil, Delete: resourceAwsKeyPairDelete, Importer: &schema.ResourceImporter{ State: schema.ImportStatePassthrough, }, SchemaVersion: 1, MigrateState: resourceAwsKeyPairMigrateState, Schema: map[string]*schema.Schema{ "key_name": { Type: schema.TypeString, Optional: true, Computed: true, ForceNew: true, ConflictsWith: []string{"key_name_prefix"}, ValidateFunc: validation.StringLenBetween(0, 255), }, "key_name_prefix": { Type: schema.TypeString, Optional: true, ForceNew: true, ConflictsWith: []string{"key_name"}, ValidateFunc: validation.StringLenBetween(0, 255-resource.UniqueIDSuffixLength), }, "public_key": { Type: schema.TypeString, Required: true, ForceNew: true, StateFunc: func(v interface{}) string { switch v.(type) { case string: return strings.TrimSpace(v.(string)) default: return "" } }, }, "fingerprint": { Type: schema.TypeString, Computed: true, }, }, } } func resourceAwsKeyPairCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).ec2conn var keyName string if v, ok := d.GetOk("key_name"); ok { keyName = v.(string) } else if v, ok := d.GetOk("key_name_prefix"); ok { keyName = resource.PrefixedUniqueId(v.(string)) d.Set("key_name", keyName) } else { keyName = resource.UniqueId() d.Set("key_name", keyName) } publicKey := d.Get("public_key").(string) req := &ec2.ImportKeyPairInput{ KeyName: aws.String(keyName), PublicKeyMaterial: []byte(publicKey), } resp, err := conn.ImportKeyPair(req) if err != nil { return fmt.Errorf("Error import KeyPair: %s", err) } d.SetId(*resp.KeyName) return resourceAwsKeyPairRead(d, meta) } func resourceAwsKeyPairRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).ec2conn req := &ec2.DescribeKeyPairsInput{ KeyNames: []*string{aws.String(d.Id())}, } resp, err := conn.DescribeKeyPairs(req) if err != nil { awsErr, ok := err.(awserr.Error) if ok && awsErr.Code() == "InvalidKeyPair.NotFound" { d.SetId("") return nil } return fmt.Errorf("Error retrieving KeyPair: %s", err) } for _, keyPair := range resp.KeyPairs { if *keyPair.KeyName == d.Id() { d.Set("key_name", keyPair.KeyName) d.Set("fingerprint", keyPair.KeyFingerprint) return nil } } return fmt.Errorf("Unable to find key pair within: %#v", resp.KeyPairs) } func resourceAwsKeyPairDelete(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).ec2conn _, err := conn.DeleteKeyPair(&ec2.DeleteKeyPairInput{ KeyName: aws.String(d.Id()), }) return err }
{ "content_hash": "c3f54224f1dec92e941af5f0c1c20aac", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 85, "avg_line_length": 25.19685039370079, "alnum_prop": 0.663125, "repo_name": "derekhiggins/installer", "id": "48f954b9cca583bc5d938689696bbb12f0ad3975", "size": "3200", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "pkg/terraform/exec/plugins/vendor/github.com/terraform-providers/terraform-provider-aws/aws/resource_aws_key_pair.go", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Dockerfile", "bytes": "988" }, { "name": "Go", "bytes": "603051" }, { "name": "HCL", "bytes": "103768" }, { "name": "Shell", "bytes": "37544" } ], "symlink_target": "" }
package com.djs.learn.ctc.transaction2; import java.time.Duration; import java.time.Instant; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; /** * Basic transaction info. */ public class BasicTransactionInfo { /** * The logger. */ private static final Logger log = LogManager.getLogger(BasicTransactionInfo.class); /** * Transaction ID. * <p> * For debugging purpose. */ private long transactionId; /** * Transaction start time. */ private Instant transactionStartTime; /** * Transaction stop time. */ private Instant transactionStopTime; /** * Transaction duration. */ private Duration transactionDuration; /** * Transaction status. */ private TransactionStatus transactionStatus; /** * Constructor. */ public BasicTransactionInfo(){ reset(); } /** * Reset info. */ public void reset(){ transactionId = -1; transactionStartTime = null; transactionStopTime = null; transactionDuration = null; transactionStatus = TransactionStatus.INVALID; } /** * Set transaction ID. * * @param id * long. */ public void setTransactionId(long id){ transactionId = id; } /** * Get transaction ID. * * @return long - Transaction ID. */ public long getTransactionId(){ return transactionId; } /** * Set transaction start time. * * @param time * Instant, null means current time. */ public synchronized void setTransactionStartTime(Instant time){ transactionStartTime = (time != null) ? time : Instant.now(); if (log.isTraceEnabled()) { log.trace("Transaction ID " + transactionId + ": Transaction start time = " + transactionStartTime); } } /** * Get transaction start time. * * @return Instant - Transaction start time. */ public Instant getTransactionStartTime(){ return transactionStartTime; } /** * Set transaction stop time. * * @param time * Instant, null means current time. */ public synchronized void setTransactionStopTime(Instant time) throws Exception{ if (transactionStartTime == null) { throw new Exception("Transaction must have start time first."); } transactionStopTime = (time != null) ? time : Instant.now(); transactionDuration = Duration.between(transactionStartTime, transactionStopTime); if (log.isTraceEnabled()) { log.trace("Transaction ID " + transactionId + ": Transaction stop time = " + transactionStopTime); log.trace("Transaction ID " + transactionId + ": Transaction duration = " + transactionDuration); } if (transactionDuration.isNegative()) { throw new Exception("Transaction stop time must >= transaction start time."); } } /** * Get transaction stop time. * * @return Instant - Transaction stop time. */ public Instant getTransactionStopTime(){ return transactionStopTime; } /** * Get transaction duration. * * @return Duration - Transaction duration. */ public Duration getTransactionDuration(){ return transactionDuration; } /** * Set transaction status. * * @param status * TransactionStatus, transaction status. */ public synchronized void setTransactionStatus(TransactionStatus status){ transactionStatus = status; if (log.isTraceEnabled()) { log.trace("Transaction ID " + transactionId + ": Transaction status = " + status + "<" + status.getDescription() + ">"); } } /** * Get transaction status. * * @return TransactionStatus - Transaction status. */ public synchronized TransactionStatus getTransactionStatus(){ return transactionStatus; } /* * (non-Javadoc) * @see java.lang.Object#clone() */ @Override public Object clone(){ try { return super.clone(); } catch (CloneNotSupportedException e) { // This should never happen. throw new InternalError(e.toString()); } } /* * (non-Javadoc) * @see java.lang.Object#toString() */ @Override public String toString(){ StringBuilder line = new StringBuilder(); line.append("Transaction ID:"); line.append(transactionId); line.append(", Transaction start time:"); line.append(transactionStartTime); line.append(", Transaction stop time:"); line.append(transactionStopTime); line.append(", Transaction duration:"); line.append(transactionDuration); line.append(", Transaction status:"); line.append(transactionStatus); line.append("<"); line.append(transactionStatus.getDescription()); line.append(">"); return line.toString(); } /** * To simple string. * * @return String */ public String toSimpleString(){ StringBuilder line = new StringBuilder(); line.append(transactionId); line.append(","); line.append(transactionStartTime); line.append(","); line.append(transactionStopTime); line.append(","); line.append(transactionDuration); line.append(","); line.append(transactionStatus); line.append("<"); line.append(transactionStatus.getDescription()); line.append(">"); return line.toString(); } }
{ "content_hash": "b8485c1daed749b6e40e763497a72c04", "timestamp": "", "source": "github", "line_count": 230, "max_line_length": 123, "avg_line_length": 21.708695652173912, "alnum_prop": 0.6827558582014821, "repo_name": "djsilenceboy/LearnTest", "id": "f1229508ecf988cc1c00d914c538c91997c60285", "size": "4993", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Java_Learn/AppConcurrentTaskController/src/main/java/com/djs/learn/ctc/transaction2/BasicTransactionInfo.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "27588" }, { "name": "C", "bytes": "201487" }, { "name": "C++", "bytes": "9459" }, { "name": "CSS", "bytes": "6049" }, { "name": "Dockerfile", "bytes": "5976" }, { "name": "HTML", "bytes": "89155" }, { "name": "Java", "bytes": "3304194" }, { "name": "JavaScript", "bytes": "73886" }, { "name": "Jinja", "bytes": "1150" }, { "name": "PHP", "bytes": "21180" }, { "name": "PLSQL", "bytes": "2080" }, { "name": "PowerShell", "bytes": "19723" }, { "name": "Python", "bytes": "551890" }, { "name": "Ruby", "bytes": "16460" }, { "name": "Shell", "bytes": "142970" }, { "name": "TypeScript", "bytes": "6986" }, { "name": "XSLT", "bytes": "1860" } ], "symlink_target": "" }
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ namespace DataConnect.Client.Windows.Properties { using System; /// <summary> /// A strongly-typed resource class, for looking up localized strings, etc. /// </summary> // This class was auto-generated by the StronglyTypedResourceBuilder // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { private static global::System.Resources.ResourceManager resourceMan; private static global::System.Globalization.CultureInfo resourceCulture; [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal Resources() { } /// <summary> /// Returns the cached ResourceManager instance used by this class. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("DataConnect.Client.Windows.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; } } /// <summary> /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } set { resourceCulture = value; } } } }
{ "content_hash": "0721675e727c27ddf945370f055835e2", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 192, "avg_line_length": 44.682539682539684, "alnum_prop": 0.6159857904085257, "repo_name": "mjnbike/DataConnect", "id": "be8393ad875abb194676849f7235f1bdd8f25a3a", "size": "2817", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/DataConnect.Client.Windows/Properties/Resources.Designer.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "960" }, { "name": "C#", "bytes": "311146" }, { "name": "CSS", "bytes": "2145" }, { "name": "JavaScript", "bytes": "6192" }, { "name": "TypeScript", "bytes": "21055" } ], "symlink_target": "" }
<?php namespace Psr7Unitesting\Html; use Symfony\Component\DomCrawler\Crawler; use Psr7Unitesting\Utils\KeyValueConstraintTrait; class Contains extends AbstractConstraint { use KeyValueConstraintTrait; public function toString() { return sprintf('has at least one element matching with the selector "%s" that contains "%s"', $this->key, $this->expected); } protected function runMatches(Crawler $html) { $texts = $html->filter($this->key)->each(function ($node) { return trim($node->text()); }); return array_filter($texts, function ($value) { return strpos($value, $this->expected) !== false; }); } }
{ "content_hash": "ff5d801d46cabf8d2141aab7c9352391", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 131, "avg_line_length": 25.925925925925927, "alnum_prop": 0.6414285714285715, "repo_name": "oscarotero/psr7-unitesting", "id": "18062c7a3da77f18849b356ab9d247d147ed168a", "size": "700", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Html/Contains.php", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "19052" }, { "name": "PHP", "bytes": "22830" } ], "symlink_target": "" }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System.Collections.Immutable; using System.Diagnostics; using Microsoft.CodeAnalysis.Diagnostics; namespace Microsoft.CodeAnalysis { internal readonly struct GeneratorDriverState { internal GeneratorDriverState(ParseOptions parseOptions, AnalyzerConfigOptionsProvider optionsProvider, ImmutableArray<ISourceGenerator> sourceGenerators, ImmutableArray<IIncrementalGenerator> incrementalGenerators, ImmutableArray<AdditionalText> additionalTexts, ImmutableArray<GeneratorState> generatorStates, DriverStateTable stateTable, bool enableIncremental, IncrementalGeneratorOutputKind disabledOutputs) { Generators = sourceGenerators; IncrementalGenerators = incrementalGenerators; GeneratorStates = generatorStates; AdditionalTexts = additionalTexts; ParseOptions = parseOptions; OptionsProvider = optionsProvider; StateTable = stateTable; EnableIncremental = enableIncremental; DisabledOutputs = disabledOutputs; Debug.Assert(Generators.Length == GeneratorStates.Length); Debug.Assert(IncrementalGenerators.Length == GeneratorStates.Length); } /// <summary> /// The set of <see cref="ISourceGenerator"/>s associated with this state. /// </summary> /// <remarks> /// This is the set of generators that will run on next generation. /// If there are any states present in <see cref="GeneratorStates" />, they were produced by a subset of these generators. /// </remarks> internal readonly ImmutableArray<ISourceGenerator> Generators; /// <summary> /// The set of <see cref="IIncrementalGenerator"/>s associated with this state. /// </summary> /// <remarks> /// This is the 'internal' representation of the <see cref="Generators"/> collection. There is a 1-to-1 mapping /// where each entry is either the unwrapped incremental generator or a wrapped <see cref="ISourceGenerator"/> /// </remarks> internal readonly ImmutableArray<IIncrementalGenerator> IncrementalGenerators; /// <summary> /// The last run state of each generator, by the generator that created it /// </summary> /// <remarks> /// There will be a 1-to-1 mapping for each generator. If a generator has yet to /// be initialized or failed during initialization it's state will be <c>default(GeneratorState)</c> /// </remarks> internal readonly ImmutableArray<GeneratorState> GeneratorStates; /// <summary> /// The set of <see cref="AdditionalText"/>s available to source generators during a run /// </summary> internal readonly ImmutableArray<AdditionalText> AdditionalTexts; /// <summary> /// Gets a provider for analyzer options /// </summary> internal readonly AnalyzerConfigOptionsProvider OptionsProvider; /// <summary> /// ParseOptions to use when parsing generator provided source. /// </summary> internal readonly ParseOptions ParseOptions; internal readonly DriverStateTable StateTable; /// <summary> /// Should this driver run incremental generators or not /// </summary> /// <remarks> /// Only used during preview period when incremental generators are enabled/disabled by preview flag /// </remarks> internal readonly bool EnableIncremental; /// <summary> /// A bit field containing the output kinds that should not be produced by this generator driver. /// </summary> internal readonly IncrementalGeneratorOutputKind DisabledOutputs; internal GeneratorDriverState With( ImmutableArray<ISourceGenerator>? sourceGenerators = null, ImmutableArray<IIncrementalGenerator>? incrementalGenerators = null, ImmutableArray<GeneratorState>? generatorStates = null, ImmutableArray<AdditionalText>? additionalTexts = null, DriverStateTable? stateTable = null, ParseOptions? parseOptions = null, AnalyzerConfigOptionsProvider? optionsProvider = null, IncrementalGeneratorOutputKind? disabledOutputs = null) { return new GeneratorDriverState( parseOptions ?? this.ParseOptions, optionsProvider ?? this.OptionsProvider, sourceGenerators ?? this.Generators, incrementalGenerators ?? this.IncrementalGenerators, additionalTexts ?? this.AdditionalTexts, generatorStates ?? this.GeneratorStates, stateTable ?? this.StateTable, this.EnableIncremental, disabledOutputs ?? this.DisabledOutputs ); } } }
{ "content_hash": "e6912a839bba8e59296b04ff428cccb2", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 130, "avg_line_length": 46.69827586206897, "alnum_prop": 0.6278382868746538, "repo_name": "eriawan/roslyn", "id": "df1dd8d6bcec42ff262d002db99c77cfb6cb13d9", "size": "5419", "binary": false, "copies": "2", "ref": "refs/heads/main", "path": "src/Compilers/Core/Portable/SourceGeneration/GeneratorDriverState.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "1C Enterprise", "bytes": "289100" }, { "name": "Batchfile", "bytes": "9670" }, { "name": "C#", "bytes": "99941085" }, { "name": "C++", "bytes": "5392" }, { "name": "F#", "bytes": "3632" }, { "name": "Groovy", "bytes": "11102" }, { "name": "PowerShell", "bytes": "126888" }, { "name": "Shell", "bytes": "13912" }, { "name": "Visual Basic", "bytes": "75514990" } ], "symlink_target": "" }
int main(int argc, char * argv[]) { @autoreleasepool { return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); } }
{ "content_hash": "ef130de25405b6a9b50602ee01029047", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 90, "avg_line_length": 31.6, "alnum_prop": 0.6582278481012658, "repo_name": "Nice2Me/NMButton", "id": "32615dd7f93d205fd691d706ebfa0960b83e5ebe", "size": "329", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Demo/ButtonTest/main.m", "mode": "33188", "license": "mit", "language": [ { "name": "Objective-C", "bytes": "19133" }, { "name": "Ruby", "bytes": "6241" } ], "symlink_target": "" }