text
stringlengths
2
1.04M
meta
dict
#ifndef V_PUBLISHERQOS_H #define V_PUBLISHERQOS_H #include "v_kernel.h" #if defined (__cplusplus) extern "C" { #endif #include "os_if.h" #ifdef OSPL_BUILD_CORE #define OS_API OS_API_EXPORT #else #define OS_API OS_API_IMPORT #endif /* !!!!!!!!NOTE From here no more includes are allowed!!!!!!! */ /** * \brief The <code>v_publisherQos</code> cast method. * * This method casts an object to a <code>v_publisherQos</code> object. * Before the cast is performed, if compiled with the NDEBUG flag not set, * the type of the object is checked to be <code>v_publisherQos</code> or * one of its subclasses. */ #define v_publisherQos(o) (C_CAST(o,v_publisherQos)) OS_API v_publisherQos v_publisherQosNew( v_kernel kernel, v_publisherQos template); OS_API void v_publisherQosFree( v_publisherQos q); OS_API v_result v_publisherQosCheck( v_publisherQos _this); #undef OS_API #if defined (__cplusplus) } #endif #endif
{ "content_hash": "5122aa14ee6cc67a2669705ee367cd2a", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 74, "avg_line_length": 19.666666666666668, "alnum_prop": 0.6959745762711864, "repo_name": "osrf/opensplice", "id": "ed03a4ded3e0de0a6e6a06dd9e69b4c5a18df0fa", "size": "1742", "binary": false, "copies": "2", "ref": "refs/heads/osrf-6.9.0", "path": "src/kernel/include/v_publisherQos.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Awk", "bytes": "16400" }, { "name": "Batchfile", "bytes": "192174" }, { "name": "C", "bytes": "19618578" }, { "name": "C#", "bytes": "2428591" }, { "name": "C++", "bytes": "8036199" }, { "name": "CMake", "bytes": "35186" }, { "name": "CSS", "bytes": "41427" }, { "name": "HTML", "bytes": "457045" }, { "name": "Java", "bytes": "5184488" }, { "name": "JavaScript", "bytes": "540355" }, { "name": "LLVM", "bytes": "13059" }, { "name": "Lex", "bytes": "51476" }, { "name": "Makefile", "bytes": "513684" }, { "name": "Objective-C", "bytes": "38424" }, { "name": "Perl", "bytes": "164028" }, { "name": "Python", "bytes": "915683" }, { "name": "Shell", "bytes": "363583" }, { "name": "TeX", "bytes": "8134" }, { "name": "Visual Basic", "bytes": "290" }, { "name": "Yacc", "bytes": "202848" } ], "symlink_target": "" }
require "celluloid/io" module Zulu class SubscriptionRequestProcessor include Celluloid::IO include Celluloid::Logger finalizer :shutdown def initialize debug "Request Processor starting up" end def process debug "Looking for a subscription request" request = SubscriptionRequest.pop(1) if request debug "Request found. Processing..." request.process end async.reprocess end def reprocess debug "Reprocessing..." after(0) { process } end def shutdown debug "Request Processor shutting down" end end end
{ "content_hash": "ed3345f91b15856bf8799b747f0ee90b", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 48, "avg_line_length": 19.575757575757574, "alnum_prop": 0.631578947368421, "repo_name": "dweinand/zulu", "id": "b37dfcc27b21903f45c3efefc701df192a5cb993", "size": "646", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/zulu/subscription_request_processor.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "34465" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <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>https0x3A0x2F0x2Fgithub0x2Ecom0x2Ftangfeixiong0x2Fgo-to-kubernetes</groupId> <artifactId>console-k8s</artifactId> <version>0.0.1-alpha</version> <packaging>pom</packaging> <name>Go to Kubernetes :: Console Project</name> <description>Console of Kubernetes and Cloud Native components.</description> <modules> <!-- <module>hadoop-operator-client</module> <module>kafka-operator-component</module> <module>mysql-operator-component</module> <module>rabbitmq-operator-component</module> <module>redis-operator-component</module>--> <module>web-console</module> </modules> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <java.version>1.8</java.version> <spring-cloud-kubernetes.version>0.2.0.RELEASE</spring-cloud-kubernetes.version> <spring-boot.version>2.0.0.RELEASE</spring-boot.version> <!-- The predefined properties in lifecycle --> <maven-compiler-plugin.version>3.7.0</maven-compiler-plugin.version> <maven-deploy-plugin.version>2.8.2</maven-deploy-plugin.version> <maven-failsafe-plugin.version>2.20.1</maven-failsafe-plugin.version> <maven-resource-plugin.version>3.0.2</maven-resource-plugin.version> <maven-surefire-plugin.version>2.20.1</maven-surefire-plugin.version> <start-class>io.stackdocker.k8sconsoleproject.webconsole.App</start-class> </properties> <dependencyManagement> <dependencies> <!-- https://docs.spring.io/spring-boot/docs/current/reference/html/using-boot-build-systems.html#using-boot-maven-without-a-parent --> <!-- Override Spring Data release train provided by Spring Boot --> <!-- <dependency> <groupId>org.springframework.data</groupId> <artifactId>spring-data-releasetrain</artifactId> <version>Fowler-SR2</version> <type>pom</type> <scope>import</scope> </dependency>--> <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-dependencies --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-dependencies</artifactId> <version>${spring-boot.version}</version> <type>pom</type> <scope>import</scope> </dependency> <!-- <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-kubernetes</artifactId> <version>0.2.1.BUILD-SNAPSHOT</version> <type>pom</type> <scope>import</scope> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-kubernetes-dependencies</artifactId> <version>${spring-cloud-kubernetes.version}</version> <type>pom</type> <scope>import</scope> </dependency>--> </dependencies> </dependencyManagement> <repositories> <!-- my synced --> <!-- <repository> <id>my-synced</id> <url>http://172.17.4.50:8081/content/repositories/allsynced</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository>--> <!-- inside China --> <repository> <id>aliyun</id> <name>aliyun</name> <url>http://maven.aliyun.com/nexus/content/groups/public</url> </repository> <!-- outside China --> <repository> <id>clojars</id> <name>clojars</name> <url>http://clojars.org/repo/</url> </repository> <!-- <repository> <id>confluent</id> <name>confluent</name> <url>http://packages.confluent.io/maven/</url> </repository>--> <repository> <id>sonatype-snapshots</id> <name>sonatype-snapshots</name> <url>https://oss.sonatype.org/content/repositories/snapshots/</url> </repository> <!-- https://repo.spring.io/webapp/#/home --> <repository> <id>spring-libs-milestone</id> <name>spring-libs-milestone</name> <url>https://repo.spring.io/libs-milestone</url> </repository> <repository> <snapshots> <enabled>false</enabled> </snapshots> <id>spring-libs-release</id> <name>spring-libs-release</name> <url>https://repo.spring.io/libs-release</url> </repository> <repository> <snapshots /> <id>spring-libs-snapshot</id> <name>spring-libs-snapshot</name> <url>https://repo.spring.io/libs-snapshot</url> </repository> <!-- <repository> <id>twitter4j</id> <url>http://twitter4j.org/maven2</url> </repository>--> </repositories> <pluginRepositories> <!-- my synced --> <!-- <pluginRepository> <id>my-synced</id> <url>http://172.17.4.50:8081/content/repositories/allsynced</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </pluginRepository>--> <pluginRepository> <id>aliyun</id> <name>aliyun</name> <url>http://maven.aliyun.com/nexus/content/groups/public</url> </pluginRepository> <!-- https://repo.spring.io/webapp/#/home --> <pluginRepository> <snapshots> <enabled>false</enabled> </snapshots> <id>spring-plugins-milestone</id> <name>spring-plugins-milestone</name> <url>https://repo.spring.io/plugins-milestone</url> </pluginRepository> <pluginRepository> <snapshots /> <id>spring-plugins-snapshot</id> <name>spring-plugins-snapshot</name> <url>https://repo.spring.io/plugins-snapshot</url> </pluginRepository> </pluginRepositories> <!-- <distributionManagement> <repository> <id>my-releases</id> <name>My internal repository</name> <url>http://172.17.4.50:8081/content/repositories/releases</url> </repository> <snapshotRepository> <id>my-snapshots</id> <name>My internal repository</name> <url>http://172.17.4.50:8081/content/repositories/snapshots</url> </snapshotRepository> </distributionManagement>--> <build> <!-- To define the plugin version in your parent POM --> <pluginManagement> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>${maven-compiler-plugin.version}</version> <configuration> <source>1.8</source> <target>1.8</target> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-resources-plugin</artifactId> <version>${maven-resource-plugin.version}</version> </plugin> <!--<plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <version>${spring-boot.version}</version> <configuration> <mainClass>${start-class}</mainClass> <layout>JAR</layout> </configuration> <executions> <execution> <id>generate build info</id> <goals> <goal>build-info</goal> </goals> </execution> <execution> <goals> <goal>repackage</goal> </goals> </execution> </executions> </plugin>--> </plugins> </pluginManagement> </build> </project>
{ "content_hash": "4fa47d06038c3af30893ed25e79b7f03", "timestamp": "", "source": "github", "line_count": 235, "max_line_length": 141, "avg_line_length": 32.740425531914894, "alnum_prop": 0.6364699766051468, "repo_name": "tangfeixiong/go-to-kubernetes", "id": "4602876fbe496628a0e67e1185d42ed6e1c9ef69", "size": "7694", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "java/console-k8s/pom.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "2373" }, { "name": "Dockerfile", "bytes": "6002" }, { "name": "Go", "bytes": "808491" }, { "name": "HTML", "bytes": "20932" }, { "name": "Java", "bytes": "160546" }, { "name": "JavaScript", "bytes": "457" }, { "name": "Makefile", "bytes": "10472" }, { "name": "Scala", "bytes": "1214" }, { "name": "Shell", "bytes": "139752" }, { "name": "Smarty", "bytes": "11095" } ], "symlink_target": "" }
package com.vk.api.sdk.objects.newsfeed; import com.google.gson.Gson; import com.google.gson.annotations.SerializedName; import com.vk.api.sdk.objects.Validable; import java.util.List; import java.util.Objects; /** * ItemNoteNotes object */ public class ItemNoteNotes implements Validable { /** * Notes number */ @SerializedName("count") private Integer count; @SerializedName("items") private List<NewsfeedNote> items; public Integer getCount() { return count; } public ItemNoteNotes setCount(Integer count) { this.count = count; return this; } public List<NewsfeedNote> getItems() { return items; } public ItemNoteNotes setItems(List<NewsfeedNote> items) { this.items = items; return this; } @Override public int hashCode() { return Objects.hash(count, items); } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ItemNoteNotes itemNoteNotes = (ItemNoteNotes) o; return Objects.equals(count, itemNoteNotes.count) && Objects.equals(items, itemNoteNotes.items); } @Override public String toString() { final Gson gson = new Gson(); return gson.toJson(this); } public String toPrettyString() { final StringBuilder sb = new StringBuilder("ItemNoteNotes{"); sb.append("count=").append(count); sb.append(", items=").append(items); sb.append('}'); return sb.toString(); } }
{ "content_hash": "c3d1a707b5b88e6a567299dfce1cfbfc", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 69, "avg_line_length": 24.28358208955224, "alnum_prop": 0.620159803318992, "repo_name": "VKCOM/vk-java-sdk", "id": "425d856f4e354562f6c68c5d7aa49394bdb13238", "size": "1627", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "sdk/src/main/java/com/vk/api/sdk/objects/newsfeed/ItemNoteNotes.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "5588603" }, { "name": "Shell", "bytes": "431" } ], "symlink_target": "" }
# Plainion.Windows.Controls.Tree.DragDropBehavior **Namespace:** Plainion.Windows.Controls.Tree **Assembly:** Plainion.Windows Implements DragDrop in the tree. Can be used by users of the TreeEditor to handle Drag and Drop commands. Pre-conditions: - INode.Parent must be writable - INode.Children must be of type ObservableCollection{T} ## Constructors ### Constructor(Plainion.Windows.Controls.Tree.INode root) ## Methods ### void ApplyDrop(Plainion.Windows.Controls.Tree.NodeDropRequest request)
{ "content_hash": "d95a8ca75f05fd1c5a7fb04ecc340ee9", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 105, "avg_line_length": 26.5, "alnum_prop": 0.7528301886792453, "repo_name": "plainionist/Plainion.Windows", "id": "11bd03e344df2e18a9d63ba365bfc48191bb30fe", "size": "530", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "doc/Api/Plainion.Windows/Plainion/Windows/Controls/Tree/DragDropBehavior.md", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C#", "bytes": "293301" }, { "name": "F#", "bytes": "27482" } ], "symlink_target": "" }
using System; using System.Collections.Generic; using NRules.RuleModel; namespace NRules.Diagnostics; internal class NodeInfo { private readonly List<IRuleDefinition> _rules = new(); public Type OutputType { get; set; } public IEnumerable<IRuleDefinition> Rules => _rules; public void Add(IRuleDefinition rule) { _rules.Add(rule); } }
{ "content_hash": "3b25dc5b5ee2a657766014d5885884fa", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 58, "avg_line_length": 20.666666666666668, "alnum_prop": 0.7016129032258065, "repo_name": "NRules/NRules", "id": "40299a8c9c52d22f49d4e28a2640cb3461940fb8", "size": "374", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "src/NRules/NRules/Diagnostics/NodeInfo.cs", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "49" }, { "name": "C#", "bytes": "1387941" }, { "name": "PowerShell", "bytes": "107007" }, { "name": "Smalltalk", "bytes": "604" } ], "symlink_target": "" }
#include "parser_prod.sep.0.h" /* method parser_prod#ASuperExternCall#replace_child for (self: Object, ANode, nullable ANode) */ void VIRTUAL_parser_prod__ASuperExternCall__replace_child(val* self, val* p0, val* p1) { parser_prod__ASuperExternCall__replace_child(self, p0, p1); RET_LABEL:; } /* method parser_prod#ASuperExternCall#n_kwsuper= for (self: ASuperExternCall, TKwsuper) */ void parser_prod__ASuperExternCall__n_kwsuper_61d(val* self, val* p0) { val* var_node /* var node: TKwsuper */; var_node = p0; self->attrs[COLOR_parser_nodes__ASuperExternCall___n_kwsuper].val = var_node; /* _n_kwsuper on <self:ASuperExternCall> */ ((void (*)(val*, val*))(var_node->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_node, self) /* parent= on <var_node:TKwsuper>*/; RET_LABEL:; } /* method parser_prod#ASuperExternCall#n_kwsuper= for (self: Object, TKwsuper) */ void VIRTUAL_parser_prod__ASuperExternCall__n_kwsuper_61d(val* self, val* p0) { parser_prod__ASuperExternCall__n_kwsuper_61d(self, p0); RET_LABEL:; } /* method parser_prod#ASuperExternCall#visit_all for (self: ASuperExternCall, Visitor) */ void parser_prod__ASuperExternCall__visit_all(val* self, val* p0) { val* var_v /* var v: Visitor */; val* var /* : TKwsuper */; var_v = p0; var = self->attrs[COLOR_parser_nodes__ASuperExternCall___n_kwsuper].val; /* _n_kwsuper on <self:ASuperExternCall> */ if (var == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_kwsuper"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10365); show_backtrace(1); } ((void (*)(val*, val*))(var_v->class->vft[COLOR_parser_nodes__Visitor__enter_visit]))(var_v, var) /* enter_visit on <var_v:Visitor>*/; RET_LABEL:; } /* method parser_prod#ASuperExternCall#visit_all for (self: Object, Visitor) */ void VIRTUAL_parser_prod__ASuperExternCall__visit_all(val* self, val* p0) { parser_prod__ASuperExternCall__visit_all(self, p0); RET_LABEL:; } /* method parser_prod#ALocalPropExternCall#empty_init for (self: ALocalPropExternCall) */ void parser_prod__ALocalPropExternCall__empty_init(val* self) { RET_LABEL:; } /* method parser_prod#ALocalPropExternCall#empty_init for (self: Object) */ void VIRTUAL_parser_prod__ALocalPropExternCall__empty_init(val* self) { parser_prod__ALocalPropExternCall__empty_init(self); RET_LABEL:; } /* method parser_prod#ALocalPropExternCall#init_alocalpropexterncall for (self: ALocalPropExternCall, nullable AMethid) */ void parser_prod__ALocalPropExternCall__init_alocalpropexterncall(val* self, val* p0) { val* var_n_methid /* var n_methid: nullable AMethid */; var_n_methid = p0; ((void (*)(val*))(self->class->vft[COLOR_parser_prod__ALocalPropExternCall__empty_init]))(self) /* empty_init on <self:ALocalPropExternCall>*/; if (var_n_methid == NULL) { fprintf(stderr, "Runtime error: %s", "Cast failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10376); show_backtrace(1); } self->attrs[COLOR_parser_nodes__ALocalPropExternCall___n_methid].val = var_n_methid; /* _n_methid on <self:ALocalPropExternCall> */ if (var_n_methid == NULL) { fprintf(stderr, "Runtime error: %s", "Receiver is null"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10377); show_backtrace(1); } else { ((void (*)(val*, val*))(var_n_methid->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_n_methid, self) /* parent= on <var_n_methid:nullable AMethid>*/; } RET_LABEL:; } /* method parser_prod#ALocalPropExternCall#init_alocalpropexterncall for (self: Object, nullable AMethid) */ void VIRTUAL_parser_prod__ALocalPropExternCall__init_alocalpropexterncall(val* self, val* p0) { parser_prod__ALocalPropExternCall__init_alocalpropexterncall(self, p0); RET_LABEL:; } /* method parser_prod#ALocalPropExternCall#replace_child for (self: ALocalPropExternCall, ANode, nullable ANode) */ void parser_prod__ALocalPropExternCall__replace_child(val* self, val* p0, val* p1) { val* var_old_child /* var old_child: ANode */; val* var_new_child /* var new_child: nullable ANode */; val* var /* : AMethid */; short int var1 /* : Bool */; val* var2 /* : null */; short int var3 /* : Bool */; short int var4 /* : Bool */; int cltype; int idtype; var_old_child = p0; var_new_child = p1; var = self->attrs[COLOR_parser_nodes__ALocalPropExternCall___n_methid].val; /* _n_methid on <self:ALocalPropExternCall> */ if (var == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_methid"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10382); show_backtrace(1); } var1 = ((short int (*)(val*, val*))(var->class->vft[COLOR_kernel__Object___61d_61d]))(var, var_old_child) /* == on <var:AMethid>*/; if (var1){ var2 = NULL; if (var_new_child == NULL) { var3 = 0; /* is null */ } else { var3 = 1; /* arg is null and recv is not */ } if (var3){ ((void (*)(val*, val*))(var_new_child->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_new_child, self) /* parent= on <var_new_child:nullable ANode(ANode)>*/; /* <var_new_child:nullable ANode(ANode)> isa AMethid */ cltype = type_parser_nodes__AMethid.color; idtype = type_parser_nodes__AMethid.id; if(cltype >= var_new_child->type->table_size) { var4 = 0; } else { var4 = var_new_child->type->type_table[cltype] == idtype; } if (!var4) { fprintf(stderr, "Runtime error: %s", "Assert failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10385); show_backtrace(1); } self->attrs[COLOR_parser_nodes__ALocalPropExternCall___n_methid].val = var_new_child; /* _n_methid on <self:ALocalPropExternCall> */ } else { fprintf(stderr, "Runtime error: %s", "Aborted"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10388); show_backtrace(1); } goto RET_LABEL; } else { } RET_LABEL:; } /* method parser_prod#ALocalPropExternCall#replace_child for (self: Object, ANode, nullable ANode) */ void VIRTUAL_parser_prod__ALocalPropExternCall__replace_child(val* self, val* p0, val* p1) { parser_prod__ALocalPropExternCall__replace_child(self, p0, p1); RET_LABEL:; } /* method parser_prod#ALocalPropExternCall#n_methid= for (self: ALocalPropExternCall, AMethid) */ void parser_prod__ALocalPropExternCall__n_methid_61d(val* self, val* p0) { val* var_node /* var node: AMethid */; var_node = p0; self->attrs[COLOR_parser_nodes__ALocalPropExternCall___n_methid].val = var_node; /* _n_methid on <self:ALocalPropExternCall> */ ((void (*)(val*, val*))(var_node->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_node, self) /* parent= on <var_node:AMethid>*/; RET_LABEL:; } /* method parser_prod#ALocalPropExternCall#n_methid= for (self: Object, AMethid) */ void VIRTUAL_parser_prod__ALocalPropExternCall__n_methid_61d(val* self, val* p0) { parser_prod__ALocalPropExternCall__n_methid_61d(self, p0); RET_LABEL:; } /* method parser_prod#ALocalPropExternCall#visit_all for (self: ALocalPropExternCall, Visitor) */ void parser_prod__ALocalPropExternCall__visit_all(val* self, val* p0) { val* var_v /* var v: Visitor */; val* var /* : AMethid */; var_v = p0; var = self->attrs[COLOR_parser_nodes__ALocalPropExternCall___n_methid].val; /* _n_methid on <self:ALocalPropExternCall> */ if (var == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_methid"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10403); show_backtrace(1); } ((void (*)(val*, val*))(var_v->class->vft[COLOR_parser_nodes__Visitor__enter_visit]))(var_v, var) /* enter_visit on <var_v:Visitor>*/; RET_LABEL:; } /* method parser_prod#ALocalPropExternCall#visit_all for (self: Object, Visitor) */ void VIRTUAL_parser_prod__ALocalPropExternCall__visit_all(val* self, val* p0) { parser_prod__ALocalPropExternCall__visit_all(self, p0); RET_LABEL:; } /* method parser_prod#AFullPropExternCall#empty_init for (self: AFullPropExternCall) */ void parser_prod__AFullPropExternCall__empty_init(val* self) { RET_LABEL:; } /* method parser_prod#AFullPropExternCall#empty_init for (self: Object) */ void VIRTUAL_parser_prod__AFullPropExternCall__empty_init(val* self) { parser_prod__AFullPropExternCall__empty_init(self); RET_LABEL:; } /* method parser_prod#AFullPropExternCall#init_afullpropexterncall for (self: AFullPropExternCall, nullable AType, nullable TDot, nullable AMethid) */ void parser_prod__AFullPropExternCall__init_afullpropexterncall(val* self, val* p0, val* p1, val* p2) { val* var_n_type /* var n_type: nullable AType */; val* var_n_dot /* var n_dot: nullable TDot */; val* var_n_methid /* var n_methid: nullable AMethid */; val* var /* : null */; short int var1 /* : Bool */; var_n_type = p0; var_n_dot = p1; var_n_methid = p2; ((void (*)(val*))(self->class->vft[COLOR_parser_prod__AFullPropExternCall__empty_init]))(self) /* empty_init on <self:AFullPropExternCall>*/; if (var_n_type == NULL) { fprintf(stderr, "Runtime error: %s", "Cast failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10416); show_backtrace(1); } self->attrs[COLOR_parser_nodes__AFullPropExternCall___n_type].val = var_n_type; /* _n_type on <self:AFullPropExternCall> */ if (var_n_type == NULL) { fprintf(stderr, "Runtime error: %s", "Receiver is null"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10417); show_backtrace(1); } else { ((void (*)(val*, val*))(var_n_type->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_n_type, self) /* parent= on <var_n_type:nullable AType>*/; } self->attrs[COLOR_parser_nodes__AFullPropExternCall___n_dot].val = var_n_dot; /* _n_dot on <self:AFullPropExternCall> */ var = NULL; if (var_n_dot == NULL) { var1 = 0; /* is null */ } else { var1 = 1; /* arg is null and recv is not */ } if (var1){ ((void (*)(val*, val*))(var_n_dot->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_n_dot, self) /* parent= on <var_n_dot:nullable TDot(TDot)>*/; } else { } if (var_n_methid == NULL) { fprintf(stderr, "Runtime error: %s", "Cast failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10422); show_backtrace(1); } self->attrs[COLOR_parser_nodes__AFullPropExternCall___n_methid].val = var_n_methid; /* _n_methid on <self:AFullPropExternCall> */ if (var_n_methid == NULL) { fprintf(stderr, "Runtime error: %s", "Receiver is null"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10423); show_backtrace(1); } else { ((void (*)(val*, val*))(var_n_methid->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_n_methid, self) /* parent= on <var_n_methid:nullable AMethid>*/; } RET_LABEL:; } /* method parser_prod#AFullPropExternCall#init_afullpropexterncall for (self: Object, nullable AType, nullable TDot, nullable AMethid) */ void VIRTUAL_parser_prod__AFullPropExternCall__init_afullpropexterncall(val* self, val* p0, val* p1, val* p2) { parser_prod__AFullPropExternCall__init_afullpropexterncall(self, p0, p1, p2); RET_LABEL:; } /* method parser_prod#AFullPropExternCall#replace_child for (self: AFullPropExternCall, ANode, nullable ANode) */ void parser_prod__AFullPropExternCall__replace_child(val* self, val* p0, val* p1) { val* var_old_child /* var old_child: ANode */; val* var_new_child /* var new_child: nullable ANode */; val* var /* : AType */; short int var1 /* : Bool */; val* var2 /* : null */; short int var3 /* : Bool */; short int var4 /* : Bool */; int cltype; int idtype; val* var5 /* : nullable TDot */; short int var6 /* : Bool */; val* var7 /* : null */; short int var8 /* : Bool */; short int var9 /* : Bool */; int cltype10; int idtype11; val* var12 /* : null */; val* var13 /* : AMethid */; short int var14 /* : Bool */; val* var15 /* : null */; short int var16 /* : Bool */; short int var17 /* : Bool */; int cltype18; int idtype19; var_old_child = p0; var_new_child = p1; var = self->attrs[COLOR_parser_nodes__AFullPropExternCall___n_type].val; /* _n_type on <self:AFullPropExternCall> */ if (var == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_type"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10428); show_backtrace(1); } var1 = ((short int (*)(val*, val*))(var->class->vft[COLOR_kernel__Object___61d_61d]))(var, var_old_child) /* == on <var:AType>*/; if (var1){ var2 = NULL; if (var_new_child == NULL) { var3 = 0; /* is null */ } else { var3 = 1; /* arg is null and recv is not */ } if (var3){ ((void (*)(val*, val*))(var_new_child->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_new_child, self) /* parent= on <var_new_child:nullable ANode(ANode)>*/; /* <var_new_child:nullable ANode(ANode)> isa AType */ cltype = type_parser_nodes__AType.color; idtype = type_parser_nodes__AType.id; if(cltype >= var_new_child->type->table_size) { var4 = 0; } else { var4 = var_new_child->type->type_table[cltype] == idtype; } if (!var4) { fprintf(stderr, "Runtime error: %s", "Assert failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10431); show_backtrace(1); } self->attrs[COLOR_parser_nodes__AFullPropExternCall___n_type].val = var_new_child; /* _n_type on <self:AFullPropExternCall> */ } else { fprintf(stderr, "Runtime error: %s", "Aborted"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10434); show_backtrace(1); } goto RET_LABEL; } else { } var5 = self->attrs[COLOR_parser_nodes__AFullPropExternCall___n_dot].val; /* _n_dot on <self:AFullPropExternCall> */ if (var5 == NULL) { var6 = 0; /* <var_old_child:ANode> cannot be null */ } else { var6 = ((short int (*)(val*, val*))(var5->class->vft[COLOR_kernel__Object___61d_61d]))(var5, var_old_child) /* == on <var5:nullable TDot>*/; } if (var6){ var7 = NULL; if (var_new_child == NULL) { var8 = 0; /* is null */ } else { var8 = 1; /* arg is null and recv is not */ } if (var8){ ((void (*)(val*, val*))(var_new_child->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_new_child, self) /* parent= on <var_new_child:nullable ANode(ANode)>*/; /* <var_new_child:nullable ANode(ANode)> isa TDot */ cltype10 = type_parser_nodes__TDot.color; idtype11 = type_parser_nodes__TDot.id; if(cltype10 >= var_new_child->type->table_size) { var9 = 0; } else { var9 = var_new_child->type->type_table[cltype10] == idtype11; } if (!var9) { fprintf(stderr, "Runtime error: %s", "Assert failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10441); show_backtrace(1); } self->attrs[COLOR_parser_nodes__AFullPropExternCall___n_dot].val = var_new_child; /* _n_dot on <self:AFullPropExternCall> */ } else { var12 = NULL; self->attrs[COLOR_parser_nodes__AFullPropExternCall___n_dot].val = var12; /* _n_dot on <self:AFullPropExternCall> */ } goto RET_LABEL; } else { } var13 = self->attrs[COLOR_parser_nodes__AFullPropExternCall___n_methid].val; /* _n_methid on <self:AFullPropExternCall> */ if (var13 == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_methid"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10448); show_backtrace(1); } var14 = ((short int (*)(val*, val*))(var13->class->vft[COLOR_kernel__Object___61d_61d]))(var13, var_old_child) /* == on <var13:AMethid>*/; if (var14){ var15 = NULL; if (var_new_child == NULL) { var16 = 0; /* is null */ } else { var16 = 1; /* arg is null and recv is not */ } if (var16){ ((void (*)(val*, val*))(var_new_child->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_new_child, self) /* parent= on <var_new_child:nullable ANode(ANode)>*/; /* <var_new_child:nullable ANode(ANode)> isa AMethid */ cltype18 = type_parser_nodes__AMethid.color; idtype19 = type_parser_nodes__AMethid.id; if(cltype18 >= var_new_child->type->table_size) { var17 = 0; } else { var17 = var_new_child->type->type_table[cltype18] == idtype19; } if (!var17) { fprintf(stderr, "Runtime error: %s", "Assert failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10451); show_backtrace(1); } self->attrs[COLOR_parser_nodes__AFullPropExternCall___n_methid].val = var_new_child; /* _n_methid on <self:AFullPropExternCall> */ } else { fprintf(stderr, "Runtime error: %s", "Aborted"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10454); show_backtrace(1); } goto RET_LABEL; } else { } RET_LABEL:; } /* method parser_prod#AFullPropExternCall#replace_child for (self: Object, ANode, nullable ANode) */ void VIRTUAL_parser_prod__AFullPropExternCall__replace_child(val* self, val* p0, val* p1) { parser_prod__AFullPropExternCall__replace_child(self, p0, p1); RET_LABEL:; } /* method parser_prod#AFullPropExternCall#n_type= for (self: AFullPropExternCall, AType) */ void parser_prod__AFullPropExternCall__n_type_61d(val* self, val* p0) { val* var_node /* var node: AType */; var_node = p0; self->attrs[COLOR_parser_nodes__AFullPropExternCall___n_type].val = var_node; /* _n_type on <self:AFullPropExternCall> */ ((void (*)(val*, val*))(var_node->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_node, self) /* parent= on <var_node:AType>*/; RET_LABEL:; } /* method parser_prod#AFullPropExternCall#n_type= for (self: Object, AType) */ void VIRTUAL_parser_prod__AFullPropExternCall__n_type_61d(val* self, val* p0) { parser_prod__AFullPropExternCall__n_type_61d(self, p0); RET_LABEL:; } /* method parser_prod#AFullPropExternCall#n_dot= for (self: AFullPropExternCall, nullable TDot) */ void parser_prod__AFullPropExternCall__n_dot_61d(val* self, val* p0) { val* var_node /* var node: nullable TDot */; val* var /* : null */; short int var1 /* : Bool */; var_node = p0; self->attrs[COLOR_parser_nodes__AFullPropExternCall___n_dot].val = var_node; /* _n_dot on <self:AFullPropExternCall> */ var = NULL; if (var_node == NULL) { var1 = 0; /* is null */ } else { var1 = 1; /* arg is null and recv is not */ } if (var1){ ((void (*)(val*, val*))(var_node->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_node, self) /* parent= on <var_node:nullable TDot(TDot)>*/; } else { } RET_LABEL:; } /* method parser_prod#AFullPropExternCall#n_dot= for (self: Object, nullable TDot) */ void VIRTUAL_parser_prod__AFullPropExternCall__n_dot_61d(val* self, val* p0) { parser_prod__AFullPropExternCall__n_dot_61d(self, p0); RET_LABEL:; } /* method parser_prod#AFullPropExternCall#n_methid= for (self: AFullPropExternCall, AMethid) */ void parser_prod__AFullPropExternCall__n_methid_61d(val* self, val* p0) { val* var_node /* var node: AMethid */; var_node = p0; self->attrs[COLOR_parser_nodes__AFullPropExternCall___n_methid].val = var_node; /* _n_methid on <self:AFullPropExternCall> */ ((void (*)(val*, val*))(var_node->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_node, self) /* parent= on <var_node:AMethid>*/; RET_LABEL:; } /* method parser_prod#AFullPropExternCall#n_methid= for (self: Object, AMethid) */ void VIRTUAL_parser_prod__AFullPropExternCall__n_methid_61d(val* self, val* p0) { parser_prod__AFullPropExternCall__n_methid_61d(self, p0); RET_LABEL:; } /* method parser_prod#AFullPropExternCall#visit_all for (self: AFullPropExternCall, Visitor) */ void parser_prod__AFullPropExternCall__visit_all(val* self, val* p0) { val* var_v /* var v: Visitor */; val* var /* : AType */; val* var1 /* : nullable TDot */; val* var2 /* : null */; short int var3 /* : Bool */; val* var4 /* : nullable TDot */; val* var5 /* : AMethid */; var_v = p0; var = self->attrs[COLOR_parser_nodes__AFullPropExternCall___n_type].val; /* _n_type on <self:AFullPropExternCall> */ if (var == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_type"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10481); show_backtrace(1); } ((void (*)(val*, val*))(var_v->class->vft[COLOR_parser_nodes__Visitor__enter_visit]))(var_v, var) /* enter_visit on <var_v:Visitor>*/; var1 = self->attrs[COLOR_parser_nodes__AFullPropExternCall___n_dot].val; /* _n_dot on <self:AFullPropExternCall> */ var2 = NULL; if (var1 == NULL) { var3 = 0; /* is null */ } else { var3 = 1; /* arg is null and recv is not */ } if (var3){ var4 = self->attrs[COLOR_parser_nodes__AFullPropExternCall___n_dot].val; /* _n_dot on <self:AFullPropExternCall> */ if (var4 == NULL) { fprintf(stderr, "Runtime error: %s", "Cast failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10483); show_backtrace(1); } ((void (*)(val*, val*))(var_v->class->vft[COLOR_parser_nodes__Visitor__enter_visit]))(var_v, var4) /* enter_visit on <var_v:Visitor>*/; } else { } var5 = self->attrs[COLOR_parser_nodes__AFullPropExternCall___n_methid].val; /* _n_methid on <self:AFullPropExternCall> */ if (var5 == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_methid"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10485); show_backtrace(1); } ((void (*)(val*, val*))(var_v->class->vft[COLOR_parser_nodes__Visitor__enter_visit]))(var_v, var5) /* enter_visit on <var_v:Visitor>*/; RET_LABEL:; } /* method parser_prod#AFullPropExternCall#visit_all for (self: Object, Visitor) */ void VIRTUAL_parser_prod__AFullPropExternCall__visit_all(val* self, val* p0) { parser_prod__AFullPropExternCall__visit_all(self, p0); RET_LABEL:; } /* method parser_prod#AInitPropExternCall#empty_init for (self: AInitPropExternCall) */ void parser_prod__AInitPropExternCall__empty_init(val* self) { RET_LABEL:; } /* method parser_prod#AInitPropExternCall#empty_init for (self: Object) */ void VIRTUAL_parser_prod__AInitPropExternCall__empty_init(val* self) { parser_prod__AInitPropExternCall__empty_init(self); RET_LABEL:; } /* method parser_prod#AInitPropExternCall#init_ainitpropexterncall for (self: AInitPropExternCall, nullable AType) */ void parser_prod__AInitPropExternCall__init_ainitpropexterncall(val* self, val* p0) { val* var_n_type /* var n_type: nullable AType */; var_n_type = p0; ((void (*)(val*))(self->class->vft[COLOR_parser_prod__AInitPropExternCall__empty_init]))(self) /* empty_init on <self:AInitPropExternCall>*/; if (var_n_type == NULL) { fprintf(stderr, "Runtime error: %s", "Cast failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10496); show_backtrace(1); } self->attrs[COLOR_parser_nodes__AInitPropExternCall___n_type].val = var_n_type; /* _n_type on <self:AInitPropExternCall> */ if (var_n_type == NULL) { fprintf(stderr, "Runtime error: %s", "Receiver is null"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10497); show_backtrace(1); } else { ((void (*)(val*, val*))(var_n_type->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_n_type, self) /* parent= on <var_n_type:nullable AType>*/; } RET_LABEL:; } /* method parser_prod#AInitPropExternCall#init_ainitpropexterncall for (self: Object, nullable AType) */ void VIRTUAL_parser_prod__AInitPropExternCall__init_ainitpropexterncall(val* self, val* p0) { parser_prod__AInitPropExternCall__init_ainitpropexterncall(self, p0); RET_LABEL:; } /* method parser_prod#AInitPropExternCall#replace_child for (self: AInitPropExternCall, ANode, nullable ANode) */ void parser_prod__AInitPropExternCall__replace_child(val* self, val* p0, val* p1) { val* var_old_child /* var old_child: ANode */; val* var_new_child /* var new_child: nullable ANode */; val* var /* : AType */; short int var1 /* : Bool */; val* var2 /* : null */; short int var3 /* : Bool */; short int var4 /* : Bool */; int cltype; int idtype; var_old_child = p0; var_new_child = p1; var = self->attrs[COLOR_parser_nodes__AInitPropExternCall___n_type].val; /* _n_type on <self:AInitPropExternCall> */ if (var == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_type"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10502); show_backtrace(1); } var1 = ((short int (*)(val*, val*))(var->class->vft[COLOR_kernel__Object___61d_61d]))(var, var_old_child) /* == on <var:AType>*/; if (var1){ var2 = NULL; if (var_new_child == NULL) { var3 = 0; /* is null */ } else { var3 = 1; /* arg is null and recv is not */ } if (var3){ ((void (*)(val*, val*))(var_new_child->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_new_child, self) /* parent= on <var_new_child:nullable ANode(ANode)>*/; /* <var_new_child:nullable ANode(ANode)> isa AType */ cltype = type_parser_nodes__AType.color; idtype = type_parser_nodes__AType.id; if(cltype >= var_new_child->type->table_size) { var4 = 0; } else { var4 = var_new_child->type->type_table[cltype] == idtype; } if (!var4) { fprintf(stderr, "Runtime error: %s", "Assert failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10505); show_backtrace(1); } self->attrs[COLOR_parser_nodes__AInitPropExternCall___n_type].val = var_new_child; /* _n_type on <self:AInitPropExternCall> */ } else { fprintf(stderr, "Runtime error: %s", "Aborted"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10508); show_backtrace(1); } goto RET_LABEL; } else { } RET_LABEL:; } /* method parser_prod#AInitPropExternCall#replace_child for (self: Object, ANode, nullable ANode) */ void VIRTUAL_parser_prod__AInitPropExternCall__replace_child(val* self, val* p0, val* p1) { parser_prod__AInitPropExternCall__replace_child(self, p0, p1); RET_LABEL:; } /* method parser_prod#AInitPropExternCall#n_type= for (self: AInitPropExternCall, AType) */ void parser_prod__AInitPropExternCall__n_type_61d(val* self, val* p0) { val* var_node /* var node: AType */; var_node = p0; self->attrs[COLOR_parser_nodes__AInitPropExternCall___n_type].val = var_node; /* _n_type on <self:AInitPropExternCall> */ ((void (*)(val*, val*))(var_node->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_node, self) /* parent= on <var_node:AType>*/; RET_LABEL:; } /* method parser_prod#AInitPropExternCall#n_type= for (self: Object, AType) */ void VIRTUAL_parser_prod__AInitPropExternCall__n_type_61d(val* self, val* p0) { parser_prod__AInitPropExternCall__n_type_61d(self, p0); RET_LABEL:; } /* method parser_prod#AInitPropExternCall#visit_all for (self: AInitPropExternCall, Visitor) */ void parser_prod__AInitPropExternCall__visit_all(val* self, val* p0) { val* var_v /* var v: Visitor */; val* var /* : AType */; var_v = p0; var = self->attrs[COLOR_parser_nodes__AInitPropExternCall___n_type].val; /* _n_type on <self:AInitPropExternCall> */ if (var == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_type"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10523); show_backtrace(1); } ((void (*)(val*, val*))(var_v->class->vft[COLOR_parser_nodes__Visitor__enter_visit]))(var_v, var) /* enter_visit on <var_v:Visitor>*/; RET_LABEL:; } /* method parser_prod#AInitPropExternCall#visit_all for (self: Object, Visitor) */ void VIRTUAL_parser_prod__AInitPropExternCall__visit_all(val* self, val* p0) { parser_prod__AInitPropExternCall__visit_all(self, p0); RET_LABEL:; } /* method parser_prod#ACastAsExternCall#empty_init for (self: ACastAsExternCall) */ void parser_prod__ACastAsExternCall__empty_init(val* self) { RET_LABEL:; } /* method parser_prod#ACastAsExternCall#empty_init for (self: Object) */ void VIRTUAL_parser_prod__ACastAsExternCall__empty_init(val* self) { parser_prod__ACastAsExternCall__empty_init(self); RET_LABEL:; } /* method parser_prod#ACastAsExternCall#init_acastasexterncall for (self: ACastAsExternCall, nullable AType, nullable TDot, nullable TKwas, nullable AType) */ void parser_prod__ACastAsExternCall__init_acastasexterncall(val* self, val* p0, val* p1, val* p2, val* p3) { val* var_n_from_type /* var n_from_type: nullable AType */; val* var_n_dot /* var n_dot: nullable TDot */; val* var_n_kwas /* var n_kwas: nullable TKwas */; val* var_n_to_type /* var n_to_type: nullable AType */; val* var /* : null */; short int var1 /* : Bool */; var_n_from_type = p0; var_n_dot = p1; var_n_kwas = p2; var_n_to_type = p3; ((void (*)(val*))(self->class->vft[COLOR_parser_prod__ACastAsExternCall__empty_init]))(self) /* empty_init on <self:ACastAsExternCall>*/; if (var_n_from_type == NULL) { fprintf(stderr, "Runtime error: %s", "Cast failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10537); show_backtrace(1); } self->attrs[COLOR_parser_nodes__ACastAsExternCall___n_from_type].val = var_n_from_type; /* _n_from_type on <self:ACastAsExternCall> */ if (var_n_from_type == NULL) { fprintf(stderr, "Runtime error: %s", "Receiver is null"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10538); show_backtrace(1); } else { ((void (*)(val*, val*))(var_n_from_type->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_n_from_type, self) /* parent= on <var_n_from_type:nullable AType>*/; } self->attrs[COLOR_parser_nodes__ACastAsExternCall___n_dot].val = var_n_dot; /* _n_dot on <self:ACastAsExternCall> */ var = NULL; if (var_n_dot == NULL) { var1 = 0; /* is null */ } else { var1 = 1; /* arg is null and recv is not */ } if (var1){ ((void (*)(val*, val*))(var_n_dot->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_n_dot, self) /* parent= on <var_n_dot:nullable TDot(TDot)>*/; } else { } if (var_n_kwas == NULL) { fprintf(stderr, "Runtime error: %s", "Cast failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10543); show_backtrace(1); } self->attrs[COLOR_parser_nodes__ACastAsExternCall___n_kwas].val = var_n_kwas; /* _n_kwas on <self:ACastAsExternCall> */ if (var_n_kwas == NULL) { fprintf(stderr, "Runtime error: %s", "Receiver is null"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10544); show_backtrace(1); } else { ((void (*)(val*, val*))(var_n_kwas->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_n_kwas, self) /* parent= on <var_n_kwas:nullable TKwas>*/; } if (var_n_to_type == NULL) { fprintf(stderr, "Runtime error: %s", "Cast failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10545); show_backtrace(1); } self->attrs[COLOR_parser_nodes__ACastAsExternCall___n_to_type].val = var_n_to_type; /* _n_to_type on <self:ACastAsExternCall> */ if (var_n_to_type == NULL) { fprintf(stderr, "Runtime error: %s", "Receiver is null"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10546); show_backtrace(1); } else { ((void (*)(val*, val*))(var_n_to_type->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_n_to_type, self) /* parent= on <var_n_to_type:nullable AType>*/; } RET_LABEL:; } /* method parser_prod#ACastAsExternCall#init_acastasexterncall for (self: Object, nullable AType, nullable TDot, nullable TKwas, nullable AType) */ void VIRTUAL_parser_prod__ACastAsExternCall__init_acastasexterncall(val* self, val* p0, val* p1, val* p2, val* p3) { parser_prod__ACastAsExternCall__init_acastasexterncall(self, p0, p1, p2, p3); RET_LABEL:; } /* method parser_prod#ACastAsExternCall#replace_child for (self: ACastAsExternCall, ANode, nullable ANode) */ void parser_prod__ACastAsExternCall__replace_child(val* self, val* p0, val* p1) { val* var_old_child /* var old_child: ANode */; val* var_new_child /* var new_child: nullable ANode */; val* var /* : AType */; short int var1 /* : Bool */; val* var2 /* : null */; short int var3 /* : Bool */; short int var4 /* : Bool */; int cltype; int idtype; val* var5 /* : nullable TDot */; short int var6 /* : Bool */; val* var7 /* : null */; short int var8 /* : Bool */; short int var9 /* : Bool */; int cltype10; int idtype11; val* var12 /* : null */; val* var13 /* : TKwas */; short int var14 /* : Bool */; val* var15 /* : null */; short int var16 /* : Bool */; short int var17 /* : Bool */; int cltype18; int idtype19; val* var20 /* : AType */; short int var21 /* : Bool */; val* var22 /* : null */; short int var23 /* : Bool */; short int var24 /* : Bool */; int cltype25; int idtype26; var_old_child = p0; var_new_child = p1; var = self->attrs[COLOR_parser_nodes__ACastAsExternCall___n_from_type].val; /* _n_from_type on <self:ACastAsExternCall> */ if (var == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_from_type"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10551); show_backtrace(1); } var1 = ((short int (*)(val*, val*))(var->class->vft[COLOR_kernel__Object___61d_61d]))(var, var_old_child) /* == on <var:AType>*/; if (var1){ var2 = NULL; if (var_new_child == NULL) { var3 = 0; /* is null */ } else { var3 = 1; /* arg is null and recv is not */ } if (var3){ ((void (*)(val*, val*))(var_new_child->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_new_child, self) /* parent= on <var_new_child:nullable ANode(ANode)>*/; /* <var_new_child:nullable ANode(ANode)> isa AType */ cltype = type_parser_nodes__AType.color; idtype = type_parser_nodes__AType.id; if(cltype >= var_new_child->type->table_size) { var4 = 0; } else { var4 = var_new_child->type->type_table[cltype] == idtype; } if (!var4) { fprintf(stderr, "Runtime error: %s", "Assert failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10554); show_backtrace(1); } self->attrs[COLOR_parser_nodes__ACastAsExternCall___n_from_type].val = var_new_child; /* _n_from_type on <self:ACastAsExternCall> */ } else { fprintf(stderr, "Runtime error: %s", "Aborted"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10557); show_backtrace(1); } goto RET_LABEL; } else { } var5 = self->attrs[COLOR_parser_nodes__ACastAsExternCall___n_dot].val; /* _n_dot on <self:ACastAsExternCall> */ if (var5 == NULL) { var6 = 0; /* <var_old_child:ANode> cannot be null */ } else { var6 = ((short int (*)(val*, val*))(var5->class->vft[COLOR_kernel__Object___61d_61d]))(var5, var_old_child) /* == on <var5:nullable TDot>*/; } if (var6){ var7 = NULL; if (var_new_child == NULL) { var8 = 0; /* is null */ } else { var8 = 1; /* arg is null and recv is not */ } if (var8){ ((void (*)(val*, val*))(var_new_child->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_new_child, self) /* parent= on <var_new_child:nullable ANode(ANode)>*/; /* <var_new_child:nullable ANode(ANode)> isa TDot */ cltype10 = type_parser_nodes__TDot.color; idtype11 = type_parser_nodes__TDot.id; if(cltype10 >= var_new_child->type->table_size) { var9 = 0; } else { var9 = var_new_child->type->type_table[cltype10] == idtype11; } if (!var9) { fprintf(stderr, "Runtime error: %s", "Assert failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10564); show_backtrace(1); } self->attrs[COLOR_parser_nodes__ACastAsExternCall___n_dot].val = var_new_child; /* _n_dot on <self:ACastAsExternCall> */ } else { var12 = NULL; self->attrs[COLOR_parser_nodes__ACastAsExternCall___n_dot].val = var12; /* _n_dot on <self:ACastAsExternCall> */ } goto RET_LABEL; } else { } var13 = self->attrs[COLOR_parser_nodes__ACastAsExternCall___n_kwas].val; /* _n_kwas on <self:ACastAsExternCall> */ if (var13 == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_kwas"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10571); show_backtrace(1); } var14 = ((short int (*)(val*, val*))(var13->class->vft[COLOR_kernel__Object___61d_61d]))(var13, var_old_child) /* == on <var13:TKwas>*/; if (var14){ var15 = NULL; if (var_new_child == NULL) { var16 = 0; /* is null */ } else { var16 = 1; /* arg is null and recv is not */ } if (var16){ ((void (*)(val*, val*))(var_new_child->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_new_child, self) /* parent= on <var_new_child:nullable ANode(ANode)>*/; /* <var_new_child:nullable ANode(ANode)> isa TKwas */ cltype18 = type_parser_nodes__TKwas.color; idtype19 = type_parser_nodes__TKwas.id; if(cltype18 >= var_new_child->type->table_size) { var17 = 0; } else { var17 = var_new_child->type->type_table[cltype18] == idtype19; } if (!var17) { fprintf(stderr, "Runtime error: %s", "Assert failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10574); show_backtrace(1); } self->attrs[COLOR_parser_nodes__ACastAsExternCall___n_kwas].val = var_new_child; /* _n_kwas on <self:ACastAsExternCall> */ } else { fprintf(stderr, "Runtime error: %s", "Aborted"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10577); show_backtrace(1); } goto RET_LABEL; } else { } var20 = self->attrs[COLOR_parser_nodes__ACastAsExternCall___n_to_type].val; /* _n_to_type on <self:ACastAsExternCall> */ if (var20 == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_to_type"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10581); show_backtrace(1); } var21 = ((short int (*)(val*, val*))(var20->class->vft[COLOR_kernel__Object___61d_61d]))(var20, var_old_child) /* == on <var20:AType>*/; if (var21){ var22 = NULL; if (var_new_child == NULL) { var23 = 0; /* is null */ } else { var23 = 1; /* arg is null and recv is not */ } if (var23){ ((void (*)(val*, val*))(var_new_child->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_new_child, self) /* parent= on <var_new_child:nullable ANode(ANode)>*/; /* <var_new_child:nullable ANode(ANode)> isa AType */ cltype25 = type_parser_nodes__AType.color; idtype26 = type_parser_nodes__AType.id; if(cltype25 >= var_new_child->type->table_size) { var24 = 0; } else { var24 = var_new_child->type->type_table[cltype25] == idtype26; } if (!var24) { fprintf(stderr, "Runtime error: %s", "Assert failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10584); show_backtrace(1); } self->attrs[COLOR_parser_nodes__ACastAsExternCall___n_to_type].val = var_new_child; /* _n_to_type on <self:ACastAsExternCall> */ } else { fprintf(stderr, "Runtime error: %s", "Aborted"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10587); show_backtrace(1); } goto RET_LABEL; } else { } RET_LABEL:; } /* method parser_prod#ACastAsExternCall#replace_child for (self: Object, ANode, nullable ANode) */ void VIRTUAL_parser_prod__ACastAsExternCall__replace_child(val* self, val* p0, val* p1) { parser_prod__ACastAsExternCall__replace_child(self, p0, p1); RET_LABEL:; } /* method parser_prod#ACastAsExternCall#n_from_type= for (self: ACastAsExternCall, AType) */ void parser_prod__ACastAsExternCall__n_from_type_61d(val* self, val* p0) { val* var_node /* var node: AType */; var_node = p0; self->attrs[COLOR_parser_nodes__ACastAsExternCall___n_from_type].val = var_node; /* _n_from_type on <self:ACastAsExternCall> */ ((void (*)(val*, val*))(var_node->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_node, self) /* parent= on <var_node:AType>*/; RET_LABEL:; } /* method parser_prod#ACastAsExternCall#n_from_type= for (self: Object, AType) */ void VIRTUAL_parser_prod__ACastAsExternCall__n_from_type_61d(val* self, val* p0) { parser_prod__ACastAsExternCall__n_from_type_61d(self, p0); RET_LABEL:; } /* method parser_prod#ACastAsExternCall#n_dot= for (self: ACastAsExternCall, nullable TDot) */ void parser_prod__ACastAsExternCall__n_dot_61d(val* self, val* p0) { val* var_node /* var node: nullable TDot */; val* var /* : null */; short int var1 /* : Bool */; var_node = p0; self->attrs[COLOR_parser_nodes__ACastAsExternCall___n_dot].val = var_node; /* _n_dot on <self:ACastAsExternCall> */ var = NULL; if (var_node == NULL) { var1 = 0; /* is null */ } else { var1 = 1; /* arg is null and recv is not */ } if (var1){ ((void (*)(val*, val*))(var_node->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_node, self) /* parent= on <var_node:nullable TDot(TDot)>*/; } else { } RET_LABEL:; } /* method parser_prod#ACastAsExternCall#n_dot= for (self: Object, nullable TDot) */ void VIRTUAL_parser_prod__ACastAsExternCall__n_dot_61d(val* self, val* p0) { parser_prod__ACastAsExternCall__n_dot_61d(self, p0); RET_LABEL:; } /* method parser_prod#ACastAsExternCall#n_kwas= for (self: ACastAsExternCall, TKwas) */ void parser_prod__ACastAsExternCall__n_kwas_61d(val* self, val* p0) { val* var_node /* var node: TKwas */; var_node = p0; self->attrs[COLOR_parser_nodes__ACastAsExternCall___n_kwas].val = var_node; /* _n_kwas on <self:ACastAsExternCall> */ ((void (*)(val*, val*))(var_node->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_node, self) /* parent= on <var_node:TKwas>*/; RET_LABEL:; } /* method parser_prod#ACastAsExternCall#n_kwas= for (self: Object, TKwas) */ void VIRTUAL_parser_prod__ACastAsExternCall__n_kwas_61d(val* self, val* p0) { parser_prod__ACastAsExternCall__n_kwas_61d(self, p0); RET_LABEL:; } /* method parser_prod#ACastAsExternCall#n_to_type= for (self: ACastAsExternCall, AType) */ void parser_prod__ACastAsExternCall__n_to_type_61d(val* self, val* p0) { val* var_node /* var node: AType */; var_node = p0; self->attrs[COLOR_parser_nodes__ACastAsExternCall___n_to_type].val = var_node; /* _n_to_type on <self:ACastAsExternCall> */ ((void (*)(val*, val*))(var_node->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_node, self) /* parent= on <var_node:AType>*/; RET_LABEL:; } /* method parser_prod#ACastAsExternCall#n_to_type= for (self: Object, AType) */ void VIRTUAL_parser_prod__ACastAsExternCall__n_to_type_61d(val* self, val* p0) { parser_prod__ACastAsExternCall__n_to_type_61d(self, p0); RET_LABEL:; } /* method parser_prod#ACastAsExternCall#visit_all for (self: ACastAsExternCall, Visitor) */ void parser_prod__ACastAsExternCall__visit_all(val* self, val* p0) { val* var_v /* var v: Visitor */; val* var /* : AType */; val* var1 /* : nullable TDot */; val* var2 /* : null */; short int var3 /* : Bool */; val* var4 /* : nullable TDot */; val* var5 /* : TKwas */; val* var6 /* : AType */; var_v = p0; var = self->attrs[COLOR_parser_nodes__ACastAsExternCall___n_from_type].val; /* _n_from_type on <self:ACastAsExternCall> */ if (var == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_from_type"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10619); show_backtrace(1); } ((void (*)(val*, val*))(var_v->class->vft[COLOR_parser_nodes__Visitor__enter_visit]))(var_v, var) /* enter_visit on <var_v:Visitor>*/; var1 = self->attrs[COLOR_parser_nodes__ACastAsExternCall___n_dot].val; /* _n_dot on <self:ACastAsExternCall> */ var2 = NULL; if (var1 == NULL) { var3 = 0; /* is null */ } else { var3 = 1; /* arg is null and recv is not */ } if (var3){ var4 = self->attrs[COLOR_parser_nodes__ACastAsExternCall___n_dot].val; /* _n_dot on <self:ACastAsExternCall> */ if (var4 == NULL) { fprintf(stderr, "Runtime error: %s", "Cast failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10621); show_backtrace(1); } ((void (*)(val*, val*))(var_v->class->vft[COLOR_parser_nodes__Visitor__enter_visit]))(var_v, var4) /* enter_visit on <var_v:Visitor>*/; } else { } var5 = self->attrs[COLOR_parser_nodes__ACastAsExternCall___n_kwas].val; /* _n_kwas on <self:ACastAsExternCall> */ if (var5 == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_kwas"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10623); show_backtrace(1); } ((void (*)(val*, val*))(var_v->class->vft[COLOR_parser_nodes__Visitor__enter_visit]))(var_v, var5) /* enter_visit on <var_v:Visitor>*/; var6 = self->attrs[COLOR_parser_nodes__ACastAsExternCall___n_to_type].val; /* _n_to_type on <self:ACastAsExternCall> */ if (var6 == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_to_type"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10624); show_backtrace(1); } ((void (*)(val*, val*))(var_v->class->vft[COLOR_parser_nodes__Visitor__enter_visit]))(var_v, var6) /* enter_visit on <var_v:Visitor>*/; RET_LABEL:; } /* method parser_prod#ACastAsExternCall#visit_all for (self: Object, Visitor) */ void VIRTUAL_parser_prod__ACastAsExternCall__visit_all(val* self, val* p0) { parser_prod__ACastAsExternCall__visit_all(self, p0); RET_LABEL:; } /* method parser_prod#AAsNullableExternCall#empty_init for (self: AAsNullableExternCall) */ void parser_prod__AAsNullableExternCall__empty_init(val* self) { RET_LABEL:; } /* method parser_prod#AAsNullableExternCall#empty_init for (self: Object) */ void VIRTUAL_parser_prod__AAsNullableExternCall__empty_init(val* self) { parser_prod__AAsNullableExternCall__empty_init(self); RET_LABEL:; } /* method parser_prod#AAsNullableExternCall#init_aasnullableexterncall for (self: AAsNullableExternCall, nullable AType, nullable TKwas, nullable TKwnullable) */ void parser_prod__AAsNullableExternCall__init_aasnullableexterncall(val* self, val* p0, val* p1, val* p2) { val* var_n_type /* var n_type: nullable AType */; val* var_n_kwas /* var n_kwas: nullable TKwas */; val* var_n_kwnullable /* var n_kwnullable: nullable TKwnullable */; var_n_type = p0; var_n_kwas = p1; var_n_kwnullable = p2; ((void (*)(val*))(self->class->vft[COLOR_parser_prod__AAsNullableExternCall__empty_init]))(self) /* empty_init on <self:AAsNullableExternCall>*/; if (var_n_type == NULL) { fprintf(stderr, "Runtime error: %s", "Cast failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10637); show_backtrace(1); } self->attrs[COLOR_parser_nodes__AAsNullableExternCall___n_type].val = var_n_type; /* _n_type on <self:AAsNullableExternCall> */ if (var_n_type == NULL) { fprintf(stderr, "Runtime error: %s", "Receiver is null"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10638); show_backtrace(1); } else { ((void (*)(val*, val*))(var_n_type->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_n_type, self) /* parent= on <var_n_type:nullable AType>*/; } if (var_n_kwas == NULL) { fprintf(stderr, "Runtime error: %s", "Cast failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10639); show_backtrace(1); } self->attrs[COLOR_parser_nodes__AAsNullableExternCall___n_kwas].val = var_n_kwas; /* _n_kwas on <self:AAsNullableExternCall> */ if (var_n_kwas == NULL) { fprintf(stderr, "Runtime error: %s", "Receiver is null"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10640); show_backtrace(1); } else { ((void (*)(val*, val*))(var_n_kwas->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_n_kwas, self) /* parent= on <var_n_kwas:nullable TKwas>*/; } if (var_n_kwnullable == NULL) { fprintf(stderr, "Runtime error: %s", "Cast failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10641); show_backtrace(1); } self->attrs[COLOR_parser_nodes__AAsNullableExternCall___n_kwnullable].val = var_n_kwnullable; /* _n_kwnullable on <self:AAsNullableExternCall> */ if (var_n_kwnullable == NULL) { fprintf(stderr, "Runtime error: %s", "Receiver is null"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10642); show_backtrace(1); } else { ((void (*)(val*, val*))(var_n_kwnullable->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_n_kwnullable, self) /* parent= on <var_n_kwnullable:nullable TKwnullable>*/; } RET_LABEL:; } /* method parser_prod#AAsNullableExternCall#init_aasnullableexterncall for (self: Object, nullable AType, nullable TKwas, nullable TKwnullable) */ void VIRTUAL_parser_prod__AAsNullableExternCall__init_aasnullableexterncall(val* self, val* p0, val* p1, val* p2) { parser_prod__AAsNullableExternCall__init_aasnullableexterncall(self, p0, p1, p2); RET_LABEL:; } /* method parser_prod#AAsNullableExternCall#replace_child for (self: AAsNullableExternCall, ANode, nullable ANode) */ void parser_prod__AAsNullableExternCall__replace_child(val* self, val* p0, val* p1) { val* var_old_child /* var old_child: ANode */; val* var_new_child /* var new_child: nullable ANode */; val* var /* : AType */; short int var1 /* : Bool */; val* var2 /* : null */; short int var3 /* : Bool */; short int var4 /* : Bool */; int cltype; int idtype; val* var5 /* : TKwas */; short int var6 /* : Bool */; val* var7 /* : null */; short int var8 /* : Bool */; short int var9 /* : Bool */; int cltype10; int idtype11; val* var12 /* : TKwnullable */; short int var13 /* : Bool */; val* var14 /* : null */; short int var15 /* : Bool */; short int var16 /* : Bool */; int cltype17; int idtype18; var_old_child = p0; var_new_child = p1; var = self->attrs[COLOR_parser_nodes__AAsNullableExternCall___n_type].val; /* _n_type on <self:AAsNullableExternCall> */ if (var == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_type"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10647); show_backtrace(1); } var1 = ((short int (*)(val*, val*))(var->class->vft[COLOR_kernel__Object___61d_61d]))(var, var_old_child) /* == on <var:AType>*/; if (var1){ var2 = NULL; if (var_new_child == NULL) { var3 = 0; /* is null */ } else { var3 = 1; /* arg is null and recv is not */ } if (var3){ ((void (*)(val*, val*))(var_new_child->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_new_child, self) /* parent= on <var_new_child:nullable ANode(ANode)>*/; /* <var_new_child:nullable ANode(ANode)> isa AType */ cltype = type_parser_nodes__AType.color; idtype = type_parser_nodes__AType.id; if(cltype >= var_new_child->type->table_size) { var4 = 0; } else { var4 = var_new_child->type->type_table[cltype] == idtype; } if (!var4) { fprintf(stderr, "Runtime error: %s", "Assert failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10650); show_backtrace(1); } self->attrs[COLOR_parser_nodes__AAsNullableExternCall___n_type].val = var_new_child; /* _n_type on <self:AAsNullableExternCall> */ } else { fprintf(stderr, "Runtime error: %s", "Aborted"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10653); show_backtrace(1); } goto RET_LABEL; } else { } var5 = self->attrs[COLOR_parser_nodes__AAsNullableExternCall___n_kwas].val; /* _n_kwas on <self:AAsNullableExternCall> */ if (var5 == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_kwas"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10657); show_backtrace(1); } var6 = ((short int (*)(val*, val*))(var5->class->vft[COLOR_kernel__Object___61d_61d]))(var5, var_old_child) /* == on <var5:TKwas>*/; if (var6){ var7 = NULL; if (var_new_child == NULL) { var8 = 0; /* is null */ } else { var8 = 1; /* arg is null and recv is not */ } if (var8){ ((void (*)(val*, val*))(var_new_child->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_new_child, self) /* parent= on <var_new_child:nullable ANode(ANode)>*/; /* <var_new_child:nullable ANode(ANode)> isa TKwas */ cltype10 = type_parser_nodes__TKwas.color; idtype11 = type_parser_nodes__TKwas.id; if(cltype10 >= var_new_child->type->table_size) { var9 = 0; } else { var9 = var_new_child->type->type_table[cltype10] == idtype11; } if (!var9) { fprintf(stderr, "Runtime error: %s", "Assert failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10660); show_backtrace(1); } self->attrs[COLOR_parser_nodes__AAsNullableExternCall___n_kwas].val = var_new_child; /* _n_kwas on <self:AAsNullableExternCall> */ } else { fprintf(stderr, "Runtime error: %s", "Aborted"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10663); show_backtrace(1); } goto RET_LABEL; } else { } var12 = self->attrs[COLOR_parser_nodes__AAsNullableExternCall___n_kwnullable].val; /* _n_kwnullable on <self:AAsNullableExternCall> */ if (var12 == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_kwnullable"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10667); show_backtrace(1); } var13 = ((short int (*)(val*, val*))(var12->class->vft[COLOR_kernel__Object___61d_61d]))(var12, var_old_child) /* == on <var12:TKwnullable>*/; if (var13){ var14 = NULL; if (var_new_child == NULL) { var15 = 0; /* is null */ } else { var15 = 1; /* arg is null and recv is not */ } if (var15){ ((void (*)(val*, val*))(var_new_child->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_new_child, self) /* parent= on <var_new_child:nullable ANode(ANode)>*/; /* <var_new_child:nullable ANode(ANode)> isa TKwnullable */ cltype17 = type_parser_nodes__TKwnullable.color; idtype18 = type_parser_nodes__TKwnullable.id; if(cltype17 >= var_new_child->type->table_size) { var16 = 0; } else { var16 = var_new_child->type->type_table[cltype17] == idtype18; } if (!var16) { fprintf(stderr, "Runtime error: %s", "Assert failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10670); show_backtrace(1); } self->attrs[COLOR_parser_nodes__AAsNullableExternCall___n_kwnullable].val = var_new_child; /* _n_kwnullable on <self:AAsNullableExternCall> */ } else { fprintf(stderr, "Runtime error: %s", "Aborted"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10673); show_backtrace(1); } goto RET_LABEL; } else { } RET_LABEL:; } /* method parser_prod#AAsNullableExternCall#replace_child for (self: Object, ANode, nullable ANode) */ void VIRTUAL_parser_prod__AAsNullableExternCall__replace_child(val* self, val* p0, val* p1) { parser_prod__AAsNullableExternCall__replace_child(self, p0, p1); RET_LABEL:; } /* method parser_prod#AAsNullableExternCall#n_type= for (self: AAsNullableExternCall, AType) */ void parser_prod__AAsNullableExternCall__n_type_61d(val* self, val* p0) { val* var_node /* var node: AType */; var_node = p0; self->attrs[COLOR_parser_nodes__AAsNullableExternCall___n_type].val = var_node; /* _n_type on <self:AAsNullableExternCall> */ ((void (*)(val*, val*))(var_node->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_node, self) /* parent= on <var_node:AType>*/; RET_LABEL:; } /* method parser_prod#AAsNullableExternCall#n_type= for (self: Object, AType) */ void VIRTUAL_parser_prod__AAsNullableExternCall__n_type_61d(val* self, val* p0) { parser_prod__AAsNullableExternCall__n_type_61d(self, p0); RET_LABEL:; } /* method parser_prod#AAsNullableExternCall#n_kwas= for (self: AAsNullableExternCall, TKwas) */ void parser_prod__AAsNullableExternCall__n_kwas_61d(val* self, val* p0) { val* var_node /* var node: TKwas */; var_node = p0; self->attrs[COLOR_parser_nodes__AAsNullableExternCall___n_kwas].val = var_node; /* _n_kwas on <self:AAsNullableExternCall> */ ((void (*)(val*, val*))(var_node->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_node, self) /* parent= on <var_node:TKwas>*/; RET_LABEL:; } /* method parser_prod#AAsNullableExternCall#n_kwas= for (self: Object, TKwas) */ void VIRTUAL_parser_prod__AAsNullableExternCall__n_kwas_61d(val* self, val* p0) { parser_prod__AAsNullableExternCall__n_kwas_61d(self, p0); RET_LABEL:; } /* method parser_prod#AAsNullableExternCall#n_kwnullable= for (self: AAsNullableExternCall, TKwnullable) */ void parser_prod__AAsNullableExternCall__n_kwnullable_61d(val* self, val* p0) { val* var_node /* var node: TKwnullable */; var_node = p0; self->attrs[COLOR_parser_nodes__AAsNullableExternCall___n_kwnullable].val = var_node; /* _n_kwnullable on <self:AAsNullableExternCall> */ ((void (*)(val*, val*))(var_node->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_node, self) /* parent= on <var_node:TKwnullable>*/; RET_LABEL:; } /* method parser_prod#AAsNullableExternCall#n_kwnullable= for (self: Object, TKwnullable) */ void VIRTUAL_parser_prod__AAsNullableExternCall__n_kwnullable_61d(val* self, val* p0) { parser_prod__AAsNullableExternCall__n_kwnullable_61d(self, p0); RET_LABEL:; } /* method parser_prod#AAsNullableExternCall#visit_all for (self: AAsNullableExternCall, Visitor) */ void parser_prod__AAsNullableExternCall__visit_all(val* self, val* p0) { val* var_v /* var v: Visitor */; val* var /* : AType */; val* var1 /* : TKwas */; val* var2 /* : TKwnullable */; var_v = p0; var = self->attrs[COLOR_parser_nodes__AAsNullableExternCall___n_type].val; /* _n_type on <self:AAsNullableExternCall> */ if (var == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_type"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10698); show_backtrace(1); } ((void (*)(val*, val*))(var_v->class->vft[COLOR_parser_nodes__Visitor__enter_visit]))(var_v, var) /* enter_visit on <var_v:Visitor>*/; var1 = self->attrs[COLOR_parser_nodes__AAsNullableExternCall___n_kwas].val; /* _n_kwas on <self:AAsNullableExternCall> */ if (var1 == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_kwas"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10699); show_backtrace(1); } ((void (*)(val*, val*))(var_v->class->vft[COLOR_parser_nodes__Visitor__enter_visit]))(var_v, var1) /* enter_visit on <var_v:Visitor>*/; var2 = self->attrs[COLOR_parser_nodes__AAsNullableExternCall___n_kwnullable].val; /* _n_kwnullable on <self:AAsNullableExternCall> */ if (var2 == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_kwnullable"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10700); show_backtrace(1); } ((void (*)(val*, val*))(var_v->class->vft[COLOR_parser_nodes__Visitor__enter_visit]))(var_v, var2) /* enter_visit on <var_v:Visitor>*/; RET_LABEL:; } /* method parser_prod#AAsNullableExternCall#visit_all for (self: Object, Visitor) */ void VIRTUAL_parser_prod__AAsNullableExternCall__visit_all(val* self, val* p0) { parser_prod__AAsNullableExternCall__visit_all(self, p0); RET_LABEL:; } /* method parser_prod#AAsNotNullableExternCall#empty_init for (self: AAsNotNullableExternCall) */ void parser_prod__AAsNotNullableExternCall__empty_init(val* self) { RET_LABEL:; } /* method parser_prod#AAsNotNullableExternCall#empty_init for (self: Object) */ void VIRTUAL_parser_prod__AAsNotNullableExternCall__empty_init(val* self) { parser_prod__AAsNotNullableExternCall__empty_init(self); RET_LABEL:; } /* method parser_prod#AAsNotNullableExternCall#init_aasnotnullableexterncall for (self: AAsNotNullableExternCall, nullable AType, nullable TKwas, nullable TKwnot, nullable TKwnullable) */ void parser_prod__AAsNotNullableExternCall__init_aasnotnullableexterncall(val* self, val* p0, val* p1, val* p2, val* p3) { val* var_n_type /* var n_type: nullable AType */; val* var_n_kwas /* var n_kwas: nullable TKwas */; val* var_n_kwnot /* var n_kwnot: nullable TKwnot */; val* var_n_kwnullable /* var n_kwnullable: nullable TKwnullable */; var_n_type = p0; var_n_kwas = p1; var_n_kwnot = p2; var_n_kwnullable = p3; ((void (*)(val*))(self->class->vft[COLOR_parser_prod__AAsNotNullableExternCall__empty_init]))(self) /* empty_init on <self:AAsNotNullableExternCall>*/; if (var_n_type == NULL) { fprintf(stderr, "Runtime error: %s", "Cast failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10714); show_backtrace(1); } self->attrs[COLOR_parser_nodes__AAsNotNullableExternCall___n_type].val = var_n_type; /* _n_type on <self:AAsNotNullableExternCall> */ if (var_n_type == NULL) { fprintf(stderr, "Runtime error: %s", "Receiver is null"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10715); show_backtrace(1); } else { ((void (*)(val*, val*))(var_n_type->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_n_type, self) /* parent= on <var_n_type:nullable AType>*/; } if (var_n_kwas == NULL) { fprintf(stderr, "Runtime error: %s", "Cast failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10716); show_backtrace(1); } self->attrs[COLOR_parser_nodes__AAsNotNullableExternCall___n_kwas].val = var_n_kwas; /* _n_kwas on <self:AAsNotNullableExternCall> */ if (var_n_kwas == NULL) { fprintf(stderr, "Runtime error: %s", "Receiver is null"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10717); show_backtrace(1); } else { ((void (*)(val*, val*))(var_n_kwas->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_n_kwas, self) /* parent= on <var_n_kwas:nullable TKwas>*/; } if (var_n_kwnot == NULL) { fprintf(stderr, "Runtime error: %s", "Cast failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10718); show_backtrace(1); } self->attrs[COLOR_parser_nodes__AAsNotNullableExternCall___n_kwnot].val = var_n_kwnot; /* _n_kwnot on <self:AAsNotNullableExternCall> */ if (var_n_kwnot == NULL) { fprintf(stderr, "Runtime error: %s", "Receiver is null"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10719); show_backtrace(1); } else { ((void (*)(val*, val*))(var_n_kwnot->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_n_kwnot, self) /* parent= on <var_n_kwnot:nullable TKwnot>*/; } if (var_n_kwnullable == NULL) { fprintf(stderr, "Runtime error: %s", "Cast failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10720); show_backtrace(1); } self->attrs[COLOR_parser_nodes__AAsNotNullableExternCall___n_kwnullable].val = var_n_kwnullable; /* _n_kwnullable on <self:AAsNotNullableExternCall> */ if (var_n_kwnullable == NULL) { fprintf(stderr, "Runtime error: %s", "Receiver is null"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10721); show_backtrace(1); } else { ((void (*)(val*, val*))(var_n_kwnullable->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_n_kwnullable, self) /* parent= on <var_n_kwnullable:nullable TKwnullable>*/; } RET_LABEL:; } /* method parser_prod#AAsNotNullableExternCall#init_aasnotnullableexterncall for (self: Object, nullable AType, nullable TKwas, nullable TKwnot, nullable TKwnullable) */ void VIRTUAL_parser_prod__AAsNotNullableExternCall__init_aasnotnullableexterncall(val* self, val* p0, val* p1, val* p2, val* p3) { parser_prod__AAsNotNullableExternCall__init_aasnotnullableexterncall(self, p0, p1, p2, p3); RET_LABEL:; } /* method parser_prod#AAsNotNullableExternCall#replace_child for (self: AAsNotNullableExternCall, ANode, nullable ANode) */ void parser_prod__AAsNotNullableExternCall__replace_child(val* self, val* p0, val* p1) { val* var_old_child /* var old_child: ANode */; val* var_new_child /* var new_child: nullable ANode */; val* var /* : AType */; short int var1 /* : Bool */; val* var2 /* : null */; short int var3 /* : Bool */; short int var4 /* : Bool */; int cltype; int idtype; val* var5 /* : TKwas */; short int var6 /* : Bool */; val* var7 /* : null */; short int var8 /* : Bool */; short int var9 /* : Bool */; int cltype10; int idtype11; val* var12 /* : TKwnot */; short int var13 /* : Bool */; val* var14 /* : null */; short int var15 /* : Bool */; short int var16 /* : Bool */; int cltype17; int idtype18; val* var19 /* : TKwnullable */; short int var20 /* : Bool */; val* var21 /* : null */; short int var22 /* : Bool */; short int var23 /* : Bool */; int cltype24; int idtype25; var_old_child = p0; var_new_child = p1; var = self->attrs[COLOR_parser_nodes__AAsNotNullableExternCall___n_type].val; /* _n_type on <self:AAsNotNullableExternCall> */ if (var == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_type"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10726); show_backtrace(1); } var1 = ((short int (*)(val*, val*))(var->class->vft[COLOR_kernel__Object___61d_61d]))(var, var_old_child) /* == on <var:AType>*/; if (var1){ var2 = NULL; if (var_new_child == NULL) { var3 = 0; /* is null */ } else { var3 = 1; /* arg is null and recv is not */ } if (var3){ ((void (*)(val*, val*))(var_new_child->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_new_child, self) /* parent= on <var_new_child:nullable ANode(ANode)>*/; /* <var_new_child:nullable ANode(ANode)> isa AType */ cltype = type_parser_nodes__AType.color; idtype = type_parser_nodes__AType.id; if(cltype >= var_new_child->type->table_size) { var4 = 0; } else { var4 = var_new_child->type->type_table[cltype] == idtype; } if (!var4) { fprintf(stderr, "Runtime error: %s", "Assert failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10729); show_backtrace(1); } self->attrs[COLOR_parser_nodes__AAsNotNullableExternCall___n_type].val = var_new_child; /* _n_type on <self:AAsNotNullableExternCall> */ } else { fprintf(stderr, "Runtime error: %s", "Aborted"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10732); show_backtrace(1); } goto RET_LABEL; } else { } var5 = self->attrs[COLOR_parser_nodes__AAsNotNullableExternCall___n_kwas].val; /* _n_kwas on <self:AAsNotNullableExternCall> */ if (var5 == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_kwas"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10736); show_backtrace(1); } var6 = ((short int (*)(val*, val*))(var5->class->vft[COLOR_kernel__Object___61d_61d]))(var5, var_old_child) /* == on <var5:TKwas>*/; if (var6){ var7 = NULL; if (var_new_child == NULL) { var8 = 0; /* is null */ } else { var8 = 1; /* arg is null and recv is not */ } if (var8){ ((void (*)(val*, val*))(var_new_child->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_new_child, self) /* parent= on <var_new_child:nullable ANode(ANode)>*/; /* <var_new_child:nullable ANode(ANode)> isa TKwas */ cltype10 = type_parser_nodes__TKwas.color; idtype11 = type_parser_nodes__TKwas.id; if(cltype10 >= var_new_child->type->table_size) { var9 = 0; } else { var9 = var_new_child->type->type_table[cltype10] == idtype11; } if (!var9) { fprintf(stderr, "Runtime error: %s", "Assert failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10739); show_backtrace(1); } self->attrs[COLOR_parser_nodes__AAsNotNullableExternCall___n_kwas].val = var_new_child; /* _n_kwas on <self:AAsNotNullableExternCall> */ } else { fprintf(stderr, "Runtime error: %s", "Aborted"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10742); show_backtrace(1); } goto RET_LABEL; } else { } var12 = self->attrs[COLOR_parser_nodes__AAsNotNullableExternCall___n_kwnot].val; /* _n_kwnot on <self:AAsNotNullableExternCall> */ if (var12 == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_kwnot"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10746); show_backtrace(1); } var13 = ((short int (*)(val*, val*))(var12->class->vft[COLOR_kernel__Object___61d_61d]))(var12, var_old_child) /* == on <var12:TKwnot>*/; if (var13){ var14 = NULL; if (var_new_child == NULL) { var15 = 0; /* is null */ } else { var15 = 1; /* arg is null and recv is not */ } if (var15){ ((void (*)(val*, val*))(var_new_child->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_new_child, self) /* parent= on <var_new_child:nullable ANode(ANode)>*/; /* <var_new_child:nullable ANode(ANode)> isa TKwnot */ cltype17 = type_parser_nodes__TKwnot.color; idtype18 = type_parser_nodes__TKwnot.id; if(cltype17 >= var_new_child->type->table_size) { var16 = 0; } else { var16 = var_new_child->type->type_table[cltype17] == idtype18; } if (!var16) { fprintf(stderr, "Runtime error: %s", "Assert failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10749); show_backtrace(1); } self->attrs[COLOR_parser_nodes__AAsNotNullableExternCall___n_kwnot].val = var_new_child; /* _n_kwnot on <self:AAsNotNullableExternCall> */ } else { fprintf(stderr, "Runtime error: %s", "Aborted"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10752); show_backtrace(1); } goto RET_LABEL; } else { } var19 = self->attrs[COLOR_parser_nodes__AAsNotNullableExternCall___n_kwnullable].val; /* _n_kwnullable on <self:AAsNotNullableExternCall> */ if (var19 == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_kwnullable"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10756); show_backtrace(1); } var20 = ((short int (*)(val*, val*))(var19->class->vft[COLOR_kernel__Object___61d_61d]))(var19, var_old_child) /* == on <var19:TKwnullable>*/; if (var20){ var21 = NULL; if (var_new_child == NULL) { var22 = 0; /* is null */ } else { var22 = 1; /* arg is null and recv is not */ } if (var22){ ((void (*)(val*, val*))(var_new_child->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_new_child, self) /* parent= on <var_new_child:nullable ANode(ANode)>*/; /* <var_new_child:nullable ANode(ANode)> isa TKwnullable */ cltype24 = type_parser_nodes__TKwnullable.color; idtype25 = type_parser_nodes__TKwnullable.id; if(cltype24 >= var_new_child->type->table_size) { var23 = 0; } else { var23 = var_new_child->type->type_table[cltype24] == idtype25; } if (!var23) { fprintf(stderr, "Runtime error: %s", "Assert failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10759); show_backtrace(1); } self->attrs[COLOR_parser_nodes__AAsNotNullableExternCall___n_kwnullable].val = var_new_child; /* _n_kwnullable on <self:AAsNotNullableExternCall> */ } else { fprintf(stderr, "Runtime error: %s", "Aborted"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10762); show_backtrace(1); } goto RET_LABEL; } else { } RET_LABEL:; } /* method parser_prod#AAsNotNullableExternCall#replace_child for (self: Object, ANode, nullable ANode) */ void VIRTUAL_parser_prod__AAsNotNullableExternCall__replace_child(val* self, val* p0, val* p1) { parser_prod__AAsNotNullableExternCall__replace_child(self, p0, p1); RET_LABEL:; } /* method parser_prod#AAsNotNullableExternCall#n_type= for (self: AAsNotNullableExternCall, AType) */ void parser_prod__AAsNotNullableExternCall__n_type_61d(val* self, val* p0) { val* var_node /* var node: AType */; var_node = p0; self->attrs[COLOR_parser_nodes__AAsNotNullableExternCall___n_type].val = var_node; /* _n_type on <self:AAsNotNullableExternCall> */ ((void (*)(val*, val*))(var_node->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_node, self) /* parent= on <var_node:AType>*/; RET_LABEL:; } /* method parser_prod#AAsNotNullableExternCall#n_type= for (self: Object, AType) */ void VIRTUAL_parser_prod__AAsNotNullableExternCall__n_type_61d(val* self, val* p0) { parser_prod__AAsNotNullableExternCall__n_type_61d(self, p0); RET_LABEL:; } /* method parser_prod#AAsNotNullableExternCall#n_kwas= for (self: AAsNotNullableExternCall, TKwas) */ void parser_prod__AAsNotNullableExternCall__n_kwas_61d(val* self, val* p0) { val* var_node /* var node: TKwas */; var_node = p0; self->attrs[COLOR_parser_nodes__AAsNotNullableExternCall___n_kwas].val = var_node; /* _n_kwas on <self:AAsNotNullableExternCall> */ ((void (*)(val*, val*))(var_node->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_node, self) /* parent= on <var_node:TKwas>*/; RET_LABEL:; } /* method parser_prod#AAsNotNullableExternCall#n_kwas= for (self: Object, TKwas) */ void VIRTUAL_parser_prod__AAsNotNullableExternCall__n_kwas_61d(val* self, val* p0) { parser_prod__AAsNotNullableExternCall__n_kwas_61d(self, p0); RET_LABEL:; } /* method parser_prod#AAsNotNullableExternCall#n_kwnot= for (self: AAsNotNullableExternCall, TKwnot) */ void parser_prod__AAsNotNullableExternCall__n_kwnot_61d(val* self, val* p0) { val* var_node /* var node: TKwnot */; var_node = p0; self->attrs[COLOR_parser_nodes__AAsNotNullableExternCall___n_kwnot].val = var_node; /* _n_kwnot on <self:AAsNotNullableExternCall> */ ((void (*)(val*, val*))(var_node->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_node, self) /* parent= on <var_node:TKwnot>*/; RET_LABEL:; } /* method parser_prod#AAsNotNullableExternCall#n_kwnot= for (self: Object, TKwnot) */ void VIRTUAL_parser_prod__AAsNotNullableExternCall__n_kwnot_61d(val* self, val* p0) { parser_prod__AAsNotNullableExternCall__n_kwnot_61d(self, p0); RET_LABEL:; } /* method parser_prod#AAsNotNullableExternCall#n_kwnullable= for (self: AAsNotNullableExternCall, TKwnullable) */ void parser_prod__AAsNotNullableExternCall__n_kwnullable_61d(val* self, val* p0) { val* var_node /* var node: TKwnullable */; var_node = p0; self->attrs[COLOR_parser_nodes__AAsNotNullableExternCall___n_kwnullable].val = var_node; /* _n_kwnullable on <self:AAsNotNullableExternCall> */ ((void (*)(val*, val*))(var_node->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_node, self) /* parent= on <var_node:TKwnullable>*/; RET_LABEL:; } /* method parser_prod#AAsNotNullableExternCall#n_kwnullable= for (self: Object, TKwnullable) */ void VIRTUAL_parser_prod__AAsNotNullableExternCall__n_kwnullable_61d(val* self, val* p0) { parser_prod__AAsNotNullableExternCall__n_kwnullable_61d(self, p0); RET_LABEL:; } /* method parser_prod#AAsNotNullableExternCall#visit_all for (self: AAsNotNullableExternCall, Visitor) */ void parser_prod__AAsNotNullableExternCall__visit_all(val* self, val* p0) { val* var_v /* var v: Visitor */; val* var /* : AType */; val* var1 /* : TKwas */; val* var2 /* : TKwnot */; val* var3 /* : TKwnullable */; var_v = p0; var = self->attrs[COLOR_parser_nodes__AAsNotNullableExternCall___n_type].val; /* _n_type on <self:AAsNotNullableExternCall> */ if (var == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_type"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10792); show_backtrace(1); } ((void (*)(val*, val*))(var_v->class->vft[COLOR_parser_nodes__Visitor__enter_visit]))(var_v, var) /* enter_visit on <var_v:Visitor>*/; var1 = self->attrs[COLOR_parser_nodes__AAsNotNullableExternCall___n_kwas].val; /* _n_kwas on <self:AAsNotNullableExternCall> */ if (var1 == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_kwas"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10793); show_backtrace(1); } ((void (*)(val*, val*))(var_v->class->vft[COLOR_parser_nodes__Visitor__enter_visit]))(var_v, var1) /* enter_visit on <var_v:Visitor>*/; var2 = self->attrs[COLOR_parser_nodes__AAsNotNullableExternCall___n_kwnot].val; /* _n_kwnot on <self:AAsNotNullableExternCall> */ if (var2 == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_kwnot"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10794); show_backtrace(1); } ((void (*)(val*, val*))(var_v->class->vft[COLOR_parser_nodes__Visitor__enter_visit]))(var_v, var2) /* enter_visit on <var_v:Visitor>*/; var3 = self->attrs[COLOR_parser_nodes__AAsNotNullableExternCall___n_kwnullable].val; /* _n_kwnullable on <self:AAsNotNullableExternCall> */ if (var3 == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_kwnullable"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10795); show_backtrace(1); } ((void (*)(val*, val*))(var_v->class->vft[COLOR_parser_nodes__Visitor__enter_visit]))(var_v, var3) /* enter_visit on <var_v:Visitor>*/; RET_LABEL:; } /* method parser_prod#AAsNotNullableExternCall#visit_all for (self: Object, Visitor) */ void VIRTUAL_parser_prod__AAsNotNullableExternCall__visit_all(val* self, val* p0) { parser_prod__AAsNotNullableExternCall__visit_all(self, p0); RET_LABEL:; } /* method parser_prod#AInLanguage#empty_init for (self: AInLanguage) */ void parser_prod__AInLanguage__empty_init(val* self) { RET_LABEL:; } /* method parser_prod#AInLanguage#empty_init for (self: Object) */ void VIRTUAL_parser_prod__AInLanguage__empty_init(val* self) { parser_prod__AInLanguage__empty_init(self); RET_LABEL:; } /* method parser_prod#AInLanguage#init_ainlanguage for (self: AInLanguage, nullable TKwin, nullable TString) */ void parser_prod__AInLanguage__init_ainlanguage(val* self, val* p0, val* p1) { val* var_n_kwin /* var n_kwin: nullable TKwin */; val* var_n_string /* var n_string: nullable TString */; var_n_kwin = p0; var_n_string = p1; ((void (*)(val*))(self->class->vft[COLOR_parser_prod__AInLanguage__empty_init]))(self) /* empty_init on <self:AInLanguage>*/; if (var_n_kwin == NULL) { fprintf(stderr, "Runtime error: %s", "Cast failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10807); show_backtrace(1); } self->attrs[COLOR_parser_nodes__AInLanguage___n_kwin].val = var_n_kwin; /* _n_kwin on <self:AInLanguage> */ if (var_n_kwin == NULL) { fprintf(stderr, "Runtime error: %s", "Receiver is null"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10808); show_backtrace(1); } else { ((void (*)(val*, val*))(var_n_kwin->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_n_kwin, self) /* parent= on <var_n_kwin:nullable TKwin>*/; } if (var_n_string == NULL) { fprintf(stderr, "Runtime error: %s", "Cast failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10809); show_backtrace(1); } self->attrs[COLOR_parser_nodes__AInLanguage___n_string].val = var_n_string; /* _n_string on <self:AInLanguage> */ if (var_n_string == NULL) { fprintf(stderr, "Runtime error: %s", "Receiver is null"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10810); show_backtrace(1); } else { ((void (*)(val*, val*))(var_n_string->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_n_string, self) /* parent= on <var_n_string:nullable TString>*/; } RET_LABEL:; } /* method parser_prod#AInLanguage#init_ainlanguage for (self: Object, nullable TKwin, nullable TString) */ void VIRTUAL_parser_prod__AInLanguage__init_ainlanguage(val* self, val* p0, val* p1) { parser_prod__AInLanguage__init_ainlanguage(self, p0, p1); RET_LABEL:; } /* method parser_prod#AInLanguage#replace_child for (self: AInLanguage, ANode, nullable ANode) */ void parser_prod__AInLanguage__replace_child(val* self, val* p0, val* p1) { val* var_old_child /* var old_child: ANode */; val* var_new_child /* var new_child: nullable ANode */; val* var /* : TKwin */; short int var1 /* : Bool */; val* var2 /* : null */; short int var3 /* : Bool */; short int var4 /* : Bool */; int cltype; int idtype; val* var5 /* : TString */; short int var6 /* : Bool */; val* var7 /* : null */; short int var8 /* : Bool */; short int var9 /* : Bool */; int cltype10; int idtype11; var_old_child = p0; var_new_child = p1; var = self->attrs[COLOR_parser_nodes__AInLanguage___n_kwin].val; /* _n_kwin on <self:AInLanguage> */ if (var == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_kwin"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10815); show_backtrace(1); } var1 = ((short int (*)(val*, val*))(var->class->vft[COLOR_kernel__Object___61d_61d]))(var, var_old_child) /* == on <var:TKwin>*/; if (var1){ var2 = NULL; if (var_new_child == NULL) { var3 = 0; /* is null */ } else { var3 = 1; /* arg is null and recv is not */ } if (var3){ ((void (*)(val*, val*))(var_new_child->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_new_child, self) /* parent= on <var_new_child:nullable ANode(ANode)>*/; /* <var_new_child:nullable ANode(ANode)> isa TKwin */ cltype = type_parser_nodes__TKwin.color; idtype = type_parser_nodes__TKwin.id; if(cltype >= var_new_child->type->table_size) { var4 = 0; } else { var4 = var_new_child->type->type_table[cltype] == idtype; } if (!var4) { fprintf(stderr, "Runtime error: %s", "Assert failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10818); show_backtrace(1); } self->attrs[COLOR_parser_nodes__AInLanguage___n_kwin].val = var_new_child; /* _n_kwin on <self:AInLanguage> */ } else { fprintf(stderr, "Runtime error: %s", "Aborted"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10821); show_backtrace(1); } goto RET_LABEL; } else { } var5 = self->attrs[COLOR_parser_nodes__AInLanguage___n_string].val; /* _n_string on <self:AInLanguage> */ if (var5 == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_string"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10825); show_backtrace(1); } var6 = ((short int (*)(val*, val*))(var5->class->vft[COLOR_kernel__Object___61d_61d]))(var5, var_old_child) /* == on <var5:TString>*/; if (var6){ var7 = NULL; if (var_new_child == NULL) { var8 = 0; /* is null */ } else { var8 = 1; /* arg is null and recv is not */ } if (var8){ ((void (*)(val*, val*))(var_new_child->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_new_child, self) /* parent= on <var_new_child:nullable ANode(ANode)>*/; /* <var_new_child:nullable ANode(ANode)> isa TString */ cltype10 = type_parser_nodes__TString.color; idtype11 = type_parser_nodes__TString.id; if(cltype10 >= var_new_child->type->table_size) { var9 = 0; } else { var9 = var_new_child->type->type_table[cltype10] == idtype11; } if (!var9) { fprintf(stderr, "Runtime error: %s", "Assert failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10828); show_backtrace(1); } self->attrs[COLOR_parser_nodes__AInLanguage___n_string].val = var_new_child; /* _n_string on <self:AInLanguage> */ } else { fprintf(stderr, "Runtime error: %s", "Aborted"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10831); show_backtrace(1); } goto RET_LABEL; } else { } RET_LABEL:; } /* method parser_prod#AInLanguage#replace_child for (self: Object, ANode, nullable ANode) */ void VIRTUAL_parser_prod__AInLanguage__replace_child(val* self, val* p0, val* p1) { parser_prod__AInLanguage__replace_child(self, p0, p1); RET_LABEL:; } /* method parser_prod#AInLanguage#n_kwin= for (self: AInLanguage, TKwin) */ void parser_prod__AInLanguage__n_kwin_61d(val* self, val* p0) { val* var_node /* var node: TKwin */; var_node = p0; self->attrs[COLOR_parser_nodes__AInLanguage___n_kwin].val = var_node; /* _n_kwin on <self:AInLanguage> */ ((void (*)(val*, val*))(var_node->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_node, self) /* parent= on <var_node:TKwin>*/; RET_LABEL:; } /* method parser_prod#AInLanguage#n_kwin= for (self: Object, TKwin) */ void VIRTUAL_parser_prod__AInLanguage__n_kwin_61d(val* self, val* p0) { parser_prod__AInLanguage__n_kwin_61d(self, p0); RET_LABEL:; } /* method parser_prod#AInLanguage#n_string= for (self: AInLanguage, TString) */ void parser_prod__AInLanguage__n_string_61d(val* self, val* p0) { val* var_node /* var node: TString */; var_node = p0; self->attrs[COLOR_parser_nodes__AInLanguage___n_string].val = var_node; /* _n_string on <self:AInLanguage> */ ((void (*)(val*, val*))(var_node->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_node, self) /* parent= on <var_node:TString>*/; RET_LABEL:; } /* method parser_prod#AInLanguage#n_string= for (self: Object, TString) */ void VIRTUAL_parser_prod__AInLanguage__n_string_61d(val* self, val* p0) { parser_prod__AInLanguage__n_string_61d(self, p0); RET_LABEL:; } /* method parser_prod#AInLanguage#visit_all for (self: AInLanguage, Visitor) */ void parser_prod__AInLanguage__visit_all(val* self, val* p0) { val* var_v /* var v: Visitor */; val* var /* : TKwin */; val* var1 /* : TString */; var_v = p0; var = self->attrs[COLOR_parser_nodes__AInLanguage___n_kwin].val; /* _n_kwin on <self:AInLanguage> */ if (var == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_kwin"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10851); show_backtrace(1); } ((void (*)(val*, val*))(var_v->class->vft[COLOR_parser_nodes__Visitor__enter_visit]))(var_v, var) /* enter_visit on <var_v:Visitor>*/; var1 = self->attrs[COLOR_parser_nodes__AInLanguage___n_string].val; /* _n_string on <self:AInLanguage> */ if (var1 == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_string"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10852); show_backtrace(1); } ((void (*)(val*, val*))(var_v->class->vft[COLOR_parser_nodes__Visitor__enter_visit]))(var_v, var1) /* enter_visit on <var_v:Visitor>*/; RET_LABEL:; } /* method parser_prod#AInLanguage#visit_all for (self: Object, Visitor) */ void VIRTUAL_parser_prod__AInLanguage__visit_all(val* self, val* p0) { parser_prod__AInLanguage__visit_all(self, p0); RET_LABEL:; } /* method parser_prod#AExternCodeBlock#empty_init for (self: AExternCodeBlock) */ void parser_prod__AExternCodeBlock__empty_init(val* self) { RET_LABEL:; } /* method parser_prod#AExternCodeBlock#empty_init for (self: Object) */ void VIRTUAL_parser_prod__AExternCodeBlock__empty_init(val* self) { parser_prod__AExternCodeBlock__empty_init(self); RET_LABEL:; } /* method parser_prod#AExternCodeBlock#init_aexterncodeblock for (self: AExternCodeBlock, nullable AInLanguage, nullable TExternCodeSegment) */ void parser_prod__AExternCodeBlock__init_aexterncodeblock(val* self, val* p0, val* p1) { val* var_n_in_language /* var n_in_language: nullable AInLanguage */; val* var_n_extern_code_segment /* var n_extern_code_segment: nullable TExternCodeSegment */; val* var /* : null */; short int var1 /* : Bool */; var_n_in_language = p0; var_n_extern_code_segment = p1; ((void (*)(val*))(self->class->vft[COLOR_parser_prod__AExternCodeBlock__empty_init]))(self) /* empty_init on <self:AExternCodeBlock>*/; self->attrs[COLOR_parser_nodes__AExternCodeBlock___n_in_language].val = var_n_in_language; /* _n_in_language on <self:AExternCodeBlock> */ var = NULL; if (var_n_in_language == NULL) { var1 = 0; /* is null */ } else { var1 = 1; /* arg is null and recv is not */ } if (var1){ ((void (*)(val*, val*))(var_n_in_language->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_n_in_language, self) /* parent= on <var_n_in_language:nullable AInLanguage(AInLanguage)>*/; } else { } if (var_n_extern_code_segment == NULL) { fprintf(stderr, "Runtime error: %s", "Cast failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10868); show_backtrace(1); } self->attrs[COLOR_parser_nodes__AExternCodeBlock___n_extern_code_segment].val = var_n_extern_code_segment; /* _n_extern_code_segment on <self:AExternCodeBlock> */ if (var_n_extern_code_segment == NULL) { fprintf(stderr, "Runtime error: %s", "Receiver is null"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10869); show_backtrace(1); } else { ((void (*)(val*, val*))(var_n_extern_code_segment->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_n_extern_code_segment, self) /* parent= on <var_n_extern_code_segment:nullable TExternCodeSegment>*/; } RET_LABEL:; } /* method parser_prod#AExternCodeBlock#init_aexterncodeblock for (self: Object, nullable AInLanguage, nullable TExternCodeSegment) */ void VIRTUAL_parser_prod__AExternCodeBlock__init_aexterncodeblock(val* self, val* p0, val* p1) { parser_prod__AExternCodeBlock__init_aexterncodeblock(self, p0, p1); RET_LABEL:; } /* method parser_prod#AExternCodeBlock#replace_child for (self: AExternCodeBlock, ANode, nullable ANode) */ void parser_prod__AExternCodeBlock__replace_child(val* self, val* p0, val* p1) { val* var_old_child /* var old_child: ANode */; val* var_new_child /* var new_child: nullable ANode */; val* var /* : nullable AInLanguage */; short int var1 /* : Bool */; val* var2 /* : null */; short int var3 /* : Bool */; short int var4 /* : Bool */; int cltype; int idtype; val* var5 /* : null */; val* var6 /* : TExternCodeSegment */; short int var7 /* : Bool */; val* var8 /* : null */; short int var9 /* : Bool */; short int var10 /* : Bool */; int cltype11; int idtype12; var_old_child = p0; var_new_child = p1; var = self->attrs[COLOR_parser_nodes__AExternCodeBlock___n_in_language].val; /* _n_in_language on <self:AExternCodeBlock> */ if (var == NULL) { var1 = 0; /* <var_old_child:ANode> cannot be null */ } else { var1 = ((short int (*)(val*, val*))(var->class->vft[COLOR_kernel__Object___61d_61d]))(var, var_old_child) /* == on <var:nullable AInLanguage>*/; } if (var1){ var2 = NULL; if (var_new_child == NULL) { var3 = 0; /* is null */ } else { var3 = 1; /* arg is null and recv is not */ } if (var3){ ((void (*)(val*, val*))(var_new_child->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_new_child, self) /* parent= on <var_new_child:nullable ANode(ANode)>*/; /* <var_new_child:nullable ANode(ANode)> isa AInLanguage */ cltype = type_parser_nodes__AInLanguage.color; idtype = type_parser_nodes__AInLanguage.id; if(cltype >= var_new_child->type->table_size) { var4 = 0; } else { var4 = var_new_child->type->type_table[cltype] == idtype; } if (!var4) { fprintf(stderr, "Runtime error: %s", "Assert failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10877); show_backtrace(1); } self->attrs[COLOR_parser_nodes__AExternCodeBlock___n_in_language].val = var_new_child; /* _n_in_language on <self:AExternCodeBlock> */ } else { var5 = NULL; self->attrs[COLOR_parser_nodes__AExternCodeBlock___n_in_language].val = var5; /* _n_in_language on <self:AExternCodeBlock> */ } goto RET_LABEL; } else { } var6 = self->attrs[COLOR_parser_nodes__AExternCodeBlock___n_extern_code_segment].val; /* _n_extern_code_segment on <self:AExternCodeBlock> */ if (var6 == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_extern_code_segment"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10884); show_backtrace(1); } var7 = ((short int (*)(val*, val*))(var6->class->vft[COLOR_kernel__Object___61d_61d]))(var6, var_old_child) /* == on <var6:TExternCodeSegment>*/; if (var7){ var8 = NULL; if (var_new_child == NULL) { var9 = 0; /* is null */ } else { var9 = 1; /* arg is null and recv is not */ } if (var9){ ((void (*)(val*, val*))(var_new_child->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_new_child, self) /* parent= on <var_new_child:nullable ANode(ANode)>*/; /* <var_new_child:nullable ANode(ANode)> isa TExternCodeSegment */ cltype11 = type_parser_nodes__TExternCodeSegment.color; idtype12 = type_parser_nodes__TExternCodeSegment.id; if(cltype11 >= var_new_child->type->table_size) { var10 = 0; } else { var10 = var_new_child->type->type_table[cltype11] == idtype12; } if (!var10) { fprintf(stderr, "Runtime error: %s", "Assert failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10887); show_backtrace(1); } self->attrs[COLOR_parser_nodes__AExternCodeBlock___n_extern_code_segment].val = var_new_child; /* _n_extern_code_segment on <self:AExternCodeBlock> */ } else { fprintf(stderr, "Runtime error: %s", "Aborted"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10890); show_backtrace(1); } goto RET_LABEL; } else { } RET_LABEL:; } /* method parser_prod#AExternCodeBlock#replace_child for (self: Object, ANode, nullable ANode) */ void VIRTUAL_parser_prod__AExternCodeBlock__replace_child(val* self, val* p0, val* p1) { parser_prod__AExternCodeBlock__replace_child(self, p0, p1); RET_LABEL:; } /* method parser_prod#AExternCodeBlock#n_in_language= for (self: AExternCodeBlock, nullable AInLanguage) */ void parser_prod__AExternCodeBlock__n_in_language_61d(val* self, val* p0) { val* var_node /* var node: nullable AInLanguage */; val* var /* : null */; short int var1 /* : Bool */; var_node = p0; self->attrs[COLOR_parser_nodes__AExternCodeBlock___n_in_language].val = var_node; /* _n_in_language on <self:AExternCodeBlock> */ var = NULL; if (var_node == NULL) { var1 = 0; /* is null */ } else { var1 = 1; /* arg is null and recv is not */ } if (var1){ ((void (*)(val*, val*))(var_node->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_node, self) /* parent= on <var_node:nullable AInLanguage(AInLanguage)>*/; } else { } RET_LABEL:; } /* method parser_prod#AExternCodeBlock#n_in_language= for (self: Object, nullable AInLanguage) */ void VIRTUAL_parser_prod__AExternCodeBlock__n_in_language_61d(val* self, val* p0) { parser_prod__AExternCodeBlock__n_in_language_61d(self, p0); RET_LABEL:; } /* method parser_prod#AExternCodeBlock#n_extern_code_segment= for (self: AExternCodeBlock, TExternCodeSegment) */ void parser_prod__AExternCodeBlock__n_extern_code_segment_61d(val* self, val* p0) { val* var_node /* var node: TExternCodeSegment */; var_node = p0; self->attrs[COLOR_parser_nodes__AExternCodeBlock___n_extern_code_segment].val = var_node; /* _n_extern_code_segment on <self:AExternCodeBlock> */ ((void (*)(val*, val*))(var_node->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_node, self) /* parent= on <var_node:TExternCodeSegment>*/; RET_LABEL:; } /* method parser_prod#AExternCodeBlock#n_extern_code_segment= for (self: Object, TExternCodeSegment) */ void VIRTUAL_parser_prod__AExternCodeBlock__n_extern_code_segment_61d(val* self, val* p0) { parser_prod__AExternCodeBlock__n_extern_code_segment_61d(self, p0); RET_LABEL:; } /* method parser_prod#AExternCodeBlock#visit_all for (self: AExternCodeBlock, Visitor) */ void parser_prod__AExternCodeBlock__visit_all(val* self, val* p0) { val* var_v /* var v: Visitor */; val* var /* : nullable AInLanguage */; val* var1 /* : null */; short int var2 /* : Bool */; val* var3 /* : nullable AInLanguage */; val* var4 /* : TExternCodeSegment */; var_v = p0; var = self->attrs[COLOR_parser_nodes__AExternCodeBlock___n_in_language].val; /* _n_in_language on <self:AExternCodeBlock> */ var1 = NULL; if (var == NULL) { var2 = 0; /* is null */ } else { var2 = 1; /* arg is null and recv is not */ } if (var2){ var3 = self->attrs[COLOR_parser_nodes__AExternCodeBlock___n_in_language].val; /* _n_in_language on <self:AExternCodeBlock> */ if (var3 == NULL) { fprintf(stderr, "Runtime error: %s", "Cast failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10913); show_backtrace(1); } ((void (*)(val*, val*))(var_v->class->vft[COLOR_parser_nodes__Visitor__enter_visit]))(var_v, var3) /* enter_visit on <var_v:Visitor>*/; } else { } var4 = self->attrs[COLOR_parser_nodes__AExternCodeBlock___n_extern_code_segment].val; /* _n_extern_code_segment on <self:AExternCodeBlock> */ if (var4 == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_extern_code_segment"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10915); show_backtrace(1); } ((void (*)(val*, val*))(var_v->class->vft[COLOR_parser_nodes__Visitor__enter_visit]))(var_v, var4) /* enter_visit on <var_v:Visitor>*/; RET_LABEL:; } /* method parser_prod#AExternCodeBlock#visit_all for (self: Object, Visitor) */ void VIRTUAL_parser_prod__AExternCodeBlock__visit_all(val* self, val* p0) { parser_prod__AExternCodeBlock__visit_all(self, p0); RET_LABEL:; } /* method parser_prod#AQualified#empty_init for (self: AQualified) */ void parser_prod__AQualified__empty_init(val* self) { RET_LABEL:; } /* method parser_prod#AQualified#empty_init for (self: Object) */ void VIRTUAL_parser_prod__AQualified__empty_init(val* self) { parser_prod__AQualified__empty_init(self); RET_LABEL:; } /* method parser_prod#AQualified#init_aqualified for (self: AQualified, Collection[Object], nullable TClassid) */ void parser_prod__AQualified__init_aqualified(val* self, val* p0, val* p1) { val* var_n_id /* var n_id: Collection[Object] */; val* var_n_classid /* var n_classid: nullable TClassid */; val* var /* : Iterator[nullable Object] */; short int var1 /* : Bool */; val* var2 /* : nullable Object */; val* var_n /* var n: Object */; short int var3 /* : Bool */; int cltype; int idtype; val* var4 /* : ANodes[TId] */; val* var5 /* : null */; short int var6 /* : Bool */; var_n_id = p0; var_n_classid = p1; ((void (*)(val*))(self->class->vft[COLOR_parser_prod__AQualified__empty_init]))(self) /* empty_init on <self:AQualified>*/; var = ((val* (*)(val*))(var_n_id->class->vft[COLOR_abstract_collection__Collection__iterator]))(var_n_id) /* iterator on <var_n_id:Collection[Object]>*/; for(;;) { var1 = ((short int (*)(val*))(var->class->vft[COLOR_abstract_collection__Iterator__is_ok]))(var) /* is_ok on <var:Iterator[nullable Object]>*/; if(!var1) break; var2 = ((val* (*)(val*))(var->class->vft[COLOR_abstract_collection__Iterator__item]))(var) /* item on <var:Iterator[nullable Object]>*/; var_n = var2; /* <var_n:Object> isa TId */ cltype = type_parser_nodes__TId.color; idtype = type_parser_nodes__TId.id; if(cltype >= var_n->type->table_size) { var3 = 0; } else { var3 = var_n->type->type_table[cltype] == idtype; } if (!var3) { fprintf(stderr, "Runtime error: %s", "Assert failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10928); show_backtrace(1); } var4 = self->attrs[COLOR_parser_nodes__AQualified___n_id].val; /* _n_id on <self:AQualified> */ if (var4 == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_id"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10929); show_backtrace(1); } ((void (*)(val*, val*))(var4->class->vft[COLOR_abstract_collection__SimpleCollection__add]))(var4, var_n) /* add on <var4:ANodes[TId]>*/; ((void (*)(val*, val*))(var_n->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_n, self) /* parent= on <var_n:Object(TId)>*/; CONTINUE_label: (void)0; ((void (*)(val*))(var->class->vft[COLOR_abstract_collection__Iterator__next]))(var) /* next on <var:Iterator[nullable Object]>*/; } BREAK_label: (void)0; self->attrs[COLOR_parser_nodes__AQualified___n_classid].val = var_n_classid; /* _n_classid on <self:AQualified> */ var5 = NULL; if (var_n_classid == NULL) { var6 = 0; /* is null */ } else { var6 = 1; /* arg is null and recv is not */ } if (var6){ ((void (*)(val*, val*))(var_n_classid->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_n_classid, self) /* parent= on <var_n_classid:nullable TClassid(TClassid)>*/; } else { } RET_LABEL:; } /* method parser_prod#AQualified#init_aqualified for (self: Object, Collection[Object], nullable TClassid) */ void VIRTUAL_parser_prod__AQualified__init_aqualified(val* self, val* p0, val* p1) { parser_prod__AQualified__init_aqualified(self, p0, p1); RET_LABEL:; } /* method parser_prod#AQualified#replace_child for (self: AQualified, ANode, nullable ANode) */ void parser_prod__AQualified__replace_child(val* self, val* p0, val* p1) { val* var_old_child /* var old_child: ANode */; val* var_new_child /* var new_child: nullable ANode */; val* var /* : Range[Int] */; long var1 /* : Int */; val* var2 /* : ANodes[TId] */; long var3 /* : Int */; val* var4 /* : Discrete */; val* var5 /* : Discrete */; val* var6 /* : Iterator[nullable Object] */; short int var7 /* : Bool */; val* var8 /* : nullable Object */; long var_i /* var i: Int */; long var9 /* : Int */; val* var10 /* : ANodes[TId] */; val* var11 /* : nullable Object */; short int var12 /* : Bool */; val* var13 /* : null */; short int var14 /* : Bool */; short int var15 /* : Bool */; int cltype; int idtype; val* var16 /* : ANodes[TId] */; val* var17 /* : ANodes[TId] */; val* var18 /* : nullable TClassid */; short int var19 /* : Bool */; val* var20 /* : null */; short int var21 /* : Bool */; short int var22 /* : Bool */; int cltype23; int idtype24; val* var25 /* : null */; var_old_child = p0; var_new_child = p1; var = NEW_range__Range(&type_range__Rangekernel__Int); var1 = 0; var2 = self->attrs[COLOR_parser_nodes__AQualified___n_id].val; /* _n_id on <self:AQualified> */ if (var2 == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_id"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10940); show_backtrace(1); } var3 = ((long (*)(val*))(var2->class->vft[COLOR_abstract_collection__Collection__length]))(var2) /* length on <var2:ANodes[TId]>*/; var4 = BOX_kernel__Int(var1); /* autobox from Int to Discrete */ var5 = BOX_kernel__Int(var3); /* autobox from Int to Discrete */ ((void (*)(val*, val*, val*))(var->class->vft[COLOR_range__Range__without_last]))(var, var4, var5) /* without_last on <var:Range[Int]>*/; var6 = ((val* (*)(val*))(var->class->vft[COLOR_abstract_collection__Collection__iterator]))(var) /* iterator on <var:Range[Int]>*/; for(;;) { var7 = ((short int (*)(val*))(var6->class->vft[COLOR_abstract_collection__Iterator__is_ok]))(var6) /* is_ok on <var6:Iterator[nullable Object]>*/; if(!var7) break; var8 = ((val* (*)(val*))(var6->class->vft[COLOR_abstract_collection__Iterator__item]))(var6) /* item on <var6:Iterator[nullable Object]>*/; var9 = ((struct instance_kernel__Int*)var8)->value; /* autounbox from nullable Object to Int */; var_i = var9; var10 = self->attrs[COLOR_parser_nodes__AQualified___n_id].val; /* _n_id on <self:AQualified> */ if (var10 == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_id"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10941); show_backtrace(1); } var11 = ((val* (*)(val*, long))(var10->class->vft[COLOR_abstract_collection__SequenceRead___91d_93d]))(var10, var_i) /* [] on <var10:ANodes[TId]>*/; var12 = ((short int (*)(val*, val*))(var11->class->vft[COLOR_kernel__Object___61d_61d]))(var11, var_old_child) /* == on <var11:nullable Object(TId)>*/; if (var12){ var13 = NULL; if (var_new_child == NULL) { var14 = 0; /* is null */ } else { var14 = 1; /* arg is null and recv is not */ } if (var14){ /* <var_new_child:nullable ANode(ANode)> isa TId */ cltype = type_parser_nodes__TId.color; idtype = type_parser_nodes__TId.id; if(cltype >= var_new_child->type->table_size) { var15 = 0; } else { var15 = var_new_child->type->type_table[cltype] == idtype; } if (!var15) { fprintf(stderr, "Runtime error: %s", "Assert failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10943); show_backtrace(1); } var16 = self->attrs[COLOR_parser_nodes__AQualified___n_id].val; /* _n_id on <self:AQualified> */ if (var16 == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_id"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10944); show_backtrace(1); } ((void (*)(val*, long, val*))(var16->class->vft[COLOR_abstract_collection__Sequence___91d_93d_61d]))(var16, var_i, var_new_child) /* []= on <var16:ANodes[TId]>*/; ((void (*)(val*, val*))(var_new_child->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_new_child, self) /* parent= on <var_new_child:nullable ANode(TId)>*/; } else { var17 = self->attrs[COLOR_parser_nodes__AQualified___n_id].val; /* _n_id on <self:AQualified> */ if (var17 == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_id"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10947); show_backtrace(1); } ((void (*)(val*, long))(var17->class->vft[COLOR_abstract_collection__Sequence__remove_at]))(var17, var_i) /* remove_at on <var17:ANodes[TId]>*/; } goto RET_LABEL; } else { } CONTINUE_label: (void)0; ((void (*)(val*))(var6->class->vft[COLOR_abstract_collection__Iterator__next]))(var6) /* next on <var6:Iterator[nullable Object]>*/; } BREAK_label: (void)0; var18 = self->attrs[COLOR_parser_nodes__AQualified___n_classid].val; /* _n_classid on <self:AQualified> */ if (var18 == NULL) { var19 = 0; /* <var_old_child:ANode> cannot be null */ } else { var19 = ((short int (*)(val*, val*))(var18->class->vft[COLOR_kernel__Object___61d_61d]))(var18, var_old_child) /* == on <var18:nullable TClassid>*/; } if (var19){ var20 = NULL; if (var_new_child == NULL) { var21 = 0; /* is null */ } else { var21 = 1; /* arg is null and recv is not */ } if (var21){ ((void (*)(val*, val*))(var_new_child->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_new_child, self) /* parent= on <var_new_child:nullable ANode(ANode)>*/; /* <var_new_child:nullable ANode(ANode)> isa TClassid */ cltype23 = type_parser_nodes__TClassid.color; idtype24 = type_parser_nodes__TClassid.id; if(cltype23 >= var_new_child->type->table_size) { var22 = 0; } else { var22 = var_new_child->type->type_table[cltype23] == idtype24; } if (!var22) { fprintf(stderr, "Runtime error: %s", "Assert failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10955); show_backtrace(1); } self->attrs[COLOR_parser_nodes__AQualified___n_classid].val = var_new_child; /* _n_classid on <self:AQualified> */ } else { var25 = NULL; self->attrs[COLOR_parser_nodes__AQualified___n_classid].val = var25; /* _n_classid on <self:AQualified> */ } goto RET_LABEL; } else { } RET_LABEL:; } /* method parser_prod#AQualified#replace_child for (self: Object, ANode, nullable ANode) */ void VIRTUAL_parser_prod__AQualified__replace_child(val* self, val* p0, val* p1) { parser_prod__AQualified__replace_child(self, p0, p1); RET_LABEL:; } /* method parser_prod#AQualified#n_classid= for (self: AQualified, nullable TClassid) */ void parser_prod__AQualified__n_classid_61d(val* self, val* p0) { val* var_node /* var node: nullable TClassid */; val* var /* : null */; short int var1 /* : Bool */; var_node = p0; self->attrs[COLOR_parser_nodes__AQualified___n_classid].val = var_node; /* _n_classid on <self:AQualified> */ var = NULL; if (var_node == NULL) { var1 = 0; /* is null */ } else { var1 = 1; /* arg is null and recv is not */ } if (var1){ ((void (*)(val*, val*))(var_node->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_node, self) /* parent= on <var_node:nullable TClassid(TClassid)>*/; } else { } RET_LABEL:; } /* method parser_prod#AQualified#n_classid= for (self: Object, nullable TClassid) */ void VIRTUAL_parser_prod__AQualified__n_classid_61d(val* self, val* p0) { parser_prod__AQualified__n_classid_61d(self, p0); RET_LABEL:; } /* method parser_prod#AQualified#visit_all for (self: AQualified, Visitor) */ void parser_prod__AQualified__visit_all(val* self, val* p0) { val* var_v /* var v: Visitor */; val* var /* : ANodes[TId] */; val* var1 /* : Iterator[nullable Object] */; short int var2 /* : Bool */; val* var3 /* : nullable Object */; val* var_n /* var n: TId */; val* var4 /* : nullable TClassid */; val* var5 /* : null */; short int var6 /* : Bool */; val* var7 /* : nullable TClassid */; var_v = p0; var = self->attrs[COLOR_parser_nodes__AQualified___n_id].val; /* _n_id on <self:AQualified> */ if (var == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_id"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10975); show_backtrace(1); } var1 = ((val* (*)(val*))(var->class->vft[COLOR_abstract_collection__Collection__iterator]))(var) /* iterator on <var:ANodes[TId]>*/; for(;;) { var2 = ((short int (*)(val*))(var1->class->vft[COLOR_abstract_collection__Iterator__is_ok]))(var1) /* is_ok on <var1:Iterator[nullable Object]>*/; if(!var2) break; var3 = ((val* (*)(val*))(var1->class->vft[COLOR_abstract_collection__Iterator__item]))(var1) /* item on <var1:Iterator[nullable Object]>*/; var_n = var3; ((void (*)(val*, val*))(var_v->class->vft[COLOR_parser_nodes__Visitor__enter_visit]))(var_v, var_n) /* enter_visit on <var_v:Visitor>*/; CONTINUE_label: (void)0; ((void (*)(val*))(var1->class->vft[COLOR_abstract_collection__Iterator__next]))(var1) /* next on <var1:Iterator[nullable Object]>*/; } BREAK_label: (void)0; var4 = self->attrs[COLOR_parser_nodes__AQualified___n_classid].val; /* _n_classid on <self:AQualified> */ var5 = NULL; if (var4 == NULL) { var6 = 0; /* is null */ } else { var6 = 1; /* arg is null and recv is not */ } if (var6){ var7 = self->attrs[COLOR_parser_nodes__AQualified___n_classid].val; /* _n_classid on <self:AQualified> */ if (var7 == NULL) { fprintf(stderr, "Runtime error: %s", "Cast failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10979); show_backtrace(1); } ((void (*)(val*, val*))(var_v->class->vft[COLOR_parser_nodes__Visitor__enter_visit]))(var_v, var7) /* enter_visit on <var_v:Visitor>*/; } else { } RET_LABEL:; } /* method parser_prod#AQualified#visit_all for (self: Object, Visitor) */ void VIRTUAL_parser_prod__AQualified__visit_all(val* self, val* p0) { parser_prod__AQualified__visit_all(self, p0); RET_LABEL:; } /* method parser_prod#ADoc#empty_init for (self: ADoc) */ void parser_prod__ADoc__empty_init(val* self) { RET_LABEL:; } /* method parser_prod#ADoc#empty_init for (self: Object) */ void VIRTUAL_parser_prod__ADoc__empty_init(val* self) { parser_prod__ADoc__empty_init(self); RET_LABEL:; } /* method parser_prod#ADoc#init_adoc for (self: ADoc, Collection[Object]) */ void parser_prod__ADoc__init_adoc(val* self, val* p0) { val* var_n_comment /* var n_comment: Collection[Object] */; val* var /* : Iterator[nullable Object] */; short int var1 /* : Bool */; val* var2 /* : nullable Object */; val* var_n /* var n: Object */; short int var3 /* : Bool */; int cltype; int idtype; val* var4 /* : ANodes[TComment] */; var_n_comment = p0; ((void (*)(val*))(self->class->vft[COLOR_parser_prod__ADoc__empty_init]))(self) /* empty_init on <self:ADoc>*/; var = ((val* (*)(val*))(var_n_comment->class->vft[COLOR_abstract_collection__Collection__iterator]))(var_n_comment) /* iterator on <var_n_comment:Collection[Object]>*/; for(;;) { var1 = ((short int (*)(val*))(var->class->vft[COLOR_abstract_collection__Iterator__is_ok]))(var) /* is_ok on <var:Iterator[nullable Object]>*/; if(!var1) break; var2 = ((val* (*)(val*))(var->class->vft[COLOR_abstract_collection__Iterator__item]))(var) /* item on <var:Iterator[nullable Object]>*/; var_n = var2; /* <var_n:Object> isa TComment */ cltype = type_parser_nodes__TComment.color; idtype = type_parser_nodes__TComment.id; if(cltype >= var_n->type->table_size) { var3 = 0; } else { var3 = var_n->type->type_table[cltype] == idtype; } if (!var3) { fprintf(stderr, "Runtime error: %s", "Assert failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10992); show_backtrace(1); } var4 = self->attrs[COLOR_parser_nodes__ADoc___n_comment].val; /* _n_comment on <self:ADoc> */ if (var4 == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_comment"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 10993); show_backtrace(1); } ((void (*)(val*, val*))(var4->class->vft[COLOR_abstract_collection__SimpleCollection__add]))(var4, var_n) /* add on <var4:ANodes[TComment]>*/; ((void (*)(val*, val*))(var_n->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_n, self) /* parent= on <var_n:Object(TComment)>*/; CONTINUE_label: (void)0; ((void (*)(val*))(var->class->vft[COLOR_abstract_collection__Iterator__next]))(var) /* next on <var:Iterator[nullable Object]>*/; } BREAK_label: (void)0; RET_LABEL:; } /* method parser_prod#ADoc#init_adoc for (self: Object, Collection[Object]) */ void VIRTUAL_parser_prod__ADoc__init_adoc(val* self, val* p0) { parser_prod__ADoc__init_adoc(self, p0); RET_LABEL:; } /* method parser_prod#ADoc#replace_child for (self: ADoc, ANode, nullable ANode) */ void parser_prod__ADoc__replace_child(val* self, val* p0, val* p1) { val* var_old_child /* var old_child: ANode */; val* var_new_child /* var new_child: nullable ANode */; val* var /* : Range[Int] */; long var1 /* : Int */; val* var2 /* : ANodes[TComment] */; long var3 /* : Int */; val* var4 /* : Discrete */; val* var5 /* : Discrete */; val* var6 /* : Iterator[nullable Object] */; short int var7 /* : Bool */; val* var8 /* : nullable Object */; long var_i /* var i: Int */; long var9 /* : Int */; val* var10 /* : ANodes[TComment] */; val* var11 /* : nullable Object */; short int var12 /* : Bool */; val* var13 /* : null */; short int var14 /* : Bool */; short int var15 /* : Bool */; int cltype; int idtype; val* var16 /* : ANodes[TComment] */; val* var17 /* : ANodes[TComment] */; var_old_child = p0; var_new_child = p1; var = NEW_range__Range(&type_range__Rangekernel__Int); var1 = 0; var2 = self->attrs[COLOR_parser_nodes__ADoc___n_comment].val; /* _n_comment on <self:ADoc> */ if (var2 == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_comment"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11000); show_backtrace(1); } var3 = ((long (*)(val*))(var2->class->vft[COLOR_abstract_collection__Collection__length]))(var2) /* length on <var2:ANodes[TComment]>*/; var4 = BOX_kernel__Int(var1); /* autobox from Int to Discrete */ var5 = BOX_kernel__Int(var3); /* autobox from Int to Discrete */ ((void (*)(val*, val*, val*))(var->class->vft[COLOR_range__Range__without_last]))(var, var4, var5) /* without_last on <var:Range[Int]>*/; var6 = ((val* (*)(val*))(var->class->vft[COLOR_abstract_collection__Collection__iterator]))(var) /* iterator on <var:Range[Int]>*/; for(;;) { var7 = ((short int (*)(val*))(var6->class->vft[COLOR_abstract_collection__Iterator__is_ok]))(var6) /* is_ok on <var6:Iterator[nullable Object]>*/; if(!var7) break; var8 = ((val* (*)(val*))(var6->class->vft[COLOR_abstract_collection__Iterator__item]))(var6) /* item on <var6:Iterator[nullable Object]>*/; var9 = ((struct instance_kernel__Int*)var8)->value; /* autounbox from nullable Object to Int */; var_i = var9; var10 = self->attrs[COLOR_parser_nodes__ADoc___n_comment].val; /* _n_comment on <self:ADoc> */ if (var10 == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_comment"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11001); show_backtrace(1); } var11 = ((val* (*)(val*, long))(var10->class->vft[COLOR_abstract_collection__SequenceRead___91d_93d]))(var10, var_i) /* [] on <var10:ANodes[TComment]>*/; var12 = ((short int (*)(val*, val*))(var11->class->vft[COLOR_kernel__Object___61d_61d]))(var11, var_old_child) /* == on <var11:nullable Object(TComment)>*/; if (var12){ var13 = NULL; if (var_new_child == NULL) { var14 = 0; /* is null */ } else { var14 = 1; /* arg is null and recv is not */ } if (var14){ /* <var_new_child:nullable ANode(ANode)> isa TComment */ cltype = type_parser_nodes__TComment.color; idtype = type_parser_nodes__TComment.id; if(cltype >= var_new_child->type->table_size) { var15 = 0; } else { var15 = var_new_child->type->type_table[cltype] == idtype; } if (!var15) { fprintf(stderr, "Runtime error: %s", "Assert failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11003); show_backtrace(1); } var16 = self->attrs[COLOR_parser_nodes__ADoc___n_comment].val; /* _n_comment on <self:ADoc> */ if (var16 == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_comment"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11004); show_backtrace(1); } ((void (*)(val*, long, val*))(var16->class->vft[COLOR_abstract_collection__Sequence___91d_93d_61d]))(var16, var_i, var_new_child) /* []= on <var16:ANodes[TComment]>*/; ((void (*)(val*, val*))(var_new_child->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_new_child, self) /* parent= on <var_new_child:nullable ANode(TComment)>*/; } else { var17 = self->attrs[COLOR_parser_nodes__ADoc___n_comment].val; /* _n_comment on <self:ADoc> */ if (var17 == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_comment"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11007); show_backtrace(1); } ((void (*)(val*, long))(var17->class->vft[COLOR_abstract_collection__Sequence__remove_at]))(var17, var_i) /* remove_at on <var17:ANodes[TComment]>*/; } goto RET_LABEL; } else { } CONTINUE_label: (void)0; ((void (*)(val*))(var6->class->vft[COLOR_abstract_collection__Iterator__next]))(var6) /* next on <var6:Iterator[nullable Object]>*/; } BREAK_label: (void)0; RET_LABEL:; } /* method parser_prod#ADoc#replace_child for (self: Object, ANode, nullable ANode) */ void VIRTUAL_parser_prod__ADoc__replace_child(val* self, val* p0, val* p1) { parser_prod__ADoc__replace_child(self, p0, p1); RET_LABEL:; } /* method parser_prod#ADoc#visit_all for (self: ADoc, Visitor) */ void parser_prod__ADoc__visit_all(val* self, val* p0) { val* var_v /* var v: Visitor */; val* var /* : ANodes[TComment] */; val* var1 /* : Iterator[nullable Object] */; short int var2 /* : Bool */; val* var3 /* : nullable Object */; val* var_n /* var n: TComment */; var_v = p0; var = self->attrs[COLOR_parser_nodes__ADoc___n_comment].val; /* _n_comment on <self:ADoc> */ if (var == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_comment"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11018); show_backtrace(1); } var1 = ((val* (*)(val*))(var->class->vft[COLOR_abstract_collection__Collection__iterator]))(var) /* iterator on <var:ANodes[TComment]>*/; for(;;) { var2 = ((short int (*)(val*))(var1->class->vft[COLOR_abstract_collection__Iterator__is_ok]))(var1) /* is_ok on <var1:Iterator[nullable Object]>*/; if(!var2) break; var3 = ((val* (*)(val*))(var1->class->vft[COLOR_abstract_collection__Iterator__item]))(var1) /* item on <var1:Iterator[nullable Object]>*/; var_n = var3; ((void (*)(val*, val*))(var_v->class->vft[COLOR_parser_nodes__Visitor__enter_visit]))(var_v, var_n) /* enter_visit on <var_v:Visitor>*/; CONTINUE_label: (void)0; ((void (*)(val*))(var1->class->vft[COLOR_abstract_collection__Iterator__next]))(var1) /* next on <var1:Iterator[nullable Object]>*/; } BREAK_label: (void)0; RET_LABEL:; } /* method parser_prod#ADoc#visit_all for (self: Object, Visitor) */ void VIRTUAL_parser_prod__ADoc__visit_all(val* self, val* p0) { parser_prod__ADoc__visit_all(self, p0); RET_LABEL:; } /* method parser_prod#AAnnotations#empty_init for (self: AAnnotations) */ void parser_prod__AAnnotations__empty_init(val* self) { RET_LABEL:; } /* method parser_prod#AAnnotations#empty_init for (self: Object) */ void VIRTUAL_parser_prod__AAnnotations__empty_init(val* self) { parser_prod__AAnnotations__empty_init(self); RET_LABEL:; } /* method parser_prod#AAnnotations#init_aannotations for (self: AAnnotations, nullable TAt, nullable TOpar, Collection[Object], nullable TCpar) */ void parser_prod__AAnnotations__init_aannotations(val* self, val* p0, val* p1, val* p2, val* p3) { val* var_n_at /* var n_at: nullable TAt */; val* var_n_opar /* var n_opar: nullable TOpar */; val* var_n_items /* var n_items: Collection[Object] */; val* var_n_cpar /* var n_cpar: nullable TCpar */; val* var /* : null */; short int var1 /* : Bool */; val* var2 /* : null */; short int var3 /* : Bool */; val* var4 /* : Iterator[nullable Object] */; short int var5 /* : Bool */; val* var6 /* : nullable Object */; val* var_n /* var n: Object */; short int var7 /* : Bool */; int cltype; int idtype; val* var8 /* : ANodes[AAnnotation] */; val* var9 /* : null */; short int var10 /* : Bool */; var_n_at = p0; var_n_opar = p1; var_n_items = p2; var_n_cpar = p3; ((void (*)(val*))(self->class->vft[COLOR_parser_prod__AAnnotations__empty_init]))(self) /* empty_init on <self:AAnnotations>*/; self->attrs[COLOR_parser_nodes__AAnnotations___n_at].val = var_n_at; /* _n_at on <self:AAnnotations> */ var = NULL; if (var_n_at == NULL) { var1 = 0; /* is null */ } else { var1 = 1; /* arg is null and recv is not */ } if (var1){ ((void (*)(val*, val*))(var_n_at->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_n_at, self) /* parent= on <var_n_at:nullable TAt(TAt)>*/; } else { } self->attrs[COLOR_parser_nodes__AAnnotations___n_opar].val = var_n_opar; /* _n_opar on <self:AAnnotations> */ var2 = NULL; if (var_n_opar == NULL) { var3 = 0; /* is null */ } else { var3 = 1; /* arg is null and recv is not */ } if (var3){ ((void (*)(val*, val*))(var_n_opar->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_n_opar, self) /* parent= on <var_n_opar:nullable TOpar(TOpar)>*/; } else { } var4 = ((val* (*)(val*))(var_n_items->class->vft[COLOR_abstract_collection__Collection__iterator]))(var_n_items) /* iterator on <var_n_items:Collection[Object]>*/; for(;;) { var5 = ((short int (*)(val*))(var4->class->vft[COLOR_abstract_collection__Iterator__is_ok]))(var4) /* is_ok on <var4:Iterator[nullable Object]>*/; if(!var5) break; var6 = ((val* (*)(val*))(var4->class->vft[COLOR_abstract_collection__Iterator__item]))(var4) /* item on <var4:Iterator[nullable Object]>*/; var_n = var6; /* <var_n:Object> isa AAnnotation */ cltype = type_parser_nodes__AAnnotation.color; idtype = type_parser_nodes__AAnnotation.id; if(cltype >= var_n->type->table_size) { var7 = 0; } else { var7 = var_n->type->type_table[cltype] == idtype; } if (!var7) { fprintf(stderr, "Runtime error: %s", "Assert failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11043); show_backtrace(1); } var8 = self->attrs[COLOR_parser_nodes__AAnnotations___n_items].val; /* _n_items on <self:AAnnotations> */ if (var8 == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_items"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11044); show_backtrace(1); } ((void (*)(val*, val*))(var8->class->vft[COLOR_abstract_collection__SimpleCollection__add]))(var8, var_n) /* add on <var8:ANodes[AAnnotation]>*/; ((void (*)(val*, val*))(var_n->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_n, self) /* parent= on <var_n:Object(AAnnotation)>*/; CONTINUE_label: (void)0; ((void (*)(val*))(var4->class->vft[COLOR_abstract_collection__Iterator__next]))(var4) /* next on <var4:Iterator[nullable Object]>*/; } BREAK_label: (void)0; self->attrs[COLOR_parser_nodes__AAnnotations___n_cpar].val = var_n_cpar; /* _n_cpar on <self:AAnnotations> */ var9 = NULL; if (var_n_cpar == NULL) { var10 = 0; /* is null */ } else { var10 = 1; /* arg is null and recv is not */ } if (var10){ ((void (*)(val*, val*))(var_n_cpar->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_n_cpar, self) /* parent= on <var_n_cpar:nullable TCpar(TCpar)>*/; } else { } RET_LABEL:; } /* method parser_prod#AAnnotations#init_aannotations for (self: Object, nullable TAt, nullable TOpar, Collection[Object], nullable TCpar) */ void VIRTUAL_parser_prod__AAnnotations__init_aannotations(val* self, val* p0, val* p1, val* p2, val* p3) { parser_prod__AAnnotations__init_aannotations(self, p0, p1, p2, p3); RET_LABEL:; } /* method parser_prod#AAnnotations#replace_child for (self: AAnnotations, ANode, nullable ANode) */ void parser_prod__AAnnotations__replace_child(val* self, val* p0, val* p1) { val* var_old_child /* var old_child: ANode */; val* var_new_child /* var new_child: nullable ANode */; val* var /* : nullable TAt */; short int var1 /* : Bool */; val* var2 /* : null */; short int var3 /* : Bool */; short int var4 /* : Bool */; int cltype; int idtype; val* var5 /* : null */; val* var6 /* : nullable TOpar */; short int var7 /* : Bool */; val* var8 /* : null */; short int var9 /* : Bool */; short int var10 /* : Bool */; int cltype11; int idtype12; val* var13 /* : null */; val* var14 /* : Range[Int] */; long var15 /* : Int */; val* var16 /* : ANodes[AAnnotation] */; long var17 /* : Int */; val* var18 /* : Discrete */; val* var19 /* : Discrete */; val* var20 /* : Iterator[nullable Object] */; short int var21 /* : Bool */; val* var22 /* : nullable Object */; long var_i /* var i: Int */; long var23 /* : Int */; val* var24 /* : ANodes[AAnnotation] */; val* var25 /* : nullable Object */; short int var26 /* : Bool */; val* var27 /* : null */; short int var28 /* : Bool */; short int var29 /* : Bool */; int cltype30; int idtype31; val* var32 /* : ANodes[AAnnotation] */; val* var33 /* : ANodes[AAnnotation] */; val* var34 /* : nullable TCpar */; short int var35 /* : Bool */; val* var36 /* : null */; short int var37 /* : Bool */; short int var38 /* : Bool */; int cltype39; int idtype40; val* var41 /* : null */; var_old_child = p0; var_new_child = p1; var = self->attrs[COLOR_parser_nodes__AAnnotations___n_at].val; /* _n_at on <self:AAnnotations> */ if (var == NULL) { var1 = 0; /* <var_old_child:ANode> cannot be null */ } else { var1 = ((short int (*)(val*, val*))(var->class->vft[COLOR_kernel__Object___61d_61d]))(var, var_old_child) /* == on <var:nullable TAt>*/; } if (var1){ var2 = NULL; if (var_new_child == NULL) { var3 = 0; /* is null */ } else { var3 = 1; /* arg is null and recv is not */ } if (var3){ ((void (*)(val*, val*))(var_new_child->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_new_child, self) /* parent= on <var_new_child:nullable ANode(ANode)>*/; /* <var_new_child:nullable ANode(ANode)> isa TAt */ cltype = type_parser_nodes__TAt.color; idtype = type_parser_nodes__TAt.id; if(cltype >= var_new_child->type->table_size) { var4 = 0; } else { var4 = var_new_child->type->type_table[cltype] == idtype; } if (!var4) { fprintf(stderr, "Runtime error: %s", "Assert failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11058); show_backtrace(1); } self->attrs[COLOR_parser_nodes__AAnnotations___n_at].val = var_new_child; /* _n_at on <self:AAnnotations> */ } else { var5 = NULL; self->attrs[COLOR_parser_nodes__AAnnotations___n_at].val = var5; /* _n_at on <self:AAnnotations> */ } goto RET_LABEL; } else { } var6 = self->attrs[COLOR_parser_nodes__AAnnotations___n_opar].val; /* _n_opar on <self:AAnnotations> */ if (var6 == NULL) { var7 = 0; /* <var_old_child:ANode> cannot be null */ } else { var7 = ((short int (*)(val*, val*))(var6->class->vft[COLOR_kernel__Object___61d_61d]))(var6, var_old_child) /* == on <var6:nullable TOpar>*/; } if (var7){ var8 = NULL; if (var_new_child == NULL) { var9 = 0; /* is null */ } else { var9 = 1; /* arg is null and recv is not */ } if (var9){ ((void (*)(val*, val*))(var_new_child->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_new_child, self) /* parent= on <var_new_child:nullable ANode(ANode)>*/; /* <var_new_child:nullable ANode(ANode)> isa TOpar */ cltype11 = type_parser_nodes__TOpar.color; idtype12 = type_parser_nodes__TOpar.id; if(cltype11 >= var_new_child->type->table_size) { var10 = 0; } else { var10 = var_new_child->type->type_table[cltype11] == idtype12; } if (!var10) { fprintf(stderr, "Runtime error: %s", "Assert failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11068); show_backtrace(1); } self->attrs[COLOR_parser_nodes__AAnnotations___n_opar].val = var_new_child; /* _n_opar on <self:AAnnotations> */ } else { var13 = NULL; self->attrs[COLOR_parser_nodes__AAnnotations___n_opar].val = var13; /* _n_opar on <self:AAnnotations> */ } goto RET_LABEL; } else { } var14 = NEW_range__Range(&type_range__Rangekernel__Int); var15 = 0; var16 = self->attrs[COLOR_parser_nodes__AAnnotations___n_items].val; /* _n_items on <self:AAnnotations> */ if (var16 == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_items"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11075); show_backtrace(1); } var17 = ((long (*)(val*))(var16->class->vft[COLOR_abstract_collection__Collection__length]))(var16) /* length on <var16:ANodes[AAnnotation]>*/; var18 = BOX_kernel__Int(var15); /* autobox from Int to Discrete */ var19 = BOX_kernel__Int(var17); /* autobox from Int to Discrete */ ((void (*)(val*, val*, val*))(var14->class->vft[COLOR_range__Range__without_last]))(var14, var18, var19) /* without_last on <var14:Range[Int]>*/; var20 = ((val* (*)(val*))(var14->class->vft[COLOR_abstract_collection__Collection__iterator]))(var14) /* iterator on <var14:Range[Int]>*/; for(;;) { var21 = ((short int (*)(val*))(var20->class->vft[COLOR_abstract_collection__Iterator__is_ok]))(var20) /* is_ok on <var20:Iterator[nullable Object]>*/; if(!var21) break; var22 = ((val* (*)(val*))(var20->class->vft[COLOR_abstract_collection__Iterator__item]))(var20) /* item on <var20:Iterator[nullable Object]>*/; var23 = ((struct instance_kernel__Int*)var22)->value; /* autounbox from nullable Object to Int */; var_i = var23; var24 = self->attrs[COLOR_parser_nodes__AAnnotations___n_items].val; /* _n_items on <self:AAnnotations> */ if (var24 == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_items"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11076); show_backtrace(1); } var25 = ((val* (*)(val*, long))(var24->class->vft[COLOR_abstract_collection__SequenceRead___91d_93d]))(var24, var_i) /* [] on <var24:ANodes[AAnnotation]>*/; var26 = ((short int (*)(val*, val*))(var25->class->vft[COLOR_kernel__Object___61d_61d]))(var25, var_old_child) /* == on <var25:nullable Object(AAnnotation)>*/; if (var26){ var27 = NULL; if (var_new_child == NULL) { var28 = 0; /* is null */ } else { var28 = 1; /* arg is null and recv is not */ } if (var28){ /* <var_new_child:nullable ANode(ANode)> isa AAnnotation */ cltype30 = type_parser_nodes__AAnnotation.color; idtype31 = type_parser_nodes__AAnnotation.id; if(cltype30 >= var_new_child->type->table_size) { var29 = 0; } else { var29 = var_new_child->type->type_table[cltype30] == idtype31; } if (!var29) { fprintf(stderr, "Runtime error: %s", "Assert failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11078); show_backtrace(1); } var32 = self->attrs[COLOR_parser_nodes__AAnnotations___n_items].val; /* _n_items on <self:AAnnotations> */ if (var32 == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_items"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11079); show_backtrace(1); } ((void (*)(val*, long, val*))(var32->class->vft[COLOR_abstract_collection__Sequence___91d_93d_61d]))(var32, var_i, var_new_child) /* []= on <var32:ANodes[AAnnotation]>*/; ((void (*)(val*, val*))(var_new_child->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_new_child, self) /* parent= on <var_new_child:nullable ANode(AAnnotation)>*/; } else { var33 = self->attrs[COLOR_parser_nodes__AAnnotations___n_items].val; /* _n_items on <self:AAnnotations> */ if (var33 == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_items"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11082); show_backtrace(1); } ((void (*)(val*, long))(var33->class->vft[COLOR_abstract_collection__Sequence__remove_at]))(var33, var_i) /* remove_at on <var33:ANodes[AAnnotation]>*/; } goto RET_LABEL; } else { } CONTINUE_label: (void)0; ((void (*)(val*))(var20->class->vft[COLOR_abstract_collection__Iterator__next]))(var20) /* next on <var20:Iterator[nullable Object]>*/; } BREAK_label: (void)0; var34 = self->attrs[COLOR_parser_nodes__AAnnotations___n_cpar].val; /* _n_cpar on <self:AAnnotations> */ if (var34 == NULL) { var35 = 0; /* <var_old_child:ANode> cannot be null */ } else { var35 = ((short int (*)(val*, val*))(var34->class->vft[COLOR_kernel__Object___61d_61d]))(var34, var_old_child) /* == on <var34:nullable TCpar>*/; } if (var35){ var36 = NULL; if (var_new_child == NULL) { var37 = 0; /* is null */ } else { var37 = 1; /* arg is null and recv is not */ } if (var37){ ((void (*)(val*, val*))(var_new_child->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_new_child, self) /* parent= on <var_new_child:nullable ANode(ANode)>*/; /* <var_new_child:nullable ANode(ANode)> isa TCpar */ cltype39 = type_parser_nodes__TCpar.color; idtype40 = type_parser_nodes__TCpar.id; if(cltype39 >= var_new_child->type->table_size) { var38 = 0; } else { var38 = var_new_child->type->type_table[cltype39] == idtype40; } if (!var38) { fprintf(stderr, "Runtime error: %s", "Assert failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11090); show_backtrace(1); } self->attrs[COLOR_parser_nodes__AAnnotations___n_cpar].val = var_new_child; /* _n_cpar on <self:AAnnotations> */ } else { var41 = NULL; self->attrs[COLOR_parser_nodes__AAnnotations___n_cpar].val = var41; /* _n_cpar on <self:AAnnotations> */ } goto RET_LABEL; } else { } RET_LABEL:; } /* method parser_prod#AAnnotations#replace_child for (self: Object, ANode, nullable ANode) */ void VIRTUAL_parser_prod__AAnnotations__replace_child(val* self, val* p0, val* p1) { parser_prod__AAnnotations__replace_child(self, p0, p1); RET_LABEL:; } /* method parser_prod#AAnnotations#n_at= for (self: AAnnotations, nullable TAt) */ void parser_prod__AAnnotations__n_at_61d(val* self, val* p0) { val* var_node /* var node: nullable TAt */; val* var /* : null */; short int var1 /* : Bool */; var_node = p0; self->attrs[COLOR_parser_nodes__AAnnotations___n_at].val = var_node; /* _n_at on <self:AAnnotations> */ var = NULL; if (var_node == NULL) { var1 = 0; /* is null */ } else { var1 = 1; /* arg is null and recv is not */ } if (var1){ ((void (*)(val*, val*))(var_node->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_node, self) /* parent= on <var_node:nullable TAt(TAt)>*/; } else { } RET_LABEL:; } /* method parser_prod#AAnnotations#n_at= for (self: Object, nullable TAt) */ void VIRTUAL_parser_prod__AAnnotations__n_at_61d(val* self, val* p0) { parser_prod__AAnnotations__n_at_61d(self, p0); RET_LABEL:; } /* method parser_prod#AAnnotations#n_opar= for (self: AAnnotations, nullable TOpar) */ void parser_prod__AAnnotations__n_opar_61d(val* self, val* p0) { val* var_node /* var node: nullable TOpar */; val* var /* : null */; short int var1 /* : Bool */; var_node = p0; self->attrs[COLOR_parser_nodes__AAnnotations___n_opar].val = var_node; /* _n_opar on <self:AAnnotations> */ var = NULL; if (var_node == NULL) { var1 = 0; /* is null */ } else { var1 = 1; /* arg is null and recv is not */ } if (var1){ ((void (*)(val*, val*))(var_node->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_node, self) /* parent= on <var_node:nullable TOpar(TOpar)>*/; } else { } RET_LABEL:; } /* method parser_prod#AAnnotations#n_opar= for (self: Object, nullable TOpar) */ void VIRTUAL_parser_prod__AAnnotations__n_opar_61d(val* self, val* p0) { parser_prod__AAnnotations__n_opar_61d(self, p0); RET_LABEL:; } /* method parser_prod#AAnnotations#n_cpar= for (self: AAnnotations, nullable TCpar) */ void parser_prod__AAnnotations__n_cpar_61d(val* self, val* p0) { val* var_node /* var node: nullable TCpar */; val* var /* : null */; short int var1 /* : Bool */; var_node = p0; self->attrs[COLOR_parser_nodes__AAnnotations___n_cpar].val = var_node; /* _n_cpar on <self:AAnnotations> */ var = NULL; if (var_node == NULL) { var1 = 0; /* is null */ } else { var1 = 1; /* arg is null and recv is not */ } if (var1){ ((void (*)(val*, val*))(var_node->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_node, self) /* parent= on <var_node:nullable TCpar(TCpar)>*/; } else { } RET_LABEL:; } /* method parser_prod#AAnnotations#n_cpar= for (self: Object, nullable TCpar) */ void VIRTUAL_parser_prod__AAnnotations__n_cpar_61d(val* self, val* p0) { parser_prod__AAnnotations__n_cpar_61d(self, p0); RET_LABEL:; } /* method parser_prod#AAnnotations#visit_all for (self: AAnnotations, Visitor) */ void parser_prod__AAnnotations__visit_all(val* self, val* p0) { val* var_v /* var v: Visitor */; val* var /* : nullable TAt */; val* var1 /* : null */; short int var2 /* : Bool */; val* var3 /* : nullable TAt */; val* var4 /* : nullable TOpar */; val* var5 /* : null */; short int var6 /* : Bool */; val* var7 /* : nullable TOpar */; val* var8 /* : ANodes[AAnnotation] */; val* var9 /* : Iterator[nullable Object] */; short int var10 /* : Bool */; val* var11 /* : nullable Object */; val* var_n /* var n: AAnnotation */; val* var12 /* : nullable TCpar */; val* var13 /* : null */; short int var14 /* : Bool */; val* var15 /* : nullable TCpar */; var_v = p0; var = self->attrs[COLOR_parser_nodes__AAnnotations___n_at].val; /* _n_at on <self:AAnnotations> */ var1 = NULL; if (var == NULL) { var2 = 0; /* is null */ } else { var2 = 1; /* arg is null and recv is not */ } if (var2){ var3 = self->attrs[COLOR_parser_nodes__AAnnotations___n_at].val; /* _n_at on <self:AAnnotations> */ if (var3 == NULL) { fprintf(stderr, "Runtime error: %s", "Cast failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11125); show_backtrace(1); } ((void (*)(val*, val*))(var_v->class->vft[COLOR_parser_nodes__Visitor__enter_visit]))(var_v, var3) /* enter_visit on <var_v:Visitor>*/; } else { } var4 = self->attrs[COLOR_parser_nodes__AAnnotations___n_opar].val; /* _n_opar on <self:AAnnotations> */ var5 = NULL; if (var4 == NULL) { var6 = 0; /* is null */ } else { var6 = 1; /* arg is null and recv is not */ } if (var6){ var7 = self->attrs[COLOR_parser_nodes__AAnnotations___n_opar].val; /* _n_opar on <self:AAnnotations> */ if (var7 == NULL) { fprintf(stderr, "Runtime error: %s", "Cast failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11128); show_backtrace(1); } ((void (*)(val*, val*))(var_v->class->vft[COLOR_parser_nodes__Visitor__enter_visit]))(var_v, var7) /* enter_visit on <var_v:Visitor>*/; } else { } var8 = self->attrs[COLOR_parser_nodes__AAnnotations___n_items].val; /* _n_items on <self:AAnnotations> */ if (var8 == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_items"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11130); show_backtrace(1); } var9 = ((val* (*)(val*))(var8->class->vft[COLOR_abstract_collection__Collection__iterator]))(var8) /* iterator on <var8:ANodes[AAnnotation]>*/; for(;;) { var10 = ((short int (*)(val*))(var9->class->vft[COLOR_abstract_collection__Iterator__is_ok]))(var9) /* is_ok on <var9:Iterator[nullable Object]>*/; if(!var10) break; var11 = ((val* (*)(val*))(var9->class->vft[COLOR_abstract_collection__Iterator__item]))(var9) /* item on <var9:Iterator[nullable Object]>*/; var_n = var11; ((void (*)(val*, val*))(var_v->class->vft[COLOR_parser_nodes__Visitor__enter_visit]))(var_v, var_n) /* enter_visit on <var_v:Visitor>*/; CONTINUE_label: (void)0; ((void (*)(val*))(var9->class->vft[COLOR_abstract_collection__Iterator__next]))(var9) /* next on <var9:Iterator[nullable Object]>*/; } BREAK_label: (void)0; var12 = self->attrs[COLOR_parser_nodes__AAnnotations___n_cpar].val; /* _n_cpar on <self:AAnnotations> */ var13 = NULL; if (var12 == NULL) { var14 = 0; /* is null */ } else { var14 = 1; /* arg is null and recv is not */ } if (var14){ var15 = self->attrs[COLOR_parser_nodes__AAnnotations___n_cpar].val; /* _n_cpar on <self:AAnnotations> */ if (var15 == NULL) { fprintf(stderr, "Runtime error: %s", "Cast failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11134); show_backtrace(1); } ((void (*)(val*, val*))(var_v->class->vft[COLOR_parser_nodes__Visitor__enter_visit]))(var_v, var15) /* enter_visit on <var_v:Visitor>*/; } else { } RET_LABEL:; } /* method parser_prod#AAnnotations#visit_all for (self: Object, Visitor) */ void VIRTUAL_parser_prod__AAnnotations__visit_all(val* self, val* p0) { parser_prod__AAnnotations__visit_all(self, p0); RET_LABEL:; } /* method parser_prod#AAnnotation#empty_init for (self: AAnnotation) */ void parser_prod__AAnnotation__empty_init(val* self) { RET_LABEL:; } /* method parser_prod#AAnnotation#empty_init for (self: Object) */ void VIRTUAL_parser_prod__AAnnotation__empty_init(val* self) { parser_prod__AAnnotation__empty_init(self); RET_LABEL:; } /* method parser_prod#AAnnotation#init_aannotation for (self: AAnnotation, nullable AAtid, nullable TOpar, Collection[Object], nullable TCpar, nullable AAnnotations) */ void parser_prod__AAnnotation__init_aannotation(val* self, val* p0, val* p1, val* p2, val* p3, val* p4) { val* var_n_atid /* var n_atid: nullable AAtid */; val* var_n_opar /* var n_opar: nullable TOpar */; val* var_n_args /* var n_args: Collection[Object] */; val* var_n_cpar /* var n_cpar: nullable TCpar */; val* var_n_annotations /* var n_annotations: nullable AAnnotations */; val* var /* : null */; short int var1 /* : Bool */; val* var2 /* : Iterator[nullable Object] */; short int var3 /* : Bool */; val* var4 /* : nullable Object */; val* var_n /* var n: Object */; short int var5 /* : Bool */; int cltype; int idtype; val* var6 /* : ANodes[AAtArg] */; val* var7 /* : null */; short int var8 /* : Bool */; val* var9 /* : null */; short int var10 /* : Bool */; var_n_atid = p0; var_n_opar = p1; var_n_args = p2; var_n_cpar = p3; var_n_annotations = p4; ((void (*)(val*))(self->class->vft[COLOR_parser_prod__AAnnotation__empty_init]))(self) /* empty_init on <self:AAnnotation>*/; if (var_n_atid == NULL) { fprintf(stderr, "Runtime error: %s", "Cast failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11150); show_backtrace(1); } self->attrs[COLOR_parser_nodes__AAnnotation___n_atid].val = var_n_atid; /* _n_atid on <self:AAnnotation> */ if (var_n_atid == NULL) { fprintf(stderr, "Runtime error: %s", "Receiver is null"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11151); show_backtrace(1); } else { ((void (*)(val*, val*))(var_n_atid->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_n_atid, self) /* parent= on <var_n_atid:nullable AAtid>*/; } self->attrs[COLOR_parser_nodes__AAnnotation___n_opar].val = var_n_opar; /* _n_opar on <self:AAnnotation> */ var = NULL; if (var_n_opar == NULL) { var1 = 0; /* is null */ } else { var1 = 1; /* arg is null and recv is not */ } if (var1){ ((void (*)(val*, val*))(var_n_opar->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_n_opar, self) /* parent= on <var_n_opar:nullable TOpar(TOpar)>*/; } else { } var2 = ((val* (*)(val*))(var_n_args->class->vft[COLOR_abstract_collection__Collection__iterator]))(var_n_args) /* iterator on <var_n_args:Collection[Object]>*/; for(;;) { var3 = ((short int (*)(val*))(var2->class->vft[COLOR_abstract_collection__Iterator__is_ok]))(var2) /* is_ok on <var2:Iterator[nullable Object]>*/; if(!var3) break; var4 = ((val* (*)(val*))(var2->class->vft[COLOR_abstract_collection__Iterator__item]))(var2) /* item on <var2:Iterator[nullable Object]>*/; var_n = var4; /* <var_n:Object> isa AAtArg */ cltype = type_parser_nodes__AAtArg.color; idtype = type_parser_nodes__AAtArg.id; if(cltype >= var_n->type->table_size) { var5 = 0; } else { var5 = var_n->type->type_table[cltype] == idtype; } if (!var5) { fprintf(stderr, "Runtime error: %s", "Assert failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11157); show_backtrace(1); } var6 = self->attrs[COLOR_parser_nodes__AAnnotation___n_args].val; /* _n_args on <self:AAnnotation> */ if (var6 == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_args"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11158); show_backtrace(1); } ((void (*)(val*, val*))(var6->class->vft[COLOR_abstract_collection__SimpleCollection__add]))(var6, var_n) /* add on <var6:ANodes[AAtArg]>*/; ((void (*)(val*, val*))(var_n->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_n, self) /* parent= on <var_n:Object(AAtArg)>*/; CONTINUE_label: (void)0; ((void (*)(val*))(var2->class->vft[COLOR_abstract_collection__Iterator__next]))(var2) /* next on <var2:Iterator[nullable Object]>*/; } BREAK_label: (void)0; self->attrs[COLOR_parser_nodes__AAnnotation___n_cpar].val = var_n_cpar; /* _n_cpar on <self:AAnnotation> */ var7 = NULL; if (var_n_cpar == NULL) { var8 = 0; /* is null */ } else { var8 = 1; /* arg is null and recv is not */ } if (var8){ ((void (*)(val*, val*))(var_n_cpar->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_n_cpar, self) /* parent= on <var_n_cpar:nullable TCpar(TCpar)>*/; } else { } self->attrs[COLOR_parser_nodes__Prod___n_annotations].val = var_n_annotations; /* _n_annotations on <self:AAnnotation> */ var9 = NULL; if (var_n_annotations == NULL) { var10 = 0; /* is null */ } else { var10 = 1; /* arg is null and recv is not */ } if (var10){ ((void (*)(val*, val*))(var_n_annotations->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_n_annotations, self) /* parent= on <var_n_annotations:nullable AAnnotations(AAnnotations)>*/; } else { } RET_LABEL:; } /* method parser_prod#AAnnotation#init_aannotation for (self: Object, nullable AAtid, nullable TOpar, Collection[Object], nullable TCpar, nullable AAnnotations) */ void VIRTUAL_parser_prod__AAnnotation__init_aannotation(val* self, val* p0, val* p1, val* p2, val* p3, val* p4) { parser_prod__AAnnotation__init_aannotation(self, p0, p1, p2, p3, p4); RET_LABEL:; } /* method parser_prod#AAnnotation#replace_child for (self: AAnnotation, ANode, nullable ANode) */ void parser_prod__AAnnotation__replace_child(val* self, val* p0, val* p1) { val* var_old_child /* var old_child: ANode */; val* var_new_child /* var new_child: nullable ANode */; val* var /* : AAtid */; short int var1 /* : Bool */; val* var2 /* : null */; short int var3 /* : Bool */; short int var4 /* : Bool */; int cltype; int idtype; val* var5 /* : nullable TOpar */; short int var6 /* : Bool */; val* var7 /* : null */; short int var8 /* : Bool */; short int var9 /* : Bool */; int cltype10; int idtype11; val* var12 /* : null */; val* var13 /* : Range[Int] */; long var14 /* : Int */; val* var15 /* : ANodes[AAtArg] */; long var16 /* : Int */; val* var17 /* : Discrete */; val* var18 /* : Discrete */; val* var19 /* : Iterator[nullable Object] */; short int var20 /* : Bool */; val* var21 /* : nullable Object */; long var_i /* var i: Int */; long var22 /* : Int */; val* var23 /* : ANodes[AAtArg] */; val* var24 /* : nullable Object */; short int var25 /* : Bool */; val* var26 /* : null */; short int var27 /* : Bool */; short int var28 /* : Bool */; int cltype29; int idtype30; val* var31 /* : ANodes[AAtArg] */; val* var32 /* : ANodes[AAtArg] */; val* var33 /* : nullable TCpar */; short int var34 /* : Bool */; val* var35 /* : null */; short int var36 /* : Bool */; short int var37 /* : Bool */; int cltype38; int idtype39; val* var40 /* : null */; val* var41 /* : nullable AAnnotations */; short int var42 /* : Bool */; val* var43 /* : null */; short int var44 /* : Bool */; short int var45 /* : Bool */; int cltype46; int idtype47; val* var48 /* : null */; var_old_child = p0; var_new_child = p1; var = self->attrs[COLOR_parser_nodes__AAnnotation___n_atid].val; /* _n_atid on <self:AAnnotation> */ if (var == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_atid"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11173); show_backtrace(1); } var1 = ((short int (*)(val*, val*))(var->class->vft[COLOR_kernel__Object___61d_61d]))(var, var_old_child) /* == on <var:AAtid>*/; if (var1){ var2 = NULL; if (var_new_child == NULL) { var3 = 0; /* is null */ } else { var3 = 1; /* arg is null and recv is not */ } if (var3){ ((void (*)(val*, val*))(var_new_child->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_new_child, self) /* parent= on <var_new_child:nullable ANode(ANode)>*/; /* <var_new_child:nullable ANode(ANode)> isa AAtid */ cltype = type_parser_nodes__AAtid.color; idtype = type_parser_nodes__AAtid.id; if(cltype >= var_new_child->type->table_size) { var4 = 0; } else { var4 = var_new_child->type->type_table[cltype] == idtype; } if (!var4) { fprintf(stderr, "Runtime error: %s", "Assert failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11176); show_backtrace(1); } self->attrs[COLOR_parser_nodes__AAnnotation___n_atid].val = var_new_child; /* _n_atid on <self:AAnnotation> */ } else { fprintf(stderr, "Runtime error: %s", "Aborted"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11179); show_backtrace(1); } goto RET_LABEL; } else { } var5 = self->attrs[COLOR_parser_nodes__AAnnotation___n_opar].val; /* _n_opar on <self:AAnnotation> */ if (var5 == NULL) { var6 = 0; /* <var_old_child:ANode> cannot be null */ } else { var6 = ((short int (*)(val*, val*))(var5->class->vft[COLOR_kernel__Object___61d_61d]))(var5, var_old_child) /* == on <var5:nullable TOpar>*/; } if (var6){ var7 = NULL; if (var_new_child == NULL) { var8 = 0; /* is null */ } else { var8 = 1; /* arg is null and recv is not */ } if (var8){ ((void (*)(val*, val*))(var_new_child->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_new_child, self) /* parent= on <var_new_child:nullable ANode(ANode)>*/; /* <var_new_child:nullable ANode(ANode)> isa TOpar */ cltype10 = type_parser_nodes__TOpar.color; idtype11 = type_parser_nodes__TOpar.id; if(cltype10 >= var_new_child->type->table_size) { var9 = 0; } else { var9 = var_new_child->type->type_table[cltype10] == idtype11; } if (!var9) { fprintf(stderr, "Runtime error: %s", "Assert failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11186); show_backtrace(1); } self->attrs[COLOR_parser_nodes__AAnnotation___n_opar].val = var_new_child; /* _n_opar on <self:AAnnotation> */ } else { var12 = NULL; self->attrs[COLOR_parser_nodes__AAnnotation___n_opar].val = var12; /* _n_opar on <self:AAnnotation> */ } goto RET_LABEL; } else { } var13 = NEW_range__Range(&type_range__Rangekernel__Int); var14 = 0; var15 = self->attrs[COLOR_parser_nodes__AAnnotation___n_args].val; /* _n_args on <self:AAnnotation> */ if (var15 == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_args"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11193); show_backtrace(1); } var16 = ((long (*)(val*))(var15->class->vft[COLOR_abstract_collection__Collection__length]))(var15) /* length on <var15:ANodes[AAtArg]>*/; var17 = BOX_kernel__Int(var14); /* autobox from Int to Discrete */ var18 = BOX_kernel__Int(var16); /* autobox from Int to Discrete */ ((void (*)(val*, val*, val*))(var13->class->vft[COLOR_range__Range__without_last]))(var13, var17, var18) /* without_last on <var13:Range[Int]>*/; var19 = ((val* (*)(val*))(var13->class->vft[COLOR_abstract_collection__Collection__iterator]))(var13) /* iterator on <var13:Range[Int]>*/; for(;;) { var20 = ((short int (*)(val*))(var19->class->vft[COLOR_abstract_collection__Iterator__is_ok]))(var19) /* is_ok on <var19:Iterator[nullable Object]>*/; if(!var20) break; var21 = ((val* (*)(val*))(var19->class->vft[COLOR_abstract_collection__Iterator__item]))(var19) /* item on <var19:Iterator[nullable Object]>*/; var22 = ((struct instance_kernel__Int*)var21)->value; /* autounbox from nullable Object to Int */; var_i = var22; var23 = self->attrs[COLOR_parser_nodes__AAnnotation___n_args].val; /* _n_args on <self:AAnnotation> */ if (var23 == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_args"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11194); show_backtrace(1); } var24 = ((val* (*)(val*, long))(var23->class->vft[COLOR_abstract_collection__SequenceRead___91d_93d]))(var23, var_i) /* [] on <var23:ANodes[AAtArg]>*/; var25 = ((short int (*)(val*, val*))(var24->class->vft[COLOR_kernel__Object___61d_61d]))(var24, var_old_child) /* == on <var24:nullable Object(AAtArg)>*/; if (var25){ var26 = NULL; if (var_new_child == NULL) { var27 = 0; /* is null */ } else { var27 = 1; /* arg is null and recv is not */ } if (var27){ /* <var_new_child:nullable ANode(ANode)> isa AAtArg */ cltype29 = type_parser_nodes__AAtArg.color; idtype30 = type_parser_nodes__AAtArg.id; if(cltype29 >= var_new_child->type->table_size) { var28 = 0; } else { var28 = var_new_child->type->type_table[cltype29] == idtype30; } if (!var28) { fprintf(stderr, "Runtime error: %s", "Assert failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11196); show_backtrace(1); } var31 = self->attrs[COLOR_parser_nodes__AAnnotation___n_args].val; /* _n_args on <self:AAnnotation> */ if (var31 == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_args"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11197); show_backtrace(1); } ((void (*)(val*, long, val*))(var31->class->vft[COLOR_abstract_collection__Sequence___91d_93d_61d]))(var31, var_i, var_new_child) /* []= on <var31:ANodes[AAtArg]>*/; ((void (*)(val*, val*))(var_new_child->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_new_child, self) /* parent= on <var_new_child:nullable ANode(AAtArg)>*/; } else { var32 = self->attrs[COLOR_parser_nodes__AAnnotation___n_args].val; /* _n_args on <self:AAnnotation> */ if (var32 == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_args"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11200); show_backtrace(1); } ((void (*)(val*, long))(var32->class->vft[COLOR_abstract_collection__Sequence__remove_at]))(var32, var_i) /* remove_at on <var32:ANodes[AAtArg]>*/; } goto RET_LABEL; } else { } CONTINUE_label: (void)0; ((void (*)(val*))(var19->class->vft[COLOR_abstract_collection__Iterator__next]))(var19) /* next on <var19:Iterator[nullable Object]>*/; } BREAK_label: (void)0; var33 = self->attrs[COLOR_parser_nodes__AAnnotation___n_cpar].val; /* _n_cpar on <self:AAnnotation> */ if (var33 == NULL) { var34 = 0; /* <var_old_child:ANode> cannot be null */ } else { var34 = ((short int (*)(val*, val*))(var33->class->vft[COLOR_kernel__Object___61d_61d]))(var33, var_old_child) /* == on <var33:nullable TCpar>*/; } if (var34){ var35 = NULL; if (var_new_child == NULL) { var36 = 0; /* is null */ } else { var36 = 1; /* arg is null and recv is not */ } if (var36){ ((void (*)(val*, val*))(var_new_child->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_new_child, self) /* parent= on <var_new_child:nullable ANode(ANode)>*/; /* <var_new_child:nullable ANode(ANode)> isa TCpar */ cltype38 = type_parser_nodes__TCpar.color; idtype39 = type_parser_nodes__TCpar.id; if(cltype38 >= var_new_child->type->table_size) { var37 = 0; } else { var37 = var_new_child->type->type_table[cltype38] == idtype39; } if (!var37) { fprintf(stderr, "Runtime error: %s", "Assert failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11208); show_backtrace(1); } self->attrs[COLOR_parser_nodes__AAnnotation___n_cpar].val = var_new_child; /* _n_cpar on <self:AAnnotation> */ } else { var40 = NULL; self->attrs[COLOR_parser_nodes__AAnnotation___n_cpar].val = var40; /* _n_cpar on <self:AAnnotation> */ } goto RET_LABEL; } else { } var41 = self->attrs[COLOR_parser_nodes__Prod___n_annotations].val; /* _n_annotations on <self:AAnnotation> */ if (var41 == NULL) { var42 = 0; /* <var_old_child:ANode> cannot be null */ } else { var42 = ((short int (*)(val*, val*))(var41->class->vft[COLOR_kernel__Object___61d_61d]))(var41, var_old_child) /* == on <var41:nullable AAnnotations>*/; } if (var42){ var43 = NULL; if (var_new_child == NULL) { var44 = 0; /* is null */ } else { var44 = 1; /* arg is null and recv is not */ } if (var44){ ((void (*)(val*, val*))(var_new_child->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_new_child, self) /* parent= on <var_new_child:nullable ANode(ANode)>*/; /* <var_new_child:nullable ANode(ANode)> isa AAnnotations */ cltype46 = type_parser_nodes__AAnnotations.color; idtype47 = type_parser_nodes__AAnnotations.id; if(cltype46 >= var_new_child->type->table_size) { var45 = 0; } else { var45 = var_new_child->type->type_table[cltype46] == idtype47; } if (!var45) { fprintf(stderr, "Runtime error: %s", "Assert failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11218); show_backtrace(1); } self->attrs[COLOR_parser_nodes__Prod___n_annotations].val = var_new_child; /* _n_annotations on <self:AAnnotation> */ } else { var48 = NULL; self->attrs[COLOR_parser_nodes__Prod___n_annotations].val = var48; /* _n_annotations on <self:AAnnotation> */ } goto RET_LABEL; } else { } RET_LABEL:; } /* method parser_prod#AAnnotation#replace_child for (self: Object, ANode, nullable ANode) */ void VIRTUAL_parser_prod__AAnnotation__replace_child(val* self, val* p0, val* p1) { parser_prod__AAnnotation__replace_child(self, p0, p1); RET_LABEL:; } /* method parser_prod#AAnnotation#n_atid= for (self: AAnnotation, AAtid) */ void parser_prod__AAnnotation__n_atid_61d(val* self, val* p0) { val* var_node /* var node: AAtid */; var_node = p0; self->attrs[COLOR_parser_nodes__AAnnotation___n_atid].val = var_node; /* _n_atid on <self:AAnnotation> */ ((void (*)(val*, val*))(var_node->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_node, self) /* parent= on <var_node:AAtid>*/; RET_LABEL:; } /* method parser_prod#AAnnotation#n_atid= for (self: Object, AAtid) */ void VIRTUAL_parser_prod__AAnnotation__n_atid_61d(val* self, val* p0) { parser_prod__AAnnotation__n_atid_61d(self, p0); RET_LABEL:; } /* method parser_prod#AAnnotation#n_opar= for (self: AAnnotation, nullable TOpar) */ void parser_prod__AAnnotation__n_opar_61d(val* self, val* p0) { val* var_node /* var node: nullable TOpar */; val* var /* : null */; short int var1 /* : Bool */; var_node = p0; self->attrs[COLOR_parser_nodes__AAnnotation___n_opar].val = var_node; /* _n_opar on <self:AAnnotation> */ var = NULL; if (var_node == NULL) { var1 = 0; /* is null */ } else { var1 = 1; /* arg is null and recv is not */ } if (var1){ ((void (*)(val*, val*))(var_node->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_node, self) /* parent= on <var_node:nullable TOpar(TOpar)>*/; } else { } RET_LABEL:; } /* method parser_prod#AAnnotation#n_opar= for (self: Object, nullable TOpar) */ void VIRTUAL_parser_prod__AAnnotation__n_opar_61d(val* self, val* p0) { parser_prod__AAnnotation__n_opar_61d(self, p0); RET_LABEL:; } /* method parser_prod#AAnnotation#n_cpar= for (self: AAnnotation, nullable TCpar) */ void parser_prod__AAnnotation__n_cpar_61d(val* self, val* p0) { val* var_node /* var node: nullable TCpar */; val* var /* : null */; short int var1 /* : Bool */; var_node = p0; self->attrs[COLOR_parser_nodes__AAnnotation___n_cpar].val = var_node; /* _n_cpar on <self:AAnnotation> */ var = NULL; if (var_node == NULL) { var1 = 0; /* is null */ } else { var1 = 1; /* arg is null and recv is not */ } if (var1){ ((void (*)(val*, val*))(var_node->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_node, self) /* parent= on <var_node:nullable TCpar(TCpar)>*/; } else { } RET_LABEL:; } /* method parser_prod#AAnnotation#n_cpar= for (self: Object, nullable TCpar) */ void VIRTUAL_parser_prod__AAnnotation__n_cpar_61d(val* self, val* p0) { parser_prod__AAnnotation__n_cpar_61d(self, p0); RET_LABEL:; } /* method parser_prod#AAnnotation#n_annotations= for (self: AAnnotation, nullable AAnnotations) */ void parser_prod__AAnnotation__n_annotations_61d(val* self, val* p0) { val* var_node /* var node: nullable AAnnotations */; val* var /* : null */; short int var1 /* : Bool */; var_node = p0; self->attrs[COLOR_parser_nodes__Prod___n_annotations].val = var_node; /* _n_annotations on <self:AAnnotation> */ var = NULL; if (var_node == NULL) { var1 = 0; /* is null */ } else { var1 = 1; /* arg is null and recv is not */ } if (var1){ ((void (*)(val*, val*))(var_node->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_node, self) /* parent= on <var_node:nullable AAnnotations(AAnnotations)>*/; } else { } RET_LABEL:; } /* method parser_prod#AAnnotation#n_annotations= for (self: Object, nullable AAnnotations) */ void VIRTUAL_parser_prod__AAnnotation__n_annotations_61d(val* self, val* p0) { parser_prod__AAnnotation__n_annotations_61d(self, p0); RET_LABEL:; } /* method parser_prod#AAnnotation#visit_all for (self: AAnnotation, Visitor) */ void parser_prod__AAnnotation__visit_all(val* self, val* p0) { val* var_v /* var v: Visitor */; val* var /* : AAtid */; val* var1 /* : nullable TOpar */; val* var2 /* : null */; short int var3 /* : Bool */; val* var4 /* : nullable TOpar */; val* var5 /* : ANodes[AAtArg] */; val* var6 /* : Iterator[nullable Object] */; short int var7 /* : Bool */; val* var8 /* : nullable Object */; val* var_n /* var n: AAtArg */; val* var9 /* : nullable TCpar */; val* var10 /* : null */; short int var11 /* : Bool */; val* var12 /* : nullable TCpar */; val* var13 /* : nullable AAnnotations */; val* var14 /* : null */; short int var15 /* : Bool */; val* var16 /* : nullable AAnnotations */; var_v = p0; var = self->attrs[COLOR_parser_nodes__AAnnotation___n_atid].val; /* _n_atid on <self:AAnnotation> */ if (var == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_atid"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11257); show_backtrace(1); } ((void (*)(val*, val*))(var_v->class->vft[COLOR_parser_nodes__Visitor__enter_visit]))(var_v, var) /* enter_visit on <var_v:Visitor>*/; var1 = self->attrs[COLOR_parser_nodes__AAnnotation___n_opar].val; /* _n_opar on <self:AAnnotation> */ var2 = NULL; if (var1 == NULL) { var3 = 0; /* is null */ } else { var3 = 1; /* arg is null and recv is not */ } if (var3){ var4 = self->attrs[COLOR_parser_nodes__AAnnotation___n_opar].val; /* _n_opar on <self:AAnnotation> */ if (var4 == NULL) { fprintf(stderr, "Runtime error: %s", "Cast failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11259); show_backtrace(1); } ((void (*)(val*, val*))(var_v->class->vft[COLOR_parser_nodes__Visitor__enter_visit]))(var_v, var4) /* enter_visit on <var_v:Visitor>*/; } else { } var5 = self->attrs[COLOR_parser_nodes__AAnnotation___n_args].val; /* _n_args on <self:AAnnotation> */ if (var5 == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_args"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11261); show_backtrace(1); } var6 = ((val* (*)(val*))(var5->class->vft[COLOR_abstract_collection__Collection__iterator]))(var5) /* iterator on <var5:ANodes[AAtArg]>*/; for(;;) { var7 = ((short int (*)(val*))(var6->class->vft[COLOR_abstract_collection__Iterator__is_ok]))(var6) /* is_ok on <var6:Iterator[nullable Object]>*/; if(!var7) break; var8 = ((val* (*)(val*))(var6->class->vft[COLOR_abstract_collection__Iterator__item]))(var6) /* item on <var6:Iterator[nullable Object]>*/; var_n = var8; ((void (*)(val*, val*))(var_v->class->vft[COLOR_parser_nodes__Visitor__enter_visit]))(var_v, var_n) /* enter_visit on <var_v:Visitor>*/; CONTINUE_label: (void)0; ((void (*)(val*))(var6->class->vft[COLOR_abstract_collection__Iterator__next]))(var6) /* next on <var6:Iterator[nullable Object]>*/; } BREAK_label: (void)0; var9 = self->attrs[COLOR_parser_nodes__AAnnotation___n_cpar].val; /* _n_cpar on <self:AAnnotation> */ var10 = NULL; if (var9 == NULL) { var11 = 0; /* is null */ } else { var11 = 1; /* arg is null and recv is not */ } if (var11){ var12 = self->attrs[COLOR_parser_nodes__AAnnotation___n_cpar].val; /* _n_cpar on <self:AAnnotation> */ if (var12 == NULL) { fprintf(stderr, "Runtime error: %s", "Cast failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11265); show_backtrace(1); } ((void (*)(val*, val*))(var_v->class->vft[COLOR_parser_nodes__Visitor__enter_visit]))(var_v, var12) /* enter_visit on <var_v:Visitor>*/; } else { } var13 = self->attrs[COLOR_parser_nodes__Prod___n_annotations].val; /* _n_annotations on <self:AAnnotation> */ var14 = NULL; if (var13 == NULL) { var15 = 0; /* is null */ } else { var15 = 1; /* arg is null and recv is not */ } if (var15){ var16 = self->attrs[COLOR_parser_nodes__Prod___n_annotations].val; /* _n_annotations on <self:AAnnotation> */ if (var16 == NULL) { fprintf(stderr, "Runtime error: %s", "Cast failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11268); show_backtrace(1); } ((void (*)(val*, val*))(var_v->class->vft[COLOR_parser_nodes__Visitor__enter_visit]))(var_v, var16) /* enter_visit on <var_v:Visitor>*/; } else { } RET_LABEL:; } /* method parser_prod#AAnnotation#visit_all for (self: Object, Visitor) */ void VIRTUAL_parser_prod__AAnnotation__visit_all(val* self, val* p0) { parser_prod__AAnnotation__visit_all(self, p0); RET_LABEL:; } /* method parser_prod#ATypeAtArg#empty_init for (self: ATypeAtArg) */ void parser_prod__ATypeAtArg__empty_init(val* self) { RET_LABEL:; } /* method parser_prod#ATypeAtArg#empty_init for (self: Object) */ void VIRTUAL_parser_prod__ATypeAtArg__empty_init(val* self) { parser_prod__ATypeAtArg__empty_init(self); RET_LABEL:; } /* method parser_prod#ATypeAtArg#init_atypeatarg for (self: ATypeAtArg, nullable AType) */ void parser_prod__ATypeAtArg__init_atypeatarg(val* self, val* p0) { val* var_n_type /* var n_type: nullable AType */; var_n_type = p0; ((void (*)(val*))(self->class->vft[COLOR_parser_prod__ATypeAtArg__empty_init]))(self) /* empty_init on <self:ATypeAtArg>*/; if (var_n_type == NULL) { fprintf(stderr, "Runtime error: %s", "Cast failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11280); show_backtrace(1); } self->attrs[COLOR_parser_nodes__ATypeAtArg___n_type].val = var_n_type; /* _n_type on <self:ATypeAtArg> */ if (var_n_type == NULL) { fprintf(stderr, "Runtime error: %s", "Receiver is null"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11281); show_backtrace(1); } else { ((void (*)(val*, val*))(var_n_type->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_n_type, self) /* parent= on <var_n_type:nullable AType>*/; } RET_LABEL:; } /* method parser_prod#ATypeAtArg#init_atypeatarg for (self: Object, nullable AType) */ void VIRTUAL_parser_prod__ATypeAtArg__init_atypeatarg(val* self, val* p0) { parser_prod__ATypeAtArg__init_atypeatarg(self, p0); RET_LABEL:; } /* method parser_prod#ATypeAtArg#replace_child for (self: ATypeAtArg, ANode, nullable ANode) */ void parser_prod__ATypeAtArg__replace_child(val* self, val* p0, val* p1) { val* var_old_child /* var old_child: ANode */; val* var_new_child /* var new_child: nullable ANode */; val* var /* : AType */; short int var1 /* : Bool */; val* var2 /* : null */; short int var3 /* : Bool */; short int var4 /* : Bool */; int cltype; int idtype; var_old_child = p0; var_new_child = p1; var = self->attrs[COLOR_parser_nodes__ATypeAtArg___n_type].val; /* _n_type on <self:ATypeAtArg> */ if (var == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_type"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11286); show_backtrace(1); } var1 = ((short int (*)(val*, val*))(var->class->vft[COLOR_kernel__Object___61d_61d]))(var, var_old_child) /* == on <var:AType>*/; if (var1){ var2 = NULL; if (var_new_child == NULL) { var3 = 0; /* is null */ } else { var3 = 1; /* arg is null and recv is not */ } if (var3){ ((void (*)(val*, val*))(var_new_child->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_new_child, self) /* parent= on <var_new_child:nullable ANode(ANode)>*/; /* <var_new_child:nullable ANode(ANode)> isa AType */ cltype = type_parser_nodes__AType.color; idtype = type_parser_nodes__AType.id; if(cltype >= var_new_child->type->table_size) { var4 = 0; } else { var4 = var_new_child->type->type_table[cltype] == idtype; } if (!var4) { fprintf(stderr, "Runtime error: %s", "Assert failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11289); show_backtrace(1); } self->attrs[COLOR_parser_nodes__ATypeAtArg___n_type].val = var_new_child; /* _n_type on <self:ATypeAtArg> */ } else { fprintf(stderr, "Runtime error: %s", "Aborted"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11292); show_backtrace(1); } goto RET_LABEL; } else { } RET_LABEL:; } /* method parser_prod#ATypeAtArg#replace_child for (self: Object, ANode, nullable ANode) */ void VIRTUAL_parser_prod__ATypeAtArg__replace_child(val* self, val* p0, val* p1) { parser_prod__ATypeAtArg__replace_child(self, p0, p1); RET_LABEL:; } /* method parser_prod#ATypeAtArg#n_type= for (self: ATypeAtArg, AType) */ void parser_prod__ATypeAtArg__n_type_61d(val* self, val* p0) { val* var_node /* var node: AType */; var_node = p0; self->attrs[COLOR_parser_nodes__ATypeAtArg___n_type].val = var_node; /* _n_type on <self:ATypeAtArg> */ ((void (*)(val*, val*))(var_node->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_node, self) /* parent= on <var_node:AType>*/; RET_LABEL:; } /* method parser_prod#ATypeAtArg#n_type= for (self: Object, AType) */ void VIRTUAL_parser_prod__ATypeAtArg__n_type_61d(val* self, val* p0) { parser_prod__ATypeAtArg__n_type_61d(self, p0); RET_LABEL:; } /* method parser_prod#ATypeAtArg#visit_all for (self: ATypeAtArg, Visitor) */ void parser_prod__ATypeAtArg__visit_all(val* self, val* p0) { val* var_v /* var v: Visitor */; val* var /* : AType */; var_v = p0; var = self->attrs[COLOR_parser_nodes__ATypeAtArg___n_type].val; /* _n_type on <self:ATypeAtArg> */ if (var == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_type"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11307); show_backtrace(1); } ((void (*)(val*, val*))(var_v->class->vft[COLOR_parser_nodes__Visitor__enter_visit]))(var_v, var) /* enter_visit on <var_v:Visitor>*/; RET_LABEL:; } /* method parser_prod#ATypeAtArg#visit_all for (self: Object, Visitor) */ void VIRTUAL_parser_prod__ATypeAtArg__visit_all(val* self, val* p0) { parser_prod__ATypeAtArg__visit_all(self, p0); RET_LABEL:; } /* method parser_prod#AExprAtArg#empty_init for (self: AExprAtArg) */ void parser_prod__AExprAtArg__empty_init(val* self) { RET_LABEL:; } /* method parser_prod#AExprAtArg#empty_init for (self: Object) */ void VIRTUAL_parser_prod__AExprAtArg__empty_init(val* self) { parser_prod__AExprAtArg__empty_init(self); RET_LABEL:; } /* method parser_prod#AExprAtArg#init_aexpratarg for (self: AExprAtArg, nullable AExpr) */ void parser_prod__AExprAtArg__init_aexpratarg(val* self, val* p0) { val* var_n_expr /* var n_expr: nullable AExpr */; var_n_expr = p0; ((void (*)(val*))(self->class->vft[COLOR_parser_prod__AExprAtArg__empty_init]))(self) /* empty_init on <self:AExprAtArg>*/; if (var_n_expr == NULL) { fprintf(stderr, "Runtime error: %s", "Cast failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11318); show_backtrace(1); } self->attrs[COLOR_parser_nodes__AExprAtArg___n_expr].val = var_n_expr; /* _n_expr on <self:AExprAtArg> */ if (var_n_expr == NULL) { fprintf(stderr, "Runtime error: %s", "Receiver is null"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11319); show_backtrace(1); } else { ((void (*)(val*, val*))(var_n_expr->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_n_expr, self) /* parent= on <var_n_expr:nullable AExpr>*/; } RET_LABEL:; } /* method parser_prod#AExprAtArg#init_aexpratarg for (self: Object, nullable AExpr) */ void VIRTUAL_parser_prod__AExprAtArg__init_aexpratarg(val* self, val* p0) { parser_prod__AExprAtArg__init_aexpratarg(self, p0); RET_LABEL:; } /* method parser_prod#AExprAtArg#replace_child for (self: AExprAtArg, ANode, nullable ANode) */ void parser_prod__AExprAtArg__replace_child(val* self, val* p0, val* p1) { val* var_old_child /* var old_child: ANode */; val* var_new_child /* var new_child: nullable ANode */; val* var /* : AExpr */; short int var1 /* : Bool */; val* var2 /* : null */; short int var3 /* : Bool */; short int var4 /* : Bool */; int cltype; int idtype; var_old_child = p0; var_new_child = p1; var = self->attrs[COLOR_parser_nodes__AExprAtArg___n_expr].val; /* _n_expr on <self:AExprAtArg> */ if (var == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_expr"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11324); show_backtrace(1); } var1 = ((short int (*)(val*, val*))(var->class->vft[COLOR_kernel__Object___61d_61d]))(var, var_old_child) /* == on <var:AExpr>*/; if (var1){ var2 = NULL; if (var_new_child == NULL) { var3 = 0; /* is null */ } else { var3 = 1; /* arg is null and recv is not */ } if (var3){ ((void (*)(val*, val*))(var_new_child->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_new_child, self) /* parent= on <var_new_child:nullable ANode(ANode)>*/; /* <var_new_child:nullable ANode(ANode)> isa AExpr */ cltype = type_parser_nodes__AExpr.color; idtype = type_parser_nodes__AExpr.id; if(cltype >= var_new_child->type->table_size) { var4 = 0; } else { var4 = var_new_child->type->type_table[cltype] == idtype; } if (!var4) { fprintf(stderr, "Runtime error: %s", "Assert failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11327); show_backtrace(1); } self->attrs[COLOR_parser_nodes__AExprAtArg___n_expr].val = var_new_child; /* _n_expr on <self:AExprAtArg> */ } else { fprintf(stderr, "Runtime error: %s", "Aborted"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11330); show_backtrace(1); } goto RET_LABEL; } else { } RET_LABEL:; } /* method parser_prod#AExprAtArg#replace_child for (self: Object, ANode, nullable ANode) */ void VIRTUAL_parser_prod__AExprAtArg__replace_child(val* self, val* p0, val* p1) { parser_prod__AExprAtArg__replace_child(self, p0, p1); RET_LABEL:; } /* method parser_prod#AExprAtArg#n_expr= for (self: AExprAtArg, AExpr) */ void parser_prod__AExprAtArg__n_expr_61d(val* self, val* p0) { val* var_node /* var node: AExpr */; var_node = p0; self->attrs[COLOR_parser_nodes__AExprAtArg___n_expr].val = var_node; /* _n_expr on <self:AExprAtArg> */ ((void (*)(val*, val*))(var_node->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_node, self) /* parent= on <var_node:AExpr>*/; RET_LABEL:; } /* method parser_prod#AExprAtArg#n_expr= for (self: Object, AExpr) */ void VIRTUAL_parser_prod__AExprAtArg__n_expr_61d(val* self, val* p0) { parser_prod__AExprAtArg__n_expr_61d(self, p0); RET_LABEL:; } /* method parser_prod#AExprAtArg#visit_all for (self: AExprAtArg, Visitor) */ void parser_prod__AExprAtArg__visit_all(val* self, val* p0) { val* var_v /* var v: Visitor */; val* var /* : AExpr */; var_v = p0; var = self->attrs[COLOR_parser_nodes__AExprAtArg___n_expr].val; /* _n_expr on <self:AExprAtArg> */ if (var == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_expr"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11345); show_backtrace(1); } ((void (*)(val*, val*))(var_v->class->vft[COLOR_parser_nodes__Visitor__enter_visit]))(var_v, var) /* enter_visit on <var_v:Visitor>*/; RET_LABEL:; } /* method parser_prod#AExprAtArg#visit_all for (self: Object, Visitor) */ void VIRTUAL_parser_prod__AExprAtArg__visit_all(val* self, val* p0) { parser_prod__AExprAtArg__visit_all(self, p0); RET_LABEL:; } /* method parser_prod#AAtAtArg#empty_init for (self: AAtAtArg) */ void parser_prod__AAtAtArg__empty_init(val* self) { RET_LABEL:; } /* method parser_prod#AAtAtArg#empty_init for (self: Object) */ void VIRTUAL_parser_prod__AAtAtArg__empty_init(val* self) { parser_prod__AAtAtArg__empty_init(self); RET_LABEL:; } /* method parser_prod#AAtAtArg#init_aatatarg for (self: AAtAtArg, nullable AAnnotations) */ void parser_prod__AAtAtArg__init_aatatarg(val* self, val* p0) { val* var_n_annotations /* var n_annotations: nullable AAnnotations */; var_n_annotations = p0; ((void (*)(val*))(self->class->vft[COLOR_parser_prod__AAtAtArg__empty_init]))(self) /* empty_init on <self:AAtAtArg>*/; if (var_n_annotations == NULL) { fprintf(stderr, "Runtime error: %s", "Cast failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11356); show_backtrace(1); } self->attrs[COLOR_parser_nodes__Prod___n_annotations].val = var_n_annotations; /* _n_annotations on <self:AAtAtArg> */ if (var_n_annotations == NULL) { fprintf(stderr, "Runtime error: %s", "Receiver is null"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11357); show_backtrace(1); } else { ((void (*)(val*, val*))(var_n_annotations->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_n_annotations, self) /* parent= on <var_n_annotations:nullable AAnnotations>*/; } RET_LABEL:; } /* method parser_prod#AAtAtArg#init_aatatarg for (self: Object, nullable AAnnotations) */ void VIRTUAL_parser_prod__AAtAtArg__init_aatatarg(val* self, val* p0) { parser_prod__AAtAtArg__init_aatatarg(self, p0); RET_LABEL:; } /* method parser_prod#AAtAtArg#replace_child for (self: AAtAtArg, ANode, nullable ANode) */ void parser_prod__AAtAtArg__replace_child(val* self, val* p0, val* p1) { val* var_old_child /* var old_child: ANode */; val* var_new_child /* var new_child: nullable ANode */; val* var /* : nullable AAnnotations */; short int var1 /* : Bool */; val* var2 /* : null */; short int var3 /* : Bool */; short int var4 /* : Bool */; int cltype; int idtype; var_old_child = p0; var_new_child = p1; var = self->attrs[COLOR_parser_nodes__Prod___n_annotations].val; /* _n_annotations on <self:AAtAtArg> */ if (var == NULL) { var1 = 0; /* <var_old_child:ANode> cannot be null */ } else { var1 = ((short int (*)(val*, val*))(var->class->vft[COLOR_kernel__Object___61d_61d]))(var, var_old_child) /* == on <var:nullable AAnnotations>*/; } if (var1){ var2 = NULL; if (var_new_child == NULL) { var3 = 0; /* is null */ } else { var3 = 1; /* arg is null and recv is not */ } if (var3){ ((void (*)(val*, val*))(var_new_child->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_new_child, self) /* parent= on <var_new_child:nullable ANode(ANode)>*/; /* <var_new_child:nullable ANode(ANode)> isa AAnnotations */ cltype = type_parser_nodes__AAnnotations.color; idtype = type_parser_nodes__AAnnotations.id; if(cltype >= var_new_child->type->table_size) { var4 = 0; } else { var4 = var_new_child->type->type_table[cltype] == idtype; } if (!var4) { fprintf(stderr, "Runtime error: %s", "Assert failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11365); show_backtrace(1); } self->attrs[COLOR_parser_nodes__Prod___n_annotations].val = var_new_child; /* _n_annotations on <self:AAtAtArg> */ } else { fprintf(stderr, "Runtime error: %s", "Aborted"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11368); show_backtrace(1); } goto RET_LABEL; } else { } RET_LABEL:; } /* method parser_prod#AAtAtArg#replace_child for (self: Object, ANode, nullable ANode) */ void VIRTUAL_parser_prod__AAtAtArg__replace_child(val* self, val* p0, val* p1) { parser_prod__AAtAtArg__replace_child(self, p0, p1); RET_LABEL:; } /* method parser_prod#AAtAtArg#n_annotations= for (self: AAtAtArg, nullable AAnnotations) */ void parser_prod__AAtAtArg__n_annotations_61d(val* self, val* p0) { val* var_node /* var node: nullable AAnnotations */; var_node = p0; self->attrs[COLOR_parser_nodes__Prod___n_annotations].val = var_node; /* _n_annotations on <self:AAtAtArg> */ if (var_node == NULL) { fprintf(stderr, "Runtime error: %s", "Receiver is null"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11377); show_backtrace(1); } else { ((void (*)(val*, val*))(var_node->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_node, self) /* parent= on <var_node:nullable AAnnotations>*/; } RET_LABEL:; } /* method parser_prod#AAtAtArg#n_annotations= for (self: Object, nullable AAnnotations) */ void VIRTUAL_parser_prod__AAtAtArg__n_annotations_61d(val* self, val* p0) { parser_prod__AAtAtArg__n_annotations_61d(self, p0); RET_LABEL:; } /* method parser_prod#AAtAtArg#visit_all for (self: AAtAtArg, Visitor) */ void parser_prod__AAtAtArg__visit_all(val* self, val* p0) { val* var_v /* var v: Visitor */; val* var /* : nullable AAnnotations */; var_v = p0; var = self->attrs[COLOR_parser_nodes__Prod___n_annotations].val; /* _n_annotations on <self:AAtAtArg> */ ((void (*)(val*, val*))(var_v->class->vft[COLOR_parser_nodes__Visitor__enter_visit]))(var_v, var) /* enter_visit on <var_v:Visitor>*/; RET_LABEL:; } /* method parser_prod#AAtAtArg#visit_all for (self: Object, Visitor) */ void VIRTUAL_parser_prod__AAtAtArg__visit_all(val* self, val* p0) { parser_prod__AAtAtArg__visit_all(self, p0); RET_LABEL:; } /* method parser_prod#AIdAtid#empty_init for (self: AIdAtid) */ void parser_prod__AIdAtid__empty_init(val* self) { RET_LABEL:; } /* method parser_prod#AIdAtid#empty_init for (self: Object) */ void VIRTUAL_parser_prod__AIdAtid__empty_init(val* self) { parser_prod__AIdAtid__empty_init(self); RET_LABEL:; } /* method parser_prod#AIdAtid#init_aidatid for (self: AIdAtid, nullable TId) */ void parser_prod__AIdAtid__init_aidatid(val* self, val* p0) { val* var_n_id /* var n_id: nullable TId */; var_n_id = p0; ((void (*)(val*))(self->class->vft[COLOR_parser_prod__AIdAtid__empty_init]))(self) /* empty_init on <self:AIdAtid>*/; if (var_n_id == NULL) { fprintf(stderr, "Runtime error: %s", "Cast failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11394); show_backtrace(1); } self->attrs[COLOR_parser_nodes__AAtid___n_id].val = var_n_id; /* _n_id on <self:AIdAtid> */ if (var_n_id == NULL) { fprintf(stderr, "Runtime error: %s", "Receiver is null"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11395); show_backtrace(1); } else { ((void (*)(val*, val*))(var_n_id->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_n_id, self) /* parent= on <var_n_id:nullable TId>*/; } RET_LABEL:; } /* method parser_prod#AIdAtid#init_aidatid for (self: Object, nullable TId) */ void VIRTUAL_parser_prod__AIdAtid__init_aidatid(val* self, val* p0) { parser_prod__AIdAtid__init_aidatid(self, p0); RET_LABEL:; } /* method parser_prod#AIdAtid#replace_child for (self: AIdAtid, ANode, nullable ANode) */ void parser_prod__AIdAtid__replace_child(val* self, val* p0, val* p1) { val* var_old_child /* var old_child: ANode */; val* var_new_child /* var new_child: nullable ANode */; val* var /* : Token */; short int var1 /* : Bool */; val* var2 /* : null */; short int var3 /* : Bool */; short int var4 /* : Bool */; int cltype; int idtype; var_old_child = p0; var_new_child = p1; var = self->attrs[COLOR_parser_nodes__AAtid___n_id].val; /* _n_id on <self:AIdAtid> */ if (var == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_id"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11400); show_backtrace(1); } var1 = ((short int (*)(val*, val*))(var->class->vft[COLOR_kernel__Object___61d_61d]))(var, var_old_child) /* == on <var:Token>*/; if (var1){ var2 = NULL; if (var_new_child == NULL) { var3 = 0; /* is null */ } else { var3 = 1; /* arg is null and recv is not */ } if (var3){ ((void (*)(val*, val*))(var_new_child->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_new_child, self) /* parent= on <var_new_child:nullable ANode(ANode)>*/; /* <var_new_child:nullable ANode(ANode)> isa TId */ cltype = type_parser_nodes__TId.color; idtype = type_parser_nodes__TId.id; if(cltype >= var_new_child->type->table_size) { var4 = 0; } else { var4 = var_new_child->type->type_table[cltype] == idtype; } if (!var4) { fprintf(stderr, "Runtime error: %s", "Assert failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11403); show_backtrace(1); } self->attrs[COLOR_parser_nodes__AAtid___n_id].val = var_new_child; /* _n_id on <self:AIdAtid> */ } else { fprintf(stderr, "Runtime error: %s", "Aborted"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11406); show_backtrace(1); } goto RET_LABEL; } else { } RET_LABEL:; } /* method parser_prod#AIdAtid#replace_child for (self: Object, ANode, nullable ANode) */ void VIRTUAL_parser_prod__AIdAtid__replace_child(val* self, val* p0, val* p1) { parser_prod__AIdAtid__replace_child(self, p0, p1); RET_LABEL:; } /* method parser_prod#AIdAtid#n_id= for (self: AIdAtid, Token) */ void parser_prod__AIdAtid__n_id_61d(val* self, val* p0) { val* var_node /* var node: Token */; var_node = p0; self->attrs[COLOR_parser_nodes__AAtid___n_id].val = var_node; /* _n_id on <self:AIdAtid> */ ((void (*)(val*, val*))(var_node->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_node, self) /* parent= on <var_node:Token>*/; RET_LABEL:; } /* method parser_prod#AIdAtid#n_id= for (self: Object, Token) */ void VIRTUAL_parser_prod__AIdAtid__n_id_61d(val* self, val* p0) { parser_prod__AIdAtid__n_id_61d(self, p0); RET_LABEL:; } /* method parser_prod#AIdAtid#visit_all for (self: AIdAtid, Visitor) */ void parser_prod__AIdAtid__visit_all(val* self, val* p0) { val* var_v /* var v: Visitor */; val* var /* : Token */; var_v = p0; var = self->attrs[COLOR_parser_nodes__AAtid___n_id].val; /* _n_id on <self:AIdAtid> */ if (var == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_id"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11421); show_backtrace(1); } ((void (*)(val*, val*))(var_v->class->vft[COLOR_parser_nodes__Visitor__enter_visit]))(var_v, var) /* enter_visit on <var_v:Visitor>*/; RET_LABEL:; } /* method parser_prod#AIdAtid#visit_all for (self: Object, Visitor) */ void VIRTUAL_parser_prod__AIdAtid__visit_all(val* self, val* p0) { parser_prod__AIdAtid__visit_all(self, p0); RET_LABEL:; } /* method parser_prod#AKwexternAtid#empty_init for (self: AKwexternAtid) */ void parser_prod__AKwexternAtid__empty_init(val* self) { RET_LABEL:; } /* method parser_prod#AKwexternAtid#empty_init for (self: Object) */ void VIRTUAL_parser_prod__AKwexternAtid__empty_init(val* self) { parser_prod__AKwexternAtid__empty_init(self); RET_LABEL:; } /* method parser_prod#AKwexternAtid#init_akwexternatid for (self: AKwexternAtid, nullable TKwextern) */ void parser_prod__AKwexternAtid__init_akwexternatid(val* self, val* p0) { val* var_n_id /* var n_id: nullable TKwextern */; var_n_id = p0; ((void (*)(val*))(self->class->vft[COLOR_parser_prod__AKwexternAtid__empty_init]))(self) /* empty_init on <self:AKwexternAtid>*/; if (var_n_id == NULL) { fprintf(stderr, "Runtime error: %s", "Cast failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11432); show_backtrace(1); } self->attrs[COLOR_parser_nodes__AAtid___n_id].val = var_n_id; /* _n_id on <self:AKwexternAtid> */ if (var_n_id == NULL) { fprintf(stderr, "Runtime error: %s", "Receiver is null"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11433); show_backtrace(1); } else { ((void (*)(val*, val*))(var_n_id->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_n_id, self) /* parent= on <var_n_id:nullable TKwextern>*/; } RET_LABEL:; } /* method parser_prod#AKwexternAtid#init_akwexternatid for (self: Object, nullable TKwextern) */ void VIRTUAL_parser_prod__AKwexternAtid__init_akwexternatid(val* self, val* p0) { parser_prod__AKwexternAtid__init_akwexternatid(self, p0); RET_LABEL:; } /* method parser_prod#AKwexternAtid#replace_child for (self: AKwexternAtid, ANode, nullable ANode) */ void parser_prod__AKwexternAtid__replace_child(val* self, val* p0, val* p1) { val* var_old_child /* var old_child: ANode */; val* var_new_child /* var new_child: nullable ANode */; val* var /* : Token */; short int var1 /* : Bool */; val* var2 /* : null */; short int var3 /* : Bool */; short int var4 /* : Bool */; int cltype; int idtype; var_old_child = p0; var_new_child = p1; var = self->attrs[COLOR_parser_nodes__AAtid___n_id].val; /* _n_id on <self:AKwexternAtid> */ if (var == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_id"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11438); show_backtrace(1); } var1 = ((short int (*)(val*, val*))(var->class->vft[COLOR_kernel__Object___61d_61d]))(var, var_old_child) /* == on <var:Token>*/; if (var1){ var2 = NULL; if (var_new_child == NULL) { var3 = 0; /* is null */ } else { var3 = 1; /* arg is null and recv is not */ } if (var3){ ((void (*)(val*, val*))(var_new_child->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_new_child, self) /* parent= on <var_new_child:nullable ANode(ANode)>*/; /* <var_new_child:nullable ANode(ANode)> isa TKwextern */ cltype = type_parser_nodes__TKwextern.color; idtype = type_parser_nodes__TKwextern.id; if(cltype >= var_new_child->type->table_size) { var4 = 0; } else { var4 = var_new_child->type->type_table[cltype] == idtype; } if (!var4) { fprintf(stderr, "Runtime error: %s", "Assert failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11441); show_backtrace(1); } self->attrs[COLOR_parser_nodes__AAtid___n_id].val = var_new_child; /* _n_id on <self:AKwexternAtid> */ } else { fprintf(stderr, "Runtime error: %s", "Aborted"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11444); show_backtrace(1); } goto RET_LABEL; } else { } RET_LABEL:; } /* method parser_prod#AKwexternAtid#replace_child for (self: Object, ANode, nullable ANode) */ void VIRTUAL_parser_prod__AKwexternAtid__replace_child(val* self, val* p0, val* p1) { parser_prod__AKwexternAtid__replace_child(self, p0, p1); RET_LABEL:; } /* method parser_prod#AKwexternAtid#n_id= for (self: AKwexternAtid, Token) */ void parser_prod__AKwexternAtid__n_id_61d(val* self, val* p0) { val* var_node /* var node: Token */; var_node = p0; self->attrs[COLOR_parser_nodes__AAtid___n_id].val = var_node; /* _n_id on <self:AKwexternAtid> */ ((void (*)(val*, val*))(var_node->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_node, self) /* parent= on <var_node:Token>*/; RET_LABEL:; } /* method parser_prod#AKwexternAtid#n_id= for (self: Object, Token) */ void VIRTUAL_parser_prod__AKwexternAtid__n_id_61d(val* self, val* p0) { parser_prod__AKwexternAtid__n_id_61d(self, p0); RET_LABEL:; } /* method parser_prod#AKwexternAtid#visit_all for (self: AKwexternAtid, Visitor) */ void parser_prod__AKwexternAtid__visit_all(val* self, val* p0) { val* var_v /* var v: Visitor */; val* var /* : Token */; var_v = p0; var = self->attrs[COLOR_parser_nodes__AAtid___n_id].val; /* _n_id on <self:AKwexternAtid> */ if (var == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_id"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11459); show_backtrace(1); } ((void (*)(val*, val*))(var_v->class->vft[COLOR_parser_nodes__Visitor__enter_visit]))(var_v, var) /* enter_visit on <var_v:Visitor>*/; RET_LABEL:; } /* method parser_prod#AKwexternAtid#visit_all for (self: Object, Visitor) */ void VIRTUAL_parser_prod__AKwexternAtid__visit_all(val* self, val* p0) { parser_prod__AKwexternAtid__visit_all(self, p0); RET_LABEL:; } /* method parser_prod#AKwinternAtid#empty_init for (self: AKwinternAtid) */ void parser_prod__AKwinternAtid__empty_init(val* self) { RET_LABEL:; } /* method parser_prod#AKwinternAtid#empty_init for (self: Object) */ void VIRTUAL_parser_prod__AKwinternAtid__empty_init(val* self) { parser_prod__AKwinternAtid__empty_init(self); RET_LABEL:; } /* method parser_prod#AKwinternAtid#init_akwinternatid for (self: AKwinternAtid, nullable TKwintern) */ void parser_prod__AKwinternAtid__init_akwinternatid(val* self, val* p0) { val* var_n_id /* var n_id: nullable TKwintern */; var_n_id = p0; ((void (*)(val*))(self->class->vft[COLOR_parser_prod__AKwinternAtid__empty_init]))(self) /* empty_init on <self:AKwinternAtid>*/; if (var_n_id == NULL) { fprintf(stderr, "Runtime error: %s", "Cast failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11470); show_backtrace(1); } self->attrs[COLOR_parser_nodes__AAtid___n_id].val = var_n_id; /* _n_id on <self:AKwinternAtid> */ if (var_n_id == NULL) { fprintf(stderr, "Runtime error: %s", "Receiver is null"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11471); show_backtrace(1); } else { ((void (*)(val*, val*))(var_n_id->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_n_id, self) /* parent= on <var_n_id:nullable TKwintern>*/; } RET_LABEL:; } /* method parser_prod#AKwinternAtid#init_akwinternatid for (self: Object, nullable TKwintern) */ void VIRTUAL_parser_prod__AKwinternAtid__init_akwinternatid(val* self, val* p0) { parser_prod__AKwinternAtid__init_akwinternatid(self, p0); RET_LABEL:; } /* method parser_prod#AKwinternAtid#replace_child for (self: AKwinternAtid, ANode, nullable ANode) */ void parser_prod__AKwinternAtid__replace_child(val* self, val* p0, val* p1) { val* var_old_child /* var old_child: ANode */; val* var_new_child /* var new_child: nullable ANode */; val* var /* : Token */; short int var1 /* : Bool */; val* var2 /* : null */; short int var3 /* : Bool */; short int var4 /* : Bool */; int cltype; int idtype; var_old_child = p0; var_new_child = p1; var = self->attrs[COLOR_parser_nodes__AAtid___n_id].val; /* _n_id on <self:AKwinternAtid> */ if (var == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_id"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11476); show_backtrace(1); } var1 = ((short int (*)(val*, val*))(var->class->vft[COLOR_kernel__Object___61d_61d]))(var, var_old_child) /* == on <var:Token>*/; if (var1){ var2 = NULL; if (var_new_child == NULL) { var3 = 0; /* is null */ } else { var3 = 1; /* arg is null and recv is not */ } if (var3){ ((void (*)(val*, val*))(var_new_child->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_new_child, self) /* parent= on <var_new_child:nullable ANode(ANode)>*/; /* <var_new_child:nullable ANode(ANode)> isa TKwintern */ cltype = type_parser_nodes__TKwintern.color; idtype = type_parser_nodes__TKwintern.id; if(cltype >= var_new_child->type->table_size) { var4 = 0; } else { var4 = var_new_child->type->type_table[cltype] == idtype; } if (!var4) { fprintf(stderr, "Runtime error: %s", "Assert failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11479); show_backtrace(1); } self->attrs[COLOR_parser_nodes__AAtid___n_id].val = var_new_child; /* _n_id on <self:AKwinternAtid> */ } else { fprintf(stderr, "Runtime error: %s", "Aborted"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11482); show_backtrace(1); } goto RET_LABEL; } else { } RET_LABEL:; } /* method parser_prod#AKwinternAtid#replace_child for (self: Object, ANode, nullable ANode) */ void VIRTUAL_parser_prod__AKwinternAtid__replace_child(val* self, val* p0, val* p1) { parser_prod__AKwinternAtid__replace_child(self, p0, p1); RET_LABEL:; } /* method parser_prod#AKwinternAtid#n_id= for (self: AKwinternAtid, Token) */ void parser_prod__AKwinternAtid__n_id_61d(val* self, val* p0) { val* var_node /* var node: Token */; var_node = p0; self->attrs[COLOR_parser_nodes__AAtid___n_id].val = var_node; /* _n_id on <self:AKwinternAtid> */ ((void (*)(val*, val*))(var_node->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_node, self) /* parent= on <var_node:Token>*/; RET_LABEL:; } /* method parser_prod#AKwinternAtid#n_id= for (self: Object, Token) */ void VIRTUAL_parser_prod__AKwinternAtid__n_id_61d(val* self, val* p0) { parser_prod__AKwinternAtid__n_id_61d(self, p0); RET_LABEL:; } /* method parser_prod#AKwinternAtid#visit_all for (self: AKwinternAtid, Visitor) */ void parser_prod__AKwinternAtid__visit_all(val* self, val* p0) { val* var_v /* var v: Visitor */; val* var /* : Token */; var_v = p0; var = self->attrs[COLOR_parser_nodes__AAtid___n_id].val; /* _n_id on <self:AKwinternAtid> */ if (var == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_id"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11497); show_backtrace(1); } ((void (*)(val*, val*))(var_v->class->vft[COLOR_parser_nodes__Visitor__enter_visit]))(var_v, var) /* enter_visit on <var_v:Visitor>*/; RET_LABEL:; } /* method parser_prod#AKwinternAtid#visit_all for (self: Object, Visitor) */ void VIRTUAL_parser_prod__AKwinternAtid__visit_all(val* self, val* p0) { parser_prod__AKwinternAtid__visit_all(self, p0); RET_LABEL:; } /* method parser_prod#AKwreadableAtid#empty_init for (self: AKwreadableAtid) */ void parser_prod__AKwreadableAtid__empty_init(val* self) { RET_LABEL:; } /* method parser_prod#AKwreadableAtid#empty_init for (self: Object) */ void VIRTUAL_parser_prod__AKwreadableAtid__empty_init(val* self) { parser_prod__AKwreadableAtid__empty_init(self); RET_LABEL:; } /* method parser_prod#AKwreadableAtid#init_akwreadableatid for (self: AKwreadableAtid, nullable TKwreadable) */ void parser_prod__AKwreadableAtid__init_akwreadableatid(val* self, val* p0) { val* var_n_id /* var n_id: nullable TKwreadable */; var_n_id = p0; ((void (*)(val*))(self->class->vft[COLOR_parser_prod__AKwreadableAtid__empty_init]))(self) /* empty_init on <self:AKwreadableAtid>*/; if (var_n_id == NULL) { fprintf(stderr, "Runtime error: %s", "Cast failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11508); show_backtrace(1); } self->attrs[COLOR_parser_nodes__AAtid___n_id].val = var_n_id; /* _n_id on <self:AKwreadableAtid> */ if (var_n_id == NULL) { fprintf(stderr, "Runtime error: %s", "Receiver is null"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11509); show_backtrace(1); } else { ((void (*)(val*, val*))(var_n_id->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_n_id, self) /* parent= on <var_n_id:nullable TKwreadable>*/; } RET_LABEL:; } /* method parser_prod#AKwreadableAtid#init_akwreadableatid for (self: Object, nullable TKwreadable) */ void VIRTUAL_parser_prod__AKwreadableAtid__init_akwreadableatid(val* self, val* p0) { parser_prod__AKwreadableAtid__init_akwreadableatid(self, p0); RET_LABEL:; } /* method parser_prod#AKwreadableAtid#replace_child for (self: AKwreadableAtid, ANode, nullable ANode) */ void parser_prod__AKwreadableAtid__replace_child(val* self, val* p0, val* p1) { val* var_old_child /* var old_child: ANode */; val* var_new_child /* var new_child: nullable ANode */; val* var /* : Token */; short int var1 /* : Bool */; val* var2 /* : null */; short int var3 /* : Bool */; short int var4 /* : Bool */; int cltype; int idtype; var_old_child = p0; var_new_child = p1; var = self->attrs[COLOR_parser_nodes__AAtid___n_id].val; /* _n_id on <self:AKwreadableAtid> */ if (var == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_id"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11514); show_backtrace(1); } var1 = ((short int (*)(val*, val*))(var->class->vft[COLOR_kernel__Object___61d_61d]))(var, var_old_child) /* == on <var:Token>*/; if (var1){ var2 = NULL; if (var_new_child == NULL) { var3 = 0; /* is null */ } else { var3 = 1; /* arg is null and recv is not */ } if (var3){ ((void (*)(val*, val*))(var_new_child->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_new_child, self) /* parent= on <var_new_child:nullable ANode(ANode)>*/; /* <var_new_child:nullable ANode(ANode)> isa TKwreadable */ cltype = type_parser_nodes__TKwreadable.color; idtype = type_parser_nodes__TKwreadable.id; if(cltype >= var_new_child->type->table_size) { var4 = 0; } else { var4 = var_new_child->type->type_table[cltype] == idtype; } if (!var4) { fprintf(stderr, "Runtime error: %s", "Assert failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11517); show_backtrace(1); } self->attrs[COLOR_parser_nodes__AAtid___n_id].val = var_new_child; /* _n_id on <self:AKwreadableAtid> */ } else { fprintf(stderr, "Runtime error: %s", "Aborted"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11520); show_backtrace(1); } goto RET_LABEL; } else { } RET_LABEL:; } /* method parser_prod#AKwreadableAtid#replace_child for (self: Object, ANode, nullable ANode) */ void VIRTUAL_parser_prod__AKwreadableAtid__replace_child(val* self, val* p0, val* p1) { parser_prod__AKwreadableAtid__replace_child(self, p0, p1); RET_LABEL:; } /* method parser_prod#AKwreadableAtid#n_id= for (self: AKwreadableAtid, Token) */ void parser_prod__AKwreadableAtid__n_id_61d(val* self, val* p0) { val* var_node /* var node: Token */; var_node = p0; self->attrs[COLOR_parser_nodes__AAtid___n_id].val = var_node; /* _n_id on <self:AKwreadableAtid> */ ((void (*)(val*, val*))(var_node->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_node, self) /* parent= on <var_node:Token>*/; RET_LABEL:; } /* method parser_prod#AKwreadableAtid#n_id= for (self: Object, Token) */ void VIRTUAL_parser_prod__AKwreadableAtid__n_id_61d(val* self, val* p0) { parser_prod__AKwreadableAtid__n_id_61d(self, p0); RET_LABEL:; } /* method parser_prod#AKwreadableAtid#visit_all for (self: AKwreadableAtid, Visitor) */ void parser_prod__AKwreadableAtid__visit_all(val* self, val* p0) { val* var_v /* var v: Visitor */; val* var /* : Token */; var_v = p0; var = self->attrs[COLOR_parser_nodes__AAtid___n_id].val; /* _n_id on <self:AKwreadableAtid> */ if (var == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_id"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11535); show_backtrace(1); } ((void (*)(val*, val*))(var_v->class->vft[COLOR_parser_nodes__Visitor__enter_visit]))(var_v, var) /* enter_visit on <var_v:Visitor>*/; RET_LABEL:; } /* method parser_prod#AKwreadableAtid#visit_all for (self: Object, Visitor) */ void VIRTUAL_parser_prod__AKwreadableAtid__visit_all(val* self, val* p0) { parser_prod__AKwreadableAtid__visit_all(self, p0); RET_LABEL:; } /* method parser_prod#AKwwritableAtid#empty_init for (self: AKwwritableAtid) */ void parser_prod__AKwwritableAtid__empty_init(val* self) { RET_LABEL:; } /* method parser_prod#AKwwritableAtid#empty_init for (self: Object) */ void VIRTUAL_parser_prod__AKwwritableAtid__empty_init(val* self) { parser_prod__AKwwritableAtid__empty_init(self); RET_LABEL:; } /* method parser_prod#AKwwritableAtid#init_akwwritableatid for (self: AKwwritableAtid, nullable TKwwritable) */ void parser_prod__AKwwritableAtid__init_akwwritableatid(val* self, val* p0) { val* var_n_id /* var n_id: nullable TKwwritable */; var_n_id = p0; ((void (*)(val*))(self->class->vft[COLOR_parser_prod__AKwwritableAtid__empty_init]))(self) /* empty_init on <self:AKwwritableAtid>*/; if (var_n_id == NULL) { fprintf(stderr, "Runtime error: %s", "Cast failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11546); show_backtrace(1); } self->attrs[COLOR_parser_nodes__AAtid___n_id].val = var_n_id; /* _n_id on <self:AKwwritableAtid> */ if (var_n_id == NULL) { fprintf(stderr, "Runtime error: %s", "Receiver is null"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11547); show_backtrace(1); } else { ((void (*)(val*, val*))(var_n_id->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_n_id, self) /* parent= on <var_n_id:nullable TKwwritable>*/; } RET_LABEL:; } /* method parser_prod#AKwwritableAtid#init_akwwritableatid for (self: Object, nullable TKwwritable) */ void VIRTUAL_parser_prod__AKwwritableAtid__init_akwwritableatid(val* self, val* p0) { parser_prod__AKwwritableAtid__init_akwwritableatid(self, p0); RET_LABEL:; } /* method parser_prod#AKwwritableAtid#replace_child for (self: AKwwritableAtid, ANode, nullable ANode) */ void parser_prod__AKwwritableAtid__replace_child(val* self, val* p0, val* p1) { val* var_old_child /* var old_child: ANode */; val* var_new_child /* var new_child: nullable ANode */; val* var /* : Token */; short int var1 /* : Bool */; val* var2 /* : null */; short int var3 /* : Bool */; short int var4 /* : Bool */; int cltype; int idtype; var_old_child = p0; var_new_child = p1; var = self->attrs[COLOR_parser_nodes__AAtid___n_id].val; /* _n_id on <self:AKwwritableAtid> */ if (var == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_id"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11552); show_backtrace(1); } var1 = ((short int (*)(val*, val*))(var->class->vft[COLOR_kernel__Object___61d_61d]))(var, var_old_child) /* == on <var:Token>*/; if (var1){ var2 = NULL; if (var_new_child == NULL) { var3 = 0; /* is null */ } else { var3 = 1; /* arg is null and recv is not */ } if (var3){ ((void (*)(val*, val*))(var_new_child->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_new_child, self) /* parent= on <var_new_child:nullable ANode(ANode)>*/; /* <var_new_child:nullable ANode(ANode)> isa TKwwritable */ cltype = type_parser_nodes__TKwwritable.color; idtype = type_parser_nodes__TKwwritable.id; if(cltype >= var_new_child->type->table_size) { var4 = 0; } else { var4 = var_new_child->type->type_table[cltype] == idtype; } if (!var4) { fprintf(stderr, "Runtime error: %s", "Assert failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11555); show_backtrace(1); } self->attrs[COLOR_parser_nodes__AAtid___n_id].val = var_new_child; /* _n_id on <self:AKwwritableAtid> */ } else { fprintf(stderr, "Runtime error: %s", "Aborted"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11558); show_backtrace(1); } goto RET_LABEL; } else { } RET_LABEL:; } /* method parser_prod#AKwwritableAtid#replace_child for (self: Object, ANode, nullable ANode) */ void VIRTUAL_parser_prod__AKwwritableAtid__replace_child(val* self, val* p0, val* p1) { parser_prod__AKwwritableAtid__replace_child(self, p0, p1); RET_LABEL:; } /* method parser_prod#AKwwritableAtid#n_id= for (self: AKwwritableAtid, Token) */ void parser_prod__AKwwritableAtid__n_id_61d(val* self, val* p0) { val* var_node /* var node: Token */; var_node = p0; self->attrs[COLOR_parser_nodes__AAtid___n_id].val = var_node; /* _n_id on <self:AKwwritableAtid> */ ((void (*)(val*, val*))(var_node->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_node, self) /* parent= on <var_node:Token>*/; RET_LABEL:; } /* method parser_prod#AKwwritableAtid#n_id= for (self: Object, Token) */ void VIRTUAL_parser_prod__AKwwritableAtid__n_id_61d(val* self, val* p0) { parser_prod__AKwwritableAtid__n_id_61d(self, p0); RET_LABEL:; } /* method parser_prod#AKwwritableAtid#visit_all for (self: AKwwritableAtid, Visitor) */ void parser_prod__AKwwritableAtid__visit_all(val* self, val* p0) { val* var_v /* var v: Visitor */; val* var /* : Token */; var_v = p0; var = self->attrs[COLOR_parser_nodes__AAtid___n_id].val; /* _n_id on <self:AKwwritableAtid> */ if (var == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_id"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11573); show_backtrace(1); } ((void (*)(val*, val*))(var_v->class->vft[COLOR_parser_nodes__Visitor__enter_visit]))(var_v, var) /* enter_visit on <var_v:Visitor>*/; RET_LABEL:; } /* method parser_prod#AKwwritableAtid#visit_all for (self: Object, Visitor) */ void VIRTUAL_parser_prod__AKwwritableAtid__visit_all(val* self, val* p0) { parser_prod__AKwwritableAtid__visit_all(self, p0); RET_LABEL:; } /* method parser_prod#AKwimportAtid#empty_init for (self: AKwimportAtid) */ void parser_prod__AKwimportAtid__empty_init(val* self) { RET_LABEL:; } /* method parser_prod#AKwimportAtid#empty_init for (self: Object) */ void VIRTUAL_parser_prod__AKwimportAtid__empty_init(val* self) { parser_prod__AKwimportAtid__empty_init(self); RET_LABEL:; } /* method parser_prod#AKwimportAtid#init_akwimportatid for (self: AKwimportAtid, nullable TKwimport) */ void parser_prod__AKwimportAtid__init_akwimportatid(val* self, val* p0) { val* var_n_id /* var n_id: nullable TKwimport */; var_n_id = p0; ((void (*)(val*))(self->class->vft[COLOR_parser_prod__AKwimportAtid__empty_init]))(self) /* empty_init on <self:AKwimportAtid>*/; if (var_n_id == NULL) { fprintf(stderr, "Runtime error: %s", "Cast failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11584); show_backtrace(1); } self->attrs[COLOR_parser_nodes__AAtid___n_id].val = var_n_id; /* _n_id on <self:AKwimportAtid> */ if (var_n_id == NULL) { fprintf(stderr, "Runtime error: %s", "Receiver is null"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11585); show_backtrace(1); } else { ((void (*)(val*, val*))(var_n_id->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_n_id, self) /* parent= on <var_n_id:nullable TKwimport>*/; } RET_LABEL:; } /* method parser_prod#AKwimportAtid#init_akwimportatid for (self: Object, nullable TKwimport) */ void VIRTUAL_parser_prod__AKwimportAtid__init_akwimportatid(val* self, val* p0) { parser_prod__AKwimportAtid__init_akwimportatid(self, p0); RET_LABEL:; } /* method parser_prod#AKwimportAtid#replace_child for (self: AKwimportAtid, ANode, nullable ANode) */ void parser_prod__AKwimportAtid__replace_child(val* self, val* p0, val* p1) { val* var_old_child /* var old_child: ANode */; val* var_new_child /* var new_child: nullable ANode */; val* var /* : Token */; short int var1 /* : Bool */; val* var2 /* : null */; short int var3 /* : Bool */; short int var4 /* : Bool */; int cltype; int idtype; var_old_child = p0; var_new_child = p1; var = self->attrs[COLOR_parser_nodes__AAtid___n_id].val; /* _n_id on <self:AKwimportAtid> */ if (var == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_id"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11590); show_backtrace(1); } var1 = ((short int (*)(val*, val*))(var->class->vft[COLOR_kernel__Object___61d_61d]))(var, var_old_child) /* == on <var:Token>*/; if (var1){ var2 = NULL; if (var_new_child == NULL) { var3 = 0; /* is null */ } else { var3 = 1; /* arg is null and recv is not */ } if (var3){ ((void (*)(val*, val*))(var_new_child->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_new_child, self) /* parent= on <var_new_child:nullable ANode(ANode)>*/; /* <var_new_child:nullable ANode(ANode)> isa TKwimport */ cltype = type_parser_nodes__TKwimport.color; idtype = type_parser_nodes__TKwimport.id; if(cltype >= var_new_child->type->table_size) { var4 = 0; } else { var4 = var_new_child->type->type_table[cltype] == idtype; } if (!var4) { fprintf(stderr, "Runtime error: %s", "Assert failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11593); show_backtrace(1); } self->attrs[COLOR_parser_nodes__AAtid___n_id].val = var_new_child; /* _n_id on <self:AKwimportAtid> */ } else { fprintf(stderr, "Runtime error: %s", "Aborted"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11596); show_backtrace(1); } goto RET_LABEL; } else { } RET_LABEL:; } /* method parser_prod#AKwimportAtid#replace_child for (self: Object, ANode, nullable ANode) */ void VIRTUAL_parser_prod__AKwimportAtid__replace_child(val* self, val* p0, val* p1) { parser_prod__AKwimportAtid__replace_child(self, p0, p1); RET_LABEL:; } /* method parser_prod#AKwimportAtid#n_id= for (self: AKwimportAtid, Token) */ void parser_prod__AKwimportAtid__n_id_61d(val* self, val* p0) { val* var_node /* var node: Token */; var_node = p0; self->attrs[COLOR_parser_nodes__AAtid___n_id].val = var_node; /* _n_id on <self:AKwimportAtid> */ ((void (*)(val*, val*))(var_node->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_node, self) /* parent= on <var_node:Token>*/; RET_LABEL:; } /* method parser_prod#AKwimportAtid#n_id= for (self: Object, Token) */ void VIRTUAL_parser_prod__AKwimportAtid__n_id_61d(val* self, val* p0) { parser_prod__AKwimportAtid__n_id_61d(self, p0); RET_LABEL:; } /* method parser_prod#AKwimportAtid#visit_all for (self: AKwimportAtid, Visitor) */ void parser_prod__AKwimportAtid__visit_all(val* self, val* p0) { val* var_v /* var v: Visitor */; val* var /* : Token */; var_v = p0; var = self->attrs[COLOR_parser_nodes__AAtid___n_id].val; /* _n_id on <self:AKwimportAtid> */ if (var == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_id"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11611); show_backtrace(1); } ((void (*)(val*, val*))(var_v->class->vft[COLOR_parser_nodes__Visitor__enter_visit]))(var_v, var) /* enter_visit on <var_v:Visitor>*/; RET_LABEL:; } /* method parser_prod#AKwimportAtid#visit_all for (self: Object, Visitor) */ void VIRTUAL_parser_prod__AKwimportAtid__visit_all(val* self, val* p0) { parser_prod__AKwimportAtid__visit_all(self, p0); RET_LABEL:; } /* method parser_prod#Start#replace_child for (self: Start, ANode, nullable ANode) */ void parser_prod__Start__replace_child(val* self, val* p0, val* p1) { val* var_old_child /* var old_child: ANode */; val* var_new_child /* var new_child: nullable ANode */; val* var /* : nullable AModule */; short int var1 /* : Bool */; val* var2 /* : null */; short int var3 /* : Bool */; short int var4 /* : Bool */; int cltype; int idtype; val* var5 /* : null */; var_old_child = p0; var_new_child = p1; var = self->attrs[COLOR_parser_nodes__Start___n_base].val; /* _n_base on <self:Start> */ if (var == NULL) { var1 = 0; /* <var_old_child:ANode> cannot be null */ } else { var1 = ((short int (*)(val*, val*))(var->class->vft[COLOR_kernel__Object___61d_61d]))(var, var_old_child) /* == on <var:nullable AModule>*/; } if (var1){ var2 = NULL; if (var_new_child == NULL) { var3 = 1; /* is null */ } else { var3 = 0; /* arg is null but recv is not */ } if (var3){ } else { ((void (*)(val*, val*))(var_new_child->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_new_child, self) /* parent= on <var_new_child:nullable ANode(ANode)>*/; /* <var_new_child:nullable ANode(ANode)> isa AModule */ cltype = type_parser_nodes__AModule.color; idtype = type_parser_nodes__AModule.id; if(cltype >= var_new_child->type->table_size) { var4 = 0; } else { var4 = var_new_child->type->type_table[cltype] == idtype; } if (!var4) { fprintf(stderr, "Runtime error: %s", "Assert failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11622); show_backtrace(1); } self->attrs[COLOR_parser_nodes__Start___n_base].val = var_new_child; /* _n_base on <self:Start> */ } var5 = NULL; ((void (*)(val*, val*))(var_old_child->class->vft[COLOR_parser_nodes__ANode__parent_61d]))(var_old_child, var5) /* parent= on <var_old_child:ANode>*/; goto RET_LABEL; } else { } RET_LABEL:; } /* method parser_prod#Start#replace_child for (self: Object, ANode, nullable ANode) */ void VIRTUAL_parser_prod__Start__replace_child(val* self, val* p0, val* p1) { parser_prod__Start__replace_child(self, p0, p1); RET_LABEL:; } /* method parser_prod#Start#visit_all for (self: Start, Visitor) */ void parser_prod__Start__visit_all(val* self, val* p0) { val* var_v /* var v: Visitor */; val* var /* : nullable AModule */; val* var1 /* : null */; short int var2 /* : Bool */; val* var3 /* : nullable AModule */; val* var4 /* : EOF */; var_v = p0; var = self->attrs[COLOR_parser_nodes__Start___n_base].val; /* _n_base on <self:Start> */ var1 = NULL; if (var == NULL) { var2 = 0; /* is null */ } else { var2 = 1; /* arg is null and recv is not */ } if (var2){ var3 = self->attrs[COLOR_parser_nodes__Start___n_base].val; /* _n_base on <self:Start> */ if (var3 == NULL) { fprintf(stderr, "Runtime error: %s", "Cast failed"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11633); show_backtrace(1); } ((void (*)(val*, val*))(var_v->class->vft[COLOR_parser_nodes__Visitor__enter_visit]))(var_v, var3) /* enter_visit on <var_v:Visitor>*/; } else { } var4 = self->attrs[COLOR_parser_nodes__Start___n_eof].val; /* _n_eof on <self:Start> */ if (var4 == NULL) { fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _n_eof"); fprintf(stderr, " (%s:%d)\n", "src/parser/parser_prod.nit", 11635); show_backtrace(1); } ((void (*)(val*, val*))(var_v->class->vft[COLOR_parser_nodes__Visitor__enter_visit]))(var_v, var4) /* enter_visit on <var_v:Visitor>*/; RET_LABEL:; } /* method parser_prod#Start#visit_all for (self: Object, Visitor) */ void VIRTUAL_parser_prod__Start__visit_all(val* self, val* p0) { parser_prod__Start__visit_all(self, p0); RET_LABEL:; }
{ "content_hash": "4906c353742398196c1db319039949b2", "timestamp": "", "source": "github", "line_count": 4889, "max_line_length": 208, "avg_line_length": 42.96400081816322, "alnum_prop": 0.6689375437393775, "repo_name": "fourou/nit", "id": "d47b0a77f56efa37488e3f3709dba48d8848888b", "size": "210051", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "c_src/parser_prod.sep.5.c", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Assembly", "bytes": "8153" }, { "name": "Awk", "bytes": "42973" }, { "name": "C", "bytes": "33884733" }, { "name": "C++", "bytes": "123561" }, { "name": "CSS", "bytes": "22989" }, { "name": "Java", "bytes": "1508" }, { "name": "JavaScript", "bytes": "114993" }, { "name": "Objective-C", "bytes": "691236" }, { "name": "Perl", "bytes": "21800" }, { "name": "Shell", "bytes": "407217" }, { "name": "TeX", "bytes": "162451" }, { "name": "VimL", "bytes": "12388" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <LinearLayout android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:padding="16dp"> <!--<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/aboutTitle" android:textColor="@android:color/black" android:textStyle="bold" android:textSize="18sp" android:layout_marginBottom="10dp"/>--> <TextView android:id="@+id/version" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="0.0" android:textColor="@color/app_purple" android:textSize="18sp" android:layout_marginBottom="30dp"/> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/aboutBody" android:textColor="@android:color/black" android:textSize="18sp"/> </LinearLayout> </ScrollView>
{ "content_hash": "d4a50d880cabd69d41665a1f65cd7d11", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 70, "avg_line_length": 34.92307692307692, "alnum_prop": 0.5814977973568282, "repo_name": "casific/murmur", "id": "a0ad2474ffbe25b5fb85598a95dc13b18ac89d6f", "size": "1362", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/main/res/layout/info_fragment.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "1245373" }, { "name": "Protocol Buffer", "bytes": "11956" }, { "name": "Python", "bytes": "932" }, { "name": "Shell", "bytes": "77" } ], "symlink_target": "" }
<?php namespace Rexmac\Zyndax\View\Helper; use \Zend_Registry; /** * Helper class for generating CSS class names for body element * * @category Zyndax * @package Rexmac_Zyndax * @subpackage View_Helper * @copyright Copyright (c) 2011-2012 Rex McConnell (http://rexmac.com/) * @license http://rexmac.com/license/bsd2c.txt Modified BSD License * @author Rex McConnell <rex@rexmac.com> */ class BodyClass extends \Zend_View_Helper_Abstract { /** * Helper method to generate CSS class names for <body> * * @return string */ public function bodyClass() { if($this->view) { $class = array(); $acl = Zend_Registry::get('acl'); $userCanViewAdmin = $acl->isUserAllowed('mvc:admin', 'view'); if($page = $this->view->navigation()->findActive($this->view->navigation()->getContainer())) { $module = $page['page']->getModule(); if($userCanViewAdmin && $module === 'default') $module = 'admin'; $class[] = $module; $class[] = $page['page']->getController(); $class[] = $page['page']->getAction(); } return implode(' ', $class); } } }
{ "content_hash": "8b9864fe9a90eda55d9f9ebd8c207dcf", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 100, "avg_line_length": 27.428571428571427, "alnum_prop": 0.6067708333333334, "repo_name": "rexmac/zyndax", "id": "71f316831e398d1c18214844e21ef0c2fa956d8a", "size": "1871", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "library/Rexmac/Zyndax/View/Helper/BodyClass.php", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "CSS", "bytes": "310927" }, { "name": "JavaScript", "bytes": "473482" }, { "name": "PHP", "bytes": "680869" } ], "symlink_target": "" }
layout: default title: Blog --- <div class="well"> <div class="list-group"> {% for post in paginator.posts %} <div class="list-group-item"> <div class="row-action-primary"> <i class="fa fa-sticky-note"></i> </div> <div class="row-content"> <div class="least-content">{{ post.date | date_to_string }}</div> <h4 class="list-group-item-heading"><a href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a></h4> <p class="list-group-item-text">{{ post.content | strip_html | truncatewords: 20 }}</p> </div> </div> <div class="list-group-separator"></div> {% endfor %} </div> <!-- Pagination links --> {% if paginator.total_pages > 1 %} <ul class="pager"> {% if paginator.previous_page %} <li class="previous"> <a href="{{ paginator.previous_page_path | prepend: site.baseurl | replace: '//', '/' }}">&laquo;</a> </li> {% else %} <li class="previous disabled"><span aria-hidden="true">&laquo;</span></li> {% endif %} <li><a href="/">First</a></li> {% for page in (1..paginator.total_pages) %} {% if page == paginator.page %} <li class="active"> <a>{{ page }}<span class="sr-only">(current)</span></a> </li> {% elsif page == 1 %} <li><a href="/">{{ page }}</a></li> {% else %} <li> <a href="{{ site.paginate_path | prepend: site.baseurl | replace: '//', '/' | replace: ':num', page }}">{{ page }}</a> </li> {% endif %} {% endfor %} <li><a href="/page{{ paginator.total_pages }}/">Last</a></li> {% if paginator.next_page %} <li class="next"> <a href="{{ paginator.next_page_path | prepend: site.baseurl | replace: '//', '/' }}">&raquo;</a> </li> {% else %} <li class="next disabled"><span>&raquo;</span></li> {% endif %} </ul> {% endif %}
{ "content_hash": "3258be5b1ebcde60b00af57752b2ecd2", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 130, "avg_line_length": 33.01639344262295, "alnum_prop": 0.487090367428004, "repo_name": "apccurtiss/apccurtiss.github.com", "id": "18ea8bd18a687270c9bf115a6406c932c3598dee", "size": "2018", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "blog/index.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "25090" }, { "name": "HTML", "bytes": "22208" }, { "name": "JavaScript", "bytes": "6778" } ], "symlink_target": "" }
SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
{ "content_hash": "3786b682c8a49b717ce7d98c89f7c577", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 10.23076923076923, "alnum_prop": 0.6917293233082706, "repo_name": "mdoering/backbone", "id": "7507c3a559da960dd78e11f1bb6876a87b8985cf", "size": "200", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Liliopsida/Asparagales/Orchidaceae/Bulbophyllum/Bulbophyllum tectipetalum/ Syn. Bulbophyllum tectipetalum longisepalum/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
''' This example shows training of the POS tagger without the Language class, showing the APIs of the atomic components. This example was adapted from the gist here: https://gist.github.com/kamac/a7bc139f62488839a8118214a4d932f2 Issue discussing the gist: https://github.com/explosion/spaCy/issues/1179 The example was written for spaCy 1.8.2. ''' from __future__ import unicode_literals from __future__ import print_function import plac import codecs import spacy.symbols as symbols import spacy from pathlib import Path from spacy.vocab import Vocab from spacy.tagger import Tagger from spacy.tokens import Doc from spacy.gold import GoldParse from spacy.language import Language from spacy import orth from spacy import attrs import random TAG_MAP = { 'ADJ': {symbols.POS: symbols.ADJ}, 'ADP': {symbols.POS: symbols.ADP}, 'PUNCT': {symbols.POS: symbols.PUNCT}, 'ADV': {symbols.POS: symbols.ADV}, 'AUX': {symbols.POS: symbols.AUX}, 'SYM': {symbols.POS: symbols.SYM}, 'INTJ': {symbols.POS: symbols.INTJ}, 'CCONJ': {symbols.POS: symbols.CCONJ}, 'X': {symbols.POS: symbols.X}, 'NOUN': {symbols.POS: symbols.NOUN}, 'DET': {symbols.POS: symbols.DET}, 'PROPN': {symbols.POS: symbols.PROPN}, 'NUM': {symbols.POS: symbols.NUM}, 'VERB': {symbols.POS: symbols.VERB}, 'PART': {symbols.POS: symbols.PART}, 'PRON': {symbols.POS: symbols.PRON}, 'SCONJ': {symbols.POS: symbols.SCONJ}, } LEX_ATTR_GETTERS = { attrs.LOWER: lambda string: string.lower(), attrs.NORM: lambda string: string, attrs.SHAPE: orth.word_shape, attrs.PREFIX: lambda string: string[0], attrs.SUFFIX: lambda string: string[-3:], attrs.CLUSTER: lambda string: 0, attrs.IS_ALPHA: orth.is_alpha, attrs.IS_ASCII: orth.is_ascii, attrs.IS_DIGIT: lambda string: string.isdigit(), attrs.IS_LOWER: orth.is_lower, attrs.IS_PUNCT: orth.is_punct, attrs.IS_SPACE: lambda string: string.isspace(), attrs.IS_TITLE: orth.is_title, attrs.IS_UPPER: orth.is_upper, attrs.IS_BRACKET: orth.is_bracket, attrs.IS_QUOTE: orth.is_quote, attrs.IS_LEFT_PUNCT: orth.is_left_punct, attrs.IS_RIGHT_PUNCT: orth.is_right_punct, attrs.LIKE_URL: orth.like_url, attrs.LIKE_NUM: orth.like_number, attrs.LIKE_EMAIL: orth.like_email, attrs.IS_STOP: lambda string: False, attrs.IS_OOV: lambda string: True } def read_ud_data(path): data = [] last_number = -1 sentence_words = [] sentence_tags = [] with codecs.open(path, encoding="utf-8") as f: while True: line = f.readline() if not line: break if line[0].isdigit(): d = line.split() if not "-" in d[0]: number = int(line[0]) if number < last_number: data.append((sentence_words, sentence_tags),) sentence_words = [] sentence_tags = [] sentence_words.append(d[2]) sentence_tags.append(d[3]) last_number = number if len(sentence_words) > 0: data.append((sentence_words, sentence_tags,)) return data def ensure_dir(path): if not path.exists(): path.mkdir() def main(train_loc, dev_loc, output_dir=None): if output_dir is not None: output_dir = Path(output_dir) ensure_dir(output_dir) ensure_dir(output_dir / "pos") ensure_dir(output_dir / "vocab") train_data = read_ud_data(train_loc) vocab = Vocab(tag_map=TAG_MAP, lex_attr_getters=LEX_ATTR_GETTERS) # Populate vocab for words, _ in train_data: for word in words: _ = vocab[word] model = spacy.tagger.TaggerModel(spacy.tagger.Tagger.feature_templates) tagger = Tagger(vocab, model) print(tagger.tag_names) for i in range(30): print("training model (iteration " + str(i) + ")...") score = 0. num_samples = 0. for words, tags in train_data: doc = Doc(vocab, words=words) gold = GoldParse(doc, tags=tags) cost = tagger.update(doc, gold) for i, word in enumerate(doc): num_samples += 1 if word.tag_ == tags[i]: score += 1 print('Train acc', score/num_samples) random.shuffle(train_data) tagger.model.end_training() score = 0.0 test_data = read_ud_data(dev_loc) num_samples = 0 for words, tags in test_data: doc = Doc(vocab, words) tagger(doc) for i, word in enumerate(doc): num_samples += 1 if word.tag_ == tags[i]: score += 1 print("score: " + str(score / num_samples * 100.0)) if output_dir is not None: tagger.model.dump(str(output_dir / 'pos' / 'model')) with (output_dir / 'vocab' / 'strings.json').open('w') as file_: tagger.vocab.strings.dump(file_) if __name__ == '__main__': plac.call(main)
{ "content_hash": "4df6f9557c1640ef7c91f254e409943f", "timestamp": "", "source": "github", "line_count": 164, "max_line_length": 75, "avg_line_length": 30.951219512195124, "alnum_prop": 0.5986997635933806, "repo_name": "raphael0202/spaCy", "id": "ce1ab50d6406a46b19273ddfbd81dd9ff248d9cf", "size": "5076", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "examples/training/train_tagger_standalone_ud.py", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "237446" }, { "name": "C++", "bytes": "26995" }, { "name": "CSS", "bytes": "29678" }, { "name": "HTML", "bytes": "286438" }, { "name": "JavaScript", "bytes": "880" }, { "name": "Objective-C", "bytes": "567" }, { "name": "Python", "bytes": "2537585" }, { "name": "Shell", "bytes": "753" } ], "symlink_target": "" }
.. _adding_release_notes: Release Notes ============= What are release notes? ~~~~~~~~~~~~~~~~~~~~~~~ Release notes are important for change management within manila. Since manila follows a release cycle with milestones, release notes provide a way for the community and users to quickly grasp what changes occurred within a development milestone. To the OpenStack release management and documentation teams, release notes are a way to compile changes per milestone. These notes are published on the `OpenStack Releases website <http://releases.openstack.org>`_. Automated tooling is built around ``releasenotes`` and they get appropriately handled per release milestone, including any back-ports to stable releases. What needs a release note? ~~~~~~~~~~~~~~~~~~~~~~~~~~ * Changes that impact an upgrade, most importantly, those that require a deployer to take some action while upgrading * API changes * New APIs * Changes to the response schema of existing APIs * Changes to request/response headers * Non-trivial API changes such as response code changes from 2xx to 4xx * Deprecation of APIs or response fields * Removal of APIs * A new feature is implemented, such as a new core feature in manila, driver support for an existing manila feature or a new driver * An existing feature is deprecated * An existing feature is removed * Behavior of an existing feature has changed in a discernible way to an end user or administrator * Backend driver interface changes * A security bug is fixed * New configuration option is added What does not need a release note? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * A code change that doesn't change the general behavior of any feature such as code refactor or logging changes. One case of this could be the exercise that all drivers went through by removing ``allow_access`` and ``deny_access`` interfaces in favor of an ``update_access`` interface as suggested in the Mitaka release. * Tempest or unit test coverage enhancement * Changes to response message with API failure codes 4xx and 5xx * Any change submitted with a justified TrivialFix flag added in the commit message * Adding or changing documentation within in-tree documentation guides How do I add a release note? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ We use `Reno <https://docs.openstack.org/reno/latest/>`_ to create and manage release notes. The new subcommand combines a random suffix with a "slug" value to make the new file with a unique name that is easy to identify again later. To create a release note for your change, use: .. code-block:: console $ reno new slug-goes-here If reno is not installed globally on your system, you can use a tox environment in manila: .. code-block:: console $ tox -e newnote slug-goes-here .. note:: When you are adding a bug-fix reno, name your file using the template: "bug-<launchpad-bug-id>-slug-goes-here". Then add the notes in ``yaml`` format in the file created. Pay attention to the type of section. The following are general sections to use: prelude General comments about the change. The prelude from all notes in a release are combined, in note order, to produce a single prelude introducing the release. features New features introduced issues A list of known issues with respect to the change being introduced. For example, if the new feature in the change is experimental or known to not work in some cases, it should be mentioned here. upgrade A list of upgrade notes in the release. Any removals that affect upgrades are to be noted here. deprecations Any features, APIs, configuration options that the change has deprecated. Deprecations are not removals. Deprecations suggest that there will be support for a certain timeline. Deprecation should allow time for users to make necessary changes for the removal to happen in a future release. It is important to note the timeline of deprecation in this section. critical A list of *fixed* critical bugs (descriptions only). security A list of *fixed* security issues (descriptions only). fixes A list of other *fixed* bugs (descriptions only). other Other notes that are important but do not fall into any of the given categories. :: --- prelude: > Replace this text with content to appear at the top of the section for this change. features: - List new features here, or remove this section. issues: - List known issues here, or remove this section. upgrade: - List upgrade notes here, or remove this section. deprecations: - List deprecation notes here, or remove this section critical: - Add critical notes here, or remove this section. security: - Add security notes here, or remove this section. fixes: - Add normal bug fixes here, or remove this section. other: - Add other notes here, or remove this section. Dos and Don'ts ~~~~~~~~~~~~~~ * Release notes need to be succinct. Short and unambiguous descriptions are preferred * Write in past tense, unless you are writing an imperative statement * Do not have blank sections in the file * Do not include code or links * Avoid special rst formatting unless absolutely necessary * Always prefer including a release note in the same patch * Release notes are not a replacement for developer/user/admin documentation * Release notes are not a way of conveying behavior of any features or usage of any APIs * Limit a release note to fewer than 2-3 lines per change per section * OpenStack prefers atomic changes. So remember that your change may need the fewest sections possible * General writing guidelines can be found `here <https://docs.openstack .org/doc-contrib-guide/writing-style/general-writing-guidelines.html>`_ * Proofread your note. Pretend you are a user or a deployer who is reading the note after a milestone or a release has been cut Examples ~~~~~~~~ The following need only be considered as directions for formatting. They are **not** fixes or features in manila. * *fix-failing-automount-23aef89a7e98c8.yaml* .. code-block:: yaml --- deprecations: - displaying mount options via the array listing API is deprecated. fixes: - users can mount shares on debian systems with kernel version 32.2.41.* with share-mount API * *add-librsync-backup-plugin-for-m-bkup-41cad17c1498a3.yaml* .. code-block:: yaml --- features: - librsync support added for NFS incremental backup upgrade: - Copy new rootwrap.d/librsync.filters file into /etc/manila/rootwrap.d directory. issues: - librsync has not been tested thoroughly in all operating systems that manila is qualified for. m-bkup is an experimental feature.
{ "content_hash": "001b3ae35d52e8d6f38daf2016deb721", "timestamp": "", "source": "github", "line_count": 203, "max_line_length": 79, "avg_line_length": 33.34975369458128, "alnum_prop": 0.7376661742983752, "repo_name": "openstack/manila", "id": "af675cf2d38c8f115e0266f60b7f5b628f1b3418", "size": "6770", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "doc/source/contributor/adding_release_notes.rst", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Mako", "bytes": "953" }, { "name": "Python", "bytes": "12728998" }, { "name": "Shell", "bytes": "107601" } ], "symlink_target": "" }
<form model="ecom.cart"> <head> <field name="state"/> <button string="Print" icon="print" action="report_cart_form"/> <button string="Options" dropdown="1"> <item string="Auto Apply Promotions" method="auto_apply_promotions"/> <item string="Calculate Shipping" method="calc_shipping"/> <item string="Copy" method="copy"/> <item string="Copy To Contact" method="copy_to_contact"/> <item string="Copy To Sales Order" method="copy_to_sale"/> <item string="Cancel Order" method="ecom_cancel_cart"/> <divider/> <item string="Import Paypal Payment" method="import_paypal_payment"/> <item string="Import Paysbuy Payment" method="import_paysbuy_payment"/> <item string="Import SCB Payment" method="import_scb_payment"/> </button> </head> <tabs> <tab string="General"> <group form_layout="stacked"> <field name="number" span="2"/> <field name="website_id" span="2"/> <field name="pricelist_id" span="2"/> <field name="user_id" span="2"/> <field name="contact_id" span="2"/> <newline/> <field name="date_created" span="2"/> <field name="date_confirmed" span="2"/> </group> <separator string="Items"/> <field name="lines" nolabel="1"> <list> <field name="sequence"/> <field name="product_id"/> <field name="description"/> <field name="qty"/> <field name="unit_price"/> <field name="discount_percent"/> <field name="discount_amount"/> <field name="promotion_amount"/> <field name="special_price"/> <field name="amount_before_discount"/> <field name="amount"/> <field name="ship_method_id"/> </list> </field> <group offset="8" span="4" columns="1"> <field name="amount_subtotal"/> <field name="amount_ship"/> <field name="amount_discount"/> <field name="amount_total"/> </group> </tab> <tab string="Promotions"> <separator string="Promotions"/> <field name="used_promotions" nolabel="1"> <list> <field name="promotion_id"/> <field name="cond_product_id"/> <field name="cond_qty"/> <field name="product_id"/> <field name="qty"/> <field name="percent"/> <field name="amount"/> </list> </field> </tab> <tab string="Customer Details"> <field name="email"/> <field name="tax_no"/> <field name="tax_branch_no"/> <field name="ip_addr"/> <newline/> <group span="6" columns="1"> <separator string="Billing Address"/> <field name="bill_first_name"/> <field name="bill_last_name"/> <field name="bill_company"/> <field name="bill_address"/> <field name="bill_address2"/> <field name="bill_city"/> <field name="bill_country_id"/> <field name="bill_district_id"/> <field name="bill_subdistrict_id"/> <field name="bill_postal_code"/> <field name="bill_phone"/> <field name="ship_to_bill"/> </group> <group span="6" columns="1"> <separator string="Shipping Address"/> <field name="ship_first_name"/> <field name="ship_last_name"/> <field name="ship_company"/> <field name="ship_address"/> <field name="ship_address2"/> <field name="ship_city"/> <field name="ship_country_id"/> <field name="ship_district_id"/> <field name="ship_subdistrict_id"/> <field name="ship_postal_code"/> <field name="ship_phone"/> </group> </tab> <tab string="Payment"> <field name="pay_method_id"/> <field name="payment_ref"/> <field name="payment_notes"/> <field name="payment_checked"/> </tab> </tabs> <related> <field name="sale_orders"/> <field name="payments"/> <field name="emails"/> <field name="related_comments"/> <field name="documents"> <list> <field name="file" target="_blank" preview="1"/> <field name="categ_id"/> <field name="description"/> <field name="date"/> </list> <form> <field name="file" target="_blank" onchange="onchange_file"/> <field name="categ_id"/> <field name="date"/> <field name="description"/> <field name="contact_id" invisible="1"/> </form> </field> </related> </form>
{ "content_hash": "68c40e035743ffa53d4ffe362c7d3e22", "timestamp": "", "source": "github", "line_count": 132, "max_line_length": 84, "avg_line_length": 41.28030303030303, "alnum_prop": 0.45898329968801616, "repo_name": "sidzan/netforce", "id": "45594c5fa16d1c4fd1264d5f5937901d82384c0e", "size": "5449", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "netforce_ecom/netforce_ecom/layouts/cart_form.xml", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "248732" }, { "name": "HTML", "bytes": "543196" }, { "name": "Java", "bytes": "11870" }, { "name": "JavaScript", "bytes": "3659528" }, { "name": "Makefile", "bytes": "353" }, { "name": "PHP", "bytes": "2274" }, { "name": "Python", "bytes": "3263548" }, { "name": "Shell", "bytes": "117" } ], "symlink_target": "" }
require "litecable" require "anycable" # Sample chat application module Chat class Connection < LiteCable::Connection::Base # :nodoc: identified_by :user, :sid def connect self.user = cookies["user"] self.sid = request.params["sid"] reject_unauthorized_connection unless user $stdout.puts "#{user} connected" end def disconnect $stdout.puts "#{user} disconnected" end end class Channel < LiteCable::Channel::Base # :nodoc: identifier :chat def subscribed reject unless chat_id stream_from "chat_#{chat_id}" end def speak(data) LiteCable.broadcast "chat_#{chat_id}", user: user, message: data["message"], sid: sid end private def chat_id params.fetch("id") end end end
{ "content_hash": "18fb775ff934d0cc0ea3328b5a850713", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 91, "avg_line_length": 20.256410256410255, "alnum_prop": 0.6367088607594936, "repo_name": "palkan/litecable", "id": "8ea2c1e3c4bb4473fbf2b5a07264821e651a0278", "size": "821", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "examples/sinatra/chat.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "62460" }, { "name": "Shell", "bytes": "131" } ], "symlink_target": "" }
layout: post title: Never Read The Comments date: 2016-05-16 tags: - Jekyll - Firebase - NoSQL - BlogOps --- As a fun little project I started playing around with [Firebase](https://www.firebase.com/) and this Jekyll blog. In a move I hope to not live to regret, I made it possible to submit comments! <!-- more --> > *Update (December 2016): Retired (aka nuked) the code shown in this tutorial from my blog. As much fun as it was to over-engineering a comments section in Jekyll, it's time to retire the seldomn used (if ever) comments section. Incidentally, the tutorial led me to learn how to use Google's reCAPTCHA and Liquid templating which was fun. <br/> Lastly, due to Google's aquisition of Firebase shortly after this post was published, I was able to painlessly transfer the database from the legacy servers to the shiny new Material Design interface at [Firebase Console](https://console.firebase.google.com/)* Folks who have pertinent and kind comments can scroll to the bottom of a post and enter a name, message, and an optional email for a Gravatar image. Isn't that nice? I used part 3 of an article from CSS-Tricks[^fn-1], so if you're curious, go ahead and follow those directions. The only tricky part was configuring the security rules. If I get hit with lots of spam, I will need to take corrective steps, but for now the only validation that is done is checking for the presence of a name and a message. Firebase is really cool, fast and well documented. I am loving the realtime NoSQL cloud database which stores data as familiar JSON objects. For a simple blog it does seem to be a bit overkill, but I just love to over-engineer this lil' blog to bits. Got feedback? Leave a comment, bub. Or, you know, just reach out to me on Twitter or email. [^fn-1]: [Building a Jekyll Site – Part 3 of 3: Creating a Firebase-Backed Commenting System](https://css-tricks.com/building-a-jekyll-site-part-3-of-3/)
{ "content_hash": "a1953d21396789f0ab072b904496d176", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 345, "avg_line_length": 69.32142857142857, "alnum_prop": 0.7614631633178773, "repo_name": "nchristiny/nchristiny.github.io", "id": "c7ac0350d5ebd84416678fd503ff1acdf634b6ee", "size": "1947", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "_posts/2016-05-16-never-read-the-comments.md", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "32298" }, { "name": "JavaScript", "bytes": "4746" }, { "name": "Ruby", "bytes": "424" }, { "name": "SCSS", "bytes": "22877" } ], "symlink_target": "" }
using JohnLambe.Util.Diagnostic; using Microsoft.VisualStudio.TestTools.UnitTesting; using System; using System.Collections.Generic; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; namespace JohnLambe.Tests.JLUtilsTest.Diagnostic { [TestClass] public class DiagnosticStringUtilTest { #region ObjectToString [TestMethod] public void ObjectToString_Struct() { object p = new Point(50, 10); Assert.AreEqual("System.Drawing.Point(IsEmpty=False X=50 Y=10)", DiagnosticStringUtil.ObjectToString(p)); } [TestMethod] public void ObjectToString_Primitive() { int x = 100; Assert.AreEqual("Int32(100)", DiagnosticStringUtil.ObjectToString(x)); } [TestMethod] public void ObjectToString_Null() { System.ArgumentException x = null; Assert.AreEqual("System.ArgumentException(null)", DiagnosticStringUtil.ObjectToString(x)); } [TestMethod] public void ObjectToString_AnonymousClass() { var x = new { Property1 = 50, Property2 = "string" }; Assert.AreEqual("(Property1=50 Property2=string)", DiagnosticStringUtil.ObjectToString(x)); } /// <summary> /// The getter of a property of the given instance throws an exception. /// </summary> [TestMethod] public void ObjectToString_Exception() { object p = new TestClass() { X = 12345 }; Assert.AreEqual("JohnLambe.Tests.JLUtilsTest.Diagnostic.DiagnosticStringUtilTest+TestClass(X=12345 Y=<" + new ArgumentException().Message + ">)", DiagnosticStringUtil.ObjectToString(p)); } /// <summary> /// null nullable primitive type. /// </summary> [TestMethod] public void ObjectToString_NullablePrimitive() { float? p = null; Assert.AreEqual("Single?(null)", DiagnosticStringUtil.ObjectToString(p)); } public class TestClass { public int X { get; set; } public int Y { get { throw new ArgumentException(); } } } #endregion } }
{ "content_hash": "89a94d6e911d882c8a389fb6e132ae6e", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 117, "avg_line_length": 27.261363636363637, "alnum_prop": 0.5727386411004586, "repo_name": "JohnLambe/JLCSUtils", "id": "06d9536426656c57041a10940cf504b8dd4cfc7e", "size": "2401", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "JLCSUtils/JLUtilsTest/Diagnostic/DiagnosticStringUtilTest.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "2651368" } ], "symlink_target": "" }
<?php namespace Tests\Unit\WindowsAzure\Common\Internal\Filters; use WindowsAzure\Common\Internal\Filters\ExponentialRetryPolicy; /** * Unit tests for class ExponentialRetryPolicy * * @category Microsoft * @package Tests\Unit\WindowsAzure\Common\Internal\Filters * @author Azure PHP SDK <azurephpsdk@microsoft.com> * @copyright 2012 Microsoft Corporation * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @version Release: 0.4.0_2014-01 * @link https://github.com/windowsazure/azure-sdk-for-php */ class ExponentialRetryPolicyTest extends \PHPUnit_Framework_TestCase { /** * @covers WindowsAzure\Common\Internal\Filters\ExponentialRetryPolicy::__construct */ public function test__construct() { // Setup $expectedRetryableStatusCodes = array(200, 201); // Test $actual = new ExponentialRetryPolicy($expectedRetryableStatusCodes); // Assert $this->assertNotNull($actual); return $actual; } /** * @covers WindowsAzure\Common\Internal\Filters\ExponentialRetryPolicy::shouldRetry * @depends test__construct */ public function testShouldRetryFalse($retryPolicy) { // Setup $expected = false; // Test $actual = $retryPolicy->shouldRetry(1000, null); // Assert $this->assertEquals($expected, $actual); } /** * @covers WindowsAzure\Common\Internal\Filters\ExponentialRetryPolicy::calculateBackoff * @depends test__construct */ public function testCalculateBackoff($retryPolicy) { // Test $actual = $retryPolicy->calculateBackoff(2, null); // Assert $this->assertTrue(is_integer($actual)); } }
{ "content_hash": "941b0a8c13b41e26a5807f6ae30ab7fa", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 92, "avg_line_length": 26.652173913043477, "alnum_prop": 0.6356715606307776, "repo_name": "jdruid/Microsoft-Azure-PHP-SDK-Storage", "id": "8ac79cf5b067d671ca4abaa72dcf359a60d13909", "size": "2751", "binary": false, "copies": "9", "ref": "refs/heads/master", "path": "vendor/microsoft/windowsazure/tests/unit/WindowsAzure/Common/Internal/Filters/ExponentialRetryPolicyTest.php", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "PHP", "bytes": "22195" } ], "symlink_target": "" }
#ifndef OSMIUM_MEMORY_CALLBACK_BUFFER_HPP #define OSMIUM_MEMORY_CALLBACK_BUFFER_HPP #include <osmium/memory/buffer.hpp> #include <cstddef> #include <functional> #include <utility> namespace osmium { namespace memory { /** * This is basically a wrapper around osmium::memory::Buffer with an * additional callback function that is called whenever the buffer is * full. * * The internal buffer is created with the `initial_buffer_size` set * in the constructor. When it grows beyond the `max_buffer_size` set * in the constructor, the callback function is called with the buffer * and a new, empty buffer is created internally. * * Note that the buffer can grow beyond the initial buffer size if * needed. This can happen if a new object doesn't fit into the rest * of the buffer available or if no callback function is set (yet). * * Example: * @code * CallbackBuffer cb; * cb.set_callback([&](osmium::memory::Buffer&& buffer) { * ...handle buffer... * } * osmium::builder::add_node(cb.buffer(), _id(9), ...); * osmium::builder::add_way(cb.buffer(), _id(27), ...); * @endcode */ class CallbackBuffer { public: /// The type for the callback function using callback_func_type = std::function<void(osmium::memory::Buffer&&)>; private: enum { default_initial_buffer_size = 1024UL * 1024UL }; enum { default_max_buffer_size = 800UL * 1024UL }; osmium::memory::Buffer m_buffer; std::size_t m_initial_buffer_size; std::size_t m_max_buffer_size; callback_func_type m_callback; public: /** * Construct a CallbackBuffer without a callback function. You * can later call set the callback with set_callback(). * * @param initial_buffer_size The initial size of newly created * internal buffers. * @param max_buffer_size If the buffer grows beyond this size the * callback will be called. */ explicit CallbackBuffer(std::size_t initial_buffer_size = default_initial_buffer_size, std::size_t max_buffer_size = default_max_buffer_size) : m_buffer(initial_buffer_size, osmium::memory::Buffer::auto_grow::yes), m_initial_buffer_size(initial_buffer_size), m_max_buffer_size(max_buffer_size), m_callback(nullptr) { } /** * Construct a CallbackBuffer with a callback function. * * @param callback The callback function. Must be of type * @code void(osmium::memory::Buffer&&) @endcode * @param initial_buffer_size The initial size of newly created * internal buffers. * @param max_buffer_size If the buffer grows beyond this size the * callback will be called. */ explicit CallbackBuffer(callback_func_type callback, std::size_t initial_buffer_size = default_initial_buffer_size, std::size_t max_buffer_size = default_max_buffer_size) : m_buffer(initial_buffer_size, osmium::memory::Buffer::auto_grow::yes), m_initial_buffer_size(initial_buffer_size), m_max_buffer_size(max_buffer_size), m_callback(std::move(callback)) { } /** * Access the internal buffer. This is used to fill the buffer, * the CallbackBuffer still owns the buffer. * * Use read() or the callback if you need to own the buffer. */ osmium::memory::Buffer& buffer() noexcept { return m_buffer; } /** * Set the callback. The function must take a rvalue reference to * a buffer and return void. * * @param callback The callback function. Must be of type * @code void(osmium::memory::Buffer&&) @endcode */ void set_callback(const callback_func_type& callback = nullptr) noexcept { m_callback = callback; } /** * Flush the internal buffer regardless of how full it is. Calls * the callback with the buffer and creates an new empty internal * one. * * This will do nothing if no callback is set or if the buffer * is empty. */ void flush() { if (m_callback && m_buffer.committed() > 0) { m_callback(read()); } } /** * Flush the internal buffer if and only if it contains more than * the max_buffer_size set in the constructor. Calls the callback * with the buffer and creates an new empty internal one. * * This will do nothing if no callback is set or if the buffer * is empty. */ void possibly_flush() { if (m_buffer.committed() > m_max_buffer_size) { flush(); } } /** * Return the internal buffer and create a new empty internal one. * You can use this as an alternative access instead of using the * callback. */ osmium::memory::Buffer read() { osmium::memory::Buffer new_buffer{m_initial_buffer_size, osmium::memory::Buffer::auto_grow::yes}; using std::swap; swap(new_buffer, m_buffer); return new_buffer; } }; // class CallbackBuffer } // namespace memory } // namespace osmium #endif // OSMIUM_MEMORY_CALLBACK_BUFFER_HPP
{ "content_hash": "d97538921029a4e2558290f134418d8f", "timestamp": "", "source": "github", "line_count": 164, "max_line_length": 184, "avg_line_length": 38.079268292682926, "alnum_prop": 0.5245796637309847, "repo_name": "Project-OSRM/osrm-backend", "id": "967d51b50aa23e68f38782a90729a8ad72bec4e0", "size": "7728", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "third_party/libosmium/include/osmium/memory/callback_buffer.hpp", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "Batchfile", "bytes": "3409" }, { "name": "C++", "bytes": "3845065" }, { "name": "CMake", "bytes": "138301" }, { "name": "Dockerfile", "bytes": "2724" }, { "name": "Gherkin", "bytes": "1411751" }, { "name": "JavaScript", "bytes": "375371" }, { "name": "Lua", "bytes": "123602" }, { "name": "Makefile", "bytes": "2833" }, { "name": "Python", "bytes": "22322" }, { "name": "Shell", "bytes": "13658" } ], "symlink_target": "" }
[Unist][] node visitor, with ancestral information. ## Installation [npm][]: ```bash npm install unist-util-visit-parents ``` ## Usage ```javascript var remark = require('remark') var visit = require('unist-util-visit-parents') var tree = remark.parse('Some _emphasis_, **importance**, and `code`.') visit(tree, 'strong', visitor) function visitor(node, parents) { console.log(parents) } ``` Yields: ```js [ { type: 'root', children: [ [Object] ] }, { type: 'paragraph', children: [ [Object], [Object], [Object], [Object], [Object], [Object], [Object] ] } ] ``` ## API ### `visit(node[, type], visitor)` Visit nodes, with ancestral information. Optionally by node type. ###### Parameters * `node` ([`Node`][node]) — Node to search * `type` (`string`, optional) — Node type * `visitor` ([Function][visitor]) — Visitor invoked when a node is found #### `stop? = visitor(node, parents)` Invoked when a node (when `type` is given, matching `type`) is found. ###### Parameters * `node` ([`Node`][node]) — Found node * `parents` (`Array.<Node>`) — List of parents ###### Returns `boolean?` - When `false`, visiting is immediately stopped. ## Related * [`unist-util-visit`](https://github.com/syntax-tree/unist-util-visit) — Like `visit-parents`, but with one parent * [`unist-util-filter`](https://github.com/eush77/unist-util-filter) — Create a new tree with all nodes that pass a test * [`unist-util-map`](https://github.com/syntax-tree/unist-util-map) — Create a new tree with all nodes mapped by a given function * [`unist-util-remove`](https://github.com/eush77/unist-util-remove) — Remove nodes from a tree that pass a test * [`unist-util-select`](https://github.com/eush77/unist-util-select) — Select nodes with CSS-like selectors ## Contribute See [`contributing.md` in `syntax-tree/unist`][contributing] for ways to get started. This organisation has a [Code of Conduct][coc]. By interacting with this repository, organisation, or community you agree to abide by its terms. ## License [MIT][license] © [Titus Wormer][author] <!-- Definition --> [build-badge]: https://img.shields.io/travis/syntax-tree/unist-util-visit-parents.svg [build-page]: https://travis-ci.org/syntax-tree/unist-util-visit-parents [coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/unist-util-visit-parents.svg [coverage-page]: https://codecov.io/github/syntax-tree/unist-util-visit-parents?branch=master [npm]: https://docs.npmjs.com/cli/install [license]: LICENSE [author]: http://wooorm.com [unist]: https://github.com/syntax-tree/unist [node]: https://github.com/syntax-tree/unist#node [visitor]: #stop--visitornode-parents [contributing]: https://github.com/syntax-tree/unist/blob/master/contributing.md [coc]: https://github.com/syntax-tree/unist/blob/master/code-of-conduct.md
{ "content_hash": "bf81b336d34c6a0c0bc9371d7cba9292", "timestamp": "", "source": "github", "line_count": 115, "max_line_length": 98, "avg_line_length": 25.36521739130435, "alnum_prop": 0.6770654782310593, "repo_name": "Dans-labs/dariah", "id": "b7063ff5c659377f7a10c58fbc3aa90f2674e6e4", "size": "3061", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "client/node_modules/unist-util-visit-parents/readme.md", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "76627" }, { "name": "HTML", "bytes": "1423730" }, { "name": "JavaScript", "bytes": "442283" }, { "name": "Jupyter Notebook", "bytes": "298743" }, { "name": "Python", "bytes": "396710" }, { "name": "Shell", "bytes": "9080" } ], "symlink_target": "" }
function dunnTbl = mcDunnett(ctrl, anovaTbl, means, enes, alpha, tails) % If we're interested in comparing different levels to one control the % problem with using the Tukey's HSD or any other method designed to % compare each mean with each other mean is that these methods overcorrect % for the number of comparisons made. % % glantz and slinker p. 307-309 % dunnett's test is an alternative for comparing several groups to a single % control group. % % t = b_{i} / S_{b_{i}} = q' % % where b_{i} is the coefficient from the regression and S_{b_{i}} its % variance % % http://davidmlane.com/hyperstat/B112114.html % % td = Mi -Mc / sqrt((2*MSe)/harmonicMean(observations)) % % Mi is the mean of the ith experimental group, Mc is the mean of the % control group, MSE is the mean square error as computed from the % analysis of variance, and nh is the harmonic mean of the sample sizes of % the experimental group and the control group. The degrees of freedom (df) % for the test are equal to N-a where N is the total number of subjects in % all groups and "a" is the number of groups (including the control). % % % initialize output dunnTbl = zeros(length(means),3); % extract Mean square of error or residual if size(anovaTbl,2)==7, MSe = anovaTbl{end-1,5}; else MSe = anovaTbl{end-1,4}; end dfDunn = sum(enes) - length(means); % get critical value dunnTbl(:,2) = localgetcrit(alpha, dfDunn, length(means)); % rank means in ascending order [smean smeanIdx] = sort(means); meanComp = smean - mean(smeanIdx==ctrl); senes = enes(smeanIdx); % compare groups with means BELOW control starting with the largest % difference if no difference then skip comparisons enclosed by the NS % difference below = sum(meanComp <= 0); for i = 1:below-1, dunnTbl(i,1) = localDunnettTest(smean(i), smean(below(end)), MSe, enes(ctrl), senes(i)); dunnTbl(i,3) = dunnTbl(i,1) > dunnTbl(i,2); if ~dunnTbl(i,3) break end end % compare groups with means ABOVE control starting with the largest % difference for ii = length(meanComp):below+1, dunnTbl(ii,1) = localDunnettTest(smean(ii), smean(below(end)), MSe, enes(ctrl), senes(ii)); dunnTbl(ii,3) = dunnTbl(ii,1) > dunnTbl(ii,2); if ~dunnTbl(ii,3) break end end %%%%%%%%%%%%%%%%%%%%%%%%%%% function qObs = localDunnettTest(xC, xT, MSe, nC, nT) if nC==nT, SE = sqrt(2*MSe/nC); else SE = sqrt( MSe*( (1/nC) + (1/nT) ) ); end qObs = (xC - xT) / SE; %%%%%%%%%%%%%%%%%%%%%% function qCrit = localgetcrit(alpha, df, ng)
{ "content_hash": "4ed6d98b988ff7a01d5dfc972d8457c5", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 99, "avg_line_length": 31.878048780487806, "alnum_prop": 0.6564651874521805, "repo_name": "rb476/Picasso", "id": "a27c5d4deaaf0077be0d1298e81df7b6ff3fd99b", "size": "2614", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Statistics/mcDunnett.m", "mode": "33188", "license": "mit", "language": [ { "name": "M", "bytes": "671" }, { "name": "MATLAB", "bytes": "1949066" } ], "symlink_target": "" }
require_relative 'component' class Position < Component attr_accessor :x, :y def initialize(x, y) @x = x @y = y end end
{ "content_hash": "798829e5be6489490ac9878836754377", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 28, "avg_line_length": 14.88888888888889, "alnum_prop": 0.6343283582089553, "repo_name": "sindresf/Lunar-Lander", "id": "d0c1d6512434e1f65fe8c174628b1cee3acdaac8", "size": "134", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/ruby/components/Position.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "95177" } ], "symlink_target": "" }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Framework.Persistencia.Interfaces { public interface IDaoGenerico<T> where T : class { void Criar(T entidade); T BuscarPorId(Nullable<long> id); IList<T> BuscarTodos(); T FiltrarResultadoPor(Func<T, bool> predicado); IList<T> FiltrarResultadosPor(Func<T, bool> predicado); void Atualizar(T entidade); void Excluir(T entidade); } }
{ "content_hash": "6a4ccbc1de73c4c0057e76fe4a0e55b2", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 70, "avg_line_length": 28.94736842105263, "alnum_prop": 0.6527272727272727, "repo_name": "gabrielsimas/Framework_DotNET", "id": "38ff32fc5e8444dd74b190330b1598015c728046", "size": "552", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Persistencia/Interfaces/IDaoGenerico.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "37249" } ], "symlink_target": "" }
@interface NSImage (NSImageAdditions) + (NSImage *) imageNamed:(NSString *) name forClass:(Class) class; - (void) tileInRect:(NSRect) rect; + (NSImage *) imageWithBase64EncodedString:(NSString *) base64String; - (id) initWithBase64EncodedString:(NSString *) base64String; - (NSString *) base64EncodingWithFileType:(NSBitmapImageFileType) fileType; @end
{ "content_hash": "96eff06cdd11412488fff3748ca50192", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 75, "avg_line_length": 44.25, "alnum_prop": 0.7711864406779662, "repo_name": "albertz/music-player", "id": "e6acad992326a8eb659f780a43bc1c6ccc4497e7", "size": "382", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "mac/pyobjc-core/Examples/ApplicationPlugins/Colloqui/Colloquy Plugin SDK/Headers/NSImageAdditions.h", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "Assembly", "bytes": "47481" }, { "name": "C", "bytes": "435926" }, { "name": "C++", "bytes": "149133" }, { "name": "CSS", "bytes": "16435" }, { "name": "HTML", "bytes": "914432" }, { "name": "JavaScript", "bytes": "52869" }, { "name": "M", "bytes": "10808" }, { "name": "Makefile", "bytes": "13304" }, { "name": "Mathematica", "bytes": "61418" }, { "name": "Objective-C", "bytes": "2082720" }, { "name": "Objective-C++", "bytes": "62427" }, { "name": "PostScript", "bytes": "2783" }, { "name": "Prolog", "bytes": "217" }, { "name": "Python", "bytes": "7789845" }, { "name": "QMake", "bytes": "9667" }, { "name": "Roff", "bytes": "8329" }, { "name": "Shell", "bytes": "3521" } ], "symlink_target": "" }
ACCEPTED #### According to Index Fungorum #### Published in null #### Original name Ryparobius hyalinellus var. hyalinellus (P. Karst.) Sacc. ### Remarks null
{ "content_hash": "4559032940e4bd5676a1e5823e793009", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 57, "avg_line_length": 12.461538461538462, "alnum_prop": 0.7098765432098766, "repo_name": "mdoering/backbone", "id": "2d41a6b98724b36cdee6d1819dfeb526c3b17b59", "size": "243", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Fungi/Ascomycota/Leotiomycetes/Thelebolales/Thelebolaceae/Thelebolus/Ryparobius hyalinellus/Ryparobius hyalinellus hyalinellus/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
package com.topnews.android.keepfragment; import android.support.v7.widget.DefaultItemAnimator; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.View; import com.topnews.android.R; import com.topnews.android.adapter.KeepTwoAdapter; import com.topnews.android.utils.UIUtils; import java.util.ArrayList; import java.util.List; /** * Created by dell on 2017/3/28. * * 用户收藏页-专题 */ public class KeepTwoFragment extends BaseKeepFragment { private List<String> mDatas; private RecyclerView mRecycler; @Override public void dataLoad() { mDatas = new ArrayList<String>(); for (int i=0;i<60;i++){ mDatas.add("这是第"+i+"条测试数据"); } setCurState(DATA_LOAD_SUCCESS); } @Override public View onSuccessView() { View view=View.inflate(UIUtils.getContext(), R.layout.user_keep,null); mRecycler = (RecyclerView) view.findViewById(R.id.recycler_view); LinearLayoutManager manager=new LinearLayoutManager(UIUtils.getContext()); mRecycler.setLayoutManager(manager); mRecycler.setAdapter(new KeepTwoAdapter(mDatas)); mRecycler.setItemAnimator(new DefaultItemAnimator()); return view; } }
{ "content_hash": "e63caf0bb756dd6a3a3e80c01b6625af", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 82, "avg_line_length": 26.163265306122447, "alnum_prop": 0.7043681747269891, "repo_name": "android-jian/topnews", "id": "b765471680bcf001c1223bd44ef97f651602bdfc", "size": "1312", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/main/java/com/topnews/android/keepfragment/KeepTwoFragment.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "394824" } ], "symlink_target": "" }
package org.apache.cloudstack.backup.veeam.api; import java.util.List; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; @JacksonXmlRootElement(localName = "EntityReferences") public class EntityReferences { @JacksonXmlProperty(localName = "Ref") @JacksonXmlElementWrapper(localName = "Ref", useWrapping = false) private List<Ref> refs; public List<Ref> getRefs() { return refs; } public void setRefs(List<Ref> refs) { this.refs = refs; } }
{ "content_hash": "6b792786c13f2f4cea18841b8ee6064b", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 80, "avg_line_length": 30.636363636363637, "alnum_prop": 0.7537091988130564, "repo_name": "GabrielBrascher/cloudstack", "id": "928e0dae4a56af00fd7decef45cd37b3d52d6cf6", "size": "1476", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "plugins/backup/veeam/src/main/java/org/apache/cloudstack/backup/veeam/api/EntityReferences.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "9979" }, { "name": "C#", "bytes": "2356211" }, { "name": "CSS", "bytes": "42504" }, { "name": "Dockerfile", "bytes": "4189" }, { "name": "FreeMarker", "bytes": "4887" }, { "name": "Groovy", "bytes": "146420" }, { "name": "HTML", "bytes": "53626" }, { "name": "Java", "bytes": "38859783" }, { "name": "JavaScript", "bytes": "995137" }, { "name": "Less", "bytes": "28250" }, { "name": "Makefile", "bytes": "871" }, { "name": "Python", "bytes": "12977377" }, { "name": "Ruby", "bytes": "22732" }, { "name": "Shell", "bytes": "744445" }, { "name": "Vue", "bytes": "2012353" }, { "name": "XSLT", "bytes": "57835" } ], "symlink_target": "" }
package org.assertj.core.internal.doubles; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.within; import org.assertj.core.internal.Doubles; import org.assertj.core.internal.DoublesBaseTest; import org.junit.jupiter.api.Test; /** * Tests for <code>{@link Doubles#NaN()}</code>. * * @author Joel Costigliola */ class Doubles_NaN_Test extends DoublesBaseTest { @Test void check_double_NaN_method() { assertThat(NaN()).isCloseTo(Double.NaN, within(0d)); } }
{ "content_hash": "e9fffc9e71f3feae01ffd938a8fc7e8f", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 57, "avg_line_length": 23.130434782608695, "alnum_prop": 0.7424812030075187, "repo_name": "joel-costigliola/assertj-core", "id": "d992cb0444d3cdeb9f728f991ce841722727db1b", "size": "1138", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "src/test/java/org/assertj/core/internal/doubles/Doubles_NaN_Test.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "13752510" }, { "name": "Shell", "bytes": "36956" } ], "symlink_target": "" }
<div ng-controller="TaskListController" class="task-list-page"> <table class="task-list-table"> <thead> <th>ID</th> <th>State</th> <th>Name</th> <th>Created At</th> <th>Elapsed Time</th> <th></th> </thead> <tbody> <tr ng-repeat="task in tasks track by task.id" ng-class="task.state + '-state'"> <td class="task-list-id"><a href="/v1/tasks/{{task.id}}">{{ task.id }}</a></td> <td>{{ task.state }}</td> <td class="task-list-name">{{ task.name }}</td> <td>{{ creationTime(task) }}</td> <td style="text-align: right">{{ elapsedTime(task) }}</td> <td class="task-list-cancel"><button class="btn-cancel mdl-button--fab mini-fab" ng-hide="isDone(task)" ng-click=cancelTask(task.id)><i class="material-icons">clear</i></button></td> </tr> </tbody> </table> </div>
{ "content_hash": "4d1bb219dc3eebcff80b4da981ca5365", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 88, "avg_line_length": 33.55555555555556, "alnum_prop": 0.5397350993377483, "repo_name": "adamstruck/funnel", "id": "8f6ce0fdb77bfd26576d3d7837ee9f6d49a5bdda", "size": "906", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "webdash/list.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "41094" }, { "name": "Go", "bytes": "640101" }, { "name": "HTML", "bytes": "25872" }, { "name": "JavaScript", "bytes": "11844" }, { "name": "Makefile", "bytes": "8894" }, { "name": "Shell", "bytes": "20704" } ], "symlink_target": "" }
package main import ( "github.com/chzyer/flagx" "gopkg.in/logex.v1" ) type Config struct { Root string } func NewConfig() *Config { cfg := new(Config) flagx.Parse(cfg) return cfg } func main() { cfg := NewConfig() logex.Struct(cfg) }
{ "content_hash": "a736e91c279cc1d9f5da189a7beae547", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 26, "avg_line_length": 11.227272727272727, "alnum_prop": 0.6639676113360324, "repo_name": "chzyer/fsmq", "id": "8e07eec21667963f87ede01f3135f2dee0512365", "size": "247", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "fsmq/fsmq.go", "mode": "33188", "license": "mit", "language": [ { "name": "Awk", "bytes": "177" }, { "name": "Go", "bytes": "110979" }, { "name": "Makefile", "bytes": "1732" }, { "name": "Shell", "bytes": "741" } ], "symlink_target": "" }
SUBDIR= include .include <bsd.subdir.mk>
{ "content_hash": "42960465ba3ef2e97ae9c521015f822f", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 24, "avg_line_length": 14, "alnum_prop": 0.7380952380952381, "repo_name": "MarginC/kame", "id": "38989d3e9a8780f4bf179ac477dbae4205719150", "size": "101", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "netbsd/sys/arch/amigappc/Makefile", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Arc", "bytes": "7491" }, { "name": "Assembly", "bytes": "14375563" }, { "name": "Awk", "bytes": "313712" }, { "name": "Batchfile", "bytes": "6819" }, { "name": "C", "bytes": "356715789" }, { "name": "C++", "bytes": "4231647" }, { "name": "DIGITAL Command Language", "bytes": "11155" }, { "name": "Emacs Lisp", "bytes": "790" }, { "name": "Forth", "bytes": "253695" }, { "name": "GAP", "bytes": "9964" }, { "name": "Groff", "bytes": "2220485" }, { "name": "Lex", "bytes": "168376" }, { "name": "Logos", "bytes": "570213" }, { "name": "Makefile", "bytes": "1778847" }, { "name": "Mathematica", "bytes": "16549" }, { "name": "Objective-C", "bytes": "529629" }, { "name": "PHP", "bytes": "11283" }, { "name": "Perl", "bytes": "151251" }, { "name": "Perl6", "bytes": "2572" }, { "name": "Ruby", "bytes": "7283" }, { "name": "Scheme", "bytes": "76872" }, { "name": "Shell", "bytes": "583253" }, { "name": "Stata", "bytes": "408" }, { "name": "Yacc", "bytes": "606054" } ], "symlink_target": "" }
<?php namespace Worldpay; class DeliveryAddress extends AbstractAddress { protected $firstName; protected $lastName; public function __construct($address) { if (!isset($address)) { $address = array(); } $address = array_merge(self::getAddressDefaults(), $address); $this->firstName = $address['firstName']; $this->lastName = $address['lastName']; $this->address1 = $address['address1']; $this->address2 = $address['address2']; $this->address3 = $address['address3']; $this->postalCode = $address['postalCode']; $this->city = $address['city']; $this->state = $address['state']; $this->countryCode = $address['countryCode']; if (!empty($address['telephoneNumber'])) { $this->telephoneNumber = $address['telephoneNumber']; } } private static function getAddressDefaults() { $defaults = array( 'firstName' => null, 'lastName' => null, 'address1' => null, 'address2' => null, 'address3' => null, 'postalCode' => null, 'city' => null, 'state' => null, 'countryCode' => null ); return $defaults; } }
{ "content_hash": "cb8e81ccfde063a089debc30a6b102a2", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 69, "avg_line_length": 28.217391304347824, "alnum_prop": 0.5261941448382126, "repo_name": "Worldpay/worldpay-lib-php", "id": "3d2712986c31e10c4beaa78f4ac66ee7a03400fb", "size": "1298", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "lib/DeliveryAddress.php", "mode": "33188", "license": "mit", "language": [ { "name": "PHP", "bytes": "31790" } ], "symlink_target": "" }
package org.daylight.pathweaver.common.config; public class ConfigurationInitializationException extends RuntimeException { public ConfigurationInitializationException(String message, Throwable cause) { super(message, cause); } public ConfigurationInitializationException(String message) { super(message); } }
{ "content_hash": "8bbcaf7d1a82db70ba32aefdfbbad51b", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 82, "avg_line_length": 28.75, "alnum_prop": 0.7623188405797101, "repo_name": "citrixsystems/pathweaver", "id": "e8ba6610397ca6744ce6fa6e5759cb8980d99b7b", "size": "345", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "services/loadbalancing/lb-common/src/main/java/org/daylight/pathweaver/common/config/ConfigurationInitializationException.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "929710" }, { "name": "Shell", "bytes": "813" } ], "symlink_target": "" }
 #pragma once #include <aws/devicefarm/DeviceFarm_EXPORTS.h> #include <aws/devicefarm/DeviceFarmRequest.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <utility> namespace Aws { namespace DeviceFarm { namespace Model { /** * <p>Represents a request to the update project operation.</p><p><h3>See * Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/UpdateProjectRequest">AWS * API Reference</a></p> */ class AWS_DEVICEFARM_API UpdateProjectRequest : public DeviceFarmRequest { public: UpdateProjectRequest(); // Service request name is the Operation name which will send this request out, // each operation should has unique request name, so that we can get operation's name from this request. // Note: this is not true for response, multiple operations may have the same response name, // so we can not get operation's name from response. inline virtual const char* GetServiceRequestName() const override { return "UpdateProject"; } Aws::String SerializePayload() const override; Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; /** * <p>The Amazon Resource Name (ARN) of the project whose name to update.</p> */ inline const Aws::String& GetArn() const{ return m_arn; } /** * <p>The Amazon Resource Name (ARN) of the project whose name to update.</p> */ inline bool ArnHasBeenSet() const { return m_arnHasBeenSet; } /** * <p>The Amazon Resource Name (ARN) of the project whose name to update.</p> */ inline void SetArn(const Aws::String& value) { m_arnHasBeenSet = true; m_arn = value; } /** * <p>The Amazon Resource Name (ARN) of the project whose name to update.</p> */ inline void SetArn(Aws::String&& value) { m_arnHasBeenSet = true; m_arn = std::move(value); } /** * <p>The Amazon Resource Name (ARN) of the project whose name to update.</p> */ inline void SetArn(const char* value) { m_arnHasBeenSet = true; m_arn.assign(value); } /** * <p>The Amazon Resource Name (ARN) of the project whose name to update.</p> */ inline UpdateProjectRequest& WithArn(const Aws::String& value) { SetArn(value); return *this;} /** * <p>The Amazon Resource Name (ARN) of the project whose name to update.</p> */ inline UpdateProjectRequest& WithArn(Aws::String&& value) { SetArn(std::move(value)); return *this;} /** * <p>The Amazon Resource Name (ARN) of the project whose name to update.</p> */ inline UpdateProjectRequest& WithArn(const char* value) { SetArn(value); return *this;} /** * <p>A string that represents the new name of the project that you are * updating.</p> */ inline const Aws::String& GetName() const{ return m_name; } /** * <p>A string that represents the new name of the project that you are * updating.</p> */ inline bool NameHasBeenSet() const { return m_nameHasBeenSet; } /** * <p>A string that represents the new name of the project that you are * updating.</p> */ inline void SetName(const Aws::String& value) { m_nameHasBeenSet = true; m_name = value; } /** * <p>A string that represents the new name of the project that you are * updating.</p> */ inline void SetName(Aws::String&& value) { m_nameHasBeenSet = true; m_name = std::move(value); } /** * <p>A string that represents the new name of the project that you are * updating.</p> */ inline void SetName(const char* value) { m_nameHasBeenSet = true; m_name.assign(value); } /** * <p>A string that represents the new name of the project that you are * updating.</p> */ inline UpdateProjectRequest& WithName(const Aws::String& value) { SetName(value); return *this;} /** * <p>A string that represents the new name of the project that you are * updating.</p> */ inline UpdateProjectRequest& WithName(Aws::String&& value) { SetName(std::move(value)); return *this;} /** * <p>A string that represents the new name of the project that you are * updating.</p> */ inline UpdateProjectRequest& WithName(const char* value) { SetName(value); return *this;} /** * <p>The number of minutes a test run in the project executes before it times * out.</p> */ inline int GetDefaultJobTimeoutMinutes() const{ return m_defaultJobTimeoutMinutes; } /** * <p>The number of minutes a test run in the project executes before it times * out.</p> */ inline bool DefaultJobTimeoutMinutesHasBeenSet() const { return m_defaultJobTimeoutMinutesHasBeenSet; } /** * <p>The number of minutes a test run in the project executes before it times * out.</p> */ inline void SetDefaultJobTimeoutMinutes(int value) { m_defaultJobTimeoutMinutesHasBeenSet = true; m_defaultJobTimeoutMinutes = value; } /** * <p>The number of minutes a test run in the project executes before it times * out.</p> */ inline UpdateProjectRequest& WithDefaultJobTimeoutMinutes(int value) { SetDefaultJobTimeoutMinutes(value); return *this;} private: Aws::String m_arn; bool m_arnHasBeenSet; Aws::String m_name; bool m_nameHasBeenSet; int m_defaultJobTimeoutMinutes; bool m_defaultJobTimeoutMinutesHasBeenSet; }; } // namespace Model } // namespace DeviceFarm } // namespace Aws
{ "content_hash": "ec9242257a97ab7859dced78a7abec6f", "timestamp": "", "source": "github", "line_count": 166, "max_line_length": 139, "avg_line_length": 33.13253012048193, "alnum_prop": 0.6594545454545454, "repo_name": "awslabs/aws-sdk-cpp", "id": "fa4b2dfa545862b4fb2c3aca1c24affb2448aa2b", "size": "5619", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "aws-cpp-sdk-devicefarm/include/aws/devicefarm/model/UpdateProjectRequest.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "7596" }, { "name": "C++", "bytes": "61740540" }, { "name": "CMake", "bytes": "337520" }, { "name": "Java", "bytes": "223122" }, { "name": "Python", "bytes": "47357" } ], "symlink_target": "" }
package core import ( "context" "errors" "fmt" "math" "reflect" "strconv" "testing" "time" "github.com/google/go-cmp/cmp" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/wait" utilfeature "k8s.io/apiserver/pkg/util/feature" "k8s.io/client-go/informers" clientsetfake "k8s.io/client-go/kubernetes/fake" featuregatetesting "k8s.io/component-base/featuregate/testing" pvutil "k8s.io/kubernetes/pkg/controller/volume/persistentvolume/util" "k8s.io/kubernetes/pkg/features" schedulerapi "k8s.io/kubernetes/pkg/scheduler/apis/config" "k8s.io/kubernetes/pkg/scheduler/framework" "k8s.io/kubernetes/pkg/scheduler/framework/plugins/defaultbinder" "k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources" "k8s.io/kubernetes/pkg/scheduler/framework/plugins/podtopologyspread" "k8s.io/kubernetes/pkg/scheduler/framework/plugins/queuesort" "k8s.io/kubernetes/pkg/scheduler/framework/plugins/selectorspread" "k8s.io/kubernetes/pkg/scheduler/framework/plugins/volumebinding" frameworkruntime "k8s.io/kubernetes/pkg/scheduler/framework/runtime" internalcache "k8s.io/kubernetes/pkg/scheduler/internal/cache" internalqueue "k8s.io/kubernetes/pkg/scheduler/internal/queue" st "k8s.io/kubernetes/pkg/scheduler/testing" schedutil "k8s.io/kubernetes/pkg/scheduler/util" ) var ( errPrioritize = fmt.Errorf("priority map encounters an error") ) type noPodsFilterPlugin struct{} // Name returns name of the plugin. func (pl *noPodsFilterPlugin) Name() string { return "NoPodsFilter" } // Filter invoked at the filter extension point. func (pl *noPodsFilterPlugin) Filter(_ context.Context, _ *framework.CycleState, pod *v1.Pod, nodeInfo *framework.NodeInfo) *framework.Status { if len(nodeInfo.Pods) == 0 { return nil } return framework.NewStatus(framework.Unschedulable, st.ErrReasonFake) } // NewNoPodsFilterPlugin initializes a noPodsFilterPlugin and returns it. func NewNoPodsFilterPlugin(_ runtime.Object, _ framework.Handle) (framework.Plugin, error) { return &noPodsFilterPlugin{}, nil } type numericMapPlugin struct{} func newNumericMapPlugin() frameworkruntime.PluginFactory { return func(_ runtime.Object, _ framework.Handle) (framework.Plugin, error) { return &numericMapPlugin{}, nil } } func (pl *numericMapPlugin) Name() string { return "NumericMap" } func (pl *numericMapPlugin) Score(_ context.Context, _ *framework.CycleState, _ *v1.Pod, nodeName string) (int64, *framework.Status) { score, err := strconv.Atoi(nodeName) if err != nil { return 0, framework.NewStatus(framework.Error, fmt.Sprintf("Error converting nodename to int: %+v", nodeName)) } return int64(score), nil } func (pl *numericMapPlugin) ScoreExtensions() framework.ScoreExtensions { return nil } type reverseNumericMapPlugin struct{} func newReverseNumericMapPlugin() frameworkruntime.PluginFactory { return func(_ runtime.Object, _ framework.Handle) (framework.Plugin, error) { return &reverseNumericMapPlugin{}, nil } } func (pl *reverseNumericMapPlugin) Name() string { return "ReverseNumericMap" } func (pl *reverseNumericMapPlugin) Score(_ context.Context, _ *framework.CycleState, _ *v1.Pod, nodeName string) (int64, *framework.Status) { score, err := strconv.Atoi(nodeName) if err != nil { return 0, framework.NewStatus(framework.Error, fmt.Sprintf("Error converting nodename to int: %+v", nodeName)) } return int64(score), nil } func (pl *reverseNumericMapPlugin) ScoreExtensions() framework.ScoreExtensions { return pl } func (pl *reverseNumericMapPlugin) NormalizeScore(_ context.Context, _ *framework.CycleState, _ *v1.Pod, nodeScores framework.NodeScoreList) *framework.Status { var maxScore float64 minScore := math.MaxFloat64 for _, hostPriority := range nodeScores { maxScore = math.Max(maxScore, float64(hostPriority.Score)) minScore = math.Min(minScore, float64(hostPriority.Score)) } for i, hostPriority := range nodeScores { nodeScores[i] = framework.NodeScore{ Name: hostPriority.Name, Score: int64(maxScore + minScore - float64(hostPriority.Score)), } } return nil } type trueMapPlugin struct{} func newTrueMapPlugin() frameworkruntime.PluginFactory { return func(_ runtime.Object, _ framework.Handle) (framework.Plugin, error) { return &trueMapPlugin{}, nil } } func (pl *trueMapPlugin) Name() string { return "TrueMap" } func (pl *trueMapPlugin) Score(_ context.Context, _ *framework.CycleState, _ *v1.Pod, _ string) (int64, *framework.Status) { return 1, nil } func (pl *trueMapPlugin) ScoreExtensions() framework.ScoreExtensions { return pl } func (pl *trueMapPlugin) NormalizeScore(_ context.Context, _ *framework.CycleState, _ *v1.Pod, nodeScores framework.NodeScoreList) *framework.Status { for _, host := range nodeScores { if host.Name == "" { return framework.NewStatus(framework.Error, "unexpected empty host name") } } return nil } type falseMapPlugin struct{} func newFalseMapPlugin() frameworkruntime.PluginFactory { return func(_ runtime.Object, _ framework.Handle) (framework.Plugin, error) { return &falseMapPlugin{}, nil } } func (pl *falseMapPlugin) Name() string { return "FalseMap" } func (pl *falseMapPlugin) Score(_ context.Context, _ *framework.CycleState, _ *v1.Pod, _ string) (int64, *framework.Status) { return 0, framework.AsStatus(errPrioritize) } func (pl *falseMapPlugin) ScoreExtensions() framework.ScoreExtensions { return nil } var emptySnapshot = internalcache.NewEmptySnapshot() func makeNodeList(nodeNames []string) []*v1.Node { result := make([]*v1.Node, 0, len(nodeNames)) for _, nodeName := range nodeNames { result = append(result, &v1.Node{ObjectMeta: metav1.ObjectMeta{Name: nodeName}}) } return result } func TestSelectHost(t *testing.T) { scheduler := genericScheduler{} tests := []struct { name string list framework.NodeScoreList possibleHosts sets.String expectsErr bool }{ { name: "unique properly ordered scores", list: []framework.NodeScore{ {Name: "machine1.1", Score: 1}, {Name: "machine2.1", Score: 2}, }, possibleHosts: sets.NewString("machine2.1"), expectsErr: false, }, { name: "equal scores", list: []framework.NodeScore{ {Name: "machine1.1", Score: 1}, {Name: "machine1.2", Score: 2}, {Name: "machine1.3", Score: 2}, {Name: "machine2.1", Score: 2}, }, possibleHosts: sets.NewString("machine1.2", "machine1.3", "machine2.1"), expectsErr: false, }, { name: "out of order scores", list: []framework.NodeScore{ {Name: "machine1.1", Score: 3}, {Name: "machine1.2", Score: 3}, {Name: "machine2.1", Score: 2}, {Name: "machine3.1", Score: 1}, {Name: "machine1.3", Score: 3}, }, possibleHosts: sets.NewString("machine1.1", "machine1.2", "machine1.3"), expectsErr: false, }, { name: "empty priority list", list: []framework.NodeScore{}, possibleHosts: sets.NewString(), expectsErr: true, }, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { // increase the randomness for i := 0; i < 10; i++ { got, err := scheduler.selectHost(test.list) if test.expectsErr { if err == nil { t.Error("Unexpected non-error") } } else { if err != nil { t.Errorf("Unexpected error: %v", err) } if !test.possibleHosts.Has(got) { t.Errorf("got %s is not in the possible map %v", got, test.possibleHosts) } } } }) } } func TestFindNodesThatPassExtenders(t *testing.T) { tests := []struct { name string extenders []st.FakeExtender nodes []*v1.Node filteredNodesStatuses framework.NodeToStatusMap expectsErr bool expectedNodes []*v1.Node expectedStatuses framework.NodeToStatusMap }{ { name: "error", extenders: []st.FakeExtender{ { Predicates: []st.FitPredicate{st.ErrorPredicateExtender}, }, }, nodes: makeNodeList([]string{"a"}), filteredNodesStatuses: make(framework.NodeToStatusMap), expectsErr: true, }, { name: "success", extenders: []st.FakeExtender{ { Predicates: []st.FitPredicate{st.TruePredicateExtender}, }, }, nodes: makeNodeList([]string{"a"}), filteredNodesStatuses: make(framework.NodeToStatusMap), expectsErr: false, expectedNodes: makeNodeList([]string{"a"}), expectedStatuses: make(framework.NodeToStatusMap), }, { name: "unschedulable", extenders: []st.FakeExtender{ { Predicates: []st.FitPredicate{func(pod *v1.Pod, node *v1.Node) *framework.Status { if node.Name == "a" { return framework.NewStatus(framework.Success) } return framework.NewStatus(framework.Unschedulable, fmt.Sprintf("node %q is not allowed", node.Name)) }}, }, }, nodes: makeNodeList([]string{"a", "b"}), filteredNodesStatuses: make(framework.NodeToStatusMap), expectsErr: false, expectedNodes: makeNodeList([]string{"a"}), expectedStatuses: framework.NodeToStatusMap{ "b": framework.NewStatus(framework.Unschedulable, fmt.Sprintf("FakeExtender: node %q failed", "b")), }, }, { name: "unschedulable and unresolvable", extenders: []st.FakeExtender{ { Predicates: []st.FitPredicate{func(pod *v1.Pod, node *v1.Node) *framework.Status { if node.Name == "a" { return framework.NewStatus(framework.Success) } if node.Name == "b" { return framework.NewStatus(framework.Unschedulable, fmt.Sprintf("node %q is not allowed", node.Name)) } return framework.NewStatus(framework.UnschedulableAndUnresolvable, fmt.Sprintf("node %q is not allowed", node.Name)) }}, }, }, nodes: makeNodeList([]string{"a", "b", "c"}), filteredNodesStatuses: make(framework.NodeToStatusMap), expectsErr: false, expectedNodes: makeNodeList([]string{"a"}), expectedStatuses: framework.NodeToStatusMap{ "b": framework.NewStatus(framework.Unschedulable, fmt.Sprintf("FakeExtender: node %q failed", "b")), "c": framework.NewStatus(framework.UnschedulableAndUnresolvable, fmt.Sprintf("FakeExtender: node %q failed and unresolvable", "c")), }, }, { name: "extender may overwrite the statuses", extenders: []st.FakeExtender{ { Predicates: []st.FitPredicate{func(pod *v1.Pod, node *v1.Node) *framework.Status { if node.Name == "a" { return framework.NewStatus(framework.Success) } if node.Name == "b" { return framework.NewStatus(framework.Unschedulable, fmt.Sprintf("node %q is not allowed", node.Name)) } return framework.NewStatus(framework.UnschedulableAndUnresolvable, fmt.Sprintf("node %q is not allowed", node.Name)) }}, }, }, nodes: makeNodeList([]string{"a", "b", "c"}), filteredNodesStatuses: framework.NodeToStatusMap{ "c": framework.NewStatus(framework.Unschedulable, fmt.Sprintf("FakeFilterPlugin: node %q failed", "c")), }, expectsErr: false, expectedNodes: makeNodeList([]string{"a"}), expectedStatuses: framework.NodeToStatusMap{ "b": framework.NewStatus(framework.Unschedulable, fmt.Sprintf("FakeExtender: node %q failed", "b")), "c": framework.NewStatus(framework.UnschedulableAndUnresolvable, fmt.Sprintf("FakeFilterPlugin: node %q failed", "c"), fmt.Sprintf("FakeExtender: node %q failed and unresolvable", "c")), }, }, { name: "multiple extenders", extenders: []st.FakeExtender{ { Predicates: []st.FitPredicate{func(pod *v1.Pod, node *v1.Node) *framework.Status { if node.Name == "a" { return framework.NewStatus(framework.Success) } if node.Name == "b" { return framework.NewStatus(framework.Unschedulable, fmt.Sprintf("node %q is not allowed", node.Name)) } return framework.NewStatus(framework.UnschedulableAndUnresolvable, fmt.Sprintf("node %q is not allowed", node.Name)) }}, }, { Predicates: []st.FitPredicate{func(pod *v1.Pod, node *v1.Node) *framework.Status { if node.Name == "a" { return framework.NewStatus(framework.Success) } return framework.NewStatus(framework.Unschedulable, fmt.Sprintf("node %q is not allowed", node.Name)) }}, }, }, nodes: makeNodeList([]string{"a", "b", "c"}), filteredNodesStatuses: make(framework.NodeToStatusMap), expectsErr: false, expectedNodes: makeNodeList([]string{"a"}), expectedStatuses: framework.NodeToStatusMap{ "b": framework.NewStatus(framework.Unschedulable, fmt.Sprintf("FakeExtender: node %q failed", "b")), "c": framework.NewStatus(framework.UnschedulableAndUnresolvable, fmt.Sprintf("FakeExtender: node %q failed and unresolvable", "c")), }, }, } cmpOpts := []cmp.Option{ cmp.Comparer(func(s1 framework.Status, s2 framework.Status) bool { return s1.Code() == s2.Code() && reflect.DeepEqual(s1.Reasons(), s2.Reasons()) }), } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { var extenders []framework.Extender for ii := range tt.extenders { extenders = append(extenders, &tt.extenders[ii]) } scheduler := &genericScheduler{ extenders: extenders, } pod := &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "1", UID: types.UID("1")}} got, err := scheduler.findNodesThatPassExtenders(pod, tt.nodes, tt.filteredNodesStatuses) if tt.expectsErr { if err == nil { t.Error("Unexpected non-error") } } else { if err != nil { t.Errorf("Unexpected error: %v", err) } if diff := cmp.Diff(tt.expectedNodes, got); diff != "" { t.Errorf("filtered nodes (-want,+got):\n%s", diff) } if diff := cmp.Diff(tt.expectedStatuses, tt.filteredNodesStatuses, cmpOpts...); diff != "" { t.Errorf("filtered statuses (-want,+got):\n%s", diff) } } }) } } func TestGenericScheduler(t *testing.T) { tests := []struct { name string registerPlugins []st.RegisterPluginFunc nodes []string pvcs []v1.PersistentVolumeClaim pod *v1.Pod pods []*v1.Pod expectedHosts sets.String wErr error }{ { registerPlugins: []st.RegisterPluginFunc{ st.RegisterQueueSortPlugin(queuesort.Name, queuesort.New), st.RegisterFilterPlugin("FalseFilter", st.NewFalseFilterPlugin), st.RegisterBindPlugin(defaultbinder.Name, defaultbinder.New), }, nodes: []string{"machine1", "machine2"}, pod: &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "2", UID: types.UID("2")}}, name: "test 1", wErr: &framework.FitError{ Pod: &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "2", UID: types.UID("2")}}, NumAllNodes: 2, Diagnosis: framework.Diagnosis{ NodeToStatusMap: framework.NodeToStatusMap{ "machine1": framework.NewStatus(framework.Unschedulable, st.ErrReasonFake).WithFailedPlugin("FalseFilter"), "machine2": framework.NewStatus(framework.Unschedulable, st.ErrReasonFake).WithFailedPlugin("FalseFilter"), }, UnschedulablePlugins: sets.NewString("FalseFilter"), }, }, }, { registerPlugins: []st.RegisterPluginFunc{ st.RegisterQueueSortPlugin(queuesort.Name, queuesort.New), st.RegisterFilterPlugin("TrueFilter", st.NewTrueFilterPlugin), st.RegisterBindPlugin(defaultbinder.Name, defaultbinder.New), }, nodes: []string{"machine1", "machine2"}, pod: &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "ignore", UID: types.UID("ignore")}}, expectedHosts: sets.NewString("machine1", "machine2"), name: "test 2", wErr: nil, }, { // Fits on a machine where the pod ID matches the machine name registerPlugins: []st.RegisterPluginFunc{ st.RegisterQueueSortPlugin(queuesort.Name, queuesort.New), st.RegisterFilterPlugin("MatchFilter", st.NewMatchFilterPlugin), st.RegisterBindPlugin(defaultbinder.Name, defaultbinder.New), }, nodes: []string{"machine1", "machine2"}, pod: &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "machine2", UID: types.UID("machine2")}}, expectedHosts: sets.NewString("machine2"), name: "test 3", wErr: nil, }, { registerPlugins: []st.RegisterPluginFunc{ st.RegisterQueueSortPlugin(queuesort.Name, queuesort.New), st.RegisterFilterPlugin("TrueFilter", st.NewTrueFilterPlugin), st.RegisterScorePlugin("NumericMap", newNumericMapPlugin(), 1), st.RegisterBindPlugin(defaultbinder.Name, defaultbinder.New), }, nodes: []string{"3", "2", "1"}, pod: &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "ignore", UID: types.UID("ignore")}}, expectedHosts: sets.NewString("3"), name: "test 4", wErr: nil, }, { registerPlugins: []st.RegisterPluginFunc{ st.RegisterQueueSortPlugin(queuesort.Name, queuesort.New), st.RegisterFilterPlugin("MatchFilter", st.NewMatchFilterPlugin), st.RegisterScorePlugin("NumericMap", newNumericMapPlugin(), 1), st.RegisterBindPlugin(defaultbinder.Name, defaultbinder.New), }, nodes: []string{"3", "2", "1"}, pod: &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "2", UID: types.UID("2")}}, expectedHosts: sets.NewString("2"), name: "test 5", wErr: nil, }, { registerPlugins: []st.RegisterPluginFunc{ st.RegisterQueueSortPlugin(queuesort.Name, queuesort.New), st.RegisterFilterPlugin("TrueFilter", st.NewTrueFilterPlugin), st.RegisterScorePlugin("NumericMap", newNumericMapPlugin(), 1), st.RegisterScorePlugin("ReverseNumericMap", newReverseNumericMapPlugin(), 2), st.RegisterBindPlugin(defaultbinder.Name, defaultbinder.New), }, nodes: []string{"3", "2", "1"}, pod: &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "2", UID: types.UID("2")}}, expectedHosts: sets.NewString("1"), name: "test 6", wErr: nil, }, { registerPlugins: []st.RegisterPluginFunc{ st.RegisterQueueSortPlugin(queuesort.Name, queuesort.New), st.RegisterFilterPlugin("TrueFilter", st.NewTrueFilterPlugin), st.RegisterFilterPlugin("FalseFilter", st.NewFalseFilterPlugin), st.RegisterScorePlugin("NumericMap", newNumericMapPlugin(), 1), st.RegisterBindPlugin(defaultbinder.Name, defaultbinder.New), }, nodes: []string{"3", "2", "1"}, pod: &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "2", UID: types.UID("2")}}, name: "test 7", wErr: &framework.FitError{ Pod: &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "2", UID: types.UID("2")}}, NumAllNodes: 3, Diagnosis: framework.Diagnosis{ NodeToStatusMap: framework.NodeToStatusMap{ "3": framework.NewStatus(framework.Unschedulable, st.ErrReasonFake).WithFailedPlugin("FalseFilter"), "2": framework.NewStatus(framework.Unschedulable, st.ErrReasonFake).WithFailedPlugin("FalseFilter"), "1": framework.NewStatus(framework.Unschedulable, st.ErrReasonFake).WithFailedPlugin("FalseFilter"), }, UnschedulablePlugins: sets.NewString("FalseFilter"), }, }, }, { registerPlugins: []st.RegisterPluginFunc{ st.RegisterQueueSortPlugin(queuesort.Name, queuesort.New), st.RegisterFilterPlugin("NoPodsFilter", NewNoPodsFilterPlugin), st.RegisterFilterPlugin("MatchFilter", st.NewMatchFilterPlugin), st.RegisterScorePlugin("NumericMap", newNumericMapPlugin(), 1), st.RegisterBindPlugin(defaultbinder.Name, defaultbinder.New), }, pods: []*v1.Pod{ { ObjectMeta: metav1.ObjectMeta{Name: "2", UID: types.UID("2")}, Spec: v1.PodSpec{ NodeName: "2", }, Status: v1.PodStatus{ Phase: v1.PodRunning, }, }, }, pod: &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "2", UID: types.UID("2")}}, nodes: []string{"1", "2"}, name: "test 8", wErr: &framework.FitError{ Pod: &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "2", UID: types.UID("2")}}, NumAllNodes: 2, Diagnosis: framework.Diagnosis{ NodeToStatusMap: framework.NodeToStatusMap{ "1": framework.NewStatus(framework.Unschedulable, st.ErrReasonFake).WithFailedPlugin("MatchFilter"), "2": framework.NewStatus(framework.Unschedulable, st.ErrReasonFake).WithFailedPlugin("NoPodsFilter"), }, UnschedulablePlugins: sets.NewString("MatchFilter", "NoPodsFilter"), }, }, }, { // Pod with existing PVC registerPlugins: []st.RegisterPluginFunc{ st.RegisterQueueSortPlugin(queuesort.Name, queuesort.New), st.RegisterPreFilterPlugin(volumebinding.Name, volumebinding.New), st.RegisterFilterPlugin("TrueFilter", st.NewTrueFilterPlugin), st.RegisterBindPlugin(defaultbinder.Name, defaultbinder.New), }, nodes: []string{"machine1", "machine2"}, pvcs: []v1.PersistentVolumeClaim{ { ObjectMeta: metav1.ObjectMeta{Name: "existingPVC", UID: types.UID("existingPVC"), Namespace: v1.NamespaceDefault}, Spec: v1.PersistentVolumeClaimSpec{VolumeName: "existingPV"}, }, }, pod: &v1.Pod{ ObjectMeta: metav1.ObjectMeta{Name: "ignore", UID: types.UID("ignore"), Namespace: v1.NamespaceDefault}, Spec: v1.PodSpec{ Volumes: []v1.Volume{ { VolumeSource: v1.VolumeSource{ PersistentVolumeClaim: &v1.PersistentVolumeClaimVolumeSource{ ClaimName: "existingPVC", }, }, }, }, }, }, expectedHosts: sets.NewString("machine1", "machine2"), name: "existing PVC", wErr: nil, }, { // Pod with non existing PVC registerPlugins: []st.RegisterPluginFunc{ st.RegisterQueueSortPlugin(queuesort.Name, queuesort.New), st.RegisterPreFilterPlugin(volumebinding.Name, volumebinding.New), st.RegisterFilterPlugin("TrueFilter", st.NewTrueFilterPlugin), st.RegisterBindPlugin(defaultbinder.Name, defaultbinder.New), }, nodes: []string{"machine1", "machine2"}, pod: &v1.Pod{ ObjectMeta: metav1.ObjectMeta{Name: "ignore", UID: types.UID("ignore")}, Spec: v1.PodSpec{ Volumes: []v1.Volume{ { VolumeSource: v1.VolumeSource{ PersistentVolumeClaim: &v1.PersistentVolumeClaimVolumeSource{ ClaimName: "unknownPVC", }, }, }, }, }, }, name: "unknown PVC", wErr: &framework.FitError{ Pod: &v1.Pod{ ObjectMeta: metav1.ObjectMeta{Name: "ignore", UID: types.UID("ignore")}, Spec: v1.PodSpec{ Volumes: []v1.Volume{ { VolumeSource: v1.VolumeSource{ PersistentVolumeClaim: &v1.PersistentVolumeClaimVolumeSource{ ClaimName: "unknownPVC", }, }, }, }, }, }, NumAllNodes: 2, Diagnosis: framework.Diagnosis{ NodeToStatusMap: framework.NodeToStatusMap{ "machine1": framework.NewStatus(framework.UnschedulableAndUnresolvable, `persistentvolumeclaim "unknownPVC" not found`).WithFailedPlugin(volumebinding.Name), "machine2": framework.NewStatus(framework.UnschedulableAndUnresolvable, `persistentvolumeclaim "unknownPVC" not found`).WithFailedPlugin(volumebinding.Name), }, UnschedulablePlugins: sets.NewString(volumebinding.Name), }, }, }, { // Pod with deleting PVC registerPlugins: []st.RegisterPluginFunc{ st.RegisterQueueSortPlugin(queuesort.Name, queuesort.New), st.RegisterPreFilterPlugin(volumebinding.Name, volumebinding.New), st.RegisterFilterPlugin("TrueFilter", st.NewTrueFilterPlugin), st.RegisterBindPlugin(defaultbinder.Name, defaultbinder.New), }, nodes: []string{"machine1", "machine2"}, pvcs: []v1.PersistentVolumeClaim{{ObjectMeta: metav1.ObjectMeta{Name: "existingPVC", UID: types.UID("existingPVC"), Namespace: v1.NamespaceDefault, DeletionTimestamp: &metav1.Time{}}}}, pod: &v1.Pod{ ObjectMeta: metav1.ObjectMeta{Name: "ignore", UID: types.UID("ignore"), Namespace: v1.NamespaceDefault}, Spec: v1.PodSpec{ Volumes: []v1.Volume{ { VolumeSource: v1.VolumeSource{ PersistentVolumeClaim: &v1.PersistentVolumeClaimVolumeSource{ ClaimName: "existingPVC", }, }, }, }, }, }, name: "deleted PVC", wErr: &framework.FitError{ Pod: &v1.Pod{ ObjectMeta: metav1.ObjectMeta{Name: "ignore", UID: types.UID("ignore"), Namespace: v1.NamespaceDefault}, Spec: v1.PodSpec{ Volumes: []v1.Volume{ { VolumeSource: v1.VolumeSource{ PersistentVolumeClaim: &v1.PersistentVolumeClaimVolumeSource{ ClaimName: "existingPVC", }, }, }, }, }, }, NumAllNodes: 2, Diagnosis: framework.Diagnosis{ NodeToStatusMap: framework.NodeToStatusMap{ "machine1": framework.NewStatus(framework.UnschedulableAndUnresolvable, `persistentvolumeclaim "existingPVC" is being deleted`).WithFailedPlugin(volumebinding.Name), "machine2": framework.NewStatus(framework.UnschedulableAndUnresolvable, `persistentvolumeclaim "existingPVC" is being deleted`).WithFailedPlugin(volumebinding.Name), }, UnschedulablePlugins: sets.NewString(volumebinding.Name), }, }, }, { registerPlugins: []st.RegisterPluginFunc{ st.RegisterQueueSortPlugin(queuesort.Name, queuesort.New), st.RegisterFilterPlugin("TrueFilter", st.NewTrueFilterPlugin), st.RegisterScorePlugin("FalseMap", newFalseMapPlugin(), 1), st.RegisterScorePlugin("TrueMap", newTrueMapPlugin(), 2), st.RegisterBindPlugin(defaultbinder.Name, defaultbinder.New), }, nodes: []string{"2", "1"}, pod: &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "2"}}, name: "test error with priority map", wErr: fmt.Errorf("running Score plugins: %w", fmt.Errorf(`plugin "FalseMap" failed with: %w`, errPrioritize)), }, { name: "test podtopologyspread plugin - 2 nodes with maxskew=1", registerPlugins: []st.RegisterPluginFunc{ st.RegisterQueueSortPlugin(queuesort.Name, queuesort.New), st.RegisterPluginAsExtensions( podtopologyspread.Name, podtopologyspread.New, "PreFilter", "Filter", ), st.RegisterBindPlugin(defaultbinder.Name, defaultbinder.New), }, nodes: []string{"machine1", "machine2"}, pod: &v1.Pod{ ObjectMeta: metav1.ObjectMeta{Name: "p", UID: types.UID("p"), Labels: map[string]string{"foo": ""}}, Spec: v1.PodSpec{ TopologySpreadConstraints: []v1.TopologySpreadConstraint{ { MaxSkew: 1, TopologyKey: "hostname", WhenUnsatisfiable: v1.DoNotSchedule, LabelSelector: &metav1.LabelSelector{ MatchExpressions: []metav1.LabelSelectorRequirement{ { Key: "foo", Operator: metav1.LabelSelectorOpExists, }, }, }, }, }, }, }, pods: []*v1.Pod{ { ObjectMeta: metav1.ObjectMeta{Name: "pod1", UID: types.UID("pod1"), Labels: map[string]string{"foo": ""}}, Spec: v1.PodSpec{ NodeName: "machine1", }, Status: v1.PodStatus{ Phase: v1.PodRunning, }, }, }, expectedHosts: sets.NewString("machine2"), wErr: nil, }, { name: "test podtopologyspread plugin - 3 nodes with maxskew=2", registerPlugins: []st.RegisterPluginFunc{ st.RegisterQueueSortPlugin(queuesort.Name, queuesort.New), st.RegisterPluginAsExtensions( podtopologyspread.Name, podtopologyspread.New, "PreFilter", "Filter", ), st.RegisterBindPlugin(defaultbinder.Name, defaultbinder.New), }, nodes: []string{"machine1", "machine2", "machine3"}, pod: &v1.Pod{ ObjectMeta: metav1.ObjectMeta{Name: "p", UID: types.UID("p"), Labels: map[string]string{"foo": ""}}, Spec: v1.PodSpec{ TopologySpreadConstraints: []v1.TopologySpreadConstraint{ { MaxSkew: 2, TopologyKey: "hostname", WhenUnsatisfiable: v1.DoNotSchedule, LabelSelector: &metav1.LabelSelector{ MatchExpressions: []metav1.LabelSelectorRequirement{ { Key: "foo", Operator: metav1.LabelSelectorOpExists, }, }, }, }, }, }, }, pods: []*v1.Pod{ { ObjectMeta: metav1.ObjectMeta{Name: "pod1a", UID: types.UID("pod1a"), Labels: map[string]string{"foo": ""}}, Spec: v1.PodSpec{ NodeName: "machine1", }, Status: v1.PodStatus{ Phase: v1.PodRunning, }, }, { ObjectMeta: metav1.ObjectMeta{Name: "pod1b", UID: types.UID("pod1b"), Labels: map[string]string{"foo": ""}}, Spec: v1.PodSpec{ NodeName: "machine1", }, Status: v1.PodStatus{ Phase: v1.PodRunning, }, }, { ObjectMeta: metav1.ObjectMeta{Name: "pod2", UID: types.UID("pod2"), Labels: map[string]string{"foo": ""}}, Spec: v1.PodSpec{ NodeName: "machine2", }, Status: v1.PodStatus{ Phase: v1.PodRunning, }, }, }, expectedHosts: sets.NewString("machine2", "machine3"), wErr: nil, }, { name: "test with filter plugin returning Unschedulable status", registerPlugins: []st.RegisterPluginFunc{ st.RegisterQueueSortPlugin(queuesort.Name, queuesort.New), st.RegisterFilterPlugin( "FakeFilter", st.NewFakeFilterPlugin(map[string]framework.Code{"3": framework.Unschedulable}), ), st.RegisterScorePlugin("NumericMap", newNumericMapPlugin(), 1), st.RegisterBindPlugin(defaultbinder.Name, defaultbinder.New), }, nodes: []string{"3"}, pod: &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "test-filter", UID: types.UID("test-filter")}}, expectedHosts: nil, wErr: &framework.FitError{ Pod: &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "test-filter", UID: types.UID("test-filter")}}, NumAllNodes: 1, Diagnosis: framework.Diagnosis{ NodeToStatusMap: framework.NodeToStatusMap{ "3": framework.NewStatus(framework.Unschedulable, "injecting failure for pod test-filter").WithFailedPlugin("FakeFilter"), }, UnschedulablePlugins: sets.NewString("FakeFilter"), }, }, }, { name: "test with filter plugin returning UnschedulableAndUnresolvable status", registerPlugins: []st.RegisterPluginFunc{ st.RegisterQueueSortPlugin(queuesort.Name, queuesort.New), st.RegisterFilterPlugin( "FakeFilter", st.NewFakeFilterPlugin(map[string]framework.Code{"3": framework.UnschedulableAndUnresolvable}), ), st.RegisterScorePlugin("NumericMap", newNumericMapPlugin(), 1), st.RegisterBindPlugin(defaultbinder.Name, defaultbinder.New), }, nodes: []string{"3"}, pod: &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "test-filter", UID: types.UID("test-filter")}}, expectedHosts: nil, wErr: &framework.FitError{ Pod: &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "test-filter", UID: types.UID("test-filter")}}, NumAllNodes: 1, Diagnosis: framework.Diagnosis{ NodeToStatusMap: framework.NodeToStatusMap{ "3": framework.NewStatus(framework.UnschedulableAndUnresolvable, "injecting failure for pod test-filter").WithFailedPlugin("FakeFilter"), }, UnschedulablePlugins: sets.NewString("FakeFilter"), }, }, }, { name: "test with partial failed filter plugin", registerPlugins: []st.RegisterPluginFunc{ st.RegisterQueueSortPlugin(queuesort.Name, queuesort.New), st.RegisterFilterPlugin( "FakeFilter", st.NewFakeFilterPlugin(map[string]framework.Code{"1": framework.Unschedulable}), ), st.RegisterScorePlugin("NumericMap", newNumericMapPlugin(), 1), st.RegisterBindPlugin(defaultbinder.Name, defaultbinder.New), }, nodes: []string{"1", "2"}, pod: &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "test-filter", UID: types.UID("test-filter")}}, expectedHosts: nil, wErr: nil, }, { name: "test prefilter plugin returning Unschedulable status", registerPlugins: []st.RegisterPluginFunc{ st.RegisterQueueSortPlugin(queuesort.Name, queuesort.New), st.RegisterPreFilterPlugin( "FakePreFilter", st.NewFakePreFilterPlugin(framework.NewStatus(framework.UnschedulableAndUnresolvable, "injected unschedulable status")), ), st.RegisterBindPlugin(defaultbinder.Name, defaultbinder.New), }, nodes: []string{"1", "2"}, pod: &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "test-prefilter", UID: types.UID("test-prefilter")}}, expectedHosts: nil, wErr: &framework.FitError{ Pod: &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "test-prefilter", UID: types.UID("test-prefilter")}}, NumAllNodes: 2, Diagnosis: framework.Diagnosis{ NodeToStatusMap: framework.NodeToStatusMap{ "1": framework.NewStatus(framework.UnschedulableAndUnresolvable, "injected unschedulable status").WithFailedPlugin("FakePreFilter"), "2": framework.NewStatus(framework.UnschedulableAndUnresolvable, "injected unschedulable status").WithFailedPlugin("FakePreFilter"), }, UnschedulablePlugins: sets.NewString("FakePreFilter"), }, }, }, { name: "test prefilter plugin returning error status", registerPlugins: []st.RegisterPluginFunc{ st.RegisterQueueSortPlugin(queuesort.Name, queuesort.New), st.RegisterPreFilterPlugin( "FakePreFilter", st.NewFakePreFilterPlugin(framework.NewStatus(framework.Error, "injected error status")), ), st.RegisterBindPlugin(defaultbinder.Name, defaultbinder.New), }, nodes: []string{"1", "2"}, pod: &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "test-prefilter", UID: types.UID("test-prefilter")}}, expectedHosts: nil, wErr: fmt.Errorf(`running PreFilter plugin "FakePreFilter": %w`, errors.New("injected error status")), }, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { cache := internalcache.New(time.Duration(0), wait.NeverStop) for _, pod := range test.pods { cache.AddPod(pod) } var nodes []*v1.Node for _, name := range test.nodes { node := &v1.Node{ObjectMeta: metav1.ObjectMeta{Name: name, Labels: map[string]string{"hostname": name}}} nodes = append(nodes, node) cache.AddNode(node) } ctx := context.Background() cs := clientsetfake.NewSimpleClientset() informerFactory := informers.NewSharedInformerFactory(cs, 0) for _, pvc := range test.pvcs { metav1.SetMetaDataAnnotation(&pvc.ObjectMeta, pvutil.AnnBindCompleted, "true") cs.CoreV1().PersistentVolumeClaims(pvc.Namespace).Create(ctx, &pvc, metav1.CreateOptions{}) if pvName := pvc.Spec.VolumeName; pvName != "" { pv := v1.PersistentVolume{ObjectMeta: metav1.ObjectMeta{Name: pvName}} cs.CoreV1().PersistentVolumes().Create(ctx, &pv, metav1.CreateOptions{}) } } snapshot := internalcache.NewSnapshot(test.pods, nodes) fwk, err := st.NewFramework( test.registerPlugins, frameworkruntime.WithSnapshotSharedLister(snapshot), frameworkruntime.WithInformerFactory(informerFactory), frameworkruntime.WithPodNominator(internalqueue.NewPodNominator()), ) if err != nil { t.Fatal(err) } scheduler := NewGenericScheduler( cache, snapshot, []framework.Extender{}, schedulerapi.DefaultPercentageOfNodesToScore, ) informerFactory.Start(ctx.Done()) informerFactory.WaitForCacheSync(ctx.Done()) result, err := scheduler.Schedule(ctx, fwk, framework.NewCycleState(), test.pod) // TODO(#94696): replace reflect.DeepEqual with cmp.Diff(). if err != test.wErr { gotFitErr, gotOK := err.(*framework.FitError) wantFitErr, wantOK := test.wErr.(*framework.FitError) if gotOK != wantOK { t.Errorf("Expected err to be FitError: %v, but got %v", wantOK, gotOK) } else if gotOK && !reflect.DeepEqual(gotFitErr, wantFitErr) { t.Errorf("Unexpected fitError. Want %v, but got %v", wantFitErr, gotFitErr) } } if test.expectedHosts != nil && !test.expectedHosts.Has(result.SuggestedHost) { t.Errorf("Expected: %s, got: %s", test.expectedHosts, result.SuggestedHost) } if test.wErr == nil && len(test.nodes) != result.EvaluatedNodes { t.Errorf("Expected EvaluatedNodes: %d, got: %d", len(test.nodes), result.EvaluatedNodes) } }) } } // makeScheduler makes a simple genericScheduler for testing. func makeScheduler(nodes []*v1.Node) *genericScheduler { cache := internalcache.New(time.Duration(0), wait.NeverStop) for _, n := range nodes { cache.AddNode(n) } s := NewGenericScheduler( cache, emptySnapshot, nil, schedulerapi.DefaultPercentageOfNodesToScore) cache.UpdateSnapshot(s.(*genericScheduler).nodeInfoSnapshot) return s.(*genericScheduler) } func TestFindFitAllError(t *testing.T) { nodes := makeNodeList([]string{"3", "2", "1"}) scheduler := makeScheduler(nodes) fwk, err := st.NewFramework( []st.RegisterPluginFunc{ st.RegisterQueueSortPlugin(queuesort.Name, queuesort.New), st.RegisterFilterPlugin("TrueFilter", st.NewTrueFilterPlugin), st.RegisterFilterPlugin("MatchFilter", st.NewMatchFilterPlugin), st.RegisterBindPlugin(defaultbinder.Name, defaultbinder.New), }, frameworkruntime.WithPodNominator(internalqueue.NewPodNominator()), ) if err != nil { t.Fatal(err) } _, diagnosis, err := scheduler.findNodesThatFitPod(context.Background(), fwk, framework.NewCycleState(), &v1.Pod{}) if err != nil { t.Errorf("unexpected error: %v", err) } // TODO(#94696): use cmp.Diff() to compare `diagnosis`. if len(diagnosis.NodeToStatusMap) != len(nodes) { t.Errorf("unexpected failed status map: %v", diagnosis.NodeToStatusMap) } if diff := cmp.Diff(sets.NewString("MatchFilter"), diagnosis.UnschedulablePlugins); diff != "" { t.Errorf("Unexpected unschedulablePlugins: (-want, +got): %s", diagnosis.UnschedulablePlugins) } } func TestFindFitSomeError(t *testing.T) { nodes := makeNodeList([]string{"3", "2", "1"}) scheduler := makeScheduler(nodes) fwk, err := st.NewFramework( []st.RegisterPluginFunc{ st.RegisterQueueSortPlugin(queuesort.Name, queuesort.New), st.RegisterFilterPlugin("TrueFilter", st.NewTrueFilterPlugin), st.RegisterFilterPlugin("MatchFilter", st.NewMatchFilterPlugin), st.RegisterBindPlugin(defaultbinder.Name, defaultbinder.New), }, frameworkruntime.WithPodNominator(internalqueue.NewPodNominator()), ) if err != nil { t.Fatal(err) } pod := &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "1", UID: types.UID("1")}} _, diagnosis, err := scheduler.findNodesThatFitPod(context.Background(), fwk, framework.NewCycleState(), pod) if err != nil { t.Errorf("unexpected error: %v", err) } if len(diagnosis.NodeToStatusMap) != len(nodes)-1 { t.Errorf("unexpected failed status map: %v", diagnosis.NodeToStatusMap) } if diff := cmp.Diff(sets.NewString("MatchFilter"), diagnosis.UnschedulablePlugins); diff != "" { t.Errorf("Unexpected unschedulablePlugins: (-want, +got): %s", diagnosis.UnschedulablePlugins) } for _, node := range nodes { if node.Name == pod.Name { continue } t.Run(node.Name, func(t *testing.T) { status, found := diagnosis.NodeToStatusMap[node.Name] if !found { t.Errorf("failed to find node %v in %v", node.Name, diagnosis.NodeToStatusMap) } reasons := status.Reasons() if len(reasons) != 1 || reasons[0] != st.ErrReasonFake { t.Errorf("unexpected failures: %v", reasons) } }) } } func TestFindFitPredicateCallCounts(t *testing.T) { tests := []struct { name string pod *v1.Pod expectedCount int32 }{ { name: "nominated pods have lower priority, predicate is called once", pod: &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "1", UID: types.UID("1")}, Spec: v1.PodSpec{Priority: &highPriority}}, expectedCount: 1, }, { name: "nominated pods have higher priority, predicate is called twice", pod: &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "1", UID: types.UID("1")}, Spec: v1.PodSpec{Priority: &lowPriority}}, expectedCount: 2, }, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { nodes := makeNodeList([]string{"1"}) plugin := st.FakeFilterPlugin{} registerFakeFilterFunc := st.RegisterFilterPlugin( "FakeFilter", func(_ runtime.Object, fh framework.Handle) (framework.Plugin, error) { return &plugin, nil }, ) registerPlugins := []st.RegisterPluginFunc{ st.RegisterQueueSortPlugin(queuesort.Name, queuesort.New), registerFakeFilterFunc, st.RegisterBindPlugin(defaultbinder.Name, defaultbinder.New), } fwk, err := st.NewFramework( registerPlugins, frameworkruntime.WithPodNominator(internalqueue.NewPodNominator()), ) if err != nil { t.Fatal(err) } scheduler := makeScheduler(nodes) if err := scheduler.cache.UpdateSnapshot(scheduler.nodeInfoSnapshot); err != nil { t.Fatal(err) } fwk.PreemptHandle().AddNominatedPod(&v1.Pod{ObjectMeta: metav1.ObjectMeta{UID: "nominated"}, Spec: v1.PodSpec{Priority: &midPriority}}, "1") _, _, err = scheduler.findNodesThatFitPod(context.Background(), fwk, framework.NewCycleState(), test.pod) if err != nil { t.Errorf("unexpected error: %v", err) } if test.expectedCount != plugin.NumFilterCalled { t.Errorf("predicate was called %d times, expected is %d", plugin.NumFilterCalled, test.expectedCount) } }) } } func makeNode(node string, milliCPU, memory int64) *v1.Node { return &v1.Node{ ObjectMeta: metav1.ObjectMeta{Name: node}, Status: v1.NodeStatus{ Capacity: v1.ResourceList{ v1.ResourceCPU: *resource.NewMilliQuantity(milliCPU, resource.DecimalSI), v1.ResourceMemory: *resource.NewQuantity(memory, resource.BinarySI), "pods": *resource.NewQuantity(100, resource.DecimalSI), }, Allocatable: v1.ResourceList{ v1.ResourceCPU: *resource.NewMilliQuantity(milliCPU, resource.DecimalSI), v1.ResourceMemory: *resource.NewQuantity(memory, resource.BinarySI), "pods": *resource.NewQuantity(100, resource.DecimalSI), }, }, } } // The point of this test is to show that you: // - get the same priority for a zero-request pod as for a pod with the defaults requests, // both when the zero-request pod is already on the machine and when the zero-request pod // is the one being scheduled. // - don't get the same score no matter what we schedule. func TestZeroRequest(t *testing.T) { // A pod with no resources. We expect spreading to count it as having the default resources. noResources := v1.PodSpec{ Containers: []v1.Container{ {}, }, } noResources1 := noResources noResources1.NodeName = "machine1" // A pod with the same resources as a 0-request pod gets by default as its resources (for spreading). small := v1.PodSpec{ Containers: []v1.Container{ { Resources: v1.ResourceRequirements{ Requests: v1.ResourceList{ v1.ResourceCPU: resource.MustParse( strconv.FormatInt(schedutil.DefaultMilliCPURequest, 10) + "m"), v1.ResourceMemory: resource.MustParse( strconv.FormatInt(schedutil.DefaultMemoryRequest, 10)), }, }, }, }, } small2 := small small2.NodeName = "machine2" // A larger pod. large := v1.PodSpec{ Containers: []v1.Container{ { Resources: v1.ResourceRequirements{ Requests: v1.ResourceList{ v1.ResourceCPU: resource.MustParse( strconv.FormatInt(schedutil.DefaultMilliCPURequest*3, 10) + "m"), v1.ResourceMemory: resource.MustParse( strconv.FormatInt(schedutil.DefaultMemoryRequest*3, 10)), }, }, }, }, } large1 := large large1.NodeName = "machine1" large2 := large large2.NodeName = "machine2" tests := []struct { pod *v1.Pod pods []*v1.Pod nodes []*v1.Node name string expectedScore int64 }{ // The point of these next two tests is to show you get the same priority for a zero-request pod // as for a pod with the defaults requests, both when the zero-request pod is already on the machine // and when the zero-request pod is the one being scheduled. { pod: &v1.Pod{Spec: noResources}, nodes: []*v1.Node{makeNode("machine1", 1000, schedutil.DefaultMemoryRequest*10), makeNode("machine2", 1000, schedutil.DefaultMemoryRequest*10)}, name: "test priority of zero-request pod with machine with zero-request pod", pods: []*v1.Pod{ {Spec: large1}, {Spec: noResources1}, {Spec: large2}, {Spec: small2}, }, expectedScore: 250, }, { pod: &v1.Pod{Spec: small}, nodes: []*v1.Node{makeNode("machine1", 1000, schedutil.DefaultMemoryRequest*10), makeNode("machine2", 1000, schedutil.DefaultMemoryRequest*10)}, name: "test priority of nonzero-request pod with machine with zero-request pod", pods: []*v1.Pod{ {Spec: large1}, {Spec: noResources1}, {Spec: large2}, {Spec: small2}, }, expectedScore: 250, }, // The point of this test is to verify that we're not just getting the same score no matter what we schedule. { pod: &v1.Pod{Spec: large}, nodes: []*v1.Node{makeNode("machine1", 1000, schedutil.DefaultMemoryRequest*10), makeNode("machine2", 1000, schedutil.DefaultMemoryRequest*10)}, name: "test priority of larger pod with machine with zero-request pod", pods: []*v1.Pod{ {Spec: large1}, {Spec: noResources1}, {Spec: large2}, {Spec: small2}, }, expectedScore: 230, }, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { client := clientsetfake.NewSimpleClientset() informerFactory := informers.NewSharedInformerFactory(client, 0) snapshot := internalcache.NewSnapshot(test.pods, test.nodes) pluginRegistrations := []st.RegisterPluginFunc{ st.RegisterQueueSortPlugin(queuesort.Name, queuesort.New), st.RegisterScorePlugin(noderesources.LeastAllocatedName, noderesources.NewLeastAllocated, 1), st.RegisterScorePlugin(noderesources.BalancedAllocationName, noderesources.NewBalancedAllocation, 1), st.RegisterScorePlugin(selectorspread.Name, selectorspread.New, 1), st.RegisterPreScorePlugin(selectorspread.Name, selectorspread.New), st.RegisterBindPlugin(defaultbinder.Name, defaultbinder.New), } fwk, err := st.NewFramework( pluginRegistrations, frameworkruntime.WithInformerFactory(informerFactory), frameworkruntime.WithSnapshotSharedLister(snapshot), frameworkruntime.WithClientSet(client), frameworkruntime.WithPodNominator(internalqueue.NewPodNominator()), ) if err != nil { t.Fatalf("error creating framework: %+v", err) } scheduler := NewGenericScheduler( nil, emptySnapshot, []framework.Extender{}, schedulerapi.DefaultPercentageOfNodesToScore).(*genericScheduler) scheduler.nodeInfoSnapshot = snapshot ctx := context.Background() state := framework.NewCycleState() _, _, err = scheduler.findNodesThatFitPod(ctx, fwk, state, test.pod) if err != nil { t.Fatalf("error filtering nodes: %+v", err) } fwk.RunPreScorePlugins(ctx, state, test.pod, test.nodes) list, err := scheduler.prioritizeNodes(ctx, fwk, state, test.pod, test.nodes) if err != nil { t.Errorf("unexpected error: %v", err) } for _, hp := range list { if hp.Score != test.expectedScore { t.Errorf("expected %d for all priorities, got list %#v", test.expectedScore, list) } } }) } } var lowPriority, midPriority, highPriority = int32(0), int32(100), int32(1000) func TestNumFeasibleNodesToFind(t *testing.T) { tests := []struct { name string percentageOfNodesToScore int32 numAllNodes int32 wantNumNodes int32 }{ { name: "not set percentageOfNodesToScore and nodes number not more than 50", numAllNodes: 10, wantNumNodes: 10, }, { name: "set percentageOfNodesToScore and nodes number not more than 50", percentageOfNodesToScore: 40, numAllNodes: 10, wantNumNodes: 10, }, { name: "not set percentageOfNodesToScore and nodes number more than 50", numAllNodes: 1000, wantNumNodes: 420, }, { name: "set percentageOfNodesToScore and nodes number more than 50", percentageOfNodesToScore: 40, numAllNodes: 1000, wantNumNodes: 400, }, { name: "not set percentageOfNodesToScore and nodes number more than 50*125", numAllNodes: 6000, wantNumNodes: 300, }, { name: "set percentageOfNodesToScore and nodes number more than 50*125", percentageOfNodesToScore: 40, numAllNodes: 6000, wantNumNodes: 2400, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { g := &genericScheduler{ percentageOfNodesToScore: tt.percentageOfNodesToScore, } if gotNumNodes := g.numFeasibleNodesToFind(tt.numAllNodes); gotNumNodes != tt.wantNumNodes { t.Errorf("genericScheduler.numFeasibleNodesToFind() = %v, want %v", gotNumNodes, tt.wantNumNodes) } }) } } func TestFairEvaluationForNodes(t *testing.T) { numAllNodes := 500 nodeNames := make([]string, 0, numAllNodes) for i := 0; i < numAllNodes; i++ { nodeNames = append(nodeNames, strconv.Itoa(i)) } nodes := makeNodeList(nodeNames) g := makeScheduler(nodes) fwk, err := st.NewFramework( []st.RegisterPluginFunc{ st.RegisterQueueSortPlugin(queuesort.Name, queuesort.New), st.RegisterFilterPlugin("TrueFilter", st.NewTrueFilterPlugin), st.RegisterBindPlugin(defaultbinder.Name, defaultbinder.New), }, frameworkruntime.WithPodNominator(internalqueue.NewPodNominator()), ) if err != nil { t.Fatal(err) } // To make numAllNodes % nodesToFind != 0 g.percentageOfNodesToScore = 30 nodesToFind := int(g.numFeasibleNodesToFind(int32(numAllNodes))) // Iterating over all nodes more than twice for i := 0; i < 2*(numAllNodes/nodesToFind+1); i++ { nodesThatFit, _, err := g.findNodesThatFitPod(context.Background(), fwk, framework.NewCycleState(), &v1.Pod{}) if err != nil { t.Errorf("unexpected error: %v", err) } if len(nodesThatFit) != nodesToFind { t.Errorf("got %d nodes filtered, want %d", len(nodesThatFit), nodesToFind) } if g.nextStartNodeIndex != (i+1)*nodesToFind%numAllNodes { t.Errorf("got %d lastProcessedNodeIndex, want %d", g.nextStartNodeIndex, (i+1)*nodesToFind%numAllNodes) } } } func TestPreferNominatedNodeFilterCallCounts(t *testing.T) { tests := []struct { name string feature bool pod *v1.Pod nodeReturnCodeMap map[string]framework.Code expectedCount int32 expectedPatchRequests int }{ { name: "Enable the feature, pod has the nominated node set, filter is called only once", feature: true, pod: st.MakePod().Name("p_with_nominated_node").UID("p").Priority(highPriority).NominatedNodeName("node1").Obj(), expectedCount: 1, }, { name: "Disable the feature, pod has the nominated node, filter is called for each node", feature: false, pod: st.MakePod().Name("p_with_nominated_node").UID("p").Priority(highPriority).NominatedNodeName("node1").Obj(), expectedCount: 3, }, { name: "pod without the nominated pod, filter is called for each node", feature: true, pod: st.MakePod().Name("p_without_nominated_node").UID("p").Priority(highPriority).Obj(), expectedCount: 3, }, { name: "nominated pod cannot pass the filter, filter is called for each node", feature: true, pod: st.MakePod().Name("p_with_nominated_node").UID("p").Priority(highPriority).NominatedNodeName("node1").Obj(), nodeReturnCodeMap: map[string]framework.Code{"node1": framework.Unschedulable}, expectedCount: 4, }, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.PreferNominatedNode, test.feature)() // create three nodes in the cluster. nodes := makeNodeList([]string{"node1", "node2", "node3"}) client := &clientsetfake.Clientset{} cache := internalcache.New(time.Duration(0), wait.NeverStop) for _, n := range nodes { cache.AddNode(n) } plugin := st.FakeFilterPlugin{FailedNodeReturnCodeMap: test.nodeReturnCodeMap} registerFakeFilterFunc := st.RegisterFilterPlugin( "FakeFilter", func(_ runtime.Object, fh framework.Handle) (framework.Plugin, error) { return &plugin, nil }, ) registerPlugins := []st.RegisterPluginFunc{ st.RegisterQueueSortPlugin(queuesort.Name, queuesort.New), registerFakeFilterFunc, st.RegisterBindPlugin(defaultbinder.Name, defaultbinder.New), } fwk, err := st.NewFramework( registerPlugins, frameworkruntime.WithClientSet(client), frameworkruntime.WithPodNominator(internalqueue.NewPodNominator()), ) if err != nil { t.Fatal(err) } snapshot := internalcache.NewSnapshot(nil, nodes) scheduler := NewGenericScheduler( cache, snapshot, []framework.Extender{}, schedulerapi.DefaultPercentageOfNodesToScore).(*genericScheduler) _, _, err = scheduler.findNodesThatFitPod(context.Background(), fwk, framework.NewCycleState(), test.pod) if err != nil { t.Errorf("unexpected error: %v", err) } if test.expectedCount != plugin.NumFilterCalled { t.Errorf("predicate was called %d times, expected is %d", plugin.NumFilterCalled, test.expectedCount) } }) } }
{ "content_hash": "3d5dc40c231336eebbbd292cc96786f0", "timestamp": "", "source": "github", "line_count": 1518, "max_line_length": 190, "avg_line_length": 35.493412384716734, "alnum_prop": 0.6731379572746339, "repo_name": "sanjeevm0/kubernetes", "id": "ea172e7f45aca902b7a465e0dfd04ee64eb3feac", "size": "54448", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "pkg/scheduler/core/generic_scheduler_test.go", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "2539" }, { "name": "Go", "bytes": "45319151" }, { "name": "HTML", "bytes": "2641473" }, { "name": "Makefile", "bytes": "81485" }, { "name": "Nginx", "bytes": "1608" }, { "name": "PowerShell", "bytes": "4261" }, { "name": "Protocol Buffer", "bytes": "699181" }, { "name": "Python", "bytes": "1434627" }, { "name": "Ruby", "bytes": "300" }, { "name": "SaltStack", "bytes": "55417" }, { "name": "Shell", "bytes": "1548188" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jsf="http://jsf.jd.com/schema/jsf" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://jsf.jd.com/schema/jsf http://jsf.jd.com/schema/jsf/jsf.xsd"> <!-- 消费服务 <jsf:consumer id="queryOrderTrackService" interface="com.jd.o2o.ots.core.api.service.query.ordertrack.QueryOrderTrackService" protocol="jsf" alias="${mvn.jsf.service.alias}" timeout="60000" check="false"> </jsf:consumer> --> </beans>
{ "content_hash": "6c7c48fa14bda3397da0b2211f97d011", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 129, "avg_line_length": 50.642857142857146, "alnum_prop": 0.6671368124118476, "repo_name": "yangshuai0711/dingding-app-server", "id": "ff3cba2880634942ae509dcba10294afae9106a8", "size": "717", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "dingding-app-server-rpc/src/main/resources/rpc/spring-config-jsf-client.xml", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "299" }, { "name": "CSS", "bytes": "184803" }, { "name": "HTML", "bytes": "41678" }, { "name": "Java", "bytes": "115974" }, { "name": "JavaScript", "bytes": "284462" } ], "symlink_target": "" }
<manifest package="me.caiying.indexlistview" xmlns:android="http://schemas.android.com/apk/res/android"> <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsRtl="true" android:theme="@style/AppTheme"> <activity android:name=".MainActivity"> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity> <activity android:name=".DemoCursorActivity"/> </application> </manifest>
{ "content_hash": "883d340887f59e6d0bd79c36ddda0476", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 75, "avg_line_length": 32.523809523809526, "alnum_prop": 0.6178623718887262, "repo_name": "yc10x/IndexListView", "id": "4cd48c9fa77ecf46b98bce060be9aef234af9350", "size": "683", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/main/AndroidManifest.xml", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "77664" } ], "symlink_target": "" }
const prompt = require('prompt'); const { exec } = require('child_process'); require('dotenv').config({ silent: true }); const schema = { properties: { app: { description: 'Choose an application, Map or Stories (m/s)', pattern: /^m{1}|s{1}$/, required: true } } }; prompt.message = ''; prompt.start(); prompt.get(schema, (err, result) => { if (err) return console.log(err); const script = { m: 'cd map; npm start', s: 'cd stories; NODE_PATH=src npm start' }[result.app]; if (script) { const child = exec(script); child.stdout.pipe(process.stdout); child.stderr.pipe(process.stderr); } else { console.error('Nah ah!! (m/s): Map or Stories'); } });
{ "content_hash": "e73d51c8062ea947aa759d577e1c6dd1", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 65, "avg_line_length": 21.727272727272727, "alnum_prop": 0.5941422594142259, "repo_name": "Vizzuality/care_usa", "id": "1ce3066a96e5ebe5574e37357bc3831fd2b64f3f", "size": "717", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "config/dev.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "156537" }, { "name": "HTML", "bytes": "555502" }, { "name": "JavaScript", "bytes": "292498" } ], "symlink_target": "" }
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>CodePen - A Pen by Benjamin Laguna</title> </head> <body> <html> <head> <title>A Pen by Ben</title> </head> <body> <h1>Notes<br><b></h1>Stage 0</b><br><br><br> Key Terms/Ideas<br><br> <em>HTML</em>: HypertextMarkup Language<br> <em>HTTP</em>: Hypertext transfer protocol <br> <em>Tags</em>: These start and end a string of code, and give it a function to do something. Tags begin adn end with <> and end with < / >, telling the browser to interpret the HTML into a specific type of element <br> <em>Inline vs. Block</em>: In reference to whether the tag provides an output that is part of a continuous line vs. making an editable box of code.<br> <em>Inserting Comments</em>: To insert comments into the HTML code, you can use the tag < ! -- (without the spaces)<br> <!-->or as such></!> <em>Head</em>: Element contains information that won't be displayed on the page<br> <em>Title</em>: Element normally sets the name of the browser tab <br> <em>Linking a webpage</em>: You can place the following code: a href="www.google.com" TEXT /a, or simply <a href="www.google.com"> Google </a> <br> <em>Linking to an image</em>: You can linke to an image by placing an inline tag img src="link to an image.jpg" alt="text" style="something by something" or simply <img src="https://upload.wikimedia.org/wikipedia/commons/thumb/5/5c/Olympic_rings_without_rims.svg/342px-Olympic_rings_without_rims.svg.png" <br> </body> </html> </body> </html>
{ "content_hash": "c11dc46403f23f65a92f491d81befb04", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 310, "avg_line_length": 32.25, "alnum_prop": 0.6866925064599483, "repo_name": "blaguna/getting-started-with-html_1", "id": "d951c3087ac467be64f2d7a3116dbaea6bdb08da", "size": "1548", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "index.html", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "1548" } ], "symlink_target": "" }
//The MIT License(MIT) //copyright(c) 2016 Alberto Rodriguez //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; namespace LiveCharts.Helpers { /// <summary> /// LiveCharts extensions methods /// </summary> public static class Extentions { /// <summary> /// Executes an Action in every item of a collection /// </summary> /// <typeparam name="T">type to iterate with</typeparam> /// <param name="source">collection to iterate</param> /// <param name="predicate">action to execute</param> public static void ForEach<T>(this IEnumerable<T> source, Action<T> predicate) { foreach (var item in source) predicate(item); } /// <summary> /// Splits a collection of points every double.Nan /// </summary> /// <param name="toSplit">collection to split</param> /// <returns>collection of collections</returns> public static IEnumerable<IList<ChartPoint>> SplitEachNaN(this IList<ChartPoint> toSplit) { var l = new List<ChartPoint>(toSplit.Count); var acum = -1; foreach (var point in toSplit) { if (double.IsNaN(point.X) || double.IsNaN(point.Y)) { yield return l; acum += l.Count; l = new List<ChartPoint>(toSplit.Count - acum); } else { l.Add(point); } } yield return l; } /// <summary> /// Return the inverse axis orientation /// </summary> /// <param name="axis">current orientation</param> /// <returns>inverted axis orientation</returns> public static AxisOrientation Invert(this AxisOrientation axis) { return axis == AxisOrientation.X ? AxisOrientation.Y : AxisOrientation.X; } /// <summary> /// Converts any collection to chart values /// </summary> /// <typeparam name="T">type to convert</typeparam> /// <param name="values">values to convert</param> /// <returns>a new ChartValues instance containing the passed collection</returns> public static ChartValues<T> AsChartValues<T>(this IEnumerable<T> values) { var l = new ChartValues<T>(); l.AddRange(values); return l; } } }
{ "content_hash": "46f412f04855704f9ac49ee402615a5a", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 97, "avg_line_length": 37.208333333333336, "alnum_prop": 0.6097424412094065, "repo_name": "rusanov-vladimir/Live-Charts", "id": "5c5a198883c326c833d5c09d5ba0d548ee69eac6", "size": "3574", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "Core40/Helpers/Extentions.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "1919075" }, { "name": "PowerShell", "bytes": "5873" } ], "symlink_target": "" }
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package AppActions; import java.awt.event.ActionEvent; import javax.swing.AbstractAction; /** * * @author lukasgreiner */ public class closeAction extends AbstractAction{ public closeAction() { this.putValue(NAME,"Close"); } @Override public void actionPerformed(ActionEvent e) { System.exit(0); } }
{ "content_hash": "9638e9f9ba3f1a88c2dd004ab876e5bb", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 79, "avg_line_length": 20.074074074074073, "alnum_prop": 0.6789667896678967, "repo_name": "LukeG317/TwitchHLS", "id": "d25efa5530cfa8a699e38349f63caaeecce623c9", "size": "542", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/AppActions/closeAction.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "41694" } ], "symlink_target": "" }
package inst import ( "testing" "github.com/stretchr/testify/require" ) //nolint:staticcheck func TestParseTag(t *testing.T) { { tag, err := ParseTag("") require.True(t, tag == nil) require.Error(t, err) } { tag, err := ParseTag("=") require.True(t, tag == nil) require.Error(t, err) } { tag, err := ParseTag("=backup") require.True(t, tag == nil) require.Error(t, err) } { tag, err := ParseTag(" =backup") require.True(t, tag == nil) require.Error(t, err) } { tag, err := ParseTag("role") require.NoError(t, err) require.True(t, tag != nil) require.Equal(t, tag.TagName, "role") require.Equal(t, tag.TagValue, "") require.False(t, tag.Negate) require.False(t, tag.HasValue) require.Equal(t, tag.String(), "role=") } { tag, err := ParseTag("role=") require.NoError(t, err) require.True(t, tag != nil) require.Equal(t, tag.TagName, "role") require.Equal(t, tag.TagValue, "") require.False(t, tag.Negate) require.True(t, tag.HasValue) require.Equal(t, tag.String(), "role=") } { tag, err := ParseTag("role=backup") require.NoError(t, err) require.True(t, tag != nil) require.Equal(t, tag.TagName, "role") require.Equal(t, tag.TagValue, "backup") require.False(t, tag.Negate) require.True(t, tag.HasValue) require.Equal(t, tag.String(), "role=backup") } { tag, err := ParseTag("!role") require.NoError(t, err) require.True(t, tag != nil) require.Equal(t, tag.TagName, "role") require.True(t, tag.Negate) require.False(t, tag.HasValue) } { tag, err := ParseTag("~role=backup") require.NoError(t, err) require.True(t, tag != nil) require.Equal(t, tag.TagName, "role") require.Equal(t, tag.TagValue, "backup") require.True(t, tag.Negate) require.True(t, tag.HasValue) } } func TestParseIntersectTags(t *testing.T) { { _, err := ParseIntersectTags("") require.Error(t, err) } { _, err := ParseIntersectTags(",") require.Error(t, err) } { _, err := ParseIntersectTags(",,,") require.Error(t, err) } { _, err := ParseIntersectTags("role,") require.Error(t, err) } { tags, err := ParseIntersectTags("role") require.NoError(t, err) require.Equal(t, len(tags), 1) require.Equal(t, tags[0].TagName, "role") require.Equal(t, tags[0].TagValue, "") require.False(t, tags[0].Negate) require.False(t, tags[0].HasValue) } { tags, err := ParseIntersectTags("role,dc") require.NoError(t, err) require.Equal(t, len(tags), 2) require.Equal(t, tags[0].TagName, "role") require.Equal(t, tags[0].TagValue, "") require.False(t, tags[0].Negate) require.False(t, tags[0].HasValue) require.Equal(t, tags[1].TagName, "dc") require.Equal(t, tags[1].TagValue, "") require.False(t, tags[1].Negate) require.False(t, tags[1].HasValue) } { tags, err := ParseIntersectTags("role=backup, !dc=ny") require.NoError(t, err) require.Equal(t, len(tags), 2) require.Equal(t, tags[0].TagName, "role") require.Equal(t, tags[0].TagValue, "backup") require.False(t, tags[0].Negate) require.True(t, tags[0].HasValue) require.Equal(t, tags[1].TagName, "dc") require.Equal(t, tags[1].TagValue, "ny") require.True(t, tags[1].Negate) require.True(t, tags[1].HasValue) } }
{ "content_hash": "6dd2488d8df763f037012f94a48d16ce", "timestamp": "", "source": "github", "line_count": 141, "max_line_length": 56, "avg_line_length": 22.9645390070922, "alnum_prop": 0.6374305126621371, "repo_name": "vitessio/vitess", "id": "0ce182b7fb2ac35afc79c6dd8b6a20fde5aad74b", "size": "3238", "binary": false, "copies": "2", "ref": "refs/heads/main", "path": "go/vt/vtorc/inst/tag_test.go", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Assembly", "bytes": "198" }, { "name": "CSS", "bytes": "18852" }, { "name": "Dockerfile", "bytes": "28594" }, { "name": "Go", "bytes": "23060389" }, { "name": "HCL", "bytes": "959" }, { "name": "HTML", "bytes": "25753" }, { "name": "Java", "bytes": "990163" }, { "name": "JavaScript", "bytes": "33028" }, { "name": "Jsonnet", "bytes": "121075" }, { "name": "Makefile", "bytes": "23322" }, { "name": "Perl", "bytes": "3161" }, { "name": "Python", "bytes": "1955" }, { "name": "SCSS", "bytes": "41351" }, { "name": "Shell", "bytes": "183827" }, { "name": "Smarty", "bytes": "30493" }, { "name": "TypeScript", "bytes": "711819" }, { "name": "Yacc", "bytes": "162805" } ], "symlink_target": "" }
package com.gdn.venice.persistence; import java.io.Serializable; import javax.persistence.*; import java.util.List; /** * The persistent class for the raf_role database table. * */ @Entity @Table(name="raf_role") public class RafRole implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy=GenerationType.TABLE, generator="raf_role") @TableGenerator(name="raf_role", table="openjpaseq", pkColumnName="id", valueColumnName="sequence_value", allocationSize=1) //flush every 1 insert //@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="raf_role_seq") //@SequenceGenerator(name="raf_role_seq", sequenceName="raf_role_seq")//,allocationSize=1) @Column(name="role_id") private Long roleId; @Column(name="role_desc", nullable=false, length=200) private String roleDesc; @Column(name="role_name", nullable=false, length=100) private String roleName; //bi-directional many-to-one association to RafRole @ManyToOne @JoinColumn(name="parent_role_id") private RafRole rafRole; //bi-directional many-to-one association to RafRole @OneToMany(mappedBy="rafRole") private List<RafRole> rafRoles; //bi-directional many-to-one association to RafRoleProfile @OneToMany(mappedBy="rafRole") private List<RafRoleProfile> rafRoleProfiles; public RafRole() { } public Long getRoleId() { return this.roleId; } public void setRoleId(Long roleId) { this.roleId = roleId; } public String getRoleDesc() { return this.roleDesc; } public void setRoleDesc(String roleDesc) { this.roleDesc = roleDesc; } public String getRoleName() { return this.roleName; } public void setRoleName(String roleName) { this.roleName = roleName; } public RafRole getRafRole() { return this.rafRole; } public void setRafRole(RafRole rafRole) { this.rafRole = rafRole; } public List<RafRole> getRafRoles() { return this.rafRoles; } public void setRafRoles(List<RafRole> rafRoles) { this.rafRoles = rafRoles; } public List<RafRoleProfile> getRafRoleProfiles() { return this.rafRoleProfiles; } public void setRafRoleProfiles(List<RafRoleProfile> rafRoleProfiles) { this.rafRoleProfiles = rafRoleProfiles; } }
{ "content_hash": "ddfd8b8619de61f11fe48757d492a64a", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 148, "avg_line_length": 23.166666666666668, "alnum_prop": 0.7405575539568345, "repo_name": "yauritux/venice-legacy", "id": "a6cf3b065bef52532b56753eaa3887d1a1e60566", "size": "2224", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Venice/Venice-Interface-Model/src/main/java/com/gdn/venice/persistence/RafRole.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ASP", "bytes": "270052" }, { "name": "ActionScript", "bytes": "241582" }, { "name": "C#", "bytes": "77780" }, { "name": "CSS", "bytes": "281718" }, { "name": "Java", "bytes": "19297374" }, { "name": "JavaScript", "bytes": "426505" }, { "name": "PHP", "bytes": "443666" }, { "name": "Perl", "bytes": "1716" }, { "name": "Ruby", "bytes": "152554" }, { "name": "Visual Basic", "bytes": "71378" }, { "name": "XSLT", "bytes": "207588" } ], "symlink_target": "" }
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AnyTypeAnnotation = AnyTypeAnnotation; exports.ArrayTypeAnnotation = ArrayTypeAnnotation; exports.BooleanTypeAnnotation = BooleanTypeAnnotation; exports.BooleanLiteralTypeAnnotation = BooleanLiteralTypeAnnotation; exports.NullLiteralTypeAnnotation = NullLiteralTypeAnnotation; exports.DeclareClass = DeclareClass; exports.DeclareFunction = DeclareFunction; exports.InferredPredicate = InferredPredicate; exports.DeclaredPredicate = DeclaredPredicate; exports.DeclareInterface = DeclareInterface; exports.DeclareModule = DeclareModule; exports.DeclareModuleExports = DeclareModuleExports; exports.DeclareTypeAlias = DeclareTypeAlias; exports.DeclareOpaqueType = DeclareOpaqueType; exports.DeclareVariable = DeclareVariable; exports.DeclareExportDeclaration = DeclareExportDeclaration; exports.DeclareExportAllDeclaration = DeclareExportAllDeclaration; exports.EnumDeclaration = EnumDeclaration; exports.EnumBooleanBody = EnumBooleanBody; exports.EnumNumberBody = EnumNumberBody; exports.EnumStringBody = EnumStringBody; exports.EnumSymbolBody = EnumSymbolBody; exports.EnumDefaultedMember = EnumDefaultedMember; exports.EnumBooleanMember = EnumBooleanMember; exports.EnumNumberMember = EnumNumberMember; exports.EnumStringMember = EnumStringMember; exports.ExistsTypeAnnotation = ExistsTypeAnnotation; exports.FunctionTypeAnnotation = FunctionTypeAnnotation; exports.FunctionTypeParam = FunctionTypeParam; exports.GenericTypeAnnotation = exports.ClassImplements = exports.InterfaceExtends = InterfaceExtends; exports._interfaceish = _interfaceish; exports._variance = _variance; exports.InterfaceDeclaration = InterfaceDeclaration; exports.InterfaceTypeAnnotation = InterfaceTypeAnnotation; exports.IntersectionTypeAnnotation = IntersectionTypeAnnotation; exports.MixedTypeAnnotation = MixedTypeAnnotation; exports.EmptyTypeAnnotation = EmptyTypeAnnotation; exports.NullableTypeAnnotation = NullableTypeAnnotation; exports.NumberTypeAnnotation = NumberTypeAnnotation; exports.StringTypeAnnotation = StringTypeAnnotation; exports.ThisTypeAnnotation = ThisTypeAnnotation; exports.TupleTypeAnnotation = TupleTypeAnnotation; exports.TypeofTypeAnnotation = TypeofTypeAnnotation; exports.TypeAlias = TypeAlias; exports.TypeAnnotation = TypeAnnotation; exports.TypeParameterDeclaration = exports.TypeParameterInstantiation = TypeParameterInstantiation; exports.TypeParameter = TypeParameter; exports.OpaqueType = OpaqueType; exports.ObjectTypeAnnotation = ObjectTypeAnnotation; exports.ObjectTypeInternalSlot = ObjectTypeInternalSlot; exports.ObjectTypeCallProperty = ObjectTypeCallProperty; exports.ObjectTypeIndexer = ObjectTypeIndexer; exports.ObjectTypeProperty = ObjectTypeProperty; exports.ObjectTypeSpreadProperty = ObjectTypeSpreadProperty; exports.QualifiedTypeIdentifier = QualifiedTypeIdentifier; exports.SymbolTypeAnnotation = SymbolTypeAnnotation; exports.UnionTypeAnnotation = UnionTypeAnnotation; exports.TypeCastExpression = TypeCastExpression; exports.Variance = Variance; exports.VoidTypeAnnotation = VoidTypeAnnotation; Object.defineProperty(exports, "NumberLiteralTypeAnnotation", { enumerable: true, get: function () { return _types2.NumericLiteral; } }); Object.defineProperty(exports, "StringLiteralTypeAnnotation", { enumerable: true, get: function () { return _types2.StringLiteral; } }); var t = _interopRequireWildcard(require("@babel/types")); var _modules = require("./modules"); var _types2 = require("./types"); function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } function AnyTypeAnnotation() { this.word("any"); } function ArrayTypeAnnotation(node) { this.print(node.elementType, node); this.token("["); this.token("]"); } function BooleanTypeAnnotation() { this.word("boolean"); } function BooleanLiteralTypeAnnotation(node) { this.word(node.value ? "true" : "false"); } function NullLiteralTypeAnnotation() { this.word("null"); } function DeclareClass(node, parent) { if (!t.isDeclareExportDeclaration(parent)) { this.word("declare"); this.space(); } this.word("class"); this.space(); this._interfaceish(node); } function DeclareFunction(node, parent) { if (!t.isDeclareExportDeclaration(parent)) { this.word("declare"); this.space(); } this.word("function"); this.space(); this.print(node.id, node); this.print(node.id.typeAnnotation.typeAnnotation, node); if (node.predicate) { this.space(); this.print(node.predicate, node); } this.semicolon(); } function InferredPredicate() { this.token("%"); this.word("checks"); } function DeclaredPredicate(node) { this.token("%"); this.word("checks"); this.token("("); this.print(node.value, node); this.token(")"); } function DeclareInterface(node) { this.word("declare"); this.space(); this.InterfaceDeclaration(node); } function DeclareModule(node) { this.word("declare"); this.space(); this.word("module"); this.space(); this.print(node.id, node); this.space(); this.print(node.body, node); } function DeclareModuleExports(node) { this.word("declare"); this.space(); this.word("module"); this.token("."); this.word("exports"); this.print(node.typeAnnotation, node); } function DeclareTypeAlias(node) { this.word("declare"); this.space(); this.TypeAlias(node); } function DeclareOpaqueType(node, parent) { if (!t.isDeclareExportDeclaration(parent)) { this.word("declare"); this.space(); } this.OpaqueType(node); } function DeclareVariable(node, parent) { if (!t.isDeclareExportDeclaration(parent)) { this.word("declare"); this.space(); } this.word("var"); this.space(); this.print(node.id, node); this.print(node.id.typeAnnotation, node); this.semicolon(); } function DeclareExportDeclaration(node) { this.word("declare"); this.space(); this.word("export"); this.space(); if (node.default) { this.word("default"); this.space(); } FlowExportDeclaration.apply(this, arguments); } function DeclareExportAllDeclaration() { this.word("declare"); this.space(); _modules.ExportAllDeclaration.apply(this, arguments); } function EnumDeclaration(node) { const { id, body } = node; this.word("enum"); this.space(); this.print(id, node); this.print(body, node); } function enumExplicitType(context, name, hasExplicitType) { if (hasExplicitType) { context.space(); context.word("of"); context.space(); context.word(name); } context.space(); } function enumBody(context, node) { const { members } = node; context.token("{"); context.indent(); context.newline(); for (const member of members) { context.print(member, node); context.newline(); } context.dedent(); context.token("}"); } function EnumBooleanBody(node) { const { explicitType } = node; enumExplicitType(this, "boolean", explicitType); enumBody(this, node); } function EnumNumberBody(node) { const { explicitType } = node; enumExplicitType(this, "number", explicitType); enumBody(this, node); } function EnumStringBody(node) { const { explicitType } = node; enumExplicitType(this, "string", explicitType); enumBody(this, node); } function EnumSymbolBody(node) { enumExplicitType(this, "symbol", true); enumBody(this, node); } function EnumDefaultedMember(node) { const { id } = node; this.print(id, node); this.token(","); } function enumInitializedMember(context, node) { const { id, init } = node; context.print(id, node); context.space(); context.token("="); context.space(); context.print(init, node); context.token(","); } function EnumBooleanMember(node) { enumInitializedMember(this, node); } function EnumNumberMember(node) { enumInitializedMember(this, node); } function EnumStringMember(node) { enumInitializedMember(this, node); } function FlowExportDeclaration(node) { if (node.declaration) { const declar = node.declaration; this.print(declar, node); if (!t.isStatement(declar)) this.semicolon(); } else { this.token("{"); if (node.specifiers.length) { this.space(); this.printList(node.specifiers, node); this.space(); } this.token("}"); if (node.source) { this.space(); this.word("from"); this.space(); this.print(node.source, node); } this.semicolon(); } } function ExistsTypeAnnotation() { this.token("*"); } function FunctionTypeAnnotation(node, parent) { this.print(node.typeParameters, node); this.token("("); this.printList(node.params, node); if (node.rest) { if (node.params.length) { this.token(","); this.space(); } this.token("..."); this.print(node.rest, node); } this.token(")"); if (parent.type === "ObjectTypeCallProperty" || parent.type === "DeclareFunction" || parent.type === "ObjectTypeProperty" && parent.method) { this.token(":"); } else { this.space(); this.token("=>"); } this.space(); this.print(node.returnType, node); } function FunctionTypeParam(node) { this.print(node.name, node); if (node.optional) this.token("?"); if (node.name) { this.token(":"); this.space(); } this.print(node.typeAnnotation, node); } function InterfaceExtends(node) { this.print(node.id, node); this.print(node.typeParameters, node); } function _interfaceish(node) { this.print(node.id, node); this.print(node.typeParameters, node); if (node.extends.length) { this.space(); this.word("extends"); this.space(); this.printList(node.extends, node); } if (node.mixins && node.mixins.length) { this.space(); this.word("mixins"); this.space(); this.printList(node.mixins, node); } if (node.implements && node.implements.length) { this.space(); this.word("implements"); this.space(); this.printList(node.implements, node); } this.space(); this.print(node.body, node); } function _variance(node) { if (node.variance) { if (node.variance.kind === "plus") { this.token("+"); } else if (node.variance.kind === "minus") { this.token("-"); } } } function InterfaceDeclaration(node) { this.word("interface"); this.space(); this._interfaceish(node); } function andSeparator() { this.space(); this.token("&"); this.space(); } function InterfaceTypeAnnotation(node) { this.word("interface"); if (node.extends && node.extends.length) { this.space(); this.word("extends"); this.space(); this.printList(node.extends, node); } this.space(); this.print(node.body, node); } function IntersectionTypeAnnotation(node) { this.printJoin(node.types, node, { separator: andSeparator }); } function MixedTypeAnnotation() { this.word("mixed"); } function EmptyTypeAnnotation() { this.word("empty"); } function NullableTypeAnnotation(node) { this.token("?"); this.print(node.typeAnnotation, node); } function NumberTypeAnnotation() { this.word("number"); } function StringTypeAnnotation() { this.word("string"); } function ThisTypeAnnotation() { this.word("this"); } function TupleTypeAnnotation(node) { this.token("["); this.printList(node.types, node); this.token("]"); } function TypeofTypeAnnotation(node) { this.word("typeof"); this.space(); this.print(node.argument, node); } function TypeAlias(node) { this.word("type"); this.space(); this.print(node.id, node); this.print(node.typeParameters, node); this.space(); this.token("="); this.space(); this.print(node.right, node); this.semicolon(); } function TypeAnnotation(node) { this.token(":"); this.space(); if (node.optional) this.token("?"); this.print(node.typeAnnotation, node); } function TypeParameterInstantiation(node) { this.token("<"); this.printList(node.params, node, {}); this.token(">"); } function TypeParameter(node) { this._variance(node); this.word(node.name); if (node.bound) { this.print(node.bound, node); } if (node.default) { this.space(); this.token("="); this.space(); this.print(node.default, node); } } function OpaqueType(node) { this.word("opaque"); this.space(); this.word("type"); this.space(); this.print(node.id, node); this.print(node.typeParameters, node); if (node.supertype) { this.token(":"); this.space(); this.print(node.supertype, node); } if (node.impltype) { this.space(); this.token("="); this.space(); this.print(node.impltype, node); } this.semicolon(); } function ObjectTypeAnnotation(node) { if (node.exact) { this.token("{|"); } else { this.token("{"); } const props = node.properties.concat(node.callProperties || [], node.indexers || [], node.internalSlots || []); if (props.length) { this.space(); this.printJoin(props, node, { addNewlines(leading) { if (leading && !props[0]) return 1; }, indent: true, statement: true, iterator: () => { if (props.length !== 1 || node.inexact) { this.token(","); this.space(); } } }); this.space(); } if (node.inexact) { this.indent(); this.token("..."); if (props.length) { this.newline(); } this.dedent(); } if (node.exact) { this.token("|}"); } else { this.token("}"); } } function ObjectTypeInternalSlot(node) { if (node.static) { this.word("static"); this.space(); } this.token("["); this.token("["); this.print(node.id, node); this.token("]"); this.token("]"); if (node.optional) this.token("?"); if (!node.method) { this.token(":"); this.space(); } this.print(node.value, node); } function ObjectTypeCallProperty(node) { if (node.static) { this.word("static"); this.space(); } this.print(node.value, node); } function ObjectTypeIndexer(node) { if (node.static) { this.word("static"); this.space(); } this._variance(node); this.token("["); if (node.id) { this.print(node.id, node); this.token(":"); this.space(); } this.print(node.key, node); this.token("]"); this.token(":"); this.space(); this.print(node.value, node); } function ObjectTypeProperty(node) { if (node.proto) { this.word("proto"); this.space(); } if (node.static) { this.word("static"); this.space(); } if (node.kind === "get" || node.kind === "set") { this.word(node.kind); this.space(); } this._variance(node); this.print(node.key, node); if (node.optional) this.token("?"); if (!node.method) { this.token(":"); this.space(); } this.print(node.value, node); } function ObjectTypeSpreadProperty(node) { this.token("..."); this.print(node.argument, node); } function QualifiedTypeIdentifier(node) { this.print(node.qualification, node); this.token("."); this.print(node.id, node); } function SymbolTypeAnnotation() { this.word("symbol"); } function orSeparator() { this.space(); this.token("|"); this.space(); } function UnionTypeAnnotation(node) { this.printJoin(node.types, node, { separator: orSeparator }); } function TypeCastExpression(node) { this.token("("); this.print(node.expression, node); this.print(node.typeAnnotation, node); this.token(")"); } function Variance(node) { if (node.kind === "plus") { this.token("+"); } else { this.token("-"); } } function VoidTypeAnnotation() { this.word("void"); }
{ "content_hash": "a130baa1efae6196dadb95075b5584e1", "timestamp": "", "source": "github", "line_count": 753, "max_line_length": 743, "avg_line_length": 21.9136786188579, "alnum_prop": 0.6764438518877643, "repo_name": "jarv/cmdchallenge", "id": "08c1734bee15da034865f0458f7a4670fffae8ed", "size": "16501", "binary": false, "copies": "7", "ref": "refs/heads/master", "path": "node_modules/@babel/generator/lib/generators/flow.js", "mode": "33188", "license": "mit", "language": [ { "name": "Go", "bytes": "9107" }, { "name": "Makefile", "bytes": "1117" }, { "name": "Python", "bytes": "10274" }, { "name": "Roff", "bytes": "11314" }, { "name": "Shell", "bytes": "3325" } ], "symlink_target": "" }
package monix.execution.internal.collection private[monix] trait EvictingQueue[A] extends Buffer[A] { /** * Returns the capacity of this queue. */ def capacity: Int /** * Returns true if the queue is at capacity. */ def isAtCapacity: Boolean /** Pushes a new element in the queue. On overflow, it starts * to evict old elements from the queue. * * @return the number of elements that were evicted in case of * overflow or zero otherwise */ def offer(elem: A): Int /** Pushes the given sequence of elements on the queue. On overflow, * it starts to evict old elements from the queue. */ def offerMany(seq: A*): Long /** Returns the first element in the queue, and removes this element * from the queue. * * @return the first element of the queue or `null` if empty */ def poll(): A /** Given an array, polls as many available elements in it as * can fit and returns the number of elements that were copied, * a number that will be equal to `min(queue.length, array.length)`. */ def drainToArray(array: Array[A], offset: Int = 0): Int /** Given a Scala `Buffer`, polls as many available elements in the * queue, up to the maximum specified by `limit`. * * @param buffer is the buffer where to polled items * @param limit is the maximum limit applied to the number of polled items */ def drainToBuffer(buffer: scala.collection.mutable.Buffer[A], limit: Int): Int }
{ "content_hash": "e02d75e1aa3a3f913cf1f2ead0192dbc", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 80, "avg_line_length": 30.591836734693878, "alnum_prop": 0.6664442961974649, "repo_name": "monix/monix", "id": "4d59a71ef16583458a7503b3ff309831cdd83077", "size": "2159", "binary": false, "copies": "2", "ref": "refs/heads/series/4.x", "path": "monix-execution/shared/src/main/scala/monix/execution/internal/collection/EvictingQueue.scala", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "188710" }, { "name": "Nix", "bytes": "693" }, { "name": "Ruby", "bytes": "3327" }, { "name": "Scala", "bytes": "5561418" } ], "symlink_target": "" }
ACCEPTED #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
{ "content_hash": "a6b4d90b9771fb3a7b83ae3be310394e", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 10.307692307692308, "alnum_prop": 0.6940298507462687, "repo_name": "mdoering/backbone", "id": "82bfc6fc8a7c7707cebc714053c45ce4b67a30c0", "size": "189", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Chromista/Cryptophyta/Cryptophyceae/Cryptomonadales/Cryptomonadaceae/Cryptomonas/Cryptomonas stigmatica/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
package org.switchyard.test.quickstarts.demo; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit.Arquillian; import org.jboss.shrinkwrap.api.spec.WebArchive; import org.junit.Test; import org.junit.runner.RunWith; import org.custommonkey.xmlunit.XMLAssert; import org.switchyard.test.ArquillianUtil; import org.switchyard.component.test.mixins.http.HTTPMixIn; import org.xml.sax.SAXException; import java.io.IOException; import junit.framework.Assert; /** * * @author Magesh Kumar B <mageshbk@jboss.com> (C) 2011 Red Hat Inc. * @author <a href="mailto:tom.fennelly@gmail.com">tom.fennelly@gmail.com</a> */ @RunWith(Arquillian.class) public class OrdersDemoQuickstartTest { @Deployment(testable = false) public static WebArchive createDeployment() { return ArquillianUtil.createWarDemoDeployment("switchyard-demo-orders"); } @Test public void testOrders() throws Exception { // Only testing that deployment is successful at this point. The web service // endpoint is tested as part of the bean-service quickstart Assert.assertTrue(true); } }
{ "content_hash": "fe2db0f39b086c5a457229fd950a7cb7", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 82, "avg_line_length": 30.864864864864863, "alnum_prop": 0.7600700525394045, "repo_name": "tadayosi/switchyard", "id": "d0595503ac926bc528d810533a7360fd66df6cb4", "size": "1775", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "release/jboss-as7/tests/src/test/java/org/switchyard/test/quickstarts/demo/OrdersDemoQuickstartTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "1387" }, { "name": "CSS", "bytes": "1428" }, { "name": "Clojure", "bytes": "239" }, { "name": "HTML", "bytes": "12878" }, { "name": "Java", "bytes": "9850364" }, { "name": "Ruby", "bytes": "1772" }, { "name": "XSLT", "bytes": "84991" } ], "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("Domain.GTFS.Realtime.Subway.Interfaces")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Domain.GTFS.Realtime.Subway.Interfaces")] [assembly: AssemblyCopyright("Copyright © 2014")] [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("5ed10055-558f-4336-b944-05c38ca4077c")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
{ "content_hash": "2ca9f7cced369aeb06af2404218bbefe", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 84, "avg_line_length": 40.25, "alnum_prop": 0.748792270531401, "repo_name": "nycmobiledev/transit-app-experiments", "id": "3060a7d33252c010ab2022c483adab1a1664de65", "size": "1452", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "gtfs/GTFSApi/Domain.GTFS.Realtime.Subway.Interfaces/Properties/AssemblyInfo.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "448669" }, { "name": "XSLT", "bytes": "82915" } ], "symlink_target": "" }
package org.assertj.core.api.float_; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.util.AssertionsUtil.expectAssertionError; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verifyNoInteractions; import org.assertj.core.api.FloatAssert; import org.assertj.core.api.FloatAssertBaseTest; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; @DisplayName("FloatAssert isGreaterThanOrEqualTo") class FloatAssert_isGreaterThanOrEqualTo_FloatWrapper_Test extends FloatAssertBaseTest { private Float other = 1.0f; @Override protected FloatAssert invoke_api_method() { return assertions.isGreaterThanOrEqualTo(other); } @Override protected void verify_internal_effects() { verify(comparables).assertGreaterThanOrEqualTo(getInfo(assertions), getActual(assertions), other); verifyNoInteractions(floats); } @Test void should_fail_when_comparing_negative_zero_to_positive_zero() { // GIVEN final Float positiveZero = 0.0f; final float negativeZero = -0.0f; // THEN expectAssertionError(() -> assertThat(negativeZero).isGreaterThanOrEqualTo(positiveZero)); verifyNoInteractions(floats); } @Test void should_pass_when_comparing_positive_zero_to_negative_zero() { // GIVEN final Float positiveZero = 0.0f; final Float negativeZero = -0.0f; // THEN assertThat(positiveZero).isGreaterThanOrEqualTo(negativeZero); } @Test void should_honor_user_specified_comparator() { // GIVEN final Float one = 1.0f; // THEN assertThat(-one).usingComparator(ALWAY_EQUAL_FLOAT) .isGreaterThanOrEqualTo(one); } }
{ "content_hash": "f9446c8397f5bc02ccbbf93500325571", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 102, "avg_line_length": 29.448275862068964, "alnum_prop": 0.7447306791569087, "repo_name": "hazendaz/assertj-core", "id": "08c5dc1e804a1c75efc0ee7d14e19956801dd9e3", "size": "2314", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/test/java/org/assertj/core/api/float_/FloatAssert_isGreaterThanOrEqualTo_FloatWrapper_Test.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "17521277" }, { "name": "Shell", "bytes": "39247" } ], "symlink_target": "" }
@interface PodsDummy_LinkimFoundation : NSObject @end @implementation PodsDummy_LinkimFoundation @end
{ "content_hash": "df705e9a662acd88d42fb50573a53aae", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 48, "avg_line_length": 25.5, "alnum_prop": 0.8529411764705882, "repo_name": "liuweicode/LinkimFoundation", "id": "127894aa9b512cdecc7d6090c26ba6cc09f2a1f6", "size": "136", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Example/Pods/Target Support Files/LinkimFoundation/LinkimFoundation-dummy.m", "mode": "33188", "license": "mit", "language": [ { "name": "Objective-C", "bytes": "3242" }, { "name": "Ruby", "bytes": "2833" }, { "name": "Shell", "bytes": "18357" }, { "name": "Swift", "bytes": "1025778" } ], "symlink_target": "" }
<?php class PassnoteMarkdownTest extends PHPUnit_Framework_TestCase { /** * @var \Stecman\Passnote\PassnoteMarkdown */ protected $parser; protected function setUp() { $this->parser = new \Stecman\Passnote\PassnoteMarkdown(); } public function testParseLink() { $md = 'Hello [example](http://example.com).'; $html = $this->parser->parseParagraph($md); $this->assertEquals( 'Hello <a rel="noreferrer" href="http://example.com">example</a>.', $html ); } public function testParseUrl() { $md = 'Website: http://example.com'; $html = $this->parser->parseParagraph($md); $this->assertEquals( 'Website: <a rel="noreferrer" href="http://example.com">http://example.com</a>', $html ); } }
{ "content_hash": "ddb12131c861a56e0343c9194e487f10", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 92, "avg_line_length": 23.243243243243242, "alnum_prop": 0.5546511627906977, "repo_name": "stecman/passnote", "id": "dbeb1ad8a7ef4372617adbb7e78b53efd73b3f94", "size": "860", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tests/Stecman/Passnote/PassnoteMarkdownTest.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "10272" }, { "name": "HTML", "bytes": "526" }, { "name": "JavaScript", "bytes": "2941" }, { "name": "Makefile", "bytes": "270" }, { "name": "PHP", "bytes": "112949" }, { "name": "Volt", "bytes": "7612" } ], "symlink_target": "" }
#include <stdio.h> #include <stdlib.h> #include "mh_sha256.h" #include "test.h" #ifndef GT_L3_CACHE # define GT_L3_CACHE 32*1024*1024 /* some number > last level cache */ #endif #if !defined(COLD_TEST) && !defined(TEST_CUSTOM) // Cached test, loop many times over small dataset # define TEST_LEN 16*1024 # define TEST_LOOPS 20000 # define TEST_TYPE_STR "_warm" #elif defined(COLD_TEST) // Uncached test. Pull from large mem base. # define TEST_LEN (GT_L3_CACHE) # define TEST_LOOPS 100 # define TEST_TYPE_STR "_cold" #endif #ifndef TEST_SEED # define TEST_SEED 0x1234 #endif #define TEST_MEM TEST_LEN #define str(s) #s #define xstr(s) str(s) #define _FUNC_TOKEN(func, type) func##type #define FUNC_TOKEN(func, type) _FUNC_TOKEN(func, type) #ifndef MH_SHA256_FUNC_TYPE #define MH_SHA256_FUNC_TYPE #endif #define TEST_UPDATE_FUNCTION FUNC_TOKEN(mh_sha256_update, MH_SHA256_FUNC_TYPE) #define TEST_FINAL_FUNCTION FUNC_TOKEN(mh_sha256_finalize, MH_SHA256_FUNC_TYPE) #define CHECK_RETURN(state) do{ \ if((state) != MH_SHA256_CTX_ERROR_NONE){ \ printf("The mh_sha256 function is failed.\n"); \ return 1; \ } \ }while(0) // Generates pseudo-random data void rand_buffer(uint8_t * buf, long buffer_size) { long i; for (i = 0; i < buffer_size; i++) buf[i] = rand(); } void dump(char *buf, int len) { int i; for (i = 0; i < len;) { printf(" %2x", 0xff & buf[i++]); if (i % 32 == 0) printf("\n"); } if (i % 32 != 0) printf("\n"); } int compare_digests(uint32_t hash_base[SHA256_DIGEST_WORDS], uint32_t hash_test[SHA256_DIGEST_WORDS]) { int i; int mh_sha256_fail = 0; for (i = 0; i < SHA256_DIGEST_WORDS; i++) { if (hash_test[i] != hash_base[i]) mh_sha256_fail++; } if (mh_sha256_fail) { printf("mh_sha256 fail test\n"); printf("base: "); dump((char *)hash_base, 32); printf("ref: "); dump((char *)hash_test, 32); } return mh_sha256_fail; } int main(int argc, char *argv[]) { int i, fail = 0; uint32_t hash_test[SHA256_DIGEST_WORDS], hash_base[SHA256_DIGEST_WORDS]; uint8_t *buff = NULL; struct mh_sha256_ctx *update_ctx_test = NULL, *update_ctx_base = NULL; struct perf start, stop; printf(xstr(TEST_UPDATE_FUNCTION) "_perf:\n"); buff = malloc(TEST_LEN); update_ctx_test = malloc(sizeof(*update_ctx_test)); update_ctx_base = malloc(sizeof(*update_ctx_base)); if (buff == NULL || update_ctx_base == NULL || update_ctx_test == NULL) { printf("malloc failed test aborted\n"); return -1; } // Rand test1 rand_buffer(buff, TEST_LEN); // mh_sha256 base version mh_sha256_init(update_ctx_base); mh_sha256_update_base(update_ctx_base, buff, TEST_LEN); mh_sha256_finalize_base(update_ctx_base, hash_base); perf_start(&start); for (i = 0; i < TEST_LOOPS / 10; i++) { mh_sha256_init(update_ctx_base); mh_sha256_update_base(update_ctx_base, buff, TEST_LEN); mh_sha256_finalize_base(update_ctx_base, hash_base); } perf_stop(&stop); printf("mh_sha256_update_base" TEST_TYPE_STR ": "); perf_print(stop, start, (long long)TEST_MEM * i); //Update feature test CHECK_RETURN(mh_sha256_init(update_ctx_test)); CHECK_RETURN(TEST_UPDATE_FUNCTION(update_ctx_test, buff, TEST_LEN)); CHECK_RETURN(TEST_FINAL_FUNCTION(update_ctx_test, hash_test)); perf_start(&start); for (i = 0; i < TEST_LOOPS; i++) { CHECK_RETURN(mh_sha256_init(update_ctx_test)); CHECK_RETURN(TEST_UPDATE_FUNCTION(update_ctx_test, buff, TEST_LEN)); CHECK_RETURN(TEST_FINAL_FUNCTION(update_ctx_test, hash_test)); } perf_stop(&stop); printf(xstr(TEST_UPDATE_FUNCTION) TEST_TYPE_STR ": "); perf_print(stop, start, (long long)TEST_MEM * i); // Check results fail = compare_digests(hash_base, hash_test); if (fail) { printf("Fail size=%d\n", TEST_LEN); return -1; } if (fail) printf("Test failed function test%d\n", fail); else printf("Pass func check\n"); return fail; }
{ "content_hash": "5887967b71ec86426c29480cc5f824e3", "timestamp": "", "source": "github", "line_count": 156, "max_line_length": 80, "avg_line_length": 24.96794871794872, "alnum_prop": 0.6572528883183568, "repo_name": "intel/isa-l_crypto", "id": "91dcf6e4b2e42735d2c7e61531f1cae21ab36728", "size": "5597", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "mh_sha256/mh_sha256_perf.c", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Assembly", "bytes": "3497891" }, { "name": "C", "bytes": "1710835" }, { "name": "C++", "bytes": "11042" }, { "name": "M4", "bytes": "11007" }, { "name": "Makefile", "bytes": "54995" }, { "name": "Shell", "bytes": "10872" } ], "symlink_target": "" }
<?php /** * This module provides like support for Content and Content Addons * Each wall entry will get a Like Button and a overview of likes. * * @package humhub.modules_core.like * @since 0.5 */ class LikeModule extends HWebModule { public $isCoreModule = true; public function init() { // import the module-level models and components $this->setImport(array( 'like.models.*', 'like.behaviors.*', )); } /** * On User delete, also delete all comments * * @param type $event */ public static function onUserDelete($event) { foreach (Like::model()->findAllByAttributes(array('created_by' => $event->sender->id)) as $like) { $like->delete(); } return true; } /** * On delete of a content object, also delete all corresponding likes */ public static function onContentDelete($event) { foreach (Like::model()->findAllByAttributes(array('object_id' => $event->sender->id, 'object_model' => get_class($event->sender))) as $like) { $like->delete(); } } /** * On delete of a content addon object, e.g. a comment * also delete all likes */ public static function onContentAddonDelete($event) { foreach (Like::model()->findAllByAttributes(array('object_id' => $event->sender->id, 'object_model' => get_class($event->sender))) as $like) { $like->delete(); } } /** * On run of integrity check command, validate all module data * * @param type $event */ public static function onIntegrityCheck($event) { $integrityChecker = $event->sender; $integrityChecker->showTestHeadline("Validating Like Module (" . Like::model()->count() . " entries)"); foreach (Like::model()->findAll() as $l) { if ($l->source === null) { $integrityChecker->showFix("Deleting like id " . $l->id . " without existing target!"); if (!$integrityChecker->simulate) $l->delete(); } } } /** * On initalizing the wall entry controls also add the like link widget * * @param type $event */ public static function onWallEntryLinksInit($event) { $event->sender->addWidget('application.modules_core.like.widgets.LikeLinkWidget', array('object' => $event->sender->object), array('sortOrder' => 10)); } /** * On init of the wall entry addons, add a overview of existing likes * * @param type $event */ public static function onWallEntryAddonInit($event) { } }
{ "content_hash": "96ccd3ace76fc13402cab00f0380fcb0", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 159, "avg_line_length": 26.349514563106798, "alnum_prop": 0.5725865880619012, "repo_name": "calonso-conabio/intranet", "id": "a10c933d3e6e4138f857861ed511047f85a6910b", "size": "2714", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "protected/modules_core/like/LikeModule.php", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "ApacheConf", "bytes": "13" }, { "name": "Batchfile", "bytes": "1410" }, { "name": "CSS", "bytes": "215052" }, { "name": "HTML", "bytes": "31712" }, { "name": "JavaScript", "bytes": "657426" }, { "name": "PHP", "bytes": "13097099" }, { "name": "Shell", "bytes": "179" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="refresh" content="0;URL=struct.ParseRatioError.html"> </head> <body> <p>Redirecting to <a href="struct.ParseRatioError.html">struct.ParseRatioError.html</a>...</p> <script>location.replace("struct.ParseRatioError.html" + location.search + location.hash);</script> </body> </html>
{ "content_hash": "291fb8b2f43b7347eb9ee2d1324c9a8e", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 103, "avg_line_length": 34.9, "alnum_prop": 0.7048710601719198, "repo_name": "liebharc/clFFT", "id": "59f24d535dabae0549dd74fc7dcbbb8276ed7e4a", "size": "349", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "docs/bindings/num_rational/ParseRatioError.t.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "141098" }, { "name": "C++", "bytes": "3950190" }, { "name": "CMake", "bytes": "47058" }, { "name": "Python", "bytes": "61560" }, { "name": "Rust", "bytes": "58918" } ], "symlink_target": "" }
package com.planet_ink.coffee_mud.Races; import com.planet_ink.coffee_mud.core.interfaces.*; import com.planet_ink.coffee_mud.core.*; import com.planet_ink.coffee_mud.core.collections.*; import com.planet_ink.coffee_mud.Abilities.interfaces.*; import com.planet_ink.coffee_mud.Areas.interfaces.*; import com.planet_ink.coffee_mud.Behaviors.interfaces.*; import com.planet_ink.coffee_mud.CharClasses.interfaces.*; import com.planet_ink.coffee_mud.Commands.interfaces.*; import com.planet_ink.coffee_mud.Common.interfaces.*; import com.planet_ink.coffee_mud.Exits.interfaces.*; import com.planet_ink.coffee_mud.Items.interfaces.*; import com.planet_ink.coffee_mud.Libraries.interfaces.*; import com.planet_ink.coffee_mud.Locales.interfaces.*; import com.planet_ink.coffee_mud.MOBS.interfaces.*; import com.planet_ink.coffee_mud.Races.interfaces.*; import java.util.*; public class ElectricityElemental extends StdRace { @Override public String ID(){ return "ElectricityElemental"; } @Override public String name(){ return "Electricity Elemental"; } @Override public int shortestMale(){return 64;} @Override public int shortestFemale(){return 60;} @Override public int heightVariance(){return 12;} @Override public int lightestWeight(){return 400;} @Override public int weightVariance(){return 100;} @Override public long forbiddenWornBits(){return 0;} @Override public String racialCategory(){return "Elemental";} @Override public boolean fertile(){return false;} @Override public boolean uncharmable(){return true;} @Override protected boolean destroyBodyAfterUse(){return true;} protected static Vector<RawMaterial> resources=new Vector<RawMaterial>(); @Override public int availabilityCode(){return Area.THEME_FANTASY|Area.THEME_SKILLONLYMASK;} // an ey ea he ne ar ha to le fo no gi mo wa ta wi private static final int[] parts={-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}; @Override public int[] bodyMask(){return parts;} private final int[] agingChart={0,0,0,0,0,YEARS_AGE_LIVES_FOREVER,YEARS_AGE_LIVES_FOREVER,YEARS_AGE_LIVES_FOREVER,YEARS_AGE_LIVES_FOREVER}; @Override public int[] getAgingChart(){return agingChart;} @Override public void affectCharStats(MOB affectedMOB, CharStats affectableStats) { super.affectCharStats(affectedMOB, affectableStats); affectableStats.setStat(CharStats.STAT_SAVE_POISON,affectableStats.getStat(CharStats.STAT_SAVE_POISON)+100); affectableStats.setStat(CharStats.STAT_SAVE_DISEASE,affectableStats.getStat(CharStats.STAT_SAVE_DISEASE)+100); affectableStats.setStat(CharStats.STAT_SAVE_ELECTRIC,affectableStats.getStat(CharStats.STAT_SAVE_ELECTRIC)+100); } @Override public Weapon myNaturalWeapon() { if(naturalWeapon==null) { naturalWeapon=CMClass.getWeapon("StdWeapon"); naturalWeapon.setName(L("a deadly spark")); naturalWeapon.setMaterial(RawMaterial.RESOURCE_ELECTRICITY); naturalWeapon.setUsesRemaining(1000); naturalWeapon.setWeaponType(Weapon.TYPE_STRIKING); } return naturalWeapon; } @Override public String makeMobName(char gender, int age) { return makeMobName('N',Race.AGE_MATURE); } @Override public String healthText(MOB viewer, MOB mob) { final double pct=(CMath.div(mob.curState().getHitPoints(),mob.maxState().getHitPoints())); if(pct<.10) return L("^r@x1^r is near destruction!^N",mob.name(viewer)); else if(pct<.20) return L("^r@x1^r is flickering alot and massively damaged.^N",mob.name(viewer)); else if(pct<.30) return L("^r@x1^r is flickering alot and extremely damaged.^N",mob.name(viewer)); else if(pct<.40) return L("^y@x1^y is flickering alot and very damaged.^N",mob.name(viewer)); else if(pct<.50) return L("^y@x1^y is flickering and damaged.^N",mob.name(viewer)); else if(pct<.60) return L("^p@x1^p is flickering and slightly damaged.^N",mob.name(viewer)); else if(pct<.70) return L("^p@x1^p is showing large flickers.^N",mob.name(viewer)); else if(pct<.80) return L("^g@x1^g is showing some flickers.^N",mob.name(viewer)); else if(pct<.90) return L("^g@x1^g is showing small flickers.^N",mob.name(viewer)); else if(pct<.99) return L("^g@x1^g is no longer in perfect condition.^N",mob.name(viewer)); else return L("^c@x1^c is in perfect condition.^N",mob.name(viewer)); } @Override public DeadBody getCorpseContainer(MOB mob, Room room) { final DeadBody body = super.getCorpseContainer(mob, room); if(body != null) { body.setMaterial(RawMaterial.RESOURCE_ELECTRICITY); } return body; } @Override public List<RawMaterial> myResources() { synchronized(resources) { if(resources.size()==0) { resources.addElement(makeResource ("a small conductive filing",RawMaterial.RESOURCE_IRON)); } } return resources; } }
{ "content_hash": "79725f02ee1c79860bbc358d04e511e3", "timestamp": "", "source": "github", "line_count": 135, "max_line_length": 140, "avg_line_length": 36.51851851851852, "alnum_prop": 0.7148073022312373, "repo_name": "Tycheo/coffeemud", "id": "eeb3ed0569f9fe2fdde18cb40da6246a03c08b6e", "size": "5534", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "com/planet_ink/coffee_mud/Races/ElectricityElemental.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "5783" }, { "name": "CSS", "bytes": "1515" }, { "name": "HTML", "bytes": "9650029" }, { "name": "Java", "bytes": "26062781" }, { "name": "JavaScript", "bytes": "24025" }, { "name": "Makefile", "bytes": "23191" }, { "name": "Shell", "bytes": "8525" } ], "symlink_target": "" }
/*************************************************************************/ /* rasterizer_gles3.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ /* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2022 Godot Engine contributors (cf. AUTHORS.md). */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ /* "Software"), to deal in the Software without restriction, including */ /* without limitation the rights to use, copy, modify, merge, publish, */ /* distribute, sublicense, and/or sell copies of the Software, and to */ /* permit persons to whom the Software is furnished to do so, subject to */ /* the following conditions: */ /* */ /* The above copyright notice and this permission notice shall be */ /* included in all copies or substantial portions of the Software. */ /* */ /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "rasterizer_gles3.h" #ifdef GLES3_ENABLED #include "core/config/project_settings.h" #include "core/os/os.h" #define _EXT_DEBUG_OUTPUT_SYNCHRONOUS_ARB 0x8242 #define _EXT_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB 0x8243 #define _EXT_DEBUG_CALLBACK_FUNCTION_ARB 0x8244 #define _EXT_DEBUG_CALLBACK_USER_PARAM_ARB 0x8245 #define _EXT_DEBUG_SOURCE_API_ARB 0x8246 #define _EXT_DEBUG_SOURCE_WINDOW_SYSTEM_ARB 0x8247 #define _EXT_DEBUG_SOURCE_SHADER_COMPILER_ARB 0x8248 #define _EXT_DEBUG_SOURCE_THIRD_PARTY_ARB 0x8249 #define _EXT_DEBUG_SOURCE_APPLICATION_ARB 0x824A #define _EXT_DEBUG_SOURCE_OTHER_ARB 0x824B #define _EXT_DEBUG_TYPE_ERROR_ARB 0x824C #define _EXT_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB 0x824D #define _EXT_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB 0x824E #define _EXT_DEBUG_TYPE_PORTABILITY_ARB 0x824F #define _EXT_DEBUG_TYPE_PERFORMANCE_ARB 0x8250 #define _EXT_DEBUG_TYPE_OTHER_ARB 0x8251 #define _EXT_MAX_DEBUG_MESSAGE_LENGTH_ARB 0x9143 #define _EXT_MAX_DEBUG_LOGGED_MESSAGES_ARB 0x9144 #define _EXT_DEBUG_LOGGED_MESSAGES_ARB 0x9145 #define _EXT_DEBUG_SEVERITY_HIGH_ARB 0x9146 #define _EXT_DEBUG_SEVERITY_MEDIUM_ARB 0x9147 #define _EXT_DEBUG_SEVERITY_LOW_ARB 0x9148 #define _EXT_DEBUG_OUTPUT 0x92E0 #ifndef GLAPIENTRY #if defined(WINDOWS_ENABLED) && !defined(UWP_ENABLED) #define GLAPIENTRY APIENTRY #else #define GLAPIENTRY #endif #endif #if !defined(IPHONE_ENABLED) && !defined(JAVASCRIPT_ENABLED) // We include EGL below to get debug callback on GLES2 platforms, // but EGL is not available on iOS. #define CAN_DEBUG #endif #if !defined(GLES_OVER_GL) && defined(CAN_DEBUG) #include <GLES3/gl3.h> #include <GLES3/gl3ext.h> #include <GLES3/gl3platform.h> #include <EGL/egl.h> #include <EGL/eglext.h> #endif #if defined(MINGW_ENABLED) || defined(_MSC_VER) #define strcpy strcpy_s #endif void RasterizerGLES3::begin_frame(double frame_step) { frame++; delta = frame_step; time_total += frame_step; double time_roll_over = GLOBAL_GET("rendering/limits/time/time_rollover_secs"); time_total = Math::fmod(time_total, time_roll_over); storage.frame.time = time_total; storage.frame.count++; storage.frame.delta = frame_step; storage.update_dirty_resources(); storage.info.render_final = storage.info.render; storage.info.render.reset(); //scene->iteration(); } void RasterizerGLES3::end_frame(bool p_swap_buffers) { // if (OS::get_singleton()->is_layered_allowed()) { // if (!OS::get_singleton()->get_window_per_pixel_transparency_enabled()) { //clear alpha // glColorMask(false, false, false, true); // glClearColor(0.5, 0, 0, 1); // glClear(GL_COLOR_BUFFER_BIT); // glColorMask(true, true, true, true); // } // } // glClearColor(1, 0, 0, 1); // glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_ACCUM_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); if (p_swap_buffers) { DisplayServer::get_singleton()->swap_buffers(); } else { glFinish(); } } #ifdef CAN_DEBUG static void GLAPIENTRY _gl_debug_print(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message, const GLvoid *userParam) { if (type == _EXT_DEBUG_TYPE_OTHER_ARB) { return; } if (type == _EXT_DEBUG_TYPE_PERFORMANCE_ARB) { return; //these are ultimately annoying, so removing for now } char debSource[256], debType[256], debSev[256]; if (source == _EXT_DEBUG_SOURCE_API_ARB) { strcpy(debSource, "OpenGL"); } else if (source == _EXT_DEBUG_SOURCE_WINDOW_SYSTEM_ARB) { strcpy(debSource, "Windows"); } else if (source == _EXT_DEBUG_SOURCE_SHADER_COMPILER_ARB) { strcpy(debSource, "Shader Compiler"); } else if (source == _EXT_DEBUG_SOURCE_THIRD_PARTY_ARB) { strcpy(debSource, "Third Party"); } else if (source == _EXT_DEBUG_SOURCE_APPLICATION_ARB) { strcpy(debSource, "Application"); } else if (source == _EXT_DEBUG_SOURCE_OTHER_ARB) { strcpy(debSource, "Other"); } if (type == _EXT_DEBUG_TYPE_ERROR_ARB) { strcpy(debType, "Error"); } else if (type == _EXT_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB) { strcpy(debType, "Deprecated behavior"); } else if (type == _EXT_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB) { strcpy(debType, "Undefined behavior"); } else if (type == _EXT_DEBUG_TYPE_PORTABILITY_ARB) { strcpy(debType, "Portability"); } else if (type == _EXT_DEBUG_TYPE_PERFORMANCE_ARB) { strcpy(debType, "Performance"); } else if (type == _EXT_DEBUG_TYPE_OTHER_ARB) { strcpy(debType, "Other"); } if (severity == _EXT_DEBUG_SEVERITY_HIGH_ARB) { strcpy(debSev, "High"); } else if (severity == _EXT_DEBUG_SEVERITY_MEDIUM_ARB) { strcpy(debSev, "Medium"); } else if (severity == _EXT_DEBUG_SEVERITY_LOW_ARB) { strcpy(debSev, "Low"); } String output = String() + "GL ERROR: Source: " + debSource + "\tType: " + debType + "\tID: " + itos(id) + "\tSeverity: " + debSev + "\tMessage: " + message; ERR_PRINT(output); } #endif typedef void (*DEBUGPROCARB)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const char *message, const void *userParam); typedef void (*DebugMessageCallbackARB)(DEBUGPROCARB callback, const void *userParam); void RasterizerGLES3::initialize() { print_verbose("Using OpenGL video driver"); storage._main_thread_id = Thread::get_caller_id(); #ifdef GLAD_ENABLED if (!gladLoadGL()) { ERR_PRINT("Error initializing GLAD"); return; } #endif #ifdef GLAD_ENABLED if (OS::get_singleton()->is_stdout_verbose()) { if (GLAD_GL_ARB_debug_output) { glEnable(_EXT_DEBUG_OUTPUT_SYNCHRONOUS_ARB); glDebugMessageCallbackARB(_gl_debug_print, nullptr); glEnable(_EXT_DEBUG_OUTPUT); } else { print_line("OpenGL debugging not supported!"); } } #endif // GLAD_ENABLED // For debugging #ifdef CAN_DEBUG #ifdef GLES_OVER_GL if (OS::get_singleton()->is_stdout_verbose() && GLAD_GL_ARB_debug_output) { glDebugMessageControlARB(_EXT_DEBUG_SOURCE_API_ARB, _EXT_DEBUG_TYPE_ERROR_ARB, _EXT_DEBUG_SEVERITY_HIGH_ARB, 0, nullptr, GL_TRUE); glDebugMessageControlARB(_EXT_DEBUG_SOURCE_API_ARB, _EXT_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB, _EXT_DEBUG_SEVERITY_HIGH_ARB, 0, nullptr, GL_TRUE); glDebugMessageControlARB(_EXT_DEBUG_SOURCE_API_ARB, _EXT_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB, _EXT_DEBUG_SEVERITY_HIGH_ARB, 0, nullptr, GL_TRUE); glDebugMessageControlARB(_EXT_DEBUG_SOURCE_API_ARB, _EXT_DEBUG_TYPE_PORTABILITY_ARB, _EXT_DEBUG_SEVERITY_HIGH_ARB, 0, nullptr, GL_TRUE); glDebugMessageControlARB(_EXT_DEBUG_SOURCE_API_ARB, _EXT_DEBUG_TYPE_PERFORMANCE_ARB, _EXT_DEBUG_SEVERITY_HIGH_ARB, 0, nullptr, GL_TRUE); glDebugMessageControlARB(_EXT_DEBUG_SOURCE_API_ARB, _EXT_DEBUG_TYPE_OTHER_ARB, _EXT_DEBUG_SEVERITY_HIGH_ARB, 0, nullptr, GL_TRUE); // glDebugMessageInsertARB( // GL_DEBUG_SOURCE_API_ARB, // GL_DEBUG_TYPE_OTHER_ARB, 1, // GL_DEBUG_SEVERITY_HIGH_ARB, 5, "hello"); } #else if (OS::get_singleton()->is_stdout_verbose()) { DebugMessageCallbackARB callback = (DebugMessageCallbackARB)eglGetProcAddress("glDebugMessageCallback"); if (!callback) { callback = (DebugMessageCallbackARB)eglGetProcAddress("glDebugMessageCallbackKHR"); } if (callback) { print_line("godot: ENABLING GL DEBUG"); glEnable(_EXT_DEBUG_OUTPUT_SYNCHRONOUS_ARB); callback(_gl_debug_print, NULL); glEnable(_EXT_DEBUG_OUTPUT); } } #endif // GLES_OVER_GL #endif // CAN_DEBUG print_line("OpenGL Renderer: " + RS::get_singleton()->get_video_adapter_name()); storage.initialize(); canvas.initialize(); // scene.initialize(); // make sure the OS knows to only access the renderer from the main thread OS::get_singleton()->set_render_main_thread_mode(OS::RENDER_MAIN_THREAD_ONLY); } RasterizerGLES3::RasterizerGLES3() { canvas.storage = &storage; canvas.scene_render = &scene; storage.canvas = &canvas; //scene.storage = &storage; storage.scene = &scene; } void RasterizerGLES3::prepare_for_blitting_render_targets() { } void RasterizerGLES3::_blit_render_target_to_screen(RID p_render_target, DisplayServer::WindowID p_screen, const Rect2 &p_screen_rect) { ERR_FAIL_COND(storage.frame.current_rt); RasterizerStorageGLES3::RenderTarget *rt = storage.render_target_owner.get_or_null(p_render_target); ERR_FAIL_COND(!rt); // TODO: do we need a keep 3d linear option? if (rt->external.fbo != 0) { glBindFramebuffer(GL_READ_FRAMEBUFFER, rt->external.fbo); } else { glBindFramebuffer(GL_READ_FRAMEBUFFER, rt->fbo); } glReadBuffer(GL_COLOR_ATTACHMENT0); glBindFramebuffer(GL_DRAW_FRAMEBUFFER, RasterizerStorageGLES3::system_fbo); glBlitFramebuffer(0, 0, rt->width, rt->height, 0, p_screen_rect.size.y, p_screen_rect.size.x, 0, GL_COLOR_BUFFER_BIT, GL_NEAREST); } // is this p_screen useless in a multi window environment? void RasterizerGLES3::blit_render_targets_to_screen(DisplayServer::WindowID p_screen, const BlitToScreen *p_render_targets, int p_amount) { // do this once off for all blits storage.bind_framebuffer_system(); storage.frame.current_rt = nullptr; for (int i = 0; i < p_amount; i++) { const BlitToScreen &blit = p_render_targets[i]; RID rid_rt = blit.render_target; Rect2 dst_rect = blit.dst_rect; _blit_render_target_to_screen(rid_rt, p_screen, dst_rect); } } void RasterizerGLES3::set_boot_image(const Ref<Image> &p_image, const Color &p_color, bool p_scale, bool p_use_filter) { if (p_image.is_null() || p_image->is_empty()) { return; } Size2i win_size = DisplayServer::get_singleton()->screen_get_size(); glBindFramebuffer(GL_FRAMEBUFFER, 0); glViewport(0, 0, win_size.width, win_size.height); glDisable(GL_BLEND); glDepthMask(GL_FALSE); if (false) { // if (OS::get_singleton()->get_window_per_pixel_transparency_enabled()) { glClearColor(0.0, 0.0, 0.0, 0.0); } else { glClearColor(p_color.r, p_color.g, p_color.b, 1.0); } glClear(GL_COLOR_BUFFER_BIT); canvas.canvas_begin(); RID texture = storage.texture_create(); //storage.texture_allocate(texture, p_image->get_width(), p_image->get_height(), 0, p_image->get_format(), VS::TEXTURE_TYPE_2D, p_use_filter ? VS::TEXTURE_FLAG_FILTER : 0); storage._texture_allocate_internal(texture, p_image->get_width(), p_image->get_height(), 0, p_image->get_format(), RenderingDevice::TEXTURE_TYPE_2D); storage.texture_set_data(texture, p_image); Rect2 imgrect(0, 0, p_image->get_width(), p_image->get_height()); Rect2 screenrect; if (p_scale) { if (win_size.width > win_size.height) { //scale horizontally screenrect.size.y = win_size.height; screenrect.size.x = imgrect.size.x * win_size.height / imgrect.size.y; screenrect.position.x = (win_size.width - screenrect.size.x) / 2; } else { //scale vertically screenrect.size.x = win_size.width; screenrect.size.y = imgrect.size.y * win_size.width / imgrect.size.x; screenrect.position.y = (win_size.height - screenrect.size.y) / 2; } } else { screenrect = imgrect; screenrect.position += ((Size2(win_size.width, win_size.height) - screenrect.size) / 2.0).floor(); } RasterizerStorageGLES3::Texture *t = storage.texture_owner.get_or_null(texture); glActiveTexture(GL_TEXTURE0 + storage.config.max_texture_image_units - 1); glBindTexture(GL_TEXTURE_2D, t->tex_id); glBindTexture(GL_TEXTURE_2D, 0); canvas.canvas_end(); storage.free(texture); end_frame(true); } #endif // GLES3_ENABLED
{ "content_hash": "e88d17196282863bc7cf7be5e3e4f029", "timestamp": "", "source": "github", "line_count": 363, "max_line_length": 173, "avg_line_length": 36.90358126721763, "alnum_prop": 0.6674380412063302, "repo_name": "Faless/godot", "id": "087bf364733a2d99affec10de5803d30ad6c3630", "size": "13396", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "drivers/gles3/rasterizer_gles3.cpp", "mode": "33188", "license": "mit", "language": [ { "name": "AIDL", "bytes": "1633" }, { "name": "C", "bytes": "820090" }, { "name": "C#", "bytes": "954253" }, { "name": "C++", "bytes": "36679303" }, { "name": "CMake", "bytes": "538" }, { "name": "GAP", "bytes": "62" }, { "name": "GDScript", "bytes": "59146" }, { "name": "GLSL", "bytes": "802565" }, { "name": "Java", "bytes": "512268" }, { "name": "JavaScript", "bytes": "184665" }, { "name": "Kotlin", "bytes": "16172" }, { "name": "Makefile", "bytes": "1421" }, { "name": "Objective-C", "bytes": "20550" }, { "name": "Objective-C++", "bytes": "315906" }, { "name": "PowerShell", "bytes": "2713" }, { "name": "Python", "bytes": "427946" }, { "name": "Shell", "bytes": "27482" } ], "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 UEDMHardwareControl.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.8.1.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); public static Settings Default { get { return defaultInstance; } } } }
{ "content_hash": "bc91bfb3dba64b62aea9414658167513", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 151, "avg_line_length": 41.30769230769231, "alnum_prop": 0.5847299813780261, "repo_name": "ColdMatter/EDMSuite", "id": "9bb19cc24a5cfc64a14d67db209640b4205c2dd1", "size": "1076", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "UEDMHardwareControl/Properties/Settings.Designer.cs", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "2489" }, { "name": "C#", "bytes": "6547131" }, { "name": "F#", "bytes": "1565" }, { "name": "Forth", "bytes": "767" }, { "name": "HTML", "bytes": "241926" }, { "name": "Mathematica", "bytes": "452861" }, { "name": "Python", "bytes": "798129" }, { "name": "Shell", "bytes": "33" }, { "name": "TSQL", "bytes": "1768" }, { "name": "TeX", "bytes": "8393" } ], "symlink_target": "" }
package client import ( "github.com/rancher/norman/types" ) const ( TemplateContentType = "templateContent" TemplateContentFieldAnnotations = "annotations" TemplateContentFieldCreated = "created" TemplateContentFieldCreatorID = "creatorId" TemplateContentFieldData = "data" TemplateContentFieldLabels = "labels" TemplateContentFieldName = "name" TemplateContentFieldOwnerReferences = "ownerReferences" TemplateContentFieldRemoved = "removed" TemplateContentFieldUUID = "uuid" ) type TemplateContent struct { types.Resource Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` Created string `json:"created,omitempty" yaml:"created,omitempty"` CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` Data string `json:"data,omitempty" yaml:"data,omitempty"` Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` Name string `json:"name,omitempty" yaml:"name,omitempty"` OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` } type TemplateContentCollection struct { types.Collection Data []TemplateContent `json:"data,omitempty"` client *TemplateContentClient } type TemplateContentClient struct { apiClient *Client } type TemplateContentOperations interface { List(opts *types.ListOpts) (*TemplateContentCollection, error) ListAll(opts *types.ListOpts) (*TemplateContentCollection, error) Create(opts *TemplateContent) (*TemplateContent, error) Update(existing *TemplateContent, updates interface{}) (*TemplateContent, error) Replace(existing *TemplateContent) (*TemplateContent, error) ByID(id string) (*TemplateContent, error) Delete(container *TemplateContent) error } func newTemplateContentClient(apiClient *Client) *TemplateContentClient { return &TemplateContentClient{ apiClient: apiClient, } } func (c *TemplateContentClient) Create(container *TemplateContent) (*TemplateContent, error) { resp := &TemplateContent{} err := c.apiClient.Ops.DoCreate(TemplateContentType, container, resp) return resp, err } func (c *TemplateContentClient) Update(existing *TemplateContent, updates interface{}) (*TemplateContent, error) { resp := &TemplateContent{} err := c.apiClient.Ops.DoUpdate(TemplateContentType, &existing.Resource, updates, resp) return resp, err } func (c *TemplateContentClient) Replace(obj *TemplateContent) (*TemplateContent, error) { resp := &TemplateContent{} err := c.apiClient.Ops.DoReplace(TemplateContentType, &obj.Resource, obj, resp) return resp, err } func (c *TemplateContentClient) List(opts *types.ListOpts) (*TemplateContentCollection, error) { resp := &TemplateContentCollection{} err := c.apiClient.Ops.DoList(TemplateContentType, opts, resp) resp.client = c return resp, err } func (c *TemplateContentClient) ListAll(opts *types.ListOpts) (*TemplateContentCollection, error) { resp := &TemplateContentCollection{} resp, err := c.List(opts) if err != nil { return resp, err } data := resp.Data for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { data = append(data, next.Data...) resp = next resp.Data = data } if err != nil { return resp, err } return resp, err } func (cc *TemplateContentCollection) Next() (*TemplateContentCollection, error) { if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { resp := &TemplateContentCollection{} err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) resp.client = cc.client return resp, err } return nil, nil } func (c *TemplateContentClient) ByID(id string) (*TemplateContent, error) { resp := &TemplateContent{} err := c.apiClient.Ops.DoByID(TemplateContentType, id, resp) return resp, err } func (c *TemplateContentClient) Delete(container *TemplateContent) error { return c.apiClient.Ops.DoResourceDelete(TemplateContentType, &container.Resource) }
{ "content_hash": "5400314440c84eb8daf252f47bf20258", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 114, "avg_line_length": 35.40833333333333, "alnum_prop": 0.7211108496116734, "repo_name": "cjellick/rancher", "id": "14061ba7b9af4a781593f1ead7e78d3e46e88e3e", "size": "4249", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "vendor/github.com/rancher/types/client/management/v3/zz_generated_template_content.go", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "728" }, { "name": "Dockerfile", "bytes": "5649" }, { "name": "Go", "bytes": "3099024" }, { "name": "Groovy", "bytes": "56136" }, { "name": "Makefile", "bytes": "411" }, { "name": "PowerShell", "bytes": "78774" }, { "name": "Python", "bytes": "728617" }, { "name": "Shell", "bytes": "40881" }, { "name": "Smarty", "bytes": "823" } ], "symlink_target": "" }
<?php namespace AppBundle\Entity; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; use Gedmo\Mapping\Annotation as Gedmo; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Validator\Constraints as Assert; use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; /** * Environment * * @ORM\Table(name="environment") * @ORM\Entity(repositoryClass="AppBundle\Repository\EnvironmentRepository") * @UniqueEntity("name") */ class Environment implements RelatedEntityInterface { /** * @var int * * @ORM\Column(name="id", type="integer") * @ORM\Id * @ORM\GeneratedValue(strategy="AUTO") */ private $id; /** * @var string * * @ORM\Column(name="name", type="string", length=255, unique=true) * @Assert\NotBlank() * @Assert\Length(max=255) */ private $name; /** * @var Adventure[]|Collection * @ORM\ManyToMany(targetEntity="Adventure", mappedBy="environments") */ private $adventures; /** * @var string * * @ORM\Column(type="string", nullable=true) * @Gedmo\Blameable(on="create") */ private $createdBy; /** * @var string * * @ORM\Column(type="string", nullable=true) * @Gedmo\Blameable(on="update") */ private $updatedBy; public function __construct() { $this->adventures = new ArrayCollection(); } /** * Get id * * @return int */ public function getId() { return $this->id; } /** * Set name * * @param string $name * * @return Environment */ public function setName($name) { $this->name = $name; return $this; } /** * Get name * * @return string */ public function getName() { return $this->name; } /** * @return Adventure[]|Collection */ public function getAdventures(): Collection { return $this->adventures; } /** * @param Adventure $adventure * @return static */ public function addAdventure(Adventure $adventure) { $this->adventures->add($adventure); return $this; } /** * @return string */ public function getCreatedBy() { return $this->createdBy; } /** * @return string */ public function getUpdatedBy() { return $this->updatedBy; } }
{ "content_hash": "9d3f71122ecff86aa4cccac46a707e3c", "timestamp": "", "source": "github", "line_count": 135, "max_line_length": 76, "avg_line_length": 18.496296296296297, "alnum_prop": 0.5622747296756108, "repo_name": "burnhamrobertp/AdventureLookup", "id": "cab4664459e89d526309a8359399acfd568f7911", "size": "2497", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/AppBundle/Entity/Environment.php", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "3605" }, { "name": "CSS", "bytes": "1745" }, { "name": "HTML", "bytes": "67771" }, { "name": "JavaScript", "bytes": "13354" }, { "name": "PHP", "bytes": "388574" }, { "name": "Shell", "bytes": "1313" } ], "symlink_target": "" }
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Threading.Tasks; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.MSBuild; using Nito.AsyncEx; using WootzJs.Compiler.JsAst; namespace WootzJs.Compiler { public class Compiler { public static bool RemoveUnusedSymbols; private string mscorlib; private string[] defines; public Compiler(string mscorlib, string[] defines) { this.mscorlib = mscorlib; this.defines = defines; } public static void Main(string[] args) { if (args.Length == 0) { Console.WriteLine("Please provide two arguments:"); Console.WriteLine("1. The fully qualified path to your .csproj file."); Console.WriteLine("2. The relative path to your project's output folder."); Console.WriteLine(); Console.WriteLine("For example:"); Console.WriteLine(@"WootzJs.Compiler.exe c:\dev\MyProject\MyProject.csproj bin\"); return; } var projectOrSolutionFile = args[0]; var outputFolder = args[1]; var namedArguments = args.Skip(2).Select(x => x.Split('=')).ToDictionary(x => x[0], x => x[1]); var mscorlib = namedArguments.Get("mscorlib"); var performanceFile = namedArguments.Get("performanceFile"); var define = namedArguments.Get("define"); var defines = define == null ? new string[0] : define.Split(','); if (performanceFile != null) { Profiler.Output = new StreamWriter(performanceFile); } var fileInfo = new FileInfo(projectOrSolutionFile); var fileFolder = fileInfo.Directory.FullName; AsyncContext.Run(async () => { if (fileInfo.Extension.Equals(".sln", StringComparison.InvariantCultureIgnoreCase)) { var result = await Profiler.Time("Total Time", async () => await new Compiler(mscorlib, defines).CompileSolution(projectOrSolutionFile)); var output = result.Item1; var solution = result.Item2; var solutionName = fileInfo.Name.Substring(0, fileInfo.Name.Length - ".sln".Length); File.WriteAllText(fileFolder + "\\" + outputFolder + solutionName + ".js", output); } else { var result = await Profiler.Time("Total Time", async () => await new Compiler(mscorlib, defines).CompileProject(projectOrSolutionFile)); var output = result.Item1; var project = result.Item2; var projectName = project.AssemblyName; File.WriteAllText(fileFolder + "\\" + outputFolder + projectName + ".js", output); } }); } public async Task<Tuple<string, Solution>> CompileSolution(string solutionFile) { // var solution = await Profiler.Time("Loading Project", async () => await MSBuildWorkspace.Create().OpenSolutionAsync(solutionFile)); var jsCompilationUnit = new JsCompilationUnit { UseStrict = true }; // Since we have all the types required by the solution, we can keep track of which symbols are used and which // are not. This of course means depending on reflection where you don't reference the actual symbol in code // will result in unexpected behavior. RemoveUnusedSymbols = true; var projectFiles = FileUtils.GetProjectFiles(solutionFile); var workspace = MSBuildWorkspace.Create(); var solution = await Profiler.Time("Loading Solution", async () => { string mscorlib = this.mscorlib; if (mscorlib == null) { mscorlib = projectFiles.Select(x => FileUtils.GetWootzJsTargetFile(x)).First(); } Solution result = workspace.CurrentSolution; if (mscorlib != null) { var mscorlibProject = await workspace.OpenProjectAsync(mscorlib); // result = result.AddProject(mscorlibProject.Id, mscorlibProject.Name, mscorlibProject.AssemblyName, mscorlibProject.Language); foreach (var projectFile in projectFiles) { var project = result.Projects.SingleOrDefault(x => x.FilePath.Equals(projectFile, StringComparison.InvariantCultureIgnoreCase)); if (project == null) project = await workspace.OpenProjectAsync(projectFile); // result = result.AddProject(project.Id, project.Name, project.AssemblyName, project.Language); // project = result.GetProject(project.Id); project = project.AddProjectReference(new ProjectReference(mscorlibProject.Id)); project = project.RemoveMetadataReference(project.MetadataReferences.Single(x => x.Display.Contains("mscorlib.dll"))); result = project.Solution; } } else { result = await workspace.OpenSolutionAsync(solutionFile); } return result; }); var projectCompilers = SortProjectsByDependencies(solution).Select(x => new ProjectCompiler(x, jsCompilationUnit, defines)).ToArray(); foreach (var compiler in projectCompilers) { await compiler.Compile(); } // Write out the compiled Javascript file to the target location. var renderer = new JsRenderer(); Profiler.Time("Rendering javascript", () => jsCompilationUnit.Accept(renderer)); // solution.Projects return Tuple.Create(renderer.Output, solution); } private IEnumerable<Project> SortProjectsByDependencies(Solution solution) { var projects = solution.Projects.Select((x, i) => new { Index = i, Project = x }).ToList(); var prepend = projects.Take(0).ToHashSet(); do { if (prepend.Any()) projects = prepend.Concat(projects.Except(prepend)).Select((x, i) => new { Index = i, x.Project }).ToList(); prepend.Clear(); var mscorlib = projects.Single(x => x.Project.AssemblyName == "mscorlib"); foreach (var item in projects) { var referencedProjects = item.Project.ProjectReferences.Where(x => solution.ProjectIds.Contains(x.ProjectId)).Select(x => projects.Single(y => y.Project.Id == x.ProjectId)).ToList(); if (item.Project.Id != mscorlib.Project.Id) referencedProjects.Add(mscorlib); foreach (var referencedProject in referencedProjects) { if (referencedProject.Index > item.Index) { prepend.Add(referencedProject); } } } } while (prepend.Any()); return projects.Select(x => x.Project).ToArray(); } public async Task<Tuple<string, Project>> CompileProject(string projectFile) { var projectFileInfo = new FileInfo(projectFile); var projectFolder = projectFileInfo.Directory.FullName; // These two lines are just a weird hack because you get no files back from compilation.SyntaxTrees // if the user file isn't modified. Not sure why that's happening. // var projectUserFile = projectFolder + "\\" + projectFileInfo.Name + ".user"; // if (File.Exists(projectUserFile)) // File.SetLastWriteTime(projectUserFile, DateTime.Now); var jsCompilationUnit = new JsCompilationUnit { UseStrict = true }; var workspace = MSBuildWorkspace.Create(); var project = await Profiler.Time("Loading Project", async () => { string mscorlib = this.mscorlib; if (mscorlib == null) { mscorlib = FileUtils.GetWootzJsTargetFile(projectFile); } Project result; if (mscorlib != null) { var mscorlibProject = await workspace.OpenProjectAsync(mscorlib); result = await workspace.OpenProjectAsync(projectFile); result = result.AddProjectReference(new ProjectReference(mscorlibProject.Id)); result = result.RemoveMetadataReference(result.MetadataReferences.Single(x => x.Display.Contains("mscorlib.dll"))); } else { result = await workspace.OpenProjectAsync(projectFile); } return result; }); var projectCompiler = new ProjectCompiler(project, jsCompilationUnit, defines); await projectCompiler.Compile(); // Write out the compiled Javascript file to the target location. var renderer = new JsRenderer(); // renderer.Builder.IsCompacting = true; Profiler.Time("Rendering javascript", () => jsCompilationUnit.Accept(renderer)); return Tuple.Create(renderer.Output, project); } } }
{ "content_hash": "7f62e255edf02a9e535ddfd1e338d009", "timestamp": "", "source": "github", "line_count": 206, "max_line_length": 202, "avg_line_length": 47.55825242718446, "alnum_prop": 0.5623149943860365, "repo_name": "x335/WootzJs", "id": "0aaae14674033608f5100f9310ba6fe1513d32f0", "size": "11142", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "WootzJs.Compiler/Compiler.cs", "mode": "33188", "license": "mit", "language": [ { "name": "ASP", "bytes": "217" }, { "name": "Batchfile", "bytes": "1716" }, { "name": "C#", "bytes": "3302444" }, { "name": "CSS", "bytes": "35057" }, { "name": "HTML", "bytes": "1684" }, { "name": "JavaScript", "bytes": "53767" }, { "name": "Pascal", "bytes": "79949" }, { "name": "PowerShell", "bytes": "126447" }, { "name": "Puppet", "bytes": "1879" } ], "symlink_target": "" }
SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
{ "content_hash": "9d5c70fcbebaf1d559f55852afc391ae", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 10.23076923076923, "alnum_prop": 0.6917293233082706, "repo_name": "mdoering/backbone", "id": "92677c59c4881043b547060ecd96c3dacf66bf55", "size": "196", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Gentianales/Rubiaceae/Uncaria/Uncaria bernaysii/ Syn. Uncaria bernaysioides/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
bms () { local bmark_match bmark_name bmark # Directory already BMarked bmark_match=$(command grep -m1 " = ${PWD}$" $BMARKS_FILE) if [ ! -z "$bmark_match" ]; then e_em "Directory already BMarked: '$bmark_match'" return $E_FAILURE fi # Get or set the BMark name [ -z "$1" ] && bmark_name=$(basename $PWD) || bmark_name=$1 # BMark name already in use bmark_match=$(command grep -m1 "^$bmark_name =" $BMARKS_FILE) if [ ! -z "$bmark_match" ]; then echo "BMark name already in use: '$bmark_match'" return $E_FAILURE fi # Do the BMark bmark="$bmark_name = $PWD" echo $bmark >> $BMARKS_FILE echo "BMark: '$bmark' created!" } # # Function: bmv() # # Return BMark value # # Completion enabled function # bmv () { local bmark_match # Check if BMark name is not empty if [ -z "$1" ]; then e_em "Please provide a BMark name" return $E_FAILURE fi # Check if supplied a valid BMark name bmark_match=$(command grep -m1 "^$1 =" $BMARKS_FILE) if [ -z "$bmark_match" ]; then e_em "Invalid BMark name" return $E_FAILURE fi # Return the BMark value echo $(echo "$bmark_match" | cut -d' ' -f3-) return $E_SUCCESS } # # Function: bm() # # Jump to a previously saved BMark # # Completion enabled function # bm () { local bmark_value # Get the BMark value bmark_value=$(bmv $1) # Invalid BMark name [ $? -eq $E_FAILURE ] && echo $bmark_value && return $E_FAILURE # Valid BMark name pointing to non-existent directory [ ! -d "$bmark_value" ] && e_em 'Valid BMark pointing to non-existent directory' && return $E_FAILURE # Jump to the BMark echo "Jumping to: '$bmark_value'" cd "$bmark_value" } # # Function: bml() # # List all the defined BMarks # bml () { if [ "$1" = "-v" -o "$1" = "--verbose" ]; then # Show whole BMARKS_FILE (comments are formatted different) awk -F= '{ if (/^[^# ].*=/) printf "'$I_RED'%-20s'$R_COLOR'%s\n", $1, $2; else printf "'$I_GRAY'%s'$R_COLOR'\n", $0 }' $BMARKS_FILE else # Only show the valid BMarks (exclude the comments) awk -F= '/^[^# ].*=/ { printf "'$I_RED'%-20s'$R_COLOR'%s\n", $1, $2 }' $BMARKS_FILE fi } # -------------------------------------------------------------------------------------------------- # Base Functions # -------------------------------------------------------------------------------------------------- # # Function: _bmarks_plugin_init() # # Setup the plugin required environment (Autoloading Function) # _bmarks_plugin_init () { # Define the BMARKS_FILE variable if undefined [ -z "$BMARKS_FILE" ] && BMARKS_FILE=$MXDF_BASH_LOCAL/bmarks.bmarks # Create the BMARKS_FILE if it doesn't exist [ ! -f "$BMARKS_FILE" ] && touch $BMARKS_FILE } && _bmarks_plugin_init # # Function: _bmarks_plugin_help() # # Display the Help for the plugin and the related functions # _bmarks_plugin_help () { _mxdf_show_header $BASH_SOURCE case "$1" in bm ) cat <<__HEREDOC_BM_HELP TBW! __HEREDOC_BM_HELP ;; * ) _describe_component_item $BASH_SOURCE ;; esac _mxdf_show_copyright } # -------------------------------------------------------------------------------------------------- # Completion Helpers # -------------------------------------------------------------------------------------------------- # # Function: _bmarks_complete() # # Completion for the BMarks functions # _bmarks_complete () { local cur prev words cword bmarks _init_completion || return bmarks=$(command grep -o '^[^# ].*=' $BMARKS_FILE | cut -d' ' -f1) COMPREPLY=( $(compgen -W "$bmarks" -- "$cur") ) } && complete -F _bmarks_complete bm bmv
{ "content_hash": "b194a9cb5d062c63dd98a37912fdee78", "timestamp": "", "source": "github", "line_count": 154, "max_line_length": 135, "avg_line_length": 23.57792207792208, "alnum_prop": 0.5483337923437069, "repo_name": "MyXelf/mx-dot-files", "id": "11bc9138ef6dffaf0089f4514f9a7f8ac03254f7", "size": "3938", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "bash/plugins/bmarks.plugins.bash", "mode": "33188", "license": "mit", "language": [ { "name": "Shell", "bytes": "120966" }, { "name": "Vim Script", "bytes": "27734" } ], "symlink_target": "" }
using System.Reflection; 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("aspmvc5_glimpse_trace")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Muhammad Rehan Saeed")] [assembly: AssemblyProduct("aspmvc5_glimpse_trace")] [assembly: AssemblyCopyright("Copyright © Muhammad Rehan Saeed 2015")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("86a6808d-0066-44e0-a1d5-be5d9ccb88d0")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
{ "content_hash": "cfead5be3de5813bbd9ab925bd685dd2", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 84, "avg_line_length": 40.3235294117647, "alnum_prop": 0.7527352297592997, "repo_name": "ashumeow/noobs", "id": "459b67afb234fae40f85deef03ae2dd65b78789f", "size": "1374", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "aspnet/aspmvc5_glimpse_trace/aspmvc5_glimpse_trace/Properties/AssemblyInfo.cs", "mode": "33188", "license": "mit", "language": [ { "name": "AGS Script", "bytes": "25463" }, { "name": "ASP", "bytes": "335" }, { "name": "C", "bytes": "8408" }, { "name": "C#", "bytes": "531687" }, { "name": "C++", "bytes": "9435" }, { "name": "CSS", "bytes": "179687" }, { "name": "HTML", "bytes": "249403" }, { "name": "Java", "bytes": "44304" }, { "name": "JavaScript", "bytes": "192462" }, { "name": "Makefile", "bytes": "673" }, { "name": "Objective-C", "bytes": "29738" }, { "name": "PHP", "bytes": "35054" }, { "name": "QML", "bytes": "2012" } ], "symlink_target": "" }
package com.amazonaws.services.ec2.model; import java.io.Serializable; /** * */ public class DescribeVpnConnectionsResult implements Serializable, Cloneable { /** * <p> * Information about one or more VPN connections. * </p> */ private com.amazonaws.internal.SdkInternalList<VpnConnection> vpnConnections; /** * <p> * Information about one or more VPN connections. * </p> * * @return Information about one or more VPN connections. */ public java.util.List<VpnConnection> getVpnConnections() { if (vpnConnections == null) { vpnConnections = new com.amazonaws.internal.SdkInternalList<VpnConnection>(); } return vpnConnections; } /** * <p> * Information about one or more VPN connections. * </p> * * @param vpnConnections * Information about one or more VPN connections. */ public void setVpnConnections( java.util.Collection<VpnConnection> vpnConnections) { if (vpnConnections == null) { this.vpnConnections = null; return; } this.vpnConnections = new com.amazonaws.internal.SdkInternalList<VpnConnection>( vpnConnections); } /** * <p> * Information about one or more VPN connections. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if * any). Use {@link #setVpnConnections(java.util.Collection)} or * {@link #withVpnConnections(java.util.Collection)} if you want to override * the existing values. * </p> * * @param vpnConnections * Information about one or more VPN connections. * @return Returns a reference to this object so that method calls can be * chained together. */ public DescribeVpnConnectionsResult withVpnConnections( VpnConnection... vpnConnections) { if (this.vpnConnections == null) { setVpnConnections(new com.amazonaws.internal.SdkInternalList<VpnConnection>( vpnConnections.length)); } for (VpnConnection ele : vpnConnections) { this.vpnConnections.add(ele); } return this; } /** * <p> * Information about one or more VPN connections. * </p> * * @param vpnConnections * Information about one or more VPN connections. * @return Returns a reference to this object so that method calls can be * chained together. */ public DescribeVpnConnectionsResult withVpnConnections( java.util.Collection<VpnConnection> vpnConnections) { setVpnConnections(vpnConnections); return this; } /** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getVpnConnections() != null) sb.append("VpnConnections: " + getVpnConnections()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DescribeVpnConnectionsResult == false) return false; DescribeVpnConnectionsResult other = (DescribeVpnConnectionsResult) obj; if (other.getVpnConnections() == null ^ this.getVpnConnections() == null) return false; if (other.getVpnConnections() != null && other.getVpnConnections().equals(this.getVpnConnections()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getVpnConnections() == null) ? 0 : getVpnConnections() .hashCode()); return hashCode; } @Override public DescribeVpnConnectionsResult clone() { try { return (DescribeVpnConnectionsResult) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException( "Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } }
{ "content_hash": "41ad472e26d66d517c13f9cc1e5c4064", "timestamp": "", "source": "github", "line_count": 159, "max_line_length": 89, "avg_line_length": 29.056603773584907, "alnum_prop": 0.5848484848484848, "repo_name": "dump247/aws-sdk-java", "id": "6b47a02dbeeea5ecdbd7bb0f9eb157002b1b0d2d", "size": "5207", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/model/DescribeVpnConnectionsResult.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "FreeMarker", "bytes": "117958" }, { "name": "Java", "bytes": "104374753" }, { "name": "Scilab", "bytes": "3375" } ], "symlink_target": "" }
 using System; using System.Collections.Generic; using System.ComponentModel; using System.Windows.Forms; using XenAdmin.Actions; using XenAdmin.Actions.Wlb; using XenAdmin.Commands; using XenAdmin.Core; using XenAdmin.Wlb; using XenAdmin.Dialogs; using XenAdmin.Dialogs.Wlb; using XenAPI; namespace XenAdmin.TabPages { public partial class WlbPage : BaseTabPage { private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); private Pool _pool; private WlbPoolConfiguration _wlbPoolConfiguration; /// <summary> /// The pool that the panel is displaying WLB info for. Must be set on the event thread. /// </summary> public Pool Pool { set { Program.AssertOnEventThread(); if (null != value) { this.wlbOptimizePool.XenObject = value; if (_pool != value) { if (_pool != null) _pool.PropertyChanged -= Pool_PropertyChanged; _pool = value; _pool.PropertyChanged += Pool_PropertyChanged; } SetRetrievingConfiguration(); RetrieveConfiguration(); RefreshControls(); } } } public WlbPage() { InitializeComponent(); base.Text = Messages.WORKLOAD_BALANCING; pdSectionConfiguration.fixFirstColumnWidth(200); RefreshControls(); } public override string HelpID => "TabPageWLB"; #region ControlEvents private void buttonConfigure_Click(object sender, EventArgs e) { if (_pool == null) { return; } // if the _wlbPoolConfiguration is null, it means we cannot communicate with the WLB // server for some reason do nothing if (null != _wlbPoolConfiguration) { DisableButtons(); EditWLB(_pool); } } private void buttonEnableDisableWlb_Click(object sender, EventArgs e) { if (WlbServerState.GetState(_pool) != WlbServerState.ServerState.Enabled) { DisableButtons(); EnableWLB(); } else { DisableButtons(); DisableWLB(false); } } #endregion #region Wlb Actions private void EnableWLB() { // Enable WLB. EnableWLBAction action = new EnableWLBAction(_pool); // We will need to re-enable buttons when the action completes action.Completed += Program.MainWindow.action_Completed; action.Completed += this.action_Completed; action.RunAsync(); } private void DisableWLB(bool deconfigure) { DisableWLBAction action = new DisableWLBAction(_pool, deconfigure); action.Completed += Program.MainWindow.action_Completed; action.Completed += this.action_Completed; action.RunAsync(); } private void RetrieveConfiguration() { // only get the config if there are no other pending wlb actions if (null == HelpersGUI.FindActiveWLBAction(_pool.Connection)) { RetrieveWlbConfigurationAction action = new RetrieveWlbConfigurationAction(_pool); action.Completed += this.action_Completed; action.RunAsync(); } } private void SaveWLBConfig(WlbPoolConfiguration PoolConfiguration) { Dictionary<string, string> completeConfiguration = PoolConfiguration.ToDictionary(); SendWlbConfigurationKind kind = SendWlbConfigurationKind.SetPoolConfiguration; // check for host configurations in the pool configuration if (PoolConfiguration.HostConfigurations.Count > 0) { // add the flag denoting that there are host configs to be saved kind |= SendWlbConfigurationKind.SetHostConfiguration; // get the key for each host config (host.uuid) foreach (string key in PoolConfiguration.HostConfigurations.ToDictionary().Keys) { //Drop any exising copy from the pool configuration if (completeConfiguration.ContainsKey(key)) { completeConfiguration.Remove(key); } // and add the task to the collection completeConfiguration.Add(key, PoolConfiguration.HostConfigurations.ToDictionary()[key]); } } // check for scheduled tasks in the pool configuration if (PoolConfiguration.ScheduledTasks.TaskList.Count > 0) { // add the flag denoting that there are scheduled tasks to be saved kind |= SendWlbConfigurationKind.SetScheduledTask; // get the key for each scheduled task foreach (string key in PoolConfiguration.ScheduledTasks.ToDictionary().Keys) { //Drop any exising copy from the pool configuration if (completeConfiguration.ContainsKey(key)) { completeConfiguration.Remove(key); } // and add the task to the collection completeConfiguration.Add(key, PoolConfiguration.ScheduledTasks.ToDictionary()[key]); } } SendWlbConfigurationAction action = new SendWlbConfigurationAction(_pool, PoolConfiguration.ToDictionary(), kind); using (var dialog = new ActionProgressDialog(action, ProgressBarStyle.Blocks)) { dialog.ShowCancel = true; dialog.ShowDialog(this); } Program.MainWindow.UpdateToolbars(); } #endregion #region Event Handlers protected void action_Completed(ActionBase sender) { // This seems to be called off the event thread AsyncAction action = (AsyncAction)sender; if (action.IsCompleted) { action.Completed -= action_Completed; if (action is EnableWLBAction || action is RetrieveWlbConfigurationAction || action is DisableWLBAction) { if (action is EnableWLBAction) { EnableWLBAction thisAction = (EnableWLBAction)action; _wlbPoolConfiguration = new WlbPoolConfiguration(thisAction.WlbConfiguration); } else if (action is RetrieveWlbConfigurationAction) { RetrieveWlbConfigurationAction thisAction = (RetrieveWlbConfigurationAction)action; if (thisAction.Succeeded) { _wlbPoolConfiguration = new WlbPoolConfiguration(thisAction.WlbConfiguration); } else { //_statusError = thisAction.Exception.Message; _wlbPoolConfiguration = null; } } else if (action is DisableWLBAction) { } Program.Invoke(Program.MainWindow, delegate() { if (_pool != null && _pool.Connection == action.Connection) { RefreshControls(); } }); } } } private void Pool_PropertyChanged(object sender, PropertyChangedEventArgs e) { // Refresh controls if a wlb pool preoprty changes, or if other_config changes if (e.PropertyName.StartsWith("wlb") || e.PropertyName == "other_config") { RefreshControls(); } } #endregion #region Private Methods /// <summary> /// Rebuilds the panel contents. Must be called on the event thread. /// </summary> private void RefreshControls() { Program.AssertOnEventThread(); if ((!this.Visible) || (null == _pool)) { return; } try { if (null != _wlbPoolConfiguration) { this.wlbOptimizePool.SuspendLayout(); // Update optimizePool control properties (versionSupport, apply button) this.wlbOptimizePool.SetOptControlProperties(_wlbPoolConfiguration.AutoBalanceEnabled, _wlbPoolConfiguration.PowerManagementEnabled); this.wlbOptimizePool.ResumeLayout(); } SetButtonState(); SetConfigurationItems(); } catch { //do nothing } } private void SetRetrievingConfiguration() { pdSectionConfiguration.PauseLayout(); pdSectionConfiguration.ClearData(); pdSectionConfiguration.AddEntry(Messages.WLB_RETRIEVING_CONFIGURATION, Messages.WLB_PLEASE_WAIT); pdSectionConfiguration.StartLayout(); pdSectionConfiguration.Expand(); } private void SetConfigurationItems() { // Populate the Configuration Items pdSectionConfiguration.PauseLayout(); pdSectionConfiguration.ClearData(); if (WlbServerState.GetState(_pool) == WlbServerState.ServerState.ConnectionError) { pdSectionConfiguration.AddEntry(Messages.WLB_STATUS, getPoolWLBStatus(_pool)); pdSectionConfiguration.AddEntry(Messages.WLB_SERVER_URL, getPoolWLBServer(_pool)); } else { pdSectionConfiguration.AddEntry(Messages.WLB_SERVER_URL, getPoolWLBServer(_pool)); pdSectionConfiguration.AddEntry(Messages.WLB_OPT_MODE, getPoolOptMode(_pool)); if (null != _wlbPoolConfiguration) { if (_wlbPoolConfiguration.AutomateOptimizationMode) { pdSectionConfiguration.AddEntry(Messages.WLB_NEXT_OPT_MODE_SCHEDULE_TEXT, getNextOptModeTask(_pool)); } pdSectionConfiguration.AddEntry(Messages.WLB_AUTO_OPT, getAutoOptimization(_pool)); pdSectionConfiguration.AddEntry(Messages.WLB_PWR_MGT, getPoolWlbPowerManagement(_pool)); } } pdSectionConfiguration.Expand(); pdSectionConfiguration.StartLayout(); } private RbacMethodList WLB_PERMISSION_CHECKS = new RbacMethodList( "pool.initialize_wlb", "pool.set_wlb_enabled", "pool.send_wlb_configuration" ); private bool PassedRbacChecks() { return Role.CanPerform(WLB_PERMISSION_CHECKS, _pool.Connection, out _); } private void SetButtonState() { string statusMessage = string.Empty; string rbacUser = string.Empty; bool passedRbacChecks = PassedRbacChecks(); if (!passedRbacChecks) { List<Role> roleList = _pool.Connection.Session.Roles; roleList.Sort(); rbacUser = roleList[0].FriendlyName(); } AsyncAction thisAction = HelpersGUI.FindActiveWLBAction(_pool.Connection); if (thisAction is RetrieveWlbConfigurationAction) { DisableButtons(); return; } //if wlb is not configured, // disable the config button and change the text of the Enable button to Initialize WLB... //else if (!wlbConfigured) else if (WlbServerState.GetState(_pool) == WlbServerState.ServerState.NotConfigured) { buttonConnect.Visible = true; buttonConnect.Text = Messages.WLB_CONNECT; buttonConfigure.Visible = false; buttonEnableDisableWlb.Visible = false; buttonReports.Visible = false; pictureBoxWarningTriangle.Visible = false; if (passedRbacChecks) { statusMessage = string.Format(Messages.WLB_INITIALIZE_WLB_BLURB, _pool.Name()); } else { statusMessage = string.Format(Messages.WLB_INITIALIZE_WLB_BLURB_NO_PRIV, _pool.Name(), rbacUser); } labelStatus.Text = statusMessage; pictureBoxWarningTriangle.Visible = (WlbServerState.GetState(_pool) == WlbServerState.ServerState.ConnectionError); panelConfiguration.Visible = false; wlbOptimizePool.Visible = false; } //if there is an error contacting the WLB server, // disable the config button and change the text of the Enable button to Initialize WLB... //else if (!wlbConfigured) else if (WlbServerState.GetState(_pool) == WlbServerState.ServerState.ConnectionError) { buttonConnect.Visible = true; buttonConnect.Text = Messages.WLB_RECONNECT; buttonConfigure.Visible = false; buttonEnableDisableWlb.Visible = false; buttonReports.Visible = false; pictureBoxWarningTriangle.Visible = true; if (passedRbacChecks) { statusMessage = Messages.WLB_CONNECTION_ERROR_BLURB; } else { statusMessage = string.Format(Messages.WLB_CONNECTION_ERROR_BLURB_NO_PRIV, rbacUser); } labelStatus.Text = statusMessage; labelStatus.Visible = true; pictureBoxWarningTriangle.Visible = (WlbServerState.GetState(_pool) == WlbServerState.ServerState.ConnectionError); buttonReports.Enabled = false; panelConfiguration.Visible = false; wlbOptimizePool.Visible = false; } //if wlb is configured but not enabled, //enable the configure button and enble the enable button //else if (wlbConfigured && !wlbEnabled) else if (WlbServerState.GetState(_pool) == WlbServerState.ServerState.Disabled) { base.Text = Messages.WORKLOAD_BALANCING; buttonConnect.Visible = false; buttonConfigure.Visible = true; buttonEnableDisableWlb.Visible = true; buttonReports.Visible = true; pictureBoxWarningTriangle.Visible = true; buttonConfigure.Enabled = true; buttonEnableDisableWlb.Enabled = true; buttonEnableDisableWlb.Text = Messages.ENABLE_WLB_ELLIPSIS; buttonEnableDisableWlb.ImageIndex = 1; //Play arrow if (!passedRbacChecks) { statusMessage = string.Format(Messages.WLB_ENABLE_WLB_BLURB_NO_PRIV, _pool.Name(), rbacUser); } else { statusMessage = string.Format(Messages.WLB_ENABLE_WLB_BLURB, _pool.Name()); } labelStatus.Text = statusMessage; buttonReports.Enabled = true; panelConfiguration.Visible = true; wlbOptimizePool.Visible = true; } //otherwise, if wlb is configured and enabled, allow configuration, and show enable as Disable //else if (wlbEnabled) else if (WlbServerState.GetState(_pool) == WlbServerState.ServerState.Enabled) { buttonConnect.Visible = false; buttonConfigure.Visible = true; buttonEnableDisableWlb.Visible = true; buttonReports.Visible = true; pictureBoxWarningTriangle.Visible = false; buttonConfigure.Enabled = true; buttonEnableDisableWlb.Enabled = true; buttonEnableDisableWlb.Text = Messages.DISABLE_WLB_ELLIPSIS; buttonEnableDisableWlb.ImageIndex = 0; //Pause hashes if (!passedRbacChecks) { statusMessage = string.Format(Messages.WLB_NO_PERMISSION_BLURB, rbacUser); } else { statusMessage = string.Format(Messages.WLB_ENABLED_BLURB, _pool.Name()); } labelStatus.Text = statusMessage; buttonReports.Enabled = true; panelConfiguration.Visible = true; wlbOptimizePool.Visible = true; } if (PassedRbacChecks()) { //Show the buttons flowLayoutPanelLeftButtons.Visible = true; //panelButtons.Visible = true; } else { //disable and hide the buttons DisableButtons(); flowLayoutPanelLeftButtons.Visible = false; //panelButtons.Visible = false; } } private void DisableButtons() { buttonConfigure.Enabled = false; buttonEnableDisableWlb.Enabled = false; } internal void EditWLB(Pool pool) { // Do nothing if there is a WLB action in progress if (HelpersGUI.FindActiveWLBAction(pool.Connection) != null) { log.Debug("Not opening WLB dialog: an WLB action is in progress"); return; } if (!pool.Connection.IsConnected) { log.Debug("Not opening WLB dialog: the connection to the pool is now closed"); return; } try { WlbConfigurationDialog wlbConfigDialog = new WlbConfigurationDialog(pool); DialogResult dr = wlbConfigDialog.ShowDialog(); if (dr == DialogResult.OK) { _wlbPoolConfiguration = wlbConfigDialog.WlbPoolConfiguration; //check to see if the current opt mode matches the current schedule if (_wlbPoolConfiguration.AutomateOptimizationMode) { WlbPoolPerformanceMode scheduledPerfMode = _wlbPoolConfiguration.ScheduledTasks.GetCurrentScheduledPerformanceMode(); if (scheduledPerfMode != _wlbPoolConfiguration.PerformanceMode) { string blurb = string.Format(Messages.WLB_PROMPT_FOR_MODE_CHANGE_BLURB, getOptModeText(scheduledPerfMode), getOptModeText(_wlbPoolConfiguration.PerformanceMode)); DialogResult drModeCheck; using (var dlg = new NoIconDialog(blurb, ThreeButtonDialog.ButtonYes, ThreeButtonDialog.ButtonNo) {WindowTitle = Messages.WLB_PROMPT_FOR_MODE_CHANGE_CAPTION}) { drModeCheck = dlg.ShowDialog(this); } if (drModeCheck == DialogResult.Yes) { _wlbPoolConfiguration.PerformanceMode = scheduledPerfMode; } } } SaveWLBConfig(_wlbPoolConfiguration); } } catch (Exception ex) { log.Debug("Unable to open the WLB configuration dialog.", ex); return; } if (!(WlbServerState.GetState(_pool) == WlbServerState.ServerState.NotConfigured)) { RetrieveConfiguration(); } } private string getPoolWLBStatus(Pool pool) { return String.Format(Messages.WLB_RECONFIGURE, String.IsNullOrEmpty(WlbServerState.GetFailureMessage(_pool)) ? string.Empty : WlbServerState.GetFailureMessage(_pool)); } private string getPoolWLBServer(Pool pool) { if (Helpers.WlbConfigured(pool.Connection)) { return pool.wlb_url; } return Messages.NONE_DEFINED; } private string getPoolOptMode(Pool pool) { string optMode = Messages.UNKNOWN; if (null != _wlbPoolConfiguration && Helpers.WlbConfigured(pool.Connection)) { if (_wlbPoolConfiguration.AutomateOptimizationMode) { optMode = string.Format(Messages.WLB_SCHEDULED_OPT_MODE, getOptModeText(_wlbPoolConfiguration.PerformanceMode)); } else { optMode = getOptModeText(_wlbPoolConfiguration.PerformanceMode); } } return optMode; } private string getOptModeText(WlbPoolPerformanceMode mode) { return (mode == WlbPoolPerformanceMode.MaximizePerformance) ? Messages.WLB_OPT_MODE_MAXIMIZEPERFORMANCE : Messages.WLB_OPT_MODE_MAXIMIZEDENSITY; } private string getNextOptModeTask(Pool pool) { //figure out the next task and return a nice string for display WlbScheduledTask nextTask = _wlbPoolConfiguration.ScheduledTasks.GetNextRunningTask(); WlbScheduledTask.WlbTaskDaysOfWeek dayOfWeek; DateTime runTime; WlbScheduledTask.GetLocalTaskTimes(nextTask.DaysOfWeek, nextTask.RunTime, out dayOfWeek, out runTime); string localDayOfWeek = WlbScheduledTask.DaysOfWeekL10N(dayOfWeek); return string.Format(Messages.WLB_NEXT_OPT_MODE_SCHEDULE_FORMAT, localDayOfWeek, HelpersGUI.DateTimeToString(runTime, Messages.DATEFORMAT_HM, true)); } private string getAutoOptimization(Pool pool) { if (null != _wlbPoolConfiguration && Helpers.WlbConfigured(pool.Connection)) { return _wlbPoolConfiguration.AutoBalanceEnabled ? Messages.YES : Messages.NO; } return Messages.UNKNOWN; } private string getPoolWlbPowerManagement(Pool pool) { if (null != _wlbPoolConfiguration && Helpers.WlbConfigured(pool.Connection)) { return _wlbPoolConfiguration.PowerManagementEnabled ? Messages.YES : Messages.NO; } return Messages.UNKNOWN; } private void buttonConnect_Click(object sender, EventArgs e) { if (Helpers.WlbConfigured(_pool.Connection) && !(WlbServerState.GetState(_pool) == WlbServerState.ServerState.ConnectionError || WlbServerState.GetState(_pool) == WlbServerState.ServerState.NotConfigured)) { return; } DisableButtons(); WlbCredentialsDialog wlbCredentialsDialog = new WlbCredentialsDialog(_pool); DialogResult dr = wlbCredentialsDialog.ShowDialog(); if (dr == DialogResult.OK) { EnableWLB(); } else { SetButtonState(); } } private void buttonReports_Click(object sender, EventArgs e) { ViewWorkloadReportsCommand viewWorkloadReportsCommand = new ViewWorkloadReportsCommand(Program.MainWindow, _pool); viewWorkloadReportsCommand.Run(); } #endregion } }
{ "content_hash": "18ab489ac028e70f1568fa0fb425562f", "timestamp": "", "source": "github", "line_count": 647, "max_line_length": 190, "avg_line_length": 39.02936630602782, "alnum_prop": 0.5300570251861239, "repo_name": "xenserver/xenadmin", "id": "2c2f047fb69637b55cfaa019649ed2fb123d5839", "size": "26712", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "XenAdmin/TabPages/WlbPage.cs", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "Batchfile", "bytes": "14" }, { "name": "C#", "bytes": "18727644" }, { "name": "JavaScript", "bytes": "829" }, { "name": "PowerShell", "bytes": "22632" }, { "name": "Shell", "bytes": "16679" }, { "name": "VBScript", "bytes": "11647" } ], "symlink_target": "" }
<?php App::uses('Controller', 'Controller'); App::uses('Helper', 'View'); App::uses('AppHelper', 'View/Helper'); App::uses('HtmlHelper', 'View/Helper'); App::uses('FormHelper', 'View/Helper'); App::uses('ClassRegistry', 'Utility'); App::uses('Folder', 'Utility'); if (!defined('FULL_BASE_URL')) { define('FULL_BASE_URL', 'http://cakephp.org'); } /** * TheHtmlTestController class * * @package Cake.Test.Case.View.Helper */ class TheHtmlTestController extends Controller { /** * name property * * @var string 'TheTest' */ public $name = 'TheTest'; /** * uses property * * @var mixed null */ public $uses = null; } class TestHtmlHelper extends HtmlHelper { /** * expose a method as public * * @param string $options * @param string $exclude * @param string $insertBefore * @param string $insertAfter * @return void */ public function parseAttributes($options, $exclude = null, $insertBefore = ' ', $insertAfter = null) { return $this->_parseAttributes($options, $exclude, $insertBefore, $insertAfter); } /** * Get a protected attribute value * * @param string $attribute * @return mixed */ public function getAttribute($attribute) { if (!isset($this->{$attribute})) { return null; } return $this->{$attribute}; } } /** * Html5TestHelper class * * @package Cake.Test.Case.View.Helper */ class Html5TestHelper extends TestHtmlHelper { /** * Minimized * * @var array */ protected $_minimizedAttributes = array('require', 'checked'); /** * Allow compact use in HTML * * @var string */ protected $_minimizedAttributeFormat = '%s'; /** * Test to attribute format * * @var string */ protected $_attributeFormat = 'data-%s="%s"'; } /** * HtmlHelperTest class * * @package Cake.Test.Case.View.Helper */ class HtmlHelperTest extends CakeTestCase { /** * Regexp for CDATA start block * * @var string */ public $cDataStart = 'preg:/^\/\/<!\[CDATA\[[\n\r]*/'; /** * Regexp for CDATA end block * * @var string */ public $cDataEnd = 'preg:/[^\]]*\]\]\>[\s\r\n]*/'; /** * html property * * @var object */ public $Html = null; /** * setUp method * * @return void */ public function setUp() { parent::setUp(); $this->View = $this->getMock('View', array('append'), array(new TheHtmlTestController())); $this->Html = new TestHtmlHelper($this->View); $this->Html->request = new CakeRequest(null, false); $this->Html->request->webroot = ''; App::build(array( 'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS) )); Configure::write('Asset.timestamp', false); } /** * tearDown method * * @return void */ public function tearDown() { parent::tearDown(); unset($this->Html, $this->View); } /** * testDocType method * * @return void */ public function testDocType() { $result = $this->Html->docType(); $expected = '<!DOCTYPE html>'; $this->assertEquals($expected, $result); $result = $this->Html->docType('html4-strict'); $expected = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">'; $this->assertEquals($expected, $result); $this->assertNull($this->Html->docType('non-existing-doctype')); } /** * testLink method * * @return void */ public function testLink() { Router::connect('/:controller/:action/*'); $this->Html->request->webroot = ''; $result = $this->Html->link('/home'); $expected = array('a' => array('href' => '/home'), 'preg:/\/home/', '/a'); $this->assertTags($result, $expected); $result = $this->Html->link(array('action' => 'login', '<[You]>')); $expected = array( 'a' => array('href' => '/login/%3C%5BYou%5D%3E'), 'preg:/\/login\/&lt;\[You\]&gt;/', '/a' ); $this->assertTags($result, $expected); Router::reload(); $result = $this->Html->link('Posts', array('controller' => 'posts', 'action' => 'index', 'full_base' => true)); $expected = array('a' => array('href' => FULL_BASE_URL . '/posts'), 'Posts', '/a'); $this->assertTags($result, $expected); $result = $this->Html->link('Home', '/home', array('confirm' => 'Are you sure you want to do this?')); $expected = array( 'a' => array('href' => '/home', 'onclick' => 'return confirm(&#039;Are you sure you want to do this?&#039;);'), 'Home', '/a' ); $this->assertTags($result, $expected); $result = $this->Html->link('Home', '/home', array('default' => false)); $expected = array( 'a' => array('href' => '/home', 'onclick' => 'event.returnValue = false; return false;'), 'Home', '/a' ); $this->assertTags($result, $expected); $result = $this->Html->link('Home', '/home', array('default' => false, 'onclick' => 'someFunction();')); $expected = array( 'a' => array('href' => '/home', 'onclick' => 'someFunction(); event.returnValue = false; return false;'), 'Home', '/a' ); $this->assertTags($result, $expected); $result = $this->Html->link('Next >', '#'); $expected = array( 'a' => array('href' => '#'), 'Next &gt;', '/a' ); $this->assertTags($result, $expected); $result = $this->Html->link('Next >', '#', array('escape' => true)); $expected = array( 'a' => array('href' => '#'), 'Next &gt;', '/a' ); $this->assertTags($result, $expected); $result = $this->Html->link('Next >', '#', array('escape' => 'utf-8')); $expected = array( 'a' => array('href' => '#'), 'Next &gt;', '/a' ); $this->assertTags($result, $expected); $result = $this->Html->link('Next >', '#', array('escape' => false)); $expected = array( 'a' => array('href' => '#'), 'Next >', '/a' ); $this->assertTags($result, $expected); $result = $this->Html->link('Next >', '#', array( 'title' => 'to escape &#8230; or not escape?', 'escape' => false )); $expected = array( 'a' => array('href' => '#', 'title' => 'to escape &#8230; or not escape?'), 'Next >', '/a' ); $this->assertTags($result, $expected); $result = $this->Html->link('Next >', '#', array( 'title' => 'to escape &#8230; or not escape?', 'escape' => true )); $expected = array( 'a' => array('href' => '#', 'title' => 'to escape &amp;#8230; or not escape?'), 'Next &gt;', '/a' ); $this->assertTags($result, $expected); $result = $this->Html->link('Original size', array( 'controller' => 'images', 'action' => 'view', 3, '?' => array('height' => 100, 'width' => 200) )); $expected = array( 'a' => array('href' => '/images/view/3?height=100&amp;width=200'), 'Original size', '/a' ); $this->assertTags($result, $expected); Configure::write('Asset.timestamp', false); $result = $this->Html->link($this->Html->image('test.gif'), '#', array('escape' => false)); $expected = array( 'a' => array('href' => '#'), 'img' => array('src' => 'img/test.gif', 'alt' => ''), '/a' ); $this->assertTags($result, $expected); $result = $this->Html->image('test.gif', array('url' => '#')); $expected = array( 'a' => array('href' => '#'), 'img' => array('src' => 'img/test.gif', 'alt' => ''), '/a' ); $this->assertTags($result, $expected); $result = $this->Html->link($this->Html->image('../favicon.ico'), '#', array('escape' => false)); $expected = array( 'a' => array('href' => '#'), 'img' => array('src' => 'img/../favicon.ico', 'alt' => ''), '/a' ); $this->assertTags($result, $expected); $result = $this->Html->image('../favicon.ico', array('url' => '#')); $expected = array( 'a' => array('href' => '#'), 'img' => array('src' => 'img/../favicon.ico', 'alt' => ''), '/a' ); $this->assertTags($result, $expected); $result = $this->Html->link('http://www.example.org?param1=value1&param2=value2'); $expected = array('a' => array('href' => 'http://www.example.org?param1=value1&amp;param2=value2'), 'http://www.example.org?param1=value1&amp;param2=value2', '/a'); $this->assertTags($result, $expected); $result = $this->Html->link('alert', 'javascript:alert(\'cakephp\');'); $expected = array('a' => array('href' => 'javascript:alert(&#039;cakephp&#039;);'), 'alert', '/a'); $this->assertTags($result, $expected); $result = $this->Html->link('write me', 'mailto:example@cakephp.org'); $expected = array('a' => array('href' => 'mailto:example@cakephp.org'), 'write me', '/a'); $this->assertTags($result, $expected); $result = $this->Html->link('call me on 0123465-798', 'tel:0123465-798'); $expected = array('a' => array('href' => 'tel:0123465-798'), 'call me on 0123465-798', '/a'); $this->assertTags($result, $expected); $result = $this->Html->link('text me on 0123465-798', 'sms:0123465-798'); $expected = array('a' => array('href' => 'sms:0123465-798'), 'text me on 0123465-798', '/a'); $this->assertTags($result, $expected); $result = $this->Html->link('say hello to 0123465-798', 'sms:0123465-798?body=hello there'); $expected = array('a' => array('href' => 'sms:0123465-798?body=hello there'), 'say hello to 0123465-798', '/a'); $this->assertTags($result, $expected); $result = $this->Html->link('say hello to 0123465-798', 'sms:0123465-798?body=hello "cakephp"'); $expected = array('a' => array('href' => 'sms:0123465-798?body=hello &quot;cakephp&quot;'), 'say hello to 0123465-798', '/a'); $this->assertTags($result, $expected); } /** * testImageTag method * * @return void */ public function testImageTag() { $this->Html->request->webroot = ''; $result = $this->Html->image('test.gif'); $this->assertTags($result, array('img' => array('src' => 'img/test.gif', 'alt' => ''))); $result = $this->Html->image('http://google.com/logo.gif'); $this->assertTags($result, array('img' => array('src' => 'http://google.com/logo.gif', 'alt' => ''))); $result = $this->Html->image(array('controller' => 'test', 'action' => 'view', 1, 'ext' => 'gif')); $this->assertTags($result, array('img' => array('src' => '/test/view/1.gif', 'alt' => ''))); $result = $this->Html->image('/test/view/1.gif'); $this->assertTags($result, array('img' => array('src' => '/test/view/1.gif', 'alt' => ''))); $result = $this->Html->image('test.gif?one=two&three=four'); $this->assertTags($result, array('img' => array('src' => 'img/test.gif?one=two&amp;three=four', 'alt' => ''))); } /** * Test that image() works with fullBase and a webroot not equal to / * * @return void */ public function testImageWithFullBase() { $result = $this->Html->image('test.gif', array('fullBase' => true)); $here = $this->Html->url('/', true); $this->assertTags($result, array('img' => array('src' => $here . 'img/test.gif', 'alt' => ''))); $result = $this->Html->image('sub/test.gif', array('fullBase' => true)); $here = $this->Html->url('/', true); $this->assertTags($result, array('img' => array('src' => $here . 'img/sub/test.gif', 'alt' => ''))); $request = $this->Html->request; $request->webroot = '/myproject/'; $request->base = '/myproject'; Router::setRequestInfo($request); $result = $this->Html->image('sub/test.gif', array('fullBase' => true)); $here = $this->Html->url('/', true); $this->assertTags($result, array('img' => array('src' => $here . 'img/sub/test.gif', 'alt' => ''))); } /** * test image() with Asset.timestamp * * @return void */ public function testImageWithTimestampping() { Configure::write('Asset.timestamp', 'force'); $this->Html->request->webroot = '/'; $result = $this->Html->image('cake.icon.png'); $this->assertTags($result, array('img' => array('src' => 'preg:/\/img\/cake\.icon\.png\?\d+/', 'alt' => ''))); Configure::write('debug', 0); Configure::write('Asset.timestamp', 'force'); $result = $this->Html->image('cake.icon.png'); $this->assertTags($result, array('img' => array('src' => 'preg:/\/img\/cake\.icon\.png\?\d+/', 'alt' => ''))); $this->Html->request->webroot = '/testing/longer/'; $result = $this->Html->image('cake.icon.png'); $expected = array( 'img' => array('src' => 'preg:/\/testing\/longer\/img\/cake\.icon\.png\?[0-9]+/', 'alt' => '') ); $this->assertTags($result, $expected); } /** * Tests creation of an image tag using a theme and asset timestamping * * @return void */ public function testImageTagWithTheme() { $this->skipIf(!is_writable(WWW_ROOT), 'Cannot write to webroot.'); $themeExists = is_dir(WWW_ROOT . 'theme'); App::uses('File', 'Utility'); $testfile = WWW_ROOT . 'theme' . DS . 'test_theme' . DS . 'img' . DS . '__cake_test_image.gif'; $File = new File($testfile, true); App::build(array( 'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS) )); Configure::write('Asset.timestamp', true); Configure::write('debug', 1); $this->Html->request->webroot = '/'; $this->Html->theme = 'test_theme'; $result = $this->Html->image('__cake_test_image.gif'); $this->assertTags($result, array( 'img' => array( 'src' => 'preg:/\/theme\/test_theme\/img\/__cake_test_image\.gif\?\d+/', 'alt' => '' ))); $this->Html->request->webroot = '/testing/'; $result = $this->Html->image('__cake_test_image.gif'); $this->assertTags($result, array( 'img' => array( 'src' => 'preg:/\/testing\/theme\/test_theme\/img\/__cake_test_image\.gif\?\d+/', 'alt' => '' ))); $dir = new Folder(WWW_ROOT . 'theme' . DS . 'test_theme'); $dir->delete(); if (!$themeExists) { $dir = new Folder(WWW_ROOT . 'theme'); $dir->delete(); } } /** * test theme assets in main webroot path * * @return void */ public function testThemeAssetsInMainWebrootPath() { App::build(array( 'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS) )); $webRoot = Configure::read('App.www_root'); Configure::write('App.www_root', CAKE . 'Test' . DS . 'test_app' . DS . 'webroot' . DS); $this->Html->theme = 'test_theme'; $result = $this->Html->css('webroot_test'); $expected = array( 'link' => array('rel' => 'stylesheet', 'type' => 'text/css', 'href' => 'preg:/.*theme\/test_theme\/css\/webroot_test\.css/') ); $this->assertTags($result, $expected); $this->Html->theme = 'test_theme'; $result = $this->Html->css('theme_webroot'); $expected = array( 'link' => array('rel' => 'stylesheet', 'type' => 'text/css', 'href' => 'preg:/.*theme\/test_theme\/css\/theme_webroot\.css/') ); $this->assertTags($result, $expected); Configure::write('App.www_root', $webRoot); } /** * testStyle method * * @return void */ public function testStyle() { $result = $this->Html->style('display: none;'); $this->assertEquals('display: none;', $result); $result = $this->Html->style(array('display' => 'none', 'margin' => '10px')); $expected = 'display:none; margin:10px;'; $this->assertRegExp('/^display\s*:\s*none\s*;\s*margin\s*:\s*10px\s*;?$/', $expected); $result = $this->Html->style(array('display' => 'none', 'margin' => '10px'), false); $lines = explode("\n", $result); $this->assertRegExp('/^\s*display\s*:\s*none\s*;\s*$/', $lines[0]); $this->assertRegExp('/^\s*margin\s*:\s*10px\s*;?$/', $lines[1]); } /** * testCssLink method * * @return void */ public function testCssLink() { Configure::write('Asset.filter.css', false); $result = $this->Html->css('screen'); $expected = array( 'link' => array('rel' => 'stylesheet', 'type' => 'text/css', 'href' => 'preg:/.*css\/screen\.css/') ); $this->assertTags($result, $expected); $result = $this->Html->css('screen.css'); $this->assertTags($result, $expected); CakePlugin::load('TestPlugin'); $result = $this->Html->css('TestPlugin.style', null, array('plugin' => false)); $expected['link']['href'] = 'preg:/.*css\/TestPlugin\.style\.css/'; $this->assertTags($result, $expected); CakePlugin::unload('TestPlugin'); $result = $this->Html->css('my.css.library'); $expected['link']['href'] = 'preg:/.*css\/my\.css\.library\.css/'; $this->assertTags($result, $expected); $result = $this->Html->css('screen.css?1234'); $expected['link']['href'] = 'preg:/.*css\/screen\.css\?1234/'; $this->assertTags($result, $expected); $result = $this->Html->css('screen.css?with=param&other=param'); $expected['link']['href'] = 'css/screen.css?with=param&amp;other=param'; $this->assertTags($result, $expected); $result = $this->Html->css('http://whatever.com/screen.css?1234'); $expected['link']['href'] = 'preg:/http:\/\/.*\/screen\.css\?1234/'; $this->assertTags($result, $expected); Configure::write('Asset.filter.css', 'css.php'); $result = $this->Html->css('cake.generic'); $expected['link']['href'] = 'preg:/.*ccss\/cake\.generic\.css/'; $this->assertTags($result, $expected); $result = $this->Html->css('//example.com/css/cake.generic.css'); $expected['link']['href'] = 'preg:/.*example\.com\/css\/cake\.generic\.css/'; $this->assertTags($result, $expected); Configure::write('Asset.filter.css', false); $result = explode("\n", trim($this->Html->css(array('cake.generic', 'vendor.generic')))); $expected['link']['href'] = 'preg:/.*css\/cake\.generic\.css/'; $this->assertTags($result[0], $expected); $expected['link']['href'] = 'preg:/.*css\/vendor\.generic\.css/'; $this->assertTags($result[1], $expected); $this->assertEquals(2, count($result)); $this->View->expects($this->at(0)) ->method('append') ->with('css', $this->matchesRegularExpression('/css_in_head.css/')); $this->View->expects($this->at(1)) ->method('append') ->with('css', $this->matchesRegularExpression('/more_css_in_head.css/')); $result = $this->Html->css('css_in_head', null, array('inline' => false)); $this->assertNull($result); $result = $this->Html->css('more_css_in_head', null, array('inline' => false)); $this->assertNull($result); } /** * testPluginCssLink method * * @return void */ public function testPluginCssLink() { Configure::write('Asset.filter.css', false); CakePlugin::load('TestPlugin'); $result = $this->Html->css('TestPlugin.test_plugin_asset'); $expected = array( 'link' => array('rel' => 'stylesheet', 'type' => 'text/css', 'href' => 'preg:/.*test_plugin\/css\/test_plugin_asset\.css/') ); $this->assertTags($result, $expected); $result = $this->Html->css('TestPlugin.test_plugin_asset.css'); $this->assertTags($result, $expected); $result = $this->Html->css('TestPlugin.my.css.library'); $expected['link']['href'] = 'preg:/.*test_plugin\/css\/my\.css\.library\.css/'; $this->assertTags($result, $expected); $result = $this->Html->css('TestPlugin.test_plugin_asset.css?1234'); $expected['link']['href'] = 'preg:/.*test_plugin\/css\/test_plugin_asset\.css\?1234/'; $this->assertTags($result, $expected); Configure::write('Asset.filter.css', 'css.php'); $result = $this->Html->css('TestPlugin.test_plugin_asset'); $expected['link']['href'] = 'preg:/.*test_plugin\/ccss\/test_plugin_asset\.css/'; $this->assertTags($result, $expected); Configure::write('Asset.filter.css', false); $result = explode("\n", trim($this->Html->css(array('TestPlugin.test_plugin_asset', 'TestPlugin.vendor.generic')))); $expected['link']['href'] = 'preg:/.*test_plugin\/css\/test_plugin_asset\.css/'; $this->assertTags($result[0], $expected); $expected['link']['href'] = 'preg:/.*test_plugin\/css\/vendor\.generic\.css/'; $this->assertTags($result[1], $expected); $this->assertEquals(2, count($result)); CakePlugin::unload('TestPlugin'); } /** * test use of css() and timestamping * * @return void */ public function testCssTimestamping() { Configure::write('debug', 2); Configure::write('Asset.timestamp', true); $expected = array( 'link' => array('rel' => 'stylesheet', 'type' => 'text/css', 'href' => '') ); $result = $this->Html->css('cake.generic'); $expected['link']['href'] = 'preg:/.*css\/cake\.generic\.css\?[0-9]+/'; $this->assertTags($result, $expected); Configure::write('debug', 0); $result = $this->Html->css('cake.generic'); $expected['link']['href'] = 'preg:/.*css\/cake\.generic\.css/'; $this->assertTags($result, $expected); Configure::write('Asset.timestamp', 'force'); $result = $this->Html->css('cake.generic'); $expected['link']['href'] = 'preg:/.*css\/cake\.generic\.css\?[0-9]+/'; $this->assertTags($result, $expected); $this->Html->request->webroot = '/testing/'; $result = $this->Html->css('cake.generic'); $expected['link']['href'] = 'preg:/\/testing\/css\/cake\.generic\.css\?[0-9]+/'; $this->assertTags($result, $expected); $this->Html->request->webroot = '/testing/longer/'; $result = $this->Html->css('cake.generic'); $expected['link']['href'] = 'preg:/\/testing\/longer\/css\/cake\.generic\.css\?[0-9]+/'; $this->assertTags($result, $expected); } /** * test use of css() and timestamping with plugin syntax * * @return void */ public function testPluginCssTimestamping() { CakePlugin::load('TestPlugin'); Configure::write('debug', 2); Configure::write('Asset.timestamp', true); $expected = array( 'link' => array('rel' => 'stylesheet', 'type' => 'text/css', 'href' => '') ); $result = $this->Html->css('TestPlugin.test_plugin_asset'); $expected['link']['href'] = 'preg:/.*test_plugin\/css\/test_plugin_asset\.css\?[0-9]+/'; $this->assertTags($result, $expected); Configure::write('debug', 0); $result = $this->Html->css('TestPlugin.test_plugin_asset'); $expected['link']['href'] = 'preg:/.*test_plugin\/css\/test_plugin_asset\.css/'; $this->assertTags($result, $expected); Configure::write('Asset.timestamp', 'force'); $result = $this->Html->css('TestPlugin.test_plugin_asset'); $expected['link']['href'] = 'preg:/.*test_plugin\/css\/test_plugin_asset\.css\?[0-9]+/'; $this->assertTags($result, $expected); $this->Html->request->webroot = '/testing/'; $result = $this->Html->css('TestPlugin.test_plugin_asset'); $expected['link']['href'] = 'preg:/\/testing\/test_plugin\/css\/test_plugin_asset\.css\?[0-9]+/'; $this->assertTags($result, $expected); $this->Html->request->webroot = '/testing/longer/'; $result = $this->Html->css('TestPlugin.test_plugin_asset'); $expected['link']['href'] = 'preg:/\/testing\/longer\/test_plugin\/css\/test_plugin_asset\.css\?[0-9]+/'; $this->assertTags($result, $expected); CakePlugin::unload('TestPlugin'); } /** * test timestamp enforcement for script tags. * * @return void */ public function testScriptTimestamping() { $this->skipIf(!is_writable(JS), 'webroot/js is not Writable, timestamp testing has been skipped.'); Configure::write('debug', 2); Configure::write('Asset.timestamp', true); touch(WWW_ROOT . 'js' . DS . '__cake_js_test.js'); $timestamp = substr(strtotime('now'), 0, 8); $result = $this->Html->script('__cake_js_test', array('inline' => true, 'once' => false)); $this->assertRegExp('/__cake_js_test.js\?' . $timestamp . '[0-9]{2}"/', $result, 'Timestamp value not found %s'); Configure::write('debug', 0); Configure::write('Asset.timestamp', 'force'); $result = $this->Html->script('__cake_js_test', array('inline' => true, 'once' => false)); $this->assertRegExp('/__cake_js_test.js\?' . $timestamp . '[0-9]{2}"/', $result, 'Timestamp value not found %s'); unlink(WWW_ROOT . 'js' . DS . '__cake_js_test.js'); Configure::write('Asset.timestamp', false); } /** * test timestamp enforcement for script tags with plugin syntax. * * @return void */ public function testPluginScriptTimestamping() { CakePlugin::load('TestPlugin'); $pluginPath = App::pluginPath('TestPlugin'); $pluginJsPath = $pluginPath . 'webroot/js'; $this->skipIf(!is_writable($pluginJsPath), $pluginJsPath . ' is not Writable, timestamp testing has been skipped.'); Configure::write('debug', 2); Configure::write('Asset.timestamp', true); touch($pluginJsPath . DS . '__cake_js_test.js'); $timestamp = substr(strtotime('now'), 0, 8); $result = $this->Html->script('TestPlugin.__cake_js_test', array('inline' => true, 'once' => false)); $this->assertRegExp('/test_plugin\/js\/__cake_js_test.js\?' . $timestamp . '[0-9]{2}"/', $result, 'Timestamp value not found %s'); Configure::write('debug', 0); Configure::write('Asset.timestamp', 'force'); $result = $this->Html->script('TestPlugin.__cake_js_test', array('inline' => true, 'once' => false)); $this->assertRegExp('/test_plugin\/js\/__cake_js_test.js\?' . $timestamp . '[0-9]{2}"/', $result, 'Timestamp value not found %s'); unlink($pluginJsPath . DS . '__cake_js_test.js'); Configure::write('Asset.timestamp', false); CakePlugin::unload('TestPlugin'); } /** * test that scripts added with uses() are only ever included once. * test script tag generation * * @return void */ public function testScript() { $result = $this->Html->script('foo'); $expected = array( 'script' => array('type' => 'text/javascript', 'src' => 'js/foo.js') ); $this->assertTags($result, $expected); $result = $this->Html->script(array('foobar', 'bar')); $expected = array( array('script' => array('type' => 'text/javascript', 'src' => 'js/foobar.js')), '/script', array('script' => array('type' => 'text/javascript', 'src' => 'js/bar.js')), '/script', ); $this->assertTags($result, $expected); $result = $this->Html->script('jquery-1.3'); $expected = array( 'script' => array('type' => 'text/javascript', 'src' => 'js/jquery-1.3.js') ); $this->assertTags($result, $expected); $result = $this->Html->script('test.json'); $expected = array( 'script' => array('type' => 'text/javascript', 'src' => 'js/test.json.js') ); $this->assertTags($result, $expected); $result = $this->Html->script('http://example.com/test.json'); $expected = array( 'script' => array('type' => 'text/javascript', 'src' => 'http://example.com/test.json') ); $this->assertTags($result, $expected); $result = $this->Html->script('/plugin/js/jquery-1.3.2.js?someparam=foo'); $expected = array( 'script' => array('type' => 'text/javascript', 'src' => '/plugin/js/jquery-1.3.2.js?someparam=foo') ); $this->assertTags($result, $expected); $result = $this->Html->script('test.json.js?foo=bar'); $expected = array( 'script' => array('type' => 'text/javascript', 'src' => 'js/test.json.js?foo=bar') ); $this->assertTags($result, $expected); $result = $this->Html->script('test.json.js?foo=bar&other=test'); $expected = array( 'script' => array('type' => 'text/javascript', 'src' => 'js/test.json.js?foo=bar&amp;other=test') ); $this->assertTags($result, $expected); $result = $this->Html->script('foo'); $this->assertNull($result, 'Script returned upon duplicate inclusion %s'); $result = $this->Html->script(array('foo', 'bar', 'baz')); $this->assertNotRegExp('/foo.js/', $result); $result = $this->Html->script('foo', array('inline' => true, 'once' => false)); $this->assertNotNull($result); $result = $this->Html->script('jquery-1.3.2', array('defer' => true, 'encoding' => 'utf-8')); $expected = array( 'script' => array('type' => 'text/javascript', 'src' => 'js/jquery-1.3.2.js', 'defer' => 'defer', 'encoding' => 'utf-8') ); $this->assertTags($result, $expected); } /** * test that plugin scripts added with uses() are only ever included once. * test script tag generation with plugin syntax * * @return void */ public function testPluginScript() { CakePlugin::load('TestPlugin'); $result = $this->Html->script('TestPlugin.foo'); $expected = array( 'script' => array('type' => 'text/javascript', 'src' => 'test_plugin/js/foo.js') ); $this->assertTags($result, $expected); $result = $this->Html->script(array('TestPlugin.foobar', 'TestPlugin.bar')); $expected = array( array('script' => array('type' => 'text/javascript', 'src' => 'test_plugin/js/foobar.js')), '/script', array('script' => array('type' => 'text/javascript', 'src' => 'test_plugin/js/bar.js')), '/script', ); $this->assertTags($result, $expected); $result = $this->Html->script('TestPlugin.jquery-1.3'); $expected = array( 'script' => array('type' => 'text/javascript', 'src' => 'test_plugin/js/jquery-1.3.js') ); $this->assertTags($result, $expected); $result = $this->Html->script('TestPlugin.test.json'); $expected = array( 'script' => array('type' => 'text/javascript', 'src' => 'test_plugin/js/test.json.js') ); $this->assertTags($result, $expected); $result = $this->Html->script('TestPlugin./jquery-1.3.2.js?someparam=foo'); $expected = array( 'script' => array('type' => 'text/javascript', 'src' => 'test_plugin/jquery-1.3.2.js?someparam=foo') ); $this->assertTags($result, $expected); $result = $this->Html->script('TestPlugin.test.json.js?foo=bar'); $expected = array( 'script' => array('type' => 'text/javascript', 'src' => 'test_plugin/js/test.json.js?foo=bar') ); $this->assertTags($result, $expected); $result = $this->Html->script('TestPlugin.foo'); $this->assertNull($result, 'Script returned upon duplicate inclusion %s'); $result = $this->Html->script(array('TestPlugin.foo', 'TestPlugin.bar', 'TestPlugin.baz')); $this->assertNotRegExp('/test_plugin\/js\/foo.js/', $result); $result = $this->Html->script('TestPlugin.foo', array('inline' => true, 'once' => false)); $this->assertNotNull($result); $result = $this->Html->script('TestPlugin.jquery-1.3.2', array('defer' => true, 'encoding' => 'utf-8')); $expected = array( 'script' => array('type' => 'text/javascript', 'src' => 'test_plugin/js/jquery-1.3.2.js', 'defer' => 'defer', 'encoding' => 'utf-8') ); $this->assertTags($result, $expected); CakePlugin::unload('TestPlugin'); } /** * test that script() works with blocks. * * @return void */ public function testScriptWithBlocks() { $this->View->expects($this->at(0)) ->method('append') ->with('script', $this->matchesRegularExpression('/script_in_head.js/')); $this->View->expects($this->at(1)) ->method('append') ->with('script', $this->matchesRegularExpression('/bool_false.js/')); $this->View->expects($this->at(2)) ->method('append') ->with('headScripts', $this->matchesRegularExpression('/second_script.js/')); $result = $this->Html->script('script_in_head', array('inline' => false)); $this->assertNull($result); $result = $this->Html->script('bool_false', false); $this->assertNull($result); $result = $this->Html->script('second_script', array('block' => 'headScripts')); $this->assertNull($result); } /** * Test that Asset.filter.js works. * * @return void */ public function testScriptAssetFilter() { Configure::write('Asset.filter.js', 'js.php'); $result = $this->Html->script('jquery-1.3'); $expected = array( 'script' => array('type' => 'text/javascript', 'src' => 'cjs/jquery-1.3.js') ); $this->assertTags($result, $expected); $result = $this->Html->script('//example.com/js/jquery-1.3.js'); $expected = array( 'script' => array('type' => 'text/javascript', 'src' => '//example.com/js/jquery-1.3.js') ); $this->assertTags($result, $expected); } /** * test a script file in the webroot/theme dir. * * @return void */ public function testScriptInTheme() { $this->skipIf(!is_writable(WWW_ROOT), 'Cannot write to webroot.'); $themeExists = is_dir(WWW_ROOT . 'theme'); App::uses('File', 'Utility'); $testfile = WWW_ROOT . 'theme' . DS . 'test_theme' . DS . 'js' . DS . '__test_js.js'; $File = new File($testfile, true); App::build(array( 'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS) )); $this->Html->webroot = '/'; $this->Html->theme = 'test_theme'; $result = $this->Html->script('__test_js.js'); $expected = array( 'script' => array('src' => '/theme/test_theme/js/__test_js.js', 'type' => 'text/javascript') ); $this->assertTags($result, $expected); $Folder = new Folder(WWW_ROOT . 'theme' . DS . 'test_theme'); $Folder->delete(); if (!$themeExists) { $dir = new Folder(WWW_ROOT . 'theme'); $dir->delete(); } } /** * test Script block generation * * @return void */ public function testScriptBlock() { $result = $this->Html->scriptBlock('window.foo = 2;'); $expected = array( 'script' => array('type' => 'text/javascript'), $this->cDataStart, 'window.foo = 2;', $this->cDataEnd, '/script', ); $this->assertTags($result, $expected); $result = $this->Html->scriptBlock('window.foo = 2;', array('safe' => false)); $expected = array( 'script' => array('type' => 'text/javascript'), 'window.foo = 2;', '/script', ); $this->assertTags($result, $expected); $result = $this->Html->scriptBlock('window.foo = 2;', array('safe' => true)); $expected = array( 'script' => array('type' => 'text/javascript'), $this->cDataStart, 'window.foo = 2;', $this->cDataEnd, '/script', ); $this->assertTags($result, $expected); $this->View->expects($this->at(0)) ->method('append') ->with('script', $this->matchesRegularExpression('/window\.foo\s\=\s2;/')); $this->View->expects($this->at(1)) ->method('append') ->with('scriptTop', $this->stringContains('alert(')); $result = $this->Html->scriptBlock('window.foo = 2;', array('inline' => false)); $this->assertNull($result); $result = $this->Html->scriptBlock('alert("hi")', array('block' => 'scriptTop')); $this->assertNull($result); $result = $this->Html->scriptBlock('window.foo = 2;', array('safe' => false, 'encoding' => 'utf-8')); $expected = array( 'script' => array('type' => 'text/javascript', 'encoding' => 'utf-8'), 'window.foo = 2;', '/script', ); $this->assertTags($result, $expected); } /** * test script tag output buffering when using scriptStart() and scriptEnd(); * * @return void */ public function testScriptStartAndScriptEnd() { $result = $this->Html->scriptStart(array('safe' => true)); $this->assertNull($result); echo 'this is some javascript'; $result = $this->Html->scriptEnd(); $expected = array( 'script' => array('type' => 'text/javascript'), $this->cDataStart, 'this is some javascript', $this->cDataEnd, '/script' ); $this->assertTags($result, $expected); $result = $this->Html->scriptStart(array('safe' => false)); $this->assertNull($result); echo 'this is some javascript'; $result = $this->Html->scriptEnd(); $expected = array( 'script' => array('type' => 'text/javascript'), 'this is some javascript', '/script' ); $this->assertTags($result, $expected); $this->View->expects($this->once()) ->method('append'); $result = $this->Html->scriptStart(array('safe' => false, 'inline' => false)); $this->assertNull($result); echo 'this is some javascript'; $result = $this->Html->scriptEnd(); $this->assertNull($result); } /** * testCharsetTag method * * @return void */ public function testCharsetTag() { Configure::write('App.encoding', null); $result = $this->Html->charset(); $this->assertTags($result, array('meta' => array('http-equiv' => 'Content-Type', 'content' => 'text/html; charset=utf-8'))); Configure::write('App.encoding', 'ISO-8859-1'); $result = $this->Html->charset(); $this->assertTags($result, array('meta' => array('http-equiv' => 'Content-Type', 'content' => 'text/html; charset=iso-8859-1'))); $result = $this->Html->charset('UTF-7'); $this->assertTags($result, array('meta' => array('http-equiv' => 'Content-Type', 'content' => 'text/html; charset=UTF-7'))); } /** * testGetCrumb and addCrumb method * * @return void */ public function testBreadcrumb() { $this->assertNull($this->Html->getCrumbs()); $this->Html->addCrumb('First', '#first'); $this->Html->addCrumb('Second', '#second'); $this->Html->addCrumb('Third', '#third'); $result = $this->Html->getCrumbs(); $expected = array( array('a' => array('href' => '#first')), 'First', '/a', '&raquo;', array('a' => array('href' => '#second')), 'Second', '/a', '&raquo;', array('a' => array('href' => '#third')), 'Third', '/a', ); $this->assertTags($result, $expected); $result = $this->Html->getCrumbs(' &gt; '); $expected = array( array('a' => array('href' => '#first')), 'First', '/a', ' &gt; ', array('a' => array('href' => '#second')), 'Second', '/a', ' &gt; ', array('a' => array('href' => '#third')), 'Third', '/a', ); $this->assertTags($result, $expected); $this->Html->addCrumb('Fourth', null); $result = $this->Html->getCrumbs(); $expected = array( array('a' => array('href' => '#first')), 'First', '/a', '&raquo;', array('a' => array('href' => '#second')), 'Second', '/a', '&raquo;', array('a' => array('href' => '#third')), 'Third', '/a', '&raquo;', 'Fourth' ); $this->assertTags($result, $expected); $result = $this->Html->getCrumbs('-', 'Start'); $expected = array( array('a' => array('href' => '/')), 'Start', '/a', '-', array('a' => array('href' => '#first')), 'First', '/a', '-', array('a' => array('href' => '#second')), 'Second', '/a', '-', array('a' => array('href' => '#third')), 'Third', '/a', '-', 'Fourth' ); $this->assertTags($result, $expected); } /** * Test the array form of $startText */ public function testGetCrumbFirstLink() { $result = $this->Html->getCrumbList(null, 'Home'); $this->assertTags( $result, array( '<ul', array('li' => array('class' => 'first')), array('a' => array('href' => '/')), 'Home', '/a', '/li', '/ul' ) ); $this->Html->addCrumb('First', '#first'); $this->Html->addCrumb('Second', '#second'); $result = $this->Html->getCrumbs(' - ', array('url' => '/home', 'text' => '<img src="/home.png" />', 'escape' => false)); $expected = array( array('a' => array('href' => '/home')), 'img' => array('src' => '/home.png'), '/a', ' - ', array('a' => array('href' => '#first')), 'First', '/a', ' - ', array('a' => array('href' => '#second')), 'Second', '/a', ); $this->assertTags($result, $expected); } /** * testNestedList method * * @return void */ public function testNestedList() { $list = array( 'Item 1', 'Item 2' => array( 'Item 2.1' ), 'Item 3', 'Item 4' => array( 'Item 4.1', 'Item 4.2', 'Item 4.3' => array( 'Item 4.3.1', 'Item 4.3.2' ) ), 'Item 5' => array( 'Item 5.1', 'Item 5.2' ) ); $result = $this->Html->nestedList($list); $expected = array( '<ul', '<li', 'Item 1', '/li', '<li', 'Item 2', '<ul', '<li', 'Item 2.1', '/li', '/ul', '/li', '<li', 'Item 3', '/li', '<li', 'Item 4', '<ul', '<li', 'Item 4.1', '/li', '<li', 'Item 4.2', '/li', '<li', 'Item 4.3', '<ul', '<li', 'Item 4.3.1', '/li', '<li', 'Item 4.3.2', '/li', '/ul', '/li', '/ul', '/li', '<li', 'Item 5', '<ul', '<li', 'Item 5.1', '/li', '<li', 'Item 5.2', '/li', '/ul', '/li', '/ul' ); $this->assertTags($result, $expected); $result = $this->Html->nestedList($list, null); $this->assertTags($result, $expected); $result = $this->Html->nestedList($list, array(), array(), 'ol'); $expected = array( '<ol', '<li', 'Item 1', '/li', '<li', 'Item 2', '<ol', '<li', 'Item 2.1', '/li', '/ol', '/li', '<li', 'Item 3', '/li', '<li', 'Item 4', '<ol', '<li', 'Item 4.1', '/li', '<li', 'Item 4.2', '/li', '<li', 'Item 4.3', '<ol', '<li', 'Item 4.3.1', '/li', '<li', 'Item 4.3.2', '/li', '/ol', '/li', '/ol', '/li', '<li', 'Item 5', '<ol', '<li', 'Item 5.1', '/li', '<li', 'Item 5.2', '/li', '/ol', '/li', '/ol' ); $this->assertTags($result, $expected); $result = $this->Html->nestedList($list, 'ol'); $this->assertTags($result, $expected); $result = $this->Html->nestedList($list, array('class' => 'list')); $expected = array( array('ul' => array('class' => 'list')), '<li', 'Item 1', '/li', '<li', 'Item 2', array('ul' => array('class' => 'list')), '<li', 'Item 2.1', '/li', '/ul', '/li', '<li', 'Item 3', '/li', '<li', 'Item 4', array('ul' => array('class' => 'list')), '<li', 'Item 4.1', '/li', '<li', 'Item 4.2', '/li', '<li', 'Item 4.3', array('ul' => array('class' => 'list')), '<li', 'Item 4.3.1', '/li', '<li', 'Item 4.3.2', '/li', '/ul', '/li', '/ul', '/li', '<li', 'Item 5', array('ul' => array('class' => 'list')), '<li', 'Item 5.1', '/li', '<li', 'Item 5.2', '/li', '/ul', '/li', '/ul' ); $this->assertTags($result, $expected); $result = $this->Html->nestedList($list, array(), array('class' => 'item')); $expected = array( '<ul', array('li' => array('class' => 'item')), 'Item 1', '/li', array('li' => array('class' => 'item')), 'Item 2', '<ul', array('li' => array('class' => 'item')), 'Item 2.1', '/li', '/ul', '/li', array('li' => array('class' => 'item')), 'Item 3', '/li', array('li' => array('class' => 'item')), 'Item 4', '<ul', array('li' => array('class' => 'item')), 'Item 4.1', '/li', array('li' => array('class' => 'item')), 'Item 4.2', '/li', array('li' => array('class' => 'item')), 'Item 4.3', '<ul', array('li' => array('class' => 'item')), 'Item 4.3.1', '/li', array('li' => array('class' => 'item')), 'Item 4.3.2', '/li', '/ul', '/li', '/ul', '/li', array('li' => array('class' => 'item')), 'Item 5', '<ul', array('li' => array('class' => 'item')), 'Item 5.1', '/li', array('li' => array('class' => 'item')), 'Item 5.2', '/li', '/ul', '/li', '/ul' ); $this->assertTags($result, $expected); $result = $this->Html->nestedList($list, array(), array('even' => 'even', 'odd' => 'odd')); $expected = array( '<ul', array('li' => array('class' => 'odd')), 'Item 1', '/li', array('li' => array('class' => 'even')), 'Item 2', '<ul', array('li' => array('class' => 'odd')), 'Item 2.1', '/li', '/ul', '/li', array('li' => array('class' => 'odd')), 'Item 3', '/li', array('li' => array('class' => 'even')), 'Item 4', '<ul', array('li' => array('class' => 'odd')), 'Item 4.1', '/li', array('li' => array('class' => 'even')), 'Item 4.2', '/li', array('li' => array('class' => 'odd')), 'Item 4.3', '<ul', array('li' => array('class' => 'odd')), 'Item 4.3.1', '/li', array('li' => array('class' => 'even')), 'Item 4.3.2', '/li', '/ul', '/li', '/ul', '/li', array('li' => array('class' => 'odd')), 'Item 5', '<ul', array('li' => array('class' => 'odd')), 'Item 5.1', '/li', array('li' => array('class' => 'even')), 'Item 5.2', '/li', '/ul', '/li', '/ul' ); $this->assertTags($result, $expected); $result = $this->Html->nestedList($list, array('class' => 'list'), array('class' => 'item')); $expected = array( array('ul' => array('class' => 'list')), array('li' => array('class' => 'item')), 'Item 1', '/li', array('li' => array('class' => 'item')), 'Item 2', array('ul' => array('class' => 'list')), array('li' => array('class' => 'item')), 'Item 2.1', '/li', '/ul', '/li', array('li' => array('class' => 'item')), 'Item 3', '/li', array('li' => array('class' => 'item')), 'Item 4', array('ul' => array('class' => 'list')), array('li' => array('class' => 'item')), 'Item 4.1', '/li', array('li' => array('class' => 'item')), 'Item 4.2', '/li', array('li' => array('class' => 'item')), 'Item 4.3', array('ul' => array('class' => 'list')), array('li' => array('class' => 'item')), 'Item 4.3.1', '/li', array('li' => array('class' => 'item')), 'Item 4.3.2', '/li', '/ul', '/li', '/ul', '/li', array('li' => array('class' => 'item')), 'Item 5', array('ul' => array('class' => 'list')), array('li' => array('class' => 'item')), 'Item 5.1', '/li', array('li' => array('class' => 'item')), 'Item 5.2', '/li', '/ul', '/li', '/ul' ); $this->assertTags($result, $expected); } /** * testMeta method * * @return void */ public function testMeta() { $result = $this->Html->meta('this is an rss feed', array('controller' => 'posts', 'ext' => 'rss')); $this->assertTags($result, array('link' => array('href' => 'preg:/.*\/posts\.rss/', 'type' => 'application/rss+xml', 'rel' => 'alternate', 'title' => 'this is an rss feed'))); $result = $this->Html->meta('rss', array('controller' => 'posts', 'ext' => 'rss'), array('title' => 'this is an rss feed')); $this->assertTags($result, array('link' => array('href' => 'preg:/.*\/posts\.rss/', 'type' => 'application/rss+xml', 'rel' => 'alternate', 'title' => 'this is an rss feed'))); $result = $this->Html->meta('atom', array('controller' => 'posts', 'ext' => 'xml')); $this->assertTags($result, array('link' => array('href' => 'preg:/.*\/posts\.xml/', 'type' => 'application/atom+xml', 'title' => 'atom'))); $result = $this->Html->meta('non-existing'); $this->assertTags($result, array('<meta')); $result = $this->Html->meta('non-existing', '/posts.xpp'); $this->assertTags($result, array('link' => array('href' => 'preg:/.*\/posts\.xpp/', 'type' => 'application/rss+xml', 'rel' => 'alternate', 'title' => 'non-existing'))); $result = $this->Html->meta('non-existing', '/posts.xpp', array('type' => 'atom')); $this->assertTags($result, array('link' => array('href' => 'preg:/.*\/posts\.xpp/', 'type' => 'application/atom+xml', 'title' => 'non-existing'))); $result = $this->Html->meta('atom', array('controller' => 'posts', 'ext' => 'xml'), array('link' => '/articles.rss')); $this->assertTags($result, array('link' => array('href' => 'preg:/.*\/articles\.rss/', 'type' => 'application/atom+xml', 'title' => 'atom'))); $result = $this->Html->meta(array('link' => 'favicon.ico', 'rel' => 'icon')); $expected = array( 'link' => array('href' => 'preg:/.*favicon\.ico/', 'rel' => 'icon'), array('link' => array('href' => 'preg:/.*favicon\.ico/', 'rel' => 'shortcut icon')) ); $this->assertTags($result, $expected); $result = $this->Html->meta('icon', 'favicon.ico'); $expected = array( 'link' => array('href' => 'preg:/.*favicon\.ico/', 'type' => 'image/x-icon', 'rel' => 'icon'), array('link' => array('href' => 'preg:/.*favicon\.ico/', 'type' => 'image/x-icon', 'rel' => 'shortcut icon')) ); $this->assertTags($result, $expected); $result = $this->Html->meta('icon'); $expected = array( 'link' => array('href' => 'preg:/.*favicon\.ico/', 'type' => 'image/x-icon', 'rel' => 'icon'), array('link' => array('href' => 'preg:/.*favicon\.ico/', 'type' => 'image/x-icon', 'rel' => 'shortcut icon')) ); $this->assertTags($result, $expected); $result = $this->Html->meta('keywords', 'these, are, some, meta, keywords'); $this->assertTags($result, array('meta' => array('name' => 'keywords', 'content' => 'these, are, some, meta, keywords'))); $this->assertRegExp('/\s+\/>$/', $result); $result = $this->Html->meta('description', 'this is the meta description'); $this->assertTags($result, array('meta' => array('name' => 'description', 'content' => 'this is the meta description'))); $result = $this->Html->meta(array('name' => 'ROBOTS', 'content' => 'ALL')); $this->assertTags($result, array('meta' => array('name' => 'ROBOTS', 'content' => 'ALL'))); } /** * Test the inline and block options for meta() */ public function testMetaWithBlocks() { $this->View->expects($this->at(0)) ->method('append') ->with('meta', $this->stringContains('ROBOTS')); $this->View->expects($this->at(1)) ->method('append') ->with('metaTags', $this->stringContains('favicon.ico')); $result = $this->Html->meta(array('name' => 'ROBOTS', 'content' => 'ALL'), null, array('inline' => false)); $this->assertNull($result); $result = $this->Html->meta('icon', 'favicon.ico', array('block' => 'metaTags')); $this->assertNull($result); } /** * testTableHeaders method * * @return void */ public function testTableHeaders() { $result = $this->Html->tableHeaders(array('ID', 'Name', 'Date')); $expected = array('<tr', '<th', 'ID', '/th', '<th', 'Name', '/th', '<th', 'Date', '/th', '/tr'); $this->assertTags($result, $expected); $result = $this->Html->tableHeaders(array('ID', array('Name' => array('class' => 'highlight')), 'Date')); $expected = array('<tr', '<th', 'ID', '/th', '<th class="highlight"', 'Name', '/th', '<th', 'Date', '/th', '/tr'); $this->assertTags($result, $expected); $result = $this->Html->tableHeaders(array('ID', array('Name' => array('class' => 'highlight', 'width' => '120px')), 'Date')); $expected = array('<tr', '<th', 'ID', '/th', '<th class="highlight" width="120px"', 'Name', '/th', '<th', 'Date', '/th', '/tr'); $this->assertTags($result, $expected); $result = $this->Html->tableHeaders(array('ID', array('Name' => array()), 'Date')); $expected = array('<tr', '<th', 'ID', '/th', '<th', 'Name', '/th', '<th', 'Date', '/th', '/tr'); $this->assertTags($result, $expected); } /** * testTableCells method * * @return void */ public function testTableCells() { $tr = array( 'td content 1', array('td content 2', array("width" => "100px")), array('td content 3', "width=100px") ); $result = $this->Html->tableCells($tr); $expected = array( '<tr', '<td', 'td content 1', '/td', array('td' => array('width' => '100px')), 'td content 2', '/td', array('td' => array('width' => 'preg:/100px/')), 'td content 3', '/td', '/tr' ); $this->assertTags($result, $expected); $tr = array('td content 1', 'td content 2', 'td content 3'); $result = $this->Html->tableCells($tr, null, null, true); $expected = array( '<tr', array('td' => array('class' => 'column-1')), 'td content 1', '/td', array('td' => array('class' => 'column-2')), 'td content 2', '/td', array('td' => array('class' => 'column-3')), 'td content 3', '/td', '/tr' ); $this->assertTags($result, $expected); $tr = array('td content 1', 'td content 2', 'td content 3'); $result = $this->Html->tableCells($tr, true); $expected = array( '<tr', array('td' => array('class' => 'column-1')), 'td content 1', '/td', array('td' => array('class' => 'column-2')), 'td content 2', '/td', array('td' => array('class' => 'column-3')), 'td content 3', '/td', '/tr' ); $this->assertTags($result, $expected); $tr = array( array('td content 1', 'td content 2', 'td content 3'), array('td content 1', 'td content 2', 'td content 3'), array('td content 1', 'td content 2', 'td content 3') ); $result = $this->Html->tableCells($tr, array('class' => 'odd'), array('class' => 'even')); $expected = "<tr class=\"even\"><td>td content 1</td> <td>td content 2</td> <td>td content 3</td></tr>\n<tr class=\"odd\"><td>td content 1</td> <td>td content 2</td> <td>td content 3</td></tr>\n<tr class=\"even\"><td>td content 1</td> <td>td content 2</td> <td>td content 3</td></tr>"; $this->assertEquals($expected, $result); $tr = array( array('td content 1', 'td content 2', 'td content 3'), array('td content 1', 'td content 2', 'td content 3'), array('td content 1', 'td content 2', 'td content 3'), array('td content 1', 'td content 2', 'td content 3') ); $result = $this->Html->tableCells($tr, array('class' => 'odd'), array('class' => 'even')); $expected = "<tr class=\"odd\"><td>td content 1</td> <td>td content 2</td> <td>td content 3</td></tr>\n<tr class=\"even\"><td>td content 1</td> <td>td content 2</td> <td>td content 3</td></tr>\n<tr class=\"odd\"><td>td content 1</td> <td>td content 2</td> <td>td content 3</td></tr>\n<tr class=\"even\"><td>td content 1</td> <td>td content 2</td> <td>td content 3</td></tr>"; $this->assertEquals($expected, $result); $tr = array( array('td content 1', 'td content 2', 'td content 3'), array('td content 1', 'td content 2', 'td content 3'), array('td content 1', 'td content 2', 'td content 3') ); $this->Html->tableCells($tr, array('class' => 'odd'), array('class' => 'even')); $result = $this->Html->tableCells($tr, array('class' => 'odd'), array('class' => 'even'), false, false); $expected = "<tr class=\"odd\"><td>td content 1</td> <td>td content 2</td> <td>td content 3</td></tr>\n<tr class=\"even\"><td>td content 1</td> <td>td content 2</td> <td>td content 3</td></tr>\n<tr class=\"odd\"><td>td content 1</td> <td>td content 2</td> <td>td content 3</td></tr>"; $this->assertEquals($expected, $result); } /** * testTag method * * @return void */ public function testTag() { $result = $this->Html->tag('div'); $this->assertTags($result, '<div'); $result = $this->Html->tag('div', 'text'); $this->assertTags($result, '<div', 'text', '/div'); $result = $this->Html->tag('div', '<text>', 'class-name'); $this->assertTags($result, array('div' => array('class' => 'class-name'), 'preg:/<text>/', '/div')); $result = $this->Html->tag('div', '<text>', array('class' => 'class-name', 'escape' => true)); $this->assertTags($result, array('div' => array('class' => 'class-name'), '&lt;text&gt;', '/div')); } /** * testUseTag method * * @return void */ public function testUseTag() { $result = $this->Html->useTag('unknowntag'); $this->assertEquals('', $result); $result = $this->Html->useTag('formend'); $this->assertTags($result, '/form'); $result = $this->Html->useTag('form', 'url', ' test'); $this->assertEquals('<form action="url" test>', $result); $result = $this->Html->useTag('form', 'example.com', array('test' => 'ok')); $this->assertTags($result, array('form' => array('test' => 'ok', 'action' => 'example.com'))); } /** * testDiv method * * @return void */ public function testDiv() { $result = $this->Html->div('class-name'); $this->assertTags($result, array('div' => array('class' => 'class-name'))); $result = $this->Html->div('class-name', 'text'); $this->assertTags($result, array('div' => array('class' => 'class-name'), 'text', '/div')); $result = $this->Html->div('class-name', '<text>', array('escape' => true)); $this->assertTags($result, array('div' => array('class' => 'class-name'), '&lt;text&gt;', '/div')); } /** * testPara method * * @return void */ public function testPara() { $result = $this->Html->para('class-name', ''); $this->assertTags($result, array('p' => array('class' => 'class-name'))); $result = $this->Html->para('class-name', 'text'); $this->assertTags($result, array('p' => array('class' => 'class-name'), 'text', '/p')); $result = $this->Html->para('class-name', '<text>', array('escape' => true)); $this->assertTags($result, array('p' => array('class' => 'class-name'), '&lt;text&gt;', '/p')); } /** * testMedia method * * @return void */ public function testMedia() { $result = $this->Html->media('video.webm'); $expected = array('video' => array('src' => 'files/video.webm'), '/video'); $this->assertTags($result, $expected); $result = $this->Html->media('video.webm', array( 'text' => 'Your browser does not support the HTML5 Video element.' )); $expected = array('video' => array('src' => 'files/video.webm'), 'Your browser does not support the HTML5 Video element.', '/video'); $this->assertTags($result, $expected); $result = $this->Html->media('video.webm', array('autoload', 'muted' => 'muted')); $expected = array( 'video' => array( 'src' => 'files/video.webm', 'autoload' => 'autoload', 'muted' => 'muted' ), '/video' ); $this->assertTags($result, $expected); $result = $this->Html->media( array('video.webm', array('src' => 'video.ogv', 'type' => "video/ogg; codecs='theora, vorbis'")), array('pathPrefix' => 'videos/', 'poster' => 'poster.jpg', 'text' => 'Your browser does not support the HTML5 Video element.') ); $expected = array( 'video' => array('poster' => IMAGES_URL . 'poster.jpg'), array('source' => array('src' => 'videos/video.webm', 'type' => 'video/webm')), array('source' => array('src' => 'videos/video.ogv', 'type' => 'video/ogg; codecs=&#039;theora, vorbis&#039;')), 'Your browser does not support the HTML5 Video element.', '/video' ); $this->assertTags($result, $expected); $result = $this->Html->media('video.ogv', array('tag' => 'video')); $expected = array('video' => array('src' => 'files/video.ogv'), '/video'); $this->assertTags($result, $expected); $result = $this->Html->media('audio.mp3'); $expected = array('audio' => array('src' => 'files/audio.mp3'), '/audio'); $this->assertTags($result, $expected); $result = $this->Html->media( array(array('src' => 'video.mov', 'type' => 'video/mp4'), 'video.webm') ); $expected = array( '<video', array('source' => array('src' => 'files/video.mov', 'type' => 'video/mp4')), array('source' => array('src' => 'files/video.webm', 'type' => 'video/webm')), '/video' ); $this->assertTags($result, $expected); $result = $this->Html->media(null, array('src' => 'video.webm')); $expected = array( 'video' => array('src' => 'files/video.webm'), '/video' ); $this->assertTags($result, $expected); } /** * testCrumbList method * * * @return void */ public function testCrumbList() { $this->assertNull($this->Html->getCrumbList()); $this->Html->addCrumb('Home', '/', array('class' => 'home')); $this->Html->addCrumb('Some page', '/some_page'); $this->Html->addCrumb('Another page'); $result = $this->Html->getCrumbList( array('class' => 'breadcrumbs') ); $this->assertTags( $result, array( array('ul' => array('class' => 'breadcrumbs')), array('li' => array('class' => 'first')), array('a' => array('class' => 'home', 'href' => '/')), 'Home', '/a', '/li', '<li', array('a' => array('href' => '/some_page')), 'Some page', '/a', '/li', array('li' => array('class' => 'last')), 'Another page', '/li', '/ul' ) ); } /** * Test getCrumbList startText */ public function testCrumbListFirstLink() { $this->Html->addCrumb('First', '#first'); $this->Html->addCrumb('Second', '#second'); $result = $this->Html->getCrumbList(null, 'Home'); $this->assertTags( $result, array( '<ul', array('li' => array('class' => 'first')), array('a' => array('href' => '/')), 'Home', '/a', '/li', '<li', array('a' => array('href' => '#first')), 'First', '/a', '/li', array('li' => array('class' => 'last')), array('a' => array('href' => '#second')), 'Second', '/a', '/li', '/ul' ) ); $result = $this->Html->getCrumbList(null, array('url' => '/home', 'text' => '<img src="/home.png" />', 'escape' => false)); $this->assertTags( $result, array( '<ul', array('li' => array('class' => 'first')), array('a' => array('href' => '/home')), 'img' => array('src' => '/home.png'), '/a', '/li', '<li', array('a' => array('href' => '#first')), 'First', '/a', '/li', array('li' => array('class' => 'last')), array('a' => array('href' => '#second')), 'Second', '/a', '/li', '/ul' ) ); } /** * testLoadConfig method * * @return void */ public function testLoadConfig() { $path = CAKE . 'Test' . DS . 'test_app' . DS . 'Config' . DS; $result = $this->Html->loadConfig('htmlhelper_tags', $path); $expected = array( 'tags' => array( 'form' => 'start form', 'formend' => 'finish form', 'hiddenblock' => '<div class="hidden">%s</div>' ) ); $this->assertEquals($expected, $result); $tags = $this->Html->getAttribute('_tags'); $this->assertEquals('start form', $tags['form']); $this->assertEquals('finish form', $tags['formend']); $this->assertEquals('</select>', $tags['selectend']); $result = $this->Html->loadConfig(array('htmlhelper_minimized.ini', 'ini'), $path); $expected = array( 'minimizedAttributeFormat' => 'format' ); $this->assertEquals($expected, $result); $this->assertEquals('format', $this->Html->getAttribute('_minimizedAttributeFormat')); } /** * testLoadConfigWrongFile method * * @return void * @expectedException ConfigureException */ public function testLoadConfigWrongFile() { $result = $this->Html->loadConfig('wrong_file'); } /** * testLoadConfigWrongReader method * * @return void * @expectedException ConfigureException */ public function testLoadConfigWrongReader() { $path = CAKE . 'Test' . DS . 'test_app' . DS . 'Config' . DS; $result = $this->Html->loadConfig(array('htmlhelper_tags', 'wrong_reader'), $path); } /** * test parsing attributes. * * @return void */ public function testParseAttributeCompact() { $helper = new TestHtmlHelper($this->View); $compact = array('compact', 'checked', 'declare', 'readonly', 'disabled', 'selected', 'defer', 'ismap', 'nohref', 'noshade', 'nowrap', 'multiple', 'noresize'); foreach ($compact as $attribute) { foreach (array('true', true, 1, '1', $attribute) as $value) { $attrs = array($attribute => $value); $expected = ' ' . $attribute . '="' . $attribute . '"'; $this->assertEquals($expected, $helper->parseAttributes($attrs), '%s Failed on ' . $value); } } $this->assertEquals(' compact="compact"', $helper->parseAttributes(array('compact'))); $attrs = array('class' => array('foo', 'bar')); $expected = ' class="foo bar"'; $this->assertEquals(' class="foo bar"', $helper->parseAttributes($attrs)); $helper = new Html5TestHelper($this->View); $expected = ' require'; $this->assertEquals($expected, $helper->parseAttributes(array('require'))); $this->assertEquals($expected, $helper->parseAttributes(array('require' => true))); $this->assertEquals('', $helper->parseAttributes(array('require' => false))); } }
{ "content_hash": "4166d068dd2810305f63ba40d97bfe88", "timestamp": "", "source": "github", "line_count": 1919, "max_line_length": 377, "avg_line_length": 32.092235539343406, "alnum_prop": 0.574198262563936, "repo_name": "sanyaade-mediadev/Catool", "id": "fcb299071653479ddd7920603ae35c5b76369777", "size": "62204", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "lib/Cake/Test/Case/View/Helper/HtmlHelperTest.php", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "ApacheConf", "bytes": "1132" }, { "name": "Batchfile", "bytes": "2899" }, { "name": "CSS", "bytes": "434914" }, { "name": "JavaScript", "bytes": "4949488" }, { "name": "Makefile", "bytes": "1161" }, { "name": "PHP", "bytes": "7803047" }, { "name": "Perl", "bytes": "2173" }, { "name": "Shell", "bytes": "5042" } ], "symlink_target": "" }
// Copyright (C) 2004, 2006 International Business Machines and others. // All Rights Reserved. // This code is published under the Common Public License. // // $Id: IpSymTMatrix.hpp 759 2006-07-07 03:07:08Z andreasw $ // // Authors: Carl Laird, Andreas Waechter IBM 2004-08-13 #ifndef __IPSYMTMATRIX_HPP__ #define __IPSYMTMATRIX_HPP__ #include "IpUtils.hpp" #include "IpSymMatrix.hpp" namespace Ipopt { /* forward declarations */ class SymTMatrixSpace; /** Class for symmetric matrices stored in triplet format. In the * triplet format, the nonzeros elements of a symmetric matrix is * stored in three arrays, Irn, Jcn, and Values, all of length * Nonzeros. The first two arrays indicate the location of a * non-zero element (as the row and column indices), and the last * array stores the value at that location. Off-diagonal elements * need to be stored only once since the matrix is symmetric. For * example, the element \f$a_{1,2}=a_{2,1}\f$ would be stored only * once, either with Irn[i]=1 and Jcn[i]=2, or with Irn[i]=2 and * Jcn[i]=1. Both representations are identical. If nonzero * elements (or their symmetric counter part) are listed more than * once, their values are added. * * The structure of the nonzeros (i.e. the arrays Irn and Jcn) * cannot be changed after the matrix can been initialized. Only * the values of the nonzero elements can be modified. * * Note that the first row and column of a matrix has index 1, not * 0. * */ class SymTMatrix : public SymMatrix { public: /**@name Constructors / Destructors */ //@{ /** Constructor, taking the corresponding matrix space. */ SymTMatrix(const SymTMatrixSpace* owner_space); /** Destructor */ ~SymTMatrix(); //@} /**@name Changing the Values.*/ //@{ /** Set values of nonzero elements. The values of the nonzero * elements is copied from the incoming Number array. Important: * It is assume that the order of the values in Values * corresponds to the one of Irn and Jcn given to the matrix * space. */ void SetValues(const Number* Values); //@} /** @name Accessor Methods */ //@{ /** Number of nonzero entries */ Index Nonzeros() const; /** Obtain pointer to the internal Index array irn_ without the * intention to change the matrix data (USE WITH CARE!). This * does not produce a copy, and lifetime is not guaranteed! */ const Index* Irows() const; /** Obtain pointer to the internal Index array jcn_ without the * intention to change the matrix data (USE WITH CARE!). This * does not produce a copy, and lifetime is not guaranteed! */ const Index* Jcols() const; /** Obtain pointer to the internal Number array values_ with the * intention to change the matrix data (USE WITH CARE!). This * does not produce a copy, and lifetime is not guaranteed! */ Number* Values(); /** Obtain pointer to the internal Number array values_ without the * intention to change the matrix data (USE WITH CARE!). This * does not produce a copy, and lifetime is not guaranteed! */ const Number* Values() const; //@} /**@name Methods for providing copy of the matrix data */ //@{ /** Copy the nonzero structure into provided space */ void FillStruct(ipfint* Irn, ipfint* Jcn) const; /** Copy the value data into provided space */ void FillValues(Number* Values) const; //@} protected: /**@name Methods overloaded from matrix */ //@{ virtual void MultVectorImpl(Number alpha, const Vector& x, Number beta, Vector& y) const; /** Method for determining if all stored numbers are valid (i.e., * no Inf or Nan). */ virtual bool HasValidNumbersImpl() const; virtual void PrintImpl(const Journalist& jnlst, EJournalLevel level, EJournalCategory category, const std::string& name, Index indent, const std::string& prefix) const; //@} private: /**@name Default Compiler Generated Methods * (Hidden to avoid implicit creation/calling). * These methods are not implemented and * we do not want the compiler to implement * them for us, so we declare them private * and do not define them. This ensures that * they will not be implicitly created/called. */ //@{ /** Default Constructor */ SymTMatrix(); /** Copy Constructor */ SymTMatrix(const SymTMatrix&); /** Overloaded Equals Operator */ void operator=(const SymTMatrix&); //@} /** Copy of the owner_space ptr as a SymTMatrixSpace insteaqd * of a MatrixSpace */ const SymTMatrixSpace* owner_space_; /** Values of nonzeros */ Number* values_; /** Flag for Initialization */ bool initialized_; }; /** This is the matrix space for a SymTMatrix with fixed sparsity * structure. The sparsity structure is stored here in the matrix * space. */ class SymTMatrixSpace : public SymMatrixSpace { public: /** @name Constructors / Destructors */ //@{ /** Constructor, given the number of rows and columns (both as * dim), as well as the number of nonzeros and the position of * the nonzero elements. Note that the counting of the nonzeros * starts a 1, i.e., iRows[i]==1 and jCols[i]==1 refers to the * first element in the first row. This is in accordance with * the HSL data structure. Off-diagonal elements are stored only * once. */ SymTMatrixSpace(Index dim, Index nonZeros, const Index* iRows, const Index* jCols); /** Destructor */ ~SymTMatrixSpace(); //@} /** Overloaded MakeNew method for the sYMMatrixSpace base class. */ virtual SymMatrix* MakeNewSymMatrix() const { return MakeNewSymTMatrix(); } /** Method for creating a new matrix of this specific type. */ SymTMatrix* MakeNewSymTMatrix() const { return new SymTMatrix(this); } /**@name Methods describing Matrix structure */ //@{ /** Number of non-zeros in the sparse matrix */ Index Nonzeros() const { return nonZeros_; } /** Row index of each non-zero element */ const Index* Irows() const { return iRows_; } /** Column index of each non-zero element */ const Index* Jcols() const { return jCols_; } //@} private: /**@name Methods called by SymTMatrix for memory management */ //@{ /** Allocate internal storage for the SymTMatrix values */ Number* AllocateInternalStorage() const; /** Deallocate internal storage for the SymTMatrix values */ void FreeInternalStorage(Number* values) const; //@} const Index nonZeros_; Index* iRows_; Index* jCols_; friend class SymTMatrix; }; /* Inline Methods */ inline Index SymTMatrix::Nonzeros() const { return owner_space_->Nonzeros(); } inline const Index* SymTMatrix::Irows() const { return owner_space_->Irows(); } inline const Index* SymTMatrix::Jcols() const { return owner_space_->Jcols(); } } // namespace Ipopt #endif
{ "content_hash": "323775cda6d101d668bff219351ed1f5", "timestamp": "", "source": "github", "line_count": 251, "max_line_length": 75, "avg_line_length": 29.573705179282868, "alnum_prop": 0.6315505860164354, "repo_name": "chrisdembia/simbody", "id": "b87c21b3c5502c6402acd74530826c7b05c2a14c", "size": "7423", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "SimTKmath/Optimizers/src/IpOpt/IpSymTMatrix.hpp", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "1945907" }, { "name": "C++", "bytes": "18107398" }, { "name": "CMake", "bytes": "126326" }, { "name": "HTML", "bytes": "224" } ], "symlink_target": "" }
import React from 'react'; class LinkItem extends React.Component { constructor(props) { super(props); this.state = {}; } render() { let { title, url, type } = this.props; return ( <div> <span>{type} <a href={url}>{title}</a></span> </div> ) } } LinkItem.PropTypes = { className: React.PropTypes.object, title: React.PropTypes.string, url: React.PropTypes.string, type: React.PropTypes.string } LinkItem.defaultProps = { className: {}, title: "", url: "", type: "" } export default LinkItem;
{ "content_hash": "b30c97d15c35c13a85aa54f5f91a8db4", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 49, "avg_line_length": 14.210526315789474, "alnum_prop": 0.6240740740740741, "repo_name": "asarode/learn-buckets", "id": "14518ed3bdd481a8c199dc7d785b015825a2c4e5", "size": "540", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "public/src/js/components/buckets/comp-linkItem.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "2710" }, { "name": "Go", "bytes": "3477" }, { "name": "HTML", "bytes": "750" }, { "name": "JavaScript", "bytes": "844407" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>coq-in-coq: Not compatible 👼</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.13.0 / coq-in-coq - 8.9.0</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> coq-in-coq <small> 8.9.0 <span class="label label-info">Not compatible 👼</span> </small> </h1> <p>📅 <em><script>document.write(moment("2022-05-13 02:27:09 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-05-13 02:27:09 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-threads base base-unix base conf-findutils 1 Virtual package relying on findutils conf-gmp 4 Virtual package relying on a GMP lib system installation coq 8.13.0 Formal proof management system num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic ocaml 4.14.0 The OCaml compiler (virtual package) ocaml-base-compiler 4.14.0 Official release 4.14.0 ocaml-config 2 OCaml Switch Configuration ocaml-options-vanilla 1 Ensure that OCaml is compiled with no special options enabled ocamlfind 1.9.3 A library manager for OCaml zarith 1.12 Implements arithmetic and logical operations over arbitrary-precision integers # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;Hugo.Herbelin@inria.fr&quot; homepage: &quot;https://github.com/coq-contribs/coq-in-coq&quot; license: &quot;LGPL 2.1&quot; build: [make &quot;-j%{jobs}%&quot;] install: [make &quot;install&quot;] remove: [&quot;rm&quot; &quot;-R&quot; &quot;%{lib}%/coq/user-contrib/CoqInCoq&quot;] depends: [ &quot;ocaml&quot; &quot;coq&quot; {&gt;= &quot;8.9&quot; &amp; &lt; &quot;8.10~&quot;} ] tags: [ &quot;keyword: calculus of constructions&quot; &quot;category: Mathematics/Logic/Type theory&quot; &quot;category: Miscellaneous/Extracted Programs/Type checking unification and normalization&quot; ] authors: [ &quot;Bruno Barras&quot; ] bug-reports: &quot;https://github.com/coq-contribs/coq-in-coq/issues&quot; dev-repo: &quot;git+https://github.com/coq-contribs/coq-in-coq.git&quot; synopsis: &quot;A formalisation of the Calculus of Construction&quot; flags: light-uninstall url { src: &quot;https://github.com/coq-contribs/coq-in-coq/archive/v8.9.0.tar.gz&quot; checksum: &quot;md5=116b5f74bb3d83619031bf4466c7b2f2&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install 🏜️</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-coq-in-coq.8.9.0 coq.8.13.0</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.13.0). The following dependencies couldn&#39;t be met: - coq-coq-in-coq -&gt; coq &lt; 8.10~ -&gt; ocaml &lt; 4.10 base of this switch (use `--unlock-base&#39; to force) No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-coq-in-coq.8.9.0</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install 🚀</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall 🧹</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣 </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
{ "content_hash": "ba484a69e5a319e187538c52bf70b3fd", "timestamp": "", "source": "github", "line_count": 168, "max_line_length": 159, "avg_line_length": 41.345238095238095, "alnum_prop": 0.5385833573279586, "repo_name": "coq-bench/coq-bench.github.io", "id": "a8e2c4e18667e4e08d36bb54eb4aa8a54655b66a", "size": "6971", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "clean/Linux-x86_64-4.14.0-2.0.10/released/8.13.0/coq-in-coq/8.9.0.html", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
import asyncio import json import logging from aio_jsonrpc_20.exception import ( InvalidRequestException, CustomJsonRpcException ) from aio_jsonrpc_20.response import ResponseMaker from aio_jsonrpc_20.utils import ( is_valid_params, check_request, lazy_check_request ) logger = logging.getLogger(__name__) class RequestResolver(object): """This class allow to resolve a request, and build a response.""" __slots__ = [ 'router', 'serializer', 'response_maker', 'check_request' ] def __init__( self, router, lazy_check=False, error_verbose=True, serializer=json ): self.router = router self.response_maker = ResponseMaker(error_verbose) self.serializer = serializer if lazy_check: self.check_request = lazy_check_request else: self.check_request = check_request async def handle(self, str_request): # handle encoding if isinstance(str_request, bytes): str_request = str_request.decode("utf-8") # get response from unserialized request try: request = self.serializer.loads(str_request) except (TypeError, ValueError) as decode_error: logger.warning('JSON decode error: {}'.format(decode_error)) response = self.response_maker.get_parse_error( data='Could not decode JSON request object.' ) else: if request: try: # batch request case if isinstance(request, list): coros = [] for sub_req in request: coros.append(self._get_response(sub_req)) response = await asyncio.gather(*coros) response = [elt for elt in response if elt] # simple request case else: response = await self._get_response(request) # handle uncaught exception except Exception as e: logger.warning('Unexpected error: ' + str(e)) response = self.response_maker.get_internal_error( data=e.args[0] ) else: response = self.response_maker.get_invalid_request( data='Empty request is not allowed' ) # return serialized result return self.serializer.dumps(response) if response else '' async def _get_response(self, request): # get id and check in the same time if request is a dict try: request_id = request['id'] except KeyError: request_id = None except TypeError: logger.warning('Request should be a dict object') return self.response_maker.get_invalid_request( data="Request should be a dict object", ) # check jsonrpc 2.0 specification try: self.check_request(request) except InvalidRequestException as e: logger.warning('Invalid request') return self.response_maker.get_invalid_request( data=e.args[0], request_id=request_id ) # get method to call try: method = self.router[request['method']] except KeyError: logger.warning('Method not found') return self.response_maker.get_method_not_found( request_id=request_id ) except TypeError: logger.error('Router should be like an dict object') return self.response_maker.get_internal_error( data="Router should be like an dict object", ) # try to execute method try: if 'params' in request: params = request['params'] if isinstance(params, dict): result = await method(**params) else: result = await method(*params) else: result = await method() except CustomJsonRpcException as e: # catch custom error logger.warning('CustomError: ' + str(e)) return self.response_maker.get_server_error( code=e.code, data=e.data, request_id=request_id ) except Exception as e: # determine the error's type if ( isinstance(e, TypeError) and not is_valid_params(method, params) ): logger.warning('Invalid params') return self.response_maker.get_invalid_params( data=e.args[0], request_id=request_id ) else: logger.warning('Application error: ' + str(e)) return self.response_maker.get_internal_error( data=e.args[0], request_id=request_id ) # is notification ? if request_id: return self.response_maker.get_response( result=result, request_id=request_id ) else: return None
{ "content_hash": "1cfabaa7c3c8bcbc564afdd5e8d24e6a", "timestamp": "", "source": "github", "line_count": 161, "max_line_length": 72, "avg_line_length": 33.391304347826086, "alnum_prop": 0.5210193452380952, "repo_name": "steffgrez/aio-jsonrpc-2.0", "id": "11a26337d475b97826c0d1401283469ea67c7c76", "size": "5376", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "aio_jsonrpc_20/resolver.py", "mode": "33188", "license": "mit", "language": [ { "name": "Python", "bytes": "29695" } ], "symlink_target": "" }
<?php /** * package.xml generation script * * To create a package you need to do the following. Before making the package * PEL should be compiled so the .mo files are created. * * <code> * $ php makepackagexml.php make * $ pear package package.xml * </code> * * @package PEL * @author Lars Olesen <lars@legestue.net> * @version @package-version@ * @license http://www.gnu.org/licenses/gpl.html GNU General Public */ require_once 'PEAR/PackageFileManager2.php'; $version = '0.9.2'; $stability = 'beta'; $notes = '* initial release as a PEAR package'; $url = 'http://downloads.sf.net/pel/PEL-' . $version . '.tgz'; PEAR::setErrorHandling(PEAR_ERROR_DIE); $pfm = new PEAR_PackageFileManager2(); $pfm->setOptions( array( 'baseinstalldir' => 'PEL', 'filelistgenerator' => 'file', 'packagedirectory' => dirname(__FILE__), 'packagefile' => 'package.xml', 'ignore' => array( 'makepackagexml.php', '*.tgz', '*.sh', 'test/', 'tutorials/', 'authors.xml' ), 'dir_roles' => array( 'doc' => 'doc', 'examples' => 'doc', 'test' => 'test' ), 'exceptions' => array( 'README' => 'doc', 'AUTHORS' => 'doc', 'COPYING' => 'doc', 'INSTALL' => 'doc', 'NEWS' => 'doc', 'TODO' => 'doc' ), 'simpleoutput' => true, ) ); $pfm->setPackage('PEL'); $pfm->setSummary('The PHP Exif Library (PEL) lets you fully manipulate Exif (Exchangeable Image File Format) data.'); $pfm->setDescription('The PHP Exif Library (PEL) lets you fully manipulate Exif (Exchangeable Image File Format) data. This is the data that digital cameras place in their images, such as the date and time, shutter speed, ISO value and so on. Using PEL, one can fully modify the Exif data, meaning that it can be both read and written. Completely new Exif data can also be added to images. PEL is written completely in PHP and depends on nothing except a standard installation of PHP, version 5. PEL is hosted on SourceForge.'); $pfm->setUri($url); $pfm->setLicense('GPL License', 'http://www.gnu.org/licenses/gpl.html'); $pfm->addMaintainer('lead', 'mgeisler', 'Martin Geisler', 'mgeisler@mgeisler.net'); $pfm->addMaintainer('helper', 'lsolesen', 'Lars Olesen', 'lars@legestue.net'); $pfm->setPackageType('php'); $pfm->setAPIVersion($version); $pfm->setReleaseVersion($version); $pfm->setAPIStability($stability); $pfm->setReleaseStability($stability); $pfm->setNotes($notes); $pfm->addRelease(); $pfm->clearDeps(); $pfm->setPhpDep('5.0.0'); $pfm->setPearinstallerDep('1.5.0'); $pfm->generateContents(); if (isset($_GET['make']) || (isset($_SERVER['argv']) && @$_SERVER['argv'][1] == 'make')) { if ($pfm->writePackageFile()) { exit('package created'); } } else { $pfm->debugPackageFile(); } ?>
{ "content_hash": "1bea5cf1ea963d99c9a0bed6c69614f7", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 285, "avg_line_length": 32.2967032967033, "alnum_prop": 0.6134739707383464, "repo_name": "marbemac/whoot-symfony2", "id": "4b8b8901aabec479150ed4c259eb292ff626ab71", "size": "2939", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "web/slir/pel-0.9.2/makepackagexml.php", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "542213" }, { "name": "JavaScript", "bytes": "979646" }, { "name": "PHP", "bytes": "1082689" }, { "name": "Ruby", "bytes": "1926" }, { "name": "Shell", "bytes": "12129" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>aac-tactics: Not compatible 👼</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.7.1+1 / aac-tactics - 8.13.1</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> aac-tactics <small> 8.13.1 <span class="label label-info">Not compatible 👼</span> </small> </h1> <p>📅 <em><script>document.write(moment("2022-10-01 01:46:28 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-10-01 01:46:28 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-num base Num library distributed with the OCaml compiler base-threads base base-unix base camlp5 7.14 Preprocessor-pretty-printer of OCaml conf-findutils 1 Virtual package relying on findutils conf-perl 2 Virtual package relying on perl coq 8.7.1+1 Formal proof management system num 0 The Num library for arbitrary-precision integer and rational arithmetic ocaml 4.03.0 The OCaml compiler (virtual package) ocaml-base-compiler 4.03.0 Official 4.03.0 release ocaml-config 1 OCaml Switch Configuration ocamlfind 1.9.5 A library manager for OCaml # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;palmskog@gmail.com&quot; homepage: &quot;https://github.com/coq-community/aac-tactics&quot; dev-repo: &quot;git+https://github.com/coq-community/aac-tactics.git&quot; bug-reports: &quot;https://github.com/coq-community/aac-tactics/issues&quot; license: &quot;LGPL-3.0-or-later&quot; synopsis: &quot;Coq plugin providing tactics for rewriting universally quantified equations, modulo associative (and possibly commutative) operators&quot; description: &quot;&quot;&quot; This Coq plugin provides tactics for rewriting universally quantified equations, modulo associativity and commutativity of some operator. The tactics can be applied for custom operators by registering the operators and their properties as type class instances. Many common operator instances, such as for Z binary arithmetic and booleans, are provided with the plugin.&quot;&quot;&quot; build: [make &quot;-j%{jobs}%&quot;] install: [make &quot;install&quot;] depends: [ &quot;ocaml&quot; {&gt;= &quot;4.05.0&quot;} &quot;coq&quot; {&gt;= &quot;8.13&quot; &amp; &lt; &quot;8.14~&quot;} ] tags: [ &quot;category:Miscellaneous/Coq Extensions&quot; &quot;category:Computer Science/Decision Procedures and Certified Algorithms/Decision procedures&quot; &quot;keyword:reflexive tactic&quot; &quot;keyword:rewriting&quot; &quot;keyword:rewriting modulo associativity and commutativity&quot; &quot;keyword:rewriting modulo ac&quot; &quot;keyword:decision procedure&quot; &quot;logpath:AAC_tactics&quot; &quot;date:2021-10-01&quot; ] authors: [ &quot;Thomas Braibant&quot; &quot;Damien Pous&quot; &quot;Fabian Kunze&quot; ] url { src: &quot;https://github.com/coq-community/aac-tactics/archive/v8.13.1.tar.gz&quot; checksum: &quot;sha512=29875c62374674d20d4d14ed1f28797a3fc15589f908436500059ed10770b7f18ad0ac662243bfecad86ddff1558cbe9c628705a561d2ec5d45972251c21b216&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install 🏜️</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-aac-tactics.8.13.1 coq.8.7.1+1</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.7.1+1). The following dependencies couldn&#39;t be met: - coq-aac-tactics -&gt; ocaml &gt;= 4.05.0 base of this switch (use `--unlock-base&#39; to force) No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-aac-tactics.8.13.1</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install 🚀</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall 🧹</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣 </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
{ "content_hash": "cde32a041acfcfa59b8b6cf13e429a6d", "timestamp": "", "source": "github", "line_count": 181, "max_line_length": 159, "avg_line_length": 42.31491712707182, "alnum_prop": 0.5697871784828307, "repo_name": "coq-bench/coq-bench.github.io", "id": "965368a350e9aa3e14a7bdb66a6b09afb7ab1289", "size": "7684", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "clean/Linux-x86_64-4.03.0-2.0.5/released/8.7.1+1/aac-tactics/8.13.1.html", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
foo_bar_baz foo_bar_baz_bar_foo _foo_bar baz_bar_ baz_foo _baz_bar_foo_ __baz_bar_foo__ ___baz_bar_foo___ baz bar foo _baz_bar_foo foo bar baz_ and foo foo\_bar\_baz foo\_bar\_baz\_bar\_foo \_foo\_bar baz\_bar\_ baz\_foo `foo_bar_baz foo_bar_baz_bar_foo _foo_bar baz_bar_ baz_foo` foo_bar_baz foo_bar_baz_bar_foo _foo_bar baz_bar_ baz_foo ```html foo_bar_baz foo_bar_baz_bar_foo _foo_bar baz_bar_ baz_foo ``` <pre>foo_bar_baz foo_bar_baz_bar_foo _foo_bar baz_bar_ baz_foo</pre> <pre><code class="language-html">foo_bar_baz foo_bar_baz_bar_foo _foo_bar baz_bar_ baz_foo</code></pre> <pre class="lang-html"><code class="language-html">foo_bar_baz foo_bar_baz_bar_foo _foo_bar baz_bar_ baz_foo</code></pre> <script> var strike = "foo_bar_baz foo_bar_baz_bar_foo _foo_bar baz_bar_ baz_foo"; var foo_bar_baz_bar_foo = "foo_bar_"; </script> [foo_bar_baz foo_bar_baz_bar_foo _foo_bar baz_bar_ baz_foo](http://myurl.com/foo_bar_baz_bar_foo) <a href="http://myurl.com/foo_bar_baz_bar_foo" title="foo_bar_baz foo_bar_baz_bar_foo _foo_bar baz_bar_ baz_foo">foo_bar_baz foo_bar_baz_bar_foo _foo_bar baz_bar_ baz_foo</a> <img src="http://myurl.com/foo_bar_baz_bar_foo" alt="foo_bar_baz foo_bar_baz_bar_foo _foo_bar baz_bar_ baz_foo"> foo_bar_baz foo_bar_baz_bar_foo _foo_bar baz_bar_ baz_foo ----- ### foo_bar_baz foo_bar_baz_bar_foo _foo_bar baz_bar_ baz_foo 1. foo_bar_baz foo_bar_baz_bar_foo _foo_bar baz_bar_ baz_foo 2. foo_bar_baz foo_bar_baz_bar_foo _foo_bar baz_bar_ baz_foo > foo_bar_baz foo_bar_baz_bar_foo _foo_bar baz_bar_ baz_foo * foo_bar_baz foo_bar_baz_bar_foo _foo_bar baz_bar_ baz_foo * foo_bar_baz foo_bar_baz_bar_foo _foo_bar baz_bar_ baz_foo ------- http://en.wikipedia.org/wiki/Tourism_in_Germany [an example] [wiki] Another [example][wiki] of a link [wiki]: http://en.wikipedia.org/wiki/Tourism_in_Germany <p><code>foo_bar_baz foo_bar_baz_bar_foo _foo_bar baz_bar_ baz_foo</code></p> <!-- These two cases still have bad <ems> because showdown handles them incorrectly --> <code>foo_bar_baz foo_bar_baz_bar_foo _foo_bar baz_bar_ baz_foo</code> ![foo_bar_baz foo_bar_baz_bar_foo _foo_bar baz_bar_ baz_foo](http://myurl.com/foo_bar_baz_bar_foo) http://myurl.com/foo_bar_baz_bar_foo <http://myurl.com/foo_bar_baz_bar_foo>
{ "content_hash": "f692f657ed50c5cf5fc311d9762bafb6", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 174, "avg_line_length": 31.041095890410958, "alnum_prop": 0.6800529567519858, "repo_name": "ErisDS/showdown", "id": "66a77af7c23c2cfeced67a7dadfb1e669c361096", "size": "2266", "binary": false, "copies": "8", "ref": "refs/heads/master", "path": "test/extensions/underscore/underscore.md", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "HTML", "bytes": "65368" }, { "name": "JavaScript", "bytes": "89256" }, { "name": "Perl", "bytes": "80843" } ], "symlink_target": "" }
package org.apache.ambari.server.events; /** * The {@link AmbariEvent} class is the base for all events in Ambari. */ public abstract class AmbariEvent { /** * The {@link AmbariEventType} defines the type of Ambari event. */ public enum AmbariEventType { /** * A service was successfully installed. */ SERVICE_INSTALL_SUCCESS, /** * A service was successfully removed. */ SERVICE_REMOVED_SUCCESS, /** * A service component was successfully installed. */ SERVICE_COMPONENT_INSTALL_SUCCESS, /** * A service component was successfully uninstalled. */ SERVICE_COMPONENT_UNINSTALLED_SUCCESS, /** * An alert definition is registered with the system. */ ALERT_DEFINITION_REGISTRATION, /** * An alert definition was updated. */ ALERT_DEFINITION_CHANGED, /** * An alert definition is removed from the system. */ ALERT_DEFINITION_REMOVAL, /** * The alert definition has was invalidated. */ ALERT_DEFINITION_HASH_INVALIDATION, /** * The alert definition was disabled. */ ALERT_DEFINITION_DISABLED, /** * A host was registered with the server. */ HOST_REGISTERED, /** * A host was registered with the server. */ HOST_COMPONENT_VERSION_ADVERTISED, /** * A host was added to the cluster. */ HOST_ADDED, /** * A host was removed from the cluster. */ HOST_REMOVED, /** * A host/service/component has had a maintenance mode change. */ MAINTENANCE_MODE, /** * Received a final command report for some action */ ACTION_EXECUTION_FINISHED, /** * Sent when request finishes */ REQUEST_FINISHED, /** * The cluster was renamed. */ CLUSTER_RENAME, /** * The cluster was successfully provisioned. */ CLUSTER_PROVISIONED, /** * The cluster provision was started. */ CLUSTER_PROVISION_STARTED, /** * The service component recovery enabled field changed. */ SERVICE_COMPONENT_RECOVERY_CHANGED, /** * Stack upgrade or downgrade finishes */ FINALIZE_UPGRADE_FINISH, /** * Cluster configuration changed. */ CLUSTER_CONFIG_CHANGED, /** * Cluster configuration finished. */ CLUSTER_CONFIG_FINISHED, /** * Metrics Collector force refresh needed. */ METRICS_COLLECTOR_HOST_DOWN, /** * Local user has been created. */ USER_CREATED, /** * Host status has been changed. */ HOST_STATUS_CHANGE, /** * Host state has been changed. */ HOST_STATE_CHANGE, /** * Received new heartbeat with host info. */ HOST_HEARTBEAT_UPDATED, /** * Ambari configuration changed event; */ AMBARI_CONFIGURATION_CHANGED, /** * Ambari properties changed event; */ AMBARI_PROPERTIES_CHANGED, /** * JPA initialized */ JPA_INITIALIZED, /** * Host component's stale config status has been changed. */ STALE_CONFIGS_UPDATE, /** * Service component's repo has been changed.. */ SERVICE_COMPONENT_REPO_CHANGE, /** * Service credential store has been enabled or disabled.. */ SERVICE_CREDENTIAL_STORE_UPDATE, /** * Message was not delivered to agent. */ MESSAGE_NOT_DELIVERED; } /** * The concrete event's type. */ protected final AmbariEventType m_eventType; /** * Constructor. * * @param eventType the type of event (not {@code null}). */ public AmbariEvent(AmbariEventType eventType) { m_eventType = eventType; } /** * Gets the type of {@link AmbariEvent}. * * @return the event type (never {@code null}). */ public AmbariEventType getType() { return m_eventType; } /** * {@inheritDoc} */ @Override public String toString() { StringBuilder buffer = new StringBuilder(getClass().getSimpleName()); buffer.append("{eventType=").append(m_eventType); buffer.append("}"); return buffer.toString(); } }
{ "content_hash": "9d6301d2a8b00c5c1ef64c99c07b563e", "timestamp": "", "source": "github", "line_count": 223, "max_line_length": 73, "avg_line_length": 18.82511210762332, "alnum_prop": 0.592663172939495, "repo_name": "sekikn/ambari", "id": "610f50d3afb62bd1f601426f99671ae357b66bb3", "size": "5003", "binary": false, "copies": "2", "ref": "refs/heads/trunk", "path": "ambari-server/src/main/java/org/apache/ambari/server/events/AmbariEvent.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "22734" }, { "name": "C", "bytes": "109499" }, { "name": "C#", "bytes": "182799" }, { "name": "CSS", "bytes": "616806" }, { "name": "CoffeeScript", "bytes": "4323" }, { "name": "Dockerfile", "bytes": "8117" }, { "name": "HTML", "bytes": "3725781" }, { "name": "Handlebars", "bytes": "1594385" }, { "name": "Java", "bytes": "26670585" }, { "name": "JavaScript", "bytes": "14647486" }, { "name": "Jinja", "bytes": "147938" }, { "name": "Less", "bytes": "303080" }, { "name": "Makefile", "bytes": "2407" }, { "name": "PHP", "bytes": "149648" }, { "name": "PLpgSQL", "bytes": "298247" }, { "name": "PowerShell", "bytes": "2047735" }, { "name": "Python", "bytes": "7226684" }, { "name": "R", "bytes": "1457" }, { "name": "Shell", "bytes": "350773" }, { "name": "TSQL", "bytes": "42351" }, { "name": "Vim Script", "bytes": "5813" }, { "name": "sed", "bytes": "1133" } ], "symlink_target": "" }
@interface TKSwitchConfig : TKConfig @property (nonatomic) BOOL value; #pragma mark - View bindings @property (weak, nonatomic) UISwitch *theSwitch; @property (weak, nonatomic) UILabel *nameLabel; #pragma mark - Creating slider configs + (instancetype)configWithName:(NSString *)name identifier:(NSString *)identifier target:(id)target keyPath:(NSString *)keyPath; @end
{ "content_hash": "98e17316f3d396cce03fd2af2dd6bc3f", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 57, "avg_line_length": 26.764705882352942, "alnum_prop": 0.6373626373626373, "repo_name": "wtmoose/TuneKit", "id": "6f9aa05fad002bde0a48f8b1b2a2a3c446e3c2de", "size": "735", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "TuneKit/TKSwitchConfig.h", "mode": "33188", "license": "mit", "language": [ { "name": "Objective-C", "bytes": "163268" }, { "name": "Ruby", "bytes": "1731" } ], "symlink_target": "" }
package com.amazonaws.services.simpleemail.model.transform; import javax.xml.stream.events.XMLEvent; import javax.annotation.Generated; import com.amazonaws.services.simpleemail.model.*; import com.amazonaws.transform.Unmarshaller; import com.amazonaws.transform.StaxUnmarshallerContext; import com.amazonaws.transform.SimpleTypeStaxUnmarshallers.*; /** * WorkmailAction StAX Unmarshaller */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class WorkmailActionStaxUnmarshaller implements Unmarshaller<WorkmailAction, StaxUnmarshallerContext> { public WorkmailAction unmarshall(StaxUnmarshallerContext context) throws Exception { WorkmailAction workmailAction = new WorkmailAction(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 1; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return workmailAction; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("TopicArn", targetDepth)) { workmailAction.setTopicArn(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("OrganizationArn", targetDepth)) { workmailAction.setOrganizationArn(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return workmailAction; } } } } private static WorkmailActionStaxUnmarshaller instance; public static WorkmailActionStaxUnmarshaller getInstance() { if (instance == null) instance = new WorkmailActionStaxUnmarshaller(); return instance; } }
{ "content_hash": "5dbf4602dc3756c8d50dc3f184951b08", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 112, "avg_line_length": 34.644067796610166, "alnum_prop": 0.6585127201565558, "repo_name": "dagnir/aws-sdk-java", "id": "cc07a979a313ee2716be5c30ec7522084e1f4d92", "size": "2624", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "aws-java-sdk-ses/src/main/java/com/amazonaws/services/simpleemail/model/transform/WorkmailActionStaxUnmarshaller.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "FreeMarker", "bytes": "157317" }, { "name": "Gherkin", "bytes": "25556" }, { "name": "Java", "bytes": "165755153" }, { "name": "Scilab", "bytes": "3561" } ], "symlink_target": "" }
<p class="description">MUI comes with two palette modes: light (the default) and dark.</p> Você pode deixar o tema escuro definindo `mode: 'dark'`. ```js const darkTheme = createTheme({ palette: { mode: 'dark', }, }); ``` While it's only a single value change, the `createTheme` helper modifies several palette values. The colors modified by the palette mode are the following: {{"demo": "DarkTheme.js", "bg": "inline", "hideToolbar": true}} > Note: The colors are modified only if you use the default palette. If you have a custom palette, you need to make sure that you have the correct values based on the `mode`. The following section explains how you can do it. ## Dark mode with custom palette The easiest way of how you can implement your custom palette that depends on mode is to have a dedicated function that will return the palette based on the mode. For example: ```ts const getDesignTokens = (mode: PaletteMode) => ({ palette: { mode, ...(mode === 'light' ? { // palette values for light mode primary: amber, divider: amber[200], text: { primary: grey[900], secondary: grey[800], }, } : { // palette values for dark mode primary: deepOrange, divider: deepOrange[700], background: { default: deepOrange[900], paper: deepOrange[900], }, text: { primary: '#fff', secondary: grey[500], }, }), }, }); ``` You can see on the example that there are different colors used based on whether the mode is light or dark. The next step is to use this function when creating the theme. ```tsx export default function App() { const [mode, setMode] = React.useState<PaletteMode>('light'); const colorMode = React.useMemo( () => ({ // The dark mode switch would invoke this method toggleColorMode: () => { setMode((prevMode: PaletteMode) => prevMode === 'light' ? 'dark' : 'light', ); }, }), [], ); // Update the theme only if the mode changes const theme = React.useMemo(() => createTheme(getDesignTokens(mode)), [mode]); return ( <ColorModeContext.Provider value={colorMode}> <ThemeProvider theme={theme}> <Page /> </ThemeProvider> </ColorModeContext.Provider> ); } ``` Here is a fully working example: {{"demo": "DarkThemeWithCustomPalette.js", "defaultCodeOpen": false}} ## Toggling color mode You can use the React context to toggle the mode with a button inside your page. {{"demo": "ToggleColorMode.js", "defaultCodeOpen": false}} ## System preference Usuários podem especificar uma preferência por um tema claro ou escuro. O método pelo qual o usuário expressa a sua preferência pode variar. Pode ser uma configuração de sistema exposta pelo Sistema Operacional, ou uma configuração controlada pelo Agente de Usuário. Você pode utilizar essa preferência dinamicamente com o hook [useMediaQuery](/components/use-media-query/) e a consulta de mídia [prefers-color-scheme](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme). Por exemplo, você pode ativar o modo escuro automaticamente: ```jsx import * as React from 'react'; import useMediaQuery from '@mui/material/useMediaQuery'; import { createTheme, ThemeProvider } from '@mui/material/styles'; import CssBaseline from '@mui/material/CssBaseline'; function App() { const prefersDarkMode = useMediaQuery('(prefers-color-scheme: dark)'); const theme = React.useMemo( () => createTheme({ palette: { mode: prefersDarkMode ? 'dark' : 'light', }, }), [prefersDarkMode], ); return ( <ThemeProvider theme={theme}> <CssBaseline /> <Routes /> </ThemeProvider> ); } ```
{ "content_hash": "4f6d6fd76580ac25f3716e749328febf", "timestamp": "", "source": "github", "line_count": 128, "max_line_length": 266, "avg_line_length": 30.3046875, "alnum_prop": 0.648620778551173, "repo_name": "oliviertassinari/material-ui", "id": "a6a2371bc3d20a5c5786608447b53d2100dc3e99", "size": "3907", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/data/material/customization/dark-mode/dark-mode-pt.md", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "2126" }, { "name": "JavaScript", "bytes": "3779365" }, { "name": "TypeScript", "bytes": "2514535" } ], "symlink_target": "" }
package xm.ik.segment; import xm.ik.collection.Lexeme; import xm.ik.dic.Dictionary; import xm.ik.dic.Hit; import xm.ik.util.CharacterUtil; import java.util.LinkedList; import java.util.List; /** * chinese japan korea segmenter * * @author xuming */ public class CJKSegmenter implements ISegmenter { // Numerals and quantifiers public static final String SEGMENTER_NAME = "CJK_SEGMENTER"; private List<Hit> hits; public CJKSegmenter() { this.hits = new LinkedList<>(); } @Override public void analyze(AnalyzerContext context) { if (CharacterUtil.CHAR_USELESS != context.getCurrentCharType()) { if (!hits.isEmpty()) { // deal with lexeme array in hits Hit[] array = hits.toArray(new Hit[hits.size()]); for (Hit hit : array) { hit = Dictionary.getSingleton().matchWithHit(context.getSegmentBuff(), context.getCursor(), hit); if (hit.isMatch()) { // output lexeme Lexeme newLexeme = new Lexeme(context.getBuffOffset(), hit.getBegin(), context.getCursor() - hit.getBegin() + 1, Lexeme.TYPE_CNWORD); newLexeme.setLexemeText(String.valueOf(context.getSegmentBuff(), newLexeme.getBegin(), newLexeme.getLength())); context.addLexeme(newLexeme); // not same prefix, remove hit if (!hit.isPrefix()) hits.remove(hit); } else if (hit.isUnmatch()){ hits.remove(hit); } } } // match single word(char) Hit singleCharHit = Dictionary.getSingleton().matchInMainDictionary( context.getSegmentBuff(), context.getCursor(), 1); if (singleCharHit.isMatch()) { // head word is match Lexeme newLexeme = new Lexeme(context.getBuffOffset(), context.getCursor(), 1, Lexeme.TYPE_CNWORD); newLexeme.setLexemeText(String.valueOf(context.getSegmentBuff(), newLexeme.getBegin(), newLexeme.getLength())); context.addLexeme(newLexeme); if (singleCharHit.isPrefix()) hits.add(singleCharHit); } else if (singleCharHit.isPrefix()) { // prefix match hits.add(singleCharHit); } else { // clear CHAR_USELESS chars hits.clear(); } if (context.isBufferConsumed()) hits.clear(); if (hits.size() == 0) context.unlockBuffer(SEGMENTER_NAME); else context.lockBuffer(SEGMENTER_NAME); } } @Override public void reset() { hits.clear(); } }
{ "content_hash": "a2affb5d4986fa2f84b2e07a2179b943", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 94, "avg_line_length": 37.93589743589744, "alnum_prop": 0.5278810408921933, "repo_name": "shibing624/BlogCode", "id": "29a4031e1b2518b911f199baa07d34e96dd1b580", "size": "2959", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/xm/ik/segment/CJKSegmenter.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "HTML", "bytes": "17360" }, { "name": "Java", "bytes": "422466" }, { "name": "Python", "bytes": "10973" } ], "symlink_target": "" }
from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/lair/opee_sea_killer/shared_lair_opee_sea_killer_underwater.iff" result.attribute_template_id = -1 result.stfName("lair_n","opee_sea_killer_underwater") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "023b96b8ac548ef2d3e7954d16787e14", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 100, "avg_line_length": 26.46153846153846, "alnum_prop": 0.7093023255813954, "repo_name": "anhstudios/swganh", "id": "0c9a96b926ff435092e71e00db4c5c2613c1849f", "size": "489", "binary": false, "copies": "2", "ref": "refs/heads/develop", "path": "data/scripts/templates/object/tangible/lair/opee_sea_killer/shared_lair_opee_sea_killer_underwater.py", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "11887" }, { "name": "C", "bytes": "7699" }, { "name": "C++", "bytes": "2357839" }, { "name": "CMake", "bytes": "41264" }, { "name": "PLSQL", "bytes": "42065" }, { "name": "Python", "bytes": "7503510" }, { "name": "SQLPL", "bytes": "42770" } ], "symlink_target": "" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_77) on Mon May 23 19:36:14 EDT 2016 --> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Uses of Class org.apache.lucene.util.fst.FST.Arc (Lucene 6.0.1 API)</title> <meta name="date" content="2016-05-23"> <link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class org.apache.lucene.util.fst.FST.Arc (Lucene 6.0.1 API)"; } } catch(err) { } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?org/apache/lucene/util/fst/class-use/FST.Arc.html" target="_top">Frames</a></li> <li><a href="FST.Arc.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Class org.apache.lucene.util.fst.FST.Arc" class="title">Uses of Class<br>org.apache.lucene.util.fst.FST.Arc</h2> </div> <div class="classUseContainer"> <ul class="blockList"> <li class="blockList"> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation"> <caption><span>Packages that use <a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Package</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="#org.apache.lucene.util.fst">org.apache.lucene.util.fst</a></td> <td class="colLast"> <div class="block">Finite state transducers</div> </td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="org.apache.lucene.util.fst"> <!-- --> </a> <h3>Uses of <a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a> in <a href="../../../../../../org/apache/lucene/util/fst/package-summary.html">org.apache.lucene.util.fst</a></h3> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing fields, and an explanation"> <caption><span>Fields in <a href="../../../../../../org/apache/lucene/util/fst/package-summary.html">org.apache.lucene.util.fst</a> declared as <a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Field and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;<a href="../../../../../../org/apache/lucene/util/fst/Util.FSTPath.html" title="type parameter in Util.FSTPath">T</a>&gt;</code></td> <td class="colLast"><span class="typeNameLabel">Util.FSTPath.</span><code><span class="memberNameLink"><a href="../../../../../../org/apache/lucene/util/fst/Util.FSTPath.html#arc">arc</a></span></code>&nbsp;</td> </tr> </tbody> </table> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../org/apache/lucene/util/fst/package-summary.html">org.apache.lucene.util.fst</a> that return <a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;<a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="type parameter in FST.Arc">T</a>&gt;</code></td> <td class="colLast"><span class="typeNameLabel">FST.Arc.</span><code><span class="memberNameLink"><a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html#copyFrom-org.apache.lucene.util.fst.FST.Arc-">copyFrom</a></span>(<a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;<a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="type parameter in FST.Arc">T</a>&gt;&nbsp;other)</code> <div class="block">Returns this</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;<a href="../../../../../../org/apache/lucene/util/fst/FST.html" title="type parameter in FST">T</a>&gt;</code></td> <td class="colLast"><span class="typeNameLabel">FST.</span><code><span class="memberNameLink"><a href="../../../../../../org/apache/lucene/util/fst/FST.html#findTargetArc-int-org.apache.lucene.util.fst.FST.Arc-org.apache.lucene.util.fst.FST.Arc-org.apache.lucene.util.fst.FST.BytesReader-">findTargetArc</a></span>(int&nbsp;labelToMatch, <a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;<a href="../../../../../../org/apache/lucene/util/fst/FST.html" title="type parameter in FST">T</a>&gt;&nbsp;follow, <a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;<a href="../../../../../../org/apache/lucene/util/fst/FST.html" title="type parameter in FST">T</a>&gt;&nbsp;arc, <a href="../../../../../../org/apache/lucene/util/fst/FST.BytesReader.html" title="class in org.apache.lucene.util.fst">FST.BytesReader</a>&nbsp;in)</code> <div class="block">Finds an arc leaving the incoming arc, replacing the arc in place.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;<a href="../../../../../../org/apache/lucene/util/fst/FST.html" title="type parameter in FST">T</a>&gt;</code></td> <td class="colLast"><span class="typeNameLabel">FST.</span><code><span class="memberNameLink"><a href="../../../../../../org/apache/lucene/util/fst/FST.html#getFirstArc-org.apache.lucene.util.fst.FST.Arc-">getFirstArc</a></span>(<a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;<a href="../../../../../../org/apache/lucene/util/fst/FST.html" title="type parameter in FST">T</a>&gt;&nbsp;arc)</code> <div class="block">Fills virtual 'start' arc, ie, an empty incoming arc to the FST's start node</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static &lt;T&gt;&nbsp;<a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;T&gt;</code></td> <td class="colLast"><span class="typeNameLabel">Util.</span><code><span class="memberNameLink"><a href="../../../../../../org/apache/lucene/util/fst/Util.html#readCeilArc-int-org.apache.lucene.util.fst.FST-org.apache.lucene.util.fst.FST.Arc-org.apache.lucene.util.fst.FST.Arc-org.apache.lucene.util.fst.FST.BytesReader-">readCeilArc</a></span>(int&nbsp;label, <a href="../../../../../../org/apache/lucene/util/fst/FST.html" title="class in org.apache.lucene.util.fst">FST</a>&lt;T&gt;&nbsp;fst, <a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;T&gt;&nbsp;follow, <a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;T&gt;&nbsp;arc, <a href="../../../../../../org/apache/lucene/util/fst/FST.BytesReader.html" title="class in org.apache.lucene.util.fst">FST.BytesReader</a>&nbsp;in)</code> <div class="block">Reads the first arc greater or equal that the given label into the provided arc in place and returns it iff found, otherwise return <code>null</code>.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;<a href="../../../../../../org/apache/lucene/util/fst/FST.html" title="type parameter in FST">T</a>&gt;</code></td> <td class="colLast"><span class="typeNameLabel">FST.</span><code><span class="memberNameLink"><a href="../../../../../../org/apache/lucene/util/fst/FST.html#readFirstRealTargetArc-long-org.apache.lucene.util.fst.FST.Arc-org.apache.lucene.util.fst.FST.BytesReader-">readFirstRealTargetArc</a></span>(long&nbsp;node, <a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;<a href="../../../../../../org/apache/lucene/util/fst/FST.html" title="type parameter in FST">T</a>&gt;&nbsp;arc, <a href="../../../../../../org/apache/lucene/util/fst/FST.BytesReader.html" title="class in org.apache.lucene.util.fst">FST.BytesReader</a>&nbsp;in)</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;<a href="../../../../../../org/apache/lucene/util/fst/FST.html" title="type parameter in FST">T</a>&gt;</code></td> <td class="colLast"><span class="typeNameLabel">FST.</span><code><span class="memberNameLink"><a href="../../../../../../org/apache/lucene/util/fst/FST.html#readFirstTargetArc-org.apache.lucene.util.fst.FST.Arc-org.apache.lucene.util.fst.FST.Arc-org.apache.lucene.util.fst.FST.BytesReader-">readFirstTargetArc</a></span>(<a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;<a href="../../../../../../org/apache/lucene/util/fst/FST.html" title="type parameter in FST">T</a>&gt;&nbsp;follow, <a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;<a href="../../../../../../org/apache/lucene/util/fst/FST.html" title="type parameter in FST">T</a>&gt;&nbsp;arc, <a href="../../../../../../org/apache/lucene/util/fst/FST.BytesReader.html" title="class in org.apache.lucene.util.fst">FST.BytesReader</a>&nbsp;in)</code> <div class="block">Follow the <code>follow</code> arc and read the first arc of its target; this changes the provided <code>arc</code> (2nd arg) in-place and returns it.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;<a href="../../../../../../org/apache/lucene/util/fst/FST.html" title="type parameter in FST">T</a>&gt;</code></td> <td class="colLast"><span class="typeNameLabel">FST.</span><code><span class="memberNameLink"><a href="../../../../../../org/apache/lucene/util/fst/FST.html#readLastTargetArc-org.apache.lucene.util.fst.FST.Arc-org.apache.lucene.util.fst.FST.Arc-org.apache.lucene.util.fst.FST.BytesReader-">readLastTargetArc</a></span>(<a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;<a href="../../../../../../org/apache/lucene/util/fst/FST.html" title="type parameter in FST">T</a>&gt;&nbsp;follow, <a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;<a href="../../../../../../org/apache/lucene/util/fst/FST.html" title="type parameter in FST">T</a>&gt;&nbsp;arc, <a href="../../../../../../org/apache/lucene/util/fst/FST.BytesReader.html" title="class in org.apache.lucene.util.fst">FST.BytesReader</a>&nbsp;in)</code> <div class="block">Follows the <code>follow</code> arc and reads the last arc of its target; this changes the provided <code>arc</code> (2nd arg) in-place and returns it.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;<a href="../../../../../../org/apache/lucene/util/fst/FST.html" title="type parameter in FST">T</a>&gt;</code></td> <td class="colLast"><span class="typeNameLabel">FST.</span><code><span class="memberNameLink"><a href="../../../../../../org/apache/lucene/util/fst/FST.html#readNextArc-org.apache.lucene.util.fst.FST.Arc-org.apache.lucene.util.fst.FST.BytesReader-">readNextArc</a></span>(<a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;<a href="../../../../../../org/apache/lucene/util/fst/FST.html" title="type parameter in FST">T</a>&gt;&nbsp;arc, <a href="../../../../../../org/apache/lucene/util/fst/FST.BytesReader.html" title="class in org.apache.lucene.util.fst">FST.BytesReader</a>&nbsp;in)</code> <div class="block">In-place read; returns the arc.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;<a href="../../../../../../org/apache/lucene/util/fst/FST.html" title="type parameter in FST">T</a>&gt;</code></td> <td class="colLast"><span class="typeNameLabel">FST.</span><code><span class="memberNameLink"><a href="../../../../../../org/apache/lucene/util/fst/FST.html#readNextRealArc-org.apache.lucene.util.fst.FST.Arc-org.apache.lucene.util.fst.FST.BytesReader-">readNextRealArc</a></span>(<a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;<a href="../../../../../../org/apache/lucene/util/fst/FST.html" title="type parameter in FST">T</a>&gt;&nbsp;arc, <a href="../../../../../../org/apache/lucene/util/fst/FST.BytesReader.html" title="class in org.apache.lucene.util.fst">FST.BytesReader</a>&nbsp;in)</code> <div class="block">Never returns null, but you should never call this if arc.isLast() is true.</div> </td> </tr> </tbody> </table> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../org/apache/lucene/util/fst/package-summary.html">org.apache.lucene.util.fst</a> with parameters of type <a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><span class="typeNameLabel">Util.TopNSearcher.</span><code><span class="memberNameLink"><a href="../../../../../../org/apache/lucene/util/fst/Util.TopNSearcher.html#addStartPaths-org.apache.lucene.util.fst.FST.Arc-T-boolean-org.apache.lucene.util.IntsRefBuilder-">addStartPaths</a></span>(<a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;<a href="../../../../../../org/apache/lucene/util/fst/Util.TopNSearcher.html" title="type parameter in Util.TopNSearcher">T</a>&gt;&nbsp;node, <a href="../../../../../../org/apache/lucene/util/fst/Util.TopNSearcher.html" title="type parameter in Util.TopNSearcher">T</a>&nbsp;startOutput, boolean&nbsp;allowEmptyString, <a href="../../../../../../org/apache/lucene/util/IntsRefBuilder.html" title="class in org.apache.lucene.util">IntsRefBuilder</a>&nbsp;input)</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><span class="typeNameLabel">Util.TopNSearcher.</span><code><span class="memberNameLink"><a href="../../../../../../org/apache/lucene/util/fst/Util.TopNSearcher.html#addStartPaths-org.apache.lucene.util.fst.FST.Arc-T-boolean-org.apache.lucene.util.IntsRefBuilder-float-java.lang.CharSequence-">addStartPaths</a></span>(<a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;<a href="../../../../../../org/apache/lucene/util/fst/Util.TopNSearcher.html" title="type parameter in Util.TopNSearcher">T</a>&gt;&nbsp;node, <a href="../../../../../../org/apache/lucene/util/fst/Util.TopNSearcher.html" title="type parameter in Util.TopNSearcher">T</a>&nbsp;startOutput, boolean&nbsp;allowEmptyString, <a href="../../../../../../org/apache/lucene/util/IntsRefBuilder.html" title="class in org.apache.lucene.util">IntsRefBuilder</a>&nbsp;input, float&nbsp;boost, <a href="http://download.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang">CharSequence</a>&nbsp;context)</code> <div class="block">Adds all leaving arcs, including 'finished' arc, if the node is final, from this node into the queue.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;<a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="type parameter in FST.Arc">T</a>&gt;</code></td> <td class="colLast"><span class="typeNameLabel">FST.Arc.</span><code><span class="memberNameLink"><a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html#copyFrom-org.apache.lucene.util.fst.FST.Arc-">copyFrom</a></span>(<a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;<a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="type parameter in FST.Arc">T</a>&gt;&nbsp;other)</code> <div class="block">Returns this</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;<a href="../../../../../../org/apache/lucene/util/fst/FST.html" title="type parameter in FST">T</a>&gt;</code></td> <td class="colLast"><span class="typeNameLabel">FST.</span><code><span class="memberNameLink"><a href="../../../../../../org/apache/lucene/util/fst/FST.html#findTargetArc-int-org.apache.lucene.util.fst.FST.Arc-org.apache.lucene.util.fst.FST.Arc-org.apache.lucene.util.fst.FST.BytesReader-">findTargetArc</a></span>(int&nbsp;labelToMatch, <a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;<a href="../../../../../../org/apache/lucene/util/fst/FST.html" title="type parameter in FST">T</a>&gt;&nbsp;follow, <a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;<a href="../../../../../../org/apache/lucene/util/fst/FST.html" title="type parameter in FST">T</a>&gt;&nbsp;arc, <a href="../../../../../../org/apache/lucene/util/fst/FST.BytesReader.html" title="class in org.apache.lucene.util.fst">FST.BytesReader</a>&nbsp;in)</code> <div class="block">Finds an arc leaving the incoming arc, replacing the arc in place.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;<a href="../../../../../../org/apache/lucene/util/fst/FST.html" title="type parameter in FST">T</a>&gt;</code></td> <td class="colLast"><span class="typeNameLabel">FST.</span><code><span class="memberNameLink"><a href="../../../../../../org/apache/lucene/util/fst/FST.html#findTargetArc-int-org.apache.lucene.util.fst.FST.Arc-org.apache.lucene.util.fst.FST.Arc-org.apache.lucene.util.fst.FST.BytesReader-">findTargetArc</a></span>(int&nbsp;labelToMatch, <a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;<a href="../../../../../../org/apache/lucene/util/fst/FST.html" title="type parameter in FST">T</a>&gt;&nbsp;follow, <a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;<a href="../../../../../../org/apache/lucene/util/fst/FST.html" title="type parameter in FST">T</a>&gt;&nbsp;arc, <a href="../../../../../../org/apache/lucene/util/fst/FST.BytesReader.html" title="class in org.apache.lucene.util.fst">FST.BytesReader</a>&nbsp;in)</code> <div class="block">Finds an arc leaving the incoming arc, replacing the arc in place.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static <a href="../../../../../../org/apache/lucene/util/IntsRef.html" title="class in org.apache.lucene.util">IntsRef</a></code></td> <td class="colLast"><span class="typeNameLabel">Util.</span><code><span class="memberNameLink"><a href="../../../../../../org/apache/lucene/util/fst/Util.html#getByOutput-org.apache.lucene.util.fst.FST-long-org.apache.lucene.util.fst.FST.BytesReader-org.apache.lucene.util.fst.FST.Arc-org.apache.lucene.util.fst.FST.Arc-org.apache.lucene.util.IntsRefBuilder-">getByOutput</a></span>(<a href="../../../../../../org/apache/lucene/util/fst/FST.html" title="class in org.apache.lucene.util.fst">FST</a>&lt;<a href="http://download.oracle.com/javase/8/docs/api/java/lang/Long.html?is-external=true" title="class or interface in java.lang">Long</a>&gt;&nbsp;fst, long&nbsp;targetOutput, <a href="../../../../../../org/apache/lucene/util/fst/FST.BytesReader.html" title="class in org.apache.lucene.util.fst">FST.BytesReader</a>&nbsp;in, <a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;<a href="http://download.oracle.com/javase/8/docs/api/java/lang/Long.html?is-external=true" title="class or interface in java.lang">Long</a>&gt;&nbsp;arc, <a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;<a href="http://download.oracle.com/javase/8/docs/api/java/lang/Long.html?is-external=true" title="class or interface in java.lang">Long</a>&gt;&nbsp;scratchArc, <a href="../../../../../../org/apache/lucene/util/IntsRefBuilder.html" title="class in org.apache.lucene.util">IntsRefBuilder</a>&nbsp;result)</code> <div class="block">Expert: like <a href="../../../../../../org/apache/lucene/util/fst/Util.html#getByOutput-org.apache.lucene.util.fst.FST-long-"><code>Util.getByOutput(FST, long)</code></a> except reusing BytesReader, initial and scratch Arc, and result.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>static <a href="../../../../../../org/apache/lucene/util/IntsRef.html" title="class in org.apache.lucene.util">IntsRef</a></code></td> <td class="colLast"><span class="typeNameLabel">Util.</span><code><span class="memberNameLink"><a href="../../../../../../org/apache/lucene/util/fst/Util.html#getByOutput-org.apache.lucene.util.fst.FST-long-org.apache.lucene.util.fst.FST.BytesReader-org.apache.lucene.util.fst.FST.Arc-org.apache.lucene.util.fst.FST.Arc-org.apache.lucene.util.IntsRefBuilder-">getByOutput</a></span>(<a href="../../../../../../org/apache/lucene/util/fst/FST.html" title="class in org.apache.lucene.util.fst">FST</a>&lt;<a href="http://download.oracle.com/javase/8/docs/api/java/lang/Long.html?is-external=true" title="class or interface in java.lang">Long</a>&gt;&nbsp;fst, long&nbsp;targetOutput, <a href="../../../../../../org/apache/lucene/util/fst/FST.BytesReader.html" title="class in org.apache.lucene.util.fst">FST.BytesReader</a>&nbsp;in, <a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;<a href="http://download.oracle.com/javase/8/docs/api/java/lang/Long.html?is-external=true" title="class or interface in java.lang">Long</a>&gt;&nbsp;arc, <a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;<a href="http://download.oracle.com/javase/8/docs/api/java/lang/Long.html?is-external=true" title="class or interface in java.lang">Long</a>&gt;&nbsp;scratchArc, <a href="../../../../../../org/apache/lucene/util/IntsRefBuilder.html" title="class in org.apache.lucene.util">IntsRefBuilder</a>&nbsp;result)</code> <div class="block">Expert: like <a href="../../../../../../org/apache/lucene/util/fst/Util.html#getByOutput-org.apache.lucene.util.fst.FST-long-"><code>Util.getByOutput(FST, long)</code></a> except reusing BytesReader, initial and scratch Arc, and result.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;<a href="../../../../../../org/apache/lucene/util/fst/FST.html" title="type parameter in FST">T</a>&gt;</code></td> <td class="colLast"><span class="typeNameLabel">FST.</span><code><span class="memberNameLink"><a href="../../../../../../org/apache/lucene/util/fst/FST.html#getFirstArc-org.apache.lucene.util.fst.FST.Arc-">getFirstArc</a></span>(<a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;<a href="../../../../../../org/apache/lucene/util/fst/FST.html" title="type parameter in FST">T</a>&gt;&nbsp;arc)</code> <div class="block">Fills virtual 'start' arc, ie, an empty incoming arc to the FST's start node</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>static &lt;T&gt;&nbsp;<a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;T&gt;</code></td> <td class="colLast"><span class="typeNameLabel">Util.</span><code><span class="memberNameLink"><a href="../../../../../../org/apache/lucene/util/fst/Util.html#readCeilArc-int-org.apache.lucene.util.fst.FST-org.apache.lucene.util.fst.FST.Arc-org.apache.lucene.util.fst.FST.Arc-org.apache.lucene.util.fst.FST.BytesReader-">readCeilArc</a></span>(int&nbsp;label, <a href="../../../../../../org/apache/lucene/util/fst/FST.html" title="class in org.apache.lucene.util.fst">FST</a>&lt;T&gt;&nbsp;fst, <a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;T&gt;&nbsp;follow, <a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;T&gt;&nbsp;arc, <a href="../../../../../../org/apache/lucene/util/fst/FST.BytesReader.html" title="class in org.apache.lucene.util.fst">FST.BytesReader</a>&nbsp;in)</code> <div class="block">Reads the first arc greater or equal that the given label into the provided arc in place and returns it iff found, otherwise return <code>null</code>.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static &lt;T&gt;&nbsp;<a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;T&gt;</code></td> <td class="colLast"><span class="typeNameLabel">Util.</span><code><span class="memberNameLink"><a href="../../../../../../org/apache/lucene/util/fst/Util.html#readCeilArc-int-org.apache.lucene.util.fst.FST-org.apache.lucene.util.fst.FST.Arc-org.apache.lucene.util.fst.FST.Arc-org.apache.lucene.util.fst.FST.BytesReader-">readCeilArc</a></span>(int&nbsp;label, <a href="../../../../../../org/apache/lucene/util/fst/FST.html" title="class in org.apache.lucene.util.fst">FST</a>&lt;T&gt;&nbsp;fst, <a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;T&gt;&nbsp;follow, <a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;T&gt;&nbsp;arc, <a href="../../../../../../org/apache/lucene/util/fst/FST.BytesReader.html" title="class in org.apache.lucene.util.fst">FST.BytesReader</a>&nbsp;in)</code> <div class="block">Reads the first arc greater or equal that the given label into the provided arc in place and returns it iff found, otherwise return <code>null</code>.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;<a href="../../../../../../org/apache/lucene/util/fst/FST.html" title="type parameter in FST">T</a>&gt;</code></td> <td class="colLast"><span class="typeNameLabel">FST.</span><code><span class="memberNameLink"><a href="../../../../../../org/apache/lucene/util/fst/FST.html#readFirstRealTargetArc-long-org.apache.lucene.util.fst.FST.Arc-org.apache.lucene.util.fst.FST.BytesReader-">readFirstRealTargetArc</a></span>(long&nbsp;node, <a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;<a href="../../../../../../org/apache/lucene/util/fst/FST.html" title="type parameter in FST">T</a>&gt;&nbsp;arc, <a href="../../../../../../org/apache/lucene/util/fst/FST.BytesReader.html" title="class in org.apache.lucene.util.fst">FST.BytesReader</a>&nbsp;in)</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;<a href="../../../../../../org/apache/lucene/util/fst/FST.html" title="type parameter in FST">T</a>&gt;</code></td> <td class="colLast"><span class="typeNameLabel">FST.</span><code><span class="memberNameLink"><a href="../../../../../../org/apache/lucene/util/fst/FST.html#readFirstTargetArc-org.apache.lucene.util.fst.FST.Arc-org.apache.lucene.util.fst.FST.Arc-org.apache.lucene.util.fst.FST.BytesReader-">readFirstTargetArc</a></span>(<a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;<a href="../../../../../../org/apache/lucene/util/fst/FST.html" title="type parameter in FST">T</a>&gt;&nbsp;follow, <a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;<a href="../../../../../../org/apache/lucene/util/fst/FST.html" title="type parameter in FST">T</a>&gt;&nbsp;arc, <a href="../../../../../../org/apache/lucene/util/fst/FST.BytesReader.html" title="class in org.apache.lucene.util.fst">FST.BytesReader</a>&nbsp;in)</code> <div class="block">Follow the <code>follow</code> arc and read the first arc of its target; this changes the provided <code>arc</code> (2nd arg) in-place and returns it.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;<a href="../../../../../../org/apache/lucene/util/fst/FST.html" title="type parameter in FST">T</a>&gt;</code></td> <td class="colLast"><span class="typeNameLabel">FST.</span><code><span class="memberNameLink"><a href="../../../../../../org/apache/lucene/util/fst/FST.html#readFirstTargetArc-org.apache.lucene.util.fst.FST.Arc-org.apache.lucene.util.fst.FST.Arc-org.apache.lucene.util.fst.FST.BytesReader-">readFirstTargetArc</a></span>(<a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;<a href="../../../../../../org/apache/lucene/util/fst/FST.html" title="type parameter in FST">T</a>&gt;&nbsp;follow, <a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;<a href="../../../../../../org/apache/lucene/util/fst/FST.html" title="type parameter in FST">T</a>&gt;&nbsp;arc, <a href="../../../../../../org/apache/lucene/util/fst/FST.BytesReader.html" title="class in org.apache.lucene.util.fst">FST.BytesReader</a>&nbsp;in)</code> <div class="block">Follow the <code>follow</code> arc and read the first arc of its target; this changes the provided <code>arc</code> (2nd arg) in-place and returns it.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;<a href="../../../../../../org/apache/lucene/util/fst/FST.html" title="type parameter in FST">T</a>&gt;</code></td> <td class="colLast"><span class="typeNameLabel">FST.</span><code><span class="memberNameLink"><a href="../../../../../../org/apache/lucene/util/fst/FST.html#readLastTargetArc-org.apache.lucene.util.fst.FST.Arc-org.apache.lucene.util.fst.FST.Arc-org.apache.lucene.util.fst.FST.BytesReader-">readLastTargetArc</a></span>(<a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;<a href="../../../../../../org/apache/lucene/util/fst/FST.html" title="type parameter in FST">T</a>&gt;&nbsp;follow, <a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;<a href="../../../../../../org/apache/lucene/util/fst/FST.html" title="type parameter in FST">T</a>&gt;&nbsp;arc, <a href="../../../../../../org/apache/lucene/util/fst/FST.BytesReader.html" title="class in org.apache.lucene.util.fst">FST.BytesReader</a>&nbsp;in)</code> <div class="block">Follows the <code>follow</code> arc and reads the last arc of its target; this changes the provided <code>arc</code> (2nd arg) in-place and returns it.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;<a href="../../../../../../org/apache/lucene/util/fst/FST.html" title="type parameter in FST">T</a>&gt;</code></td> <td class="colLast"><span class="typeNameLabel">FST.</span><code><span class="memberNameLink"><a href="../../../../../../org/apache/lucene/util/fst/FST.html#readLastTargetArc-org.apache.lucene.util.fst.FST.Arc-org.apache.lucene.util.fst.FST.Arc-org.apache.lucene.util.fst.FST.BytesReader-">readLastTargetArc</a></span>(<a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;<a href="../../../../../../org/apache/lucene/util/fst/FST.html" title="type parameter in FST">T</a>&gt;&nbsp;follow, <a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;<a href="../../../../../../org/apache/lucene/util/fst/FST.html" title="type parameter in FST">T</a>&gt;&nbsp;arc, <a href="../../../../../../org/apache/lucene/util/fst/FST.BytesReader.html" title="class in org.apache.lucene.util.fst">FST.BytesReader</a>&nbsp;in)</code> <div class="block">Follows the <code>follow</code> arc and reads the last arc of its target; this changes the provided <code>arc</code> (2nd arg) in-place and returns it.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;<a href="../../../../../../org/apache/lucene/util/fst/FST.html" title="type parameter in FST">T</a>&gt;</code></td> <td class="colLast"><span class="typeNameLabel">FST.</span><code><span class="memberNameLink"><a href="../../../../../../org/apache/lucene/util/fst/FST.html#readNextArc-org.apache.lucene.util.fst.FST.Arc-org.apache.lucene.util.fst.FST.BytesReader-">readNextArc</a></span>(<a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;<a href="../../../../../../org/apache/lucene/util/fst/FST.html" title="type parameter in FST">T</a>&gt;&nbsp;arc, <a href="../../../../../../org/apache/lucene/util/fst/FST.BytesReader.html" title="class in org.apache.lucene.util.fst">FST.BytesReader</a>&nbsp;in)</code> <div class="block">In-place read; returns the arc.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>int</code></td> <td class="colLast"><span class="typeNameLabel">FST.</span><code><span class="memberNameLink"><a href="../../../../../../org/apache/lucene/util/fst/FST.html#readNextArcLabel-org.apache.lucene.util.fst.FST.Arc-org.apache.lucene.util.fst.FST.BytesReader-">readNextArcLabel</a></span>(<a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;<a href="../../../../../../org/apache/lucene/util/fst/FST.html" title="type parameter in FST">T</a>&gt;&nbsp;arc, <a href="../../../../../../org/apache/lucene/util/fst/FST.BytesReader.html" title="class in org.apache.lucene.util.fst">FST.BytesReader</a>&nbsp;in)</code> <div class="block">Peeks at next arc's label; does not alter arc.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;<a href="../../../../../../org/apache/lucene/util/fst/FST.html" title="type parameter in FST">T</a>&gt;</code></td> <td class="colLast"><span class="typeNameLabel">FST.</span><code><span class="memberNameLink"><a href="../../../../../../org/apache/lucene/util/fst/FST.html#readNextRealArc-org.apache.lucene.util.fst.FST.Arc-org.apache.lucene.util.fst.FST.BytesReader-">readNextRealArc</a></span>(<a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;<a href="../../../../../../org/apache/lucene/util/fst/FST.html" title="type parameter in FST">T</a>&gt;&nbsp;arc, <a href="../../../../../../org/apache/lucene/util/fst/FST.BytesReader.html" title="class in org.apache.lucene.util.fst">FST.BytesReader</a>&nbsp;in)</code> <div class="block">Never returns null, but you should never call this if arc.isLast() is true.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>static &lt;T&gt;&nbsp;<a href="../../../../../../org/apache/lucene/util/fst/Util.TopResults.html" title="class in org.apache.lucene.util.fst">Util.TopResults</a>&lt;T&gt;</code></td> <td class="colLast"><span class="typeNameLabel">Util.</span><code><span class="memberNameLink"><a href="../../../../../../org/apache/lucene/util/fst/Util.html#shortestPaths-org.apache.lucene.util.fst.FST-org.apache.lucene.util.fst.FST.Arc-T-java.util.Comparator-int-boolean-">shortestPaths</a></span>(<a href="../../../../../../org/apache/lucene/util/fst/FST.html" title="class in org.apache.lucene.util.fst">FST</a>&lt;T&gt;&nbsp;fst, <a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;T&gt;&nbsp;fromNode, T&nbsp;startOutput, <a href="http://download.oracle.com/javase/8/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a>&lt;T&gt;&nbsp;comparator, int&nbsp;topN, boolean&nbsp;allowEmptyString)</code> <div class="block">Starting from node, find the top N min cost completions to a final node.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static &lt;T&gt;&nbsp;boolean</code></td> <td class="colLast"><span class="typeNameLabel">FST.</span><code><span class="memberNameLink"><a href="../../../../../../org/apache/lucene/util/fst/FST.html#targetHasArcs-org.apache.lucene.util.fst.FST.Arc-">targetHasArcs</a></span>(<a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;T&gt;&nbsp;arc)</code> <div class="block">returns true if the node at this address has any outgoing arcs</div> </td> </tr> </tbody> </table> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing constructors, and an explanation"> <caption><span>Constructors in <a href="../../../../../../org/apache/lucene/util/fst/package-summary.html">org.apache.lucene.util.fst</a> with parameters of type <a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Constructor and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/lucene/util/fst/Util.FSTPath.html#FSTPath-T-org.apache.lucene.util.fst.FST.Arc-org.apache.lucene.util.IntsRefBuilder-">FSTPath</a></span>(<a href="../../../../../../org/apache/lucene/util/fst/Util.FSTPath.html" title="type parameter in Util.FSTPath">T</a>&nbsp;cost, <a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;<a href="../../../../../../org/apache/lucene/util/fst/Util.FSTPath.html" title="type parameter in Util.FSTPath">T</a>&gt;&nbsp;arc, <a href="../../../../../../org/apache/lucene/util/IntsRefBuilder.html" title="class in org.apache.lucene.util">IntsRefBuilder</a>&nbsp;input)</code> <div class="block">Sole constructor</div> </td> </tr> <tr class="rowColor"> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/lucene/util/fst/Util.FSTPath.html#FSTPath-T-org.apache.lucene.util.fst.FST.Arc-org.apache.lucene.util.IntsRefBuilder-float-java.lang.CharSequence-">FSTPath</a></span>(<a href="../../../../../../org/apache/lucene/util/fst/Util.FSTPath.html" title="type parameter in Util.FSTPath">T</a>&nbsp;cost, <a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">FST.Arc</a>&lt;<a href="../../../../../../org/apache/lucene/util/fst/Util.FSTPath.html" title="type parameter in Util.FSTPath">T</a>&gt;&nbsp;arc, <a href="../../../../../../org/apache/lucene/util/IntsRefBuilder.html" title="class in org.apache.lucene.util">IntsRefBuilder</a>&nbsp;input, float&nbsp;boost, <a href="http://download.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang">CharSequence</a>&nbsp;context)</code>&nbsp;</td> </tr> </tbody> </table> </li> </ul> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../org/apache/lucene/util/fst/FST.Arc.html" title="class in org.apache.lucene.util.fst">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?org/apache/lucene/util/fst/class-use/FST.Arc.html" target="_top">Frames</a></li> <li><a href="FST.Arc.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small> <i>Copyright &copy; 2000-2016 Apache Software Foundation. All Rights Reserved.</i> <script src='../../../../../../prettify.js' type='text/javascript'></script> <script type='text/javascript'> (function(){ var oldonload = window.onload; if (typeof oldonload != 'function') { window.onload = prettyPrint; } else { window.onload = function() { oldonload(); prettyPrint(); } } })(); </script> </small></p> </body> </html>
{ "content_hash": "2a1e1138645fc5e546775a87a352e92a", "timestamp": "", "source": "github", "line_count": 479, "max_line_length": 656, "avg_line_length": 98.67014613778706, "alnum_prop": 0.6468061697310793, "repo_name": "YorkUIRLab/irlab", "id": "2a24b2087cebdca75498d7e425fe951333b64023", "size": "47263", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/lucene-6.0.1/docs/core/org/apache/lucene/util/fst/class-use/FST.Arc.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "433499" }, { "name": "Gnuplot", "bytes": "2444" }, { "name": "HTML", "bytes": "95820812" }, { "name": "Java", "bytes": "303195" }, { "name": "JavaScript", "bytes": "33538" } ], "symlink_target": "" }
package engine.listeners; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import engine.GameEngine; import model.Ability; public class AbilityListener implements ActionListener{ private Ability myAbility; private GameEngine myEngine; public AbilityListener(GameEngine engine, Ability ability) { myAbility = ability; myEngine = engine; } @Override public void actionPerformed(ActionEvent e) { myEngine.getModel().setAbility(myAbility); myEngine.getGameViewer().getActionPanel().getAbilityListArea().setUnit(myAbility.getUnit()); // ^^ attempt to have buttons removed if no longer available for that turn. } }
{ "content_hash": "467435959d2b3e0b55f813100c56ca1c", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 94, "avg_line_length": 24.40740740740741, "alnum_prop": 0.7814871016691958, "repo_name": "bradleysykes/game_leprechaun", "id": "054a8807cd71acbb79d6021d05f2cfaf45b50048", "size": "659", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/engine/listeners/AbilityListener.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "338938" } ], "symlink_target": "" }
10 Puns is an android application that can be used as a Pun Catalog. It's searchable, has categories and users can save their favorite puns. #### Table of Contents 1. [Getting Started](#getting-started) 2. [App Structure](#app-structure) 3. [Testing](#testing) 4. [Versioning](#versioning) 5. [License](#license) 6. [Acknowledgments](#acknowledgments) ## Getting Started A quick overview of the project set up. ### Prerequisits A list of the project dependencies and installation instructions for the dependencies. ```shell install this ``` and this: ```shell install another dependency ``` ### Installing and running ### Usage ## App Structure ### Build with Android ### Architecture ## Testing ### Setting up the testing tools ### Statistics on tests ## Development status ## Versioning Current Version: (pre) 1.0.0 This project uses [SemVer](http://semver.org/) for versioning. The versions are marked with tags. ## License This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details ## Acknowledgments Pun Icons built with : https://romannurik.github.io/AndroidAssetStudio/
{ "content_hash": "b3cf04b9617026219973749c2b8f73fb", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 140, "avg_line_length": 18.516129032258064, "alnum_prop": 0.7299651567944251, "repo_name": "sinzianag/vanilla", "id": "b898b03dfcd6610f7a7ae8dd5f9187c5c931433b", "size": "1159", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "47580" } ], "symlink_target": "" }
layout: default title: CAS - Hazelcast Ticket Registry - Google Cloud Platform (GCP) Auto Discovery category: Ticketing --- {% include variables.html %} # Hazelcast Ticket Registry - Google Cloud Platform (GCP) Auto Discovery This hazelcast discovery plugin provides a Google Cloud Platform (GCP) discovery strategy. {% include_cached casmodule.html group="org.apereo.cas" module="cas-server-support-hazelcast-discovery-gcp" %} {% include_cached casproperties.html properties="cas.ticket.registry.hazelcast.cluster.discovery.gcp" %} Note that: - Your GCP Service Account must have permissions to query for all the projects/zones specified in the configuration. - If you don’t specify any of the properties, then CAS forms a cluster from all Hazelcast members running in the current project, in the current region.
{ "content_hash": "e42a223162ea1abce18c3ae27f8ebbc4", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 152, "avg_line_length": 43.21052631578947, "alnum_prop": 0.7868453105968332, "repo_name": "apereo/cas", "id": "bd2c92c9cbf03ba87a803c21ed57884a78219a75", "size": "827", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/cas-server-documentation/ticketing/Hazelcast-Ticket-Registry-AutoDiscovery-Docker-GCP.md", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "16679" }, { "name": "Dockerfile", "bytes": "1207" }, { "name": "Groovy", "bytes": "63590" }, { "name": "HTML", "bytes": "385378" }, { "name": "Java", "bytes": "20049652" }, { "name": "JavaScript", "bytes": "642995" }, { "name": "Mustache", "bytes": "1946" }, { "name": "PHP", "bytes": "33936" }, { "name": "Python", "bytes": "20629" }, { "name": "Ruby", "bytes": "2628" }, { "name": "Shell", "bytes": "165922" } ], "symlink_target": "" }
<roundcube:object name="message" id="messagestack" condition="env:task != 'login'" /> <script type="text/javascript"> // UI startup var UI = new rcube_mail_ui(); $(document).ready(function(){ UI.set('errortitle', '<roundcube:label name="errortitle" quoting="javascript" />'); UI.set('toggleoptions', '<roundcube:label name="toggleadvancedoptions" quoting="javascript" />'); UI.init(); }); </script>
{ "content_hash": "10f08c86997ef0202566fb6359ad363d", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 98, "avg_line_length": 31.153846153846153, "alnum_prop": 0.691358024691358, "repo_name": "ArcherSys/ArcherSys", "id": "6cd3e62d1331ab461ce10cbd90f5f617ec53cd03", "size": "405", "binary": false, "copies": "30", "ref": "refs/heads/master", "path": "webmail/skins/larry/includes/footer.html", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
package com.scalableant.objectlike; import java.util.Iterator; import java.util.NoSuchElementException; public class EmptyIterator<E> implements Iterator<E> { @SuppressWarnings("unchecked") public static <E> EmptyIterator<E> instance() { return new EmptyIterator(); } public boolean hasNext() { return false; } public E next() { throw new NoSuchElementException(); } public void remove() { throw new UnsupportedOperationException(); } }
{ "content_hash": "3c24e11f6b2e4ded86e4a20e8d5f7c2d", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 52, "avg_line_length": 18.785714285714285, "alnum_prop": 0.6463878326996197, "repo_name": "bwarminski/object-like", "id": "aac34cb4658b7e35dc1f7add5502b183e1f2027b", "size": "526", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "object-like/src/main/java/com/scalableant/objectlike/EmptyIterator.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "68458" } ], "symlink_target": "" }
"""AbstractCardRequest class. __author__ = "http://www.gemalto.com" Copyright 2001-2012 gemalto Author: Jean-Daniel Aussel, mailto:jean-daniel.aussel@gemalto.com This file is part of pyscard. pyscard is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. pyscard is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with pyscard; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA """ from smartcard.CardType import AnyCardType from smartcard.PassThruCardService import PassThruCardService import smartcard.System class AbstractCardRequest(object): """The base class for xxxCardRequest classes. A CardRequest is used for waitForCard() invocations and specifies what kind of smart card an application is waited for. Known subclasses: smartcard.pcsc.PCSCCardRequest""" def __init__(self, newcardonly=False, readers=None, cardType=None, cardServiceClass=None, timeout=1): """Construct new CardRequest. newcardonly: if True, request a new card; default is False, i.e. accepts cards already inserted readers: the list of readers to consider for requesting a card; default is to consider all readers cardType: the smartcard.CardType.CardType to wait for; default is smartcard.CardType.AnyCardType, i.e. the request will succeed with any card cardServiceClass: the specific card service class to create and bind to the card;default is to create and bind a smartcard.PassThruCardService timeout: the time in seconds we are ready to wait for connecting to the requested card. default is to wait one second; to wait forever, set timeout to None """ self.newcardonly = newcardonly self.readersAsked = readers self.cardType = cardType self.cardServiceClass = cardServiceClass self.timeout = timeout # if no CardType requeted, use AnyCardType if None == self.cardType: self.cardType = AnyCardType() # if no card service requested, use pass-thru card service if None == self.cardServiceClass: self.cardServiceClass = PassThruCardService def getReaders(self): """Returns the list or readers on which to wait for cards.""" # if readers not given, use all readers if None == self.readersAsked: return smartcard.System.readers() else: return self.readersAsked def waitforcard(self): """Wait for card insertion and returns a card service.""" pass def waitforcardevent(self): """Wait for card insertion or removal.""" pass
{ "content_hash": "254d9a9cf831fd77299466ef417c9fdb", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 75, "avg_line_length": 38.111111111111114, "alnum_prop": 0.6495626822157434, "repo_name": "mixja/eap-sim-lab", "id": "ef3206f045180e1ab4920e97356979ca745c6418", "size": "3430", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "lib/pyscard-1.6.16/build/lib.macosx-10.10-x86_64-2.7/smartcard/AbstractCardRequest.py", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "296205" }, { "name": "CSS", "bytes": "16483" }, { "name": "JavaScript", "bytes": "102146" }, { "name": "Makefile", "bytes": "9775" }, { "name": "Python", "bytes": "1465805" }, { "name": "Shell", "bytes": "7763" } ], "symlink_target": "" }
/** * @file * This file includes compile-time configurations for the SRP (Service Registration Protocol) Server. * */ #ifndef CONFIG_SRP_SERVER_H_ #define CONFIG_SRP_SERVER_H_ /** * @def OPENTHREAD_CONFIG_SRP_SERVER_ENABLE * * Define to 1 to enable SRP Server support. * */ #ifndef OPENTHREAD_CONFIG_SRP_SERVER_ENABLE #define OPENTHREAD_CONFIG_SRP_SERVER_ENABLE 0 #endif /** * @def OPENTHREAD_CONFIG_SRP_SERVER_DEFAULT_ADDDRESS_MODE * * Specifies the default address mode used by the SRP server. * * The address mode specifies how address and port number are determined by the SRP server and how this info is * published in the Thread Network Data. * * The value of this configuration should be from `otSrpServerAddressMode` enumeration. * */ #ifndef OPENTHREAD_CONFIG_SRP_SERVER_DEFAULT_ADDDRESS_MODE #define OPENTHREAD_CONFIG_SRP_SERVER_DEFAULT_ADDDRESS_MODE OT_SRP_SERVER_ADDRESS_MODE_UNICAST #endif /** * @def OPENTHREAD_CONFIG_SRP_SERVER_UDP_PORT_MIN * * Specifies the min port number in the port range reserved for SRP server. * */ #ifndef OPENTHREAD_CONFIG_SRP_SERVER_UDP_PORT_MIN #define OPENTHREAD_CONFIG_SRP_SERVER_UDP_PORT_MIN 53535 #endif /** * @def OPENTHREAD_CONFIG_SRP_SERVER_UDP_PORT_MAX * * Specifies the max port number in the port range reserved for SRP server. * */ #ifndef OPENTHREAD_CONFIG_SRP_SERVER_UDP_PORT_MAX #define OPENTHREAD_CONFIG_SRP_SERVER_UDP_PORT_MAX 53554 #endif /** * @def OPENTHREAD_CONFIG_SRP_SERVER_PORT_SWITCH_ENABLE * * Define to 1 to enable SRP server feature to save its own port in non-volatile settings. * * When enabled, the SRP server will save its port in the non-volatile settings. On a server * restart (e.g., due to a device reset) it will restore the port and change to a different one. The info is written to * Settings after the first service has been registered due to receiving an SRP Update. * */ #ifndef OPENTHREAD_CONFIG_SRP_SERVER_PORT_SWITCH_ENABLE #define OPENTHREAD_CONFIG_SRP_SERVER_PORT_SWITCH_ENABLE 1 #endif /** * @def OPENTHREAD_CONFIG_SRP_SERVER_SERVICE_UPDATE_TIMEOUT * * Specifies the timeout value (in milliseconds) for the service update handler. * * The default timeout value is the sum of the maximum total mDNS probing delays * and a loose IPC timeout of 250ms. It is recommended that this configuration should * not use a value smaller than the default value here, if an Advertising Proxy is used * to handle the service update events. * */ #ifndef OPENTHREAD_CONFIG_SRP_SERVER_SERVICE_UPDATE_TIMEOUT #define OPENTHREAD_CONFIG_SRP_SERVER_SERVICE_UPDATE_TIMEOUT ((4 * 250u) + 250u) #endif #endif // CONFIG_SRP_SERVER_H_
{ "content_hash": "4334063680efaeae8badfa0345a6f059", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 119, "avg_line_length": 30.8953488372093, "alnum_prop": 0.75235227700414, "repo_name": "openthread/openthread", "id": "aeffbdf3148c380c577f0b4724d6944123c19adf", "size": "4265", "binary": false, "copies": "5", "ref": "refs/heads/main", "path": "src/core/config/srp_server.h", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Batchfile", "bytes": "2610" }, { "name": "C", "bytes": "1602099" }, { "name": "C++", "bytes": "8403018" }, { "name": "CMake", "bytes": "110320" }, { "name": "Dockerfile", "bytes": "10426" }, { "name": "M4", "bytes": "32369" }, { "name": "Makefile", "bytes": "192544" }, { "name": "Python", "bytes": "4630721" }, { "name": "Shell", "bytes": "165349" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>metacoq-safechecker: Not compatible 👼</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.13.0 / metacoq-safechecker - 1.0+8.16</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> metacoq-safechecker <small> 1.0+8.16 <span class="label label-info">Not compatible 👼</span> </small> </h1> <p>📅 <em><script>document.write(moment("2022-10-05 18:53:14 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-10-05 18:53:14 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-threads base base-unix base conf-findutils 1 Virtual package relying on findutils conf-gmp 4 Virtual package relying on a GMP lib system installation coq 8.13.0 Formal proof management system num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic ocaml 4.09.1 The OCaml compiler (virtual package) ocaml-base-compiler 4.09.1 Official release 4.09.1 ocaml-config 1 OCaml Switch Configuration ocamlfind 1.9.5 A library manager for OCaml zarith 1.12 Implements arithmetic and logical operations over arbitrary-precision integers # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;matthieu.sozeau@inria.fr&quot; homepage: &quot;https://metacoq.github.io/metacoq&quot; dev-repo: &quot;git+https://github.com/MetaCoq/metacoq.git#coq-8.16&quot; bug-reports: &quot;https://github.com/MetaCoq/metacoq/issues&quot; authors: [&quot;Abhishek Anand &lt;aa755@cs.cornell.edu&gt;&quot; &quot;Danil Annenkov &lt;danil.v.annenkov@gmail.com&gt;&quot; &quot;Simon Boulier &lt;simon.boulier@inria.fr&gt;&quot; &quot;Cyril Cohen &lt;cyril.cohen@inria.fr&gt;&quot; &quot;Yannick Forster &lt;forster@ps.uni-saarland.de&gt;&quot; &quot;Fabian Kunze &lt;fkunze@fakusb.de&gt;&quot; &quot;Meven Lennon-Bertrand &lt;Meven.Bertrand@univ-nantes.fr&gt;&quot; &quot;Gregory Malecha &lt;gmalecha@gmail.com&gt;&quot; &quot;Jakob Botsch Nielsen &lt;Jakob.botsch.nielsen@gmail.com&gt;&quot; &quot;Matthieu Sozeau &lt;matthieu.sozeau@inria.fr&gt;&quot; &quot;Nicolas Tabareau &lt;nicolas.tabareau@inria.fr&gt;&quot; &quot;Théo Winterhalter &lt;theo.winterhalter@inria.fr&gt;&quot; ] license: &quot;MIT&quot; build: [ [&quot;sh&quot; &quot;./configure.sh&quot;] [make &quot;-j&quot; &quot;%{jobs}%&quot; &quot;-C&quot; &quot;safechecker&quot;] ] install: [ [make &quot;-C&quot; &quot;safechecker&quot; &quot;install&quot;] ] depends: [ &quot;coq-metacoq-pcuic&quot; {= version} ] synopsis: &quot;Implementation and verification of safe conversion and typechecking algorithms for Coq&quot; description: &quot;&quot;&quot; MetaCoq is a meta-programming framework for Coq. The SafeChecker modules provides a correct implementation of weak-head reduction, conversion and typechecking of Coq definitions and global environments. &quot;&quot;&quot; url { src: &quot;https://github.com/MetaCoq/metacoq/archive/refs/tags/v1.0-8.16.tar.gz&quot; checksum: &quot;sha512=84c59b74d7ed3798593026d00e412ce2a9d1443afdaf98f5f680788ed8e73cf7e67dcd91392efe2243c5cd61b979edea9bf109f72ea5c45de5c31ef732bba593&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install 🏜️</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-metacoq-safechecker.1.0+8.16 coq.8.13.0</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.13.0). The following dependencies couldn&#39;t be met: - coq-metacoq-safechecker -&gt; coq-metacoq-pcuic = 1.0+8.16 -&gt; coq-metacoq-template = 1.0+8.16 -&gt; coq &gt;= 8.16 Your request can&#39;t be satisfied: - No available version of coq satisfies the constraints No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-metacoq-safechecker.1.0+8.16</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install 🚀</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall 🧹</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣 </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
{ "content_hash": "600c2870026692936973b1badf0e9918", "timestamp": "", "source": "github", "line_count": 180, "max_line_length": 159, "avg_line_length": 44.12777777777778, "alnum_prop": 0.5672919551806622, "repo_name": "coq-bench/coq-bench.github.io", "id": "a186fe6eba0e827b7dbb39172cd475c6e6d11619", "size": "7969", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "clean/Linux-x86_64-4.09.1-2.0.6/released/8.13.0/metacoq-safechecker/1.0+8.16.html", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
#import <Foundation/Foundation.h> #import "DynamoDBResponseUnmarshaller.h" #import "DynamoDBKey.h" /** * Key Unmarshaller */ @interface DynamoDBKeyUnmarshaller:DynamoDBResponseUnmarshaller { DynamoDBKey *response; } +(DynamoDBKey *)unmarshall:(NSDictionary *)jsonObject; @end
{ "content_hash": "ead9de76e1391ac6e145cbccd295a685", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 65, "avg_line_length": 16.941176470588236, "alnum_prop": 0.7638888888888888, "repo_name": "jetthoughts/motion-recorder", "id": "08970c8772dd55827d2b63a3f9d029e068a8aeda", "size": "872", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "vendor/Pods/AWSiOSSDK/src/include/DynamoDB/DynamoDBKeyUnmarshaller.h", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "16899" } ], "symlink_target": "" }
// Type definitions for OpenFin API 16.0 // Project: https://openfin.co/ // Definitions by: Chris Barker <https://github.com/chrisbarker/> // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // based on v6.49.16.16 // see https://openfin.co/support/technical-faq/#what-do-the-numbers-in-the-runtime-version-mean /** * JavaScript API * The JavaScript API allows you to create an HTML/JavaScript application that has access to the native windowing environment, can communicate with other applications and has access to sandboxed system-level features. * * API Ready * When using the OpenFin API, it is important to ensure that it has been fully loaded before making any API calls. To verify that the API is in fact ready, be sure to make any API calls either from within the fin.desktop.main() method or explicitly after it has returned. This avoids the situation of trying to access methods that are not yet fully injected. * * Overview * When running within the OpenFin Runtime your web applications have access to the "fin" namespace and all the modules within the API without the need to include additional source files. You can treat the "fin" namespace as you would the "window", "navigator" or "document" objects. **/ declare namespace fin { const desktop: OpenFinDesktop; interface OpenFinDesktop { main(f: () => any): void; Application: OpenFinApplicationStatic; ExternalApp: OpenFinExternalApplicationStatic; InterApplicationBus: OpenFinInterApplicationBus; Notification: OpenFinNotificationStatic; System: OpenFinSystem; Window: OpenFinWindowStatic; } interface OpenFinApplicationStatic { /** * Creates a new Application. * An object representing an application. Allows the developer to create, execute, show/close an application as well as listen to application events. */ new (options: ApplicationOptions, callback?: (successObj: { httpResponseCode: number }) => void, errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinApplication; /** * Returns an Application object that represents an existing application. */ getCurrent(): OpenFinApplication; /** * Returns an Application object that represents an existing application. */ wrap(uuid: string): OpenFinApplication; } /** * Application * An object representing an application.Allows the developer to create, execute, show / close an application as well as listen to application events. */ interface OpenFinApplication { /** * Returns an instance of the main Window of the application */ getWindow(): OpenFinWindow; /** * Registers an event listener on the specified event. */ addEventListener(type: OpenFinApplicationEventType, listener: (event: ApplicationBaseEvent | TrayIconClickedEvent | WindowEvent | WindowAlertRequestedEvent | WindowAuthRequested | WindowNavigationRejectedEvent | WindowEndLoadEvent) => void, callback?: () => void, errorCallback?: (reason: string) => void): void; /** * Closes the application and any child windows created by the application. */ close(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; /** * Retrieves an array of wrapped fin.desktop.Windows for each of the application's child windows. */ getChildWindows(callback?: (children: OpenFinWindow[]) => void, errorCallback?: (reason: string) => void): void; /** * Retrieves an array of active window groups for all of the application's windows. Each group is represented as an array of wrapped fin.desktop.Windows. */ getGroups(callback?: (groups: OpenFinWindow[][]) => void, errorCallback?: (reason: string) => void): void; /** * Retrieves the JSON manifest that was used to create the application. Invokes the error callback if the application was not created from a manifest. */ getManifest(callback?: (manifest: any) => void, errorCallback?: (reason: string) => void): void; /** * Retrieves UUID of the application that launches this application. Invokes the error callback if the application was created from a manifest. */ getParentUuid(callback?: (uuid: string) => void, errorCallback?: (reason: string) => void): void; /** * Retrieves current configuration of application's shortcuts. */ getShortcuts(callback?: (config: ShortCutConfig) => void, errorCallback?: (reason: string) => void): void; /** * Determines if the application is currently running. */ isRunning(callback?: (running: boolean) => void, errorCallback?: (reason: string) => void): void; /** * Passes in custom data that will be relayed to the RVM */ registerCustomData(data: any, callback?: () => void, errorCallback?: (reason: string) => void): void; /** * Removes a previously registered event listener from the specified event. */ removeEventListener(type: OpenFinApplicationEventType, previouslyRegisteredListener: (event: ApplicationBaseEvent | TrayIconClickedEvent | WindowEvent | WindowAlertRequestedEvent | WindowAuthRequested | WindowNavigationRejectedEvent | WindowEndLoadEvent) => any, callback?: () => void, errorCallback?: (reason: string) => void): void; /** * Removes the application's icon from the tray. */ removeTrayIcon(callback?: () => void, errorCallback?: (reason: string) => void): void; /** * Restarts the application. */ restart(callback?: () => void, errorCallback?: (reason: string) => void): void; /** * Runs the application. When the application is created, run must be called. */ run(callback?: (successObj: SuccessObj) => void, errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): void; /** * Tells the rvm to relaunch the main application once upon a complete shutdown */ scheduleRestart(callback?: () => void, errorCallback?: (reason: string) => void): void; /** * Sets new shortcut configuration for current application. Application has to be launched with a manifest and has to have shortcut configuration (icon url, name, etc.) in its manifest to be able to change shortcut states. */ setShortcuts(config: ShortCutConfig, callback?: () => void, errorCallback?: (reason: string) => void): void; /** * Adds a customizable icon in the system tray and notifies the application when clicked. */ setTrayIcon(iconUrl: string, listener: (clickInfo: TrayIconClickedEvent) => void, callback?: () => void, errorCallback?: (reason: string) => void): void; /** * Closes the application by terminating its process. */ terminate(callback?: () => void, errorCallback?: (reason: string) => void): void; /** * Waits for a hanging application. This method can be called in response to an application "not-responding" to allow the application to continue and to generate another "not-responding" message after a certain period of time. */ wait(callback?: () => void, errorCallback?: (reason: string) => void): void; } interface ShortCutConfig { /** * application has a shortcut on the desktop */ desktop?: boolean; /** * application has no shortcut in the start menu */ startMenu?: boolean; /** * application will be launched on system startup */ systemStartup?: boolean; } interface SuccessObj { httpResponseCode: number; } interface NetworkErrorInfo extends ErrorInfo { networkErrorCode: number; } interface ErrorInfo { stack: string; message: string; } interface ApplicationOptions { /** * The name of the application. */ name?: string; /** * The url to the application. */ url?: string; /** * The UUID of the application, unique within the set of all other applications running in the OpenFin Runtime. name and uuid must match. */ uuid?: string; /** * Enable Flash at the application level. Default: false. */ plugins?: boolean; /** * The options of the main window of the application. */ mainWindowOptions?: WindowOptions; } interface WindowOptions { /** * Enable keyboard shortcuts for devtools and zoom. Default: false for both. */ accelerator?: { devtools?: boolean, zoom?: boolean }; /** * A flag to always position the window at the top of the window stack. Default: false. */ alwaysOnTop?: boolean; /** * A flag to automatically show the Window when it is created. Default: false. */ autoShow?: boolean; /** * A flag to show the context menu when right-clicking on a window. Gives access to the Developer Console for the Window. Default: true */ contextMenu?: boolean; /** * This defines and applies rounded corners for a frameless window. Default for both width and height: 0. */ cornerRounding?: { width?: number; height?: number; }; /** * A field that the user can attach serializable data to to be ferried around with the window options. Default: ''. */ customData?: any; /** * Specifies that the window will be positioned in the center of the primary monitor when loaded for the first time on a machine. When the window corresponding to that id is loaded again, the position from before the window was closed is used. This option overrides defaultLeft and defaultTop. Default: false. */ defaultCentered?: boolean; /** * The default height of the window. Specifies the height of the window when loaded for the first time on a machine. When the window corresponding to that id is loaded again, the height is taken to be the last height of the window before it was closed. Default: 500. */ defaultHeight?: number; /** * The default left position of the window. Specifies the position of the left of the window when loaded for the first time on a machine. When the window corresponding to that id is loaded again, the value of left is taken to be the last value before the window was closed. Default: 100. */ defaultWidth?: number; /** * The default top position of the window. Specifies the position of the top of the window when loaded for the first time on a machine. When the window corresponding to that id is loaded again, the value of top is taken to be the last value before the window was closed. Default: 100. */ defaultTop?: number; /** * The default width of the window. Specifies the width of the window when loaded for the first time on a machine. When the window corresponding to that id is loaded again, the width is taken to be the last width of the window before it was closed. Default: 800. */ defaultLeft?: number; /** * A flag to show the frame. Default: true. */ frame?: boolean; /** * A flag to allow a window to be hidden when the close button is clicked.Default: false. */ hideOnClose?: boolean; /** * A URL for the icon to be shown in the window title bar and the taskbar.Default: The parent application's applicationIcon. */ icon?: string; /** * The maximum height of a window.Will default to the OS defined value if set to - 1. Default: -1. */ maxHeight?: number; /** * A flag that lets the window be maximized.Default: true. */ maximizable?: boolean; /** * The maximum width of a window.Will default to the OS defined value if set to - 1. Default: -1. */ maxWidth?: number; /** * The minimum height of a window.Default: 0. */ minHeight?: number; /** * A flag that lets the window be minimized.Default: true. */ minimizable?: boolean; /** * The minimum width of a window.Default: 0. */ minWidth?: number; /** * The name for the window which must be unique within the context of the invoking Application. */ name?: string; /** * A flag that specifies how transparent the window will be.This value is clamped between 0.0 and 1.0.Default: 1.0. */ opacity?: number; /** * A flag to drop to allow the user to resize the window.Default: true. */ resizable?: boolean; /** * Defines a region in pixels that will respond to user mouse interaction for resizing a frameless window. */ resizeRegion?: { /** * The size in pixels (Default: 2), */ size?: number; /** * The size in pixels of an additional * square resizable region located at the * bottom right corner of a * frameless window. (Default: 4) */ bottomRightCorner?: number; }; /** * A flag to show the Window's icon in the taskbar. Default: true. */ showTaskbarIcon?: boolean; /** * A flag to cache the location of the window or not. Default: true. */ saveWindowState?: boolean; /** * Specify a taskbar group for the window. Default: app's uuid. */ taskbarIconGroup?: string; /** * A string that sets the window to be "minimized", "maximized", or "normal" on creation. Default: "normal". */ state?: string; /** * The URL of the window. Default: "about:blank". */ url?: string; /** * When set to false, the window will render before the "load" event is fired on the content's window. Caution, when false you will see an initial empty white window. Default: true. */ waitForPageLoad?: boolean; } /** * Clipboard * Clipboard API allows reading and writting to the clipboard in multiple formats. */ interface OpenFinClipboard { /** * Reads available formats for the clipboard type */ availableFormats(type: string | null, callback?: (formats: string[]) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; /** * Reads available formats for the clipboard type */ readHtml(type: string | null, callback?: (html: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; /** * Read the content of the clipboard as Rtf */ readRtf(type: string | null, callback?: (rtf: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; /** * Read the content of the clipboard as plain text */ readText(type: string | null, callback?: (text: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; /** * Writes data into the clipboard */ write(data: any, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; /** * Writes data into the clipboard as Html */ writeHtml(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; /** * Writes data into the clipboard as Rtf */ writeRtf(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; /** * Writes data into the clipboard as plain text */ writeText(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; } interface OpenFinExternalApplicationStatic { /** * Returns an External Application object that represents an existing external application. */ wrap(uuid: string): OpenFinExternalApplication; } /** * ExternalApplication * An object representing an application. Allows the developer to create, execute, show and close an application, as well as listen to application events. */ interface OpenFinExternalApplication { /** * Registers an event listener on the specified event. */ addEventListener(type: OpenFinExternalApplicationEventType, listener: () => void, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; /** * Removes a previously registered event listener from the specified event. */ removeEventListener(type: OpenFinExternalApplicationEventType, listener: () => void, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; } /** * InterApplicationBus * A messaging bus that allows for pub/sub messaging between different applications. */ interface OpenFinInterApplicationBus { /** * Adds a listener that gets called when applications subscribe to the current application's messages. */ addSubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; /** * Adds a listener that gets called when applications unsubscribe to the current application's messages. */ addUnsubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; /** * Removes a previously registered subscribe listener. */ removeSubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; /** * Removes a previously registered unsubscribe listener. */ removeUnsubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; /** * Publishes a message to all applications running on OpenFin Runtime that are subscribed to the specified topic. */ publish(topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; /** * Sends a message to a specific application on a specific topic. */ send(destinationUuid: string, name: string, topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; send(destinationUuid: string, topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; /** * Subscribes to messages from the specified application on the specified topic. If the subscription is for a uuid, [name], topic combination that has already been published to upon subscription you will receive the last 20 missed messages in the order they were published. */ subscribe(senderUuid: string, name: string, topic: string, listener: (message: any, uuid: string, name: string) => void, callback?: () => void, errorCallback?: (reason: string) => void): void; subscribe(senderUuid: string, topic: string, listener: (message: any, uuid: string, name: string) => void, callback?: () => void, errorCallback?: (reason: string) => void): void; /** * Unsubscribes to messages from the specified application on the specified topic. */ unsubscribe(senderUuid: string, name: string, topic: string, listener: (message: any, uuid: string, name: string) => void, callback?: () => void, errorCallback?: (reason: string) => void): void; unsubscribe(senderUuid: string, topic: string, listener: (message: any, uuid: string, name: string) => void, callback?: () => void, errorCallback?: (reason: string) => void): void; } interface OpenFinNotificationStatic { /** * ctor */ new (options: NotificationOptions, callback?: () => void, errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinNotification; /** * Gets an instance of the current notification. For use within a notification window to close the window or send a message back to its parent application. */ getCurrent(): OpenFinNotification; } /** * Notification * Notification represents a window on OpenFin Runtime which is shown briefly to the user on the bottom-right corner of the primary monitor. A notification is typically used to alert the user of some important event which requires his or her attention. Notifications are a child or your application that are controlled by the runtime. */ interface OpenFinNotification { /** * Closes the notification. */ close(callback?: () => void): void; /** * Sends a message to the notification. */ sendMessage(message: any, callback?: () => void): void; /** * Sends a message from the notification to the application that created the notification. The message is handled by the notification's onMessage callback. */ sendMessageToApplication(message: any, callback?: () => void): void; } interface NotificationOptions { /** * A boolean that will force dismissal even if the mouse is hovering over the notification */ ignoreMouseOver?: boolean; /** * A message of any primitive or composite-primitive type to be passed to the notification upon creation. */ message?: any; /** * The timeout for displaying a notification.Can be in milliseconds or "never". */ duration?: number | "never"; /** * The url of the notification */ url?: string; /** * A function that is called when a notification is clicked. */ onClick?(callback: () => void): void; /** * Invoked when the notification is closed via .close() method on the created notification instance or the by the notification itself via fin.desktop.Notification.getCurrent().close(). NOTE: this is not invoked when the notification is dismissed via a swipe. For the swipe dismissal callback see onDismiss */ onClose?(callback: () => void): void; /** * Invoked when a the notification is dismissed by swiping it off the screen to the right. NOTE: this is no fired on a programmatic close. */ onDismiss?(callback: () => void): void; /** * A function that is called when an error occurs.The reason for the error is passed as an argument. */ onError?(errorCallback: (reason: string, errorObj: NetworkErrorInfo) => void): void; /** * The onMessage function will respond to messages sent from notification.sendMessageToApplication.The function is passed the message, which can be of any primitive or composite-primitive type. */ onMessage?(callback: (message: any) => void): void; /** * A function that is called when a notification is shown. */ onShow?(callback: (successObj: SuccessObj) => void): void; } /** * System * An object representing the core of OpenFin Runtime. Allows the developer to perform system-level actions, such as accessing logs, viewing processes, clearing the cache and exiting the runtime. */ interface OpenFinSystem { /** * */ Clipboard: OpenFinClipboard; /** * Registers an event listener on the specified event. */ addEventListener(type: OpenFinSystemEventType, listener: (event: SystemBaseEvent | DesktopIconClickedEvent | IdleStateChangedEvent | MonitorInfoChangedEvent | SessionChangedEvent) => void, callback?: () => void, errorCallback?: (reason: string) => void): void; /** * Clears cached data containing window state/positions, application resource files (images, HTML, JavaScript files), cookies, and items stored in the Local Storage. */ clearCache(options: CacheOptions, callback?: () => void, errorCallback?: (reason: string) => void): void; /** * Clears all cached data when OpenFin Runtime exits. */ deleteCacheOnExit(callback?: () => void, errorCallback?: (reason: string) => void): void; /** * Downloads the given application asset */ downloadAsset(assetObj: AppAssetInfo, progressListener?: (progress: { downloadedBytes: number, totalBytes: number }) => void, callback?: (successObj: { path: string }) => void, errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): void; /** * Exits the Runtime. */ exit(callback?: () => void, errorCallback?: (reason: string) => void): void; /** * Retrieves an array of data for all applications. */ getAllApplications(callback?: (applicationInfoList: ApplicationInfo[]) => void, errorCallback?: (reason: string) => void): void; /** * Retrieves an array of data for all external applications. */ getAllExternalApplications(callback?: (applicationInfoList: ApplicationInfo[]) => void, errorCallback?: (reason: string) => void): void; /** * Retrieves an array of data (name, ids, bounds) for all application windows. */ getAllWindows(callback?: (windowInfoList: WindowDetails[]) => void, errorCallback?: (reason: string) => void): void; /** * Retrieves the command line argument string that started OpenFin Runtime. */ getCommandLineArguments(callback?: (args: string) => void, errorCallback?: (reason: string) => void): void; /** * Retrieves the configuration object that started the OpenFin Runtime. */ getDeviceId(callback?: (uuid: string) => void, errorCallback?: (reason: string) => void): void; /** * Gets the value of a given environment variable on the computer on which the runtime is installed. */ getEnvironmentVariable(envVar: string, callback?: (variable: string) => void, errorCallback?: (reason: string) => void): void; /** * Retrieves system information. */ getHostSpecs(callback?: (info: HostSpecInfo) => void, errorCallback?: (reason: string) => void): void; /** * Retrieves the contents of the log with the specified filename. */ getLog(logFileName: string, callback?: (variable: string) => void, errorCallback?: (reason: string) => void): void; /** * Retrieves an array containing information for each log file. */ getLogList(callback?: (logInfoList: LogInfo[]) => void, errorCallback?: (reason: string) => void): void; /** * Retrieves an object that contains data about the about the monitor setup of the computer that the runtime is running on. */ getMonitorInfo(callback?: (monitorInfo: MonitorInfo) => void, errorCallback?: (reason: string) => void): void; /** * Returns the mouse in virtual screen coordinates (left, top). */ getMousePosition(callback?: (mousePosition: VirtualScreenCoordinates) => void, errorCallback?: (reason: string) => void): void; /** * Retrieves an array of all of the runtime processes that are currently running. Each element in the array is an object containing the uuid and the name of the application to which the process belongs. */ getProcessList(callback?: (processInfoList: ProcessInfo[]) => void, errorCallback?: (reason: string) => void): void; /** * Retrieves the Proxy settings. */ getProxySettings(callback?: (proxy: ProxyInfo) => void, errorCallback?: (reason: string) => void): void; /** * Returns information about the running RVM in an object. */ getRvmInfo(callback?: (rvmInfo: RvmInfo) => void, errorCallback?: (reason: string) => void): void; /** * Returns the version of the runtime. The version contains the major, minor, build and revision numbers. */ getVersion(callback?: (version: string) => void, errorCallback?: (reason: string) => void): void; /** * Runs an executable or batch file. */ launchExternalProcess(options: ExternalProcessLaunchInfo, callback?: (payload: { uuid: string }) => void, errorCallback?: (reason: string) => void): void; /** * Writes the passed message into both the log file and the console. */ log(level: "debug" | "info" | "warn" | "error", message: string, callback?: () => void, errorCallback?: (reason: string) => void): void; /** * Monitors a running process. */ monitorExternalProcess(options: ExternalProcessInfo, callback?: (payload: { uuid: string }) => void, errorCallback?: (reason: string) => void): void; /** * Opens the passed URL in the default web browser. */ openUrlWithBrowser(url: string, callback?: () => void, errorCallback?: (reason: string) => void): void; /** * This function call will register a unique id and produce a token. The token can be used to broker an external connection. */ registerExternalConnection(uuid: string, callback?: (detail: { /** * this will be unique each time */ token: string; /** * "remote-connection-uuid" */ uuid: string; }) => void, errorCallback?: (reason: string) => void): void; /** * Removes the process entry for the passed UUID obtained from a prior call of fin.desktop.System.launchExternalProcess(). */ releaseExternalProcess(processUuid: string, callback?: () => void, errorCallback?: (reason: string) => void): void; /** * Removes a previously registered event listener from the specified event. */ removeEventListener(type: OpenFinSystemEventType, listener: (event: SystemBaseEvent | DesktopIconClickedEvent | IdleStateChangedEvent | MonitorInfoChangedEvent | SessionChangedEvent) => void, callback?: () => void, errorCallback?: (reason: string) => void): void; /** * Shows the Chrome Developer Tools for the specified window. */ showDeveloperTools(uuid: string, name: string, callback?: () => void, errorCallback?: (reason: string) => void): void; /** * Attempt to close an external process. The process will be terminated if it has not closed after the elapsed timeout in milliseconds. */ terminateExternalProcess(processUuid: string, timeout: number, killTree: boolean, callback?: (info: { result: "clean" | "terminated" | "failed" }) => void, errorCallback?: (reason: string) => void): void; terminateExternalProcess(processUuid: string, timeout: number, callback?: (info: { result: "clean" | "terminated" | "failed" }) => void, errorCallback?: (reason: string) => void): void; /** * Update the OpenFin Runtime Proxy settings. */ updateProxySettings(type: string, address: string, port: number, callback?: () => void, errorCallback?: (reason: string) => void): void; } interface CacheOptions { cache?: boolean; cookies?: boolean; localStorage?: boolean; appcache?: boolean; userData?: boolean; } interface AppAssetInfo { src?: string; alias?: string; version?: string; target?: string; args?: string; } interface ApplicationInfo { /** * true when the application is running. */ isRunning?: boolean; /** * uuid of the application. */ uuid?: string; /** * uuid of the application that launches this application. */ parentUuid?: string; } interface WindowDetails { uuid?: string; mainWindow?: WindowInfo; childWindows?: WindowInfo[]; } interface WindowInfo { /** * name of the child window */ name?: string; /** * top-most coordinate of the child window */ top?: number; /** * right-most coordinate of the child window */ right?: number; /** * bottom-most coordinate of the child window */ bottom?: number; /** * left-most coordinate of the child window */ left?: number; } interface HostSpecInfo { /** * "x86" for 32-bit or "x86_64" for 64-bit */ arch: string; /** * Same payload as Node's os.cpus() */ cpus: NodeCpuInfo[]; /** * */ gpu: { /** * Graphics card name */ name: string; }; /** * Same payload as Node's os.totalmem() */ memory: number; /** * OS name and version/edition */ name: string; } interface NodeCpuInfo { model: string; /** * in MHz */ speed: number; times: { /** * The number of milliseconds the CPU has spent in user mode. */ user: number; /** * The number of milliseconds the CPU has spent in nice mode. */ nice: number; /** * The number of milliseconds the CPU has spent in sys mode. */ sys: number; /** * The number of milliseconds the CPU has spent in idle mode. */ idle: number; /** * The number of milliseconds the CPU has spent in irq mode. */ irq: number; }; } interface LogInfo { /** * the filename of the log */ name?: string; /** * the size of the log in bytes */ size?: number; /** * the unix time at which the log was created "Thu Jan 08 2015 14:40:30 GMT-0500 (Eastern Standard Time)" */ date?: string; } interface ProcessInfo { /** * the percentage of total CPU usage */ cpuUsage?: number; /** * the application name */ name?: string; /** * the current nonpaged pool usage in bytes */ nonPagedPoolUsage?: number; /** * the number of page faults */ pageFaultCount?: number; /** * the current paged pool usage in bytes */ pagedPoolUsage?: number; /** * the total amount of memory in bytes that the memory manager has committed */ pagefileUsage?: number; /** * the peak nonpaged pool usage in bytes */ peakNonPagedPoolUsage?: number; /** * the peak paged pool usage in bytes */ peakPagedPoolUsage?: number; /** * the peak value in bytes of pagefileUsage during the lifetime of this process */ peakPagefileUsage?: number; /** * the peak working set size in bytes */ peakWorkingSetSize?: number; /** * the native process identifier */ processId?: number; /** * the application UUID */ uuid?: string; /** * the current working set size (both shared and private data) in bytes */ workingSetSize?: number; } interface ProxyInfo { /** * the configured Proxy Address */ proxyAddress?: string; /** * the configured Proxy port */ proxyPort?: number; /** * Proxy Type */ type?: string; } interface RvmInfo { version?: string; "start-time"?: string; } interface ExternalProcessLaunchInfo { path?: string; /** * Additionally note that the executable found in the zip file specified in appAssets * will default to the one mentioned by appAssets.target * If the the path below refers to a specific path it will override this default */ alias?: string; /** * When using alias; if no arguments are passed then the arguments (if any) * are taken from the 'app.json' file, from the 'args' parameter * of the 'appAssets' Object with the relevant 'alias'. * If 'arguments' is passed as a parameter it takes precedence * over any 'args' set in the 'app.json'. */ arguments?: string; listener?: (result: { /** * "Exited" Or "released" on a call to releaseExternalProcess */ topic?: string; /** * The mapped UUID which identifies the launched process */ uuid?: string; /* * Process exit code */ exitCode?: number; }) => void; certificate?: CertificationInfo; } interface CertificationInfo { /** * A hex string with or without spaces */ serial?: string; /** * An internally tokenized and comma delimited string allowing partial or full checks of the subject fields */ subject?: string; /** * A hex string with or without spaces */ publickey?: string; /** * A hex string with or without spaces */ thumbprint?: string; /** * A boolean indicating that the certificate is trusted and not revoked */ trusted?: boolean; } interface ExternalProcessInfo { pid?: number; listener?: (result: { /** * "Exited" Or "released" on a call to releaseExternalProcess */ topic?: string; /** * The mapped UUID which identifies the launched process */ uuid?: string; /* * Process exit code */ exitCode?: number; }) => void; } interface OpenFinWindowStatic { /** * Class: Window * * new Window(options, callbackopt, errorCallbackopt) * * Creates a new OpenFin Window * * A basic window that wraps a native HTML window. Provides more fine-grained control over the window state such as the ability to minimize, maximize, restore, etc. By default a window does not show upon instantiation; instead the window's show() method must be invoked manually. The new window appears in the same process as the parent window. * @param {any} options - The options of the window * @param {Function} [callback] - Called if the window creation was successful * @param {number} [callback.successObj] - httpResponseCode */ new (options: WindowOptions, callback?: (successObj: { httpResponseCode: number }) => void, errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinWindow; /** * Returns an instance of the current window. * @returns {OpenFinWindow} Current window */ getCurrent(): OpenFinWindow; /** * Returns a Window object that wraps an existing window. */ wrap(appUuid: string, windowName: string): OpenFinWindow; } /** * Window * A basic window that wraps a native HTML window. Provides more fine-grained control over the window state such as the ability to minimize, maximize, restore, etc. By default a window does not show upon instantiation; instead the window's show() method must be invoked manually. The new window appears in the same process as the parent window. */ interface OpenFinWindow { /** * Name of window */ name: string; /** * Returns the native JavaScript "window" object for the window. This method can only be used by the parent application or the window itself, otherwise it will return undefined. The same Single-Origin-Policy (SOP) rules apply for child windows created by window.open(url) in that the contents of the window object are only accessible if the URL has the same origin as the invoking window. See example below. Also, will not work with fin.desktop.Window objects created with fin.desktop.Window.wrap(). * @returns {Window} Native window */ getNativeWindow(): Window; /** * Gets the parent application. * @returns {OpenFinApplication} Parent application */ getParentApplication(): OpenFinApplication; /** * Gets the parent window. */ getParentWindow(): OpenFinWindow; /** * Registers an event listener on the specified event. */ addEventListener(type: OpenFinWindowEventType, listener: (event: WindowBaseEvent | WindowAuthRequestedEvent | WindowBoundsEvent | WindowExternalProcessStartedEvent | WindowExternalProcessExited | WindowGroupChangedEvent | WindowHiddenEvent | Window_NavigationRejectedEvent) => void, callback?: () => void, errorCallback?: (reason: string) => void): void; /** * Performs the specified window transitions */ animate(transitions: AnimationTransition, options: AnimationOptions, callback?: (event: any) => void, errorCallback?: (reason: string) => void): void; /** * Provides credentials to authentication requests */ authenticate(userName: string, password: string, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; /** * Removes focus from the window. */ blur(callback?: () => void, errorCallback?: (reason: string) => void): void; /** * Brings the window to the front of the OpenFin window stack. */ bringToFront(callback?: () => void, errorCallback?: (reason: string) => void): void; /** * Closes the window. * @param {force} Close will be prevented from closing when force is false and 'close-requested' has been subscribed to for application's main window. */ close(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; /** * Prevents a user from changing a window's size/position when using the window's frame. * 'disabled-frame-bounds-changing' is generated at the start of and during a user move/size operation. * 'disabled-frame-bounds-changed' is generated after a user move/size operation. * The events provide the bounds that would have been applied if the frame was enabled. * 'frame-disabled' is generated when an enabled frame becomes disabled. */ disableFrame(callback?: () => void, errorCallback?: (reason: string) => void): void; /** * Re-enables user changes to a window's size/position when using the window's frame. * 'disabled-frame-bounds-changing' is generated at the start of and during a user move/size operation. * 'disabled-frame-bounds-changed' is generated after a user move/size operation. * The events provide the bounds that would have been applied if the frame was enabled. * 'frame-enabled' is generated when a disabled frame has becomes enabled. */ enableFrame(callback?: () => void, errorCallback?: (reason: string) => void): void; /** * Flashes the window's frame and taskbar icon until the window is activated. */ flash(options?: any, callback?: () => void, errorCallback?: (reason: string) => void): void; /** * Gives focus to the window. */ focus(callback?: () => void, errorCallback?: (reason: string) => void): void; /** * Gets the current bounds (top, left, width, height) of the window. */ getBounds(callback?: (bounds: WindowBounds) => void, errorCallback?: (reason: string) => void): void; /** * Retrieves an array containing wrapped fin.desktop.Windows that are grouped with this window. If a window is not in a group an empty array is returned. Please note that calling window is included in the result array. */ getGroup(callback?: (group: OpenFinWindow[]) => void, errorCallback?: (reason: string) => void): void; /** * Gets the current settings of the window. */ getOptions(callback?: (options: WindowOptions) => void, errorCallback?: (reason: string) => void): void; /** * Gets a base64 encoded PNG snapshot of the window. */ getSnapshot(callback?: (base64Snapshot: string) => void, errorCallback?: (reason: string) => void): void; /** * Gets the current state ("minimized", "maximized", or "restored") of the window. */ getState(callback?: (state: "minimized" | "maximized" | "restored") => void, errorCallback?: (reason: string) => void): void; /** * Returns the zoom level of the window. */ getZoomLevel(callback?: (level: number) => void, errorCallback?: (reason: string) => void): void; /** * Hides the window. */ hide(callback?: () => void, errorCallback?: (reason: string) => void): void; /** * Determines if the window is currently showing. */ isShowing(callback?: (showing: boolean) => void, errorCallback?: (reason: string) => void): void; /** * Joins the same window group as the specified window. */ joinGroup(target: OpenFinWindow, callback?: () => void, errorCallback?: (reason: string) => void): void; /** * Leaves the current window group so that the window can be move independently of those in the group. */ leaveGroup(callback?: () => void, errorCallback?: (reason: string) => void): void; /** * Maximizes the window. */ maximize(callback?: () => void, errorCallback?: (reason: string) => void): void; /** * Merges the instance's window group with the same window group as the specified window */ mergeGroups(target: OpenFinWindow, callback?: () => void, errorCallback?: (reason: string) => void): void; /** * Minimizes the window. */ minimize(callback?: () => void, errorCallback?: (reason: string) => void): void; /** * Moves the window by a specified amount. */ moveBy(deltaLeft: number, deltaTop: number, callback?: () => void, errorCallback?: (reason: string) => void): void; /** * Moves the window to a specified location. */ moveTo(left: number, top: number, callback?: () => void, errorCallback?: (reason: string) => void): void; /** * Removes a previously registered event listener from the specified event. */ removeEventListener(type: OpenFinWindowEventType, listener: (event: WindowBaseEvent | WindowAuthRequestedEvent | WindowBoundsEvent | WindowExternalProcessStartedEvent | WindowExternalProcessExited | WindowGroupChangedEvent | WindowHiddenEvent | Window_NavigationRejectedEvent) => void, callback?: () => void, errorCallback?: (reason: string) => void): void; /** * Resizes the window by a specified amount. */ resizeBy(deltaWidth: number, deltaHeight: number, anchor: OpenFinAnchor, callback?: () => void, errorCallback?: (reason: string) => void): void; /** * Resizes the window by a specified amount. */ resizeTo(width: number, height: number, anchor: OpenFinAnchor, callback?: () => void, errorCallback?: (reason: string) => void): void; /** * Restores the window to its normal state (i.e., unminimized, unmaximized). */ restore(callback?: () => void, errorCallback?: (reason: string) => void): void; /** * Will bring the window to the front of the entire stack and give it focus. */ setAsForeground(callback?: () => void, errorCallback?: (reason: string) => void): void; /** * Sets the window's size and position */ setBounds(left: number, top: number, width: number, height: number, callback?: () => void, errorCallback?: (reason: string) => void): void; /** * Sets the zoom level of the window. */ setZoomLevel(level: number, callback?: () => void, errorCallback?: (reason: string) => void): void; /** * Shows the window if it is hidden. * @param {force} Show will be prevented from closing when force is false and 'show-requested' has been subscribed to for application's main window. */ show(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; /** * Shows the window if it is hidden at the specified location. If the toggle parameter is set to true, the window will alternate between showing and hiding. */ showAt(left: number, top: number, force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; /** * Stops the taskbar icon from flashing. */ stopFlashing(callback?: () => void, errorCallback?: (reason: string) => void): void; /** * Updates the window using the passed options */ updateOptions(options: WindowOptions, callback?: () => void, errorCallback?: (reason: string) => void): void; } interface ApplicationBaseEvent { topic: string; type: OpenFinApplicationEventType; uuid: string; } interface TrayIconClickedEvent extends ApplicationBaseEvent { button: number; // 0 for left, 1 for middle, 2 for right monitorInfo: MonitorInfo; x: number; // the cursor x coordinate y: number; // the cursor y coordinate } interface WindowEvent extends ApplicationBaseEvent { name: string; } interface WindowAlertRequestedEvent extends WindowEvent { message: string; url: string; } interface WindowAuthRequested extends WindowEvent { authInfo: { host: string; isProxy: boolean; port: number; realm: string; scheme: string; }; } interface WindowNavigationRejectedEvent extends WindowEvent { sourceName: string; url: string; } interface WindowEndLoadEvent extends WindowEvent { documentName: string; isMain: boolean; } interface MonitorInfoChangedEvent extends MonitorInfo { topic: "system"; type: "monitor-info-changed"; } interface MonitorInfo { nonPrimaryMonitors: MonitorInfoDetail[]; primaryMonitor: MonitorInfoDetail; reason: string; taskbar: { edge: "left" | "right" | "top" | "bottom", rect: MontiorCoordinates }; topic: "system"; type: "monitor-info-changed"; virtualScreen: MontiorCoordinates; } interface MonitorInfoDetail { availableRect: MontiorCoordinates; deviceId: string; displayDeviceActive: boolean; monitorRect: MontiorCoordinates; name: string; } interface MontiorCoordinates { bottom: number; left: number; right: number; top: number; } interface VirtualScreenCoordinates { left: number; top: number; } interface SystemBaseEvent { topic: string; type: OpenFinSystemEventType; uuid: string; } interface DesktopIconClickedEvent { mouse: { /** * the left virtual screen coordinate of the mouse */ left: number, /** * the top virtual screen coordinate of the mouse */ top: number }; /** * the number of milliseconds that have elapsed since the system was started, */ tickCount: number; topic: "system"; type: "desktop-icon-clicked"; } interface IdleStateChangedEvent { /** * How long in milliseconds since the user has been idle. */ elapsedTime: number; /** * true when the user is idle,false when the user has returned; */ isIdle: boolean; topic: "system"; type: "idle-state-changed"; } interface WindowBaseEvent { /** * the name of the window */ name: string; /** * always window */ topic: "window"; /** * window event type */ type: OpenFinWindowEventType; /** * the UUID of the application the window belongs to */ uuid: string; } interface WindowAuthRequestedEvent extends WindowBaseEvent { authInfo: { host: string; isProxy: boolean; port: number; realm: string; scheme: string; }; } interface WindowBoundsEvent extends WindowBaseEvent { /** * describes what kind of change occurred. * 0 means a change in position. * 1 means a change in size. * 2 means a change in position and size. */ changeType: number; /** * true when pending changes have been applied to the window. */ deferred: boolean; /** * the new height of the window. */ height: number; /** * the left-most coordinate of the window. */ left: number; /** * the top-most coordinate of the window. */ top: number; /** * */ type: "bounds-changed" | "bounds-changing" | "disabled-frame-bounds-changed" | "disabled-frame-bounds-changing"; /** * the new width of the window. */ width: number; } interface WindowExternalProcessStartedEvent extends WindowBaseEvent { /** * the process handle uuid */ processUuid: string; type: "external-process-started"; } interface WindowExternalProcessExited extends WindowBaseEvent { /** * the process exit code */ exitCode: number; /** * the process handle uuid */ processUuid: string; type: "external-process-exited"; } interface WindowGroupChangedEvent extends WindowBaseEvent { /** * Which group array the window that the event listener was registered on is included in: * 'source' The window is included in sourceGroup. * 'target' The window is included in targetGroup. * 'nothing' The window is not included in sourceGroup nor targetGroup. */ memberOf: "source" | "target" | "nothing"; /** * The reason this event was triggered. * 'leave' A window has left the group due to a leave or merge with group. * 'join' A window has joined the group. * 'merge' Two groups have been merged together. * 'disband' There are no other windows in the group. */ reason: "leave" | "join" | "merge" | "disband"; /** * All the windows in the group the sourceWindow originated from. */ sourceGroup: WindowOfGroupInfo[]; /** * The UUID of the application the sourceWindow belongs to The source window is the window in which (merge/join/leave)group(s) was called. */ sourceWindowAppUuid: string; /** * the name of the sourcewindow.The source window is the window in which(merge / join / leave) group(s) was called. */ sourceWindowName: string; /** * All the windows in the group the targetWindow orginated from */ targetGroup: WindowOfGroupInfo[]; /** * The UUID of the application the targetWindow belongs to. The target window is the window that was passed into (merge/join) group(s). */ targetWindowAppUuid: string; /** * The name of the targetWindow. The target window is the window that was passed into (merge/join) group(s). */ targetWindowName: string; type: "group-changed"; } interface WindowOfGroupInfo { /** * The UUID of the application this window entry belongs to. */ appUuid: string; /** * The name of this window entry. */ windowName: string; } interface WindowHiddenEvent extends WindowBaseEvent { /** * What action prompted the close. * The reasons are: "hide", "hide-on-close" */ reason: "hide" | "hide-on-close"; type: "hidden"; } interface Window_NavigationRejectedEvent { name: string; /** * source of navigation window name */ sourceName: string; topic: "navigation-rejected"; /** * Url that was not reached "http://blocked-content.url" */ url: string; /** * the UUID of the application the window belongs to. */ uuid: string; } interface AnimationTransition { opacity?: { /** * This value is clamped from 0.0 to 1.0 */ opacity?: number; /** * The total time in milliseconds this transition should take. */ duration?: number; /** * Treat 'opacity' as absolute or as a delta. Defaults to false. */ relative?: boolean; }; position?: { /** * Defaults to the window's current left position in virtual screen coordinates. */ left?: number; /** * Defaults to the window's current top position in virtual screen coordinates. */ top?: number; /** * The total time in milliseconds this transition should take. */ duration?: number; /** * Treat 'left' and 'top' as absolute or as deltas. Defaults to false. */ relative?: boolean; }; size?: { /** * Optional if height is present. Defaults to the window's current width. */ width?: number; /** * Optional if width is present. Defaults to the window's current height. */ height?: number; /** * The total time in milliseconds this transition should take. */ duration?: number; /** * Treat 'width' and 'height' as absolute or as deltas. Defaults to false. */ relative?: boolean; }; } interface AnimationOptions { /** * This option interrupts the current animation. When false it pushes this animation onto the end of the animation queue. */ interrupt?: boolean; /** * Transition effect. Defaults to 'ease-in-out'. */ tween?: OpenFinTweenType; } interface WindowBounds { /** * the height of the window. */ height?: number; /** * left-most coordinate of the window. */ left?: number; /** * top-most coordinate of the window. */ top?: number; /** * the width of the window. */ width?: number; } interface SessionChangedEvent { /** * the action that triggered this event: */ reason: "lock" | "unlock" | "remote-connect" | "remote-disconnect" | "unknown"; topic: "system"; type: "session-changed"; } type OpenFinTweenType = "linear" | "ease-in" | "ease-out" | "ease-in-out" | "ease-in-quad" | "ease-out-quad" | "ease-in-out-quad" | "ease-in-cubic" | "ease-out-cubic" | "ease-in-out-cubic" | "ease-out-bounce" | "ease-in-back" | "ease-out-back" | "ease-in-out-back" | "ease-in-elastic" | "ease-out-elastic" | "ease-in-out-elastic"; type OpenFinApplicationEventType = "closed" | "connected" | "crashed" | "initialized" | "manifest-changed" | "not-responding" | "out-of-memory" | "responding" | "run-requested" | "started" | "tray-icon-clicked" | "window-alert-requested" | "window-auth-requested" | "window-closed" | "window-created" | "window-end-load" | "window-navigation-rejected" | "window-show-requested" | "window-start-load"; type OpenFinExternalApplicationEventType = "connected" | "disconnected"; type OpenFinSystemEventType = "application-closed" | "application-crashed" | "application-created" | "application-started" | "desktop-icon-clicked" | "idle-state-changed" | "monitor-info-changed" | "session-changed"; type OpenFinWindowEventType = "auth-requested" | "blurred" | "bounds-changed" | "bounds-changing" | "close-requested" | "closed" | "disabled-frame-bounds-changed" | "disabled-frame-bounds-changing" | "embedded" | "external-process-exited" | "external-process-started" | "focused" | "frame-disabled" | "frame-enabled" | "group-changed" | "hidden" | "initialized" | "maximized" | "minimized" | "navigation-rejected" | "restored" | "show-requested" | "shown"; type OpenFinAnchor = "top-left" | "top-right" | "bottom-left" | "bottom-right"; }
{ "content_hash": "7ed53a6bda44333ec644a7a4dd5064f9", "timestamp": "", "source": "github", "line_count": 1581, "max_line_length": 501, "avg_line_length": 34.77798861480076, "alnum_prop": 0.6793067074057908, "repo_name": "johan-gorter/DefinitelyTyped", "id": "32e980120f2980a8ae6a0cff4a33e7c50b2905db", "size": "54984", "binary": false, "copies": "32", "ref": "refs/heads/master", "path": "types/openfin/v16/index.d.ts", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "1193" }, { "name": "TypeScript", "bytes": "24402654" } ], "symlink_target": "" }
using System.Web.Mvc; using DD4T.ContentModel; using DD4T.ContentModel.Exceptions; using DD4T.Mvc.Html; using System.Web; using System.IO; using System.Security; using DD4T.ContentModel.Contracts.Logging; using DD4T.ContentModel.Factories; using System; using DD4T.Core.Contracts.ViewModels; using DD4T.ContentModel.Contracts.Configuration; namespace DD4T.Mvc.Controllers { public abstract class TridionControllerBase : DD4TControllerBase, IPageController, IComponentPresentationController { public TridionControllerBase(IPageFactory pageFactory, IComponentPresentationFactory componentPresentationFactory, ILogger logger, IDD4TConfiguration dd4tConfiguration) : base(pageFactory, componentPresentationFactory, logger, dd4tConfiguration) { } [HandleError] public virtual ActionResult Page(string url) { url = AddWelcomePageToUrl(url); IPage page = GetPage(url); if (page == null) { throw new HttpException(404, "Page cannot be found"); } return View(GetViewName(page), page); } /// <summary> /// Read component presentation from RouteData and render it with the specified view /// </summary> /// <param name="componentPresentationId"></param> /// <returns></returns> public virtual ActionResult ComponentPresentation() // TODO: overload with component/ct uri to retrieve DCPs { LoggerService.Information(">>ComponentPresentation", LoggingCategory.Performance); try { IComponentPresentation componentPresentation = RouteData.Values["ComponentPresentation"] as IComponentPresentation; if (componentPresentation == null) { throw new ArgumentException("No ComponentPresentation found in the RouteData"); } return View(GetViewName(componentPresentation), componentPresentation); } catch (ConfigurationException e) { ViewResult result = View("Configuration exception: " + e.Message); LoggerService.Information("<<ComponentPresentation", LoggingCategory.Performance); return result; } } /// <summary> /// Create IPage from data in the request and forward to the view /// </summary> /// <example> /// To use, add the following code to the Global.asax.cs of your MVC web application: /// routes.MapRoute( /// "PreviewPage", /// "{*PageId}", /// new { controller = "Page", action = "PreviewPage" }, // Parameter defaults /// new { httpMethod = new HttpMethodConstraint("POST") } // Parameter constraints /// ); /// * This is assuming that you have a controller called PageController which extends TridionControllerBase /// </example> /// <returns></returns> [HandleError] [AcceptVerbs(HttpVerbs.Post)] [ValidateInput(false)] public System.Web.Mvc.ActionResult PreviewPage() { try { using (StreamReader reader = new StreamReader(this.Request.InputStream)) { string pageXml = reader.ReadToEnd(); IPage page = PageFactory.GetIPageObject(pageXml); if (page == null) { throw new ModelNotCreatedException("--unknown--"); } return View(GetViewName(page), page); } } catch (SecurityException se) { throw new HttpException(403, se.Message); } } } }
{ "content_hash": "2dc0753e0dad202a61b14a27c6a8ca15", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 253, "avg_line_length": 38.87, "alnum_prop": 0.5857988165680473, "repo_name": "dd4t/dd4t-mvc", "id": "1f0c80d87a15586862dd8390cdcd670ea9972a8a", "size": "3889", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "source/DD4T.Mvc/Controllers/TridionControllerBase.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C#", "bytes": "150478" } ], "symlink_target": "" }
package com.twitter.sdk.android.core.models; import com.google.gson.annotations.SerializedName; import java.util.Collections; import java.util.List; /** * Entities for User Objects describe URLs that appear in the user defined profile URL and * description fields. */ public class UserEntities { @SerializedName("url") public final UrlEntities url; @SerializedName("description") public final UrlEntities description; public UserEntities(UrlEntities url, UrlEntities description) { this.url = url; this.description = description; } public static class UrlEntities { @SerializedName("urls") public final List<UrlEntity> urls; public UrlEntities(List<UrlEntity> urls) { this.urls = getSafeList(urls); } private <T> List<T> getSafeList(List<T> entities) { // Entities may be null if Gson does not find object to parse. When that happens, make // sure to return an empty list. if (entities == null) { return Collections.EMPTY_LIST; } else { return Collections.unmodifiableList(entities); } } } }
{ "content_hash": "3e009d32bd95226a79583ebffad45a40", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 98, "avg_line_length": 26.23913043478261, "alnum_prop": 0.6371168185584093, "repo_name": "rcastro78/twitter-kit-android", "id": "1cfc577cf62203ee0adf009331655ce030f3a1f9", "size": "1811", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "twitter-core/src/main/java/com/twitter/sdk/android/core/models/UserEntities.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "1342756" } ], "symlink_target": "" }
license: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --- Getting Started Guides ====================== - Getting Started with Android - Getting Started with Blackberry - Getting Started with iOS - Getting Started with Symbian - Getting Started with WebOS - Getting Started with Windows Phone - Getting Started with Windows 8 - Getting Started with Bada - Getting Started with Tizen
{ "content_hash": "43735ecdaed3c87c014d5682c122119a", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 69, "avg_line_length": 40.4, "alnum_prop": 0.7070957095709571, "repo_name": "maveriklko9719/Coffee-Spills", "id": "a4f87484e4fa532cefaee0166a076300453d44c0", "size": "1216", "binary": false, "copies": "8", "ref": "refs/heads/master", "path": "docs/en/2.2.0/guide/getting-started/index.md", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "10947" }, { "name": "JavaScript", "bytes": "2656" }, { "name": "Ruby", "bytes": "53938" }, { "name": "Shell", "bytes": "643" } ], "symlink_target": "" }
__author__ = 'adrian' from PyQt4 import QtGui from PyQt4 import QtCore from parking_app.UI.WarningConfirmationUI import WarningConfirmationUI import parking_app.Common as Common import random class SlotUI(QtGui.QWidget): def __init__(self): super(SlotUI, self).__init__() self.initUI() def initUI(self): vertical = QtGui.QVBoxLayout() # Vehicle ID self.btn_patente = QtGui.QPushButton('AAA-000',self) self.btn_patente.clicked.connect(self.withdraw_vehicle) self.lbl_vehicle = QtGui.QLabel(self) vertical.addWidget(self.lbl_vehicle) self.setLayout(vertical) color = QtGui.QColor(150, 150, 150) self.setBackgroundColor(color) self.btn_patente.setHidden(True) self.lbl_vehicle.setHidden(True) def withdraw_vehicle(self): print("Mostrar mensaje de confirmacion") def setBackgroundColor(self, color): self.setAutoFillBackground(True) p = self.palette() p.setColor(self.backgroundRole(), color) self.setPalette(p) def updateUI(self, vehicle_patent, vehicle_weight): self.lbl_vehicle.setHidden(False) self.btn_patente.setHidden(False) # Vehicle ID self.btn_patente.setText(vehicle_patent) # Current vehicle color = QtGui.QColor(100, 100, 255) vehicleName = '' if vehicle_weight == Common.Weights.veryLight.value: vehicleName = 'MotoSide.png' elif vehicle_weight == Common.Weights.light.value: vehicleName = 'CarSide.png' elif vehicle_weight == Common.Weights.heavy.value: vehicleName = 'AutoTruckSide.png' elif vehicle_weight == Common.Weights.veryHeavy.value: vehicleName = 'TrukSide.png' elif vehicle_weight == Common.Weights.empty.value: color = QtGui.QColor(150, 150, 150) self.lbl_vehicle.setHidden(False) self.btn_patente.setHidden(False) pixmap2 = QtGui.QPixmap(vehicleName) pixmap2 = pixmap2.scaled(40, 40, QtCore.Qt.KeepAspectRatio) self.lbl_vehicle.setPixmap(pixmap2) self.setBackgroundColor(color)
{ "content_hash": "0ad7acf9de53f783d110df4055b828a4", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 70, "avg_line_length": 27.234567901234566, "alnum_prop": 0.642792384406165, "repo_name": "Nebla/cylindricalParkingPrototype", "id": "644f5de4bedcf8eb3d60142e804d81e1ec721687", "size": "2206", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "parking_app/UI/SlotUI.py", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "26725" }, { "name": "C++", "bytes": "629" }, { "name": "Objective-C", "bytes": "541653" }, { "name": "Python", "bytes": "68099" }, { "name": "Ruby", "bytes": "80" }, { "name": "Shell", "bytes": "3626" } ], "symlink_target": "" }
title: Adventhåbet omsat i praksis date: 07/09/2019 --- > <p>Ugens vers</p> > ”Derfor, mine kære brødre, stå urokkeligt fast, og giv jer helt hen i arbejdet for Herren. I ved jo, at jeres slid ikke er spildt i Herren“ (1 Kor 15,58). **Introduktion** Jesus forkyndte Guds rige som en nuværende realitet, som vi kan være en del af i dag. Han udsendte sine disciple for at vise, hvordan Guds rige er. De skulle forkynde evangeliet og tjene andre; altså give for intet, hvad de havde fået for intet (se Matt 10,5-8). Men Jesus gjorde det også klart, at hans rige var en anden slags rige, som ikke er ”af denne verden“ (Joh 18,36), og som endnu ikke til fulde er kommet. Ved Jesu inkarnation, tjeneste, død og opstandelse blev Guds rige indledt; men Jesus så også frem til den tid, hvor hans rige helt og fuldt skulle erstatte denne verdens riger og Guds herredømme ville blive fuldendt. Per definition er adventister – de, som venter på Guds riges komme – et håbets folk. Men dette håb handler ikke kun om en fremtidig, ny verden. Mens håb ser frem mod fremtiden, forvandler det nutiden. Med et sådant håb lever vi i nutiden på den måde, vi forventer at leve i fremtiden, og vi begynder at arbejde på at gøre en forskel i verden nu på måder, der passer med vores opfattelse af, hvordan verden en dag kommer til at se ud. **Ugens tekster** - Luk 18,1-8 - Matt 24-25 - 1 Kor 15,12-19 - Præd 8,14; 12,13-14 - Åb 21,1-5; 22,1-5
{ "content_hash": "5640d8c8af49771cace2937f57848b86", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 433, "avg_line_length": 64.9090909090909, "alnum_prop": 0.7492997198879552, "repo_name": "imasaru/sabbath-school-lessons", "id": "611d4fc68610fe6e5125c4a8c70f607aa5aaa50e", "size": "1471", "binary": false, "copies": "3", "ref": "refs/heads/stage", "path": "src/da/2019-03/11/01.md", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "160533" }, { "name": "HTML", "bytes": "20725" }, { "name": "JavaScript", "bytes": "54661" } ], "symlink_target": "" }
package com.asakusafw.lang.compiler.analyzer.mock; import com.asakusafw.vocabulary.batch.Batch; import com.asakusafw.vocabulary.batch.BatchDescription; @SuppressWarnings("javadoc") @Batch(name = "BatchWithDuplicateJobflow") public class BatchWithDuplicateJobflow extends BatchDescription { @Override protected void describe() { run(MockJobflow.class).soon(); run(MockJobflow.class).soon(); } }
{ "content_hash": "bc8c5bd5cd5818710f88bd04486d050a", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 65, "avg_line_length": 26.625, "alnum_prop": 0.7535211267605634, "repo_name": "asakusafw/asakusafw-compiler", "id": "3710646b2e6871144cbe816496f1323e2cb1e2e5", "size": "1038", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "compiler-project/analyzer/src/test/java/com/asakusafw/lang/compiler/analyzer/mock/BatchWithDuplicateJobflow.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Groovy", "bytes": "67219" }, { "name": "Java", "bytes": "6520625" }, { "name": "Shell", "bytes": "1081" } ], "symlink_target": "" }
<div class="container" ng-controller="HeaderController"> <div class="navbar-header"> <button class="navbar-toggle" type="button" ng-click="toggleCollapsibleMenu()"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a ui-sref="home" class="navbar-brand">Hour Monitor</a> </div> <nav class="collapse navbar-collapse" collapse="!isCollapsed" role="navigation"> <ul class="nav navbar-nav" ng-if="menu.shouldRender(authentication.user);"> <li ng-repeat="item in menu.items | orderBy: 'position'" ng-if="item.shouldRender(authentication.user);" ng-switch="item.type" ng-class="{ active: $state.includes(item.state), dropdown: item.type === 'dropdown' }" class="{{item.class}}" dropdown="item.type === 'dropdown'"> <a ng-switch-when="dropdown" class="dropdown-toggle" dropdown-toggle role="button">{{::item.title}}&nbsp;<span class="caret"></span></a> <ul ng-switch-when="dropdown" class="dropdown-menu"> <li ng-repeat="subitem in item.items | orderBy: 'position'" ng-if="subitem.shouldRender(authentication.user);" ui-sref-active="active"> <a ui-sref="{{subitem.state}}" ng-bind="subitem.title"></a> </li> </ul> <a ng-switch-default ui-sref="{{item.state}}" ng-bind="item.title"></a> </li> </ul> <ul class="nav navbar-nav navbar-right" ng-hide="authentication.user"> <li ui-sref-active="active"> <a ui-sref="authentication.signup">Sign Up</a> </li> <li class="divider-vertical"></li> <li ui-sref-active="active"> <a ui-sref="authentication.signin">Sign In</a> </li> </ul> <ul class="nav navbar-nav navbar-right" ng-show="authentication.user"> <li class="dropdown" dropdown> <a class="dropdown-toggle user-header-dropdown-toggle" dropdown-toggle role="button"> <img ng-src="{{authentication.user.profileImageURL}}" alt="{{authentication.user.displayName}}" class="header-profile-image" /> <span ng-bind="authentication.user.displayName"></span> <b class="caret"></b> </a> <ul class="dropdown-menu" role="menu"> <li ui-sref-active="active"> <a ui-sref="settings.profile">Edit Profile</a> </li> <li ui-sref-active="active"> <a ui-sref="settings.picture">Change Profile Picture</a> </li> <li ui-sref-active="active" ng-show="authentication.user.provider === 'local'"> <a ui-sref="settings.password">Change Password</a> </li> <li ui-sref-active="active"> <a ui-sref="settings.accounts">Manage Social Accounts</a> </li> <li class="divider"></li> <li> <a href="/api/auth/signout" target="_self">Signout</a> </li> </ul> </li> </ul> </nav> </div>
{ "content_hash": "7e50e351347a26ee1a23a13bd775ac6f", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 279, "avg_line_length": 50.11864406779661, "alnum_prop": 0.6016232668244843, "repo_name": "rassweiler/HourMonitor-MEAN", "id": "a34d92883dfb6c86812daa3dede9f22a1a6b6bd1", "size": "2957", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "modules/core/client/views/header.client.view.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "1220" }, { "name": "HTML", "bytes": "42958" }, { "name": "JavaScript", "bytes": "333640" }, { "name": "Shell", "bytes": "685" } ], "symlink_target": "" }
<HTML> <!-- Copyright (c) Jeremy Siek 2000 Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) --> <Head> <Title>AdjacencyMatrix</Title> <BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b" ALINK="#ff0000"> <IMG SRC="../../../boost.png" ALT="C++ Boost" width="277" height="86"> <BR Clear> <H2><A NAME="concept:AdjacencyMatrix"></A> AdjacencyMatrix </H2> <P> The AdjacencyMatrix concept refines <a href="./Graph.html">Graph</a> concept and adds the requirement for efficient access to any edge in the graph given the source and target vertices. No Boost Graph Library algorithms currently use this concept. However there are algorithms not yet implemented such as Floyd-Warshall that would require this concept. <H3>Refinement of</H3> <a href="./Graph.html">Graph</a> <H3>Associated Types</H3> <Table border> <tr> <td><tt>boost::graph_traits&lt;G&gt;::traversal_category</tt><br><br> This tag type must be convertible to <tt>adjacency_matrix_tag</tt>. </td> </tr> </table> <H3>Valid Expressions</H3> <table border> <tr> <th>Name</th><th>Expression</th><th>Return Type</th><th>Description</th> </tr> <tr> <td>Direct Edge Access</td> <TD><TT>edge(u,v,g)</TT></TD> <TD><TT>std::pair&lt;edge_descriptor, bool&gt;</TT></TD> <TD> Returns a pair consisting of a flag saying whether there exists an edge between <TT>u</TT> and <TT>v</TT> in graph <TT>g</TT>, and consisting of the edge descriptor if the edge was found. </TD> </TR> </TABLE> <H3>Complexity guarantees</H3> The <TT>edge()</TT> function must return in constant time. <H3>Models</H3> <a href="./adjacency_matrix.html"><tt>adjacency_matrix</tt></a> <H3>Concept Checking Class</H3> <PRE> template &lt;class G&gt; struct AdjacencyMatrix { typedef typename boost::graph_traits&lt;G&gt;::edge_descriptor edge_descriptor; void constraints() { p = edge(u, v, g); } typename boost::graph_traits&lt;G&gt;::vertex_descriptor u, v; std::pair&lt;bool, edge_descriptor&gt; p; G g; }; </PRE> <br> <HR> <TABLE> <TR valign=top> <TD nowrap>Copyright &copy; 2000-2001</TD><TD> <A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>, Indiana University (<A HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>) </TD></TR></TABLE> </BODY> </HTML>
{ "content_hash": "9b4db278838a18ff94b621e849695072", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 146, "avg_line_length": 24.45631067961165, "alnum_prop": 0.647479158396189, "repo_name": "Franky666/programmiersprachen-raytracer", "id": "7fcd0ceafc800e1347fb65ff8a0315a1410626df", "size": "2519", "binary": false, "copies": "10", "ref": "refs/heads/master", "path": "external/boost_1_59_0/libs/graph/doc/AdjacencyMatrix.html", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "905071" }, { "name": "C++", "bytes": "46207" }, { "name": "CMake", "bytes": "4419" } ], "symlink_target": "" }
Create a solution file to contain the projects created in the labs. *-n spcifies the name of the solution file, -o specifies the folder name to create the content. ``` bash dotnet new sln -n ConferencePlanner -o ConferencePlanner ``` Create the new angular application in the **ConferencePlanner** directory ``` bash dotnet new angular -n FrontEnd -o ConferencePlanner/FrontEnd ``` Finally, add the **FrontEnd** app to the sln. ``` bash cd ConferencePlanner dotnet sln add FrontEnd/FrontEnd.csproj ``` ## Option #2: Using Visual Studio 1. Create a new project using File / New / ASP.NET Core Web Application. Select the Angular template, No Auth, no Docker support. ![new project](images/new-project.png) ![new angular project](images/new-angular-project.png) 1. Add a new `Models` folder to the root of the application. 1. Add a new `Speaker` class using the following code: ```csharp using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Threading.Tasks; namespace FrontEnd.Models { public class Speaker { public int ID { get; set; } [Required] [StringLength(200)] public string Name { get; set; } [StringLength(4000)] public string Bio { get; set; } [StringLength(1000)] public virtual string WebSite { get; set; } } } ``` 1. Next we'll create a new Entity Framework DbContext. Create a new `ApplicationDbContext` class in the `Models` folder using the following code: ```csharp using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Design; using Microsoft.Extensions.DependencyInjection; namespace FrontEnd.Models { public class ApplicationDbContext : DbContext { public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options) : base(options) { } public DbSet<Speaker> Speaker { get; set; } } public class ApplicationDbContextFactory : IDesignTimeDbContextFactory<ApplicationDbContext> { public ApplicationDbContext CreateDbContext(string[] args) => Program.CreateWebHostBuilder(args).Build().Services.CreateScope().ServiceProvider.GetRequiredService<ApplicationDbContext>(); } } ``` 1. Add a connection string to the appSettings.json file for this database: ```json { "ConnectionStrings": { "DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=aspnet-FrontEnd-931E56BD-86CB-4A96-BD99-2C6A6ABB0829;Trusted_Connection=True;MultipleActiveResultSets=true" }, "Logging": { "IncludeScopes": false, "LogLevel": { "Default": "Warning" } } } ``` ## Register the DB Context Service 1. Add the following code to the top of the `ConfigureServices()` method in `Startup.cs`: ```csharp services.AddDbContext<ApplicationDbContext>(options => { if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")); } else { options.UseSqlite("Data Source=conferences.db"); } }); ``` >This code registers the `ApplicationDbContext` service so it can be injected into controllers. Additionally, it configures operating system specific database technologies and connection strings. ## Configuring EF Migrations 1. Open a command prompt and navigate to the project directory. (The directory containing the `.csproj` file). 1. Run the following commands in the command prompt: ```console dotnet restore dotnet ef migrations add Initial dotnet ef database update ``` >For more information on these commands and scaffolding in general, see [this tutorial](https://docs.microsoft.com/en-us/aspnet/core/tutorials/first-mvc-app/adding-model#add-initial-migration-and-update-the-database). ## A quick look at the Sample Data Controller First, open the `Controllers` folder and take a quick look at the `SampleDataController`. This controller has a `WeatherForecasts` method that responds to GET requests. The weather forecast data from this endpoint is displayed on the "Fetch data" page of the Angular app. You'll see the output of this controller in a bit, but first we'll build our own API controller for the `Speakers` model class. ## Scaffolding an API Controller ### Using Visual Studio 1. Right-click the `Controllers` folder and select Add/Controller. You'll be shown a prompt for setting up Scaffolding. Select "Minimal Dependencies". 1. Again, right-click the `Controllers` folder and select Add/Controller. Select "API Controller with Actions, Using EF". 1. In the dialog, select the `Speaker` model for the Model Class, `ApplicationDbContext` for the "Data Context Class" and click the `Add` button. ![scaffold api controller](images/scaffold-api-controller.png) ### Using the cmd line 1. Edit the project file to add a reference to the `Microsoft.VisualStudio.Web.CodeGeneration.Design` package: ```xml <ItemGroup> <PackageReference Include="Microsoft.AspNetCore.App" /> <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.0.0" /> </ItemGroup> ``` 1. Run `dotnet restore` in the project folder at the cmd line 1. Run the following in the project folder at the cmd line: ``` bash dotnet aspnet-codegenerator controller -name SpeakersController -namespace FrontEnd.Controllers -m FrontEnd.Models.Speaker -dc FrontEnd.Models.ApplicationDbContext -api -outDir Controllers ``` ## Testing the API using the Swashbuckle In this section, we'll be adding documentation to our API using the Swashbuckle NuGet package. *Swashbuckle.AspNetCore* is an open source project for generating Swagger documents for Web APIs that are built with ASP.NET Core MVC. Swagger (now called the OpenAPI specification) is a machine readable representation of a RESTful API that enables support for interactive documentation, client SDK generation and discoverability. Additional information on using Swashbuckle in ASP.NET Core is available in this tutorial: [ASP.NET Web API Help Pages using Swagger](https://docs.microsoft.com/en-us/aspnet/core/tutorials/web-api-help-pages-using-swagger?WT.mc_id=workshop-github-shboyer) 1. Add the `Swashbuckle.AspNetCore` NuGet package. > This can be done from the command line using `dotnet add package Swashbuckle.AspNetCore` 1. Register Swashbuckle as a service by adding the following in the the `ConfigureServices()` method in `Startup.cs`: ```csharp services.AddSwaggerGen(options => options.SwaggerDoc("v1", new Info { Title = "Conference Planner API", Version = "v1" }) ); ``` 1. Configure Swashbuckle by adding the following lines to top of the `Configure()` method in `Startup.cs`: ```csharp app.UseSwagger(); app.UseSwaggerUI(options => options.SwaggerEndpoint("/swagger/v1/swagger.json", "Conference Planner API v1") ); ``` 1. Run the application (F5 in Visual Studio or `dotnet run` from console). 1. Browse to the Swagger UI at `http://localhost:<random_port>/swagger`. ![swagger for speakers](images/swagger-speakers.png) 1. First, click on the *GET* button in *SampleData* section and then click *Try it out!*. You'll see the weather forecast data from the `SampleDataController`. 1. In the *Speakers* section, click on the *GET* button. You'll see there are not speakers returned. Let's add one! 1. In the *Speakers* section, click on the *POST* button. Referencing the example on the right, fill in a speaker request. Leave the `ID` blank, that will be filled in by the database. ![create speaker](images/swagger-create-speaker.png) 1. When you click the *Try it out!* button, you should see a success response from the server. Now, clicking the *GET* button above should show your newly added speaker. ![swagger results](images/swagger-create-results.png)
{ "content_hash": "8e9a1036d55c5c73e10f4da4cb01a657", "timestamp": "", "source": "github", "line_count": 190, "max_line_length": 399, "avg_line_length": 43.18421052631579, "alnum_prop": 0.7127361365021329, "repo_name": "spboyer/angular-aspnetcore-workshop", "id": "a31341fa617548cf3b4aeb212d9dc711fef04757", "size": "8274", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/Labs/1-Create-Angular-WebAPI-Project.md", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "69659" }, { "name": "CSS", "bytes": "1436" }, { "name": "HTML", "bytes": "6693" }, { "name": "JavaScript", "bytes": "8402" }, { "name": "TypeScript", "bytes": "14318" } ], "symlink_target": "" }
using System; using UIKit; namespace Bitrise.iOS { public partial class ViewController : UIViewController { int count = 1; public ViewController (IntPtr handle) : base(handle) { } public override void ViewDidLoad () { base.ViewDidLoad(); // Perform any additional setup after loading the view, typically from a nib. Button.AccessibilityIdentifier = "myButton"; Button.TouchUpInside += delegate { var title = string.Format("{0} clicks!", count++); Button.SetTitle(title, UIControlState.Normal); }; } public override void DidReceiveMemoryWarning () { base.DidReceiveMemoryWarning(); // Release any cached data, images, etc that aren't in use. } } }
{ "content_hash": "488c4988dceb65a26100b1aa4255af34", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 80, "avg_line_length": 21.696969696969695, "alnum_prop": 0.6843575418994413, "repo_name": "colbylwilliams/Bitrise", "id": "7b33dbbded57f48321314e164fe18863b13ae13d", "size": "718", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "iOS/ViewController.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "6136" } ], "symlink_target": "" }